vendor: 4,635 bytes, line 1
1var oB=Object.defineProperty;var aB=(t,e,r)=>e in t?oB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var ot=(t,e,r)=>(aB(t,typeof e!="symbol"?e+"":e,r),r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function $e(){}function Ef(t,e){for(const r in e)t[r]=e[r];return t}function cB(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function h7(t){return t()}function C8(){return Object.create(null)}function co(t){t.forEach(h7)}function i5(t){return typeof t=="function"}function Ct(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let dg;function p7(t,e){return dg||(dg=document.createElement("a")),dg.href=e,t===dg.href}function lB(t){return Object.keys(t).length===0}function g7(t,...e){if(t==null)return $e;const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function Qu(t,e,r){t.$$.on_destroy.push(g7(e,r))}function Ya(t,e,r,n){if(t){const i=m7(t,e,r,n);return t[0](i)}}function m7(t,e,r,n){return t[1]&&n?Ef(r.ctx.slice(),t[1](n(e))):r.ctx}function Qa(t,e,r,n){if(t[2]&&n){const i=t[2](n(r));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],o=Math.max(e.dirty.length,i.length);for(let a=0;a<o;a+=1)s[a]=e.dirty[a]|i[a];return s}return e.dirty|i}return e.dirty}function ec(t,e,r,n,i,s){if(i){const o=m7(e,r,n,s);t.p(o,i)}}function tc(t){if(t.ctx.length>32){const e=[],r=t.ctx.length/32;for(let n=0;n<r;n++)e[n]=-1;return e}return-1}function Vw(t){const e={};for(const r in t)r[0]!=="$"&&(e[r]=t[r]);return e}function S8(t,e){const r={};e=new Set(e);for(const n in t)!e.has(n)&&n[0]!=="$"&&(r[n]=t[n]);return r}function L(t,e){t.appendChild(e)}function ee(t,e,r){t.insertBefore(e,r||null)}function Q(t){t.parentNode&&t.parentNode.removeChild(t)}function hu(t,e){for(let r=0;r<t.length;r+=1)t[r]&&t[r].d(e)}function J(t){return document.createElement(t)}function pe(t){return document.createTextNode(t)}function Y(){return pe(" ")}function ti(){return pe("")}function Tr(t,e,r,n){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r,n)}function W(t,e,r){r==null?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}const uB=["width","height"];function T8(t,e){const r=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:r[n]&&r[n].set&&uB.indexOf(n)===-1?t[n]=e[n]:W(t,n,e[n])}function fB(t){return Array.from(t.childNodes)}function lt(t,e){e=""+e,t.data!==e&&(t.data=e)}function Ir(t,e){t.value=e??""}function On(t,e,r,n){r==null?t.style.removeProperty(e):t.style.setProperty(e,r,n?"important":"")}function an(t,e,r){t.classList[r?"add":"remove"](e)}function dB(t,e,{bubbles:r=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,r,n,e),i}function N8(t,e){return new t(e)}let dp;function Pc(t){dp=t}function Bh(){if(!dp)throw new Error("Function called outside component initialization");return dp}function sy(t){Bh().$$.on_mount.push(t)}function s5(t){Bh().$$.on_destroy.push(t)}function hB(){const t=Bh();return(e,r,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=dB(e,r,{cancelable:n});return i.slice().forEach(o=>{o.call(t,s)}),!s.defaultPrevented}return!0}}function _2(t,e){return Bh().$$.context.set(t,e),e}function Hd(t){return Bh().$$.context.get(t)}function pB(t,e){const r=t.$$.callbacks[e.type];r&&r.slice().forEach(n=>n.call(this,e))}const Sd=[],Mr=[];let jd=[];const Ww=[],gB=Promise.resolve();let Kw=!1;function mB(){Kw||(Kw=!0,gB.then(o5))}function Xw(t){jd.push(t)}function Gr(t){Ww.push(t)}const C2=new Set;let id=0;function o5(){if(id!==0)return;const t=dp;do{try{for(;id<Sd.length;){const e=Sd[id];id++,Pc(e),bB(e.$$)}}catch(e){throw Sd.length=0,id=0,e}for(Pc(null),Sd.length=0,id=0;Mr.length;)Mr.pop()();for(let e=0;e<jd.length;e+=1){const r=jd[e];C2.has(r)||(C2.add(r),r())}jd.length=0}while(Sd.length);for(;Ww.length;)Ww.pop()();Kw=!1,C2.clear(),Pc(t)}
1function bB(t){if(t.fragment!==null){t.update(),co(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(Xw)}}function yB(t){const e=[],r=[];jd.forEach(n=>t.indexOf(n)===-1?e.push(n):r.push(n)),r.forEach(n=>n()),jd=e}const pm=new Set;let ef;function _r(){ef={r:0,c:[],p:ef}}function Cr(){ef.r||co(ef.c),ef=ef.p}function te(t,e){t&&t.i&&(pm.delete(t),t.i(e))}function ne(t,e,r,n){if(t&&t.o){if(pm.has(t))return;pm.add(t),ef.c.push(()=>{pm.delete(t),n&&(r&&t.d(1),n())}),t.o(e)}else n&&n()}function I8(t,e){const r=e.token={};function n(i,s,o,a){if(e.token!==r)return;e.resolved=a;let c=e.ctx;o!==void 0&&(c=c.slice(),c[o]=a);const l=i&&(e.current=i)(c);let u=!1;e.block&&(e.blocks?e.blocks.forEach((f,d)=>{d!==s&&f&&(_r(),ne(f,1,1,()=>{e.blocks[d]===f&&(e.blocks[d]=null)}),Cr())}):e.block.d(1),l.c(),te(l,1),l.m(e.mount(),e.anchor),u=!0),e.block=l,e.blocks&&(e.blocks[s]=l),u&&o5()}if(cB(t)){const i=Bh();if(t.then(s=>{Pc(i),n(e.then,1,e.value,s),Pc(null)},s=>{if(Pc(i),n(e.catch,2,e.error,s),Pc(null),!e.hasCatch)throw s}),e.current!==e.pending)return n(e.pending,0),!0}else{if(e.current!==e.then)return n(e.then,1,e.value,t),!0;e.resolved=t}}function vB(t,e,r){const n=e.slice(),{resolved:i}=t;t.current===t.then&&(n[t.value]=i),t.current===t.catch&&(n[t.error]=i),t.block.p(n,r)}function b7(t,e){const r={},n={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],a=e[s];if(a){for(const c in o)c in a||(n[c]=1);for(const c in a)i[c]||(r[c]=a[c],i[c]=1);t[s]=a}else for(const c in o)i[c]=1}for(const o in n)o in r||(r[o]=void 0);return r}function x8(t){return typeof t=="object"&&t!==null?t:{}}function Vr(t,e,r){const n=t.$$.props[e];n!==void 0&&(t.$$.bound[n]=r,r(t.$$.ctx[n]))}function he(t){t&&t.c()}function fe(t,e,r,n){const{fragment:i,after_update:s}=t.$$;i&&i.m(e,r),n||Xw(()=>{const o=t.$$.on_mount.map(h7).filter(i5);t.$$.on_destroy?t.$$.on_destroy.push(...o):co(o),t.$$.on_mount=[]}),s.forEach(Xw)}function de(t,e){const r=t.$$;r.fragment!==null&&(yB(r.after_update),co(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])}function wB(t,e){t.$$.dirty[0]===-1&&(Sd.push(t),mB(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function xt(t,e,r,n,i,s,o,a=[-1]){const c=dp;Pc(t);const l=t.$$={fragment:null,ctx:[],props:s,update:$e,not_equal:i,bound:C8(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:C8(),dirty:a,skip_bound:!1,root:e.target||c.$$.root};o&&o(l.root);let u=!1;if(l.ctx=r?r(t,e.props||{},(f,d,...h)=>{const g=h.length?h[0]:d;return l.ctx&&i(l.ctx[f],l.ctx[f]=g)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](g),u&&wB(t,f)),d}):[],l.update(),u=!0,co(l.before_update),l.fragment=n?n(l.ctx):!1,e.target){if(e.hydrate){const f=fB(e.target);l.fragment&&l.fragment.l(f),f.forEach(Q)}else l.fragment&&l.fragment.c();e.intro&&te(t.$$.fragment),fe(t,e.target,e.anchor,e.customElement),o5()}Pc(c)}class Rt{$destroy(){de(this,1),this.$destroy=$e}$on(e,r){if(!i5(r))return $e;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!lB(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Zw={},qm={},y7={},v7=/^:(.+)/,R8=4,EB=3,AB=2,_B=1,CB=1,hp=t=>t.replace(/(^\/+|\/+$)/g,"").split("/"),S2=t=>t.replace(/(^\/+|\/+$)/g,""),SB=(t,e)=>{const r=t.default?0:hp(t.path).reduce((n,i)=>(n+=R8,i===""?n+=CB:v7.test(i)?n+=AB:i[0]==="*"?n-=R8+_B:n+=EB,n),0);return{route:t,score:r,index:e}},TB=t=>t.map(SB).sort((e,r)=>e.score<r.score?1:e.score>r.score?-1:e.index-r.index),P8=(t,e)=>{let r,n;const[i]=e.split("?"),s=hp(i),o=s[0]==="",a=TB(t);for(let c=0,l=a.length;c<l;c++){const u=a[c].route;let f=!1;if(u.default){n={route:u,params:{},uri:e};continue}const d=hp(u.path),h={},g=Math.max(s.length,d.length);let b=0;for(;b<g;b++){const w=d[b],x=s[b];if(w&&w[0]==="*"){const R=w==="*"?"*":w.slice(1);h[R]=s.slice(b).map(decodeURIComponent).join("/");break}if(typeof x>"u"){f=!0;break}const k=v7.exec(w);if(k&&!o){const R=decodeURIComponent(x);
1h[k[1]]=R}else if(w!==x){f=!0;break}}if(!f){r={route:u,params:h,uri:"/"+s.slice(0,b).join("/")};break}}return r||n||null},T2=(t,e)=>t+(e?`?${e}`:""),NB=(t,e)=>{if(t.startsWith("/"))return t;const[r,n]=t.split("?"),[i]=e.split("?"),s=hp(r),o=hp(i);if(s[0]==="")return T2(i,n);if(!s[0].startsWith(".")){const l=o.concat(s).join("/");return T2((i==="/"?"":"/")+l,n)}const a=o.concat(s),c=[];return a.forEach(l=>{l===".."?c.pop():l!=="."&&c.push(l)}),T2("/"+c.join("/"),n)},k8=(t,e)=>`${S2(e==="/"?t:`${S2(t)}/${S2(e)}`)}/`,IB=t=>!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey),w7=()=>typeof window<"u"&&"document"in window&&"location"in window,xB=t=>({active:t&4}),O8=t=>({active:!!t[2]});function RB(t){let e,r,n,i;const s=t[16].default,o=Ya(s,t,t[15],O8);let a=[{href:t[0]},{"aria-current":t[2]},t[1],t[6]],c={};for(let l=0;l<a.length;l+=1)c=Ef(c,a[l]);return{c(){e=J("a"),o&&o.c(),T8(e,c)},m(l,u){ee(l,e,u),o&&o.m(e,null),r=!0,n||(i=Tr(e,"click",t[5]),n=!0)},p(l,[u]){o&&o.p&&(!r||u&32772)&&ec(o,s,l,l[15],r?Qa(s,l[15],u,xB):tc(l[15]),O8),T8(e,c=b7(a,[(!r||u&1)&&{href:l[0]},(!r||u&4)&&{"aria-current":l[2]},u&2&&l[1],u&64&&l[6]]))},i(l){r||(te(o,l),r=!0)},o(l){ne(o,l),r=!1},d(l){l&&Q(e),o&&o.d(l),n=!1,i()}}}function PB(t,e,r){let n;const i=["to","replace","state","getProps"];let s=S8(e,i),o,a,{$$slots:c={},$$scope:l}=e,{to:u="#"}=e,{replace:f=!1}=e,{state:d={}}=e,{getProps:h=()=>({})}=e;const g=Hd(Zw);Qu(t,g,F=>r(13,o=F));const{base:b}=Hd(qm);Qu(t,b,F=>r(14,a=F));const{navigate:w}=Hd(y7),x=hB();let k,R,D,O;const M=F=>{if(x("click",F),IB(F)){F.preventDefault();const H=o.pathname===k||f;w(k,{state:d,replace:H})}};return t.$$set=F=>{e=Ef(Ef({},e),Vw(F)),r(6,s=S8(e,i)),"to"in F&&r(7,u=F.to),"replace"in F&&r(8,f=F.replace),"state"in F&&r(9,d=F.state),"getProps"in F&&r(10,h=F.getProps),"$$scope"in F&&r(15,l=F.$$scope)},t.$$.update=()=>{t.$$.dirty&16512&&r(0,k=u==="/"?a.uri:NB(u,a.uri)),t.$$.dirty&8193&&r(11,R=o.pathname.startsWith(k)),t.$$.dirty&8193&&r(12,D=k===o.pathname),t.$$.dirty&4096&&r(2,n=D?"page":void 0),r(1,O=h({location:o,href:k,isPartiallyCurrent:R,isCurrent:D,existingProps:s}))},[k,O,n,g,b,M,s,u,f,d,h,R,D,o,a,l,c]}class ah extends Rt{constructor(e){super(),xt(this,e,PB,RB,Ct,{to:7,replace:8,state:9,getProps:10})}}const kB=t=>({params:t&4}),M8=t=>({params:t[2]});function D8(t){let e,r,n,i;const s=[MB,OB],o=[];function a(c,l){return c[0]?0:1}return e=a(t),r=o[e]=s[e](t),{c(){r.c(),n=ti()},m(c,l){o[e].m(c,l),ee(c,n,l),i=!0},p(c,l){let u=e;e=a(c),e===u?o[e].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),r=o[e],r?r.p(c,l):(r=o[e]=s[e](c),r.c()),te(r,1),r.m(n.parentNode,n))},i(c){i||(te(r),i=!0)},o(c){ne(r),i=!1},d(c){o[e].d(c),c&&Q(n)}}}function OB(t){let e;const r=t[8].default,n=Ya(r,t,t[7],M8);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&132)&&ec(n,r,i,i[7],e?Qa(r,i[7],s,kB):tc(i[7]),M8)},i(i){e||(te(n,i),e=!0)},o(i){ne(n,i),e=!1},d(i){n&&n.d(i)}}}function MB(t){let e,r,n,i={ctx:t,current:null,token:null,hasCatch:!1,pending:FB,then:BB,catch:DB,value:12,blocks:[,,,]};return I8(r=t[0],i),{c(){e=ti(),i.block.c()},m(s,o){ee(s,e,o),i.block.m(s,i.anchor=o),i.mount=()=>e.parentNode,i.anchor=e,n=!0},p(s,o){t=s,i.ctx=t,o&1&&r!==(r=t[0])&&I8(r,i)||vB(i,t,o)},i(s){n||(te(i.block),n=!0)},o(s){for(let o=0;o<3;o+=1){const a=i.blocks[o];ne(a)}n=!1},d(s){s&&Q(e),i.block.d(s),i.token=null,i=null}}}function DB(t){return{c:$e,m:$e,p:$e,i:$e,o:$e,d:$e}}function BB(t){var a;let e,r,n;const i=[t[2],t[3]];var s=((a=t[12])==null?void 0:a.default)||t[12];function o(c){let l={};for(let u=0;u<i.length;u+=1)l=Ef(l,i[u]);return{props:l}}return s&&(e=N8(s,o())),{c(){e&&he(e.$$.fragment),r=ti()},m(c,l){e&&fe(e,c,l),ee(c,r,l),n=!0},p(c,l){var f;const u=l&12?b7(i,[l&4&&x8(c[2]),l&8&&x8(c[3])]):{};if(l&1&&s!==(s=((f=c[12])==null?void 0:f.default)||c[12])){if(e){_r();const d=e;ne(d.$$.fragment,1,0,()=>{de(d,1)}),Cr()}s?(e=N8(s,o()),he(e.$$.fragment),te(e.$$.fragment,1),fe(e,r.parentNode,r)):e=null}else s&&e.$set(u)},i(c){n||(e&&te(e.$$.fragment,c),n=!0)},o(c){e&&ne(e.$$.fragment,c),n=!1},d(c){c&&Q(r),e&&de(e,c)}}}function FB(t){return{c:$e,m:$e,p:$e,i:$e,o:$e,d:$e}}function $B(t){let e,r,n=t[1]&&t[1].route===t[5]&&D8(t);return{c(){n&&n.c(),e=ti()},m(i,s){n&&n.m(i,s),ee(i,e,s),r=!0},p(i,[s]){i[1]&&i[1].route===i[5]?n?(n.p(i,s),s&2&&te(n,1)):(n=D8(i),n.c(),te(n,1),n.m(e.parentNode,e)):n&&(_r(),ne(n,1,1,()=>{n=null}),Cr())},i(i){r||(te(n),r=!0)},o(i){ne(n),r=!1},d(i){n&&n.d(i),i&&Q(e)}}}
1function LB(t,e,r){let n,{$$slots:i={},$$scope:s}=e,{path:o=""}=e,{component:a=null}=e,c={},l={};const{registerRoute:u,unregisterRoute:f,activeRoute:d}=Hd(qm);Qu(t,d,g=>r(1,n=g));const h={path:o,default:o===""};return u(h),s5(()=>{f(h)}),t.$$set=g=>{r(11,e=Ef(Ef({},e),Vw(g))),"path"in g&&r(6,o=g.path),"component"in g&&r(0,a=g.component),"$$scope"in g&&r(7,s=g.$$scope)},t.$$.update=()=>{if(n&&n.route===h){r(2,c=n.params);const{component:g,path:b,...w}=e;r(3,l=w),g&&(g.toString().startsWith("class ")?r(0,a=g):r(0,a=g())),w7()&&(window==null||window.scrollTo(0,0))}},e=Vw(e),[a,n,c,l,d,h,o,s,i]}class nl extends Rt{constructor(e){super(),xt(this,e,LB,$B,Ct,{path:6,component:0})}}const sd=[];function UB(t,e){return{subscribe:O0(t,e).subscribe}}function O0(t,e=$e){let r;const n=new Set;function i(a){if(Ct(t,a)&&(t=a,r)){const c=!sd.length;for(const l of n)l[1](),sd.push(l,t);if(c){for(let l=0;l<sd.length;l+=2)sd[l][0](sd[l+1]);sd.length=0}}}function s(a){i(a(t))}function o(a,c=$e){const l=[a,c];return n.add(l),n.size===1&&(r=e(i)||$e),a(t),()=>{n.delete(l),n.size===0&&r&&(r(),r=null)}}return{set:i,update:s,subscribe:o}}function HB(t,e,r){const n=!Array.isArray(t),i=n?[t]:t,s=e.length<2;return UB(r,o=>{let a=!1;const c=[];let l=0,u=$e;const f=()=>{if(l)return;u();const h=e(n?c[0]:c,o);s?o(h):u=i5(h)?h:$e},d=i.map((h,g)=>g7(h,b=>{c[g]=b,l&=~(1<<g),a&&f()},()=>{l|=1<<g}));return a=!0,f(),function(){co(d),u(),a=!1}})}const N2=t=>({...t.location,state:t.history.state,key:t.history.state&&t.history.state.key||"initial"}),jB=t=>{const e=[];let r=N2(t);return{get location(){return r},listen(n){e.push(n);const i=()=>{r=N2(t),n({location:r,action:"POP"})};return t.addEventListener("popstate",i),()=>{t.removeEventListener("popstate",i);const s=e.indexOf(n);e.splice(s,1)}},navigate(n,{state:i,replace:s=!1}={}){i={...i,key:Date.now()+""};try{s?t.history.replaceState(i,"",n):t.history.pushState(i,"",n)}catch{t.location[s?"replace":"assign"](n)}r=N2(t),e.forEach(o=>o({location:r,action:"PUSH"})),document.activeElement.blur()}}},zB=(t="/")=>{let e=0;const r=[{pathname:t,search:""}],n=[];return{get location(){return r[e]},addEventListener(i,s){},removeEventListener(i,s){},history:{get entries(){return r},get index(){return e},get state(){return n[e]},pushState(i,s,o){const[a,c=""]=o.split("?");e++,r.push({pathname:a,search:c}),n.push(i)},replaceState(i,s,o){const[a,c=""]=o.split("?");r[e]={pathname:a,search:c},n[e]=i}}}},E7=jB(w7()?window:zB()),{navigate:_1}=E7,JB=t=>({route:t&2,location:t&1}),B8=t=>({route:t[1]&&t[1].uri,location:t[0]});function qB(t){let e;const r=t[12].default,n=Ya(r,t,t[11],B8);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,[s]){n&&n.p&&(!e||s&2051)&&ec(n,r,i,i[11],e?Qa(r,i[11],s,JB):tc(i[11]),B8)},i(i){e||(te(n,i),e=!0)},o(i){ne(n,i),e=!1},d(i){n&&n.d(i)}}}function GB(t,e,r){let n,i,s,o,{$$slots:a={},$$scope:c}=e,{basepath:l="/"}=e,{url:u=null}=e,{history:f=E7}=e;_2(y7,f);const d=Hd(Zw),h=Hd(qm),g=O0([]);Qu(t,g,M=>r(9,i=M));const b=O0(null);Qu(t,b,M=>r(1,o=M));let w=!1;const x=d||O0(u?{pathname:u}:f.location);Qu(t,x,M=>r(0,n=M));const k=h?h.routerBase:O0({path:l,uri:l});Qu(t,k,M=>r(10,s=M));const R=HB([k,b],([M,F])=>{if(!F)return M;const{path:H}=M,{route:U,uri:G}=F;return{path:U.default?H:U.path.replace(/\*.*$/,""),uri:G}}),D=M=>{const{path:F}=s;let{path:H}=M;if(M._path=H,M.path=k8(F,H),typeof window>"u"){if(w)return;const U=P8([M],n.pathname);U&&(b.set(U),w=!0)}else g.update(U=>[...U,M])},O=M=>{g.update(F=>F.filter(H=>H!==M))};return d||(sy(()=>f.listen(F=>{x.set(F.location)})),_2(Zw,x)),_2(qm,{activeRoute:b,base:k,routerBase:R,registerRoute:D,unregisterRoute:O}),t.$$set=M=>{"basepath"in M&&r(6,l=M.basepath),"url"in M&&r(7,u=M.url),"history"in M&&r(8,f=M.history),"$$scope"in M&&r(11,c=M.$$scope)},t.$$.update=()=>{if(t.$$.dirty&1024){const{path:M}=s;g.update(F=>F.map(H=>Object.assign(H,{path:k8(M,H._path)})))}if(t.$$.dirty&513){const M=P8(i,n.pathname);b.set(M)}},[n,o,g,b,x,k,l,u,f,i,s,c,a]}class VB extends Rt{constructor(e){super(),xt(this,e,GB,qB,Ct,{basepath:6,url:7,history:8})}}function WB(t){let e;return{c(){e=J("div"),e.innerHTML=`<div class="svelte-rxhpry"></div> 2 <div class="svelte-rxhpry"></div> 3 <div class="svelte-rxhpry"></div> 4 <div class="svelte-rxhpry"></div>`,W(e,"class","lds-ring svelte-rxhpry")},m(r,n){ee(r,e,n)},p:$e,i:$e,o:$e,d(r){r&&Q(e)}}}class A7 extends Rt{constructor(e){super(),xt(this,e,null,WB,Ct,{})}}function KB(t){let e,r,n;e=new A7({});let i=t[1]&&F8(t);return{c(){he(e.$$.fragment),i&&i.c(),r=ti()},m(s,o){fe(e,s,o),i&&i.m(s,o),ee(s,r,o),n=!0},p(s,o){s[1]?i?i.p(s,o):(i=F8(s),i.c(),i.m(r.parentNode,r)):i&&(i.d(1),i=null)},i(s){n||(te(e.$$.fragment,s),n=!0)},o(s){ne(e.$$.fragment,s),n=!1},d(s){de(e,s),i&&i.d(s),s&&Q(r)}}}function XB(t){let e;const r=t[9].default,n=Ya(r,t,t[8],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0}
4,p(i,s){n&&n.p&&(!e||s&256)&&ec(n,r,i,i[8],e?Qa(r,i[8],s,null):tc(i[8]),null)},i(i){e||(te(n,i),e=!0)},o(i){ne(n,i),e=!1},d(i){n&&n.d(i)}}}function F8(t){let e,r,n;return{c(){e=pe("Â Â Â Â "),r=J("span"),n=pe(t[1])},m(i,s){ee(i,e,s),ee(i,r,s),L(r,n)},p(i,s){s&2&<(n,i[1])},d(i){i&&Q(e),i&&Q(r)}}}function ZB(t){let e,r,n,i,s,o,a;const c=[XB,KB],l=[];function u(f,d){return f[4]?1:0}return r=u(t),n=l[r]=c[r](t),{c(){e=J("button"),n.c(),W(e,"class","btn svelte-ddgkom"),e.disabled=i=t[0]||t[4],an(e,"disabled",t[0]||t[4]),an(e,"outline",t[2]),an(e,"small",t[3])},m(f,d){ee(f,e,d),l[r].m(e,null),s=!0,o||(a=Tr(e,"click",t[5]),o=!0)},p(f,[d]){let h=r;r=u(f),r===h?l[r].p(f,d):(_r(),ne(l[h],1,1,()=>{l[h]=null}),Cr(),n=l[r],n?n.p(f,d):(n=l[r]=c[r](f),n.c()),te(n,1),n.m(e,null)),(!s||d&17&&i!==(i=f[0]||f[4]))&&(e.disabled=i),(!s||d&17)&&an(e,"disabled",f[0]||f[4]),(!s||d&4)&&an(e,"outline",f[2]),(!s||d&8)&&an(e,"small",f[3])},i(f){s||(te(n),s=!0)},o(f){ne(n),s=!1},d(f){f&&Q(e),l[r].d(),o=!1,a()}}}function YB(t,e,r){let{$$slots:n={},$$scope:i}=e,{disabled:s,comment:o,outline:a,href:c,small:l}=e,{on_click:u}=e,f=!1;async function d(){r(4,f=!0);try{c&&window.open(c,"_blank"),await u()}catch(h){console.log(h)}r(4,f=!1)}return t.$$set=h=>{"disabled"in h&&r(0,s=h.disabled),"comment"in h&&r(1,o=h.comment),"outline"in h&&r(2,a=h.outline),"href"in h&&r(6,c=h.href),"small"in h&&r(3,l=h.small),"on_click"in h&&r(7,u=h.on_click),"$$scope"in h&&r(8,i=h.$$scope)},[s,o,a,l,f,d,c,u,i,n]}class un extends Rt{constructor(e){super(),xt(this,e,YB,ZB,Ct,{disabled:0,comment:1,outline:2,href:6,small:3,on_click:7})}}var ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _7(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var a5={exports:{}};const QB={},eF=Object.freeze(Object.defineProperty({__proto__:null,default:QB},Symbol.toStringTag,{value:"Module"})),tF=_7(eF);a5.exports;(function(t){(function(e,r){function n(v,p){if(!v)throw new Error(p||"Assertion failed")}function i(v,p){v.super_=p;var m=function(){};m.prototype=p.prototype,v.prototype=new m,v.prototype.constructor=v}function s(v,p,m){if(s.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((p==="le"||p==="be")&&(m=p,p=10),this._init(v||0,p||10,m||"be"))}
vendor: 42,675 bytes, line 4
4typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=tF.Buffer}catch{}s.isBN=function(p){return p instanceof s?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===s.wordSize&&Array.isArray(p.words)},s.max=function(p,m){return p.cmp(m)>0?p:m},s.min=function(p,m){return p.cmp(m)<0?p:m},s.prototype._init=function(p,m,y){if(typeof p=="number")return this._initNumber(p,m,y);if(typeof p=="object")return this._initArray(p,m,y);m==="hex"&&(m=16),n(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var T=0;p[0]==="-"&&(T++,this.negative=1),T<p.length&&(m===16?this._parseHex(p,T,y):(this._parseBase(p,m,T),y==="le"&&this._initArray(this.toArray(),m,y)))},s.prototype._initNumber=function(p,m,y){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(n(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),m,y)},s.prototype._initArray=function(p,m,y){if(n(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var I,_,E=0;if(y==="be")for(T=p.length-1,I=0;T>=0;T-=3)_=p[T]|p[T-1]<<8|p[T-2]<<16,this.words[I]|=_<<E&67108863,this.words[I+1]=_>>>26-E&67108863,E+=24,E>=26&&(E-=26,I++);else if(y==="le")for(T=0,I=0;T<p.length;T+=3)_=p[T]|p[T+1]<<8|p[T+2]<<16,this.words[I]|=_<<E&67108863,this.words[I+1]=_>>>26-E&67108863,E+=24,E>=26&&(E-=26,I++);return this._strip()};function a(v,p){var m=v.charCodeAt(p);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;n(!1,"Invalid character in "+v)}function c(v,p,m){var y=a(v,m);return m-1>=p&&(y|=a(v,m-1)<<4),y}s.prototype._parseHex=function(p,m,y){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var T=0;T<this.length;T++)this.words[T]=0;var I=0,_=0,E;if(y==="be")for(T=p.length-1;T>=m;T-=2)E=c(p,m,T)<<I,this.words[_]|=E&67108863,I>=18?(I-=18,_+=1,this.words[_]|=E>>>26):I+=8;else{var C=p.length-m;for(T=C%2===0?m+1:m;T<p.length;T+=2)E=c(p,m,T)<<I,this.words[_]|=E&67108863,I>=18?(I-=18,_+=1,this.words[_]|=E>>>26):I+=8}this._strip()};function l(v,p,m,y){for(var T=0,I=0,_=Math.min(v.length,m),E=p;E<_;E++){var C=v.charCodeAt(E)-48;T*=y,C>=49?I=C-49+10:C>=17?I=C-17+10:I=C,n(C>=0&&I<y,"Invalid character"),T+=I}return T}s.prototype._parseBase=function(p,m,y){this.words=[0],this.length=1;for(var T=0,I=1;I<=67108863;I*=m)T++;T--,I=I/m|0;for(var _=p.length-y,E=_%T,C=Math.min(_,_-E)+y,S=0,B=y;B<C;B+=T)S=l(p,B,B+T,m),this.imuln(I),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S);if(E!==0){var $=1;for(S=l(p,B,p.length,m),B=0;B<E;B++)$*=m;this.imuln($),this.words[0]+S<67108864?this.words[0]+=S:this._iaddn(S)}this._strip()},s.prototype.copy=function(p){p.words=new Array(this.length);for(var m=0;m<this.length;m++)p.words[m]=this.words[m];p.length=this.length,p.negative=this.negative,p.red=this.red};function u(v,p){v.words=p.words,v.length=p.length,v.negative=p.negative,v.red=p.red}if(s.prototype._move=function(p){u(p,this)},s.prototype.clone=function(){var p=new s(null);return this.copy(p),p},s.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{s.prototype.inspect=f}else s.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(p,m){p=p||10,m=m|0||1;var y;if(p===16||p==="hex"){y="";for(var T=0,I=0,_=0;_<this.length;_++){var E=this.words[_],C=((E<<T|I)&16777215).toString(16);I=E>>>24-T&16777215,T+=2,T>=26&&(T-=26,_--),I!==0||_!==this.length-1?y=d[6-C.length]+C+y:y=C+y}for(I!==0&&(y=I.toString(16)+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(p===(p|0)&&p>=2&&p<=36){var S=h[p],B=g[p];y="";var $=this.clone();for($.negative=0;!$.isZero();){var P=$.modrn(B).toString(p);$=$.idivn(B),$.isZero()?y=P+y:y=d[S-P.length]+P+y}for(this.isZero()&&(y="0"+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(p,m){return this.toArrayLike(o,p,m)}),s.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)};var b=function(p,m){return p.allocUnsafe?p.allocUnsafe(m):new p(m)};s.prototype.toArrayLike=function(p,m,y){this._strip();var T=this.byteLength(),I=y||Math.max(1,T);n(T<=I,"byte array longer than desired length"),n(I>0,"Requested array length <= 0");var _=b(p,I),E=m==="le"?"LE":"BE";return this["_toArrayLike"+E](_,T),_},s.prototype._toArrayLikeLE=function(p,m){for(var y=0,T=0,I=0,_=0;I<this.length;I++){var E=this.words[I]<<_|T;p[y++]=E&255,y<p.length&&(p[y++]=E>>8&255),y<p.length&&(p[y++]=E>>16&255),_===6?(y<p.length&&(p[y++]=E>>24&255),T=0,_=0):(T=E>>>24,_+=2)}if(y<p.length)for(p[y++]=T;y<p.length;)p[y++]=0},s.prototype._toArrayLikeBE=function(p,m){for(var y=p.length-1,T=0,I=0,_=0;I<this.length;I++){var E=this.words[I]<<_|T;p[y--]=E&255,y>=0&&(p[y--]=E>>8&255),y>=0&&(p[y--]=E>>16&255),_===6?(y>=0&&(p[y--]=E>>24&255),T=0,_=0):(T=E>>>24,_+=2)}if(y>=0)for(p[y--]=T;y>=0;)p[y--]=0},Math.clz32?s.prototype._countBits=function(p){return 32-Math.clz32(p)}:s.prototype._countBits=function(p){var m=p,y=0;return m>=4096&&(y+=13,m>>>=13),m>=64&&(y+=7,m>>>=7),m>=8&&(y+=4,m>>>=4),m>=2&&(y+=2,m>>>=2),y+m},s.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,y=0;return m&8191||(y+=13,m>>>=13),m&127||(y+=7,m>>>=7),m&15||(y+=4,m>>>=4),m&3||(y+=2,m>>>=2),m&1||y++,y},s.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function w(v){for(var p=new Array(v.bitLength()),m=0;m<p.length;m++){var y=m/26|0,T=m%26;p[m]=v.words[y]>>>T&1}return p}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;m<this.length;m++){var y=this._zeroBits(this.words[m]);if(p+=y,y!==26)break}return p},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},s.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var m=0;m<p.length;m++)this.words[m]=this.words[m]|p.words[m];return this._strip()},s.prototype.ior=function(p){return n((this.negative|p.negative)===0),this.iuor(p)},s.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},s.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},s.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var y=0;y<m.length;y++)this.words[y]=this.words[y]&p.words[y];return this.length=m.length,this._strip()},s.prototype.iand=function(p){return n((this.negative|p.negative)===0),this.iuand(p)},s.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},s.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},s.prototype.iuxor=function(p){var m,y;this.length>p.length?(m=this,y=p):(m=p,y=this);for(var T=0;T<y.length;T++)this.words[T]=m.words[T]^y.words[T];if(this!==m)for(;T<m.length;T++)this.words[T]=m.words[T];return this.length=m.length,this._strip()},s.prototype.ixor=function(p){return n((this.negative|p.negative)===0),this.iuxor(p)},s.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},s.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},s.prototype.inotn=function(p){n(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,y=p%26;this._expand(m),y>0&&m--;for(var T=0;T<m;T++)this.words[T]=~this.words[T]&67108863;return y>0&&(this.words[T]=~this.words[T]&67108863>>26-y),this._strip()},s.prototype.notn=function(p){return this.clone().inotn(p)},s.prototype.setn=function(p,m){n(typeof p=="number"&&p>=0);var y=p/26|0,T=p%26;return this._expand(y+1),m?this.words[y]=this.words[y]|1<<T:this.words[y]=this.words[y]&~(1<<T),this._strip()},s.prototype.iadd=function(p){var m;if(this.negative!==0&&p.negative===0)return this.negative=0,m=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,m=this.isub(p),p.negative=1,m._normSign();var y,T;this.length>p.length?(y=this,T=p):(y=p,T=this);for(var I=0,_=0;_<T.length;_++)m=(y.words[_]|0)+(T.words[_]|0)+I,this.words[_]=m&67108863,I=m>>>26;for(;I!==0&&_<y.length;_++)m=(y.words[_]|0)+I,this.words[_]=m&67108863,I=m>>>26;if(this.length=y.length,I!==0)this.words[this.length]=I,this.length++;else if(y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this},s.prototype.add=function(p){var m;return p.negative!==0&&this.negative===0?(p.negative=0,m=this.sub(p),p.negative^=1,m):p.negative===0&&this.negative!==0?(this.negative=0,m=p.sub(this),this.negative=1,m):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},s.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var y=this.cmp(p);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var T,I;y>0?(T=this,I=p):(T=p,I=this);for(var _=0,E=0;E<I.length;E++)m=(T.words[E]|0)-(I.words[E]|0)+_,_=m>>26,this.words[E]=m&67108863;for(;_!==0&&E<T.length;E++)m=(T.words[E]|0)+_,_=m>>26,this.words[E]=m&67108863;if(_===0&&E<T.length&&T!==this)for(;E<T.length;E++)this.words[E]=T.words[E];return this.length=Math.max(this.length,E),T!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(p){return this.clone().isub(p)};function x(v,p,m){m.negative=p.negative^v.negative;var y=v.length+p.length|0;m.length=y,y=y-1|0;var T=v.words[0]|0,I=p.words[0]|0,_=T*I,E=_&67108863,C=_/67108864|0;m.words[0]=E;for(var S=1;S<y;S++){for(var B=C>>>26,$=C&67108863,P=Math.min(S,p.length-1),q=Math.max(0,S-v.length+1);q<=P;q++){var V=S-q|0;T=v.words[V]|0,I=p.words[q]|0,_=T*I+$,B+=_/67108864|0,$=_&67108863}m.words[S]=$|0,C=B|0}return C!==0?m.words[S]=C|0:m.length--,m._strip()}var k=function(p,m,y){var T=p.words,I=m.words,_=y.words,E=0,C,S,B,$=T[0]|0,P=$&8191,q=$>>>13,V=T[1]|0,X=V&8191,Z=V>>>13,ie=T[2]|0,ce=ie&8191,se=ie>>>13,_e=T[3]|0,ye=_e&8191,Te=_e>>>13,ht=T[4]|0,Ot=ht&8191,Ge=ht>>>13,$t=T[5]|0,Lt=$t&8191,Je=$t>>>13,Ut=T[6]|0,Ht=Ut&8191,qe=Ut>>>13,jt=T[7]|0,zt=jt&8191,Ve=jt>>>13,Vt=T[8]|0,Wt=Vt&8191,We=Vt>>>13,tr=T[9]|0,rr=tr&8191,Xe=tr>>>13,nr=I[0]|0,ir=nr&8191,Ze=nr>>>13,sr=I[1]|0,or=sr&8191,Ye=sr>>>13,ar=I[2]|0,cr=ar&8191,Qe=ar>>>13,lr=I[3]|0,ur=lr&8191,et=lr>>>13,fr=I[4]|0,dr=fr&8191,tt=fr>>>13,hr=I[5]|0,pr=hr&8191,rt=hr>>>13,gr=I[6]|0,mr=gr&8191,nt=gr>>>13,Fr=I[7]|0,$r=Fr&8191,ut=Fr>>>13,Lr=I[8]|0,Ur=Lr&8191,ft=Lr>>>13,Hr=I[9]|0,xr=Hr&8191,Rr=Hr>>>13;y.negative=p.negative^m.negative,y.length=19,C=Math.imul(P,ir),S=Math.imul(P,Ze),S=S+Math.imul(q,ir)|0,B=Math.imul(q,Ze);var Hs=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Hs>>>26)|0,Hs&=67108863,C=Math.imul(X,ir),S=Math.imul(X,Ze),S=S+Math.imul(Z,ir)|0,B=Math.imul(Z,Ze),C=C+Math.imul(P,or)|0,S=S+Math.imul(P,Ye)|0,S=S+Math.imul(q,or)|0,B=B+Math.imul(q,Ye)|0;var js=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(js>>>26)|0,js&=67108863,C=Math.imul(ce,ir),S=Math.imul(ce,Ze),S=S+Math.imul(se,ir)|0,B=Math.imul(se,Ze),C=C+Math.imul(X,or)|0,S=S+Math.imul(X,Ye)|0,S=S+Math.imul(Z,or)|0,B=B+Math.imul(Z,Ye)|0,C=C+Math.imul(P,cr)|0,S=S+Math.imul(P,Qe)|0,S=S+Math.imul(q,cr)|0,B=B+Math.imul(q,Qe)|0;var zs=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(zs>>>26)|0,zs&=67108863,C=Math.imul(ye,ir),S=Math.imul(ye,Ze),S=S+Math.imul(Te,ir)|0,B=Math.imul(Te,Ze),C=C+Math.imul(ce,or)|0,S=S+Math.imul(ce,Ye)|0,S=S+Math.imul(se,or)|0,B=B+Math.imul(se,Ye)|0,C=C+Math.imul(X,cr)|0,S=S+Math.imul(X,Qe)|0,S=S+Math.imul(Z,cr)|0,B=B+Math.imul(Z,Qe)|0,C=C+Math.imul(P,ur)|0,S=S+Math.imul(P,et)|0,S=S+Math.imul(q,ur)|0,B=B+Math.imul(q,et)|0;var Js=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Js>>>26)|0,Js&=67108863,C=Math.imul(Ot,ir),S=Math.imul(Ot,Ze),S=S+Math.imul(Ge,ir)|0,B=Math.imul(Ge,Ze),C=C+Math.imul(ye,or)|0,S=S+Math.imul(ye,Ye)|0,S=S+Math.imul(Te,or)|0,B=B+Math.imul(Te,Ye)|0,C=C+Math.imul(ce,cr)|0,S=S+Math.imul(ce,Qe)|0,S=S+Math.imul(se,cr)|0,B=B+Math.imul(se,Qe)|0,C=C+Math.imul(X,ur)|0,S=S+Math.imul(X,et)|0,S=S+Math.imul(Z,ur)|0,B=B+Math.imul(Z,et)|0,C=C+Math.imul(P,dr)|0,S=S+Math.imul(P,tt)|0,S=S+Math.imul(q,dr)|0,B=B+Math.imul(q,tt)|0;var qs=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(qs>>>26)|0,qs&=67108863,C=Math.imul(Lt,ir),S=Math.imul(Lt,Ze),S=S+Math.imul(Je,ir)|0,B=Math.imul(Je,Ze),C=C+Math.imul(Ot,or)|0,S=S+Math.imul(Ot,Ye)|0,S=S+Math.imul(Ge,or)|0,B=B+Math.imul(Ge,Ye)|0,C=C+Math.imul(ye,cr)|0,S=S+Math.imul(ye,Qe)|0,S=S+Math.imul(Te,cr)|0,B=B+Math.imul(Te,Qe)|0,C=C+Math.imul(ce,ur)|0,S=S+Math.imul(ce,et)|0,S=S+Math.imul(se,ur)|0,B=B+Math.imul(se,et)|0,C=C+Math.imul(X,dr)|0,S=S+Math.imul(X,tt)|0,S=S+Math.imul(Z,dr)|0,B=B+Math.imul(Z,tt)|0,C=C+Math.imul(P,pr)|0,S=S+Math.imul(P,rt)|0,S=S+Math.imul(q,pr)|0,B=B+Math.imul(q,rt)|0;var Au=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Au>>>26)|0,Au&=67108863,C=Math.imul(Ht,ir),S=Math.imul(Ht,Ze),S=S+Math.imul(qe,ir)|0,B=Math.imul(qe,Ze),C=C+Math.imul(Lt,or)|0,S=S+Math.imul(Lt,Ye)|0,S=S+Math.imul(Je,or)|0,B=B+Math.imul(Je,Ye)|0,C=C+Math.imul(Ot,cr)|0,S=S+Math.imul(Ot,Qe)|0,S=S+Math.imul(Ge,cr)|0,B=B+Math.imul(Ge,Qe)|0,C=C+Math.imul(ye,ur)|0,S=S+Math.imul(ye,et)|0,S=S+Math.imul(Te,ur)|0,B=B+Math.imul(Te,et)|0,C=C+Math.imul(ce,dr)|0,S=S+Math.imul(ce,tt)|0,S=S+Math.imul(se,dr)|0,B=B+Math.imul(se,tt)|0,C=C+Math.imul(X,pr)|0,S=S+Math.imul(X,rt)|0,S=S+Math.imul(Z,pr)|0,B=B+Math.imul(Z,rt)|0,C=C+Math.imul(P,mr)|0,S=S+Math.imul(P,nt)|0,S=S+Math.imul(q,mr)|0,B=B+Math.imul(q,nt)|0;var _u=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(_u>>>26)|0,_u&=67108863,C=Math.imul(zt,ir),S=Math.imul(zt,Ze),S=S+Math.imul(Ve,ir)|0,B=Math.imul(Ve,Ze),C=C+Math.imul(Ht,or)|0,S=S+Math.imul(Ht,Ye)|0,S=S+Math.imul(qe,or)|0,B=B+Math.imul(qe,Ye)|0,C=C+Math.imul(Lt,cr)|0,S=S+Math.imul(Lt,Qe)|0,S=S+Math.imul(Je,cr)|0,B=B+Math.imul(Je,Qe)|0,C=C+Math.imul(Ot,ur)|0,S=S+Math.imul(Ot,et)|0,S=S+Math.imul(Ge,ur)|0,B=B+Math.imul(Ge,et)|0,C=C+Math.imul(ye,dr)|0,S=S+Math.imul(ye,tt)|0,S=S+Math.imul(Te,dr)|0,B=B+Math.imul(Te,tt)|0,C=C+Math.imul(ce,pr)|0,S=S+Math.imul(ce,rt)|0,S=S+Math.imul(se,pr)|0,B=B+Math.imul(se,rt)|0,C=C+Math.imul(X,mr)|0,S=S+Math.imul(X,nt)|0,S=S+Math.imul(Z,mr)|0,B=B+Math.imul(Z,nt)|0,C=C+Math.imul(P,$r)|0,S=S+Math.imul(P,ut)|0,S=S+Math.imul(q,$r)|0,B=B+Math.imul(q,ut)|0;var Cu=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Cu>>>26)|0,Cu&=67108863,C=Math.imul(Wt,ir),S=Math.imul(Wt,Ze),S=S+Math.imul(We,ir)|0,B=Math.imul(We,Ze),C=C+Math.imul(zt,or)|0,S=S+Math.imul(zt,Ye)|0,S=S+Math.imul(Ve,or)|0,B=B+Math.imul(Ve,Ye)|0,C=C+Math.imul(Ht,cr)|0,S=S+Math.imul(Ht,Qe)|0,S=S+Math.imul(qe,cr)|0,B=B+Math.imul(qe,Qe)|0,C=C+Math.imul(Lt,ur)|0,S=S+Math.imul(Lt,et)|0,S=S+Math.imul(Je,ur)|0,B=B+Math.imul(Je,et)|0,C=C+Math.imul(Ot,dr)|0,S=S+Math.imul(Ot,tt)|0,S=S+Math.imul(Ge,dr)|0,B=B+Math.imul(Ge,tt)|0,C=C+Math.imul(ye,pr)|0,S=S+Math.imul(ye,rt)|0,S=S+Math.imul(Te,pr)|0,B=B+Math.imul(Te,rt)|0,C=C+Math.imul(ce,mr)|0,S=S+Math.imul(ce,nt)|0,S=S+Math.imul(se,mr)|0,B=B+Math.imul(se,nt)|0,C=C+Math.imul(X,$r)|0,S=S+Math.imul(X,ut)|0,S=S+Math.imul(Z,$r)|0,B=B+Math.imul(Z,ut)|0,C=C+Math.imul(P,Ur)|0,S=S+Math.imul(P,ft)|0,S=S+Math.imul(q,Ur)|0,B=B+Math.imul(q,ft)|0;var Su=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Su>>>26)|0,Su&=67108863,C=Math.imul(rr,ir),S=Math.imul(rr,Ze),S=S+Math.imul(Xe,ir)|0,B=Math.imul(Xe,Ze),C=C+Math.imul(Wt,or)|0,S=S+Math.imul(Wt,Ye)|0,S=S+Math.imul(We,or)|0,B=B+Math.imul(We,Ye)|0,C=C+Math.imul(zt,cr)|0,S=S+Math.imul(zt,Qe)|0,S=S+Math.imul(Ve,cr)|0,B=B+Math.imul(Ve,Qe)|0,C=C+Math.imul(Ht,ur)|0,S=S+Math.imul(Ht,et)|0,S=S+Math.imul(qe,ur)|0,B=B+Math.imul(qe,et)|0,C=C+Math.imul(Lt,dr)|0,S=S+Math.imul(Lt,tt)|0,S=S+Math.imul(Je,dr)|0,B=B+Math.imul(Je,tt)|0,C=C+Math.imul(Ot,pr)|0,S=S+Math.imul(Ot,rt)|0,S=S+Math.imul(Ge,pr)|0,B=B+Math.imul(Ge,rt)|0,C=C+Math.imul(ye,mr)|0,S=S+Math.imul(ye,nt)|0,S=S+Math.imul(Te,mr)|0,B=B+Math.imul(Te,nt)|0,C=C+Math.imul(ce,$r)|0,S=S+Math.imul(ce,ut)|0,S=S+Math.imul(se,$r)|0,B=B+Math.imul(se,ut)|0,C=C+Math.imul(X,Ur)|0,S=S+Math.imul(X,ft)|0,S=S+Math.imul(Z,Ur)|0,B=B+Math.imul(Z,ft)|0,C=C+Math.imul(P,xr)|0,S=S+Math.imul(P,Rr)|0,S=S+Math.imul(q,xr)|0,B=B+Math.imul(q,Rr)|0;var Tu=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Tu>>>26)|0,Tu&=67108863,C=Math.imul(rr,or),S=Math.imul(rr,Ye),S=S+Math.imul(Xe,or)|0,B=Math.imul(Xe,Ye),C=C+Math.imul(Wt,cr)|0,S=S+Math.imul(Wt,Qe)|0,S=S+Math.imul(We,cr)|0,B=B+Math.imul(We,Qe)|0,C=C+Math.imul(zt,ur)|0,S=S+Math.imul(zt,et)|0,S=S+Math.imul(Ve,ur)|0,B=B+Math.imul(Ve,et)|0,C=C+Math.imul(Ht,dr)|0,S=S+Math.imul(Ht,tt)|0,S=S+Math.imul(qe,dr)|0,B=B+Math.imul(qe,tt)|0,C=C+Math.imul(Lt,pr)|0,S=S+Math.imul(Lt,rt)|0,S=S+Math.imul(Je,pr)|0,B=B+Math.imul(Je,rt)|0,C=C+Math.imul(Ot,mr)|0,S=S+Math.imul(Ot,nt)|0,S=S+Math.imul(Ge,mr)|0,B=B+Math.imul(Ge,nt)|0,C=C+Math.imul(ye,$r)|0,S=S+Math.imul(ye,ut)|0,S=S+Math.imul(Te,$r)|0,B=B+Math.imul(Te,ut)|0,C=C+Math.imul(ce,Ur)|0,S=S+Math.imul(ce,ft)|0,S=S+Math.imul(se,Ur)|0,B=B+Math.imul(se,ft)|0,C=C+Math.imul(X,xr)|0,S=S+Math.imul(X,Rr)|0,S=S+Math.imul(Z,xr)|0,B=B+Math.imul(Z,Rr)|0;var Nu=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Nu>>>26)|0,Nu&=67108863,C=Math.imul(rr,cr),S=Math.imul(rr,Qe),S=S+Math.imul(Xe,cr)|0,B=Math.imul(Xe,Qe),C=C+Math.imul(Wt,ur)|0,S=S+Math.imul(Wt,et)|0,S=S+Math.imul(We,ur)|0,B=B+Math.imul(We,et)|0,C=C+Math.imul(zt,dr)|0,S=S+Math.imul(zt,tt)|0,S=S+Math.imul(Ve,dr)|0,B=B+Math.imul(Ve,tt)|0,C=C+Math.imul(Ht,pr)|0,S=S+Math.imul(Ht,rt)|0,S=S+Math.imul(qe,pr)|0,B=B+Math.imul(qe,rt)|0,C=C+Math.imul(Lt,mr)|0,S=S+Math.imul(Lt,nt)|0,S=S+Math.imul(Je,mr)|0,B=B+Math.imul(Je,nt)|0,C=C+Math.imul(Ot,$r)|0,S=S+Math.imul(Ot,ut)|0,S=S+Math.imul(Ge,$r)|0,B=B+Math.imul(Ge,ut)|0,C=C+Math.imul(ye,Ur)|0,S=S+Math.imul(ye,ft)|0,S=S+Math.imul(Te,Ur)|0,B=B+Math.imul(Te,ft)|0,C=C+Math.imul(ce,xr)|0,S=S+Math.imul(ce,Rr)|0,S=S+Math.imul(se,xr)|0,B=B+Math.imul(se,Rr)|0;var Iu=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Iu>>>26)|0,Iu&=67108863,C=Math.imul(rr,ur),S=Math.imul(rr,et),S=S+Math.imul(Xe,ur)|0,B=Math.imul(Xe,et),C=C+Math.imul(Wt,dr)|0,S=S+Math.imul(Wt,tt)|0,S=S+Math.imul(We,dr)|0,B=B+Math.imul(We,tt)|0,C=C+Math.imul(zt,pr)|0,S=S+Math.imul(zt,rt)|0,S=S+Math.imul(Ve,pr)|0,B=B+Math.imul(Ve,rt)|0,C=C+Math.imul(Ht,mr)|0,S=S+Math.imul(Ht,nt)|0,S=S+Math.imul(qe,mr)|0,B=B+Math.imul(qe,nt)|0,C=C+Math.imul(Lt,$r)|0,S=S+Math.imul(Lt,ut)|0,S=S+Math.imul(Je,$r)|0,B=B+Math.imul(Je,ut)|0,C=C+Math.imul(Ot,Ur)|0,S=S+Math.imul(Ot,ft)|0,S=S+Math.imul(Ge,Ur)|0,B=B+Math.imul(Ge,ft)|0,C=C+Math.imul(ye,xr)|0,S=S+Math.imul(ye,Rr)|0,S=S+Math.imul(Te,xr)|0,B=B+Math.imul(Te,Rr)|0;var xu=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(xu>>>26)|0,xu&=67108863,C=Math.imul(rr,dr),S=Math.imul(rr,tt),S=S+Math.imul(Xe,dr)|0,B=Math.imul(Xe,tt),C=C+Math.imul(Wt,pr)|0,S=S+Math.imul(Wt,rt)|0,S=S+Math.imul(We,pr)|0,B=B+Math.imul(We,rt)|0,C=C+Math.imul(zt,mr)|0,S=S+Math.imul(zt,nt)|0,S=S+Math.imul(Ve,mr)|0,B=B+Math.imul(Ve,nt)|0,C=C+Math.imul(Ht,$r)|0,S=S+Math.imul(Ht,ut)|0,S=S+Math.imul(qe,$r)|0,B=B+Math.imul(qe,ut)|0,C=C+Math.imul(Lt,Ur)|0,S=S+Math.imul(Lt,ft)|0,S=S+Math.imul(Je,Ur)|0,B=B+Math.imul(Je,ft)|0,C=C+Math.imul(Ot,xr)|0,S=S+Math.imul(Ot,Rr)|0,S=S+Math.imul(Ge,xr)|0,B=B+Math.imul(Ge,Rr)|0;var Ru=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Ru>>>26)|0,Ru&=67108863,C=Math.imul(rr,pr),S=Math.imul(rr,rt),S=S+Math.imul(Xe,pr)|0,B=Math.imul(Xe,rt),C=C+Math.imul(Wt,mr)|0,S=S+Math.imul(Wt,nt)|0,S=S+Math.imul(We,mr)|0,B=B+Math.imul(We,nt)|0,C=C+Math.imul(zt,$r)|0,S=S+Math.imul(zt,ut)|0,S=S+Math.imul(Ve,$r)|0,B=B+Math.imul(Ve,ut)|0,C=C+Math.imul(Ht,Ur)|0,S=S+Math.imul(Ht,ft)|0,S=S+Math.imul(qe,Ur)|0,B=B+Math.imul(qe,ft)|0,C=C+Math.imul(Lt,xr)|0,S=S+Math.imul(Lt,Rr)|0,S=S+Math.imul(Je,xr)|0,B=B+Math.imul(Je,Rr)|0;var Pu=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Pu>>>26)|0,Pu&=67108863,C=Math.imul(rr,mr),S=Math.imul(rr,nt),S=S+Math.imul(Xe,mr)|0,B=Math.imul(Xe,nt),C=C+Math.imul(Wt,$r)|0,S=S+Math.imul(Wt,ut)|0,S=S+Math.imul(We,$r)|0,B=B+Math.imul(We,ut)|0,C=C+Math.imul(zt,Ur)|0,S=S+Math.imul(zt,ft)|0,S=S+Math.imul(Ve,Ur)|0,B=B+Math.imul(Ve,ft)|0,C=C+Math.imul(Ht,xr)|0,S=S+Math.imul(Ht,Rr)|0,S=S+Math.imul(qe,xr)|0,B=B+Math.imul(qe,Rr)|0;var ku=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(ku>>>26)|0,ku&=67108863,C=Math.imul(rr,$r),S=Math.imul(rr,ut),S=S+Math.imul(Xe,$r)|0,B=Math.imul(Xe,ut),C=C+Math.imul(Wt,Ur)|0,S=S+Math.imul(Wt,ft)|0,S=S+Math.imul(We,Ur)|0,B=B+Math.imul(We,ft)|0,C=C+Math.imul(zt,xr)|0,S=S+Math.imul(zt,Rr)|0,S=S+Math.imul(Ve,xr)|0,B=B+Math.imul(Ve,Rr)|0;var Ou=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(Ou>>>26)|0,Ou&=67108863,C=Math.imul(rr,Ur),S=Math.imul(rr,ft),S=S+Math.imul(Xe,Ur)|0,B=Math.imul(Xe,ft),C=C+Math.imul(Wt,xr)|0,S=S+Math.imul(Wt,Rr)|0,S=S+Math.imul(We,xr)|0,B=B+Math.imul(We,Rr)|0;var E2=(E+C|0)+((S&8191)<<13)|0;E=(B+(S>>>13)|0)+(E2>>>26)|0,E2&=67108863,C=Math.imul(rr,xr),S=Math.imul(rr,Rr),S=S+Math.imul(Xe,xr)|0,B=Math.imul(Xe,Rr);var A2=(E+C|0)+((S&8191)<<13)|0;return E=(B+(S>>>13)|0)+(A2>>>26)|0,A2&=67108863,_[0]=Hs,_[1]=js,_[2]=zs,_[3]=Js,_[4]=qs,_[5]=Au,_[6]=_u,_[7]=Cu,_[8]=Su,_[9]=Tu,_[10]=Nu,_[11]=Iu,_[12]=xu,_[13]=Ru,_[14]=Pu,_[15]=ku,_[16]=Ou,_[17]=E2,_[18]=A2,E!==0&&(_[19]=E,y.length++),y};Math.imul||(k=x);function R(v,p,m){m.negative=p.negative^v.negative,m.length=v.length+p.length;for(var y=0,T=0,I=0;I<m.length-1;I++){var _=T;T=0;for(var E=y&67108863,C=Math.min(I,p.length-1),S=Math.max(0,I-v.length+1);S<=C;S++){var B=I-S,$=v.words[B]|0,P=p.words[S]|0,q=$*P,V=q&67108863;_=_+(q/67108864|0)|0,V=V+E|0,E=V&67108863,_=_+(V>>>26)|0,T+=_>>>26,_&=67108863}m.words[I]=E,y=_,_=T}return y!==0?m.words[I]=y:m.length--,m._strip()}function D(v,p,m){return R(v,p,m)}s.prototype.mulTo=function(p,m){var y,T=this.length+p.length;return this.length===10&&p.length===10?y=k(this,p,m):T<63?y=x(this,p,m):T<1024?y=R(this,p,m):y=D(this,p,m),y},s.prototype.mul=function(p){var m=new s(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},s.prototype.mulf=function(p){var m=new s(null);return m.words=new Array(this.length+p.length),D(this,p,m)},s.prototype.imul=function(p){return this.clone().mulTo(p,this)},s.prototype.imuln=function(p){var m=p<0;m&&(p=-p),n(typeof p=="number"),n(p<67108864);for(var y=0,T=0;T<this.length;T++){var I=(this.words[T]|0)*p,_=(I&67108863)+(y&67108863);y>>=26,y+=I/67108864|0,y+=_>>>26,this.words[T]=_&67108863}return y!==0&&(this.words[T]=y,this.length++),this.length=p===0?1:this.length,m?this.ineg():this},s.prototype.muln=function(p){return this.clone().imuln(p)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(p){var m=w(p);if(m.length===0)return new s(1);for(var y=this,T=0;T<m.length&&m[T]===0;T++,y=y.sqr());if(++T<m.length)for(var I=y.sqr();T<m.length;T++,I=I.sqr())m[T]!==0&&(y=y.mul(I));return y},s.prototype.iushln=function(p){n(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26,T=67108863>>>26-m<<26-m,I;if(m!==0){var _=0;for(I=0;I<this.length;I++){var E=this.words[I]&T,C=(this.words[I]|0)-E<<m;this.words[I]=C|_,_=E>>>26-m}_&&(this.words[I]=_,this.length++)}if(y!==0){for(I=this.length-1;I>=0;I--)this.words[I+y]=this.words[I];for(I=0;I<y;I++)this.words[I]=0;this.length+=y}return this._strip()},s.prototype.ishln=function(p){return n(this.negative===0),this.iushln(p)},s.prototype.iushrn=function(p,m,y){n(typeof p=="number"&&p>=0);var T;m?T=(m-m%26)/26:T=0;var I=p%26,_=Math.min((p-I)/26,this.length),E=67108863^67108863>>>I<<I,C=y;if(T-=_,T=Math.max(0,T),C){for(var S=0;S<_;S++)C.words[S]=this.words[S];C.length=_}if(_!==0)if(this.length>_)for(this.length-=_,S=0;S<this.length;S++)this.words[S]=this.words[S+_];else this.words[0]=0,this.length=1;var B=0;for(S=this.length-1;S>=0&&(B!==0||S>=T);S--){var $=this.words[S]|0;this.words[S]=B<<26-I|$>>>I,B=$&E}return C&&B!==0&&(C.words[C.length++]=B),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(p,m,y){return n(this.negative===0),this.iushrn(p,m,y)},s.prototype.shln=function(p){return this.clone().ishln(p)},s.prototype.ushln=function(p){return this.clone().iushln(p)},s.prototype.shrn=function(p){return this.clone().ishrn(p)},s.prototype.ushrn=function(p){return this.clone().iushrn(p)},s.prototype.testn=function(p){n(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26,T=1<<m;if(this.length<=y)return!1;var I=this.words[y];return!!(I&T)},s.prototype.imaskn=function(p){n(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(m!==0&&y++,this.length=Math.min(y,this.length),m!==0){var T=67108863^67108863>>>m<<m;this.words[this.length-1]&=T}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.maskn=function(p){return this.clone().imaskn(p)},s.prototype.iaddn=function(p){return n(typeof p=="number"),n(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<=p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},s.prototype._iaddn=function(p){this.words[0]+=p;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},s.prototype.isubn=function(p){if(n(typeof p=="number"),n(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},s.prototype.addn=function(p){return this.clone().iaddn(p)},s.prototype.subn=function(p){return this.clone().isubn(p)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(p,m,y){var T=p.length+y,I;this._expand(T);var _,E=0;for(I=0;I<p.length;I++){_=(this.words[I+y]|0)+E;var C=(p.words[I]|0)*m;_-=C&67108863,E=(_>>26)-(C/67108864|0),this.words[I+y]=_&67108863}for(;I<this.length-y;I++)_=(this.words[I+y]|0)+E,E=_>>26,this.words[I+y]=_&67108863;if(E===0)return this._strip();for(n(E===-1),E=0,I=0;I<this.length;I++)_=-(this.words[I]|0)+E,E=_>>26,this.words[I]=_&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(p,m){var y=this.length-p.length,T=this.clone(),I=p,_=I.words[I.length-1]|0,E=this._countBits(_);y=26-E,y!==0&&(I=I.ushln(y),T.iushln(y),_=I.words[I.length-1]|0);var C=T.length-I.length,S;if(m!=="mod"){S=new s(null),S.length=C+1,S.words=new Array(S.length);for(var B=0;B<S.length;B++)S.words[B]=0}var $=T.clone()._ishlnsubmul(I,1,C);$.negative===0&&(T=$,S&&(S.words[C]=1));for(var P=C-1;P>=0;P--){var q=(T.words[I.length+P]|0)*67108864+(T.words[I.length+P-1]|0);for(q=Math.min(q/_|0,67108863),T._ishlnsubmul(I,q,P);T.negative!==0;)q--,T.negative=0,T._ishlnsubmul(I,1,P),T.isZero()||(T.negative^=1);S&&(S.words[P]=q)}return S&&S._strip(),T._strip(),m!=="div"&&y!==0&&T.iushrn(y),{div:S||null,mod:T}},s.prototype.divmod=function(p,m,y){if(n(!p.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var T,I,_;return this.negative!==0&&p.negative===0?(_=this.neg().divmod(p,m),m!=="mod"&&(T=_.div.neg()),m!=="div"&&(I=_.mod.neg(),y&&I.negative!==0&&I.iadd(p)),{div:T,mod:I}):this.negative===0&&p.negative!==0?(_=this.divmod(p.neg(),m),m!=="mod"&&(T=_.div.neg()),{div:T,mod:_.mod}):this.negative&p.negative?(_=this.neg().divmod(p.neg(),m),m!=="div"&&(I=_.mod.neg(),y&&I.negative!==0&&I.isub(p)),{div:_.div,mod:I}):p.length>this.length||this.cmp(p)<0?{div:new s(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new s(this.modrn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new s(this.modrn(p.words[0]))}:this._wordDiv(p,m)},s.prototype.div=function(p){return this.divmod(p,"div",!1).div},s.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},s.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},s.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var y=m.div.negative!==0?m.mod.isub(p):m.mod,T=p.ushrn(1),I=p.andln(1),_=y.cmp(T);return _<0||I===1&&_===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},s.prototype.modrn=function(p){var m=p<0;m&&(p=-p),n(p<=67108863);for(var y=(1<<26)%p,T=0,I=this.length-1;I>=0;I--)T=(y*T+(this.words[I]|0))%p;return m?-T:T},s.prototype.modn=function(p){return this.modrn(p)},s.prototype.idivn=function(p){var m=p<0;m&&(p=-p),n(p<=67108863);for(var y=0,T=this.length-1;T>=0;T--){var I=(this.words[T]|0)+y*67108864;this.words[T]=I/p|0,y=I%p}return this._strip(),m?this.ineg():this},s.prototype.divn=function(p){return this.clone().idivn(p)},s.prototype.egcd=function(p){n(p.negative===0),n(!p.isZero());var m=this,y=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var T=new s(1),I=new s(0),_=new s(0),E=new s(1),C=0;m.isEven()&&y.isEven();)m.iushrn(1),y.iushrn(1),++C;for(var S=y.clone(),B=m.clone();!m.isZero();){for(var $=0,P=1;!(m.words[0]&P)&&$<26;++$,P<<=1);if($>0)for(m.iushrn($);$-- >0;)(T.isOdd()||I.isOdd())&&(T.iadd(S),I.isub(B)),T.iushrn(1),I.iushrn(1);for(var q=0,V=1;!(y.words[0]&V)&&q<26;++q,V<<=1);if(q>0)for(y.iushrn(q);q-- >0;)(_.isOdd()||E.isOdd())&&(_.iadd(S),E.isub(B)),_.iushrn(1),E.iushrn(1);m.cmp(y)>=0?(m.isub(y),T.isub(_),I.isub(E)):(y.isub(m),_.isub(T),E.isub(I))}return{a:_,b:E,gcd:y.iushln(C)}},s.prototype._invmp=function(p){n(p.negative===0),n(!p.isZero());var m=this,y=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var T=new s(1),I=new s(0),_=y.clone();m.cmpn(1)>0&&y.cmpn(1)>0;){for(var E=0,C=1;!(m.words[0]&C)&&E<26;++E,C<<=1);if(E>0)for(m.iushrn(E);E-- >0;)T.isOdd()&&T.iadd(_),T.iushrn(1);for(var S=0,B=1;!(y.words[0]&B)&&S<26;++S,B<<=1);if(S>0)for(y.iushrn(S);S-- >0;)I.isOdd()&&I.iadd(_),I.iushrn(1);m.cmp(y)>=0?(m.isub(y),T.isub(I)):(y.isub(m),I.isub(T))}var $;return m.cmpn(1)===0?$=T:$=I,$.cmpn(0)<0&&$.iadd(p),$},s.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),y=p.clone();m.negative=0,y.negative=0;for(var T=0;m.isEven()&&y.isEven();T++)m.iushrn(1),y.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;y.isEven();)y.iushrn(1);var I=m.cmp(y);if(I<0){var _=m;m=y,y=_}else if(I===0||y.cmpn(1)===0)break;m.isub(y)}while(!0);return y.iushln(T)},s.prototype.invm=function(p){return this.egcd(p).a.umod(p)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(p){return this.words[0]&p},s.prototype.bincn=function(p){n(typeof p=="number");var m=p%26,y=(p-m)/26,T=1<<m;if(this.length<=y)return this._expand(y+1),this.words[y]|=T,this;for(var I=T,_=y;I!==0&&_<this.length;_++){var E=this.words[_]|0;E+=I,I=E>>>26,E&=67108863,this.words[_]=E}return I!==0&&(this.words[_]=I,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var y;if(this.length>1)y=1;else{m&&(p=-p),n(p<=67108863,"Number is too big");var T=this.words[0]|0;y=T===p?0:T<p?-1:1}return this.negative!==0?-y|0:y},s.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var m=this.ucmp(p);return this.negative!==0?-m|0:m},s.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var m=0,y=this.length-1;y>=0;y--){var T=this.words[y]|0,I=p.words[y]|0;if(T!==I){T<I?m=-1:T>I&&(m=1);break}}return m},s.prototype.gtn=function(p){return this.cmpn(p)===1},s.prototype.gt=function(p){return this.cmp(p)===1},s.prototype.gten=function(p){return this.cmpn(p)>=0},s.prototype.gte=function(p){return this.cmp(p)>=0},s.prototype.ltn=function(p){return this.cmpn(p)===-1},s.prototype.lt=function(p){return this.cmp(p)===-1},s.prototype.lten=function(p){return this.cmpn(p)<=0},s.prototype.lte=function(p){return this.cmp(p)<=0},s.prototype.eqn=function(p){return this.cmpn(p)===0},s.prototype.eq=function(p){return this.cmp(p)===0},s.red=function(p){return new N(p)},s.prototype.toRed=function(p){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(p){return this.red=p,this},s.prototype.forceRed=function(p){return n(!this.red,"Already a number in reduction context"),this._forceRed(p)},s.prototype.redAdd=function(p){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},s.prototype.redIAdd=function(p){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},s.prototype.redSub=function(p){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},s.prototype.redISub=function(p){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},s.prototype.redShl=function(p){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},s.prototype.redMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},s.prototype.redIMul=function(p){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(p){return n(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var O={k256:null,p224:null,p192:null,p25519:null};function M(v,p){this.name=v,this.p=new s(p,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}M.prototype._tmp=function(){var p=new s(null);return p.words=new Array(Math.ceil(this.n/13)),p},M.prototype.ireduce=function(p){var m=p,y;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),y=m.bitLength();while(y>this.n);var T=y<this.n?-1:m.ucmp(this.p);return T===0?(m.words[0]=0,m.length=1):T>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},M.prototype.split=function(p,m){p.iushrn(this.n,0,m)},M.prototype.imulK=function(p){return p.imul(this.k)};function F(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(F,M),F.prototype.split=function(p,m){for(var y=4194303,T=Math.min(p.length,9),I=0;I<T;I++)m.words[I]=p.words[I];if(m.length=T,p.length<=9){p.words[0]=0,p.length=1;return}var _=p.words[9];for(m.words[m.length++]=_&y,I=10;I<p.length;I++){var E=p.words[I]|0;p.words[I-10]=(E&y)<<4|_>>>22,_=E}_>>>=22,p.words[I-10]=_,_===0&&p.length>10?p.length-=10:p.length-=9},F.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,y=0;y<p.length;y++){var T=p.words[y]|0;m+=T*977,p.words[y]=m&67108863,m=T*64+(m/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function H(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(H,M);function U(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(U,M);function G(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(G,M),G.prototype.imulK=function(p){for(var m=0,y=0;y<p.length;y++){var T=(p.words[y]|0)*19+m,I=T&67108863;T>>>=26,p.words[y]=I,m=T}return m!==0&&(p.words[p.length++]=m),p},s._prime=function(p){if(O[p])return O[p];var m;if(p==="k256")m=new F;else if(p==="p224")m=new H;else if(p==="p192")m=new U;else if(p==="p25519")m=new G;else throw new Error("Unknown prime "+p);return O[p]=m,m};function N(v){if(typeof v=="string"){var p=s._prime(v);this.m=p.p,this.prime=p}else n(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}N.prototype._verify1=function(p){n(p.negative===0,"red works only with positives"),n(p.red,"red works only with red numbers")},N.prototype._verify2=function(p,m){n((p.negative|m.negative)===0,"red works only with positives"),n(p.red&&p.red===m.red,"red works only with red numbers")},N.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):(u(p,p.umod(this.m)._forceRed(this)),p)},N.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},N.prototype.add=function(p,m){this._verify2(p,m);var y=p.add(m);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},N.prototype.iadd=function(p,m){this._verify2(p,m);var y=p.iadd(m);return y.cmp(this.m)>=0&&y.isub(this.m),y},N.prototype.sub=function(p,m){this._verify2(p,m);var y=p.sub(m);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},N.prototype.isub=function(p,m){this._verify2(p,m);var y=p.isub(m);return y.cmpn(0)<0&&y.iadd(this.m),y},N.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},N.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},N.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},N.prototype.isqr=function(p){return this.imul(p,p.clone())},N.prototype.sqr=function(p){return this.mul(p,p)},N.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(n(m%2===1),m===3){var y=this.m.add(new s(1)).iushrn(2);return this.pow(p,y)}for(var T=this.m.subn(1),I=0;!T.isZero()&&T.andln(1)===0;)I++,T.iushrn(1);n(!T.isZero());var _=new s(1).toRed(this),E=_.redNeg(),C=this.m.subn(1).iushrn(1),S=this.m.bitLength();for(S=new s(2*S*S).toRed(this);this.pow(S,C).cmp(E)!==0;)S.redIAdd(E);for(var B=this.pow(S,T),$=this.pow(p,T.addn(1).iushrn(1)),P=this.pow(p,T),q=I;P.cmp(_)!==0;){for(var V=P,X=0;V.cmp(_)!==0;X++)V=V.redSqr();n(X<q);var Z=this.pow(B,new s(1).iushln(q-X-1));$=$.redMul(Z),B=Z.redSqr(),P=P.redMul(B),q=X}return $},N.prototype.invm=function(p){var m=p._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},N.prototype.pow=function(p,m){if(m.isZero())return new s(1).toRed(this);if(m.cmpn(1)===0)return p.clone();var y=4,T=new Array(1<<y);T[0]=new s(1).toRed(this),T[1]=p;for(var I=2;I<T.length;I++)T[I]=this.mul(T[I-1],p);var _=T[0],E=0,C=0,S=m.bitLength()%26;for(S===0&&(S=26),I=m.length-1;I>=0;I--){for(var B=m.words[I],$=S-1;$>=0;$--){var P=B>>$&1;if(_!==T[0]&&(_=this.sqr(_)),P===0&&E===0){C=0;continue}E<<=1,E|=P,C++,!(C!==y&&(I!==0||$!==0))&&(_=this.mul(_,T[E]),C=0,E=0)}S=26}return _},N.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},N.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},s.mont=function(p){return new A(p)};function A(v){N.call(this,v),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(A,N),A.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},A.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},A.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var y=p.imul(m),T=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),I=y.isub(T).iushrn(this.shift),_=I;return I.cmp(this.m)>=0?_=I.isub(this.m):I.cmpn(0)<0&&(_=I.iadd(this.m)),_._forceRed(this)},A.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new s(0)._forceRed(this);var y=p.mul(m),T=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),I=y.isub(T).iushrn(this.shift),_=I;return I.cmp(this.m)>=0?_=I.isub(this.m):I.cmpn(0)<0&&(_=I.iadd(this.m)),_._forceRed(this)},A.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(t,ro)})(a5);var rF=a5.exports;const ct=zf(rF),nF="logger/5.8.0";let $8=!1,L8=!1;const gm={debug:1,default:2,info:2,warning:3,error:4,off:5};let U8=gm.default,I2=null;function iF(){try{const t=[];
4if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const H8=iF();var Yw;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Yw||(Yw={}));var Ro;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ro||(Ro={}));const j8="0123456789abcdef";let ge=class Fn{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();gm[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(U8>gm[n])&&console.log.apply(console,r)}debug(...e){this._log(Fn.levels.DEBUG,e)}info(...e){this._log(Fn.levels.INFO,e)}warn(...e){this._log(Fn.levels.WARNING,e)}makeError(e,r,n){if(L8)return this.makeError("censored error",r,{});r||(r=Fn.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f<l.length;f++)u+=j8[l[f]>>4],u+=j8[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Ro.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Ro.CALL_EXCEPTION:case Ro.INSUFFICIENT_FUNDS:case Ro.MISSING_NEW:case Ro.NONCE_EXPIRED:case Ro.REPLACEMENT_UNDERPRICED:case Ro.TRANSACTION_REPLACED:case Ro.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Fn.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){H8&&this.throwError("platform missing String.prototype.normalize",Fn.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:H8})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Fn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Fn.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,Fn.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,Fn.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Fn.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Fn.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Fn.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return I2||(I2=new Fn(nF)),I2}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Fn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),$8){if(!e)return;this.globalLogger().throwError("error censorship permanent",Fn.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}L8=!!e,$8=!!r}static setLogLevel(e){const r=gm[e.toLowerCase()];if(r==null){Fn.globalLogger().warn("invalid log level - "+e);return}U8=r}static from(e){return new Fn(e)}};ge.errors=Ro;ge.levels=Yw;const sF="bytes/5.8.0",yn=new ge(sF);function C7(t){return!!t.toHexString}function zd(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return zd(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function c5(t){return Yr(t)&&!(t.length%2)||oy(t)}function z8(t){return typeof t=="number"&&t==t&&t%1===0}function oy(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;
4if(typeof t=="string"||!z8(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!z8(r)||r<0||r>=256)return!1}return!0}function Nt(t,e){if(e||(e={}),typeof t=="number"){yn.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),zd(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),C7(t)&&(t=t.toHexString()),Yr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":yn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return zd(new Uint8Array(n))}return oy(t)?zd(new Uint8Array(t)):yn.throwArgumentError("invalid arrayify value","value",t)}function tf(t){const e=t.map(i=>Nt(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),zd(n)}function ch(t){let e=Nt(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function oF(t,e){t=Nt(t),t.length>e&&yn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),zd(r)}function Yr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const x2="0123456789abcdef";function Et(t,e){if(e||(e={}),typeof t=="number"){yn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=x2[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),C7(t))return t.toHexString();if(Yr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":yn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(oy(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=x2[(i&240)>>4]+x2[i&15]}return r}return yn.throwArgumentError("invalid hexlify value","value",t)}function Af(t){if(typeof t!="string")t=Et(t);else if(!Yr(t)||t.length%2)return null;return(t.length-2)/2}function Fi(t,e,r){return typeof t!="string"?t=Et(t):(!Yr(t)||t.length%2)&&yn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Ds(t){let e="0x";return t.forEach(r=>{e+=Et(r).substring(2)}),e}function l5(t){const e=aF(Et(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function aF(t){typeof t!="string"&&(t=Et(t)),Yr(t)||yn.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e<t.length&&t[e]==="0";)e++;return"0x"+t.substring(e)}function Mn(t,e){for(typeof t!="string"?t=Et(t):Yr(t)||yn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&yn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function ay(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(c5(t)){let r=Nt(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Et(r.slice(0,32)),e.s=Et(r.slice(32,64))):r.length===65?(e.r=Et(r.slice(0,32)),e.s=Et(r.slice(32,64)),e.v=r[64]):yn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:yn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Et(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=oF(Nt(e._vs),32);e._vs=Et(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&yn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=Et(i);e.s==null?e.s=o:e.s!==o&&yn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?yn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&yn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Yr(e.r)?yn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Mn(e.r,32),e.s==null||!Yr(e.s)?yn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Mn(e.s,32);const r=Nt(e.s);r[0]>=128&&yn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Et(r);e._vs&&(Yr(e._vs)||yn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Mn(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&yn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}const cF="bignumber/5.8.0";var Gm=ct.BN;const Ec=new ge(cF),R2={},J8=9007199254740991;let q8=!1,at=class So{constructor(e,r){e!==R2&&Ec.throwError("cannot call constructor directly; use BigNumber.from",ge.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Wi(Jt(this).fromTwos(e))}toTwos(e){return Wi(Jt(this).toTwos(e))}abs(){return this._hex[0]==="-"?So.from(this._hex.substring(1)):this}add(e){return Wi(Jt(this).add(Jt(e)))}sub(e){return Wi(Jt(this).sub(Jt(e)))}div(e){return So.from(e).isZero()&&Gs("division-by-zero","div"),Wi(Jt(this).div(Jt(e)))}mul(e){return Wi(Jt(this).mul(Jt(e)))}mod(e){const r=Jt(e);return r.isNeg()&&Gs("division-by-zero","mod"),Wi(Jt(this).umod(r))}pow(e){const r=Jt(e);return r.isNeg()&&Gs("negative-power","pow"),Wi(Jt(this).pow(r))}and(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&Gs("unbound-bitwise-result","and"),Wi(Jt(this).and(r))}or(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&Gs("unbound-bitwise-result","or"),Wi(Jt(this).or(r))}xor(e){const r=Jt(e);return(this.isNegative()||r.isNeg())&&Gs("unbound-bitwise-result","xor"),Wi(Jt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Gs("negative-width","mask"),Wi(Jt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Gs("negative-width","shl"),Wi(Jt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Gs("negative-width","shr"),Wi(Jt(this).shrn(e))}eq(e){return Jt(this).eq(Jt(e))}lt(e){return Jt(this).lt(Jt(e))}lte(e){return Jt(this).lte(Jt(e))}gt(e){return Jt(this).gt(Jt(e))}gte(e){return Jt(this).gte(Jt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Jt(this).isZero()}toNumber(){try{return Jt(this).toNumber()}catch{Gs("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ec.throwError("this platform does not support BigInt",ge.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?q8||(q8=!0,Ec.warn("BigNumber.toString does not accept any parameters;
4 base-10 is assumed")):arguments[0]===16?Ec.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ge.errors.UNEXPECTED_ARGUMENT,{}):Ec.throwError("BigNumber.toString does not accept parameters",ge.errors.UNEXPECTED_ARGUMENT,{})),Jt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof So)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new So(R2,pp(e)):e.match(/^-?[0-9]+$/)?new So(R2,pp(new Gm(e))):Ec.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Gs("underflow","BigNumber.from",e),(e>=J8||e<=-J8)&&Gs("overflow","BigNumber.from",e),So.from(String(e));const r=e;if(typeof r=="bigint")return So.from(r.toString());if(oy(r))return So.from(Et(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return So.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Yr(n)||n[0]==="-"&&Yr(n.substring(1))))return So.from(n)}return Ec.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function pp(t){if(typeof t!="string")return pp(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Ec.throwArgumentError("invalid hex","value",t),t=pp(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Wi(t){return at.from(pp(t))}function Jt(t){const e=at.from(t).toHexString();return e[0]==="-"?new Gm("-"+e.substring(3),16):new Gm(e.substring(2),16)}function Gs(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Ec.throwError(t,ge.errors.NUMERIC_FAULT,n)}function lF(t){return new Gm(t,36).toString(16)}const uF="properties/5.8.0";var fF=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Vm=new ge(uF);function Zt(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function M0(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function li(t){return fF(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function dF(t,e){(!t||typeof t!="object")&&Vm.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Vm.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function us(t){const e={};for(const r in t)e[r]=t[r];return e}const hF={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function S7(t){if(t==null||hF[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++){let n=null;try{n=t[e[r]]}catch{continue}if(!S7(n))return!1}return!0}return Vm.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function pF(t){if(S7(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>_f(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&Zt(e,r,_f(n))}return e}return Vm.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function _f(t){return pF(t)}let gF=class{constructor(e){for(const r in e)this[r]=_f(e[r])}};var T7={exports:{}};/** 5 * [js-sha3]{@link https://github.com/emn178/js-sha3} 6 * 7 * @version 0.8.0 8 * @author Chen, Yi-Cyuan [[email protected]] 9 * @copyright Chen, Yi-Cyuan 2015-2018 10 * @license MIT 11 */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=ro:s&&(i=self);
11var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],h=[6,1536,393216,100663296],g=[0,8,16,24],b=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],w=[224,256,384,512],x=[128,256],k=["hex","buffer","arrayBuffer","array","digest"],R={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(P){return Object.prototype.toString.call(P)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(P){return typeof P=="object"&&P.buffer&&P.buffer.constructor===ArrayBuffer});for(var D=function(P,q,V){return function(X){return new S(P,q,P).update(X)[V]()}},O=function(P,q,V){return function(X,Z){return new S(P,q,Z).update(X)[V]()}},M=function(P,q,V){return function(X,Z,ie,ce){return p["cshake"+P].update(X,Z,ie,ce)[V]()}},F=function(P,q,V){return function(X,Z,ie,ce){return p["kmac"+P].update(X,Z,ie,ce)[V]()}},H=function(P,q,V,X){for(var Z=0;Z<k.length;++Z){var ie=k[Z];P[ie]=q(V,X,ie)}return P},U=function(P,q){var V=D(P,q,"hex");return V.create=function(){return new S(P,q,P)},V.update=function(X){return V.create().update(X)},H(V,D,P,q)},G=function(P,q){var V=O(P,q,"hex");return V.create=function(X){return new S(P,q,X)},V.update=function(X,Z){return V.create(Z).update(X)},H(V,O,P,q)},N=function(P,q){var V=R[P],X=M(P,q,"hex");return X.create=function(Z,ie,ce){return!ie&&!ce?p["shake"+P].create(Z):new S(P,q,Z).bytepad([ie,ce],V)},X.update=function(Z,ie,ce,se){return X.create(ie,ce,se).update(Z)},H(X,M,P,q)},A=function(P,q){var V=R[P],X=F(P,q,"hex");return X.create=function(Z,ie,ce){return new B(P,q,ie).bytepad(["KMAC",ce],V).bytepad([Z],V)},X.update=function(Z,ie,ce,se){return X.create(Z,ce,se).update(ie)},H(X,F,P,q)},v=[{name:"keccak",padding:d,bits:w,createMethod:U},{name:"sha3",padding:h,bits:w,createMethod:U},{name:"shake",padding:u,bits:x,createMethod:G},{name:"cshake",padding:f,bits:x,createMethod:N},{name:"kmac",padding:f,bits:x,createMethod:A}],p={},m=[],y=0;y<v.length;++y)for(var T=v[y],I=T.bits,_=0;_<I.length;++_){var E=T.name+"_"+I[_];if(m.push(E),p[E]=T.createMethod(I[_],T.padding),T.name!=="sha3"){var C=T.name+I[_];m.push(C),p[C]=p[E]}}function S(P,q,V){this.blocks=[],this.s=[],this.padding=q,this.outputBits=V,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(P<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=V>>5,this.extraBytes=(V&31)>>3;for(var X=0;X<50;++X)this.s[X]=0}S.prototype.update=function(P){if(this.finalized)throw new Error(r);var q,V=typeof P;if(V!=="string"){if(V==="object"){if(P===null)throw new Error(e);
11if(c&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!Array.isArray(P)&&(!c||!ArrayBuffer.isView(P)))throw new Error(e)}else throw new Error(e);q=!0}for(var X=this.blocks,Z=this.byteCount,ie=P.length,ce=this.blockCount,se=0,_e=this.s,ye,Te;se<ie;){if(this.reset)for(this.reset=!1,X[0]=this.block,ye=1;ye<ce+1;++ye)X[ye]=0;if(q)for(ye=this.start;se<ie&&ye<Z;++se)X[ye>>2]|=P[se]<<g[ye++&3];else for(ye=this.start;se<ie&&ye<Z;++se)Te=P.charCodeAt(se),Te<128?X[ye>>2]|=Te<<g[ye++&3]:Te<2048?(X[ye>>2]|=(192|Te>>6)<<g[ye++&3],X[ye>>2]|=(128|Te&63)<<g[ye++&3]):Te<55296||Te>=57344?(X[ye>>2]|=(224|Te>>12)<<g[ye++&3],X[ye>>2]|=(128|Te>>6&63)<<g[ye++&3],X[ye>>2]|=(128|Te&63)<<g[ye++&3]):(Te=65536+((Te&1023)<<10|P.charCodeAt(++se)&1023),X[ye>>2]|=(240|Te>>18)<<g[ye++&3],X[ye>>2]|=(128|Te>>12&63)<<g[ye++&3],X[ye>>2]|=(128|Te>>6&63)<<g[ye++&3],X[ye>>2]|=(128|Te&63)<<g[ye++&3]);if(this.lastByteIndex=ye,ye>=Z){for(this.start=ye-Z,this.block=X[ce],ye=0;ye<ce;++ye)_e[ye]^=X[ye];$(_e),this.reset=!0}else this.start=ye}return this},S.prototype.encode=function(P,q){var V=P&255,X=1,Z=[V];for(P=P>>8,V=P&255;V>0;)Z.unshift(V),P=P>>8,V=P&255,++X;return q?Z.push(X):Z.unshift(X),this.update(Z),Z.length},S.prototype.encodeString=function(P){var q,V=typeof P;if(V!=="string"){if(V==="object"){if(P===null)throw new Error(e);
11if(c&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!Array.isArray(P)&&(!c||!ArrayBuffer.isView(P)))throw new Error(e)}else throw new Error(e);q=!0}var X=0,Z=P.length;if(q)X=Z;else for(var ie=0;ie<P.length;++ie){var ce=P.charCodeAt(ie);ce<128?X+=1:ce<2048?X+=2:ce<55296||ce>=57344?X+=3:(ce=65536+((ce&1023)<<10|P.charCodeAt(++ie)&1023),X+=4)}return X+=this.encode(X*8),this.update(P),X},S.prototype.bytepad=function(P,q){for(var V=this.encode(q),X=0;X<P.length;++X)V+=this.encodeString(P[X]);var Z=q-V%q,ie=[];return ie.length=Z,this.update(ie),this},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var P=this.blocks,q=this.lastByteIndex,V=this.blockCount,X=this.s;if(P[q>>2]|=this.padding[q&3],this.lastByteIndex===this.byteCount)for(P[0]=P[V],q=1;q<V+1;++q)P[q]=0;for(P[V-1]|=2147483648,q=0;q<V;++q)X[q]^=P[q];$(X)}},S.prototype.toString=S.prototype.hex=function(){this.finalize();for(var P=this.blockCount,q=this.s,V=this.outputBlocks,X=this.extraBytes,Z=0,ie=0,ce="",se;ie<V;){for(Z=0;Z<P&&ie<V;++Z,++ie)se=q[Z],ce+=l[se>>4&15]+l[se&15]+l[se>>12&15]+l[se>>8&15]+l[se>>20&15]+l[se>>16&15]+l[se>>28&15]+l[se>>24&15];ie%P===0&&($(q),Z=0)}return X&&(se=q[Z],ce+=l[se>>4&15]+l[se&15],X>1&&(ce+=l[se>>12&15]+l[se>>8&15]),X>2&&(ce+=l[se>>20&15]+l[se>>16&15])),ce},S.prototype.arrayBuffer=function(){this.finalize();var P=this.blockCount,q=this.s,V=this.outputBlocks,X=this.extraBytes,Z=0,ie=0,ce=this.outputBits>>3,se;X?se=new ArrayBuffer(V+1<<2):se=new ArrayBuffer(ce);for(var _e=new Uint32Array(se);ie<V;){for(Z=0;Z<P&&ie<V;++Z,++ie)_e[ie]=q[Z];ie%P===0&&$(q)}return X&&(_e[Z]=q[Z],se=se.slice(0,ce)),se},S.prototype.buffer=S.prototype.arrayBuffer,S.prototype.digest=S.prototype.array=function(){this.finalize();for(var P=this.blockCount,q=this.s,V=this.outputBlocks,X=this.extraBytes,Z=0,ie=0,ce=[],se,_e;ie<V;){for(Z=0;Z<P&&ie<V;++Z,++ie)se=ie<<2,_e=q[Z],ce[se]=_e&255,ce[se+1]=_e>>8&255,ce[se+2]=_e>>16&255,ce[se+3]=_e>>24&255;ie%P===0&&$(q)}return X&&(se=ie<<2,_e=q[Z],ce[se]=_e&255,X>1&&(ce[se+1]=_e>>8&255),X>2&&(ce[se+2]=_e>>16&255)),ce};function B(P,q,V){S.call(this,P,q,V)}B.prototype=new S,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),S.prototype.finalize.call(this)};var $=function(P){var q,V,X,Z,ie,ce,se,_e,ye,Te,ht,Ot,Ge,$t,Lt,Je,Ut,Ht,qe,jt,zt,Ve,Vt,Wt,We,tr,rr,Xe,nr,ir,Ze,sr,or,Ye,ar,cr,Qe,lr,ur,et,fr,dr,tt,hr,pr,rt,gr,mr,nt,Fr,$r,ut,Lr,Ur,ft,Hr,xr,Rr,Hs,js,zs,Js,qs;for(X=0;X<48;X+=2)Z=P[0]^P[10]^P[20]^P[30]^P[40],ie=P[1]^P[11]^P[21]^P[31]^P[41],ce=P[2]^P[12]^P[22]^P[32]^P[42],se=P[3]^P[13]^P[23]^P[33]^P[43],_e=P[4]^P[14]^P[24]^P[34]^P[44],ye=P[5]^P[15]^P[25]^P[35]^P[45],Te=P[6]^P[16]^P[26]^P[36]^P[46],ht=P[7]^P[17]^P[27]^P[37]^P[47],Ot=P[8]^P[18]^P[28]^P[38]^P[48],Ge=P[9]^P[19]^P[29]^P[39]^P[49],q=Ot^(ce<<1|se>>>31),V=Ge^(se<<1|ce>>>31),P[0]^=q,P[1]^=V,P[10]^=q,P[11]^=V,P[20]^=q,P[21]^=V,P[30]^=q,P[31]^=V,P[40]^=q,P[41]^=V,q=Z^(_e<<1|ye>>>31),V=ie^(ye<<1|_e>>>31),P[2]^=q,P[3]^=V,P[12]^=q,P[13]^=V,P[22]^=q,P[23]^=V,P[32]^=q,P[33]^=V,P[42]^=q,P[43]^=V,q=ce^(Te<<1|ht>>>31),V=se^(ht<<1|Te>>>31),P[4]^=q,P[5]^=V,P[14]^=q,P[15]^=V,P[24]^=q,P[25]^=V,P[34]^=q,P[35]^=V,P[44]^=q,P[45]^=V,q=_e^(Ot<<1|Ge>>>31),V=ye^(Ge<<1|Ot>>>31),P[6]^=q,P[7]^=V,P[16]^=q,P[17]^=V,P[26]^=q,P[27]^=V,P[36]^=q,P[37]^=V,P[46]^=q,P[47]^=V,q=Te^(Z<<1|ie>>>31),V=ht^(ie<<1|Z>>>31),P[8]^=q,P[9]^=V,P[18]^=q,P[19]^=V,P[28]^=q,P[29]^=V,P[38]^=q,P[39]^=V,P[48]^=q,P[49]^=V,$t=P[0],Lt=P[1],rt=P[11]<<4|P[10]>>>28,gr=P[10]<<4|P[11]>>>28,Xe=P[20]<<3|P[21]>>>29,nr=P[21]<<3|P[20]>>>29,js=P[31]<<9|P[30]>>>23,zs=P[30]<<9|P[31]>>>23,dr=P[40]<<18|P[41]>>>14,tt=P[41]<<18|P[40]>>>14,Ye=P[2]<<1|P[3]>>>31,ar=P[3]<<1|P[2]>>>31,Je=P[13]<<12|P[12]>>>20,Ut=P[12]<<12|P[13]>>>20,mr=P[22]<<10|P[23]>>>22,nt=P[23]<<10|P[22]>>>22,ir=P[33]<<13|P[32]>>>19,Ze=P[32]<<13|P[33]>>>19,Js=P[42]<<2|P[43]>>>30,qs=P[43]<<2|P[42]>>>30,Ur=P[5]<<30|P[4]>>>2,ft=P[4]<<30|P[5]>>>2,cr=P[14]<<6|P[15]>>>26,Qe=P[15]<<6|P[14]>>>26,Ht=P[25]<<11|P[24]>>>21,qe=P[24]<<11|P[25]>>>21,Fr=P[34]<<15|P[35]>>>17,$r=P[35]<<15|P[34]>>>17,sr=P[45]<<29|P[44]>>>3,or=P[44]<<29|P[45]>>>3,Wt=P[6]<<28|P[7]>>>4,We=P[7]<<28|P[6]>>>4,Hr=P[17]<<23|P[16]>>>9,xr=P[16]<<23|P[17]>>>9,lr=P[26]<<25|P[27]>>>7,ur=P[27]<<25|P[26]>>>7,jt=P[36]<<21|P[37]>>>11,zt=P[37]<<21|P[36]>>>11,ut=P[47]<<24|P[46]>>>8,Lr=P[46]<<24|P[47]>>>8,hr=P[8]<<27|P[9]>>>5,pr=P[9]<<27|P[8]>>>5,tr=P[18]<<20|P[19]>>>12,rr=P[19]<<20|P[18]>>>12,Rr=P[29]<<7|P[28]>>>25,Hs=P[28]<<7|P[29]>>>25,et=P[38]<<8|P[39]>>>24,fr=P[39]<<8|P[38]>>>24,Ve=P[48]<<14|P[49]>>>18,Vt=P[49]<<14|P[48]>>>18,P[0]=$t^~Je&Ht,P[1]=Lt^~Ut&qe,P[10]=Wt^~tr&Xe,P[11]=We^~rr&nr,P[20]=Ye^~cr&lr,P[21]=ar^~Qe&ur,P[30]=hr^~rt&mr,P[31]=pr^~gr&nt,P[40]=Ur^~Hr&Rr,P[41]=ft^~xr&Hs,P[2]=Je^~Ht&jt,P[3]=Ut^~qe&zt,P[12]=tr^~Xe&ir,P[13]=rr^~nr&Ze,P[22]=cr^~lr&et,P[23]=Qe^~ur&fr,P[32]=rt^~mr&Fr,P[33]=gr^~nt&$r,P[42]=
11Hr^~Rr&js,P[43]=xr^~Hs&zs,P[4]=Ht^~jt&Ve,P[5]=qe^~zt&Vt,P[14]=Xe^~ir&sr,P[15]=nr^~Ze&or,P[24]=lr^~et&dr,P[25]=ur^~fr&tt,P[34]=mr^~Fr&ut,P[35]=nt^~$r&Lr,P[44]=Rr^~js&Js,P[45]=Hs^~zs&qs,P[6]=jt^~Ve&$t,P[7]=zt^~Vt&Lt,P[16]=ir^~sr&Wt,P[17]=Ze^~or&We,P[26]=et^~dr&Ye,P[27]=fr^~tt&ar,P[36]=Fr^~ut&hr,P[37]=$r^~Lr&pr,P[46]=js^~Js&Ur,P[47]=zs^~qs&ft,P[8]=Ve^~$t&Je,P[9]=Vt^~Lt&Ut,P[18]=sr^~Wt&tr,P[19]=or^~We&rr,P[28]=dr^~Ye&cr,P[29]=tt^~ar&Qe,P[38]=ut^~hr&rt,P[39]=Lr^~pr&gr,P[48]=Js^~Ur&Hr,P[49]=qs^~ft&xr,P[0]^=b[X],P[1]^=b[X+1]};if(a)t.exports=p;else for(y=0;y<m.length;++y)i[m[y]]=p[m[y]]})()})(T7);var mF=T7.exports;const bF=zf(mF);function fi(t){return"0x"+bF.keccak_256(Nt(t))}const yF="rlp/5.8.0",ha=new ge(yF);function G8(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function V8(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function N7(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(s){n=n.concat(N7(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=G8(n.length);return i.unshift(247+i.length),i.concat(n)}c5(t)||ha.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(Nt(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=G8(e.length);return r.unshift(183+r.length),r.concat(e)}function cy(t){return Et(N7(t))}function W8(t,e,r,n){const i=[];for(;r<e+1+n;){const s=I7(t,r);i.push(s.result),r+=s.consumed,r>e+1+n&&ha.throwError("child data too short",ge.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function I7(t,e){if(t.length===0&&ha.throwError("data too short",ge.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&ha.throwError("data short segment too short",ge.errors.BUFFER_OVERRUN,{});const n=V8(t,e+1,r);return e+1+r+n>t.length&&ha.throwError("data long segment too short",ge.errors.BUFFER_OVERRUN,{}),W8(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&ha.throwError("data array too short",ge.errors.BUFFER_OVERRUN,{}),W8(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&ha.throwError("data array too short",ge.errors.BUFFER_OVERRUN,{});const n=V8(t,e+1,r);e+1+r+n>t.length&&ha.throwError("data array too short",ge.errors.BUFFER_OVERRUN,{});const i=Et(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&ha.throwError("data too short",ge.errors.BUFFER_OVERRUN,{});const n=Et(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Et(t[e])}}function u5(t){const e=Nt(t),r=I7(e,0);return r.consumed!==e.length&&ha.throwArgumentError("invalid rlp data","data",t),r.result}const vF="address/5.8.0",Pd=new ge(vF);function K8(t){Yr(t,20)||Pd.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Nt(fi(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const wF=9007199254740991;function EF(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const f5={};for(let t=0;t<10;t++)f5[String(t)]=String(t);for(let t=0;t<26;t++)f5[String.fromCharCode(65+t)]=String(10+t);const X8=Math.floor(EF(wF));function AF(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>f5[n]).join("");for(;e.length>=X8;){let n=e.substring(0,X8);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Jo(t){let e=null;if(typeof t!="string"&&Pd.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=K8(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Pd.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==AF(t)&&Pd.throwArgumentError("bad icap checksum","address",t),e=lF(t.substring(4));e.length<40;)e="0"+e;e=K8("0x"+e)}else Pd.throwArgumentError("invalid address","address",t);return e}function _F(t){let e=null;try{e=Jo(t.from)}catch{Pd.throwArgumentError("missing from address","transaction",t)}
11const r=ch(Nt(at.from(t.nonce).toHexString()));return Jo(Fi(fi(cy([e,r])),12))}const CF="0x0000000000000000000000000000000000000000",SF=at.from(0),TF="0x0000000000000000000000000000000000000000000000000000000000000000",NF="strings/5.8.0",x7=new ge(NF);var gp;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(gp||(gp={}));var xs;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(xs||(xs={}));function IF(t,e,r,n,i){return x7.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function R7(t,e,r,n,i){if(t===xs.BAD_PREFIX||t===xs.UNEXPECTED_CONTINUE){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t===xs.OVERRUN?r.length-e-1:0}function xF(t,e,r,n,i){return t===xs.OVERLONG?(n.push(i),0):(n.push(65533),R7(t,e,r))}const RF=Object.freeze({error:IF,ignore:R7,replace:xF});function P7(t,e){e==null&&(e=RF.error),t=Nt(t);const r=[];let n=0;for(;n<t.length;){const i=t[n++];if(!(i>>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(xs.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(xs.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(xs.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c<s;c++){let l=t[n];if((l&192)!=128){n+=e(xs.MISSING_CONTINUE,n,t,r),a=null;break}a=a<<6|l&63,n++}if(a!==null){if(a>1114111){n+=e(xs.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(xs.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(xs.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function Hc(t,e=gp.current){e!=gp.current&&(x7.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Nt(r)}function PF(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ly(t,e){return PF(P7(t,e))}function kF(t,e=gp.current){return P7(Hc(t,e))}function k7(t){return fi(Hc(t))}const O7="hash/5.8.0";function M7(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return Nt(e)}function D7(t){t=Nt(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function B7(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(s,o){n.call(s,function(a){o>0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function OF(t){const e={};for(let r=0;r<t.length;r++){const n=t[r];e[n[0]]=n[1]}return e}function MF(t){let e=0;function r(){return t[e++]<<8|t[e++]}let n=r(),i=1,s=[0,1];for(let O=1;O<n;O++)s.push(i+=r());let o=r(),a=e;e+=o;let c=0,l=0;function u(){return c==0&&(l=l<<8|t[e++],c=8),l>>--c&1}const f=31,d=Math.pow(2,f),h=d>>>1,g=h>>1,b=d-1;let w=0;for(let O=0;O<f;O++)w=w<<1|u();let x=[],k=0,R=d;for(;;){let O=Math.floor(((w-k+1)*i-1)/R),M=0,F=n;for(;F-M>1;){let G=M+F>>>1;O<s[G]?F=G:M=G}if(M==0)break;x.push(M);let H=k+Math.floor(R*s[M]/i),U=k+Math.floor(R*s[M+1]/i)-1;for(;!((H^U)&h);)w=w<<1&b|u(),H=H<<1&b,U=U<<1&b|1;for(;H&~U&g;)w=w&h|w<<1&b>>>1|u(),H=H<<1^h,U=(U^h)<<1|h|1;k=H,R=1+U-H}let D=n-4;return x.map(O=>{switch(O-D){case 3:return D+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return D+256+(t[a++]<<8|t[a++]);case 1:return D+t[a++];default:return O-1}})}function DF(t){let e=0;return()=>t[e++]}function BF(t){return DF(MF(t))}function FF(t){return t&1?~t>>1:t>>1}function $F(t,e){let r=Array(t);for(let n=0;n<t;n++)r[n]=1+e();return r}function Z8(t,e){let r=Array(t);for(let n=0,i=-1;n<t;n++)r[n]=i+=1+e();return r}function LF(t,e){let r=Array(t);for(let n=0,i=0;n<t;
11n++)r[n]=i+=FF(e());return r}function Wm(t,e){let r=Z8(t(),t),n=t(),i=Z8(n,t),s=$F(n,t);for(let o=0;o<n;o++)for(let a=0;a<s[o];a++)r.push(i[o]+a);return e?r.map(o=>e[o]):r}function UF(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(jF(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(zF(r,t))}return OF(B7(e))}function HF(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function F7(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;i<e;i++)LF(t,r).forEach((s,o)=>n[o].push(s));return n}function jF(t,e){let r=1+e(),n=e(),i=HF(e),s=F7(i.length,1+t,e);return B7(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(h=>h+d)]})}))}function zF(t,e){let r=1+e();return F7(r,1+t,e).map(i=>[i[0],i.slice(1)])}function JF(t){let e=Wm(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=Wm(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function qF(){return BF(M7
vendor: 14,757 bytes, line 11
11("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))
11}const uy=qF(),GF=new Set(Wm(uy)),VF=new Set(Wm(uy)),WF=UF(uy),KF=JF(uy),Y8=45,Q8=95;function $7(t){return kF(t)}function XF(t){return t.filter(e=>e!=65039)}function L7(t){for(let e of t.split(".")){let r=$7(e);try{for(let n=r.lastIndexOf(Q8)-1;n>=0;n--)if(r[n]!==Q8)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Y8&&r[3]===Y8)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function ZF(t){return L7(YF(t,XF))}function YF(t,e){let r=$7(t).reverse(),n=[];for(;r.length;){let i=e$(r);if(i){n.push(...e(i));continue}let s=r.pop();if(GF.has(s)){n.push(s);continue}if(VF.has(s))continue;let o=WF[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return L7(QF(String.fromCodePoint(...n)))}function QF(t){return t.normalize("NFC")}function e$(t,e){var r;let n=KF,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>
11l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const t$=new ge(O7),U7=new Uint8Array(32);U7.fill(0);function eA(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function H7(t){const e=Hc(ZF(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i<e.length;i++)e[i]===46&&(r.push(eA(e.slice(n,i))),n=i+1);if(n>=e.length)throw new Error("invalid ENS name; empty component");return r.push(eA(e.slice(n))),r}function mm(t){typeof t!="string"&&t$.throwArgumentError("invalid ENS name; not a string","name",t);let e=U7;const r=H7(t);for(;r.length;)e=fi(tf([e,fi(r.pop())]));return Et(e)}function r$(t){return Et(tf(H7(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}var n$=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const dn=new ge(O7),j7=new Uint8Array(32);j7.fill(0);const i$=at.from(-1),z7=at.from(0),J7=at.from(1),s$=at.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function o$(t){const e=Nt(t),r=e.length%32;return r?Ds([e,j7.slice(r)]):Et(e)}const a$=Mn(J7.toHexString(),32),c$=Mn(z7.toHexString(),32),tA={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},P2=["name","version","chainId","verifyingContract","salt"];function rA(t){return function(e){return typeof e!="string"&&dn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const l$={name:rA("name"),version:rA("version"),chainId:function(t){try{return at.from(t).toString()}catch{}return dn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Jo(t).toLowerCase()}catch{}return dn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=Nt(t);if(e.length!==32)throw new Error("bad length");return Et(e)}catch{}return dn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function k2(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&dn.throwArgumentError("invalid numeric width","type",t);const i=s$.mask(r?n-1:n),s=r?i.add(J7).mul(i$):z7;return function(o){const a=at.from(o);return(a.lt(s)||a.gt(i))&&dn.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),Mn(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&dn.throwArgumentError("invalid bytes width","type",t),function(n){return Nt(n).length!==r&&dn.throwArgumentError(`invalid length for ${t}`,"value",n),o$(n)}}}switch(t){case"address":return function(e){return Mn(Jo(e),32)};case"bool":return function(e){return e?a$:c$};case"bytes":return function(e){return fi(e)};case"string":return function(e){return k7(e)}}return null}function nA(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}let iA=class To{constructor(e){Zt(this,"types",Object.freeze(_f(e))),Zt(this,"_encoderCache",{}),Zt(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&dn.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&dn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!k2(u)&&(n[u]||dn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?dn.throwArgumentError("missing primary type","types",e):s.length>1&&dn.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Zt(this,"primaryType",s[0]);function o(a,c){c[a]&&dn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}
11`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=nA(a,e[a])+c.map(l=>nA(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=k2(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&dn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(fi)),fi(Ds(c))}}const n=this.types[e];if(n){const i=k7(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?fi(l):l});return o.unshift(i),Ds(o)}}return dn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||dn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return fi(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(k2(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&dn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):dn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new To(e)}static getPrimaryType(e){return To.from(e).primaryType}static hashStruct(e,r,n){return To.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=tA[n];i||dn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>P2.indexOf(n.name)-P2.indexOf(i.name)),To.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Ds(["0x1901",To.hashDomain(e),To.from(r).hash(n)])}static hash(e,r,n){return fi(To.encode(e,r,n))}static resolveNames(e,r,n,i){return n$(this,void 0,void 0,function*(){e=us(e);const s={};e.verifyingContract&&!Yr(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=To.from(r);o.visit(n,(a,c)=>(a==="address"&&!Yr(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){To.hashDomain(e);const i={},s=[];P2.forEach(c=>{const l=e[c];l!=null&&(i[c]=l$[c](l),s.push({name:c,type:tA[c]}))});const o=To.from(r),a=us(r);return a.EIP712Domain?dn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Et(Nt(l));if(c.match(/^u?int/))return at.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&dn.throwArgumentError("invalid string","value",l),l}return dn.throwArgumentError("unsupported type","type",c)})}}};const u$="abstract-provider/5.8.0";var f$=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const d$=new ge(u$);let h$=class extends gF{static isForkEvent(e){return!!(e&&e._isForkEvent)}},p$=class q7{constructor(){d$.checkAbstract(new.target,q7),Zt(this,"_isProvider",!0)}getFeeData(){return f$(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield li({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});
11let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=at.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}};const g$="abstract-signer/5.8.0";var bo=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const yo=new ge(g$),m$=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],b$=[ge.errors.INSUFFICIENT_FUNDS,ge.errors.NONCE_EXPIRED,ge.errors.REPLACEMENT_UNDERPRICED];let y$=class G7{constructor(){yo.checkAbstract(new.target,G7),Zt(this,"_isSigner",!0)}getBalance(e){return bo(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return bo(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return bo(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield li(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return bo(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield li(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return bo(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return bo(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return bo(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return bo(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return bo(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)m$.indexOf(n)===-1&&yo.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=us(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&yo.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return bo(this,void 0,void 0,function*(){const r=yield li(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>bo(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&yo.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?yo.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&yo.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&yo.throwError("network does not support EIP-1559",ge.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):yo.throwError("failed to get consistent fee data",ge.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLim
11it==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(b$.indexOf(i.code)>=0)throw i;return yo.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ge.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&yo.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield li(r)})}_checkProvider(e){this.provider||yo.throwError("missing provider",ge.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};var V7={},Gt={},C1=W7;function W7(t,e){if(!t)throw new Error(e||"Assertion failed")}W7.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Qw={exports:{}};typeof Object.create=="function"?Qw.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Qw.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var v$=Qw.exports,w$=C1,E$=v$;Gt.inherits=E$;function A$(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function _$(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=s&63|128):A$(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i<t.length;i++)r[i]=t[i]|0;return r}Gt.toArray=_$;function C$(t){for(var e="",r=0;r<t.length;r++)e+=X7(t[r].toString(16));return e}Gt.toHex=C$;function K7(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Gt.htonl=K7;function S$(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=K7(i)),r+=Z7(i.toString(16))}return r}Gt.toHex32=S$;function X7(t){return t.length===1?"0"+t:t}Gt.zero2=X7;function Z7(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}Gt.zero8=Z7;function T$(t,e,r,n){var i=r-e;w$(i%4===0);for(var s=new Array(i/4),o=0,a=e;o<s.length;o++,a+=4){var c;n==="big"?c=t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:c=t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[o]=c>>>0}return s}Gt.join32=T$;function N$(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];e==="big"?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Gt.split32=N$;function I$(t,e){return t>>>e|t<<32-e}Gt.rotr32=I$;function x$(t,e){return t<<e|t>>>32-e}Gt.rotl32=x$;function R$(t,e){return t+e>>>0}Gt.sum32=R$;function P$(t,e,r){return t+e+r>>>0}Gt.sum32_3=P$;function k$(t,e,r,n){return t+e+r+n>>>0}Gt.sum32_4=k$;function O$(t,e,r,n,i){return t+e+r+n+i>>>0}Gt.sum32_5=O$;function M$(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o}Gt.sum64=M$;function D$(t,e,r,n){var i=e+n>>>0,s=(i<e?1:0)+t+r;return s>>>0}Gt.sum64_hi=D$;function B$(t,e,r,n){var i=e+n;return i>>>0}Gt.sum64_lo=B$;function F$(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l<e?1:0,l=l+s>>>0,c+=l<s?1:0,l=l+a>>>0,c+=l<a?1:0;var u=t+r+i+o+c;return u>>>0}Gt.sum64_4_hi=F$;function $$(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Gt.sum64_4_lo=$$;function L$(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f<e?1:0,f=f+s>>>0,u+=f<s?1:0,f=f+a>>>0,u+=f<a?1:0,f=f+l>>>0,u+=f<l?1:0;var d=t+r+i+o+c+u;return d>>>0}Gt.sum64_5_hi=L$;function U$(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}Gt.sum64_5_lo=U$;function H$(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Gt.rotr64_hi=H$;function j$(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Gt.rotr64_lo=j$;function z$(t,e,r){return t>>>r}Gt.shr64_hi=z$;function J$(t,e,r){var n=t<<32-r|e>>
11>r;return n>>>0}Gt.shr64_lo=J$;var Fh={},sA=Gt,q$=C1;function fy(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Fh.BlockHash=fy;fy.prototype.update=function(e,r){if(e=sA.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=sA.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this};fy.prototype.digest=function(e){return this.update(this._pad()),q$(this.pending===null),this._digest(e)};fy.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o<this.padLength;o++)i[s++]=0;return i};var $h={},rc={},G$=Gt,xa=G$.rotr32;function V$(t,e,r,n){if(t===0)return Y7(e,r,n);if(t===1||t===3)return eN(e,r,n);if(t===2)return Q7(e,r,n)}rc.ft_1=V$;function Y7(t,e,r){return t&e^~t&r}rc.ch32=Y7;function Q7(t,e,r){return t&e^t&r^e&r}rc.maj32=Q7;function eN(t,e,r){return t^e^r}rc.p32=eN;function W$(t){return xa(t,2)^xa(t,13)^xa(t,22)}rc.s0_256=W$;function K$(t){return xa(t,6)^xa(t,11)^xa(t,25)}rc.s1_256=K$;function X$(t){return xa(t,7)^xa(t,18)^t>>>3}rc.g0_256=X$;function Z$(t){return xa(t,17)^xa(t,19)^t>>>10}rc.g1_256=Z$;var lh=Gt,Y$=Fh,Q$=rc,O2=lh.rotl32,Yh=lh.sum32,eL=lh.sum32_5,tL=Q$.ft_1,tN=Y$.BlockHash,rL=[1518500249,1859775393,2400959708,3395469782];function La(){if(!(this instanceof La))return new La;tN.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}lh.inherits(La,tN);var nL=La;La.blockSize=512;La.outSize=160;La.hmacStrength=80;La.padLength=64;La.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=O2(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],l=this.h[4];for(i=0;i<n.length;i++){var u=~~(i/20),f=eL(O2(s,5),tL(u,o,a,c),l,n[i],rL[u]);l=c,c=a,a=O2(o,30),o=s,s=f}this.h[0]=Yh(this.h[0],s),this.h[1]=Yh(this.h[1],o),this.h[2]=Yh(this.h[2],a),this.h[3]=Yh(this.h[3],c),this.h[4]=Yh(this.h[4],l)};La.prototype._digest=function(e){return e==="hex"?lh.toHex32(this.h,"big"):lh.split32(this.h,"big")};var uh=Gt,iL=Fh,Lh=rc,sL=C1,vo=uh.sum32,oL=uh.sum32_4,aL=uh.sum32_5,cL=Lh.ch32,lL=Lh.maj32,uL=Lh.s0_256,fL=Lh.s1_256,dL=Lh.g0_256,hL=Lh.g1_256,rN=iL.BlockHash,pL=[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];function Ua(){if(!(this instanceof Ua))return new Ua;rN.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=pL,this.W=new Array(64)}uh.inherits(Ua,rN);var nN=Ua;Ua.blockSize=512;Ua.outSize=256;Ua.hmacStrength=192;Ua.padLength=64;Ua.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=oL(hL(n[i-2]),n[i-7],dL(n[i-15]),n[i-16]);var s=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],l=this.h[4],u=this.h[5],f=this.h[6],d=this.h[7];for(sL(this.k.length===n.length),i=0;i<n.length;i++){var h=aL(d,fL(l),cL(l,u,f),this.k[i],n[i]),g=vo(uL(s),lL(s,o,a));d=f,f=u,u=l,l=vo(c,h),c=a,a=o,o=s,s=vo(h,g)}this.h[0]=vo(this.h[0],s),this.h[1]=vo(this.h[1],o),this.h[2]=vo(this.h[2],a),this.h[3]=vo(this.h[3],c),this.h[4]=vo(this.h[4],l),this.h[5]=vo(this.h[5],u),this.h[6]=vo(this.h[6],f),this.h[7]=vo(this.h[7],d)};Ua.prototype._digest=function(e){return e==="hex"?uh.toHex32(this.h,"big"):uh.split32(this.h,"big")};var e3=Gt,iN=nN;function jc(){if(!(this instanceof jc))return new jc;iN.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}e3.inherits(jc,iN);var gL=jc;jc.blockSize=512;jc.outSize=224;jc.hmacStrength=192;jc.padLength=64;jc.prototype._digest=function(e){return e==="hex"?e3.toHex32(this.h.slice(0,7),"big"):e3.split32(this.h.slice(0,7),"big")};var bs=Gt,mL=Fh,bL=C1,Ra=bs.rotr64_hi,Pa=bs.rotr64_lo,sN=bs.shr64_hi,oN=bs.shr64_lo,il=bs.sum64,M2=bs.sum64_hi,D2=bs.sum64_lo,yL=bs.sum64_4_hi,vL=bs.sum64_4_lo,wL=bs.sum64_5_hi,EL=bs.sum64_5_lo,aN=mL.BlockHash,AL=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
111322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function qo(){if(!(this instanceof qo))return new qo;aN.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=AL,this.W=new Array(160)}bs.inherits(qo,aN);var cN=qo;qo.blockSize=1024;qo.outSize=512;qo.hmacStrength=192;qo.padLength=128;qo.prototype._prepareBlock=function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var s=OL(n[i-4],n[i-3]),o=ML(n[i-4],n[i-3]),a=n[i-14],c=n[i-13],l=PL(n[i-30],n[i-29]),u=kL(n[i-30],n[i-29]),f=n[i-32],d=n[i-31];n[i]=yL(s,o,a,c,l,u,f,d),n[i+1]=vL(s,o,a,c,l,u,f,d)}};qo.prototype._update=function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],f=this.h[7],d=this.h[8],h=this.h[9],g=this.h[10],b=this.h[11],w=this.h[12],x=this.h[13],k=this.h[14],R=this.h[15];bL(this.k.length===n.length);for(var D=0;D<n.length;D+=2){var O=k,M=R,F=xL(d,h),H=RL(d,h),U=_L(d,h,g,b,w),G=CL(d,h,g,b,w,x),N=this.k[D],A=this.k[D+1],v=n[D],p=n[D+1],m=wL(O,M,F,H,U,G,N,A,v,p),y=EL(O,M,F,H,U,G,N,A,v,p);O=NL(i,s),M=IL(i,s),F=SL(i,s,o,a,c),H=TL(i,s,o,a,c,l);var T=M2(O,M,F,H),I=D2(O,M,F,H);k=w,R=x,w=g,x=b,g=d,b=h,d=M2(u,f,m,y),h=D2(f,f,m,y),u=c,f=l,c=o,l=a,o=i,a=s,i=M2(m,y,T,I),s=D2(m,y,T,I)}il(this.h,0,i,s),il(this.h,2,o,a),il(this.h,4,c,l),il(this.h,6,u,f),il(this.h,8,d,h),il(this.h,10,g,b),il(this.h,12,w,x),il(this.h,14,k,R)};qo.prototype._digest=function(e){return e==="hex"?bs.toHex32(this.h,"big"):bs.split32(this.h,"big")};function _L(t,e,r,n,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function CL(t,e,r,n,i,s){var o=e&n^~e&s;return o<0&&(o+=4294967296),o}function SL(t,e,r,n,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function TL(t,e,r,n,i,s){var o=e&n^e&s^n&s;return o<0&&(o+=4294967296),o}function NL(t,e){var r=Ra(t,e,28),n=Ra(e,t,2),i=Ra(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function IL(t,e){var r=Pa(t,e,28),n=Pa(e,t,2),i=Pa(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function xL(t,e){var r=Ra(t,e,14),n=Ra(t,e,18),i=Ra(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function RL(t,e){var r=Pa(t,e,14),n=Pa(t,e,18),i=Pa(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function PL(t,e){var r=Ra(t,e,1),n=Ra(t,e,8),i=sN(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function kL(t,e){var r=Pa(t,e,1),n=Pa(t,e,8),i=oN(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function OL(t,e){var r=Ra(t,e,19),n=Ra(e,t,29),i=sN(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}function ML(t,e){var r=Pa(t,e,19),n=Pa(e,t,29),i=oN(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}var t3=Gt,lN=cN;function zc(){if(!(this instanceof zc))return new zc;lN.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}t3.inherits(zc,lN);var DL=zc;zc.blockSize=1024;zc.outSize=384;zc.hmacStrength=192;zc.padLength=128;zc.prototype._digest=function(e){return e==="hex"?t3.toHex32(this.h.slice(0,12),"big"):t3.split32(this.h.slice(0,12),"big")};$h.sha1=nL;$h.sha224=gL;$h.sha256=nN;$h.sha384=DL;$h.sha512=cN;var uN={},Cf=Gt,BL=Fh,hg=Cf.rotl32,oA=Cf.sum32,Qh=Cf.sum32_3,aA=Cf.sum32_4,fN=BL.BlockHash;function Ha(){if(!(this instanceof Ha))return new Ha;fN.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Cf.inherits(Ha,fN);uN.ripemd160=Ha;Ha.blockSize=512;Ha.outSize=160;Ha.hmacStrength=192;Ha.padLength=64;Ha.prototype._update=function(e,r){for(var n=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],c=n,l=i,u=s,f=o,d=a,h=0;h<80;h++){var g=oA(hg(aA(n,cA(h,i,s,o),e[LL[h]+r],FL(h)),HL[h]),a);n=a,a=o,o=hg(s,10),s=i,i=g,g=oA(hg(aA(c,cA(79-h,l,u,f),e[UL[h]+r],$L(h)),jL[h]),d),c=d,d=f,f=hg(u,10),u=l,l=g}g=Qh(this.h[1],s,f),this.h[1]=Qh(this.h[2],o,d),this.h[2]=Qh(this.h[3],a,c),this.h[3]=Qh(this.h[4],n,l),this.h[4]=Qh(this.h[0],i,u),this.h[0]=g};Ha.prototype._digest=function(e){return e==="hex"?Cf.toHex32(this.h,"little"):Cf.split32(this.h,"little")};function cA(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function FL(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function $L(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var LL=[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],UL=[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],HL=[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],jL=[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],zL=Gt,JL=C1;function fh(t,e,r){if(!(this instanceof fh))return new fh(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(zL.toArray(e,r))}var qL=fh;fh.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),JL(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)};fh.prototype.update=function(e,r){return this.inner.update(e,r),this};fh.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};(function(t){var e=t;e.utils=Gt,e.common=Fh,e.sha=$h,e.ripemd=uN,e.hmac=qL,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160})(V7);const la=zf(V7);function Uh(t,e,r){return r={path:e,exports:{},require:function(n,i){return GL(n,i??r.path)}},t(r,r.exports),r.exports}function GL(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var d5=dN;function dN(t,e){if(!t)throw new Error(e||"Assertion failed")}dN.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var $o=Uh(function(t,e){var r=e;function n(o,a){if(Array.isArray(o))return o.slice();if(!o)return[];var c=[];if(typeof o!="string"){for(var l=0;l<o.length;l++)c[l]=o[l]|0;return c}if(a==="hex"){o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o);for(var l=0;l<o.length;l+=2)c.push(parseInt(o[l]+o[l+1],16))}else for(var l=0;l<o.length;
11l++){var u=o.charCodeAt(l),f=u>>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c<o.length;c++)a+=i(o[c].toString(16));return a}r.toHex=s,r.encode=function(a,c){return c==="hex"?s(a):a}}),Ls=Uh(function(t,e){var r=e;r.assert=d5,r.toArray=$o.toArray,r.zero2=$o.zero2,r.toHex=$o.toHex,r.encode=$o.encode;function n(c,l,u){var f=new Array(Math.max(c.bitLength(),u)+1),d;for(d=0;d<f.length;d+=1)f[d]=0;var h=1<<l+1,g=c.clone();for(d=0;d<f.length;d++){var b,w=g.andln(h-1);g.isOdd()?(w>(h>>1)-1?b=(h>>1)-w:b=w,g.isubn(b)):b=0,f[d]=b,g.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var g=c.andln(3)+f&3,b=l.andln(3)+d&3;g===3&&(g=-1),b===3&&(b=-1);var w;g&1?(h=c.andln(7)+f&7,(h===3||h===5)&&b===2?w=-g:w=g):w=0,u[0].push(w);var x;b&1?(h=l.andln(7)+d&7,(h===3||h===5)&&g===2?x=-b:x=b):x=0,u[1].push(x),2*f===w+1&&(f=1-f),2*d===x+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new ct(c,"hex","le")}r.intFromLE=a}),Km=Ls.getNAF,VL=Ls.getJSF,Xm=Ls.assert;function pu(t,e){this.type=t,this.p=new ct(e.p,16),this.red=e.prime?ct.red(e.prime):ct.mont(this.p),this.zero=new ct(0).toRed(this.red),this.one=new ct(1).toRed(this.red),this.two=new ct(2).toRed(this.red),this.n=e.n&&new ct(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Jf=pu;pu.prototype.point=function(){throw new Error("Not implemented")};pu.prototype.validate=function(){throw new Error("Not implemented")};pu.prototype._fixedNafMul=function(e,r){Xm(e.precomputed);var n=e._getDoubles(),i=Km(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var o=[],a,c;for(a=0;a<i.length;a+=n.step){c=0;for(var l=a+n.step-1;l>=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a<o.length;a++)c=o[a],c===d?f=f.mixedAdd(n.points[a]):c===-d&&(f=f.mixedAdd(n.points[a].neg()));u=u.add(f)}return u.toP()};pu.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,o=Km(r,n,this._bitLength),a=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];Xm(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};pu.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u<i;u++){d=r[u];var h=d._getNAFPoints(e);o[u]=h.wnd,a[u]=h.points}for(u=i-1;u>=1;u-=2){var g=u-1,b=u;if(o[g]!==1||o[b]!==1){c[g]=Km(n[g],o[g],this._bitLength),c[b]=Km(n[b],o[b],this._bitLength),l=Math.max(c[g].length,l),l=Math.max(c[b].length,l);continue}
11var w=[r[g],null,null,r[b]];r[g].y.cmp(r[b].y)===0?(w[1]=r[g].add(r[b]),w[2]=r[g].toJ().mixedAdd(r[b].neg())):r[g].y.cmp(r[b].y.redNeg())===0?(w[1]=r[g].toJ().mixedAdd(r[b]),w[2]=r[g].add(r[b].neg())):(w[1]=r[g].toJ().mixedAdd(r[b]),w[2]=r[g].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],k=VL(n[g],n[b]);for(l=Math.max(k[0].length,l),c[g]=new Array(l),c[b]=new Array(l),f=0;f<l;f++){var R=k[0][f]|0,D=k[1][f]|0;c[g][f]=x[(R+1)*3+(D+1)],c[b][f]=0,a[g]=w}}var O=this.jpoint(null,null,null),M=this._wnafT4;for(u=l;u>=0;u--){for(var F=0;u>=0;){var H=!0;for(f=0;f<i;f++)M[f]=c[f][u]|0,M[f]!==0&&(H=!1);if(!H)break;F++,u--}if(u>=0&&F++,O=O.dblp(F),u<0)break;for(f=0;f<i;f++){var U=M[f];U!==0&&(U>0?d=a[f][U-1>>1]:U<0&&(d=a[f][-U-1>>1].neg()),d.type==="affine"?O=O.mixedAdd(d):O=O.add(d))}}for(u=0;u<i;u++)a[u]=null;return s?O:O.toP()};function lo(t,e){this.curve=t,this.type=e,this.precomputed=null}pu.BasePoint=lo;lo.prototype.eq=function(){throw new Error("Not implemented")};lo.prototype.validate=function(){return this.curve.validate(this)};pu.prototype.decodePoint=function(e,r){e=Ls.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Xm(e[e.length-1]%2===0):e[0]===7&&Xm(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};lo.prototype.encodeCompressed=function(e){return this.encode(e,!0)};lo.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};lo.prototype.encode=function(e,r){return Ls.encode(this._encode(r),e)};lo.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};lo.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};lo.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<r;s+=e){for(var o=0;o<e;o++)i=i.dbl();n.push(i)}return{step:e,points:n}};lo.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(i);return{wnd:e,points:r}};lo.prototype._getBeta=function(){return null};lo.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r};var h5=Uh(function(t){typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),WL=Ls.assert;function uo(t){Jf.call(this,"short",t),this.a=new ct(t.a,16).toRed(this.red),this.b=new ct(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}h5(uo,Jf);var KL=uo;uo.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ct(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new ct(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],WL(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var o;return e.basis?o=e.basis.map(function(a){return{a:new ct(a.a,16),b:new ct(a.b,16)}}):o=this._getEndoBasis(n),{beta:r,lambda:n,basis:o}}};uo.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:ct.mont(e),n=new ct(2).toRed(r).redInvm(),i=n.redNeg(),s=new ct(3).toRed(r).redNeg().redSqrt().redMul(n),o=i.redAdd(s).fromRed(),a=i.redSub(s).fromRed();return[o,a]};uo.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new ct(1),o=new ct(0),a=new ct(0),c=new ct(1),l,u,f,d,h,g,b,w=0,x,k;n.cmpn(0)!==0;){var R=i.div(n);x=i.sub(R.mul(n)),k=a.sub(R.mul(s));var D=c.sub(R.mul(o));if(!f&&x.cmp(r)<0)l=b.neg(),u=s,f=x.neg(),d=k;else if(f&&++w===2)break;b=x,i=n,n=x,a=s,s=k,c=o,o=D}h=x.neg(),g=k;var O=f.sqr().add(d.sqr()),M=h.sqr().add(g.sqr());return M.cmp(O)>=0&&(h=l,g=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),g=g.neg()),[{a:f,b
11:d},{a:h,b:g}]};uo.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};uo.prototype.pointFromX=function(e,r){e=new ct(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};uo.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};uo.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(r[o]),c=e[o],l=c._getBeta();a.k1.negative&&(a.k1.ineg(),c=c.neg(!0)),a.k2.negative&&(a.k2.ineg(),l=l.neg(!0)),i[o*2]=c,i[o*2+1]=l,s[o*2]=a.k1,s[o*2+1]=a.k2}for(var u=this._wnafMulAdd(1,i,s,o*2,n),f=0;f<o*2;f++)i[f]=null,s[f]=null;return u};function ri(t,e,r,n){Jf.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ct(e,16),this.y=new ct(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}h5(ri,Jf.BasePoint);uo.prototype.point=function(e,r,n){return new ri(this,e,r,n)};uo.prototype.pointFromJSON=function(e,r){return ri.fromJSON(this,e,r)};ri.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=function(s){return n.point(s.x.redMul(n.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};ri.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};ri.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function s(a){return e.point(a[0],a[1],n)}var o=r[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(s))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(s))}},i};ri.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};ri.prototype.isInfinity=function(){return this.inf};ri.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};ri.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};ri.prototype.getX=function(){return this.x.fromRed()};ri.prototype.getY=function(){return this.y.fromRed()};ri.prototype.mul=function(e){return e=new ct(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};ri.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};ri.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};ri.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};ri.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());
vendor: 4,851 bytes, line 11
11if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};ri.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function hi(t,e,r,n){Jf.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ct(0)):(this.x=new ct(e,16),this.y=new ct(r,16),this.z=new ct(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}h5(hi,Jf.BasePoint);uo.prototype.jpoint=function(e,r,n){return new hi(this,e,r,n)};hi.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};hi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};hi.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),g=l.redMul(d.redISub(h)).redISub(o.redMul(f)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,g,b)};hi.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),g=this.z.redMul(a);return this.curve.jpoint(d,h,g)};hi.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,o=this.x,a=this.y,c=this.z,l=c.redSqr().redSqr(),u=a.redAdd(a);for(r=0;r<e;r++){var f=o.redSqr(),d=u.redSqr(),h=d.redSqr(),g=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(l)),b=o.redMul(d),w=g.redSqr().redISub(b.redAdd(b)),x=b.redISub(w),k=g.redMul(x);k=k.redIAdd(k).redISub(h);var R=u.redMul(c);r+1<e&&(l=l.redMul(h)),o=w,c=R,u=k}return this.curve.jpoint(o,u.redMul(s),c)};hi.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};hi.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var c=i.redAdd(i).redIAdd(i),l=c.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=u.redIAdd(u),u=u.redIAdd(u),e=l,r=c.redMul(a.redISub(l)).redISub(u),n=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),g=this.x.redAdd(d).redSqr().redISub(f).redISub(h);g=g.redIAdd(g);var b=f.redAdd(f).redIAdd(f),w=b.redSqr(),x=h.redIAdd(h);x=x.redIAdd(x),x=x.redIAdd(x),e=w.redISub(g).redISub(g),r=b.redMul(g.redISub(e)).redISub(x),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};hi.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var c=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),l=c.redSqr().redISub(a).redISub(a);e=l;var u=o.redIAdd(o);u=u.redIAdd(u),u=u.redIAdd(u),r=c.redMul(a.redISub(l)).redISub(u),n=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),g=this.x.redSub(f).redMul(this.x.redAdd(f));g=g.redAdd(g).redIAdd(g);var b=h.redIAdd(h);b=b.redIAdd(b);var w=b.redAdd(b);e=g.redSqr().redISub(w),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(f);var x=d.redSqr();x=x.redIAdd(x),x=x.redIAdd(x),x=x.redIAdd(x),r=g.redMul(b.redISub(e)).redISub(x)}return this.curve.jpoint(e,r,n)};hi.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),o=r.redSqr(),a=n.redSqr(),c=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(s)),l=r.redAdd(r);l=l.redIAdd(l);var u=l.redMul(a),f=c.redSqr().redISub(u.redAdd(u)),d=u.redISub(f),h=a.redSqr();h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=c.redMul(d).redISub(h),b=n.redAdd(n).redMul(i);return this.curve.jpoint(f,g,b)};hi.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
11var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),s=e.redAdd(e).redIAdd(e),o=s.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(o);var c=a.redSqr(),l=i.redIAdd(i);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var u=s.redIAdd(a).redSqr().redISub(o).redISub(c).redISub(l),f=r.redMul(u);f=f.redIAdd(f),f=f.redIAdd(f);var d=this.x.redMul(c).redISub(f);d=d.redIAdd(d),d=d.redIAdd(d);var h=this.y.redMul(u.redMul(l.redISub(u)).redISub(a.redMul(c)));h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=this.z.redAdd(a).redSqr().redISub(n).redISub(c);return this.curve.jpoint(d,h,g)};hi.prototype.mul=function(e,r){return e=new ct(e,r),this.curve._wnafMul(this,e)};hi.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0};hi.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};hi.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};hi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var bm=Uh(function(t,e){var r=e;r.base=Jf,r.short=KL,r.mont=null,r.edwards=null}),ym=Uh(function(t,e){var r=e,n=Ls.assert;function i(a){a.type==="short"?this.curve=new bm.short(a):a.type==="edwards"?this.curve=new bm.edwards(a):this.curve=new bm.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:la.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:la.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:la.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:la.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:la.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:la.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:la.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:la.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
11,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function eu(t){if(!(this instanceof eu))return new eu(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=$o.toArray(t.entropy,t.entropyEnc||"hex"),r=$o.toArray(t.nonce,t.nonceEnc||"hex"),n=$o.toArray(t.pers,t.persEnc||"hex");d5(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var hN=eu;eu.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};eu.prototype._hmac=function(){return new la.hmac(this.hash,this.K)};eu.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};eu.prototype.reseed=function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=$o.toArray(e,r),n=$o.toArray(n,i),d5(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};eu.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=$o.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(n),this._reseed++,$o.encode(o,r)};var r3=Ls.assert;function xi(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var p5=xi;xi.fromPublic=function(e,r,n){return r instanceof xi?r:new xi(e,{pub:r,pubEnc:n})};xi.fromPrivate=function(e,r,n){return r instanceof xi?r:new xi(e,{priv:r,privEnc:n})};xi.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};xi.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};xi.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};xi.prototype._importPrivate=function(e,r){this.priv=new ct(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};xi.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?r3(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&r3(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};xi.prototype.derive=function(e){return e.validate()||r3(e.validate(),"public point not validated"),e.mul(this.priv).getX()};xi.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};xi.prototype.verify=function(e,r,n){return this.ec.verify(e,r,this,void 0,n)};xi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var XL=Ls.assert;function dy(t,e){if(t instanceof dy)return t;this._importDER(t,e)||(XL(t.r&&t.s,"Signature without r or s"),this.r=new ct(t.r,16),this.s=new ct(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var hy=dy;function ZL(){this.place=0}function B2(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,s=0,o=e.place;s<n;s++,o++)i<<=8,i|=t[o],i>>>=0;return i<=127?!1:(e.place=o,i)}function lA(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}dy.prototype._importDER=function(e,r){e=Ls.toArray(e,r);var n=new ZL;if(e[n.place++]!==48)return!1;var i=B2(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=B2(e,n);if(s===!1||e[n.place]&128)return!1;var o=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var a=B2(e,n);if(a===!1||e.length!==a+n.place||e[n.place]&128)return!1;var c=e.slice(n.place,a+n.place);
11if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new ct(o),this.s=new ct(c),this.recoveryParam=null,!0};function F2(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}dy.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=lA(r),n=lA(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];F2(i,r.length),i=i.concat(r),i.push(2),F2(i,n.length);var s=i.concat(n),o=[48];return F2(o,s.length),o=o.concat(s),Ls.encode(o,e)};var YL=function(){throw new Error("unsupported")},Vu=Ls.assert;function io(t){if(!(this instanceof io))return new io(t);typeof t=="string"&&(Vu(Object.prototype.hasOwnProperty.call(ym,t),"Unknown curve "+t),t=ym[t]),t instanceof ym.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var QL=io;io.prototype.keyPair=function(e){return new p5(this,e)};io.prototype.keyFromPrivate=function(e,r){return p5.fromPrivate(this,e,r)};io.prototype.keyFromPublic=function(e,r){return p5.fromPublic(this,e,r)};io.prototype.genKeyPair=function(e){e||(e={});for(var r=new hN({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||YL(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ct(2));;){var s=new ct(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};io.prototype._truncateToN=function(e,r,n){var i;if(ct.isBN(e)||typeof e=="number")e=new ct(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new ct(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new ct(s,16)}typeof n!="number"&&(n=i*8);var o=n-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};io.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!ct.isBN(e)){Vu(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),Vu(e.length>>>0===e.length);for(var s=0;s<e.length;s++)Vu((e[s]&255)===e[s])}r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength),Vu(!e.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),c=e.toArray("be",o);Vu(new ct(c).eq(e),"Can not sign message");for(var l=new hN({hash:this.hash,entropy:a,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ct(1)),f=0;;f++){var d=i.k?i.k(f):new ct(l.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),!(d.cmpn(1)<=0||d.cmp(u)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var g=h.getX(),b=g.umod(this.n);if(b.cmpn(0)!==0){var w=d.invm(this.n).mul(b.mul(r.getPrivate()).iadd(e));if(w=w.umod(this.n),w.cmpn(0)!==0){var x=(h.getY().isOdd()?1:0)|(g.cmp(b)!==0?2:0);return i.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),x^=1),new hy({r:b,s:w,recoveryParam:x})}}}}}};io.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new hy(r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),l=c.mul(e).umod(this.n),u=c.mul(o).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(o)):(f=this.g.mulAdd(l,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(o)===0)};io.prototype.recoverPubKey=function(t,e,r,n){Vu((3&r)===r,"The recovery param is more than two bits"),e=new hy(e,n);var i=this.n,s=new ct(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};io.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new hy(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var eU=Uh(function(t,e){var r=e;r.version="6.6.1",r.utils=Ls,r.rand=function(){throw new Error("unsupported")},r.curve=bm,r.curves=ym,r.ec=QL,r.eddsa=null}),tU=eU.ec;const rU="signing-key/5.8.0",n3=new ge(rU);let $2=null;function ga(){return $2||($2=new tU("secp256k1")),$2}let nU=class{constructor(e){Zt(this,"curve","secp256k1"),Zt(this,"privateKey",Et(e)),Af(this.privateKey)!==32&&n3.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ga().keyFromPrivate(Nt(this.privateKey));Zt(this,"publicKey","0x"+r.getPublic(!1,"hex")),Zt(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Zt(this,"_isSigningKey",!0)}_addPoint(e){const r=ga().keyFromPublic(Nt(this.publicKey)),n=ga().keyFromPublic(Nt(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}
11signDigest(e){const r=ga().keyFromPrivate(Nt(this.privateKey)),n=Nt(e);n.length!==32&&n3.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return ay({recoveryParam:i.recoveryParam,r:Mn("0x"+i.r.toString(16),32),s:Mn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=ga().keyFromPrivate(Nt(this.privateKey)),n=ga().keyFromPublic(Nt(pN(e)));return Mn("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function iU(t,e){const r=ay(e),n={r:Nt(r.r),s:Nt(r.s)};return"0x"+ga().recoverPubKey(Nt(t),n,r.recoveryParam).encode("hex",!1)}function pN(t,e){const r=Nt(t);if(r.length===32){const n=new nU(r);return e?"0x"+ga().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?Et(r):"0x"+ga().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+ga().keyFromPublic(r).getPublic(!0,"hex"):Et(r)}return n3.throwArgumentError("invalid public or private key","key","[REDACTED]")}const sU="transactions/5.8.0",el=new ge(sU);var uA;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(uA||(uA={}));function g5(t){return t==="0x"?null:Jo(t)}function Ni(t){return t==="0x"?SF:at.from(t)}function oU(t){const e=pN(t);return Jo(Fi(fi(Fi(e,1)),12))}function gN(t,e){return oU(iU(Nt(t),e))}function Rs(t,e){const r=ch(at.from(t).toHexString());return r.length>32&&el.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function L2(t,e){return{address:Jo(t),storageKeys:(e||[]).map((r,n)=>(Af(r)!==32&&el.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function S1(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&el.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),L2(r[0],r[1])):L2(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return L2(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function mN(t){return S1(t).map(e=>[e.address,e.storageKeys])}function aU(t,e){if(t.gasPrice!=null){const n=at.from(t.gasPrice),i=at.from(t.maxFeePerGas||0);n.eq(i)||el.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[Rs(t.chainId||0,"chainId"),Rs(t.nonce||0,"nonce"),Rs(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Rs(t.maxFeePerGas||0,"maxFeePerGas"),Rs(t.gasLimit||0,"gasLimit"),t.to!=null?Jo(t.to):"0x",Rs(t.value||0,"value"),t.data||"0x",mN(t.accessList||[])];if(e){const n=ay(e);r.push(Rs(n.recoveryParam,"recoveryParam")),r.push(ch(n.r)),r.push(ch(n.s))}return Ds(["0x02",cy(r)])}function cU(t,e){const r=[Rs(t.chainId||0,"chainId"),Rs(t.nonce||0,"nonce"),Rs(t.gasPrice||0,"gasPrice"),Rs(t.gasLimit||0,"gasLimit"),t.to!=null?Jo(t.to):"0x",Rs(t.value||0,"value"),t.data||"0x",mN(t.accessList||[])];if(e){const n=ay(e);r.push(Rs(n.recoveryParam,"recoveryParam")),r.push(ch(n.r)),r.push(ch(n.s))}return Ds(["0x01",cy(r)])}function bN(t,e,r){try{const n=Ni(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{el.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Mn(e[1],32),t.s=Mn(e[2],32);try{const n=fi(r(t));t.from=gN(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function lU(t){const e=u5(t.slice(1));e.length!==9&&e.length!==12&&el.throwArgumentError("invalid component count for transaction type: 2","payload",Et(t));const r=Ni(e[2]),n=Ni(e[3]),i={type:2,chainId:Ni(e[0]).toNumber(),nonce:Ni(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ni(e[4]),to:g5(e[5]),value:Ni(e[6]),data:e[7],accessList:S1(e[8])};return e.length===9||(i.hash=fi(t),bN(i,e.slice(9),aU)),i}function uU(t){const e=u5(t.slice(1));e.length!==8&&e.length!==11&&el.throwArgumentError("invalid component count for transaction type: 1","payload",Et(t));const r={type:1,chainId:Ni(e[0]).toNumber(),nonce:Ni(e[1]).toNumber(),gasPrice:Ni(e[2]),gasLimit:Ni(e[3]),to:g5(e[4]),value:Ni(e[5]),data:e[6],accessList:S1(e[7])};
11return e.length===8||(r.hash=fi(t),bN(r,e.slice(8),cU)),r}function fU(t){const e=u5(t);e.length!==9&&e.length!==6&&el.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Ni(e[0]).toNumber(),gasPrice:Ni(e[1]),gasLimit:Ni(e[2]),to:g5(e[3]),value:Ni(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=at.from(e[6]).toNumber()}catch{return r}if(r.r=Mn(e[7],32),r.s=Mn(e[8],32),at.from(r.r).isZero()&&at.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(Et(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=fi(cy(i));try{r.from=gN(s,{r:Et(r.r),s:Et(r.s),recoveryParam:n})}catch{}r.hash=fi(t)}return r.type=null,r}function dU(t){const e=Nt(t);if(e[0]>127)return fU(e);switch(e[0]){case 1:return uU(e);case 2:return lU(e)}return el.throwError(`unsupported transaction type: ${e[0]}`,ge.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}let yN=class{constructor(e){Zt(this,"alphabet",e),Zt(this,"base",e.length),Zt(this,"_alphabetMap",{}),Zt(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=Nt(e);if(r.length===0)return"";let n=[0];for(let s=0;s<r.length;++s){let o=r[s];for(let a=0;a<n.length;++a)o+=n[a]<<8,n[a]=o%this.base,o=o/this.base|0;for(;o>0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s<r.length-1;++s)i+=this._leader;for(let s=n.length-1;s>=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n<e.length;n++){let i=this._alphabetMap[e[n]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let s=i;for(let o=0;o<r.length;++o)s+=r[o]*this.base,r[o]=s&255,s>>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n<e.length-1;++n)r.push(0);return Nt(new Uint8Array(r.reverse()))}};new yN("abcdefghijklmnopqrstuvwxyz234567");const i3=new yN("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function fA(t){return"0x"+la.sha256().update(Nt(t)).digest("hex")}const hU="networks/5.8.0",dA=new ge(hU);function pU(t){return t&&typeof t.renetwork=="function"}function Po(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(r.QuickNodeProvider&&n.quicknode!=="-")try{i.push(new r.QuickNodeProvider(t,n.quicknode))}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Po(r)},e}function Zm(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return Zm(t,n)},r}const hA={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Po("homestead")},pA={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Po("ropsten")},gA={chainId:63,name:"classicMordor",_defaultProvider:Zm("https://www.ethercluster.com/mordor","classicMordor")},pg={unspecified:{chainId:0,name:"unspecified"},homestead:hA,mainnet:hA,morden:{chainId:2,name:"morden"},ropsten:pA,testnet:pA,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Po("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Po("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Po("goerli")}
11,kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:Po("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:Po("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:Zm("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:gA,classicTestnet:gA,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Zm("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Po("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:Po("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:Po("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},"optimism-sepolia":{chainId:11155420,name:"optimism-sepolia"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},"arbitrum-sepolia":{chainId:421614,name:"arbitrum-sepolia"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function gU(t){if(t==null)return null;if(typeof t=="number"){for(const n in pg){const i=pg[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=pg[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=pg[t.name];if(!e)return typeof t.chainId!="number"&&dA.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&dA.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(pU(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const mU="web/5.8.0";var bU=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function yU(t,e){return bU(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};
11if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:Nt(new Uint8Array(i))}})}var vU=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const No=new ge(mU);function mA(t){return new Promise(e=>{setTimeout(e,t)})}function sl(t,e){if(t==null)return null;if(typeof t=="string")return t;if(c5(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return ly(t)}catch{}return Et(t)}return t}function wU(t){return Hc(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function EU(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;No.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;No.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&No.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const x in t.headers)a[x.toLowerCase()]={key:x,value:String(t.headers[x])},["if-none-match","if-modified-since"].indexOf(x.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&No.throwError("basic authentication requires a secure https url",ge.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const x=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+D7(Hc(x))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=us(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const x={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?M7(h[3]):wU(h[3])};let k=x.body;return r&&(k=r(x.body,x)),Promise.resolve(k)}catch(x){No.throwError("processing response error",ge.errors.SERVER_ERROR,{body:sl(h[1],h[2]),error:x,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const g={};Object.keys(a).forEach(x=>{const k=a[x];g[k.key]=k.value}),l.headers=g;const b=function(){let x=null;return{promise:new Promise(function(D,O){f&&(x=setTimeout(()=>{x!=null&&(x=null,O(No.makeError("timeout",ge.errors.TIMEOUT,{requestBody:sl(l.body,g["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){x!=null&&(clearTimeout(x),x=null)}}}(),w=function(){return vU(this,void 0,void 0,function*(){for(let x=0;x<n;x++){let k=null;try{if(k=yield yU(c,l),x<n){if(k.statusCode===301||k.statusCode===302){const D=k.headers.location||"";if(l.method==="GET"&&D.match(/^https:/)){c=k.headers.location;continue}}else if(k.statusCode===429){let D=!0;if(i&&(D=yield i(x,c)),D){let O=0;const M=k.headers["retry-after"];
11typeof M=="string"&&M.match(/^[1-9][0-9]*$/)?O=parseInt(M)*1e3:O=s*parseInt(String(Math.random()*Math.pow(2,x))),yield mA(O);continue}}}}catch(D){k=D.response,k==null&&(b.cancel(),No.throwError("missing response",ge.errors.SERVER_ERROR,{requestBody:sl(l.body,g["content-type"]),requestMethod:l.method,serverError:D,url:c}))}let R=k.body;if(u&&k.statusCode===304?R=null:!o&&(k.statusCode<200||k.statusCode>=300)&&(b.cancel(),No.throwError("bad response",ge.errors.SERVER_ERROR,{status:k.statusCode,headers:k.headers,body:sl(R,k.headers?k.headers["content-type"]:null),requestBody:sl(l.body,g["content-type"]),requestMethod:l.method,url:c})),r)try{const D=yield r(R,k);return b.cancel(),D}catch(D){if(D.throttleRetry&&x<n){let O=!0;if(i&&(O=yield i(x,c)),O){const M=s*parseInt(String(Math.random()*Math.pow(2,x)));yield mA(M);continue}}b.cancel(),No.throwError("processing response error",ge.errors.SERVER_ERROR,{body:sl(R,k.headers?k.headers["content-type"]:null),error:D,requestBody:sl(l.body,g["content-type"]),requestMethod:l.method,url:c})}return b.cancel(),R}return No.throwError("failed response",ge.errors.SERVER_ERROR,{requestBody:sl(l.body,g["content-type"]),requestMethod:l.method,url:c})})}();return Promise.race([b.promise,w])}function m5(t,e,r){let n=(s,o)=>{let a=null;if(s!=null)try{a=JSON.parse(ly(s))}catch(c){No.throwError("invalid JSON",ge.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=Hc(e);const s=typeof t=="string"?{url:t}:us(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=us(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return EU(t,i,n)}function D0(t,e){return e||(e={}),e=us(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));f<e.floor&&(f=e.floor),f>e.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}var Ym="qpzry9x8gf2tvdw0s3jn54khce6mua7l",s3={};for(var gg=0;gg<Ym.length;gg++){var U2=Ym.charAt(gg);if(s3[U2]!==void 0)throw new TypeError(U2+" is ambiguous");s3[U2]=gg}function Jd(t){var e=t>>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function vN(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=Jd(e)^n>>5}for(e=Jd(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=Jd(e)^i&31}return e}function AU(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=vN(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s<e.length;++s){var o=e[s];if(o>>5)throw new Error("Non 5-bit word");n=Jd(n)^o,i+=Ym.charAt(o)}for(s=0;s<6;++s)n=Jd(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=Ym.charAt(a)}return i}function wN(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=vN(s);if(typeof a=="string")return a;for(var c=[],l=0;l<o.length;++l){var u=o.charAt(l),f=s3[u];if(f===void 0)return"Unknown character "+u;a=Jd(a)^f,!(l+6>=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function _U(){var t=wN.apply(null,arguments);if(typeof t=="object")return t}function CU(t){var e=wN.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function py(t,e,r,n){for(var i=0,s=0,o=(1<<r)-1,a=[],c=0;c<t.length;++c)for(i=i<<e|t[c],s+=e;s>=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=e)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}function SU(t){var e=py(t,8,5,!0);if(Array.isArray(e))return e}function TU(t){var e=py(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)}function NU(t){var e=py(t,5,8,!1);if(Array.isArray(e))return e}function IU(t){var e=py(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}var xU={decodeUnsafe:_U,decode:CU,encode:AU,toWordsUnsafe:SU,toWords:TU,fromWordsUnsafe:NU,fromWords:IU};
11const bA=zf(xU),gy="providers/5.8.0",e0=new ge(gy);let yA=class He{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this),u=f=>this.data(f,!0);return e.transaction={hash:o,type:l,accessList:He.allowNull(this.accessList.bind(this),null),blockHash:He.allowNull(o,null),blockNumber:He.allowNull(c,null),transactionIndex:He.allowNull(c,null),confirmations:He.allowNull(c,null),from:r,gasPrice:He.allowNull(n),maxPriorityFeePerGas:He.allowNull(n),maxFeePerGas:He.allowNull(n),gasLimit:n,to:He.allowNull(r,null),value:n,nonce:c,data:s,r:He.allowNull(this.uint256),s:He.allowNull(this.uint256),v:He.allowNull(c),creates:He.allowNull(r,null),raw:He.allowNull(s)},e.transactionRequest={from:He.allowNull(r),nonce:He.allowNull(c),gasLimit:He.allowNull(n),gasPrice:He.allowNull(n),maxPriorityFeePerGas:He.allowNull(n),maxFeePerGas:He.allowNull(n),to:He.allowNull(r),value:He.allowNull(n),data:He.allowNull(u),type:He.allowNull(c),accessList:He.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:He.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:He.allowNull(this.address,null),from:He.allowNull(this.address,null),contractAddress:He.allowNull(r,null),transactionIndex:c,root:He.allowNull(a),gasUsed:n,logsBloom:He.allowNull(s),blockHash:o,transactionHash:o,logs:He.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:He.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:He.allowNull(n),status:He.allowNull(c),type:l},e.block={hash:He.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:He.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:He.allowNull(r),extraData:s,transactions:He.allowNull(He.arrayOf(o)),baseFeePerGas:He.allowNull(n)},e.blockWithTransactions=us(e.block),e.blockWithTransactions.transactions=He.allowNull(He.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:He.allowNull(i,void 0),toBlock:He.allowNull(i,void 0),blockHash:He.allowNull(o,void 0),address:He.allowNull(r,void 0),topics:He.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:He.allowNull(c),blockHash:He.allowNull(o),transactionIndex:c,removed:He.allowNull(this.boolean.bind(this)),address:r,data:He.allowFalsish(s,"0x"),topics:He.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return S1(e||[])}number(e){return e==="0x"?0:at.from(e).toNumber()}type(e){return e==="0x"||e==null?0:at.from(e).toNumber()}bigNumber(e){return at.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Yr(e))?e.toLowerCase():e0.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Jo(e)}callAddress(e){if(!Yr(e,32))return null;const r=Jo(Fi(e,12));return r===CF?null:r}contractAddress(e){return _F(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Yr(e))return l5(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Af(n)!==32?e0.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=at.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Yr(e))throw new Error("invalid uint256");return Mn(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=He.check(r,e);return i._difficulty=n==null?null:at.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return He.check(this.formats.transactionRequest,e)}
11transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&at.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=He.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Yr(n)&&(n=at.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Yr(n)&&(n=at.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return dU(e)}receiptLog(e){return He.check(this.formats.receiptLog,e)}receipt(e){const r=He.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=at.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&e0.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):e0.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&e0.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return He.check(this.formats.filter,e)}filterLog(e){return He.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}};var pt=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Mt=new ge(gy),RU=10;function vA(t){return t==null?"null":(Af(t)!==32&&Mt.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function wA(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[vA(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return vA(e)}).join("&")}function PU(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function od(t){if(typeof t=="string"){if(t=t.toLowerCase(),Af(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+wA(t);if(h$.isForkEvent(t))throw Mt.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+wA(t.topics||[])}throw new Error("invalid event - "+t)}function t0(){return new Date().getTime()}function EA(t){return new Promise(e=>{setTimeout(e,t)})}const kU=["block","network","pending","poll"];let OU=class{constructor(e,r,n){Zt(this,"tag",e),Zt(this,"listener",r),Zt(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=PU(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||kU.indexOf(this.tag)>=0}};const MU={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function H2(t){return Mn(at.from(t).toHexString(),32)}function AA(t){return i3.encode(tf([t,Fi(fA(fA(t)),0,4)]))}const EN=new RegExp("^(ipfs)://(.*)$","i"),_A=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),EN,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function vm(t,e){try{return ly(mp(t,e))}catch{}return null}function mp(t,e){if(t==="0x")return null;const r=at.from(Fi(t,e,e+32)).toNumber(),n=at.from(Fi(t,r,r+32)).toNumber();return Fi(t,r+32,r+32+n)}function j2(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Mt.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function CA(t){const e=Nt(t);if(e.length>32)throw new Error("internal; should not happen");
11const r=new Uint8Array(32);return r.set(e,32-e.length),r}function DU(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function AN(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=Nt(t[n]);e[n]=CA(r),e.push(CA(i.length)),e.push(DU(i)),r+=32+Math.ceil(i.length/32)*32}return Ds(e)}let SA=class{constructor(e,r,n,i){Zt(this,"provider",e),Zt(this,"name",n),Zt(this,"address",e.formatter.address(r)),Zt(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>at.from(e).eq(1)).catch(e=>{if(e.code===ge.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return pt(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Ds([e,mm(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Ds(["0x9061b923",AN([r$(this.name),n.data])]));try{let s=yield this.provider.call(n);return Nt(s).length%32===4&&Mt.throwError("resolver threw error",ge.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=mp(s,0)),s}catch(s){if(s.code===ge.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return pt(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?mp(n,0):null})}_getAddress(e,r){const n=MU[String(e)];if(n==null&&Mt.throwError(`unsupported coin type: ${e}`,ge.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=Nt(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return AA(tf([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return AA(tf([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=bA.toWords(i.slice(2));return a.unshift(o),bA.encode(n.prefix,a)}}return null}getAddress(e){return pt(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===TF?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ge.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",H2(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Mt.throwError("invalid or unsupported coin data",ge.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return pt(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;n<_A.length;n++){const i=r.match(_A[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":return e.push({type:"url",content:r}),{linkage:e,url:r};case"data":return e.push({type:"data",content:r}),{linkage:e,url:r};case"ipfs":return e.push({type:"ipfs",content:r}),{linkage:e,url:j2(r)};case"erc721":case"erc1155":{const o=s==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:s,content:r});const a=this._resolvedAddress||(yield this.getAddress()),c=(i[2]||"").split("/");if(c.length!==2)return null;const l=yield this.provider.formatter.address(c[0]),u=Mn(at.from(c[1]).toHexString(),32);if(s==="erc721"){const b=this.provider.formatter.callAddress(yield this.provider.call({to:l,data:Ds(["0x6352211e",u])}));if(a!==b)return null;e.push({type:"owner",content:b})}else if(s==="erc1155"){const b=at.from(yield this.provider.call({to:l,data:Ds(["0x00fdd58e",Mn(a,32),u])}));if(b.isZero())return null;e.push({type:"balance",content:b.toString()})}const f={to:this.provider.formatter.address(c[0]),data:Ds([o,u])};let d=vm(yield this.provider.call(f),0);if(d==null)return null;e.push({type:"metadata-url-base",content:d}),s==="erc1155"&&(d=d.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:d})),d.match(/^ipfs:/i)&&(d=j2(d)),e.push({type:"metadata-url",content:d});const h=yield m5(d);if(!h)return null;e.push({type:"metadata",content:JSON.stringify(h)});let g=h.image;if(typeof g!="string")return null;
11if(!g.match(/^(https:\/\/|data:)/i)){if(g.match(EN)==null)return null;e.push({type:"url-ipfs",content:g}),g=j2(g)}return e.push({type:"url",content:g}),{linkage:e,url:g}}}}}catch{}return null})}getContentHash(){return pt(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const o=parseInt(r[3],16);if(r[4].length===o*2)return"ipfs://"+i3.encode("0x"+r[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const o=parseInt(n[3],16);if(n[4].length===o*2)return"ipns://"+i3.encode("0x"+n[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===32*2)return"bzz://"+i[1];const s=e.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&s[1].length===34*2){const o={"=":"","+":"-","/":"_"};return"sia://"+D7("0x"+s[1]).replace(/[=+\/]/g,c=>o[c])}return Mt.throwError("invalid or unsupported content hash data",ge.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return pt(this,void 0,void 0,function*(){let r=Hc(e);r=tf([H2(64),H2(r.length),r]),r.length%32!==0&&(r=tf([r,Mn("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Et(r));return n==null||n==="0x"?null:ly(n)})}},z2=null,BU=1,FU=class extends p${constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Zt(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=M0(new.target,"getNetwork")(e);r?(Zt(this,"_network",r),this.emit("network",r,null)):Mt.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return pt(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Mt.throwError("no network detected",ge.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:Zt(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return D0(()=>this._ready().then(e=>e,e=>{if(!(e.code===ge.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return z2==null&&(z2=new yA),z2}static getNetwork(e){return gU(e??"homestead")}ccipReadFetch(e,r,n){return pt(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a<n.length;a++){const c=n[a],l=c.replace("{sender}",i).replace("{data}",s),u=c.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:i}),f=yield m5({url:l,errorPassThrough:!0},u,(h,g)=>(h.status=g.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return Mt.throwError(`response not found during CCIP fetch: ${d}`,ge.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return Mt.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ge.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return pt(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(t0()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=t0(),n=li({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=t0();return i=at.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:r,respTime:o}});return this._internalBlockNumber=n,n.catch(i=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return pt(this,void 0,void 0,function*(){const e=BU++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}
11catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Mt.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Mt.makeError("network block skew detected",ge.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return pt(this,void 0,void 0,function*(){return Mt.throwError("provider does not support network detection",ge.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return pt(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield EA(0),this._network;const n=Mt.makeError("underlying network changed",ge.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=t0();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=t0(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return pt(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return pt(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;
11const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations<r||u()||o(d)};if(this.on(e,f),c.push(()=>{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const g=b=>pt(this,void 0,void 0,function*(){l||(yield EA(1e3),this.getTransactionCount(i.from).then(w=>pt(this,void 0,void 0,function*(){if(!l){if(w<=i.nonce)d=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(h==null&&(h=d-3,h<i.startBlock&&(h=i.startBlock));h<=b;){if(l)return;const x=yield this.getBlockWithTransactions(h);for(let k=0;k<x.transactions.length;k++){const R=x.transactions[k];if(R.hash===e)return;if(R.from===i.from&&R.nonce===i.nonce){if(l)return;const D=yield this.waitForTransaction(R.hash,r);if(u())return;let O="replaced";R.data===i.data&&R.to===i.to&&R.value.eq(i.value)?O="repriced":R.data==="0x"&&R.from===R.to&&R.value.isZero()&&(O="cancelled"),a(Mt.makeError("transaction was replaced",ge.errors.TRANSACTION_REPLACED,{cancelled:O==="replaced"||O==="cancelled",reason:O,replacement:this._wrapTransaction(R),hash:e,receipt:D}));return}}h++}}l||this.once("block",g)}}),w=>{l||this.once("block",g)}))});if(l)return;this.once("block",g),c.push(()=>{this.removeListener("block",g)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(Mt.makeError("timeout exceeded",ge.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return pt(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return at.from(e)}catch(r){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield li({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return at.from(i)}catch(s){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield li({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return at.from(i).toNumber()}catch(s){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield li({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Et(i)}catch(s){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield li({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>l5(o))}),s=yield this.perform("getStorageAt",i);try{return Et(s)}catch(o){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Af(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Mt.throwError("Transaction hash mismatch from Provider.sendTransaction.",ge.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>pt(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&Mt.throwError("transaction failed",ge.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>Et(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return pt(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>
11{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?at.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Et(s):null))}),this.formatter.transactionRequest(yield li(n))})}_getFilter(e){return pt(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield li(r))})}_call(e,r,n){return pt(this,void 0,void 0,function*(){n>=RU&&Mt.throwError("CCIP read exceeded maximum redirections",ge.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Af(s)%32===4)try{const o=Fi(s,4),a=Fi(o,0,32);at.from(a).eq(i)||Mt.throwError("CCIP Read sender did not match",ge.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=at.from(Fi(o,32,64)).toNumber(),u=at.from(Fi(o,l,l+32)).toNumber(),f=Fi(o,l
11+32);for(let x=0;x<u;x++){const k=vm(f,x*32);k==null&&Mt.throwError("CCIP Read contained corrupt URL string",ge.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),c.push(k)}const d=mp(o,64);at.from(Fi(o,100,128)).isZero()||Mt.throwError("CCIP Read callback selector included junk",ge.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const h=Fi(o,96,100),g=mp(o,128),b=yield this.ccipReadFetch(e,d,c);b==null&&Mt.throwError("CCIP Read disabled or provided no URLs",ge.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const w={to:i,data:Ds([h,AN([b,g])])};return this._call(w,r,n+1)}catch(o){if(o.code===ge.errors.SERVER_ERROR)throw o}try{return Et(s)}catch(o){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:r},result:s,error:o})}})}call(e,r){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield li({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)})}estimateGas(e){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield li({transaction:this._getTransactionRequest(e)}),n=yield this.perform("estimateGas",r);try{return at.from(n)}catch(i){return Mt.throwError("bad result from backend",ge.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:i})}})}_getAddress(e){return pt(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&Mt.throwArgumentError("invalid address or ENS name","name",e);const r=yield this.resolveName(e);return r==null&&Mt.throwError("ENS name not configured",ge.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return pt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let n=-128;const i={includeTransactions:!!r};if(Yr(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),Yr(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16))}catch{Mt.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return D0(()=>pt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;c<s.transactions.length;c++){const l=s.transactions[c];if(l.blockNumber==null)l.confirmations=0;else if(l.confirmations==null){o==null&&(o=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let u=o-l.blockNumber+1;u<=0&&(u=1),l.confirmations=u}}const a=this.formatter.blockWithTransactions(s);return a.transactions=a.transactions.map(c=>this._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return pt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return D0(()=>pt(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return pt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return D0(()=>pt(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);
11if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return pt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield li({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),yA.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return pt(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return pt(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Mt.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return pt(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new SA(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return pt(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Mt.throwError("network does not support ENS",ge.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+mm(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return pt(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Yr(e))throw n}typeof e!="string"&&Mt.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return pt(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=vm(yield this.call({to:n,data:"0x691f3431"+mm(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return pt(this,void 0,void 0,function*(){let r=null;if(Yr(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new SA(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ge.errors.CALL_EXCEPTION)throw a}try{const a=vm(yield this.call({to:o,data:"0x691f3431"+mm(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ge.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Mt.throwError(e+" not implemented",ge.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new OU(od(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=od(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)}
11,0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=od(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=od(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=od(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=od(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}};var Ac=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Rn=new ge(gy),$U=["call","estimateGas"];function q0(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Yr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=q0(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return q0(JSON.parse(t),e)}catch{}return null}function _N(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=q0(e,!0);if(s)return s.data;Rn.throwError("missing revert data in call exception; Transaction reverted without a reason string",ge.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=q0(e.body,!1);s==null&&(s=q0(e,!1)),s&&Rn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ge.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ge.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Rn.throwError("insufficient funds for intrinsic transaction cost",ge.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Rn.throwError("nonce has already been used",ge.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Rn.throwError("replacement fee too low",ge.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Rn.throwError("legacy pre-eip-155 transactions not supported",ge.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),$U.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Rn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ge.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function TA(t){return new Promise(function(e){setTimeout(e,t)})}function LU(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function r0(t){return t&&t.toLowerCase()}const o3={};let CN=class extends y${constructor(e,r,n){if(super(),e!==o3)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Zt(this,"provider",r),n==null&&(n=0),typeof n=="string"?(Zt(this,"_address",this.provider.formatter.address(n)),Zt(this,"_index",null)):typeof n=="number"?(Zt(this,"_index",n),Zt(this,"_address",null)):Rn.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Rn.throwError("cannot alter JSON-RPC Signer connection",ge.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new UU(o3,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&Rn.throwError("unknown account #"+this._index,ge.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=us(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));
11if(e.gasLimit==null){const n=us(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Ac(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Rn.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),li({tx:li(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Rn.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Rn.throwError("user rejected transaction",ge.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),_N("sendTransaction",o,s)))})}signTransaction(e){return Rn.throwError("signing transactions is unsupported",ge.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Ac(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield D0(()=>Ac(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Ac(this,void 0,void 0,function*(){const r=typeof e=="string"?Hc(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Et(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Rn.throwError("user rejected signing",ge.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Ac(this,void 0,void 0,function*(){const r=typeof e=="string"?Hc(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Et(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Rn.throwError("user rejected signing",ge.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Ac(this,void 0,void 0,function*(){const i=yield iA.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(iA.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Rn.throwError("user rejected signing",ge.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Ac(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}},UU=class extends CN{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}};const HU={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let jU=class extends FU{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=M0(this.constructor,"defaultUrl")()),typeof e=="string"?Zt(this,"connection",Object.freeze({url:e})):Zt(this,"connection",Object.freeze(us(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Ac(this,void 0,void 0,function*(){yield TA(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=M0(this.constructor,"getNetwork");try{return r(at.from(e).toNumber())}catch(n){return Rn.throwError("could not detect network",ge.errors.NETWORK_E
11RROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Rn.throwError("could not detect network",ge.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new CN(o3,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:_f(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=m5(this.connection,JSON.stringify(n),LU).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[r0(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[r0(r.address),r.blockTag]];case"getCode":return["eth_getCode",[r0(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[r0(r.address),Mn(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[M0(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[M0(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=r0(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Ac(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&at.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=us(r),r.transaction=us(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Rn.throwError(e+" not implemented",ge.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return _N(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return TA(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=us(HU);if(r)for(const s in r)r[s]&&(n[s]=!0);dF(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=l5(at.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=Et(e[s]))}),e.accessList&&(i.accessList=S1(e.accessList)),i}};const NA=new ge(gy);let zU=1;function IA(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:zU++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:_f(s),provider:this}),e(s,(c,l)=>
11{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function JU(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:_f(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}let qU=class extends jU{constructor(e,r){e==null&&NA.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=JU(e)):e.sendAsync?i=IA(e,e.sendAsync.bind(e)):e.send?i=IA(e,e.send.bind(e)):NA.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),Zt(this,"jsonRpcFetchFunc",i),Zt(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}};const GU=Symbol(),xA=Object.getPrototypeOf,a3=new WeakMap,VU=t=>t&&(a3.has(t)?a3.get(t):xA(t)===Object.prototype||xA(t)===Array.prototype),WU=t=>VU(t)&&t[GU]||null,RA=(t,e=!0)=>{a3.set(t,e)},b5=t=>typeof t=="object"&&t!==null,KU=t=>b5(t)&&!T1.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),SN=(t,e)=>{const r=c3.get(t);if((r==null?void 0:r[0])===e)return r[1];const n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return RA(n,!0),c3.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;const s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),a={value:s,enumerable:o,configurable:!0};if(T1.has(s))RA(s,!1);else if(tu.has(s)){const[c,l]=tu.get(s);a.value=SN(c,l())}Object.defineProperty(n,i,a)}),Object.preventExtensions(n)},XU=(t,e,r,n)=>({deleteProperty(i,s){const o=Reflect.get(i,s);r(s);const a=Reflect.deleteProperty(i,s);return a&&n(["delete",[s],o]),a},set(i,s,o,a){const c=!t()&&Reflect.has(i,s),l=Reflect.get(i,s,a);if(c&&(PA(l,o)||bp.has(o)&&PA(l,bp.get(o))))return!0;r(s),b5(o)&&(o=WU(o)||o);const u=!tu.has(o)&&YU(o)?Qr(o):o;return e(s,u),Reflect.set(i,s,u,a),n(["set",[s],o,l]),!0}}),tu=new WeakMap,T1=new WeakSet,c3=new WeakMap,wm=[1],bp=new WeakMap;let PA=Object.is,ZU=(t,e)=>new Proxy(t,e),YU=KU,QU=SN,eH=XU;function Qr(t={}){if(!b5(t))throw new Error("object required");const e=bp.get(t);if(e)return e;let r=wm[0];const n=new Set,i=(w,x=++wm[0])=>{r!==x&&(s=r=x,n.forEach(k=>k(w,x)))};let s=r;const o=(w=wm[0])=>(s!==w&&(s=w,c.forEach(([x])=>{const k=x[1](w);k>r&&(r=k)})),r),a=w=>(x,k)=>{const R=[...x];R[1]=[w,...R[1]],i(R,k)},c=new Map,l=(w,x)=>{const k=!T1.has(x)&&tu.get(x);if(k)if(n.size){const R=k[2](a(w));c.set(w,[k,R])}else c.set(w,[k])},u=w=>{var x;const k=c.get(w);k&&(c.delete(w),(x=k[1])==null||x.call(k))},f=w=>(n.add(w),n.size===1&&c.forEach(([k,R],D)=>{const O=k[2](a(D));c.set(D,[k,O])}),()=>{n.delete(w),n.size===0&&c.forEach(([k,R],D)=>{R&&(R(),c.set(D,[k]))})});let d=!0;const h=eH(()=>d,l,u,i),g=ZU(t,h);bp.set(t,g);const b=[t,o,f];return tu.set(g,b),Reflect.ownKeys(t).forEach(w=>{const x=Object.getOwnPropertyDescriptor(t,w);"value"in x&&x.writable&&(g[w]=t[w])}),d=!1,g}function di(t,e,r){const n=tu.get(t);let i;const s=[],o=n[2];let a=!1;const l=o(u=>{if(s.push(u),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function yp(t){const e=tu.get(t),[r,n]=e;return QU(r,n())}function vp(t){return T1.add(t),t}function tH(){return{proxyStateMap:tu,refSet:T1,snapCache:c3,versionHolder:wm,proxyCache:bp}}function Qn(t,e,r,n){let i=t[e];return di(t,()=>{const s=t[e];Object.is(i,s)||r(i=s)},n)}const{proxyStateMap:rH,snapCache:nH}=tH(),mg=t=>rH.has(t);function iH(t){const e=[];let r=0;const n=new Map,i=new WeakMap,s=()=>{const l=nH.get(a),u=l==null?void 0:l[1];if(u&&!i.has(u)){const f=new Map(n);i.set(u,f)}},o=l=>i.get(l)||n;if(t){if(typeof t[Symbol.iterator]!="function")throw new TypeError(`proxyMap: 12 initial state must be iterable 13 tip: structure should be [[key, value]]`);for(const[l,u]of t)n.set(l,r),e[r++]=u}const a={data:e,index:r,epoch:0,get size(){return mg(this)||s(),o(this).size},get(l){const f=o(this).get(l);if(f===void 0){this.epoch;return}return this.data[f]},has(l){const u=o(this);return this.epoch,u.has(l)},set(l,u){if(!mg(this))throw new Error("Cannot perform mutations on a snapshot");const f=n.get(l);return f===void 0?(n.set(l,this.index),this.data[this.index++]=u):this.data[f]=u,this.epoch++,this},delete(l){if(!mg(this))throw new Error("Cannot perform mutations on a snapshot");const u=n.get(l);return u===void 0?!1:(delete this.data[u],n.delete(l),this.epoch++,!0)},clear(){if(!mg(this))throw new Error("Cannot perform mutations on a snapshot");this.data.length=0,this.index=0,this.epoch++,n.clear()}
13,forEach(l){this.epoch,o(this).forEach((f,d)=>{l(this.data[f],d,this)})},*entries(){this.epoch;const l=o(this);for(const[u,f]of l)yield[u,this.data[f]]},*keys(){this.epoch;const l=o(this);for(const u of l.keys())yield u},*values(){this.epoch;const l=o(this);for(const u of l.values())yield this.data[u]},[Symbol.iterator](){return this.entries()},get[Symbol.toStringTag](){return"Map"},toJSON(){return new Map(this.entries())}},c=Qr(a);return Object.defineProperties(c,{size:{enumerable:!1},index:{enumerable:!1},epoch:{enumerable:!1},data:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(c),c}const TN={isLowerCaseMatch(t,e){return(t==null?void 0:t.toLowerCase())===(e==null?void 0:e.toLowerCase())}},K={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",BASE_ACCOUNT:"baseAccount",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122",TON:"ton",TRON:"tron"}
13,CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos",sui:"Sui",stacks:"Stacks",ton:"TON",tron:"TRON"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",TON:"ton",TRON:"tron"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],SOLANA_SPL_TOKEN_ADDRESSES:{SOL:"So11111111111111111111111111111111111111112"},NATIVE_IMAGE_IDS_BY_NAMESPACE:{eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"3e8119e5-2a6f-4818-c50c-1937011d5900",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00"},TOKEN_SYMBOLS_BY_ADDRESS:{"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":"USDC","0x833589fcd6edb6e08f4c7c32d4f71b54bda02913":"USDC","0x0b2c639c533813f4aa9d7837caf62653d097ff85":"USDC","0xaf88d065e77c8cc2239327c5edb3a432268e5831":"USDC","0x3c499c542cef5e3811e1192ce70d8cc03d5c3359":"USDC","0x2791bca1f2de4661ed88a30c99a7a9449aa84174":"USDC",EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:"USDC","0xdac17f958d2ee523a2206206994597c13d831ec7":"USDT","0x94b008aa00579c1307b0ef2c499ad98a8ce58e58":"USDT","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9":"USDT","0xc2132d05d31c914a87c6611c10748aeb04b58e8f":"USDT",Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB:"USDT"},HTTP_STATUS_CODES:{SERVER_ERROR:500,TOO_MANY_REQUESTS:429,SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",REMOTE_FEATURES_ALERTS:{MULTI_WALLET_NOT_ENABLED:{DEFAULT:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com."},CONNECTIONS_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnections hook."},CONNECTION_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnection hook."}},HEADLESS_NOT_ENABLED:{DEFAULT:{displayMessage:"",debugMessage:"Headless support is not enabled. Please enable it with the features.headless option in the AppKit configuration and make sure your current plan supports it."}}},IS_DEVELOPMENT:typeof process<"u"&&process.env.NODE_ENV==="development",DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://localhost:*","http://127.0.0.1:*","https://127.0.0.1:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"],METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH"},wp={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0},parseEvmChainId(t){return typeof t=="string"?this.caipNetworkIdToNumber(t):t},getNetworksByNamespace(t,e){return(t==null?void 0:t.filter(r=>r.chainNamespace===e))||[]},getFirstNetworkByNamespace(t,e){return this.getNetworksByNamespace(t,e)[0]},getNetworkNameByCaipNetworkId(t,e){var i;if(!e)return;const r=t.find(s=>
vendor: 4,635 bytes, line 13
13s.caipNetworkId===e);if(r)return r.name;const[n]=e.split(":");return((i=K.CHAIN_NAME_MAP)==null?void 0:i[n])||void 0}},NN=["eip155","solana","polkadot","bip122","cosmos","sui","stacks"];var sH=20,oH=1,Sf=1e6,kA=1e6,aH=-7,cH=21,lH=!1,N1="[big.js] ",qf=N1+"Invalid ",my=qf+"decimal places",uH=qf+"rounding mode",IN=N1+"Division by zero",Dr={},ka=void 0,fH=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function xN(){function t(e){var r=this;if(!(r instanceof t))return e===ka?xN():new t(e);if(e instanceof t)r.s=e.s,r.e=e.e,r.c=e.c.slice();else{if(typeof e!="string"){if(t.strict===!0&&typeof e!="bigint")throw TypeError(qf+"value");e=e===0&&1/e<0?"-0":String(e)}dH(r,e)}r.constructor=t}return t.prototype=Dr,t.DP=sH,t.RM=oH,t.NE=aH,t.PE=cH,t.strict=lH,t.roundDown=0,t.roundHalfUp=1,t.roundHalfEven=2,t.roundUp=3,t}function dH(t,e){var r,n,i;if(!fH.test(e))throw Error(qf+"number");for(t.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}return t}function Gf(t,e,r,n){var i=t.c;if(r===ka&&(r=t.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(uH);if(e<1)n=r===3&&(n||!!i[0])||e===0&&(r===1&&i[0]>=5||r===2&&(i[0]>5||i[0]===5&&(n||i[1]!==ka))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=r===1&&i[e]>=5||r===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==ka||i[e-1]&1))||r===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++t.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return t}function Vf(t,e,r){var n=t.e,i=t.c.join(""),s=i.length;if(e)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>s)for(n-=s;n--;)i+="0";else n<s&&(i=i.slice(0,n)+"."+i.slice(n));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}Dr.abs=function(){var t=new this.constructor(this);return t.s=1,t};Dr.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,s=r.s,o=t.s,a=r.e,c=t.e;if(!n[0]||!i[0])return n[0]?s:i[0]?-o:0;if(s!=o)return s;if(e=s<0,a!=c)return a>c^e?1:-1;for(o=(a=n.length)<(c=i.length)?a:c,s=-1;++s<o;)if(n[s]!=i[s])return n[s]>i[s]^e?1:-1;return a==c?0:a>c^e?1:-1};Dr.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,s=e.s==t.s?1:-1,o=r.DP;if(o!==~~o||o<0||o>Sf)throw Error(my);if(!i[0])throw Error(IN);if(!n[0])return t.s=s,t.c=[t.e=0],t;var a,c,l,u,f,d=i.slice(),h=a=i.length,g=n.length,b=n.slice(0,a),w=b.length,x=t,k=x.c=[],R=0,D=o+(x.e=e.e-t.e)+1;for(x.s=s,s=D<0?0:D,d.unshift(0);w++<a;)b.push(0);do{for(l=0;l<10;l++){if(a!=(w=b.length))u=a>w?1:-1;else for(f=-1,u=0;++f<a;)if(i[f]!=b[f]){u=i[f]>b[f]?1:-1;break}if(u<0){for(c=w==a?i:d;w;){if(b[--w]<c[w]){for(f=w;f&&!b[--f];)b[f]=9;--b[f],b[w]+=10}b[w]-=c[w]}for(;!b[0];)b.shift()}else break}k[R++]=u?l:++l,b[0]&&u?b[w]=n[h]||0:b=[n[h]]}while((h++<g||b[0]!==ka)&&s--);return!k[0]&&R!=1&&(k.shift(),x.e--,D--),R>D&&Gf(x,D,r.RM,b[0]!==ka),x};Dr.eq=function(t){return this.cmp(t)===0};Dr.gt=function(t){return this.cmp(t)>0};Dr.gte=function(t){return this.cmp(t)>-1};Dr.lt=function(t){return this.cmp(t)<0};Dr.lte=function(t){return this.cmp(t)<1};Dr.minus=Dr.sub=function(t){var e,r,n,i,s=this,o=s.constructor,a=s.s,c=(t=new o(t)).s;if(a!=c)return t.s=-c,s.plus(t);var l=s.c.slice(),u=s.e,f=t.c,d=t.e;if(!l[0]||!f[0])return f[0]?t.s=-c:l[0]?t=new o(s):t.s=1,t;if(a=u-d){for((i=a<0)?(a=-a,n=l):(d=u,n=f),n.reverse(),c=a;c--;)n.push(0);n.reverse()}else for(r=((i=l.length<f.length)?l:f).length,a=c=0;c<r;c++)if(l[c]!=f[c]){i=l[c]<f[c];break}if(i&&(n=l,l=f,f=n,t.s=-t.s),(c=(r=f.length)-(e=l.length))>0)for(;c--;)l[e++]=0;for(c=e;r>a;){if(l[--r]<f[r]){for(e=r;e&&!l[--e];)l[e]=9;--l[e],l[r]+=10}l[r]-=f[r]}for(;l[--c]===0;)l.pop();for(;l[0]===0;)l.shift(),--d;return l[0]||(t.s=1,l=[d=0]),t.c=l,t.e=d,t};Dr.mod=function(t){var e,r=this,n=r.constructor,i=r.s,s=(t=new n(t)).s;if(!t.c[0])throw Error(IN);return r.s=t.s=1,e=t.cmp(r)==1,r.s=i,t.s=s,e?new n(r):(i=n.DP,s=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=s,this.minus(r.times(t)))};Dr.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t};Dr.plus=Dr.add=function(t){var e,r,n,i=this,s=i.constructor;if(t=new s(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var o=i.e,a=i.c,c=t.e,l=t.c;if(!a[0]||!l[0])return l[0]||(a[0]?t=new s(i):t.s=i.s),t;if(a=a.slice(),e=o-c){for(e>0?(c=o,n=l):(e=-e,n=a),n.reverse();e--;)n.push(0);n.reverse()}for(a.length-l.length<0&&(n=l,l=a,a=n),e=l.length,r=0;e;a[e]%=10)r=(a[--e]=a[e]+l[e]+r)/10|0;
13for(r&&(a.unshift(r),++c),e=a.length;a[--e]===0;)a.pop();return t.c=a,t.e=c,t};Dr.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-kA||t>kA)throw Error(qf+"exponent");for(i&&(t=-t);t&1&&(n=n.times(e)),t>>=1,!!t;)e=e.times(e);return i?r.div(n):n};Dr.prec=function(t,e){if(t!==~~t||t<1||t>Sf)throw Error(qf+"precision");return Gf(new this.constructor(this),t,e)};Dr.round=function(t,e){if(t===ka)t=0;else if(t!==~~t||t<-Sf||t>Sf)throw Error(my);return Gf(new this.constructor(this),t+this.e+1,e)};Dr.sqrt=function(){var t,e,r,n=this,i=n.constructor,s=n.s,o=n.e,a=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(N1+"No square root");s=Math.sqrt(+Vf(n,!0,!0)),s===0||s===1/0?(e=n.c.join(""),e.length+o&1||(e+="0"),s=Math.sqrt(e),o=((o+1)/2|0)-(o<0||o&1),t=new i((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+o)):t=new i(s+""),o=t.e+(i.DP+=4);do r=t,t=a.times(r.plus(n.div(r)));while(r.c.slice(0,o).join("")!==t.c.slice(0,o).join(""));return Gf(t,(i.DP-=4)+t.e+1,i.RM)};Dr.times=Dr.mul=function(t){var e,r=this,n=r.constructor,i=r.c,s=(t=new n(t)).c,o=i.length,a=s.length,c=r.e,l=t.e;if(t.s=r.s==t.s?1:-1,!i[0]||!s[0])return t.c=[t.e=0],t;for(t.e=c+l,o<a&&(e=i,i=s,s=e,l=o,o=a,a=l),e=new Array(l=o+a);l--;)e[l]=0;for(c=a;c--;){for(a=0,l=o+c;l>c;)a=e[l]+s[c]*i[l-c-1]+a,e[l--]=a%10,a=a/10|0;e[l]=a}for(a?++t.e:e.shift(),c=e.length;!e[--c];)e.pop();return t.c=e,t};Dr.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==ka){if(t!==~~t||t<0||t>Sf)throw Error(my);for(r=Gf(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return Vf(r,!0,!!n)};Dr.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==ka){if(t!==~~t||t<0||t>Sf)throw Error(my);for(r=Gf(new r.constructor(r),t+r.e+1,e),t=t+r.e+1;r.c.length<t;)r.c.push(0)}return Vf(r,!1,!!n)};Dr[Symbol.for("nodejs.util.inspect.custom")]=Dr.toJSON=Dr.toString=function(){var t=this,e=t.constructor;return Vf(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])};Dr.toNumber=function(){var t=+Vf(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(t.toString()))throw Error(N1+"Imprecise conversion");return t};Dr.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==ka){if(t!==~~t||t<1||t>Sf)throw Error(qf+"precision");for(r=Gf(new n(r),t,e);r.c.length<t;)r.c.push(0)}return Vf(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)};Dr.valueOf=function(){var t=this,e=t.constructor;if(e.strict===!0)throw Error(N1+"valueOf disallowed");return Vf(t,t.e<=e.NE||t.e>=e.PE,!0)};var Qo=xN();const RN={bigNumber(t,e={safe:!1}){try{return t?new Qo(t):new Qo(0)}catch(r){if(e.safe)return new Qo(0);throw r}},formatNumber(t,e){const{decimals:r,round:n=8,safe:i=!0}=e;return RN.bigNumber(t,{safe:i}).div(new Qo(10).pow(r)).round(n)},multiply(t,e){if(t===void 0||e===void 0)return new Qo(0);const r=new Qo(t),n=new Qo(e);return r.times(n)},toFixed(t,e=2){return t===void 0||t===""?new Qo(0).toFixed(e):new Qo(t).toFixed(e)},formatNumberToLocalString(t,e=2){return t===void 0||t===""?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e,roundingMode:"floor"}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e,roundingMode:"floor"})},parseLocalStringToNumber(t){if(t===void 0||t==="")return 0;const e=t.replace(/,/gu,"");return new Qo(e).toNumber()}},hH=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],pH=[{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],gH=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}],mH={getERC20Abi:t=>K.USDT_CONTRACT_ADDRESSES.includes(t)?gH:hH,getSwapAbi:()=>pH},Di={ConnectorExplorerIds:{[K.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[K.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[K.CONNECTOR_ID.BASE_ACCOUNT]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[K.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[K.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[K.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
13a09c0faed0709",[K.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[K.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[K.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[K.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[K.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[K.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[K.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[K.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[K.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[K.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[K.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13",[K.OKX_CONNECTOR_NAME]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[K.BINANCE_CONNECTOR_NAME]:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700","-239":"20f673c0-095e-49b2-07cf-eb5049dcf600","-3":"20f673c0-095e-49b2-07cf-eb5049dcf600","0x2b6653dc":"3502bb86-cc4e-420f-a387-59ea63a28b00","0x94a9059e":"3502bb86-cc4e-420f-a387-59ea63a28b00","0xcd8690dc":"3502bb86-cc4e-420f-a387-59ea63a28b00"},ConnectorImageIds:{[K.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[K.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[K.CONNECTOR_ID.BASE_ACCOUNT]:"bba2c8be-7fd1-463e-42b1-796ecb0ad200",[K.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[K.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[K.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[K.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[K.CONNECTOR_ID.INJECTED]:"Browser Wallet",[K.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[K.CONNECTOR_ID.COINBASE]:"Coinbase",[K.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[K.CONNECTOR_ID.BASE_ACCOUNT]:"Base Account",[K.CONNECTOR_ID.LEDGER]:"Ledger",[K.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[K.CONNECTOR_ID.INJECTED]:"INJECTED",[K.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[K.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[K.CONNECTOR_ID.AUTH]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},kn={validateCaipAddress(t){var e;if(((e=t.split(":"))==null?void 0:e.length)!==3)throw new Error("Invalid CAIP Address");return t},parseCaipAddress(t){const e=t.split(":");if(e.length!==3)throw new Error(`Invalid CAIP-10 address: ${t}`);const[r,n,i]=e;if(!r||!n||!i)throw new Error(`Invalid CAIP-10 address: ${t}`);return{chainNamespace:r,chainId:n,address:i}},parseCaipNetworkId(t){const e=t.split(":");if(e.length!==2)throw new Error(`Invalid CAIP-2 network id: ${t}`);const[r,n]=e;if(!r||!n)throw new Error(`Invalid CAIP-2 network id: ${t}`);return{chainNamespace:r,chainId:n}}},Do={RPC_ERROR_CODE:{USER_REJECTED_REQUEST:4001,USER_REJECTED_METHODS:5002,USER_REJECTED:5e3,SEND_TRANSACTION_ERROR:5001},PROVIDER_RPC_ERROR_NAME:{PROVIDER_RPC:"ProviderRpcError",USER_REJECTED_REQUEST:"UserRejectedRequestError",SEND_TRANSACTION_ERROR:"SendTransactionError"},isRpcProviderError(t){try{if(typeof t=="object"&&t!==null){const e=t,r=typeof e.message=="string",n=typeof e.code=="number";return r&&n}return!1}catch{return!1}},isUserRejectedMessage(t){return t.toLowerCase().includes("user rejected")||t.toLowerCase().includes("user cancelled")||t.toLowerCase().includes("user canceled")},isUserRejectedRequestError(t){if(Do.isRpcProviderError(t)){const e=t.code===Do.RPC_ERROR_CODE.USER_REJECTED_REQUEST,r=t.code===Do.RPC_ERROR_CODE.USER_REJECTED_METHODS;return e||r||Do.isUserRejectedMessage(t.message)}return t instanceof Error?Do.isUserRejectedMessage(t.message):!1}};
vendor: 5,156 bytes, line 13
13let bH=class extends Error{constructor(e,r){super(r.message,{cause:e}),this.name=Do.PROVIDER_RPC_ERROR_NAME.PROVIDER_RPC,this.code=r.code}},kd=class extends bH{constructor(e){super(e,{code:Do.RPC_ERROR_CODE.USER_REJECTED_REQUEST,message:"User rejected the request"}),this.name=Do.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST}};const Le={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit-wallet/SOCIAL_USERNAME",RECENT_WALLETS:"@appkit/recent_wallets",RECENT_WALLET:"@appkit/recent_wallet",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",ACTIVE_NAMESPACE:"@appkit/active_namespace",CONNECTED_NAMESPACES:"@appkit/connected_namespaces",CONNECTION_STATUS:"@appkit/connection_status",SIWX_AUTH_TOKEN:"@appkit/siwx-auth-token",SIWX_NONCE_TOKEN:"@appkit/siwx-nonce-token",TELEGRAM_SOCIAL_PROVIDER:"@appkit/social_provider",NATIVE_BALANCE_CACHE:"@appkit/native_balance_cache",PORTFOLIO_CACHE:"@appkit/portfolio_cache",ENS_CACHE:"@appkit/ens_cache",IDENTITY_CACHE:"@appkit/identity_cache",PREFERRED_ACCOUNT_TYPES:"@appkit/preferred_account_types",CONNECTIONS:"@appkit/connections",DISCONNECTED_CONNECTOR_IDS:"@appkit/disconnected_connector_ids",HISTORY_TRANSACTIONS_CACHE:"@appkit/history_transactions_cache",TOKEN_PRICE_CACHE:"@appkit/token_price_cache",RECENT_EMAILS:"@appkit/recent_emails",LATEST_APPKIT_VERSION:"@appkit/latest_version",TON_WALLETS_CACHE:"@appkit/ton_wallets_cache"};function J2(t){if(!t)throw new Error("Namespace is required for CONNECTED_CONNECTOR_ID");return`@appkit/${t}:connected_connector_id`}const Fe={setItem(t,e){B0()&&e!==void 0&&localStorage.setItem(t,e)},getItem(t){if(B0())return localStorage.getItem(t)||void 0},removeItem(t){B0()&&localStorage.removeItem(t)},clear(){B0()&&localStorage.clear()}};function B0(){return typeof window<"u"&&typeof localStorage<"u"}function Ep(t,e){const r=(t==null?void 0:t["--apkt-accent"])??(t==null?void 0:t["--w3m-accent"]);return e==="light"?{"--w3m-accent":r||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":r||"hsla(230, 100%, 67%, 1)","--w3m-background":"#202020"}}const q2=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",PN=[{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],yH="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",kt={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:q2,SECURE_SITE_DASHBOARD:`${q2}/dashboard`,SECURE_SITE_FAVICON:`${q2}/images/favicon.png`,SOLANA_NATIVE_TOKEN_ADDRESS:"So11111111111111111111111111111111111111111",RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SUGGESTED_TOKENS_BY_CHAIN:{"eip155:42161":["USDâ®0"]},BALANCE_SUPPORTED_CHAINS:[K.CHAIN.EVM,K.CHAIN.SOLANA],SEND_PARAMS_SUPPORTED_CHAINS:[K.CHAIN.EVM],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:[K.CHAIN.EVM],ONRAMP_SUPPORTED_CHAIN_NAMESPACES:[K.CHAIN.EVM,K.CHAIN.SOLANA],PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES:[K.CHAIN.EVM,K.CHAIN.SOLANA],ACTIVITY_ENABLED_CHAIN_NAMESPACES:[K.CHAIN.EVM,K.CHAIN.TON],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x",cosmos:"0x",sui:"0x",stacks:"0x",ton:"0x",tron:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in the wallet app",WEB:"Open and continue in the wallet app"},SEND_SUPPORTED_NAMESPACES:[K.CHAIN.EVM,K.CHAIN.SOLANA],DEFAULT_REMOTE_FEATURES:{swaps:["1inch"],onramp:["meld"],email:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],activity:!0,reownBranding:!0,multiWallet:!1,emailCapture:!1,payWithExchange:!1,payments:!1,reownAuthentication:!1,headless:!1},DEFAULT_REMOTE_FEATURES_DISABLED:{email:!1,socials:!1,swaps:!1,onramp:!1,activity:!1,reownBranding:!1,emailCapture:!1,reownAuthentication:!1,headless:!1},DEFAULT_FEATURES:{receive:!0,send:!0,emailShowWallets:!0,connectorTypeOrder:["walletConnect","recent","
13injected","featured","custom","external","recommended"],analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1,collapseWallets:!1,walletFeaturesOrder:["onramp","swaps","receive","send"],connectMethodsOrder:void 0,pay:!1,reownAuthentication:!1,headless:!1},DEFAULT_SOCIALS:["google","x","farcaster","discord","apple","github","facebook"],DEFAULT_ACCOUNT_TYPES:{bip122:"payment",eip155:"smartAccount",polkadot:"eoa",solana:"eoa",ton:"eoa",tron:"eoa"},ADAPTER_TYPES:{UNIVERSAL:"universal",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",BITCOIN:"bitcoin"},SIWX_DEFAULTS:{signOutOnDisconnect:!0},MANDATORY_WALLET_IDS_ON_MOBILE:[Di.ConnectorExplorerIds[K.CONNECTOR_ID.COINBASE],Di.ConnectorExplorerIds[K.CONNECTOR_ID.COINBASE_SDK],Di.ConnectorExplorerIds[K.CONNECTOR_ID.BASE_ACCOUNT],Di.ConnectorExplorerIds[K.SOLFLARE_CONNECTOR_NAME],Di.ConnectorExplorerIds[K.PHANTOM_CONNECTOR_NAME],Di.ConnectorExplorerIds[K.BINANCE_CONNECTOR_NAME]],DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"]},le={cacheExpiry:{portfolio:3e4,nativeBalance:3e4,ens:3e5,identity:3e5,transactionsHistory:15e3,tokenPrice:15e3,latestAppKitVersion:6048e5,tonWallets:864e5},isCacheExpired(t,e){return Date.now()-t>e},getActiveNetworkProps(){const t=le.getActiveNamespace(),e=le.getActiveCaipNetworkId(),r=e?e.split(":")[1]:void 0,n=r?isNaN(Number(r))?r:Number(r):void 0;return{namespace:t,caipNetworkId:e,chainId:n}},setWalletConnectDeepLink({name:t,href:e}){try{Fe.setItem(Le.DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const t=Fe.getItem(Le.DEEPLINK_CHOICE);if(t)return JSON.parse(t)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{Fe.removeItem(Le.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setActiveNamespace(t){try{Fe.setItem(Le.ACTIVE_NAMESPACE,t)}catch{console.info("Unable to set active namespace")}},setActiveCaipNetworkId(t){try{Fe.setItem(Le.ACTIVE_CAIP_NETWORK_ID,t),le.setActiveNamespace(t.split(":")[0])}catch{console.info("Unable to set active caip network id")}},getActiveCaipNetworkId(){try{return Fe.getItem(Le.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to get active caip network id");return}},deleteActiveCaipNetworkId(){try{Fe.removeItem(Le.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to delete active caip network id")}},deleteConnectedConnectorId(t){try{const e=J2(t);Fe.removeItem(e)}catch{console.info("Unable to delete connected connector id")}},setAppKitRecent(t){try{const e=le.getRecentWallets();e.find(n=>n.id===t.id)||(e.unshift(t),e.length>2&&e.pop(),Fe.setItem(Le.RECENT_WALLETS,JSON.stringify(e)),Fe.setItem(Le.RECENT_WALLET,JSON.stringify(t)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{const t=Fe.getItem(Le.RECENT_WALLETS);return t?JSON.parse(t):[]}catch{console.info("Unable to get AppKit recent")}return[]},getRecentWallet(){try{const t=Fe.getItem(Le.RECENT_WALLET);return t?JSON.parse(t):null}catch{console.info("Unable to get AppKit recent")}return null},deleteRecentWallet(){try{Fe.removeItem(Le.RECENT_WALLET)}catch{console.info("Unable to delete AppKit recent")}},setConnectedConnectorId(t,e){try{const r=J2(t);Fe.setItem(r,e)}catch{console.info("Unable to set Connected Connector Id")}},getActiveNamespace(){try{return Fe.getItem(Le.ACTIVE_NAMESPACE)}catch{console.info("Unable to get active namespace")}},getConnectedConnectorId(t){if(t)try{const e=J2(t);return Fe.getItem(e)}catch{console.info("Unable to get connected connector id in namespace",t)}},setConnectedSocialProvider(t){try{Fe.setItem(Le.CONNECTED_SOCIAL,t)}catch{console.info("Unable to set connected social provider")}},getConnectedSocialProvider(){try{return Fe.getItem(Le.CONNECTED_SOCIAL)}catch{console.info("Unable to get connected social provider")}},deleteConnectedSocialProvider(){try{Fe.removeItem(Le.CONNECTED_SOCIAL)}catch{console.info("Unable to delete connected social provider")}},getConnectedSocialUsername(){try{return Fe.getItem(Le.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get connected social username")}},getStoredActiveCaipNetworkId(){var r;const t=Fe.getItem(Le.ACTIVE_CAIP_NETWORK_ID);return(r=t==null?void 0:t.split(":"))==null?void 0:r[1]},setConnectionStatus(t){try{Fe.setItem(Le.CONNECTION_STATUS,t)}catch{console.info("Unable to set connection status")}},getConnectionStatus(){try{return Fe.getItem(Le.CONNECTION_STATUS)}catch{return}},getConnectedNamespaces(){try{const t=Fe.getItem(Le.CONNECTED_NAMESPACES);return t!=null&&t.length?t.split(","):[]}catch{return[]}},setConnectedNamespaces(t){try{const e=Array.from(new Set(t));Fe.setItem(Le.CONNECTED_NAMESPACES,e.join(","))}catch{console.info("Unable to set namespaces in storage")}},addConnectedNamespace(t){try{const e=le.getConnectedNamespaces();e.includes(t)||(e.push(t),le.setConnectedNamespaces(e))}catch{console.info("Unable to add connected namespace")}},removeConnectedNamespace(t){try{const e=le.getConnectedNamespaces(),r=e.indexOf(t);r>-1&&(e.splice(r,1),le.setConnectedNamespaces(e))}catch{console.info("Unable to remove connected namespace")}},getTelegramSocialProvider(){try{return Fe.getItem(Le.TELEGRAM_SOCIAL_PROVIDER)}catch{return console.info("Unable to get telegram social provider"),null}},setTelegramSocialProvider(t){try{Fe.setItem(Le.TELEGRAM_SOCIAL_PROVIDER,t)}catch{console.info("Unable to set telegram social provider")}},removeTelegramSocialProvider(){try{Fe.removeItem(Le.TELEGRAM_SOCIAL_PROVIDER)}catch{console.info("Unable to remove telegram social provider")}},getBalanceCache(){let t={};try{const e=Fe.getItem(Le.PORTFOLIO_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get balance cache")}return t},removeAddressFromBalanceCache(t){try{const e=le.getBalanceCache();Fe.setItem(Le.PORTFOLIO_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove address from balance cache",t)}},getBalanceCacheForCaipAddress(t){try{const r=le.getBalanceCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.portfolio))return r.balance;le.removeAddressFromBalanceCache(t)}catch{console.info("Unable to get balance cache for address",t)}},updateBalanceCache(t){try{const e=le.getBalanceCache();e[t.caipAddress]=t,Fe.setItem(Le.PORTFOLIO_CACHE,JSON.stringify(e))}catch{console.info("Unable to update balance cache",t)}},getNativeBalanceCache(){let t={};try{const e=Fe.getItem(Le.NATIVE_BALANCE_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get balance cache")}return t},removeAddressFromNativeBalanceCache(t){try{const e=le.getBalanceCache();Fe.setItem(Le.NATIVE_BALANCE_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove address from balance cache",t)}},getNativeBalanceCacheForCaipAddress(t){try{const r=le.getNativeBalanceCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.nativeBalance))return r;console.info("Discarding cache for address",t),le.removeAddressFromBalanceCache(t)}catch{console.info("Unable to get balance cache for address",t)}},updateNativeBalanceCache(t){try{const e=le.getNativeBalanceCache();e[t.caipAddress]=t,Fe.setItem(Le.NATIVE_BALANCE_CACHE,JSON.stringify(e))}catch{console.info("Unable to update balance cache",t)}},getEnsCache(){let t={};try{const e=Fe.getItem(Le.ENS_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get ens name cache")}return t}
vendor: 5,173 bytes, line 13
13,getEnsFromCacheForAddress(t){try{const r=le.getEnsCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.ens))return r.ens;le.removeEnsFromCache(t)}catch{console.info("Unable to get ens name from cache",t)}},updateEnsCache(t){try{const e=le.getEnsCache();e[t.address]=t,Fe.setItem(Le.ENS_CACHE,JSON.stringify(e))}catch{console.info("Unable to update ens name cache",t)}},removeEnsFromCache(t){try{const e=le.getEnsCache();Fe.setItem(Le.ENS_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove ens name from cache",t)}},getIdentityCache(){let t={};try{const e=Fe.getItem(Le.IDENTITY_CACHE);t=e?JSON.parse(e):{}}catch{console.info("Unable to get identity cache")}return t},getIdentityFromCacheForAddress(t){try{const r=le.getIdentityCache()[t];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.identity))return r.identity;le.removeIdentityFromCache(t)}catch{console.info("Unable to get identity from cache",t)}},updateIdentityCache(t){try{const e=le.getIdentityCache();e[t.address]={identity:t.identity,timestamp:t.timestamp},Fe.setItem(Le.IDENTITY_CACHE,JSON.stringify(e))}catch{console.info("Unable to update identity cache",t)}},removeIdentityFromCache(t){try{const e=le.getIdentityCache();Fe.setItem(Le.IDENTITY_CACHE,JSON.stringify({...e,[t]:void 0}))}catch{console.info("Unable to remove identity from cache",t)}},getTonWalletsCache(){try{const t=Fe.getItem(Le.TON_WALLETS_CACHE),e=t?JSON.parse(t):void 0;if(e&&!this.isCacheExpired(e.timestamp,this.cacheExpiry.tonWallets))return e;le.removeTonWalletsCache()}catch{console.info("Unable to get ton wallets cache")}},updateTonWalletsCache(t){try{const e=le.getTonWalletsCache()||{timestamp:0,wallets:[]};e.timestamp=new Date().getTime(),e.wallets=t,Fe.setItem(Le.TON_WALLETS_CACHE,JSON.stringify(e))}catch{console.info("Unable to update ton wallets cache",t)}},removeTonWalletsCache(){try{Fe.removeItem(Le.TON_WALLETS_CACHE)}catch{console.info("Unable to remove ton wallets cache")}},clearAddressCache(){try{Fe.removeItem(Le.PORTFOLIO_CACHE),Fe.removeItem(Le.NATIVE_BALANCE_CACHE),Fe.removeItem(Le.ENS_CACHE),Fe.removeItem(Le.IDENTITY_CACHE),Fe.removeItem(Le.HISTORY_TRANSACTIONS_CACHE)}catch{console.info("Unable to clear address cache")}},setPreferredAccountTypes(t){try{Fe.setItem(Le.PREFERRED_ACCOUNT_TYPES,JSON.stringify(t))}catch{console.info("Unable to set preferred account types",t)}},getPreferredAccountTypes(){try{const t=Fe.getItem(Le.PREFERRED_ACCOUNT_TYPES);return t?JSON.parse(t):{}}catch{console.info("Unable to get preferred account types")}return{}},setConnections(t,e){try{const r=le.getConnections(),n=r[e]??[],i=new Map;for(const o of n)i.set(o.connectorId,{...o});for(const o of t){const a=i.get(o.connectorId),c=o.connectorId===K.CONNECTOR_ID.AUTH;if(a&&!c){const l=new Set(a.accounts.map(f=>f.address.toLowerCase())),u=o.accounts.filter(f=>!l.has(f.address.toLowerCase()));a.accounts.push(...u)}else i.set(o.connectorId,{...o})}const s={...r,[e]:Array.from(i.values())};Fe.setItem(Le.CONNECTIONS,JSON.stringify(s))}catch(r){console.error("Unable to sync connections to storage",r)}},getConnections(){try{const t=Fe.getItem(Le.CONNECTIONS);return t?JSON.parse(t):{}}catch(t){return console.error("Unable to get connections from storage",t),{}}},deleteAddressFromConnection({connectorId:t,address:e,namespace:r}){try{const n=le.getConnections(),i=n[r]??[],s=new Map(i.map(a=>[a.connectorId,a])),o=s.get(t);o&&(o.accounts.filter(c=>c.address.toLowerCase()!==e.toLowerCase()).length===0?s.delete(t):s.set(t,{...o,accounts:o.accounts.filter(c=>c.address.toLowerCase()!==e.toLowerCase())})),Fe.setItem(Le.CONNECTIONS,JSON.stringify({...n,[r]:Array.from(s.values())}))}catch{console.error(`Unable to remove address "${e}" from connector "${t}" in namespace "${r}"`)}},getDisconnectedConnectorIds(){try{const t=Fe.getItem(Le.DISCONNECTED_CONNECTOR_IDS);return t?JSON.parse(t):{}}catch{console.info("Unable to get disconnected connector ids")}return{}},addDisconnectedConnectorId(t,e){try{const r=le.getDisconnectedConnectorIds(),n=r[e]??[];n.push(t),Fe.setItem(Le.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...r,[e]:Array.from(new Set(n))}))}catch{console.error(`Unable to set disconnected connector id "${t}" for namespace "${e}"`)}},removeDisconnectedConnectorId(t,e){try{const r=le.getDisconnectedConnectorIds();let n=r[e]??[];n=n.filter(i=>i.toLowerCase()!==t.toLowerCase()),Fe.setItem(Le.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...r,[e]:Array.from(new Set(n))}))}catch{console.error(`Unable to remove disconnected connector id "${t}" for namespace "${e}"`)}},isConnectorDisconnected(t,e){try{return(le.getDisconnectedConnectorIds()[e]??[]).some(i=>i.toLowerCase()===t.toLowerCase())}catch{console.info(`Unable to get disconnected connector id "${t}" for namespace "${e}"`)}return!1},getTransactionsCache(){try{const t=Fe.getItem(Le.HISTORY_TRANSACTIONS_CACHE);return t?JSON.parse(t):{}}catch{console.info("Unable to get transactions cache")}return{}},getTransactionsCacheForAddress({address:t,chainId:e=""}){var r;try{const i=(r=le.getTransactionsCache()[t])==null?void 0:r[e];if(i&&!this.isCacheExpired(i.timestamp,this.cacheExpiry.transactionsHistory)
13)return i.transactions;le.removeTransactionsCache({address:t,chainId:e})}catch{console.info("Unable to get transactions cache")}},updateTransactionsCache({address:t,chainId:e="",timestamp:r,transactions:n}){try{const i=le.getTransactionsCache();i[t]={...i[t],[e]:{timestamp:r,transactions:n}},Fe.setItem(Le.HISTORY_TRANSACTIONS_CACHE,JSON.stringify(i))}catch{console.info("Unable to update transactions cache",{address:t,chainId:e,timestamp:r,transactions:n})}},removeTransactionsCache({address:t,chainId:e}){try{const r=le.getTransactionsCache(),n=(r==null?void 0:r[t])||{},{[e]:i,...s}=n;Fe.setItem(Le.HISTORY_TRANSACTIONS_CACHE,JSON.stringify({...r,[t]:s}))}catch{console.info("Unable to remove transactions cache",{address:t,chainId:e})}},getTokenPriceCache(){try{const t=Fe.getItem(Le.TOKEN_PRICE_CACHE);return t?JSON.parse(t):{}}catch{console.info("Unable to get token price cache")}return{}},getTokenPriceCacheForAddresses(t){try{const r=le.getTokenPriceCache()[t.join(",")];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.tokenPrice))return r.tokenPrice;le.removeTokenPriceCache(t)}catch{console.info("Unable to get token price cache for addresses",t)}},updateTokenPriceCache(t){try{const e=le.getTokenPriceCache();e[t.addresses.join(",")]={timestamp:t.timestamp,tokenPrice:t.tokenPrice},Fe.setItem(Le.TOKEN_PRICE_CACHE,JSON.stringify(e))}catch{console.info("Unable to update token price cache",t)}},removeTokenPriceCache(t){try{const e=le.getTokenPriceCache();Fe.setItem(Le.TOKEN_PRICE_CACHE,JSON.stringify({...e,[t.join(",")]:void 0}))}catch{console.info("Unable to remove token price cache",t)}},getLatestAppKitVersion(){try{const t=this.getLatestAppKitVersionCache(),e=t==null?void 0:t.version;return e&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.latestAppKitVersion)?e:void 0}catch{console.info("Unable to get latest AppKit version")}},getLatestAppKitVersionCache(){try{const t=Fe.getItem(Le.LATEST_APPKIT_VERSION);return t?JSON.parse(t):{}}catch{console.info("Unable to get latest AppKit version cache")}return{}},updateLatestAppKitVersion(t){try{const e=le.getLatestAppKitVersionCache();e.timestamp=t.timestamp,e.version=t.version,Fe.setItem(Le.LATEST_APPKIT_VERSION,JSON.stringify(e))}catch{console.info("Unable to update latest AppKit version on local storage",t)}}},Ce={getWindow(){if(!(typeof window>"u"))return window},isMobile(){var t;return this.isClient()?!!(window!=null&&window.matchMedia&&typeof window.matchMedia=="function"&&((t=window.matchMedia("(pointer:coarse)"))!=null&&t.matches)||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.caipNetworkId.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){if(!this.isMobile())return!1;const t=window==null?void 0:window.navigator.userAgent.toLowerCase();return Ce.isMobile()&&t.includes("android")},isIos(){if(!this.isMobile())return!1;const t=window==null?void 0:window.navigator.userAgent.toLowerCase();return t.includes("iphone")||t.includes("ipad")},isSafari(){return this.isClient()?(window==null?void 0:window.navigator.userAgent.toLowerCase()).includes("safari"):!1},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=kt.TEN_SEC_MS:!0},isAllowedRetry(t,e=kt.ONE_SEC_MS){return Date.now()-t>=e},copyToClopboard(t){navigator.clipboard.writeText(t)},isIframe(){try{return(window==null?void 0:window.self)!==(window==null?void 0:window.top)}catch{return!1}},isSafeApp(){var t,e;if(Ce.isClient()&&window.self!==window.top)try{const r=(e=(t=window==null?void 0:window.location)==null?void 0:t.ancestorOrigins)==null?void 0:e[0],n="https://app.safe.global";if(r){const i=new URL(r),s=new URL(n);return i.hostname===s.hostname}}catch{return!1}return!1},getPairingExpiry(){return Date.now()+kt.FOUR_MINUTES_MS},getNetworkId(t){return t==null?void 0:t.split(":")[1]},getPlainAddress(t){return t==null?void 0:t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let r;return(...n)=>{function i(){t(...n)}r&&clearTimeout(r),r=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e,r=null){if(Ce.isHttpUrl(t))return this.formatUniversalUrl(t,e);let n=t,i=r;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),i&&!(i!=null&&i.endsWith("/"))&&(i=`${i}/`),this.isTelegram()&&this.isAndroid()&&(e=encodeURIComponent(e));const s=encodeURIComponent(e);return{redirect:`${n}wc?uri=${s}`,redirectUniversalLink:i?`${i}wc?uri=${s}`:void 0,href:n}},formatUniversalUrl(t,e){if(!Ce.isHttpUrl(t))return this.formatNativeUrl(t,e);let r=t;r.endsWith("/")||(r=`${r}/`);const n=encodeURIComponent(e);return{redirect:`${r}wc?uri=${n}`,href:r}},getOpenTargetForPlatform(t){return t==="popupWindow"?t:this.isTelegram()?le.getTelegramSocialProvider()?"_top":"_blank":t},openHref(t,e,r){window==null||window.open(t,this.getOpenTargetForPlatform(e),r||"n
13oreferrer noopener")},returnOpenHref(t,e,r){return window==null?void 0:window.open(t,this.getOpenTargetForPlatform(e),r||"noreferrer noopener")},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},isPWA(){var r,n;if(typeof window>"u")return!1;const t=window!=null&&window.matchMedia&&typeof window.matchMedia=="function"?(r=window.matchMedia("(display-mode: standalone)"))==null?void 0:r.matches:!1,e=(n=window==null?void 0:window.navigator)==null?void 0:n.standalone;return!!(t||e)},async preloadImage(t){const e=new Promise((r,n)=>{const i=new Image;i.onload=r,i.onerror=n,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,Ce.wait(2e3)])},parseBalance(t,e){let r="0.000";if(typeof t=="string"){const c=Number(t);if(!isNaN(c)){const l=(Math.floor(c*1e3)/1e3).toFixed(3);l&&(r=l)}}const[n,i]=r.split("."),s=n||"0",o=i||"000";return{formattedText:`${s}.${o}${e?` ${e}`:""}`,value:s,decimals:o,symbol:e}},getApiUrl(){return K.W3M_API_URL},getBlockchainApiUrl(){return K.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return K.PULSE_API_URL},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})},parseError(t){var e,r;return typeof t=="string"?t:typeof((r=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:r.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const r={};return e&&t&&(t.forEach((n,i)=>{r[n]=i}),e.sort((n,i)=>{const s=r[n.id],o=r[i.id];return s!==void 0&&o!==void 0?s-o:s!==void 0?-1:o!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const r of t)e+=r.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[r,n]=e.split(".");return{dollars:r,pennies:n}},isAddress(t,e="eip155"){switch(e){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);case"bip122":{const r=/^[1][a-km-zA-HJ-NP-Z1-9]{25,34}$/u.test(t),n=/^[3][a-km-zA-HJ-NP-Z1-9]{25,34}$/u.test(t),i=/^bc1[a-z0-9]{39,87}$/u.test(t),s=/^bc1p[a-z0-9]{58}$/u.test(t);return r||n||i||s}default:return!1}},uniqueBy(t,e){const r=new Set;return t.filter(n=>{const i=n[e];return r.has(i)?!1:(r.add(i),!0)})},generateSdkVersion(t,e,r){const i=t.length===0?kt.ADAPTER_TYPES.UNIVERSAL:t.map(s=>s.adapterType).join(",");return`${e}-${i}-${r}`},createAccount(t){const{chainNamespace:e,chainId:r,address:n}=kn.parseCaipAddress(t.caipAddress);return{namespace:e,address:n,chainId:r,caipAddress:t.caipAddress,type:t.type,publicKey:t.publicKey,path:t.path}},isCaipAddress(t){if(typeof t!="string")return!1;const e=t.split(":"),r=e[0];return e.filter(Boolean).length===3&&r in K.CHAIN_NAME_MAP},getAccount(t){return t?typeof t=="string"?{address:t,chainId:void 0}:{address:t.address,chainId:t.chainId}:{address:void 0,chainId:void 0}},isMac(){const t=window==null?void 0:window.navigator.userAgent.toLowerCase();return t.includes("macintosh")&&!t.includes("safari")},formatTelegramSocialLoginUrl(t){const e=`--${encodeURIComponent(window==null?void 0:window.location.href)}`,r="state=";if(new URL(t).host==="auth.magic.link"){const i="provider_authorization_url=",s=t.substring(t.indexOf(i)+i.length),o=this.injectIntoUrl(decodeURIComponent(s),r,e);return t.replace(s,encodeURIComponent(o))}return this.injectIntoUrl(t,r,e)},injectIntoUrl(t,e,r){const n=t.indexOf(e);if(n===-1)throw new Error(`${e} parameter not found in the URL: ${t}`);const i=t.indexOf("&",n),s=e.length,o=i!==-1?i:t.length,a=t.substring(0,n+s),c=t.substring(n+s,o),l=t.substring(i),u=c+r;return a+u+l},isNumber(t){return typeof t!="number"&&typeof t!="string"?!1:!isNaN(Number(t))},appendPayToUri(t,e){return e?`${t}&pay=${encodeURIComponent(e)}`:t}},vH="https://secure.walletconnect.org/sdk",wH=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL:void 0)||vH,EH=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_DEFAULT_LOG_LEVEL:void 0)||"error",AH=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION:void 0)||"4",Be={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SO
13CIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",APP_RELOAD:"@w3m-app/RELOAD",APP_RPC_ABORT:"@w3m-app/RPC_ABORT",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",FRAME_RELOAD_SUCCESS:"@w3m-frame/RELOAD_SUCCESS",FRAME_RELOAD_ERROR:"@w3m-frame/RELOAD_ERROR",FRAME_RPC_ABORT_SUCCESS:"@w3m-frame/RPC_ABORT_SUCCESS",FRAME_RPC_ABORT_ERROR:"@w3m-frame/RPC_ABORT_ERROR",RPC_RESPONSE_TYPE_ER
13ROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},Tn={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints","wallet_getAssets"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}},OA={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u},Ln={set(t,e){Ms.isClient&&localStorage.setItem(`${Be.STORAGE_KEY}${t}`,e)},get(t){return Ms.isClient?localStorage.getItem(`${Be.STORAGE_KEY}${t}`):null},delete(t,e){Ms.isClient&&(e?localStorage.removeItem(t):localStorage.removeItem(`${Be.STORAGE_KEY}${t}`))}},bg=30*1e3,Ms={checkIfAllowedToTriggerEmail(){const t=Ln.get(Be.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e<bg){const r=Math.ceil((bg-e)/1e3);throw new Error(`Please try again after ${r} seconds`)}}},getTimeToNextEmailLogin(){const t=Ln.get(Be.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e<bg)return Math.ceil((bg-e)/1e3)}return 0},checkIfRequestExists(t){return Tn.NOT_SAFE_RPC_METHODS.includes(t.method)||Tn.SAFE_RPC_METHODS.includes(t.method)},getResponseType(t){return typeof t=="string"&&((t==null?void 0:t.match(OA.transactionHash))||(t==null?void 0:t.match(OA.signedMessage)))?Be.RPC_RESPONSE_TYPE_TX:Be.RPC_RESPONSE_TYPE_OBJECT},checkIfRequestIsSafe(t){return Tn.SAFE_RPC_METHODS.includes(t.method)},isClient:typeof window<"u"};var Er;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(const o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Er||(Er={}));var l3;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(l3||(l3={}));const ke=Er.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),kl=t=>{switch(typeof t){case"undefined":return ke.undefined;case"string":return ke.string;case"number":return isNaN(t)?ke.nan:ke.number;case"boolean":return ke.boolean;case"function":return ke.function;case"bigint":return ke.bigint;case"symbol":return ke.symbol;case"object":return Array.isArray(t)?ke.array:t===null?ke.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ke.promise:typeof Map<"u"&&t instanceof Map?ke.map:typeof Set<"u"&&t instanceof Set?ke.set:typeof Date<"u"&&t instanceof Date?ke.date:ke.object;default:return ke.unknown}}
vendor: 39,226 bytes, line 13
13,Ae=Er.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),_H=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ho extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){const l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Er.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ho.create=t=>new Ho(t);const Ap=(t,e)=>{let r;switch(t.code){case Ae.invalid_type:t.received===ke.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Er.jsonStringifyReplacer)}`;break;case Ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${Er.joinValues(t.keys,", ")}`;break;case Ae.invalid_union:r="Invalid input";break;case Ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Er.joinValues(t.options)}`;break;case Ae.invalid_enum_value:r=`Invalid enum value. Expected ${Er.joinValues(t.options)}, received '${t.received}'`;break;case Ae.invalid_arguments:r="Invalid function arguments";break;case Ae.invalid_return_type:r="Invalid function return type";break;case Ae.invalid_date:r="Invalid date";break;case Ae.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Er.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Ae.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Ae.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Ae.custom:r="Invalid input";break;case Ae.invalid_intersection_types:r="Intersection results could not be merged";break;case Ae.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Ae.not_finite:r="Number must be finite";break;default:r=e.defaultError,Er.assertNever(t)}return{message:r}};let kN=Ap;function CH(t){kN=t}function Qm(){return kN}const eb=t=>{const{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s};let a="";const c=n.filter(l=>!!l).slice().reverse();for(const l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},SH=[];function De(t,e){const r=eb({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qm(),Ap].filter(n=>!!n)});t.common.issues.push(r)}class Pi{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const i of r){if(i.status==="aborted")return mt;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const i of r)n.push({key:await i.key,value:await i.value});return Pi.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const i of r){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return mt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const mt=Object.freeze({status:"aborted"}),ON=t=>({status:"dirty",value:t}),qi=t=>({status:"valid",value:t}),u3=t=>t.status==="aborted",f3=t=>t.status==="dirty",_p=t=>t.status==="valid",tb=t=>typeof Promise<"u"&&t instanceof Promise;var Ke;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ke||(Ke={}));class ja{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const MA=(t,e)=>{if(_p(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ho(t.common.issues);return this._error=r,this._error}}};function At(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:i}}class It{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return kl(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:kl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Pi,ctx:{common:e.parent.common,data:e.data,parsedType:kl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(tb(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kl(e)},s=this._parseSync({data:e,path:i.path,parent:i});return MA(i,s)}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kl(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(tb(i)?i:Promise.resolve(i));return MA(n,s)}refine(e,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const o=e(i),a=()=>s.addIssue({code:Ae.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Go({schema:this,typeName:st.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Dc.create(this,this._def)}nullable(){return If.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jo.create(this,this._def)}promise(){return hh.create(this,this._def)}or(e){return Np.create([this,e],this._def)}and(e){return Ip.create(this,e,this._def)}transform(e){return new Go({...At(this._def),schema:this,typeName:st.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Op({...At(this._def),innerType:this,defaultValue:r,typeName:st.ZodDefault})}brand(){return new DN({typeName:st.ZodBranded,type:this,...At(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new sb({...At(this._def),innerType:this,catchValue:r,typeName:st.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return I1.create(this,e)}readonly(){return ab.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const TH=/^c[^\s-]{8,}$/i,NH=/^[a-z][a-z0-9]*$/,IH=/^[0-9A-HJKMNP-TV-Z]{26}$/,xH=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,RH=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PH="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let G2;const kH=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,OH=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,MH=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function DH(t,e){return!!((e==="v4"||!e)&&kH.test(t)||(e==="v6"||!e)&&OH.test(t))}class Lo extends It{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ke.string){const s=this._getOrReturnCtx(e);return De(s,{code:Ae.invalid_type,expected:ke.string,received:s.parsedType}),mt}const n=new Pi;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?De(i,{code:Ae.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&De(i,{code:Ae.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")RH.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"email",code:Ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")G2||(G2=new RegExp(PH,"u")),G2.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"emoji",code:Ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")xH.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"uuid",code:Ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")TH.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"cuid",code:Ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")NH.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"cuid2",code:Ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")IH.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"ulid",code:Ae.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),De(i,{validation:"url",code:Ae.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"regex",code:Ae.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?MH(s).test(e.data)||(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?DH(e.data,s.version)||(i=this._getOrReturnCtx(e,i),De(i,{validation:"ip",code:Ae.invalid_string,message:s.message}),n.dirty()):Er.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:Ae.invalid_string,...Ke.errToObj(n)})}_addCheck(e){return new Lo({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ke.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ke.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ke.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ke.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ke.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ke.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ke.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ke.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...Ke.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Ke.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...Ke.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Ke.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Ke.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Ke.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Ke.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Ke.errToObj(r)})}nonempty(e){return this.min(1,Ke.errToObj(e))}trim(){return new Lo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Lo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Lo({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Lo.create=t=>{var e;return new Lo({checks:[],typeName:st.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...At(t)})};function BH(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class ru extends It{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ke.number){const s=this._getOrReturnCtx(e);return De(s,{code:Ae.invalid_type,expected:ke.number,received:s.parsedType}),mt}let n;const i=new Pi;for(const s of this._def.checks)s.kind==="int"?Er.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?BH(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.not_finite,message:s.message}),i.dirty()):Er.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Ke.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Ke.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Ke.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Ke.toString(r))}setLimit(e,r,n,i){return new ru({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Ke.toString(i)}]})}_addCheck(e){return new ru({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ke.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ke.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Ke.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Ke.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ke.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ke.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Er.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}ru.create=t=>new ru({checks:[],typeName:st.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...At(t)});class nu extends It{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ke.bigint){const s=this._getOrReturnCtx(e);return De(s,{code:Ae.invalid_type,expected:ke.bigint,received:s.parsedType}),mt}let n;const i=new Pi;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),De(n,{code:Ae.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Er.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Ke.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Ke.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Ke.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Ke.toString(r))}setLimit(e,r,n,i){return new nu({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Ke.toString(i)}]})}_addCheck(e){return new nu({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ke.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ke.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ke.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ke.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Ke.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}nu.create=t=>{var e;return new nu({checks:[],typeName:st.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...At(t)})};class Cp extends It{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ke.boolean){const n=this._getOrReturnCtx(e);return De(n,{code:Ae.invalid_type,expected:ke.boolean,received:n.parsedType}),mt}return qi(e.data)}}Cp.create=t=>new Cp({typeName:st.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...At(t)});class Tf extends It{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ke.date){const s=this._getOrReturnCtx(e);return De(s,{code:Ae.invalid_type,expected:ke.date,received:s.parsedType}),mt}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return De(s,{code:Ae.invalid_date}),mt}const n=new Pi;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),De(i,{code:Ae.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Er.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Tf({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Ke.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Ke.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Tf.create=t=>new Tf({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:st.ZodDate,...At(t)});class rb extends It{_parse(e){if(this._getType(e)!==ke.symbol){const n=this._getOrReturnCtx(e);return De(n,{code:Ae.invalid_type,expected:ke.symbol,received:n.parsedType}),mt}return qi(e.data)}}rb.create=t=>new rb({typeName:st.ZodSymbol,...At(t)});class Sp extends It{_parse(e){if(this._getType(e)!==ke.undefined){const n=this._getOrReturnCtx(e);return De(n,{code:Ae.invalid_type,expected:ke.undefined,received:n.parsedType}),mt}return qi(e.data)}}Sp.create=t=>new Sp({typeName:st.ZodUndefined,...At(t)});class Tp extends It{_parse(e){if(this._getType(e)!==ke.null){const n=this._getOrReturnCtx(e);return De(n,{code:Ae.invalid_type,expected:ke.null,received:n.parsedType}),mt}return qi(e.data)}}Tp.create=t=>new Tp({typeName:st.ZodNull,...At(t)});class dh extends It{constructor(){super(...arguments),this._any=!0}_parse(e){return qi(e.data)}}dh.create=t=>new dh({typeName:st.ZodAny,...At(t)});class pf extends It{constructor(){super(...arguments),this._unknown=!0}_parse(e){return qi(e.data)}}pf.create=t=>new pf({typeName:st.ZodUnknown,...At(t)});class Jc extends It{_parse(e){const r=this._getOrReturnCtx(e);return De(r,{code:Ae.invalid_type,expected:ke.never,received:r.parsedType}),mt}}Jc.create=t=>new Jc({typeName:st.ZodNever,...At(t)});class nb extends It{_parse(e){if(this._getType(e)!==ke.undefined){const n=this._getOrReturnCtx(e);return De(n,{code:Ae.invalid_type,expected:ke.void,received:n.parsedType}),mt}return qi(e.data)}}nb.create=t=>new nb({typeName:st.ZodVoid,...At(t)});class jo extends It{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ke.array)return De(r,{code:Ae.invalid_type,expected:ke.array,received:r.parsedType}),mt;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(De(r,{code:o?Ae.too_big:Ae.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(De(r,{code:Ae.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(De(r,{code:Ae.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new ja(r,o,r.path,a)))).then(o=>Pi.mergeArray(n,o));const s=[...r.data].map((o,a)=>i.type._parseSync(new ja(r,o,r.path,a)));return Pi.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new jo({...this._def,minLength:{value:e,message:Ke.toString(r)}})}max(e,r){return new jo({...this._def,maxLength:{value:e,message:Ke.toString(r)}})}length(e,r){return new jo({...this._def,exactLength:{value:e,message:Ke.toString(r)}})}nonempty(e){return this.min(1,e)}}jo.create=(t,e)=>new jo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:st.ZodArray,...At(e)});function Td(t){if(t instanceof pn){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Dc.create(Td(n))}return new pn({...t._def,shape:()=>e})}else return t instanceof jo?new jo({...t._def,type:Td(t.element)}):t instanceof Dc?Dc.create(Td(t.unwrap())):t instanceof If?If.create(Td(t.unwrap())):t instanceof za?za.create(t.items.map(e=>Td(e))):t}class pn extends It{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Er.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ke.object){const l=this._getOrReturnCtx(e);return De(l,{code:Ae.invalid_type,expected:ke.object,received:l.parsedType}),mt}const{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Jc&&this._def.unknownKeys==="strip"))for(const l in i.data)o.includes(l)||a.push(l);const c=[];for(const l of o){const u=s[l],f=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ja(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Jc){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(De(i,{code:Ae.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const f=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ja(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const f=await u.key;l.push({key:f,value:await u.value,alwaysSet:u.alwaysSet})}return l}).then(l=>Pi.mergeObjectSync(n,l)):Pi.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return Ke.errToObj,new pn({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;const c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Ke.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new pn({...this._def,unknownKeys:"strip"})}passthrough(){return new pn({...this._def,unknownKeys:"passthrough"})}extend(e){return new pn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new pn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:st.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new pn({...this._def,catchall:e})}pick(e){const r={};return Er.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new pn({...this._def,shape:()=>r})}omit(e){const r={};return Er.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new pn({...this._def,shape:()=>r})}deepPartial(){return Td(this)}partial(e){const r={};return Er.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new pn({...this._def,shape:()=>r})}required(e){const r={};return Er.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Dc;)s=s._def.innerType;r[n]=s}}),new pn({...this._def,shape:()=>r})}keyof(){return MN(Er.objectKeys(this.shape))}}pn.create=(t,e)=>new pn({shape:()=>t,unknownKeys:"strip",catchall:Jc.create(),typeName:st.ZodObject,...At(e)});pn.strictCreate=(t,e)=>new pn({shape:()=>t,unknownKeys:"strict",catchall:Jc.create(),typeName:st.ZodObject,...At(e)});pn.lazycreate=(t,e)=>new pn({shape:t,unknownKeys:"strip",catchall:Jc.create(),typeName:st.ZodObject,...At(e)});class Np extends It{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Ho(a.ctx.common.issues));return De(r,{code:Ae.invalid_union,unionErrors:o}),mt}if(r.common.async)return Promise.all(n.map(async s=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const c of n){const l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(c=>new Ho(c));return De(r,{code:Ae.invalid_union,unionErrors:a}),mt}}get options(){return this._def.options}}Np.create=(t,e)=>new Np({options:t,typeName:st.ZodUnion,...At(e)});const Em=t=>t instanceof Rp?Em(t.schema):t instanceof Go?Em(t.innerType()):t instanceof Pp?[t.value]:t instanceof iu?t.options:t instanceof kp?Object.keys(t.enum):t instanceof Op?Em(t._def.innerType):t instanceof Sp?[void 0]:t instanceof Tp?[null]:null;class by extends It{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ke.object)return De(r,{code:Ae.invalid_type,expected:ke.object,received:r.parsedType}),mt;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(De(r,{code:Ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),mt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const i=new Map;for(const s of r){const o=Em(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new by({typeName:st.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...At(n)})}}function d3(t,e){const r=kl(t),n=kl(e);if(t===e)return{valid:!0,data:t};if(r===ke.object&&n===ke.object){const i=Er.objectKeys(e),s=Er.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(const a of s){const c=d3(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===ke.array&&n===ke.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const o=t[s],a=e[s],c=d3(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===ke.date&&n===ke.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ip extends It{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(u3(s)||u3(o))return mt;const a=d3(s.value,o.value);return a.valid?((f3(s)||f3(o))&&r.dirty(),{status:r.value,value:a.data}):(De(n,{code:Ae.invalid_intersection_types}),mt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ip.create=(t,e,r)=>new Ip({left:t,right:e,typeName:st.ZodIntersection,...At(r)});class za extends It{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ke.array)return De(n,{code:Ae.invalid_type,expected:ke.array,received:n.parsedType}),mt;if(n.data.length<this._def.items.length)return De(n,{code:Ae.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),mt;!this._def.rest&&n.data.length>this._def.items.length&&(De(n,{code:Ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((o,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new ja(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Pi.mergeArray(r,o)):Pi.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new za({...this._def,rest:e})}}za.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new za({items:t,typeName:st.ZodTuple,rest:null,...At(e)})};class xp extends It{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ke.object)return De(n,{code:Ae.invalid_type,expected:ke.object,received:n.parsedType}),mt;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)i.push({key:s._parse(new ja(n,a,n.path,a)),value:o._parse(new ja(n,n.data[a],n.path,a))});return n.common.async?Pi.mergeObjectAsync(r,i):Pi.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof It?new xp({keyType:e,valueType:r,typeName:st.ZodRecord,...At(n)}):new xp({keyType:Lo.create(),valueType:e,typeName:st.ZodRecord,...At(r)})}}class ib extends It{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ke.map)return De(n,{code:Ae.invalid_type,expected:ke.map,received:n.parsedType}),mt;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:i._parse(new ja(n,a,n.path,[l,"key"])),value:s._parse(new ja(n,c,n.path,[l,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of o){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return mt;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const c of o){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return mt;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}}}}ib.create=(t,e,r)=>new ib({valueType:e,keyType:t,typeName:st.ZodMap,...At(r)});class Nf extends It{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);
vendor: 8,457 bytes, line 13
13if(n.parsedType!==ke.set)return De(n,{code:Ae.invalid_type,expected:ke.set,received:n.parsedType}),mt;const i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(De(n,{code:Ae.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(De(n,{code:Ae.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function o(c){const l=new Set;for(const u of c){if(u.status==="aborted")return mt;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}const a=[...n.data.values()].map((c,l)=>s._parse(new ja(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new Nf({...this._def,minSize:{value:e,message:Ke.toString(r)}})}max(e,r){return new Nf({...this._def,maxSize:{value:e,message:Ke.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Nf.create=(t,e)=>new Nf({valueType:t,minSize:null,maxSize:null,typeName:st.ZodSet,...At(e)});class qd extends It{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ke.function)return De(r,{code:Ae.invalid_type,expected:ke.function,received:r.parsedType}),mt;function n(a,c){return eb({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Qm(),Ap].filter(l=>!!l),issueData:{code:Ae.invalid_arguments,argumentsError:c}})}function i(a,c){return eb({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Qm(),Ap].filter(l=>!!l),issueData:{code:Ae.invalid_return_type,returnTypeError:c}})}const s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof hh){const a=this;return qi(async function(...c){const l=new Ho([]),u=await a._def.args.parseAsync(c,s).catch(h=>{throw l.addIssue(n(c,h)),l}),f=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(f,s).catch(h=>{throw l.addIssue(i(f,h)),l})})}else{const a=this;return qi(function(...c){const l=a._def.args.safeParse(c,s);if(!l.success)throw new Ho([n(c,l.error)]);const u=Reflect.apply(o,this,l.data),f=a._def.returns.safeParse(u,s);if(!f.success)throw new Ho([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new qd({...this._def,args:za.create(e).rest(pf.create())})}returns(e){return new qd({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new qd({args:e||za.create([]).rest(pf.create()),returns:r||pf.create(),typeName:st.ZodFunction,...At(n)})}}class Rp extends It{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Rp.create=(t,e)=>new Rp({getter:t,typeName:st.ZodLazy,...At(e)});class Pp extends It{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return De(r,{received:r.data,code:Ae.invalid_literal,expected:this._def.value}),mt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Pp.create=(t,e)=>new Pp({value:t,typeName:st.ZodLiteral,...At(e)});function MN(t,e){return new iu({values:t,typeName:st.ZodEnum,...At(e)})}class iu extends It{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return De(r,{expected:Er.joinValues(n),received:r.parsedType,code:Ae.invalid_type}),mt}if(this._def.values.indexOf(e.data)===-1){const r=this._getOrReturnCtx(e),n=this._def.values;return De(r,{received:r.data,code:Ae.invalid_enum_value,options:n}),mt}return qi(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e){return iu.create(e)}exclude(e){return iu.create(this.options.filter(r=>!e.includes(r)))}}iu.create=MN;class kp extends It{_parse(e){const r=Er.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ke.string&&n.parsedType!==ke.number){const i=Er.objectValues(r);return De(n,{expected:Er.joinValues(i),received:n.parsedType,code:Ae.invalid_type}),mt}if(r.indexOf(e.data)===-1){const i=Er.objectValues(r);return De(n,{received:n.data,code:Ae.invalid_enum_value,options:i}),mt}return qi(e.data)}get enum(){return this._def.values}}kp.create=(t,e)=>new kp({values:t,typeName:st.ZodNativeEnum,...At(e)});class hh extends It{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==ke.promise&&r.common.async===!1)return De(r,{code:Ae.invalid_type,expected:ke.promise,received:r.parsedType}),mt;const n=r.parsedType===ke.promise?r.data:Promise.resolve(r.data);return qi(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}hh.create=(t,e)=>new hh({type:t,typeName:st.ZodPromise,...At(e)});class Go extends It{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===st.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{De(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){const o=a=>{const c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?mt:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?mt:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_p(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>_p(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Er.assertNever(i)}}Go.create=(t,e,r)=>new Go({schema:t,typeName:st.ZodEffects,effect:e,...At(r)});Go.createWithPreprocess=(t,e,r)=>new Go({schema:e,effect:{type:"preprocess",transform:t},typeName:st.ZodEffects,...At(r)});class Dc extends It{_parse(e){return this._getType(e)===ke.undefined?qi(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dc.create=(t,e)=>new Dc({innerType:t,typeName:st.ZodOptional,...At(e)});class If extends It{_parse(e){return this._getType(e)===ke.null?qi(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}If.create=(t,e)=>new If({innerType:t,typeName:st.ZodNullable,...At(e)});class Op extends It{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===ke.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Op.create=(t,e)=>new Op({innerType:t,typeName:st.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...At(e)});class sb extends It{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return tb(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ho(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ho(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}sb.create=(t,e)=>
vendor: 4,441 bytes, line 13
13new sb({innerType:t,typeName:st.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...At(e)});class ob extends It{_parse(e){if(this._getType(e)!==ke.nan){const n=this._getOrReturnCtx(e);return De(n,{code:Ae.invalid_type,expected:ke.nan,received:n.parsedType}),mt}return{status:"valid",value:e.data}}}ob.create=t=>new ob({typeName:st.ZodNaN,...At(t)});const FH=Symbol("zod_brand");class DN extends It{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class I1 extends It{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?mt:s.status==="dirty"?(r.dirty(),ON(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?mt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new I1({in:e,out:r,typeName:st.ZodPipeline})}}class ab extends It{_parse(e){const r=this._def.innerType._parse(e);return _p(r)&&(r.value=Object.freeze(r.value)),r}}ab.create=(t,e)=>new ab({innerType:t,typeName:st.ZodReadonly,...At(e)});const BN=(t,e={},r)=>t?dh.create().superRefine((n,i)=>{var s,o;if(!t(n)){const a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):dh.create(),$H={object:pn.lazycreate};var st;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(st||(st={}));const LH=(t,e={message:`Input not instance of ${t.name}`})=>BN(r=>r instanceof t,e),FN=Lo.create,$N=ru.create,UH=ob.create,HH=nu.create,LN=Cp.create,jH=Tf.create,zH=rb.create,JH=Sp.create,qH=Tp.create,GH=dh.create,VH=pf.create,WH=Jc.create,KH=nb.create,XH=jo.create,ZH=pn.create,YH=pn.strictCreate,QH=Np.create,ej=by.create,tj=Ip.create,rj=za.create,nj=xp.create,ij=ib.create,sj=Nf.create,oj=qd.create,aj=Rp.create,cj=Pp.create,lj=iu.create,uj=kp.create,fj=hh.create,DA=Go.create,dj=Dc.create,hj=If.create,pj=Go.createWithPreprocess,gj=I1.create,mj=()=>FN().optional(),bj=()=>$N().optional(),yj=()=>LN().optional(),vj={string:t=>Lo.create({...t,coerce:!0}),number:t=>ru.create({...t,coerce:!0}),boolean:t=>Cp.create({...t,coerce:!0}),bigint:t=>nu.create({...t,coerce:!0}),date:t=>Tf.create({...t,coerce:!0})},wj=mt;var j=Object.freeze({__proto__:null,defaultErrorMap:Ap,setErrorMap:CH,getErrorMap:Qm,makeIssue:eb,EMPTY_PATH:SH,addIssueToContext:De,ParseStatus:Pi,INVALID:mt,DIRTY:ON,OK:qi,isAborted:u3,isDirty:f3,isValid:_p,isAsync:tb,get util(){return Er},get objectUtil(){return l3},ZodParsedType:ke,getParsedType:kl,ZodType:It,ZodString:Lo,ZodNumber:ru,ZodBigInt:nu,ZodBoolean:Cp,ZodDate:Tf,ZodSymbol:rb,ZodUndefined:Sp,ZodNull:Tp,ZodAny:dh,ZodUnknown:pf,ZodNever:Jc,ZodVoid:nb,ZodArray:jo,ZodObject:pn,ZodUnion:Np,ZodDiscriminatedUnion:by,ZodIntersection:Ip,ZodTuple:za,ZodRecord:xp,ZodMap:ib,ZodSet:Nf,ZodFunction:qd,ZodLazy:Rp,ZodLiteral:Pp,ZodEnum:iu,ZodNativeEnum:kp,ZodPromise:hh,ZodEffects:Go,ZodTransformer:Go,ZodOptional:Dc,ZodNullable:If,ZodDefault:Op,ZodCatch:sb,ZodNaN:ob,BRAND:FH,ZodBranded:DN,ZodPipeline:I1,ZodReadonly:ab,custom:BN,Schema:It,ZodSchema:It,late:$H,get ZodFirstPartyTypeKind(){return st},coerce:vj,any:GH,array:XH,bigint:HH,boolean:LN,date:jH,discriminatedUnion:ej,effect:
13DA,enum:lj,function:oj,instanceof:LH,intersection:tj,lazy:aj,literal:cj,map:ij,nan:UH,nativeEnum:uj,never:WH,null:qH,nullable:hj,number:$N,object:ZH,oboolean:yj,onumber:bj,optional:dj,ostring:mj,pipeline:gj,preprocess:pj,promise:fj,record:nj,set:sj,strictObject:YH,string:FN,symbol:zH,transformer:DA,tuple:rj,undefined:JH,union:QH,unknown:VH,void:KH,NEVER:wj,ZodIssueCode:Ae,quotelessJson:_H,ZodError:Ho});const gn=j.object({message:j.string()});function Oe(t){return j.literal(Be[t])}const yy=j.object({serializedMessage:j.string().optional(),accountAddress:j.string(),chainId:j.string(),notBefore:j.string().optional(),domain:j.string(),uri:j.string(),version:j.string(),nonce:j.string(),statement:j.string().optional(),resources:j.array(j.string()).optional(),requestId:j.string().optional(),issuedAt:j.string().optional(),expirationTime:j.string().optional()});j.object({accessList:j.array(j.string()),blockHash:j.string().nullable(),blockNumber:j.string().nullable(),chainId:j.string().or(j.number()),from:j.string(),gas:j.string(),hash:j.string(),input:j.string().nullable(),maxFeePerGas:j.string(),maxPriorityFeePerGas:j.string(),nonce:j.string(),r:j.string(),s:j.string(),to:j.string(),transactionIndex:j.string().nullable(),type:j.string(),v:j.string(),value:j.string()});const Ej=j.object({chainId:j.string().or(j.number()),rpcUrl:j.optional(j.string())}),Aj=j.object({email:j.string().email()}),_j=j.object({otp:j.string()}),Cj=j.object({uri:j.string(),preferredAccountType:j.optional(j.string()),chainId:j.optional(j.string().or(j.number())),siwxMessage:j.optional(yy),rpcUrl:j.optional(j.string())}),Sj=j.object({chainId:j.optional(j.string().or(j.number())),preferredAccountType:j.optional(j.string()),socialUri:j.optional(j.string()),siwxMessage:j.optional(yy),rpcUrl:j.optional(j.string())}),Tj=j.object({provider:j.enum(["google","github","apple","facebook","x","discord"])}),Nj=j.object({email:j.string().email()}),Ij=j.object({otp:j.string()}),xj=j.object({otp:j.string()}),Rj=j.object({themeMode:j.optional(j.enum(["light","dark"])),themeVariables:j.optional(j.record(j.string(),j.string().or(j.number()))),w3mThemeVariables:j.optional(j.record(j.string(),j.string()))}),Pj=j.object({metadata:j.object({name:j.string(),description:j.string(),url:j.string(),icons:j.array(j.string())}).optional(),sdkVersion:j.string().optional(),sdkType:j.string().optional(),projectId:j.string()}),kj=j.object({type:j.string()}),Oj=j.object({action:j.enum(["VERIFY_DEVICE","VERIFY_OTP","CONNECT"])}),Mj=j.object({url:j.string()}),Dj=j.object({userName:j.string()}),Bj=j.object({email:j.string().optional().nullable(),address:j.string(),chainId:j.string().or(j.number()),accounts:j.array(j.object({address:j.string(),type:j.enum([Tn.ACCOUNT_TYPES.EOA,Tn.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),userName:j.string().optional().nullable(),preferredAccountType:j.optional(j.string()),signature:j.string().optional(),message:j.string().optional(),siwxMessage:j.optional(yy)}),Fj=j.object({action:j.enum(["VERIFY_PRIMARY_OTP","VERIFY_SECONDARY_OTP"])}),$j=j.object({email:j.string().email().optional().nullable(),address:j.string(),chainId:j.string().or(j.number()),smartAccountDeployed:j.optional(j.boolean()),accounts:j.array(j.object({address:j.string(),type:j.enum([Tn.ACCOUNT_TYPES.EOA,Tn.ACCOUNT_TYPES.SMART_ACCOUNT])})).optional(),preferredAccountType:j.optional(j.string()),signature:j.string().optional(),message:j.string().optional(),siwxMessage:j.optional(yy)}),Lj=j.object({uri:j.string()}),Uj=j.object({isConnected:j.boolean()}),Hj=j.object({chainId:j.string().or(j.number())}),jj=j.object({chainId:j.string().or(j.number())}),zj=j.object({newEmail:j.string().email()}),Jj=j.object({smartAccountEnabledNetworks:j.array(j.number())});j.object({address:j.string(),isDeployed:j.boolean()});const qj=j.object({version:j.string().optional()}),Gj=j.object({type:j.string(),address:j.string()}),Vj=j.any(),Wj=j.object({method:j.literal("eth_accounts")}),Kj=j.object({method:j.literal("eth_blockNumber")}),Xj=j.object({method:j.literal("eth_call"),params:j.array(j.any())}),Zj=j.object({method:j.literal("eth_chainId")}),Yj=j.object({method:j.literal("eth_estimateGas"),params:j.array(j.any())}),Qj=j.object({method:j.literal("eth_feeHistory"),params:j.array(j.any())}),ez=j.object({method:j.literal("eth_gasPrice")}),tz=j.object({method:j.literal("eth_getAccount"),params:j.array(j.any())}),rz=j.object({method:j.literal("eth_getBalance"),params:j.array(j.any())}),nz=j.object({method:j.literal("eth_getBlockByHash"),params:j.array(j.any())}),iz=j.object({method:j.literal("eth_getBlockByNumber"),params:j.array(j.any())}),sz=j.object({method:j.literal("eth_getBlockReceipts"),params:j.array(j.any())}),oz=j.object({method:j.literal("eth_getBlockTransactionCountByHash"),params:j.array(j.any())}),az=j.object({method:j.literal("eth_getBlockTransactionCountByNumber"),params:j.array(j.any())}),cz=j.object({method:j.literal("eth_getCode"),params:j.array(j.any())}),lz=j.object({method:j.literal("eth_getFilterChanges"),params:j.array(j.any())}),uz=j.object({method:j.literal("eth_getFilterLogs"),params:j.array(j.any())}),fz=j.object({method:j.literal("eth_getLogs"),params:j.array(j.any())}),dz=j.object({method:j.literal("eth_getProof"),params:j.array(j.any())}),hz=j.object({method:j.literal("eth_getStorageAt"),params:j.array(j.any())}),pz=j.object({method:j.literal("eth_getTransactionByBlockHashAndIndex"),params:j.array(j.any())}),gz=j.object({method:j.literal("eth_getTransactionByBlockNumberAndIndex"),params:j.array(j.any())}),mz=j.object({method:j.literal("eth_getTransactionByHash"),params:j.array(j.any())}),bz=j.object({method:j.literal("eth_getTransactionCount"),params:j.array(j.any())}),yz=j.object({method:j.literal("eth_getTransactionReceipt"),params:j.array(j.any())}),vz=j.object({method:j.literal("eth_getUncleCountByBlockHash"),params:j.array(j.any())}),wz=j.object({method:j.literal("eth_getUncleCountByBlockNumber"),params:j.array(j.any())}),Ez=j.object({method:j.literal("eth_maxPriorityFeePerGas")}),Az=j.object({method:j.literal("eth_newBlockFilter")}),_z=j.object({method:j.literal("eth_newFilter"),params:j.array(j.any())}),Cz=j.object({method:j.literal("eth_newPendingTransactionFilter")}),Sz=j.object({method:j.literal("eth_sendRawTransaction"),params:j.array(j.any())}),Tz=j.object({method:j.literal("eth_syncing"),params:j.array(j.any())}),Nz=j.object({method:j.literal("eth_uninstallFilter"),params:j.array(j.any())}),BA=j.object({method:j.literal("personal_sign"),params:j.array(j.any())}),Iz=j.object({method:j.literal("eth_signTypedData_v4"),params:j.array(j.any())}),xz=j.object({method:j.literal("eth_sendTransaction"),params:j.array(j.any())}),Rz=j.object({method:j.literal("solana_signMessage"),params:j.object({message:j.string(),pubkey:j.string()})}),Pz=j.object({method:j.literal("solana_signTransaction"),params:j.object({transaction:j.string()})}),kz=j.object({method:j.literal("solana_signAllTransactions"),params:j.object({transactions:j.array(j.string())})}),Oz=j.object({method:j.literal("solana_signAndSendTransaction"),params:j.object({transaction:j.string(),options:j.object({skipPreflight:j.boolean().optional(),preflightCommitment:j.enum(["processed","confirmed","finalized","recent","single","singleGossip","root","max"]).optional(),maxRetries:j.number().optional(),minContextSlot:j.number().optional()}).optional()})}),Mz=j.object({method:j.literal("wallet_sendCalls"),params:j.array(j.object({chainId:j.string().or(j.number()).optional(),from:j.string().optional(),version:j.string().optional(),capabilities:j.any().optional(),calls:j.array(j.object({to:j.string().startsWith("0x"),data:j.string().startsWith("0x").optional(),value:j.string().optional()}))}))}),Dz=j.object({method:j.literal("wallet_getCallsStatus"),params:j.array(j.string())}),Bz=j.object({method:j.literal("wallet_getCapabilities"),params:j.array(j.string().or(j.number()).optional()).optional()}),Fz=j.object({method:j.literal("wallet_grantPermissions"),params:j.array(j.any())}),$z=j.object({method:j.literal("wallet_revokePermissions"),params:j.any()}),Lz=j.object({method:j.literal("wallet_getAssets"),params:j.any()}),FA=j.object({token:j.string()}),Me=j.object({id:j.string().optional()}),V2={appEvent:Me.extend({type:Oe("APP_SWITCH_NETWORK"),payload:Ej}).or(Me.extend({type:Oe("APP_CONNECT_EMAIL"),payload:Aj})).or(Me.extend({type:Oe("APP_CONNECT_DEVICE")})).or(Me.extend({type:Oe("APP_CONNECT_OTP"),payload:_j}
13)).or(Me.extend({type:Oe("APP_CONNECT_SOCIAL"),payload:Cj})).or(Me.extend({type:Oe("APP_GET_FARCASTER_URI")})).or(Me.extend({type:Oe("APP_CONNECT_FARCASTER")})).or(Me.extend({type:Oe("APP_GET_USER"),payload:j.optional(Sj)})).or(Me.extend({type:Oe("APP_GET_SOCIAL_REDIRECT_URI"),payload:Tj})).or(Me.extend({type:Oe("APP_SIGN_OUT")})).or(Me.extend({type:Oe("APP_IS_CONNECTED"),payload:j.optional(FA)})).or(Me.extend({type:Oe("APP_GET_CHAIN_ID")})).or(Me.extend({type:Oe("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or(Me.extend({type:Oe("APP_INIT_SMART_ACCOUNT")})).or(Me.extend({type:Oe("APP_SET_PREFERRED_ACCOUNT"),payload:kj})).or(Me.extend({type:Oe("APP_RPC_REQUEST"),payload:BA.or(Lz).or(Wj).or(Kj).or(Xj).or(Zj).or(Yj).or(Qj).or(ez).or(tz).or(rz).or(nz).or(iz).or(sz).or(oz).or(az).or(cz).or(lz).or(uz).or(fz).or(dz).or(hz).or(pz).or(gz).or(mz).or(bz).or(yz).or(vz).or(wz).or(Ez).or(Az).or(_z).or(Cz).or(Sz).or(Tz).or(Nz).or(BA).or(Iz).or(xz).or(Rz).or(Pz).or(kz).or(Oz).or(Dz).or(Mz).or(Bz).or(Fz).or($z).and(j.object({chainId:j.string().or(j.number()).optional(),chainNamespace:j.enum(["eip155","solana","polkadot","bip122","cosmos"]).optional(),rpcUrl:j.string().optional()}))})).or(Me.extend({type:Oe("APP_UPDATE_EMAIL"),payload:Nj})).or(Me.extend({type:Oe("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:Ij})).or(Me.extend({type:Oe("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:xj})).or(Me.extend({type:Oe("APP_SYNC_THEME"),payload:Rj})).or(Me.extend({type:Oe("APP_SYNC_DAPP_DATA"),payload:Pj})).or(Me.extend({type:Oe("APP_RELOAD")})).or(Me.extend({type:Oe("APP_RPC_ABORT")})),frameEvent:Me.extend({type:Oe("FRAME_SWITCH_NETWORK_ERROR"),payload:gn}).or(Me.extend({type:Oe("FRAME_SWITCH_NETWORK_SUCCESS"),payload:jj})).or(Me.extend({type:Oe("FRAME_CONNECT_EMAIL_SUCCESS"),payload:Oj})).or(Me.extend({type:Oe("FRAME_CONNECT_EMAIL_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_GET_FARCASTER_URI_SUCCESS"),payload:Mj})).or(Me.extend({type:Oe("FRAME_GET_FARCASTER_URI_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_CONNECT_FARCASTER_SUCCESS"),payload:Dj})).or(Me.extend({type:Oe("FRAME_CONNECT_FARCASTER_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_CONNECT_OTP_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_CONNECT_OTP_SUCCESS")})).or(Me.extend({type:Oe("FRAME_CONNECT_DEVICE_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_CONNECT_DEVICE_SUCCESS")})).or(Me.extend({type:Oe("FRAME_CONNECT_SOCIAL_SUCCESS"),payload:Bj})).or(Me.extend({type:Oe("FRAME_CONNECT_SOCIAL_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_GET_USER_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_GET_USER_SUCCESS"),payload:$j})).or(Me.extend({type:Oe("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),payload:Lj})).or(Me.extend({type:Oe("FRAME_SIGN_OUT_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_SIGN_OUT_SUCCESS")})).or(Me.extend({type:Oe("FRAME_IS_CONNECTED_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_IS_CONNECTED_SUCCESS"),payload:Uj})).or(Me.extend({type:Oe("FRAME_GET_CHAIN_ID_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_GET_CHAIN_ID_SUCCESS"),payload:Hj})).or(Me.extend({type:Oe("FRAME_RPC_REQUEST_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_RPC_REQUEST_SUCCESS"),payload:Vj})).or(Me.extend({type:Oe("FRAME_SESSION_UPDATE"),payload:FA})).or(Me.extend({type:Oe("FRAME_UPDATE_EMAIL_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_UPDATE_EMAIL_SUCCESS"),payload:Fj})).or(Me.extend({type:Oe("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or(Me.extend({type:Oe("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:zj})).or(Me.extend({type:Oe("FRAME_SYNC_THEME_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_SYNC_THEME_SUCCESS")})).or(Me.extend({type:Oe("FRAME_SYNC_DAPP_DATA_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or(Me.extend({type:Oe("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:Jj})).or(Me.extend({type:Oe("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:Gj})).or(Me.extend({type:Oe("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_READY"),payload:qj})).or(Me.extend({type:Oe("FRAME_RELOAD_ERROR"),payload:gn})).or(Me.extend({type:Oe("FRAME_RELOAD_SUCCESS")}))};function W2(t,e={}){var r;return typeof(e==null?void 0:e.type)=="string"&&((r=e==null?void 0:e.type)==null?void 0:r.includes(t))}function Uz({projectId:t,chainId:e,enableLogger:r,rpcUrl:n=K.BLOCKCHAIN_API_RPC_URL,enableCloudAuthAccount:i=!1}){const s=new URL(wH);s.searchParams.set("projectId",t),s.searchParams.set("chainId",String(e)),s.searchParams.set("version",AH),s.searchParams.set("enableLogger",String(r)),s.searchParams.set("rpcUrl",n);const o=Ln.get("dapp_smart_account_version");return o&&(o==="v6"||o==="v7")&&(console.warn(">>
13 AppKit - Forcing smart account version",o),s.searchParams.set("smartAccountVersion",o)),i&&s.searchParams.set("enableCloudAuthAccount","true"),s.toString()}class Hz{constructor({projectId:e,isAppClient:r=!1,chainId:n="eip155:1",enableLogger:i=!0,enableCloudAuthAccount:s=!1,rpcUrl:o=K.BLOCKCHAIN_API_RPC_URL}){if(this.iframe=null,this.iframeIsReady=!1,this.initFrame=()=>{const a=document.getElementById("w3m-iframe");this.iframe&&!a&&document.body.appendChild(this.iframe)},this.events={registerFrameEventHandler:(a,c,l)=>{function u({data:f}){var h;if(!W2(Be.FRAME_EVENT_KEY,f))return;const d=V2.frameEvent.safeParse(f);if(!d.success){console.warn("W3mFrame: invalid frame event",d.error.message);return}((h=d.data)==null?void 0:h.id)===a&&(c(d.data),window.removeEventListener("message",u))}Ms.isClient&&(window.addEventListener("message",u),l.addEventListener("abort",()=>{window.removeEventListener("message",u)}))},onFrameEvent:a=>{Ms.isClient&&window.addEventListener("message",({data:c})=>{if(!W2(Be.FRAME_EVENT_KEY,c))return;const l=V2.frameEvent.safeParse(c);l.success?a(l.data):console.warn("W3mFrame: invalid frame event",l.error.message)})},onAppEvent:a=>{Ms.isClient&&window.addEventListener("message",({data:c})=>{if(!W2(Be.APP_EVENT_KEY,c))return;const l=V2.appEvent.safeParse(c);l.success||console.warn("W3mFrame: invalid app event",l.error.message),a(c)})},postAppEvent:a=>{var c;if(Ms.isClient){if(!((c=this.iframe)!=null&&c.contentWindow))throw new Error("W3mFrame: iframe is not set");this.iframe.contentWindow.postMessage(a,"*")}},postFrameEvent:a=>{if(Ms.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");parent.postMessage(a,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((a,c)=>{this.frameLoadPromiseResolver={resolve:a,reject:c}}),this.rpcUrl=o,r&&(this.frameLoadPromise=new Promise((a,c)=>{this.frameLoadPromiseResolver={resolve:a,reject:c}}),Ms.isClient)){const a=document.createElement("iframe");a.id="w3m-iframe",a.src=Uz({projectId:e,chainId:n,enableLogger:i,rpcUrl:this.rpcUrl,enableCloudAuthAccount:s}),a.name="w3m-secure-iframe",a.style.position="fixed",a.style.zIndex="999999",a.style.display="none",a.style.border="none",a.style.animationDelay="0s, 50ms",a.style.borderBottomLeftRadius="clamp(0px, var(--apkt-borderRadius-8), 44px)",a.style.borderBottomRightRadius="clamp(0px, var(--apkt-borderRadius-8), 44px)",this.iframe=a,this.iframe.onerror=()=>{var c;(c=this.frameLoadPromiseResolver)==null||c.reject("Unable to load email login dependency")},this.events.onFrameEvent(c=>{var l;c.type==="@w3m-frame/READY"&&(this.iframeIsReady=!0,(l=this.frameLoadPromiseResolver)==null||l.resolve(void 0))})}}get networks(){const e=["eip155:1","eip155:5","eip155:11155111","eip155:10","eip155:420","eip155:42161","eip155:421613","eip155:137","eip155:80001","eip155:42220","eip155:1313161554","eip155:1313161555","eip155:56","eip155:97","eip155:43114","eip155:43113","eip155:324","eip155:280","eip155:100","eip155:8453","eip155:84531","eip155:84532","eip155:7777777","eip155:999","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(r=>({[r]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=${r}&projectId=${this.projectId}`,chainId:r}}));return Object.assign({},...e)}}var va={exports:{}};function jz(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var zz=Jz;function Jz(t,e,r){var n=r&&r.stringify||jz,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a<s;a++)o[a]=n(e[a]);return o.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var l="",u=1-i,f=-1,d=t&&t.length||0,h=0;h<d;){if(t.charCodeAt(h)===37&&h+1<d){switch(f=f>-1?f:0,t.charCodeAt(h+1)){case 100:case 102:if(u>=c||e[u]==null)break;f<h&&(l+=t.slice(f,h)),l+=Number(e[u]),f=h+2,h++;break;case 105:if(u>=c||e[u]==null)break;f<h&&(l+=t.slice(f,h)),l+=Math.floor(Number(e[u])),f=h+2,h++;break;case 79:case 111:case 106:if(u>=c||e[u]===void 0)break;f<h&&(l+=t.slice(f,h));var g=typeof e[u];if(g==="string"){l+="'"+e[u]+"'",f=h+2,h++;break}if(g==="function"){l+=e[u].name||"<anonymous>",f=h+2,h++;break}l+=n(e[u]),f=h+2,h++;break;case 115:if(u>=c)break;f<h&&(l+=t.slice(f,h)),l+=String(e[u]),f=h+2,h++;break;case 37:f<h&&(l+=t.slice(f,h)),l+="%",f=h+2,h++,u--;break}++u}++h}
vendor: 12,654 bytes, line 13
13return f===-1?t:(f<d&&(l+=t.slice(f)),l)}const $A=zz;va.exports=Bc;const Mp=sJ().console||{},qz={mapHttpRequest:yg,mapHttpResponse:yg,wrapRequestSerializer:K2,wrapResponseSerializer:K2,wrapErrorSerializer:K2,req:yg,res:yg,err:UA,errWithCause:UA};function $l(t,e){return t==="silent"?1/0:e.levels.values[t]}const y5=Symbol("pino.logFuncs"),h3=Symbol("pino.hierarchy"),Gz={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function LA(t,e){const r={logger:e,parent:t[h3]};e[h3]=r}function Vz(t,e,r){const n={};e.forEach(i=>{n[i]=r[i]?r[i]:Mp[i]||Mp[Gz[i]||"log"]||Gd}),t[y5]=n}function Wz(t,e){return Array.isArray(t)?t.filter(function(r){return r!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function Bc(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||Mp;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=Wz(t.browser.serialize,n);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const o=Object.keys(t.customLevels||{}),a=["error","fatal","warn","info","debug","trace"].concat(o);typeof r=="function"&&a.forEach(function(b){r[b]=r}),(t.enabled===!1||t.browser.disabled)&&(t.level="silent");const c=t.level||"info",l=Object.create(r);l.log||(l.log=Gd),Vz(l,a,r),LA({},l),Object.defineProperty(l,"levelVal",{get:f}),Object.defineProperty(l,"level",{get:d,set:h});const u={transmit:e,serialize:i,asObject:t.browser.asObject,asObjectBindingsOnly:t.browser.asObjectBindingsOnly,formatters:t.browser.formatters,levels:a,timestamp:rJ(t),messageKey:t.messageKey||"msg",onChild:t.onChild||Gd};l.levels=Kz(t),l.level=c,l.isLevelEnabled=function(b){return this.levels.values[b]?this.levels.values[b]>=this.levels.values[this.level]:!1},l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=Gd,l.serializers=n,l._serialize=i,l._stdErrSerialize=s,l.child=function(...b){return g.call(this,u,...b)},e&&(l._logEvent=p3());function f(){return $l(this.level,this)}function d(){return this._level}function h(b){if(b!=="silent"&&!this.levels.values[b])throw Error("unknown level "+b);this._level=b,Mu(this,u,l,"error"),Mu(this,u,l,"fatal"),Mu(this,u,l,"warn"),Mu(this,u,l,"info"),Mu(this,u,l,"debug"),Mu(this,u,l,"trace"),o.forEach(w=>{Mu(this,u,l,w)})}function g(b,w,x){if(!w)throw new Error("missing bindings for child Pino");x=x||{},i&&w.serializers&&(x.serializers=w.serializers);const k=x.serializers;if(i&&k){var R=Object.assign({},n,k),D=t.browser.serialize===!0?Object.keys(R):i;delete w.serializers,v5([w],D,R,this._stdErrSerialize)}function O(F){this._childLevel=(F._childLevel|0)+1,this.bindings=w,R&&(this.serializers=R,this._serialize=D),e&&(this._logEvent=p3([].concat(F._logEvent.bindings,w)))}O.prototype=this;const M=new O(this);return LA(this,M),M.child=function(...F){return g.call(this,b,...F)},M.level=x.level||this.level,b.onChild(M),M}return l}function Kz(t){const e=t.customLevels||{},r=Object.assign({},Bc.levels.values,e),n=Object.assign({},Bc.levels.labels,Xz(e));return{values:r,labels:n}}function Xz(t){const e={};return Object.keys(t).forEach(function(r){e[t[r]]=r}),e}Bc.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},Bc.stdSerializers=qz,Bc.stdTimeFunctions=Object.assign({},{nullTime:UN,epochTime:HN,unixTime:nJ,isoTime:iJ});function Zz(t){const e=[];t.bindings&&e.push(t.bindings);let r=t[h3];for(;r.parent;)r=r.parent,r.logger.bindings&&e.push(r.logger.bindings);return e.reverse()}function Mu(t,e,r,n){if(Object.defineProperty(t,n,{value:$l(t.level,r)>$l(n,r)?Gd:r[y5][n],writable:!0,enumerable:!0,configurable:!0}),t[n]===Gd){if(!e.transmit)return;const s=e.transmit.level||t.level,o=$l(s,r);if($l(n,r)<o)return}t[n]=Qz(t,e,r,n);const i=Zz(t);i.length!==0&&(t[n]=Yz(i,t[n]))}function Yz(t,e){return function(){return e.apply(this,[...t,...arguments])}}function Qz(t,e,r,n){return function(i){return function(){const s=e.timestamp(),o=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Mp?Mp:this;for(var c=0;c<o.length;c++)o[c]=arguments[c];var l=!1;if(e.serialize&&(v5(o,this._serialize,this.serializers,this._stdErrSerialize),l=!0),e.asObject||e.formatters?i.call(a,...eJ(this,n,o,s,e)):i.apply(a,o),e.transmit){const u=e.transmit.level||t._level,f=$l(u,r),d=$l(n,r);if(d<f)return;tJ(this,{ts:s,methodLevel:n,methodValue:d,transmitLevel:u,transmitValue:r.levels.values[e.transmit.level||t._level],send:e.transmit.send,val:$l(t._level,r)},o,l)}}}(t[y5][n])}function eJ(t,e,r,n,i){const{level:s,log:o=f=>f}=i.formatters||{},a=r.slice();let c=a[0];const l={};let u=(t._childLevel|0)+1;if(u<1&&(u=1),n&&(l.time=n),s){const f=s(e,t.levels.values[e]);Object.assign(l,f)}else l.level=t.levels.values[e];if(i.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;u--&&typeof a[0]=="object";)Object.assign(l,a.shift());return[o(l),...a]}else{if(c!==null&&typeof c=="object"){for(;u--&&typeof a[0]=="object";)Object.assign(l,a.shift());c=a.length?$A(a.shift(),a):void 0}else typeof c=="string"&&(c=$A(a.shift(),a));return c!==void 0&&(l[i.messageKey]=c),[o(l)]}}function v5(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=Bc.stdSerializers.err(t[i]);else if(typeof t[i]=="object"&&!Array.isArray(t[i])&&e)for(const s in t[i])e.indexOf(s)>-1&&s in r&&(t[i][s]=r[s](t[i][s]))}function tJ(t,e,r,n=!1){const i=e.send,s=e.ts,o=e.methodLevel,a=e.methodValue,c=e.val,l=t._logEvent.bindings;n||v5(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=s,t._logEvent.messages=r.filter(function(u){return l.indexOf(u)===-1}),t._logEvent.level.label=o,t._logEvent.level.value=a,i(o,t._logEvent,c),t._logEvent=p3(l)}function p3(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function UA(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function rJ(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?UN:HN}function yg(){return{}}function K2(t){return t}function Gd(){}function UN(){return!1}function HN(){return Date.now()}function nJ(){return Math.round(Date.now()/1e3)}function iJ(){return new Date(Date.now()).toISOString()}function sJ(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}va.exports.default=Bc;va.exports.pino=Bc;const oJ={level:"info"},vy="custom_context",w5=1e3*1024;var aJ=Object.defineProperty,cJ=(t,e,r)=>e in t?aJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ol=(t,e,r)=>cJ(t,typeof e!="symbol"?e+"":e,r);let lJ=class{constructor(e){Ol(this,"nodeValue"),Ol(this,"sizeInBytes"),Ol(this,"next"),this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},HA=class{constructor(e){Ol(this,"lengthInNodes"),Ol(this,"sizeInBytes"),Ol(this,"head"),Ol(this,"tail"),Ol(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new lJ(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}};const uJ=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r);function jA(t){return typeof t=="string"?t:uJ(t)||""}var fJ=Object.defineProperty,dJ=(t,e,r)=>e in t?fJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vg=(t,e,r)=>dJ(t,typeof e!="symbol"?e+"":e,r);let jN=class{constructor(e,r=w5){vg(this,"logs"),vg(this,"level"),vg(this,"levelValue"),vg(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=va.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new HA(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===va.exports.levels.values.error?console.error(e):r===va.exports.levels.values.warn?console.warn(e):r===va.exports.levels.values.debug?console.debug(e):r===va.exports.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(jA({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new HA(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(jA({extraMetadata:e})),new Blob(r,{type:"application/json"})}};var hJ=Object.defineProperty,pJ=(t,e,r)=>e in t?hJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gJ=(t,e,r)=>pJ(t,typeof e!="symbol"?e+"":e,r);let mJ=class{constructor(e,r=w5){gJ(this,"baseChunkLogger"),this.baseChunkLogger=new jN(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}};var bJ=Object.defineProperty,yJ=(t,e,r)=>e in t?bJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,vJ=(t,e,r)=>yJ(t,typeof e!="symbol"?e+"":e,r);let wJ=class{constructor(e,r=w5){vJ(this,"baseChunkLogger"),this.baseChunkLogger=new jN(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var EJ=Object.defineProperty,AJ=Object.defineProperties,_J=Object.getOwnPropertyDescriptors,zA=Object.getOwnPropertySymbols,CJ=Object.prototype.hasOwnProperty,SJ=Object.prototype.propertyIsEnumerable,JA=(t,e,r)=>e in t?EJ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jl=(t,e)=>{for(var r in e||(e={}))CJ.call(e,r)&&JA(t,r,e[r]);if(zA)for(var r of zA(e))SJ.call(e,r)&&JA(t,r,e[r]);return t},ql=(t,e)=>AJ(t,_J(e));function E5(t){return ql(Jl({},t),{level:(t==null?void 0:t.level)||oJ.level})}function TJ(t,e,r=vy){return t[r]=e,t}function ys(t,e=vy){return t[e]||""}function NJ(t,e,r=vy){const n=ys(t,r);return n.trim()?`${n}/${e}`:e}function vs(t,e,r=vy){const n=NJ(t,e,r),i=t.child({context:n});return TJ(i,n,r)}function IJ(t){var e,r;const n=new mJ((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:va.exports(ql(Jl({},t.opts),{level:"trace",browser:ql(Jl({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function xJ(t){var e,r;const n=new wJ((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:va.exports(ql(Jl({},t.opts),{level:"trace",browser:ql(Jl({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})}),n),chunkLoggerController:n}}function wy(t){var e;if(typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string")return{logger:t.loggerOverride,chunkLoggerController:null};const r=ql(Jl({},t.opts),{level:typeof t.loggerOverride=="string"?t.loggerOverride:(e=t.opts)==null?void 0:e.level});return typeof window<"u"?IJ(ql(Jl({},t),{opts:r})):xJ(ql(Jl({},t),{opts:r}))}class RJ{constructor(e){var s;const r=E5({level:EH}),{logger:n,chunkLoggerController:i}=wy({opts:r});this.logger=vs(n,this.constructor.name),this.chunkLoggerController=i,t
13ypeof window<"u"&&((s=this.chunkLoggerController)!=null&&s.downloadLogsBlobInBrowser)&&(window.downloadAppKitLogsBlob||(window.downloadAppKitLogsBlob={}),window.downloadAppKitLogsBlob.sdk=()=>{var o;(o=this.chunkLoggerController)!=null&&o.downloadLogsBlobInBrowser&&this.chunkLoggerController.downloadLogsBlobInBrowser({projectId:e})})}}class PJ{constructor({projectId:e,chainId:r,enableLogger:n=!0,onTimeout:i,abortController:s,getActiveCaipNetwork:o,getCaipNetworks:a,enableCloudAuthAccount:c,metadata:l,sdkVersion:u,sdkType:f}){this.openRpcRequests=new Map,this.isInitialized=!1,n&&(this.w3mLogger=new RJ(e)),this.abortController=s,this.getActiveCaipNetwork=o,this.getCaipNetworks=a;const d=this.getRpcUrl(r);this.projectId=e,this.sdkVersion=u,this.sdkType=f,this.metadata=l,this.w3mFrame=new Hz({projectId:e,isAppClient:!0,chainId:r,enableLogger:n,rpcUrl:d,enableCloudAuthAccount:c}),this.onTimeout=i,this.getLoginEmailUsed()&&this.createFrame()}async createFrame(){this.w3mFrame.initFrame(),this.initPromise=new Promise(e=>{this.w3mFrame.events.onFrameEvent(r=>{r.type===Be.FRAME_READY&&setTimeout(()=>{e()},500)})}),await this.initPromise,await this.syncDappData({metadata:this.metadata,projectId:this.projectId,sdkVersion:this.sdkVersion,sdkType:this.sdkType}
13),await this.getSmartAccountEnabledNetworks(),this.isInitialized=!0,this.initPromise=void 0}async init(){if(!this.isInitialized){if(this.initPromise){await this.initPromise;return}await this.createFrame()}}getLoginEmailUsed(){return!!Ln.get(Be.EMAIL_LOGIN_USED_KEY)}getEmail(){return Ln.get(Be.EMAIL)}getUsername(){return Ln.get(Be.SOCIAL_USERNAME)}async reload(){var e;try{await this.appEvent({type:Be.APP_RELOAD})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error reloading iframe"),r}}async connectEmail(e){var r;try{Ms.checkIfAllowedToTriggerEmail(),await this.init();const n=await this.appEvent({type:Be.APP_CONNECT_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting email"),n}}async connectDevice(){var e;try{return this.appEvent({type:Be.APP_CONNECT_DEVICE})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error connecting device"),r}}async connectOtp(e){var r;try{return this.appEvent({type:Be.APP_CONNECT_OTP,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting otp"),n}}async isConnected(){var e;try{if(!this.getLoginEmailUsed())return{isConnected:!1};const r=await this.appEvent({type:Be.APP_IS_CONNECTED});return r!=null&&r.isConnected||this.deleteAuthLoginCache(),r}catch(r){throw this.deleteAuthLoginCache(),(e=this.w3mLogger)==null||e.logger.error({error:r},"Error checking connection"),r}}async getChainId(){var e;try{const r=await this.appEvent({type:Be.APP_GET_CHAIN_ID});return this.setLastUsedChainId(r.chainId),r}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error getting chain id"),r}}async getSocialRedirectUri(e){var r;try{return await this.init(),this.appEvent({type:Be.APP_GET_SOCIAL_REDIRECT_URI,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error getting social redirect uri"),n}}async updateEmail(e){var r;try{const n=await this.appEvent({type:Be.APP_UPDATE_EMAIL,payload:e});return this.setNewLastEmailLoginTime(),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error updating email"),n}}async updateEmailPrimaryOtp(e){var r;try{return this.appEvent({type:Be.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error updating email primary otp"),n}}async updateEmailSecondaryOtp(e){var r;try{const n=await this.appEvent({type:Be.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e});return this.setLoginSuccess(n.newEmail),n}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error updating email secondary otp"),n}}async syncTheme(e){var r;try{return this.appEvent({type:Be.APP_SYNC_THEME,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error syncing theme"),n}}async syncDappData(e){var r;try{return this.appEvent({type:Be.APP_SYNC_DAPP_DATA,payload:e})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error syncing dapp data"),n}}async getSmartAccountEnabledNetworks(){var e;try{const r=await this.appEvent({type:Be.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS});return this.persistSmartAccountEnabledNetworks(r.smartAccountEnabledNetworks),r}catch(r){throw this.persistSmartAccountEnabledNetworks([]),(e=this.w3mLogger)==null||e.logger.error({error:r},"Error getting smart account enabled networks"),r}}async setPreferredAccount(e){var r;try{return this.appEvent({type:Be.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}})}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error setting preferred account"),n}}async connect(e){var r,n;if(e!=null&&e.socialUri)try{await this.init();const i=this.getRpcUrl(e.chainId),s=await this.appEvent({type:Be.APP_CONNECT_SOCIAL,payload:{uri:e.socialUri,preferredAccountType:e.preferredAccountType,chainId:e.chainId,siwxMessage:e.siwxMessage,rpcUrl:i}});return s.userName&&this.setSocialLoginSuccess(s.userName),this.setLoginSuccess(s.email),this.setLastUsedChainId(s.chainId),this.user=s,s}catch(i){throw(r=this.w3mLogger)==null||r.logger.error({error:i},"Error connecting social"),i}
13else try{const i=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,s=await this.getUser({chainId:i,preferredAccountType:e==null?void 0:e.preferredAccountType,siwxMessage:e==null?void 0:e.siwxMessage,rpcUrl:this.getRpcUrl(i)});return this.setLoginSuccess(s.email),this.setLastUsedChainId(s.chainId),this.user=s,s}catch(i){throw(n=this.w3mLogger)==null||n.logger.error({error:i},"Error connecting"),i}}async getUser(e){var r;try{await this.init();const n=(e==null?void 0:e.chainId)||this.getLastUsedChainId()||1,i=await this.appEvent({type:Be.APP_GET_USER,payload:{...e,chainId:n,rpcUrl:this.getRpcUrl(n)}});return this.user=i,i}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error connecting"),n}}async connectSocial({uri:e,chainId:r,preferredAccountType:n}){var i;try{await this.init();const s=this.getRpcUrl(r),o=await this.appEvent({type:Be.APP_CONNECT_SOCIAL,payload:{uri:e,chainId:r,rpcUrl:s,preferredAccountType:n}});return o.userName&&this.setSocialLoginSuccess(o.userName),o}catch(s){throw(i=this.w3mLogger)==null||i.logger.error({error:s},"Error connecting social"),s}}async getFarcasterUri(){var e;try{return await this.init(),await this.appEvent({type:Be.APP_GET_FARCASTER_URI})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error getting farcaster uri"),r}}async connectFarcaster(){var e;try{const r=await this.appEvent({type:Be.APP_CONNECT_FARCASTER});return r.userName&&this.setSocialLoginSuccess(r.userName),r}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error connecting farcaster"),r}}async switchNetwork({chainId:e}){var r;try{const n=this.getRpcUrl(e),i=await this.appEvent({type:Be.APP_SWITCH_NETWORK,payload:{chainId:e,rpcUrl:n}});return this.setLastUsedChainId(i.chainId),i}catch(n){throw(r=this.w3mLogger)==null||r.logger.error({error:n},"Error switching network"),n}}async disconnect(){var e;try{return this.deleteAuthLoginCache(),await new Promise(async n=>{const i=setTimeout(()=>{n()},3e3);await this.appEvent({type:Be.APP_SIGN_OUT}),clearTimeout(i),n()})}catch(r){throw(e=this.w3mLogger)==null||e.logger.error({error:r},"Error disconnecting"),r}}async request(e){var n,i,s,o,a;const r=e;try{if(Tn.GET_CHAIN_ID===e.method)return this.getLastUsedChainId();const c=e.chainNamespace||"eip155",l=(n=this.getActiveCaipNetwork(c))==null?void 0:n.id;r.chainNamespace=c,r.chainId=l,r.rpcUrl=this.getRpcUrl(l),(i=this.rpcRequestHandler)==null||i.call(this,e);const u=await this.appEvent({type:Be.APP_RPC_REQUEST,payload:r});return(s=this.rpcSuccessHandler)==null||s.call(this,u,r),u}catch(c){throw(o=this.rpcErrorHandler)==null||o.call(this,c,r),(a=this.w3mLogger)==null||a.logger.error({error:c},"Error requesting"),c}}onRpcRequest(e){this.rpcRequestHandler=e}onRpcSuccess(e){this.rpcSuccessHandler=e}onRpcError(e){this.rpcErrorHandler=e}onIsConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Be.FRAME_IS_CONNECTED_SUCCESS&&r.payload.isConnected&&e()})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Be.FRAME_IS_CONNECTED_ERROR&&e(),r.type===Be.FRAME_IS_CONNECTED_SUCCESS&&!r.payload.isConnected&&e()})}onConnect(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Be.FRAME_GET_USER_SUCCESS&&e(r.payload)})}onSocialConnected(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Be.FRAME_CONNECT_SOCIAL_SUCCESS&&e(r.payload)})}async getCapabilities(){try{return await this.request({method:"wallet_getCapabilities"})||{}}catch{return{}}}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(r=>{r.type===Be.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(r.payload):r.type===Be.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:Tn.ACCOUNT_TYPES.EOA})})}getAvailableChainIds(){return Object.keys(this.w3mFrame.networks)}async rejectRpcRequests(){var e;try{await Promise.all(Array.from(this.openRpcRequests.values()).map(async({abortController:r,method:n})=>{Tn.SAFE_RPC_METHODS.includes(n)||r.abort(),await this.appEvent({type:Be.APP_RPC_ABORT})})),this.openRpcRequests.clear()}catch(r){(e=this.w3mLogger)==null||e.logger.error({error:r},"Error aborting RPC request")}}async appEvent(e){let r,n;function i(c){return c.replace("@w3m-app/","")}const s=[Be.APP_SYNC_DAPP_DATA,Be.APP_SYNC_THEME,Be.APP_SET_PREFERRED_ACCOUNT],o=i(e.type);return!this.w3mFrame.iframeIsReady&&!s.includes(e.type)&&(n=setTimeout(()=>{var c;(c=this.onTimeout)==null||c.call(this,"iframe_load_failed"),this.abortController.abort()},2e4)),await this.w3mFrame.frameLoadPromise,clearTimeout(n),[Be.APP_CONNECT_EMAIL,Be.APP_CONNECT_DEVICE,Be.APP_CONNECT_OTP,Be.APP_CONNECT_SOCIAL,Be.APP_GET_SOCIAL_REDIRECT_URI].map(i).includes(o)&&(r=setTimeout(()=>{var c;(c=this.onTimeout)==null||c.call(this,"iframe_request_timeout"),this.abortController.abort()},12e4)),new Promise((c,l)=>{var h,g,b;const u=Math.random().toString(36).substring(7);(b=(h=this.w3mLogger)==null?void 0:(g=h.logger).info)==null||b.call(g,{event:e,id:u},"Sending app event"),this.w3mFrame.events.postAppEvent({...e,id:u});const f=new AbortController;if(o==="RPC_REQUEST"){const w=e;this.openRpcRequests.set(u,{...w.payload,abortController:f})}f.signal.addEventListener("abort",()=>{o==="RPC_REQUEST"?l(new Error("Request was aborted")):o!=="GET_FARCASTER_URI"&&l(new Error("Something went wrong"))});const d=(w,x)=>{var k,R,D;w.id===u&&((R=x==null?void 0:(k=x.logger).info)==null||R.call(k,{framEvent:w,id:u},"Received frame response"),this.openRpcRequests.delete(w.id),w.type===`@w3m-frame/${o}_SUCCESS`?(r&&clearTimeout(r),n&&clearTimeout(n),"payload"in w&&c(w.payload),c(void 0)):w.type===`@w3m-frame/${o}_ERROR`&&(r&&clearTimeout(r),n&&clearTimeout(n),"payload"in w&&l(new Error(((D=w.payload)==null?void 0:D.message)||"An error occurred")),l(new Error("An error occurred"))))};this.w3mFrame.events.registerFrameEventHandler(u,w=>d(w,this.w3mLogger),this.abortController.signal)}
13)}setNewLastEmailLoginTime(){Ln.set(Be.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setSocialLoginSuccess(e){Ln.set(Be.SOCIAL_USERNAME,e)}setLoginSuccess(e){e&&Ln.set(Be.EMAIL,e),Ln.set(Be.EMAIL_LOGIN_USED_KEY,"true"),Ln.delete(Be.LAST_EMAIL_LOGIN_TIME)}deleteAuthLoginCache(){Ln.delete(Be.EMAIL_LOGIN_USED_KEY),Ln.delete(Be.EMAIL),Ln.delete(Be.LAST_USED_CHAIN_KEY),Ln.delete(Be.SOCIAL_USERNAME)}setLastUsedChainId(e){e&&Ln.set(Be.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){const e=Ln.get(Be.LAST_USED_CHAIN_KEY)??void 0,r=Number(e);return isNaN(r)?e:r}persistSmartAccountEnabledNetworks(e){Ln.set(Be.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}getRpcUrl(e){var s,o;let r=e===void 0?void 0:"eip155";typeof e=="string"&&(e.includes(":")?r=(s=kn.parseCaipNetworkId(e))==null?void 0:s.chainNamespace:Number.isInteger(Number(e))?r="eip155":r="solana");const n=this.getCaipNetworks(r),i=e?n.find(a=>String(a.id)===String(e)||a.caipNetworkId===e):n[0];return(o=i==null?void 0:i.rpcUrls.default.http)==null?void 0:o[0]}}const kJ="1.2.3";let Gi=class g3 extends Error{constructor(e,r={}){var o;const n=r.cause instanceof g3?r.cause.details:(o=r.cause)!=null&&o.message?r.cause.message:r.details,i=r.cause instanceof g3&&r.cause.docsPath||r.docsPath,s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${kJ}`].join(` 14`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function tl(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const zN=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,JN=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,qN=/^\(.+?\).*?$/,qA=/^tuple(?<array>(\[(\d*)\])*)$/;function m3(t){let e=t.type;if(qA.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i<r;i++){const s=t.components[i];e+=m3(s),i<r-1&&(e+=", ")}const n=tl(qA,t.type);return e+=`)${(n==null?void 0:n.array)||""}`,m3({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
14 indexed`),t.name?`${e} ${t.name}`:e}function n0(t){let e="";const r=t.length;for(let n=0;n<r;n++){const i=t[n];e+=m3(i),n!==r-1&&(e+=", ")}return e}function OJ(t){var e;return t.type==="function"?`function ${t.name}(${n0(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${n0(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${n0(t.inputs)})`:t.type==="error"?`error ${t.name}(${n0(t.inputs)})`:t.type==="constructor"?`constructor(${n0(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const GN=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function MJ(t){return GN.test(t)}function DJ(t){return tl(GN,t)}const VN=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function BJ(t){return VN.test(t)}function FJ(t){return tl(VN,t)}const WN=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function $J(t){return WN.test(t)}function LJ(t){return tl(WN,t)}const KN=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function XN(t){return KN.test(t)}function UJ(t){return tl(KN,t)}const ZN=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function HJ(t){return ZN.test(t)}function jJ(t){return tl(ZN,t)}const YN=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function zJ(t){return YN.test(t)}function JJ(t){return tl(YN,t)}const qJ=/^receive\(\) external payable$/;function GJ(t){return qJ.test(t)}const XEe=new Set(["memory","indexed","storage","calldata"]),VJ=new Set(["indexed"]),b3=new Set(["calldata","memory","storage"]);class ZEe extends Gi{constructor({signature:e}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class WJ extends Gi{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class KJ extends Gi{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class YEe extends Gi{constructor({param:e}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}}class QEe extends Gi{constructor({params:e}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(e,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class XJ extends Gi{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class ZJ extends Gi{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class YJ extends Gi{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class QJ extends Gi{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class eq extends Gi{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
14d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Hh extends Gi{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class tq extends Gi{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class rq extends Gi{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class nq extends Gi{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class iq extends Gi{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function sq(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let s="";for(const o of i[1])s+=`[${o.type}${o.name?`:${o.name}`:""}]`;n+=`(${i[0]}{${s}})`}return e?`${e}:${t}${n}`:`${t}${n}`}const X2=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function oq(t,e={}){if($J(t))return aq(t,e);if(BJ(t))return cq(t,e);if(MJ(t))return lq(t,e);if(HJ(t))return uq(t,e);if(zJ(t))return fq(t);if(GJ(t))return{type:"receive",stateMutability:"payable"};throw new tq({signature:t})}function aq(t,e={}){const r=LJ(t);if(!r)throw new Hh({signature:t,type:"function"});const n=Bo(r.parameters),i=[],s=n.length;for(let a=0;a<s;a++)i.push(xf(n[a],{modifiers:b3,structs:e,type:"function"}));const o=[];if(r.returns){const a=Bo(r.returns),c=a.length;for(let l=0;l<c;l++)o.push(xf(a[l],{modifiers:b3,structs:e,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:o}}function cq(t,e={}){const r=FJ(t);if(!r)throw new Hh({signature:t,type:"event"});const n=Bo(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(xf(n[o],{modifiers:VJ,structs:e,type:"event"}));return{name:r.name,type:"event",inputs:i}}function lq(t,e={}){const r=DJ(t);if(!r)throw new Hh({signature:t,type:"error"});const n=Bo(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(xf(n[o],{structs:e,type:"error"}));return{name:r.name,type:"error",inputs:i}}function uq(t,e={}){const r=jJ(t);if(!r)throw new Hh({signature:t,type:"constructor"});const n=Bo(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(xf(n[o],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}
14function fq(t){const e=JJ(t);if(!e)throw new Hh({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const dq=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,hq=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,pq=/^u?int$/;function xf(t,e){var f,d;const r=sq(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(X2.has(r))return X2.get(r);const n=qN.test(t),i=tl(n?hq:dq,t);if(!i)throw new XJ({param:t});if(i.name&&mq(i.name))throw new ZJ({param:t,name:i.name});const s=i.name?{name:i.name}:{},o=i.modifier==="indexed"?{indexed:!0}:{},a=(e==null?void 0:e.structs)??{};let c,l={};if(n){c="tuple";const h=Bo(i.type),g=[],b=h.length;for(let w=0;w<b;w++)g.push(xf(h[w],{structs:a}));l={components:g}}else if(i.type in a)c="tuple",l={components:a[i.type]};else if(pq.test(i.type))c=`${i.type}256`;else if(i.type==="address payable")c="address";else if(c=i.type,(e==null?void 0:e.type)!=="struct"&&!QN(c))throw new KJ({type:c});if(i.modifier){if(!((d=(f=e==null?void 0:e.modifiers)==null?void 0:f.has)!=null&&d.call(f,i.modifier)))throw new YJ({param:t,type:e==null?void 0:e.type,modifier:i.modifier});if(b3.has(i.modifier)&&!bq(c,!!i.array))throw new QJ({param:t,type:e==null?void 0:e.type,modifier:i.modifier})}const u={type:`${c}${i.array??""}`,...s,...o,...l};return X2.set(r,u),u}function Bo(t,e=[],r="",n=0){const i=t.trim().length;for(let s=0;s<i;s++){const o=t[s],a=t.slice(s+1);switch(o){case",":return n===0?Bo(a,[...e,r.trim()]):Bo(a,e,`${r}${o}`,n);case"(":return Bo(a,e,`${r}${o}`,n+1);case")":return Bo(a,e,`${r}${o}`,n-1);default:return Bo(a,e,`${r}${o}`,n)}}if(r==="")return e;if(n!==0)throw new iq({current:r,depth:n});return e.push(r.trim()),e}function QN(t){return t==="address"||t==="bool"||t==="function"||t==="string"||zN.test(t)||JN.test(t)}const gq=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function mq(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||zN.test(t)||JN.test(t)||gq.test(t)}function bq(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function yq(t){const e={},r=t.length;for(let o=0;o<r;o++){const a=t[o];if(!XN(a))continue;const c=UJ(a);if(!c)throw new Hh({signature:a,type:"struct"});const l=c.properties.split(";"),u=[],f=l.length;for(let d=0;d<f;d++){const g=l[d].trim();if(!g)continue;const b=xf(g,{type:"struct"});u.push(b)}if(!u.length)throw new rq({signature:a});e[c.name]=u}const n={},i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,c]=i[o];n[a]=eI(c,e)}return n}const vq=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function eI(t=[],e={},r=new Set){const n=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(qN.test(o.type))n.push(o);else{const c=tl(vq,o.type);if(!(c!=null&&c.type))throw new eq({abiParameter:o});const{array:l,type:u}=c;if(u in e){if(r.has(u))throw new nq({type:u});n.push({...o,type:`tuple${l??""}`,components:eI(e[u],e,new Set([...r,u]))})}else if(QN(u))n.push(o);else throw new WJ({type:u})}}return n}function tI(t){const e=yq(t),r=[],n=t.length;for(let i=0;i<n;i++){const s=t[i];XN(s)||r.push(oq(s,e))}return r}function Ar(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:s=>e(t,s)}function Ja(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new Oq(t.type);return`${t.name}(${Ey(t.inputs,{includeName:e})})`}function Ey(t,{includeName:e=!1}={}){return t?t.map(r=>wq(r,{includeName:e})).join(e?", ":","):""}function wq(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Ey(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}
14function qc(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function qn(t){return qc(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const rI="2.47.12";let Nd={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${rI}`};function e8e(t){Nd=t}let ue=class y3 extends Error{constructor(e,r={}){var a;const n=(()=>{var c;return r.cause instanceof y3?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),i=(()=>r.cause instanceof y3&&r.cause.docsPath||r.docsPath)(),s=(a=Nd.getDocsUrl)==null?void 0:a.call(Nd,{...r,docsPath:i}),o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...Nd.version?[`Version: ${Nd.version}`]:[]].join(` 15`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=rI}walk(e){return nI(this,e)}};function nI(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?nI(t.cause,e):e?null:t}class Eq extends ue{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` 16`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class GA extends ue{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` 17`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class t8e extends ue{constructor({data:e,size:r}){super([`Data size of ${r}
17 bytes is invalid.`,"Size must be in increments of 32 bytes (size % 32 === 0)."].join(` 18`),{metaMessages:[`Data: ${e} (${r} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}}class iI extends ue{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` 19`),{metaMessages:[`Params: (${Ey(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class A5 extends ue{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class Aq extends ue{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` 20`),{name:"AbiEncodingArrayLengthMismatchError"})}}class _q extends ue{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${qn(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Cq extends ue{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` 21`),{name:"AbiEncodingLengthMismatchError"})}}class Sq extends ue{constructor(e,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${e}", but "${e}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(` 22`),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}}class VA extends ue{constructor(e,{docsPath:r}={}){super([`Error ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` 23`),{docsPath:r,name:"AbiErrorNotFoundError"})}}class sI extends ue{constructor(e,{docsPath:r,cause:n}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${e}.`].join(` 24`),{docsPath:r,name:"AbiErrorSignatureNotFoundError",cause:n}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class Tq extends ue{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class Nq extends ue{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(` 25`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}}class r8e extends ue{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` 26`),{docsPath:r,name:"AbiEventNotFoundError"})}}class ph extends ue{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` 27`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class oI extends ue{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` 28`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class Iq extends ue{constructor(e,{docsPath:r}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${e}.`].join(` 29`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class xq extends ue{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}
29\` in \`${Ja(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Ja(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class n8e extends ue{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class WA extends ue{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` 30`),{metaMessages:[`Params: (${Ey(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class Rq extends ue{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Ja(e,{includeName:!0})}".`].join(` 31`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class Pq extends ue{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 32`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class kq extends ue{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 33`),{docsPath:r,name:"InvalidAbiDecodingType"})}}class aI extends ue{constructor(e){super([`Value "${e}" is not a valid array.`].join(` 34`),{name:"InvalidArrayError"})}}class Oq extends ue{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 35`),{name:"InvalidDefinitionTypeError"})}}class i8e extends ue{constructor(e){super(`Type "${e}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}let cI=class extends ue{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},lI=class extends ue{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class KA extends ue{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function jh(t,{dir:e,size:r=32}={}){return typeof t=="string"?Gl(t,{dir:e,size:r}):Mq(t,{dir:e,size:r})}function Gl(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new lI({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function Mq(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new lI({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i<r;i++){const s=e==="right";n[s?i:r-i-1]=t[s?i:t.length-i-1]}return n}let _5=class extends ue{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Dq=class extends ue{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class Bq extends ue{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let l8e=class extends ue{constructor(e){super(`Hex value "${e}" is an odd length (${e.length}). It must be an even length.`,{name:"InvalidHexValueError"})}},Fq=class extends ue{constructor({givenSize:e,maxSize:r}
35){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function Vl(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;i<r.length-1&&r[e==="left"?i:r.length-i-1].toString()==="0";i++)n++;return r=e==="left"?r.slice(n):r.slice(0,r.length-n),typeof t=="string"?(r.length===1&&e==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}function fo(t,{size:e}){if(qn(t)>e)throw new Fq({givenSize:qn(t),maxSize:e})}function d8e(t,e){const r=typeof e=="string"?{to:e}:e,n=r.to;return n==="number"?su(t,r):n==="bigint"?Rf(t,r):n==="string"?uI(t,r):n==="boolean"?$q(t,r):Vo(t,r)}function Rf(t,e={}){const{signed:r}=e;e.size&&fo(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function $q(t,e={}){let r=t;if(e.size&&(fo(r,{size:e.size}),r=Vl(r)),Vl(r)==="0x00")return!1;if(Vl(r)==="0x01")return!0;throw new Bq(r)}function su(t,e={}){const r=Rf(t,e),n=Number(r);if(!Number.isSafeInteger(n))throw new _5({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${r}n`});return n}function uI(t,e={}){let r=Vo(t);return e.size&&(fo(r,{size:e.size}),r=Vl(r,{dir:"right"})),new TextDecoder().decode(r)}const Lq=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Gc(t,e={}){return typeof t=="number"||typeof t=="bigint"?Bt(t,e):typeof t=="string"?Ay(t,e):typeof t=="boolean"?fI(t,e):ei(t,e)}function fI(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(fo(r,{size:e.size}),jh(r,{size:e.size})):r}function ei(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=Lq[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(fo(n,{size:e.size}),jh(n,{dir:"right",size:e.size})):n}function Bt(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const c=typeof t=="bigint"?"n":"";throw new _5({max:s?`${s}${c}`:void 0,min:`${o}${c}`,signed:r,size:n,value:`${t}${c}`})}const a=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?jh(a,{size:n}):a}const Uq=new TextEncoder;function Ay(t,e={}){const r=Uq.encode(t);return ei(r,e)}const Hq=new TextEncoder;function x1(t,e={}){return typeof t=="number"||typeof t=="bigint"?zq(t,e):typeof t=="boolean"?jq(t,e):qc(t)?Vo(t,e):gf(t,e)}function jq(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(fo(r,{size:e.size}),jh(r,{size:e.size})):r}const nc={zero:48,nine:57,A:65,F:70,a:97,f:102};function XA(t){if(t>=nc.zero&&t<=nc.nine)return t-nc.zero;if(t>=nc.A&&t<=nc.F)return t-(nc.A-10);if(t>=nc.a&&t<=nc.f)return t-(nc.a-10)}function Vo(t,e={}){let r=t;e.size&&(fo(r,{size:e.size}),r=jh(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;o<i;o++){const c=XA(n.charCodeAt(a++)),l=XA(n.charCodeAt(a++));if(c===void 0||l===void 0)throw new ue(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);s[o]=c*16+l}return s}function zq(t,e){const r=Bt(t,e);return Vo(r)}function gf(t,e={}){const r=Hq.encode(t);return typeof e.size=="number"?(fo(r,{size:e.size}),jh(r,{dir:"right",size:e.size})):r}const wg=BigInt(2**32-1),ZA=BigInt(32);function Jq(t,e=!1){return e?{h:Number(t&wg),l:Number(t>>ZA&wg)}:{h:Number(t>>ZA&wg)|0,l:Number(t&wg)|0}}function dI(t,e=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:o,l:a}=Jq(t[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const YA=(t,e,r)=>t>>>r,QA=(t,e,r)=>t<<32-r|e>>>r,ad=(t,e,r)=>t>>>r|e<<32-r,cd=(t,e,r)=>t<<32-r|e>>>r,Eg=(t,e,r)=>t<<64-r|e>>>r-32,Ag=(t,e,r)=>t>>>r-32|e<<64-r,qq=(t,e,r)=>t<<r|e>>>32-r,Gq=(t,e,r)=>e<<r|t>>>32-r,Vq=(t,e,r)=>e<<r-32|t>>>64-r,Wq=(t,e,r)=>t<<r-32|e>>>64-r;function ic(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const Kq=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),Xq=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Zq=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Yq=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Qq=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),eG=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,ld=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function tG(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function cb(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function gh(t,...e){if(!tG(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}
vendor: 4,584 bytes, line 35
35function h8e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");cb(t.outputLen),cb(t.blockLen)}function lb(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function hI(t,e){gh(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function rG(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Pf(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Z2(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ea(t,e){return t<<32-e|t>>>e}function p8e(t,e){return t<<e|t>>>32-e>>>0}const nG=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function iG(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function sG(t){for(let e=0;e<t.length;e++)t[e]=iG(t[e]);return t}const e4=nG?t=>t:sG;function oG(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function C5(t){return typeof t=="string"&&(t=oG(t)),gh(t),t}function g8e(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];gh(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}let pI=class{};function _y(t){const e=n=>t().update(C5(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function b8e(t=32){if(ld&&typeof ld.getRandomValues=="function")return ld.getRandomValues(new Uint8Array(t));if(ld&&typeof ld.randomBytes=="function")return Uint8Array.from(ld.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const aG=BigInt(0),i0=BigInt(1),cG=BigInt(2),lG=BigInt(7),uG=BigInt(256),fG=BigInt(113),gI=[],mI=[],bI=[];for(let t=0,e=i0,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],gI.push(2*(5*n+r)),mI.push((t+1)*(t+2)/2%64);let i=aG;for(let s=0;s<7;s++)e=(e<<i0^(e>>lG)*fG)%uG,e&cG&&(i^=i0<<(i0<<BigInt(s))-i0);bI.push(i)}const yI=dI(bI,!0),dG=yI[0],hG=yI[1],t4=(t,e,r)=>r>32?Vq(t,e,r):qq(t,e,r),r4=(t,e,r)=>r>32?Wq(t,e,r):Gq(t,e,r);function pG(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=t4(l,u,1)^r[a],d=r4(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=mI[o],c=t4(i,s,a),l=r4(i,s,a),u=gI[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=dG[n],t[1]^=hG[n]}Pf(r)}let gG=class vI extends pI{constructor(e,r,n,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,cb(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=rG(this.state)}clone(){return this._cloneInto()}keccak(){e4(this.state32),pG(this.state32,this.rounds),e4(this.state32),this.posOut=0,this.pos=0}update(e){lb(this),e=C5(e),gh(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){lb(this,!1),gh(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return cb(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(hI(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,Pf(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new vI(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const mG=(t,e,r)=>_y(()=>new gG(e,t,r)),bG=(()=>mG(1,136,256/8))();
35function ou(t,e){const r=e||"hex",n=bG(qc(t,{strict:!1})?x1(t):t);return r==="bytes"?n:Gc(n)}const yG=t=>ou(x1(t));function vG(t){return yG(t)}function wG(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o<t.length;o++){const a=t[o];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function",""].includes(i))i="";else if(i+=a,a===")"){s=!0;break}continue}if(a===" "){t[o-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=a,r+=a}}if(!s)throw new ue("Unable to normalize signature.");return i}const EG=t=>{const e=(()=>typeof t=="string"?t:OJ(t))();return wG(e)};function wI(t){return vG(EG(t))}const S5=wI;let kf=class extends ue{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},R1=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&(super.delete(e),super.set(e,r)),r}set(e,r){if(super.has(e)&&super.delete(e),super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=super.keys().next().value;n!==void 0&&super.delete(n)}return this}};const Y2=new R1(8192);function P1(t,e){if(Y2.has(`${t}.${e}`))return Y2.get(`${t}.${e}`);const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=ou(gf(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(n[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());const s=`0x${i.join("")}`;return Y2.set(`${t}.${e}`,s),s}function rf(t,e){if(!qa(t,{strict:!1}))throw new kf({address:t});return P1(t,e)}const AG=/^0x[a-fA-F0-9]{40}$/,Q2=new R1(8192);function qa(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(Q2.has(n))return Q2.get(n);const i=(()=>AG.test(t)?t.toLowerCase()===t?!0:r?P1(t)===t:!0:!1)();return Q2.set(n,i),i}function Vc(t){return typeof t[0]=="string"?k1(t):_G(t)}function _G(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function k1(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function mh(t,e,r,{strict:n}={}){return qc(t,{strict:!1})?CG(t,e,r,{strict:n}):_I(t,e,r,{strict:n})}function EI(t,e){if(typeof e=="number"&&e>0&&e>qn(t)-1)throw new cI({offset:e,position:"start",size:qn(t)})}function AI(t,e,r){if(typeof e=="number"&&typeof r=="number"&&qn(t)!==r-e)throw new cI({offset:r,position:"end",size:qn(t)})}function _I(t,e,r,{strict:n}={}){EI(t,e);const i=t.slice(e,r);return n&&AI(i,e,r),i}function CG(t,e,r,{strict:n}={}){EI(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&AI(i,e,r),i}const w8e=/^(.*)\[([0-9]*)\]$/,E8e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,SG=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Cy(t,e){if(t.length!==e.length)throw new Cq({expectedLength:t.length,givenLength:e.length});const r=TG({params:t,values:e}),n=N5(r);return n.length===0?"0x":n}function TG({params:t,values:e}){const r=[];for(let n=0;n<t.length;n++)r.push(T5({param:t[n],value:e[n]}));return r}function T5({param:t,value:e}){const r=I5(t.type);if(r){const[n,i]=r;return IG(e,{length:n,param:{...t,type:i}})}if(t.type==="tuple")return OG(e,{param:t});if(t.type==="address")return NG(e);if(t.type==="bool")return RG(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const n=t.type.startsWith("int"),[,,i="256"]=SG.exec(t.type)??[];return PG(e,{signed:n,size:Number(i)})}if(t.type.startsWith("bytes"))return xG(e,{param:t});if(t.type==="string")return kG(e);throw new Pq(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function N5(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?e+=32:e+=qn(a)}const r=[],n=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:o,encoded:a}=t[s];o?(r.push(Bt(e+i,{size:32})),n.push(a),i+=qn(a)):r.push(a)}return Vc([...r,...n])}function NG(t){if(!qa(t))throw new kf({address:t});return{dynamic:!1,encoded:Gl(t.toLowerCase())}}function IG(t,{length:e,param:r}){const n=e===null;if(!Array.isArray(t))throw new aI(t);if(!n&&t.length!==e)throw new Aq({expectedLength:e,givenLength:t.length,type:`${r.type}[${e}]`});let i=!1;const s=[];for(let o=0;o<t.length;o++){const a=T5({param:r,value:t[o]});a.dynamic&&(i=!0),s.push(a)}if(n||i){const o=N5(s);if(n){const a=Bt(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?Vc([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Vc(s.map(({encoded:o})=>o))}}function xG(t,{param:e}){const[,r]=e.type.split("bytes"),n=qn(t);if(!r){let i=t;return n%32!==0&&(i=Gl(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Vc([Gl(Bt(n,{size:32})),i])}}if(n!==Number.parseInt(r,10))throw new _q({expectedSize:Number.parseInt(r,10),value:t});return{dynamic:!1,encoded:Gl(t,{dir:"right"})}}function RG(t){if(typeof t!="boolean")throw new ue(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Gl(fI(t))}}function PG(t,{signed:e,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||t<i)throw new _5({max:n.toString(),min:i.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:Bt(t,{size:32,signed:e})}}function kG(t){const e=Ay(t),r=Math.ceil(qn(e)/32),n=[];for(let i=0;i<r;
35i++)n.push(Gl(mh(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Vc([Gl(Bt(qn(e),{size:32})),...n])}}function OG(t,{param:e}){let r=!1;const n=[];for(let i=0;i<e.components.length;i++){const s=e.components[i],o=Array.isArray(t)?i:s.name,a=T5({param:s,value:t[o]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?N5(n):Vc(n.map(({encoded:i})=>i))}}function I5(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const O1=t=>mh(wI(t),0,4);function M1(t){const{abi:e,args:r=[],name:n}=t,i=qc(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?O1(a)===n:a.type==="event"?S5(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((l,u)=>{const f="inputs"in a&&a.inputs[u];return f?v3(l,f):!1})){if(o&&"inputs"in o&&o.inputs){const l=CI(a.inputs,o.inputs,r);if(l)throw new xq({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function v3(t,e){const r=typeof t,n=e.type;switch(n){case"address":return qa(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>r==="object"&&v3(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>v3(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function CI(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return CI(i.components,s.components,r[n]);const o=[i.type,s.type];if((()=>o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?qa(r[n],{strict:!1}):o.includes("address")&&o.includes("bytes")?qa(r[n],{strict:!1}):!1)())return o}}function MG(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}function so(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const n4="/docs/contract/encodeFunctionData";function DG(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=M1({abi:e,args:r,name:n});if(!s)throw new ph(n,{docsPath:n4});i=s}if(i.type!=="function")throw new ph(void 0,{docsPath:n4});return{abi:[i],functionName:O1(Ja(i))}}function zh(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:DG(t)})(),i=r[0],s=n,o="inputs"in i&&i.inputs?Cy(i.inputs,e??[]):void 0;return k1([s,o??"0x"])}const BG={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},SI={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},FG={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class i4 extends ue{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class TI extends ue{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class $G extends ue{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const LG={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new $G({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new TI({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new i4({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new i4({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function x5(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(LG);return r.bytes=t,r.dataView=new DataView(t.buffer??t,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function A8e(t,e){const r=typeof e=="string"?{to:e}:e,n=r.to;return n==="number"?Oa(t,r):n==="bigint"?NI(t,r):n==="boolean"?II(t,r):n==="string"?xI(t,r):ei(t,r)}function NI(t,e={}){typeof e.size<"u"&&fo(t,{size:e.size});const r=ei(t,e);return Rf(r,e)}function II(t,e={}){let r=t;if(typeof e.size<"u"&&(fo(r,{size:e.size}),r=Vl(r)),r.length>1||r[0]>1)throw new Dq(r);return!!r[0]}function Oa(t,e={}){typeof e.size<"u"&&fo(t,{size:e.size});const r=ei(t,e);return su(r,e)}function xI(t,e={}){let r=t;return typeof e.size<"u"&&(fo(r,{size:e.size}),r=Vl(r,{dir:"right"})),new TextDecoder().decode(r)}function D1(t,e){const r=typeof e=="string"?Vo(e):e,n=x5(r);if(qn(r)===0&&t.length>0)throw new A5;if(qn(e)&&qn(e)<32)throw new iI({data:typeof e=="string"?e:ei(e),params:t,size:qn(e)});let i=0;const s=[];for(let o=0;o<t.length;++o){const a=t[o];n.setPosition(i);const[c,l]=Vd(n,a,{staticPosition:0});i+=l,s.push(c)}return s}function Vd(t,e,{staticPosition:r}){const n=I5(e.type);if(n){const[i,s]=n;return HG(t,{...e,type:s},{length:i,staticPosition:r})}if(e.type==="tuple")return qG(t,e,{staticPosition:r});if(e.type==="address")return UG(t);if(e.type==="bool")return jG(t);if(e.type.startsWith("bytes"))return zG(t,e,{staticPosition:r});if(e.type.startsWith("uint")||e.type.startsWith("int"))return JG(t,e);if(e.type==="string")return GG(t,{staticPosition:r});throw new kq(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const s4=32,w3=32;function UG(t){const e=t.readBytes(32);return[P1(ei(_I(e,-20))),32]}function HG(t,e,{length:r,staticPosition:n}){if(!r){const o=Oa(t.readBytes(w3)),a=n+o,c=a+s4;t.setPosition(a);const l=Oa(t.readBytes(s4)),u=Dp(e);let f=0;const d=[];for(let h=0;h<l;++h){t.setPosition(c+(u?h*32:f));const[g,b]=Vd(t,e,{staticPosition:c});f+=b,d.push(g)}return t.setPosition(n+32),[d,32]}if(Dp(e)){const o=Oa(t.readBytes(w3)),a=n+o,c=[];for(let l=0;l<r;++l){t.setPosition(a+l*32);const[u]=Vd(t,e,{staticPosition:a});c.push(u)}return t.setPosition(n+32),[c,32]}let i=0;const s=[];for(let o=0;o<r;++o){const[a,c]=Vd(t,e,{staticPosition:n+i});i+=c,s.push(a)}return[s,i]}function jG(t){return[II(t.readBytes(32),{size:32}),32]}function zG(t,e,{staticPosition:r}){const[n,i]=e.type.split("bytes");if(!i){const o=Oa(t.readBytes(32));t.setPosition(r+o);const a=Oa(t.readBytes(32));if(a===0)return t.setPosition(r+32),["0x",32];const c=t.readBytes(a);return t.setPosition(r+32),[ei(c),32]}return[ei(t.readBytes(Number.parseInt(i,10),32)),32]}function JG(t,e){const r=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256",10),i=t.readBytes(32);return[n>48?NI(i,{signed:r}):Oa(i,{signed:r}),32]}function qG(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(Dp(e)){const o=Oa(t.readBytes(w3)),a=r+o;for(let c=0;c<e.components.length;++c){const l=e.components[c];t.setPosition(a+s);const[u,f]=Vd(t,l,{staticPosition:a});s+=f,i[n?c:l==null?void 0:l.name]=u}return t.setPosition(r+32),[i,32]}for(let o=0;o<e.components.length;++o){const a=e.components[o],[c,l]=Vd(t,a,{staticPosition:r});i[n?o:a==null?void 0:a.name]=c,s+=l}return[i,s]}function GG(t,{staticPosition:e}){const r=Oa(t.readBytes(32)),n=e+r;t.setPosition(n);const i=Oa(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),o=xI(Vl(s));return t.setPosition(e+32),[o,32]}function Dp(t){var n;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;
35if(e==="tuple")return(n=t.components)==null?void 0:n.some(Dp);const r=I5(t.type);return!!(r&&Dp({...t,type:r[1]}))}function VG(t){const{abi:e,data:r,cause:n}=t,i=mh(r,0,4);if(i==="0x")throw new A5({cause:n});const o=[...e||[],SI,FG].find(a=>a.type==="error"&&i===O1(Ja(a)));if(!o)throw new sI(i,{docsPath:"/docs/contract/decodeErrorResult",cause:n});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?D1(o.inputs,mh(r,4)):void 0,errorName:o.name}}const $s=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);function RI({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?$s(e[s]):e[s]}`).join(", ")})`}const WG={gwei:9,wei:18},KG={ether:-9,wei:9},_8e={ether:-18,gwei:-9};function B1(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function R5(t,e="wei"){return B1(t,WG[e])}function hs(t,e="wei"){return B1(t,KG[e])}class XG extends ue{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class ZG extends ue{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function o4(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} 36`,"")}function YG(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: 37`;return n.nonce&&(i+=` nonce: ${n.nonce} 38`),n.balance&&(i+=` balance: ${n.balance} 39`),n.code&&(i+=` code: ${n.code} 40`),n.state&&(i+=` state: 41`,i+=o4(n.state)),n.stateDiff&&(i+=` stateDiff: 42`,i+=o4(n.stateDiff)),i},` State Override: 43`).slice(0,-1)}function F1(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` 44`)}class C8e extends ue{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` 45`),{name:"FeeConflictError"})}}class S8e extends ue{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class QG extends ue{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",F1(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class T8e extends ue{constructor({serializedType:e}){super(`Serialized transaction type "${e}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=e}}class N8e extends ue{constructor({attributes:e,serializedTransaction:r,type:n}){const i=Object.entries(e).map(([s,o])=>typeof o>"u"?s:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${n}" was provided.`,{metaMessages:[`Serialized Transaction: "${r}"`,i.length>0?`Missing Attributes: ${i.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=r,this.type=n}}class I8e extends ue{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class eV extends ue{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var g;const h=F1({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${R5(d)} ${((g=i==null?void 0:i.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${hs(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${hs(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${hs(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(
45Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class PI extends ue{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`,{name:"TransactionNotFoundError"})}}class kI extends ue{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class x8e extends ue{constructor({receipt:e}){super(`Transaction with hash "${e.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=e}}class tV extends ue{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const rV=t=>t,$1=t=>t;class nV extends ue{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,stateOverride:h}){var w;const g=r?so(r):void 0;let b=F1({from:g==null?void 0:g.address,to:f,value:typeof d<"u"&&`${R5(d)} ${((w=i==null?void 0:i.nativeCurrency)==null?void 0:w.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${hs(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${hs(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${hs(l)} gwei`,nonce:u});h&&(b+=` 46${YG(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",b].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class iV extends ue{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=M1({abi:r,args:n,name:o}),l=c?RI({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Ja(c,{includeName:!0}):void 0,f=F1({address:i&&rV(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class E3 extends ue{constructor({abi:e,data:r,functionName:n,message:i,cause:s}){let o,a,c,l;if(r&&r!=="0x")try{a=VG({abi:e,data:r,cause:s});const{abiItem:f,errorName:d,args:h}=a;if(d==="Error")l=h[0];else if(d==="Panic"){const[g]=h;l=BG[g]}else{const g=f?Ja(f,{includeName:!0}
46):void 0,b=f&&h?RI({abiItem:f,args:h,includeFunctionName:!1,includeName:!1}):void 0;c=[g?`Error: ${g}`:"",b&&b!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(f){o=f}else i&&(l=i);let u;o instanceof sI&&(u=o.signature,c=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(` 47`):`The contract function "${n}" reverted.`,{cause:o??s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=r,this.reason=l,this.signature=u}}class sV extends ue{constructor({functionName:e,cause:r}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:r})}}class oV extends ue{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class OI extends ue{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class G0 extends ue{constructor({body:e,cause:r,details:n,headers:i,status:s,url:o}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${$1(o)}`,e&&`Request body: ${$s(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=s,this.url=o}}class R8e extends ue{constructor({body:e,cause:r,details:n,url:i}){super("WebSocket request failed.",{cause:r,details:n,metaMessages:[`URL: ${$1(i)}`,e&&`Request body: ${$s(e)}`].filter(Boolean),name:"WebSocketRequestError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=i}}class P5 extends ue{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${$1(n)}`,`Request body: ${$s(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data,this.url=n}}class P8e extends ue{constructor({url:e}={}){super("The socket has been closed.",{metaMessages:[e&&`URL: ${$1(e)}`].filter(Boolean),name:"SocketClosedError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e}}class a4 extends ue{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${$1(r)}`,`Request body: ${$s(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=r}}const aV=-1;class ws extends ue{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:o}
vendor: 4,051 bytes, lines 47-49
47){super(o,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||e.name,this.code=e instanceof P5?e.code:r??aV}}class Es extends ws{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class Bp extends ws{constructor(e){super(e,{code:Bp.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Bp,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Fp extends ws{constructor(e){super(e,{code:Fp.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Fp,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class $p extends ws{constructor(e,{method:r}={}){super(e,{code:$p.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty($p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Lp extends ws{constructor(e){super(e,{code:Lp.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 48`)})}}Object.defineProperty(Lp,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Of extends ws{constructor(e){super(e,{code:Of.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(Of,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class bh extends ws{constructor(e){super(e,{code:bh.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 49`)})}}Object.defineProperty(bh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Up extends ws{constructor(e){super(e,{code:Up.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Up,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Wl extends ws{constructor(e){super(e,{code:Wl.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Wl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class yh extends ws{constructor(e){super(e,{code:yh.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(yh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class nf extends ws{constructor(e,{method:r}={}){super(e,{code:nf.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(nf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class vh extends ws{constructor(e){super(e,{code:vh.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(vh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Hp extends ws{constructor(e){super(e,{code:Hp.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Hp,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class _n extends Es{constructor(e){super(e,{code:_n.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(_n,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class jp extends Es{constructor(e){super(e,{code:jp.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(jp,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});
49class zp extends Es{constructor(e,{method:r}={}){super(e,{code:zp.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(zp,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Jp extends Es{constructor(e){super(e,{code:Jp.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Jp,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class qp extends Es{constructor(e){super(e,{code:qp.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(qp,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Ga extends Es{constructor(e){super(e,{code:Ga.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Ga,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class Gp extends Es{constructor(e){super(e,{code:Gp.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(Gp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Vp extends Es{constructor(e){super(e,{code:Vp.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Vp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});
49class Wp extends Es{constructor(e){super(e,{code:Wp.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Wp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class Kp extends Es{constructor(e){super(e,{code:Kp.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(Kp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Xp extends Es{constructor(e){super(e,{code:Xp.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Xp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Zp extends Es{constructor(e){super(e,{code:Zp.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Zp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class Yp extends Es{constructor(e){super(e,{code:Yp.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(Yp,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class wh extends Es{constructor(e){super(e,{code:wh.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(wh,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class cV extends ws{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const lV=3;function MI(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const a=t instanceof OI?t:t instanceof ue?t.walk(g=>"data"in g)||t.walk():{},{code:c,data:l,details:u,message:f,shortMessage:d}=a,h=(()=>t instanceof A5?new sV({functionName:s,cause:t}):[lV,Of.code].includes(c)&&(l||u||f||d)||c===bh.code&&u==="execution reverted"&&l?new E3({abi:e,data:typeof l=="object"?l.data:l,functionName:s,message:a instanceof P5?u:d??f,cause:t}):t)();return new iV(h,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}function uV(t){const e=ou(`0x${t.substring(4)}`).substring(26);return P1(`0x${e}`)}const fV="modulepreload",dV=function(t){return"/"+t},c4={},Hn=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=dV(s),s in c4)return;c4[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const f=i[u];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":fV,o||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),o)return new Promise((u,f)=>{l.addEventListener("load",u),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};async function hV({hash:t,signature:e}){const r=qc(t)?t:Gc(t),{secp256k1:n}=await Hn(()=>import("./secp256k1-ee758b7f.js").then(o=>o.a),[]);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:u,v:f,yParity:d}=e,h=Number(d??f),g=l4(h);return new n.Signature(Rf(l),Rf(u)).addRecoveryBit(g)}const o=qc(e)?e:Gc(e);if(qn(o)!==65)throw new Error("invalid signature length");const a=su(`0x${o.slice(130)}`),c=l4(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function l4(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function pV({hash:t,signature:e}){return uV(await hV({hash:t,signature:e}))}function k5(t,e="hex"){const r=DI(t),n=x5(new Uint8Array(r.length));return r.encode(n),e==="hex"?ei(n.bytes):n.bytes}function k8e(t,e="bytes"){return k5(t,e)}function O8e(t,e="hex"){return k5(t,e)}function DI(t){return Array.isArray(t)?gV(t.map(e=>DI(e))):mV(t)}function gV(t){const e=t.reduce((i,s)=>i+s.length,0),r=BI(e);return{length:(()=>e<=55?1+e:1+r+e)(),encode(i){e<=55?i.pushByte(192+e):(i.pushByte(192+55+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:s}of t)s(i)}}}function mV(t){const e=typeof t=="string"?Vo(t):t,r=BI(e.length);return{length:(()=>e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length)(),encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(128+55+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function BI(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;
49if(t<2**32)return 4;throw new ue("Length is too large.")}function bV(t){const{chainId:e,nonce:r,to:n}=t,i=t.contractAddress??t.address,s=ou(k1(["0x05",k5([e?Bt(e):"0x",i,r?Bt(r):"0x"])]));return n==="bytes"?Vo(s):s}async function FI(t){const{authorization:e,signature:r}=t;return pV({hash:bV(e),signature:r??e})}class yV extends ue{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var g;const h=F1({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${R5(d)} ${((g=i==null?void 0:i.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${hs(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${hs(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${hs(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class sf extends ue{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(sf,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(sf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class ub extends ue{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${hs(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(ub,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class A3 extends ue{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${hs(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(A3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class _3 extends ue{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(_3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class C3 extends ue{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` 50`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(C3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class S3 extends ue{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(S3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class T3 extends ue{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 51`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(T3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class N3 extends ue{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(N3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class I3 extends ue{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(I3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class x3 extends ue{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(x3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class fb extends ue{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${hs(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${hs(n)} gwei`:""}).`].join(` 52`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(fb,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Sy extends ue{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function O5(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof ue?t.walk(i=>(i==null?void 0:i.code)===sf.code):t;return n instanceof ue?new sf({cause:t,message:n.details}):sf.nodeMessage.test(r)?new sf({cause:t,message:t.details}):ub.nodeMessage.test(r)?new ub({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):A3.nodeMessage.test(r)?new A3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):_3.nodeMessage.test(r)?new _3({cause:t,nonce:e==null?void 0:e.nonce}):C3.nodeMessage.test(r)?new C3({cause:t,nonce:e==null?void 0:e.nonce}):S3.nodeMessage.test(r)?new S3({cause:t,nonce:e==null?void 0:e.nonce}):T3.nodeMessage.test(r)?new T3({cause:t}):N3.nodeMessage.test(r)?new N3({cause:t,gas:e==null?void 0:e.gas}):I3.nodeMessage.test(r)?new I3({cause:t,gas:e==null?void 0:e.gas}):x3.nodeMessage.test(r)?new x3({cause:t}):fb.nodeMessage.test(r)?new fb({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Sy({cause:t})}function vV(t,{docsPath:e,...r}){const n=(()=>{const i=O5(t,r);return i instanceof Sy?t:i})();return new yV(n,{docsPath:e,...r})}function Ty(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);
52for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}function Ny(t,e){return({exclude:r,format:n})=>({exclude:r,format:(i,s)=>{const o=e(i,s);if(r)for(const a of r)delete o[a];return{...o,...n(i,s)}},type:t})}const wV={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function L1(t,e){const r={};return typeof t.authorizationList<"u"&&(r.authorizationList=EV(t.authorizationList)),typeof t.accessList<"u"&&(r.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(r.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?r.blobs=t.blobs.map(n=>ei(n)):r.blobs=t.blobs),typeof t.data<"u"&&(r.data=t.data),t.account&&(r.from=t.account.address),typeof t.from<"u"&&(r.from=t.from),typeof t.gas<"u"&&(r.gas=Bt(t.gas)),typeof t.gasPrice<"u"&&(r.gasPrice=Bt(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=Bt(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(r.maxFeePerGas=Bt(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=Bt(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(r.nonce=Bt(t.nonce)),typeof t.to<"u"&&(r.to=t.to),typeof t.type<"u"&&(r.type=wV[t.type]),typeof t.value<"u"&&(r.value=Bt(t.value)),r}const M8e=Ny("transactionRequest",L1);function EV(t){return t.map(e=>({address:e.address,r:e.r?Bt(BigInt(e.r)):e.r,s:e.s?Bt(BigInt(e.s)):e.s,chainId:Bt(e.chainId),nonce:Bt(e.nonce),...typeof e.yParity<"u"?{yParity:Bt(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Bt(e.v)}:{}}))}function u4(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new KA({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new KA({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function AV(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,o={};if(s!==void 0&&(o.code=s),e!==void 0&&(o.balance=Bt(e)),r!==void 0&&(o.nonce=Bt(r)),n!==void 0&&(o.state=u4(n)),i!==void 0){if(o.state)throw new ZG;o.stateDiff=u4(i)}return o}function $I(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!qa(r,{strict:!1}))throw new kf({address:r});if(e[r])throw new XG({address:r});e[r]=AV(n)}return e}const D8e=2n**(8n-1n)-1n,B8e=2n**(16n-1n)-1n,F8e=2n**(24n-1n)-1n,$8e=2n**(32n-1n)-1n,L8e=2n**(40n-1n)-1n,U8e=2n**(48n-1n)-1n,H8e=2n**(56n-1n)-1n,j8e=2n**(64n-1n)-1n,z8e=2n**(72n-1n)-1n,J8e=2n**(80n-1n)-1n,q8e=2n**(88n-1n)-1n,G8e=2n**(96n-1n)-1n,V8e=2n**(104n-1n)-1n,W8e=2n**(112n-1n)-1n,K8e=2n**(120n-1n)-1n,X8e=2n**(128n-1n)-1n,Z8e=2n**(136n-1n)-1n,Y8e=2n**(144n-1n)-1n,Q8e=2n**(152n-1n)-1n,eAe=2n**(160n-1n)-1n,tAe=2n**(168n-1n)-1n,rAe=2n**(176n-1n)-1n,nAe=2n**(184n-1n)-1n,iAe=2n**(192n-1n)-1n,sAe=2n**(200n-1n)-1n,oAe=2n**(208n-1n)-1n,aAe=2n**(216n-1n)-1n,cAe=2n**(224n-1n)-1n,lAe=2n**(232n-1n)-1n,uAe=2n**(240n-1n)-1n,fAe=2n**(248n-1n)-1n,dAe=2n**(256n-1n)-1n,hAe=-(2n**(8n-1n)),pAe=-(2n**(16n-1n)),gAe=-(2n**(24n-1n)),mAe=-(2n**(32n-1n)),bAe=-(2n**(40n-1n)),yAe=-(2n**(48n-1n)),vAe=-(2n**(56n-1n)),wAe=-(2n**(64n-1n)),EAe=-(2n**(72n-1n)),AAe=-(2n**(80n-1n)),_Ae=-(2n**(88n-1n)),CAe=-(2n**(96n-1n)),SAe=-(2n**(104n-1n)),TAe=-(2n**(112n-1n)),NAe=-(2n**(120n-1n)),IAe=-(2n**(128n-1n)),xAe=-(2n**(136n-1n)),RAe=-(2n**(144n-1n)),PAe=-(2n**(152n-1n)),kAe=-(2n**(160n-1n)),OAe=-(2n**(168n-1n)),MAe=-(2n**(176n-1n)),DAe=-(2n**(184n-1n)),BAe=-(2n**(192n-1n)),FAe=-(2n**(200n-1n)),$Ae=-(2n**(208n-1n)),LAe=-(2n**(216n-1n)),UAe=-(2n**(224n-1n)),HAe=-(2n**(232n-1n)),jAe=-(2n**(240n-1n)),zAe=-(2n**(248n-1n)),JAe=-(2n**(256n-1n)),qAe=2n**8n-1n,GAe=2n**16n-1n,VAe=2n**24n-1n,WAe=2n**32n-1n,KAe=2n**40n-1n,XAe=2n**48n-1n,ZAe=2n**56n-1n,YAe=2n**64n-1n,QAe=2n**72n-1n,e4e=2n**80n-1n,t4e=2n**88n-1n,r4e=2n**96n-1n,n4e=2n**104n-1n,i4e=2n**112n-1n,s4e=2n**120n-1n,o4e=2n**128n-1n,a4e=2n**136n-1n,c4e=2n**144n-1n,l4e=2n**152n-1n,u4e=2n**160n-1n,f4e=2n**168n-1n,d4e=2n**176n-1n,h4e=2n**184n-1n,p4e=2n**192n-1n,g4e=2n**200n-1n,m4e=2n**208n-1n,b4e=2n**216n-1n,y4e=2n**224n-1n,v4e=2n**232n-1n,w4e=2n**240n-1n,E4e=2n**248n-1n,_V=2n**256n-1n;function U1(t){const{account:e,maxFeePerGas:r,maxPriorityFeePerGas:n,to:i}=t,s=e?so(e):void 0;if(s&&!qa(s.address))throw new kf({address:s.address});if(i&&!qa(i))throw new kf({address:i});if(r&&r>_V)throw new ub({maxFeePerGas:r});if(n&&r&&n>r)throw new fb({maxFeePerGas:r,maxPriorityFeePerGas:n})}class LI extends ue{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class M5 extends ue{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class CV extends ue{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${hs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class UI extends ue{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const HI={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Iy(t,e){const r={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?su(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?su(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?HI[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(r.authorizationList=SV(t.authorizationList)),r.yParity=(()=>
52{if(t.yParity)return Number(t.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}const A4e=Ny("transaction",Iy);function SV(t){return t.map(e=>({address:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function jI(t,e){const r=(t.transactions??[]).map(n=>typeof n=="string"?n:Iy(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:r,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const _4e=Ny("block",jI);async function Eh(t,{blockHash:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest",includeTransactions:i}={}){var l,u,f;const s=i??!1,o=r!==void 0?Bt(r):void 0;let a=null;if(e?a=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):a=await t.request({method:"eth_getBlockByNumber",params:[o||n,s]},{dedupe:!!o}),!a)throw new UI({blockHash:e,blockNumber:r});return(((f=(u=(l=t.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:f.format)||jI)(a,"getBlock")}async function D5(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function C4e(t,e){return zI(t,e)}async function zI(t,e){var s,o;const{block:r,chain:n=t.chain,request:i}=e||{};try{const a=((s=n==null?void 0:n.fees)==null?void 0:s.maxPriorityFeePerGas)??((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee);if(typeof a=="function"){const l=r||await Ar(t,Eh,"getBlock")({}),u=await a({block:l,client:t,request:i});if(u===null)throw new Error;return u}if(typeof a<"u")return a;const c=await t.request({method:"eth_maxPriorityFeePerGas"});return Rf(c)}catch{const[a,c]=await Promise.all([r?Promise.resolve(r):Ar(t,Eh,"getBlock")({}),Ar(t,D5,"getGasPrice")({})]);if(typeof a.baseFeePerGas!="bigint")throw new M5;const l=c-a.baseFeePerGas;return l<0n?0n:l}}async function S4e(t,e){return R3(t,e)}async function R3(t,e){var d,h;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var g,b;return typeof((g=n==null?void 0:n.fees)==null?void 0:g.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((b=n==null?void 0:n.fees)==null?void 0:b.baseFeeMultiplier)??1.2})();if(o<1)throw new LI;const c=10**(((d=o.toString().split(".")[1])==null?void 0:d.length)??0),l=g=>g*BigInt(Math.ceil(o*c))/BigInt(c),u=r||await Ar(t,Eh,"getBlock")({});if(typeof((h=n==null?void 0:n.fees)==null?void 0:h.estimateFeesPerGas)=="function"){const g=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(g!==null)return g}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new M5;const g=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await zI(t,{block:u,chain:n,request:i}),b=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??b+g,maxPriorityFeePerGas:g}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await Ar(t,D5,"getGasPrice")({}))}}async function TV(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,typeof n=="bigint"?Bt(n):r]},{dedupe:!!n});return su(i)}function JI(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>Vo(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>ei(s))}function qI(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>Vo(o)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(o=>Vo(o)):t.commitments,s=[];for(let o=0;o<n.length;o++){const a=n[o],c=i[o];s.push(Uint8Array.from(e.computeBlobKzgProof(a,c)))}return r==="bytes"?s:s.map(o=>ei(o))}function NV(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}function IV(t,e,r){return t&e^~t&r}function xV(t,e,r){return t&e^t&r^e&r}let GI=class extends pI{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Z2(this.buffer)}update(e){lb(this),e=C5(e),gh(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Z2(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){lb(this),hI(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,Pf(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let f=o;f<i;f++)r[f]=0;NV(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Z2(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const ol=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yi=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),vi=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),RV=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,019 bytes, line 52
52734187,3204031479,3329325298]),al=new Uint32Array(64);let PV=class extends GI{constructor(e=32){super(64,e,8,!1),this.A=ol[0]|0,this.B=ol[1]|0,this.C=ol[2]|0,this.D=ol[3]|0,this.E=ol[4]|0,this.F=ol[5]|0,this.G=ol[6]|0,this.H=ol[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)al[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=al[f-15],h=al[f-2],g=ea(d,7)^ea(d,18)^d>>>3,b=ea(h,17)^ea(h,19)^h>>>10;al[f]=b+al[f-7]+g+al[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=ea(a,6)^ea(a,11)^ea(a,25),h=u+d+IV(a,c,l)+RV[f]+al[f]|0,b=(ea(n,2)^ea(n,13)^ea(n,22))+xV(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Pf(al)}destroy(){this.set(0,0,0,0,0,0,0,0),Pf(this.buffer)}};const VI=(()=>dI(["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","0xf40e3585
525771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),kV=(()=>VI[0])(),OV=(()=>VI[1])(),cl=new Uint32Array(80),ll=new Uint32Array(80);let WI=class extends GI{constructor(e=64){super(128,e,16,!1),this.Ah=vi[0]|0,this.Al=vi[1]|0,this.Bh=vi[2]|0,this.Bl=vi[3]|0,this.Ch=vi[4]|0,this.Cl=vi[5]|0,this.Dh=vi[6]|0,this.Dl=vi[7]|0,this.Eh=vi[8]|0,this.El=vi[9]|0,this.Fh=vi[10]|0,this.Fl=vi[11]|0,this.Gh=vi[12]|0,this.Gl=vi[13]|0,this.Hh=vi[14]|0,this.Hl=vi[15]|0}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:f,Fl:d,Gh:h,Gl:g,Hh:b,Hl:w}=this;return[e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w]}set(e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=g|0,this.Hh=b|0,this.Hl=w|0}process(e,r){for(let R=0;R<16;R++,r+=4)cl[R]=e.getUint32(r),ll[R]=e.getUint32(r+=4);for(let R=16;R<80;R++){const D=cl[R-15]|0,O=ll[R-15]|0,M=ad(D,O,1)^ad(D,O,8)^YA(D,O,7),F=cd(D,O,1)^cd(D,O,8)^QA(D,O,7),H=cl[R-2]|0,U=ll[R-2]|0,G=ad(H,U,19)^Eg(H,U,61)^YA(H,U,6),N=cd(H,U,19)^Ag(H,U,61)^QA(H,U,6),A=Zq(F,N,ll[R-7],ll[R-16]),v=Yq(A,M,G,cl[R-7],cl[R-16]);cl[R]=v|0,ll[R]=A|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:f,El:d,Fh:h,Fl:g,Gh:b,Gl:w,Hh:x,Hl:k}=this;for(let R=0;R<80;R++){const D=ad(f,d,14)^ad(f,d,18)^Eg(f,d,41),O=cd(f,d,14)^cd(f,d,18)^Ag(f,d,41),M=f&h^~f&b,F=d&g^~d&w,H=Qq(k,O,F,OV[R],ll[R]),U=eG(H,x,D,M,kV[R],cl[R]),G=H|0,N=ad(n,i,28)^Eg(n,i,34)^Eg(n,i,39),A=cd(n,i,28)^Ag(n,i,34)^Ag(n,i,39),v=n&s^n&a^s&a,p=i&o^i&c^o&c;x=b|0,k=w|0,b=h|0,w=g|0,h=f|0,g=d|0,{h:f,l:d}=ic(l|0,u|0,U|0,G|0),l=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=Kq(G,A,p);n=Xq(m,U,N,v),i=m|0}({h:n,l:i}=ic(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=ic(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=ic(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=ic(this.Dh|0,this.Dl|0,l|0,u|0),{h:f,l:d}=ic(this.Eh|0,this.El|0,f|0,d|0),{h,l:g}=ic(this.Fh|0,this.Fl|0,h|0,g|0),{h:b,l:w}=ic(this.Gh|0,this.Gl|0,b|0,w|0),{h:x,l:k}=ic(this.Hh|0,this.Hl|0,x|0,k|0),this.set(n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k)}roundClean(){Pf(cl,ll)}destroy(){Pf(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},MV=class extends WI{constructor(){super(48),this.Ah=yi[0]|0,this.Al=yi[1]|0,this.Bh=yi[2]|0,this.Bl=yi[3]|0,this.Ch=yi[4]|0,this.Cl=yi[5]|0,this.Dh=yi[6]|0,this.Dl=yi[7]|0,this.Eh=yi[8]|0,this.El=yi[9]|0,this.Fh=yi[10]|0,this.Fl=yi[11]|0,this.Gh=yi[12]|0,this.Gl=yi[13]|0,this.Hh=yi[14]|0,this.Hl=yi[15]|0}};const DV=_y(()=>new PV),R4e=_y(()=>new WI),P4e=_y(()=>new MV),BV=DV;function FV(t,e){const r=e||"hex",n=BV(qc(t,{strict:!1})?x1(t):t);return r==="bytes"?n:Gc(n)}function $V(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=FV(e,"bytes");return i.set([r],0),n==="bytes"?i:ei(i)}function LV(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const s of e)i.push($V({commitment:s,to:n,version:r}));return i}const f4=6,KI=32,B5=4096,XI=KI*B5,d4=XI*f4-1-1*B5*f4,UV=1;class HV extends ue{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class jV extends ue{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class k4e extends ue{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class O4e extends ue{constructor({hash:e,version:r}){super(`Versioned hash "${e}
52" version is invalid.`,{metaMessages:[`Expected: ${UV}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function zV(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Vo(t.data):t.data,n=qn(r);if(!n)throw new jV;if(n>d4)throw new HV({maxSize:d4,size:n});const i=[];let s=!0,o=0;for(;s;){const a=x5(new Uint8Array(XI));let c=0;for(;c<B5;){const l=r.slice(o,o+(KI-1));if(a.pushByte(0),a.pushBytes(l),l.length<31){a.pushByte(128),s=!1;break}c++,o+=31}i.push(a)}return e==="bytes"?i.map(a=>a.bytes):i.map(a=>ei(a.bytes))}function JV(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??zV({data:e,to:n}),s=t.commitments??JI({blobs:i,kzg:r,to:n}),o=t.proofs??qI({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let c=0;c<i.length;c++)a.push({blob:i[c],commitment:s[c],proof:o[c]});return a}function qV(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new QG({transaction:t})}function ZI(t,{docsPath:e,...r}){const n=(()=>{const i=O5(t,r);return i instanceof Sy?t:i})();return new eV(n,{docsPath:e,...r})}async function F5(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return su(e)}async function GV(t,e){var H,U,G,N,A;const{account:r=t.account,accessList:n,authorizationList:i,chain:s=t.chain,blobVersionedHashes:o,blobs:a,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:g,nonceManager:b,to:w,type:x,value:k,...R}=e,D=await(async()=>{if(!r||!b||typeof g<"u")return g;const v=so(r),p=s?s.id:await Ar(t,F5,"getChainId")({});return await b.consume({address:v.address,chainId:p,client:t})})();U1(e);const O=(U=(H=s==null?void 0:s.formatters)==null?void 0:H.transactionRequest)==null?void 0:U.format,F=(O||L1)({...Ty(R,{format:O}),account:r?so(r):void 0,accessList:n,authorizationList:i,blobs:a,blobVersionedHashes:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:f,maxFeePerGas:d,maxPriorityFeePerGas:h,nonce:D,to:w,type:x,value:k},"fillTransaction");try{const v=await t.request({method:"eth_fillTransaction",params:[F]}),m=(((N=(G=s==null?void 0:s.formatters)==null?void 0:G.transaction)==null?void 0:N.format)||Iy)(v.tx);delete m.blockHash,delete m.blockNumber,delete m.r,delete m.s,delete m.transactionIndex,delete m.v,delete m.yParity,m.data=m.input,m.gas&&(m.gas=e.gas??m.gas),m.gasPrice&&(m.gasPrice=e.gasPrice??m.gasPrice),m.maxFeePerBlobGas&&(m.maxFeePerBlobGas=e.maxFeePerBlobGas??m.maxFeePerBlobGas),m.maxFeePerGas&&(m.maxFeePerGas=e.maxFeePerGas??m.maxFeePerGas),m.maxPriorityFeePerGas&&(m.maxPriorityFeePerGas=e.maxPriorityFeePerGas??m.maxPriorityFeePerGas),m.nonce&&(m.nonce=e.nonce??m.nonce);const y=await(async()=>{var E,C;if(typeof((E=s==null?void 0:s.fees)==null?void 0:E.baseFeeMultiplier)=="function"){const S=await Ar(t,Eh,"getBlock")({});return s.fees.baseFeeMultiplier({block:S,client:t,request:e})}return((C=s==null?void 0:s.fees)==null?void 0:C.baseFeeMultiplier)??1.2})();if(y<1)throw new LI;const I=10**(((A=y.toString().split(".")[1])==null?void 0:A.length)??0),_=E=>E*BigInt(Math.ceil(y*I))/BigInt(I);return m.maxFeePerGas&&!e.maxFeePerGas&&(m.maxFeePerGas=_(m.maxFeePerGas)),m.gasPrice&&!e.gasPrice&&(m.gasPrice=_(m.gasPrice)),{raw:v.raw,transaction:{from:F.from,...m}}}catch(v){throw ZI(v,{...e,chain:t.chain})}}const YI=["blobVersionedHashes","chainId","fees","gas","nonce","type"],h4=new Map,ev=new R1(128);async function $5(t,e){var D,O,M;let r=e;r.account??(r.account=t.account),r.parameters??(r.parameters=YI);const{account:n,chain:i=t.chain,nonceManager:s,parameters:o}=r,a=(()=>
52{if(typeof(i==null?void 0:i.prepareTransactionRequest)=="function")return{fn:i.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(i==null?void 0:i.prepareTransactionRequest))return{fn:i.prepareTransactionRequest[0],runAt:i.prepareTransactionRequest[1].runAt}})();let c;async function l(){return c||(typeof r.chainId<"u"?r.chainId:i?i.id:(c=await Ar(t,F5,"getChainId")({}),c))}const u=n&&so(n);let f=r.nonce;if(o.includes("nonce")&&typeof f>"u"&&u&&s){const F=await l();f=await s.consume({address:u.address,chainId:F,client:t})}a!=null&&a.fn&&((D=a.runAt)!=null&&D.includes("beforeFillTransaction"))&&(r=await a.fn({...r,chain:i},{phase:"beforeFillTransaction"}),f??(f=r.nonce));const h=(()=>(o.includes("blobVersionedHashes")||o.includes("sidecars"))&&r.kzg&&r.blobs||ev.get(t.uid)===!1||!["fees","gas"].some(H=>o.includes(H))?!1:!!(o.includes("chainId")&&typeof r.chainId!="number"||o.includes("nonce")&&typeof f!="number"||o.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||o.includes("gas")&&typeof r.gas!="bigint"))()?await Ar(t,GV,"fillTransaction")({...r,nonce:f}).then(F=>{const{chainId:H,from:U,gas:G,gasPrice:N,nonce:A,maxFeePerBlobGas:v,maxFeePerGas:p,maxPriorityFeePerGas:m,type:y,...T}=F.transaction;return ev.set(t.uid,!0),{...r,...U?{from:U}:{},...y&&!r.type?{type:y}:{},...typeof H<"u"?{chainId:H}:{},...typeof G<"u"?{gas:G}:{},...typeof N<"u"?{gasPrice:N}:{},...typeof A<"u"?{nonce:A}:{},...typeof v<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerBlobGas:v}:{},...typeof p<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerGas:p}:{},...typeof m<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxPriorityFeePerGas:m}:{}
52,..."nonceKey"in T&&typeof T.nonceKey<"u"?{nonceKey:T.nonceKey}:{},..."keyAuthorization"in T&&typeof T.keyAuthorization<"u"&&T.keyAuthorization!==null&&!("keyAuthorization"in r)?{keyAuthorization:T.keyAuthorization}:{},..."feePayerSignature"in T&&typeof T.feePayerSignature<"u"&&T.feePayerSignature!==null?{feePayerSignature:T.feePayerSignature}:{}}}).catch(F=>{var N,A;const H=F;if(H.name!=="TransactionExecutionError")return r;if((N=H.walk)==null?void 0:N.call(H,v=>v.name==="ExecutionRevertedError"))throw F;return((A=H.walk)==null?void 0:A.call(H,v=>{var m;const p=v;return p.name==="MethodNotFoundRpcError"||p.name==="MethodNotSupportedRpcError"||((m=p.message)==null?void 0:m.includes("eth_fillTransaction is not available"))}))&&ev.set(t.uid,!1),r}):r;f??(f=h.nonce),r={...h,...u?{from:u==null?void 0:u.address}:{},...f?{nonce:f}:{}};const{blobs:g,gas:b,kzg:w,type:x}=r;a!=null&&a.fn&&((O=a.runAt)!=null&&O.includes("beforeFillParameters"))&&(r=await a.fn({...r,chain:i},{phase:"beforeFillParameters"}));let k;async function R(){return k||(k=await Ar(t,Eh,"getBlock")({blockTag:"latest"}),k)}if(o.includes("nonce")&&typeof f>"u"&&u&&!s&&(r.nonce=await Ar(t,TV,"getTransactionCount")({address:u.address,blockTag:"pending"})),(o.includes("blobVersionedHashes")||o.includes("sidecars"))&&g&&w){const F=JI({blobs:g,kzg:w});if(o.includes("blobVersionedHashes")){const H=LV({commitments:F,to:"hex"});r.blobVersionedHashes=H}if(o.includes("sidecars")){const H=qI({blobs:g,commitments:F,kzg:w}),U=JV({blobs:g,commitments:F,proofs:H,to:"hex"});r.sidecars=U}}if(o.includes("chainId")&&(r.chainId=await l()),(o.includes("fees")||o.includes("type"))&&typeof x>"u")try{r.type=qV(r)}catch{let F=h4.get(t.uid);if(typeof F>"u"){const H=await R();F=typeof(H==null?void 0:H.baseFeePerGas)=="bigint",h4.set(t.uid,F)}r.type=F?"eip1559":"legacy"}
52if(o.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){const F=await R(),{maxFeePerGas:H,maxPriorityFeePerGas:U}=await R3(t,{block:F,chain:i,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<U)throw new CV({maxPriorityFeePerGas:U});r.maxPriorityFeePerGas=U,r.maxFeePerGas=H}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new M5;if(typeof r.gasPrice>"u"){const F=await R(),{gasPrice:H}=await R3(t,{block:F,chain:i,request:r,type:"legacy"});r.gasPrice=H}}return o.includes("gas")&&typeof b>"u"&&(r.gas=await Ar(t,QI,"estimateGas")({...r,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),a!=null&&a.fn&&((M=a.runAt)!=null&&M.includes("afterFillParameters"))&&(r=await a.fn({...r,chain:i},{phase:"afterFillParameters"})),U1(r),delete r.parameters,r}async function QI(t,e){var o,a,c;const{account:r=t.account,prepare:n=!0}=e,i=r?so(r):void 0,s=(()=>{if(Array.isArray(n))return n;if((i==null?void 0:i.type)!=="local")return["blobVersionedHashes"]})();try{const l=await(async()=>{if(e.to)return e.to;if(e.authorizationList&&e.authorizationList.length>0)return await FI({authorization:e.authorizationList[0]}).catch(()=>{throw new ue("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:f,blobs:d,blobVersionedHashes:h,blockNumber:g,blockTag:b,data:w,gas:x,gasPrice:k,maxFeePerBlobGas:R,maxFeePerGas:D,maxPriorityFeePerGas:O,nonce:M,value:F,stateOverride:H,...U}=n?await $5(t,{...e,parameters:s,to:l}):e;if(x&&e.gas!==x)return x;const N=(typeof g=="bigint"?Bt(g):void 0)||b,A=$I(H);U1(e);const v=(c=(a=(o=t.chain)==null?void 0:o.formatters)==null?void 0:a.transactionRequest)==null?void 0:c.format,m=(v||L1)({...Ty(U,{format:v}),account:i,accessList:u,authorizationList:f,blobs:d,blobVersionedHashes:h,data:w,gasPrice:k,maxFeePerBlobGas:R,maxFeePerGas:D,maxPriorityFeePerGas:O,nonce:M,to:l,value:F},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:A?[m,N??t.experimental_blockTag??"latest",A]:N?[m,N]:[m]}))}catch(l){throw vV(l,{...e,account:i,chain:t.chain})}}function VV(t,e){if(!qa(t,{strict:!1}))throw new kf({address:t});if(!qa(e,{strict:!1}))throw new kf({address:e});return t.toLowerCase()===e.toLowerCase()}function L5(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,blockTimestamp:t.blockTimestamp?BigInt(t.blockTimestamp):t.blockTimestamp===null?null:void 0,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const p4="/docs/contract/decodeEventLog";function g4(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new Tq({docsPath:p4});const c=e.find(x=>x.type==="event"&&o===S5(Ja(x)));if(!(c&&"name"in c)||c.type!=="event")throw new Nq(o,{docsPath:p4});const{name:l,inputs:u}=c,f=u==null?void 0:u.some(x=>!("name"in x&&x.name)),d=f?[]:{},h=u.map((x,k)=>[x,k]).filter(([x])=>"indexed"in x&&x.indexed),g=[];for(let x=0;x<h.length;x++){const[k,R]=h[x],D=a[x];if(!D){if(s)throw new Rq({abiItem:c,param:k});g.push([k,R]);continue}d[f?R:k.name||R]=WV({param:k,value:D})}const b=u.filter(x=>!("indexed"in x&&x.indexed)),w=s?b:[...g.map(([x])=>x),...b];if(w.length>0){if(r&&r!=="0x")try{const x=D1(w,r);if(x){let k=0;if(!s)for(const[R,D]of g)d[f?D:R.name||D]=x[k++];if(f)for(let R=0;R<u.length;R++)d[R]===void 0&&k<x.length&&(d[R]=x[k++]);else for(let R=0;R<b.length;R++)d[b[R].name]=x[k++]}}catch(x){if(s)throw x instanceof iI||x instanceof TI?new WA({abiItem:c,data:r,params:w,size:qn(r)}):x}else if(s)throw new WA({abiItem:c,data:"0x",params:w,size:0})}return{eventName:l,args:Object.values(d).length>0?d:void 0}}function WV({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(D1([t],e)||[])[0]}function KV(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,s=(()=>
52{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})(),o=e.filter(a=>a.type==="event").map(a=>({abi:a,selector:S5(a)}));return n.map(a=>{var d;const c=typeof a.blockNumber=="string"?L5(a):a,l=o.filter(h=>c.topics[0]===h.selector);if(l.length===0)return null;let u,f;for(const h of l)try{u=g4({...c,abi:[h.abi],strict:!0}),f=h;break}catch{}if(!u&&!i){f=l[0];try{u=g4({data:c.data,topics:c.topics,abi:[f.abi],strict:!1})}catch{const h=(d=f.abi.inputs)==null?void 0:d.some(g=>!("name"in g&&g.name));return{...c,args:h?[]:{},eventName:f.abi.name}}}return!u||!f||s&&!s.includes(u.eventName)||!XV({args:u.args,inputs:f.abi.inputs,matchArgs:r})?null:{...u,...c}}).filter(Boolean)}function XV(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(s,o,a){try{return s.type==="address"?VV(o,a):s.type==="string"||s.type==="bytes"?ou(x1(o))===a:o===a}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((s,o)=>{if(s==null)return!0;const a=r[o];return a?(Array.isArray(s)?s:[s]).some(l=>i(a,l,e[o])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,o])=>{if(o==null)return!0;const a=r.find(l=>
vendor: 4,389 bytes, line 52
52l.name===s);return a?(Array.isArray(o)?o:[o]).some(l=>i(a,l,e[s])):!1}):!1}const tv="/docs/contract/decodeFunctionResult";function H1(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=M1({abi:e,args:r,name:n});if(!a)throw new ph(n,{docsPath:tv});s=a}if(s.type!=="function")throw new ph(void 0,{docsPath:tv});if(!s.outputs)throw new oI(s.name,{docsPath:tv});const o=D1(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const U5=BigInt(0),P3=BigInt(1);function H5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function j5(t){if(!H5(t))throw new Error("Uint8Array expected")}function M4e(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function D4e(t){const e=t.toString(16);return e.length&1?"0"+e:e}function ex(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?U5:BigInt("0x"+t)}const tx=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",ZV=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function rx(t){if(j5(t),tx)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=ZV[t[r]];return e}const sc={_0:48,_9:57,A:65,F:70,a:97,f:102};function m4(t){if(t>=sc._0&&t<=sc._9)return t-sc._0;if(t>=sc.A&&t<=sc.F)return t-(sc.A-10);if(t>=sc.a&&t<=sc.f)return t-(sc.a-10)}function nx(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(tx)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=m4(t.charCodeAt(s)),a=m4(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function B4e(t){return ex(rx(t))}function F4e(t){return j5(t),ex(rx(Uint8Array.from(t).reverse()))}function YV(t,e){return nx(t.toString(16).padStart(e*2,"0"))}function $4e(t,e){return YV(t,e).reverse()}function L4e(t,e,r){let n;if(typeof e=="string")try{n=nx(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(H5(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function QV(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];j5(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}function eW(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function U4e(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}const rv=t=>typeof t=="bigint"&&U5<=t;function tW(t,e,r){return rv(t)&&rv(e)&&rv(r)&&e<=t&&t<r}function H4e(t,e,r,n){if(!tW(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function j4e(t){let e;for(e=0;t>U5;t>>=P3,e+=1);return e}const z4e=t=>(P3<<BigInt(t))-P3,nv=t=>new Uint8Array(t),b4=t=>Uint8Array.from(t);function J4e(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=nv(t),i=nv(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...f)=>r(i,n,...f),c=(f=nv(0))=>{i=a(b4([0]),f),n=a(),f.length!==0&&(i=a(b4([1]),f),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<e;){n=a();const h=n.slice();d.push(h),f+=n.length}return QV(...d)};return(f,d)=>{o(),c(f);let h;for(;!(h=d(l()));)c();return o(),h}}const rW={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||H5(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function q4e(t,e,r={}){const n=(i,s,o)=>{const a=rW[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invali
52d. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}function G4e(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const nW="0.1.1";function iW(){return nW}let ki=class mc extends Error{static setStaticOptions(e){mc.prototype.docsOrigin=e.docsOrigin,mc.prototype.showVersion=e.showVersion,mc.prototype.version=e.version}constructor(e,r={}){const n=(()=>{var u;if(r.cause instanceof mc){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:(u=r.cause)!=null&&u.message?r.cause.message:r.details})(),i=(()=>r.cause instanceof mc&&r.cause.docsPath||r.docsPath)(),s=r.docsOrigin??mc.prototype.docsOrigin,o=`${s}${i??""}`,a=!!(r.version??mc.prototype.showVersion),c=r.version??mc.prototype.version,l=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i||a?["",n?`Details: ${n}`:void 0,i?`See: ${o}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(` 53`);super(l,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=r.cause,this.details=n,this.docs=o,this.docsOrigin=s,this.docsPath=i,this.shortMessage=e,this.showVersion=a,this.version=c}walk(e){return ix(this,e)}};Object.defineProperty(ki,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${iW()}`}});ki.setStaticOptions(ki.defaultStaticOptions);function ix(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?ix(t.cause,e):e?null:t}function Jh(t,e){if(Ah(t)>e)throw new wW({givenSize:Ah(t),maxSize:e})}function sW(t,e){if(typeof e=="number"&&e>0&&e>Ah(t)-1)throw new ux({offset:e,position:"start",size:Ah(t)})}function oW(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ah(t)!==r-e)throw new ux({offset:r,position:"end",size:Ah(t)})}const oc={zero:48,nine:57,A:65,F:70,a:97,f:102};function y4(t){if(t>=oc.zero&&t<=oc.nine)return t-oc.zero;if(t>=oc.A&&t<=oc.F)return t-(oc.A-10);if(t>=oc.a&&t<=oc.f)return t-(oc.a-10)}function aW(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;if(t.length>n)throw new EW({size:t.length,targetSize:n,type:"Bytes"});const i=new Uint8Array(n);for(let s=0;s<n;s++){const o=r==="right";i[o?s:n-s-1]=t[o?s:t.length-s-1]}return i}function sx(t,e={}){const{dir:r="left"}=e;let n=t,i=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)i++;return n=r==="left"?n.slice(i):n.slice(0,n.length-i),n}function xy(t,e){if(Ch(t)>e)throw new NW({givenSize:Ch(t),maxSize:e})}function cW(t,e){if(typeof e=="number"&&e>0&&e>Ch(t)-1)throw new px({offset:e,position:"start",size:Ch(t)})}function lW(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ch(t)!==r-e)throw new px({offset:r,position:"end",size:Ch(t)})}function ox(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;const i=t.replace("0x","");if(i.length>n*2)throw new IW({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function uW(t,e={}){const{dir:r="left"}=e;let n=t.replace("0x",""),i=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)i++;return n=r==="left"?n.slice(i):n.slice(0,n.length-i),n==="0"?"0x":r==="right"&&n.length%2===1?`0x${n}0`:`0x${n}`}const fW="#__bigint";function ax(t,e,r){return JSON.stringify(t,(n,i)=>typeof e=="function"?e(n,i):typeof i=="bigint"?i.toString()+fW:i,r)}const dW=new TextDecoder,hW=new TextEncoder;function pW(t){if(!(t instanceof Uint8Array)){if(!t)throw new _g(t);if(typeof t!="object")throw new _g(t);if(!("BYTES_PER_ELEMENT"in t))throw new _g(t);if(t.BYTES_PER_ELEMENT!==1||t.constructor.name!=="Uint8Array")throw new _g(t)}}function V4e(...t){let e=0;for(const n of t)e+=n.length;
53const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}function W4e(t){return t instanceof Uint8Array?t:typeof t=="string"?cx(t):gW(t)}function gW(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function cx(t,e={}){const{size:r}=e;let n=t;r&&(xy(t,r),n=dx(t,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const l=y4(i.charCodeAt(c++)),u=y4(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new ki(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);o[a]=l<<4|u}return o}function K4e(t,e={}){const{size:r}=e,n=hW.encode(t);return typeof r=="number"?(Jh(n,r),mW(n,r)):n}function X4e(t,e){return eW(t,e)}function mW(t,e){return aW(t,{dir:"right",size:e})}function bW(t){return crypto.getRandomValues(new Uint8Array(t))}function Ah(t){return t.length}function Z4e(t,e,r,n={}){const{strict:i}=n;sW(t,e);const s=t.slice(e,r);return i&&oW(s,e,r),s}function Y4e(t,e={}){const{size:r}=e;typeof r<"u"&&Jh(t,r);const n=_h(t,e);return hx(n,e)}function Q4e(t,e={}){const{size:r}=e;let n=t;if(typeof r<"u"&&(Jh(n,r),n=yW(n)),n.length>1||n[0]>1)throw new vW(n);return!!n[0]}function e_e(t,e={}){const{size:r}=e;typeof r<"u"&&Jh(t,r);const n=_h(t,e);
53return SW(n,e)}function t_e(t,e={}){const{size:r}=e;let n=t;return typeof r<"u"&&(Jh(n,r),n=lx(n)),dW.decode(n)}function yW(t){return sx(t,{dir:"left"})}function lx(t){return sx(t,{dir:"right"})}function r_e(t){try{return pW(t),!0}catch{return!1}}class vW extends ki{constructor(e){super(`Bytes value \`${e}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}let _g=class extends ki{constructor(e){super(`Value \`${typeof e=="object"?ax(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}},wW=class extends ki{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},ux=class extends ki{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}},EW=class extends ki{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const AW=new TextEncoder,_W=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function CW(t,e={}){const{strict:r=!1}=e;if(!t)throw new v4(t);if(typeof t!="string")throw new v4(t);if(r&&!/^0x[0-9a-fA-F]*$/.test(t))throw new w4(t);if(!t.startsWith("0x"))throw new w4(t)}function a_e(...t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function c_e(t){return t instanceof Uint8Array?_h(t):Array.isArray(t)?_h(new Uint8Array(t)):t}function l_e(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(xy(r,e.size),fx(r,e.size)):r}function _h(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=_W[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(xy(n,e.size),dx(n,e.size)):n}function Tc(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const l=typeof t=="bigint"?"n":"";throw new TW({max:s?`${s}${l}`:void 0,min:`${o}${l}`,signed:r,size:n,value:`${t}${l}`})}const c=`0x${(r&&i<0?BigInt.asUintN(n*8,BigInt(i)):i).toString(16)}`;return n?fx(c,n):c}function u_e(t,e={}){return _h(AW.encode(t),e)}function fx(t,e){return ox(t,{dir:"left",size:e})}function dx(t,e){return ox(t,{dir:"right",size:e})}function f_e(t){return _h(bW(t))}function d_e(t,e,r,n={}){const{strict:i}=n;cW(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return i&&lW(s,e,r),s}function Ch(t){return Math.ceil((t.length-2)/2)}function h_e(t){return uW(t,{dir:"left"})}function hx(t,e={}){const{signed:r}=e;e.size&&xy(t,e.size);const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n)-1n,o=s>>1n;return n<=o?n:n-s-1n}function SW(t,e={}){const{signed:r,size:n}=e;return Number(!r&&!n?t:hx(t,e))}function p_e(t,e={}){const{size:r}=e;let n=cx(t);return r&&(Jh(n,r),n=lx(n)),new TextDecoder().decode(n)}function g_e(t,e={}){const{strict:r=!1}=e;try{return CW(t,{strict:r}),!0}catch{return!1}}let TW=class extends ki{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${n?" signed":" unsigned"} integer range ${e?`(\`${r}\` to \`${e}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},v4=class extends ki{constructor(e){super(`Value \`${typeof e=="object"?ax(e):e}\` of type \`${typeof e}
vendor: 5,619 bytes, line 53
53\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}},w4=class extends ki{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}};class v_e extends ki{constructor(e){super(`Hex value \`"${e}"\` is an odd length (${e.length-2} nibbles).`,{metaMessages:["It must be an even length."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidLengthError"})}}let NW=class extends ki{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},px=class extends ki{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},IW=class extends ki{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};function xW(t){return{address:t.address,amount:Tc(t.amount),index:Tc(t.index),validatorIndex:Tc(t.validatorIndex)}}function RW(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:Tc(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:Tc(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient},...typeof t.gasLimit=="bigint"&&{gasLimit:Tc(t.gasLimit)},...typeof t.number=="bigint"&&{number:Tc(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:Tc(t.prevRandao)},...typeof t.time=="bigint"&&{time:Tc(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(xW)}}}const db=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],k3=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],gx=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],mx=[...gx,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],PW=[...gx,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],E4=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],A4=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],__e=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],C_e=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
vendor: 7,203 bytes, line 53
53],Cg=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],S_e=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],T_e=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{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:"values",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:"value",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"}
53],N_e=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],I_e=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}],kW="0x82ad56cb",OW="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
53602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",MW="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",x_e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
53603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",DW="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
53150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class O3 extends ue{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class BW extends ue{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} â ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} â ${e.name}`],name:"ChainMismatchError"})}}class FW extends ue{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` 54`),{name:"ChainNotFoundError"})}}class bx extends ue{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class R_e extends ue{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}
54" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const iv="/docs/contract/encodeDeployData";function yx(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new Eq({docsPath:iv});if(!("inputs"in i))throw new GA({docsPath:iv});if(!i.inputs||i.inputs.length===0)throw new GA({docsPath:iv});const s=Cy(i.inputs,r);return k1([n,s])}function Ry({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new O3({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new O3({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function $W(t,{docsPath:e,...r}){const n=(()=>{const i=O5(t,r);return i instanceof Sy?t:i})();return new nV(n,{docsPath:e,...r})}function vx(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const sv=new Map;function wx({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=c();o();const f=u.map(({args:d})=>d);f.length!==0&&t(f).then(d=>{i&&Array.isArray(d)&&d.sort(i);for(let h=0;h<u.length;h++){const{resolve:g}=u[h];g==null||g([d[h],d])}}).catch(d=>{for(let h=0;h<u.length;h++){const{reject:g}=u[h];g==null||g(d)}})},o=()=>sv.delete(e),a=()=>c().map(({args:u})=>u),c=()=>sv.get(e)||[],l=u=>sv.set(e,[...c(),u]);return{flush:o,async schedule(u){const{promise:f,resolve:d,reject:h}=vx();return(r==null?void 0:r([...a(),u]))&&s(),c().length>0?(l({args:u,resolve:d,reject:h}),f):(l({args:u,resolve:d,reject:h}),setTimeout(s,n),f)}}}async function z5(t,e){var v,p,m,y;const{account:r=t.account,authorizationList:n,batch:i=!!((v=t.batch)!=null&&v.multicall),blockNumber:s,blockTag:o=t.experimental_blockTag??"latest",accessList:a,blobs:c,blockOverrides:l,code:u,data:f,factory:d,factoryData:h,gas:g,gasPrice:b,maxFeePerBlobGas:w,maxFeePerGas:x,maxPriorityFeePerGas:k,nonce:R,to:D,value:O,stateOverride:M,...F}=e,H=r?so(r):void 0;if(u&&(d||h))throw new ue("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&D)throw new ue("Cannot provide both `code` & `to` as parameters.");const U=u&&f,G=d&&h&&D&&f,N=U||G,A=(()=>U?Ex({code:u,data:f}):G?HW({data:f,factory:d,factoryData:h,to:D}):f)();try{U1(e);const I=(typeof s=="bigint"?Bt(s):void 0)||o,_=l?RW(l):void 0,E=$I(M),C=(y=(m=(p=t.chain)==null?void 0:p.formatters)==null?void 0:m.transactionRequest)==null?void 0:y.format,B=(C||L1)({...Ty(F,{format:C}),accessList:a,account:H,authorizationList:n,blobs:c,data:A,gas:g,gasPrice:b,maxFeePerBlobGas:w,maxFeePerGas:x,maxPriorityFeePerGas:k,nonce:R,to:N?void 0:D,value:O},"call");if(i&&LW({request:B})&&!E&&!_)try{return await UW(t,{...B,blockNumber:s,blockTag:o})}catch(q){if(!(q instanceof bx)&&!(q instanceof O3))throw q}const $=(()=>{const q=[B,I];return E&&_?[...q,E,_]:E?[...q,E]:_?[...q,{},_]:q})(),P=await t.request({method:"eth_call",params:$});return P==="0x"?{data:void 0}:{data:P}}catch(T){const I=jW(T),{offchainLookup:_,offchainLookupSignature:E}=await Hn(()=>import("./ccip-6b409edf.js"),[]);if(t.ccipRead!==!1&&(I==null?void 0:I.slice(0,10))===E&&D)return{data:await _(t,{data:I,to:D})};throw N&&(I==null?void 0:I.slice(0,10))==="0x101bb98d"?new oV({factory:d}):$W(T,{...e,account:H,chain:t.chain})}}function LW({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(kW)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function UW(t,e){var b;const{batchSize:r=1024,deployless:n=!1,wait:i=0}=typeof((b=t.batch)==null?void 0:b.multicall)=="object"?t.batch.multicall:{},{blockNumber:s,blockTag:o=t.experimental_blockTag??"latest",data:a,to:c}=e,l=(()=>{if(n)return null;if(e.multicallAddress)return e.multicallAddress;if(t.chain)return Ry({blockNumber:s,chain:t.chain,contract:"multicall3"});throw new bx})(),f=(typeof s=="bigint"?Bt(s):void 0)||o,{schedule:d}=wx({id:`${t.uid}.${f}`,wait:i,shouldSplitBatch(w){return w.reduce((k,{data:R})=>k+(R.length-2),0)>r*2},fn:async w=>{const x=w.map(D=>({allowFailure:!0,callData:D.data,target:D.to})),k=zh({abi:db,args:[x],functionName:"aggregate3"}),R=await t.request({method:"eth_call",params:[{...l===null?{data:Ex({code:DW,data:k})}:{to:l,data:k}},f]});return H1({abi:db,args:[x],functionName:"aggregate3",data:R||"0x"})}}),[{returnData:h,success:g}]=await d({data:a,to:c});if(!g)throw new OI({data:h});return h==="0x"?{data:void 0}:{data:h}}function Ex(t){const{code:e,data:r}=t;return yx({abi:tI(["constructor(bytes, bytes)"]),bytecode:OW,args:[e,r]})}function HW(t){const{data:e,factory:r,factoryData:n,to:i}=t;return yx({abi:tI(["constructor(address, bytes, address, bytes)"]),bytecode:MW,args:[i,e,r,n]})}function jW(t){var r;if(!(t instanceof ue))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function Qp(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=zh({abi:r,args:i,functionName:s});try{const{data:c}=await Ar(t,z5,"call")({...o,data:a,to:n});return H1({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw MI(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}const ov=new Map,_4=new Map;let zW=0;function hb(t,e,r){const n=++zW,i=()=>ov.get(t)||[],s=()=>{const u=i();ov.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=i();if(!u.some(d=>d.id===n))return;const f=_4.get(t);if(u.length===1&&f){const d=f();
54d instanceof Promise&&d.catch(()=>{})}s()},a=i();if(ov.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{var h,g;const d=i();if(d.length!==0)for(const b of d)(g=(h=b.fns)[u])==null||g.call(h,...f)};const l=r(c);return typeof l=="function"&&_4.set(t,l),o}async function pb(t){return new Promise(e=>setTimeout(e,t))}function Ax(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await pb(c);const l=async()=>{i&&(await t({unpoll:s}),await pb(n),l())};l()})(),s}const JW=new Map,qW=new Map;function GW(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,JW),n=e(t,qW);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function VW(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=GW(e),i=n.response.get();if(i&&r>0&&Date.now()-i.created.getTime()<r)return i.data;let s=n.promise.get();s||(s=t(),n.promise.set(s));try{const o=await s;return n.response.set({created:new Date,data:o}),o}finally{n.promise.clear()}}const WW=t=>`blockNumber.${t}`;async function KW(t,{cacheTime:e=t.cacheTime}={}){const r=await VW(()=>t.request({method:"eth_blockNumber"}),{cacheKey:WW(t.uid),cacheTime:e});return BigInt(r)}async function XW(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(s=>L5(s));return!("abi"in e)||!e.abi?i:KV({abi:e.abi,logs:i,strict:r})}async function ZW(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}class J5 extends ue{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` 55`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class av extends ue{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function YW({chain:t,currentChainId:e}){if(!t)throw new FW;if(e!==t.id)throw new BW({chain:t,currentChainId:e})}async function QW(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const cv=new R1(128);async function _x(t,e){var D,O,M,F,H;const{account:r=t.account,assertChainId:n=!0,chain:i=t.chain,accessList:s,authorizationList:o,blobs:a,data:c,dataSuffix:l=typeof t.dataSuffix=="string"?t.dataSuffix:(D=t.dataSuffix)==null?void 0:D.value,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:b,type:w,value:x,...k}=e;if(typeof r>"u")throw new J5({docsPath:"/docs/actions/wallet/sendTransaction"});const R=r?so(r):null;try{U1(e);const U=await(async()=>{if(e.to)return e.to;if(e.to!==null&&o&&o.length>0)return await FI({authorization:o[0]}).catch(()=>{throw new ue("`to` is required. Could not infer from `authorizationList`.")})})();if((R==null?void 0:R.type)==="json-rpc"||R===null){let G;i!==null&&(G=await Ar(t,F5,"getChainId")({}),n&&YW({currentChainId:G,chain:i}));const N=(F=(M=(O=t.chain)==null?void 0:O.formatters)==null?void 0:M.transactionRequest)==null?void 0:F.format,v=(N||L1)({...Ty(k,{format:N}),accessList:s,account:R,authorizationList:o,blobs:a,chainId:G,data:l?Vc([c??"0x",l]):c,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:b,to:U,type:w,value:x},"sendTransaction"),p=cv.get(t.uid),m=p?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:m,params:[v]},{retryCount:0})}catch(y){if(p===!1)throw y;const T=y;
55if(T.name==="InvalidInputRpcError"||T.name==="InvalidParamsRpcError"||T.name==="MethodNotFoundRpcError"||T.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[v]},{retryCount:0}).then(I=>(cv.set(t.uid,!0),I)).catch(I=>{const _=I;throw _.name==="MethodNotFoundRpcError"||_.name==="MethodNotSupportedRpcError"?(cv.set(t.uid,!1),T):_});throw T}}if((R==null?void 0:R.type)==="local"){const G=await Ar(t,$5,"prepareTransactionRequest")({account:R,accessList:s,authorizationList:o,blobs:a,chain:i,data:l?Vc([c??"0x",l]):c,gas:u,gasPrice:f,maxFeePerBlobGas:d,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:b,nonceManager:R.nonceManager,parameters:[...YI,"sidecars"],type:w,value:x,...k,to:U}),N=(H=i==null?void 0:i.serializers)==null?void 0:H.transaction,A=await R.signTransaction(G,{serializer:N});return await Ar(t,QW,"sendRawTransaction")({serializedTransaction:A})}throw(R==null?void 0:R.type)==="smart"?new av({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new av({docsPath:"/docs/actions/wallet/sendTransaction",type:R==null?void 0:R.type})}catch(U){throw U instanceof av?U:ZI(U,{...e,account:R,chain:e.chain||void 0})}}async function gb(t,e){return gb.internal(t,_x,"sendTransaction",e)}(function(t){async function e(r,n,i,s){const{abi:o,account:a=r.account,address:c,args:l,functionName:u,...f}=s;if(typeof a>"u")throw new J5({docsPath:"/docs/contract/writeContract"});const d=a?so(a):null,h=zh({abi:o,args:l,functionName:u});try{return await Ar(r,n,i)({data:h,to:c,account:d,...f})}catch(g){throw MI(g,{abi:o,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:u,sender:d==null?void 0:d.address})}}t.internal=e})(gb||(gb={}));function mb(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await pb(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a<r&&await n({count:a,error:l}))return c({error:l});s(l)}};o()})}const eK={"0x0":"reverted","0x1":"success"};function Cx(t,e){const r={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(n=>L5(n)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?su(t.transactionIndex):null,status:t.status?eK[t.status]:null,type:t.type?HI[t.type]||t.type:null};return t.blobGasPrice&&(r.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(r.blobGasUsed=BigInt(t.blobGasUsed)),r}const P_e=Ny("transactionReceipt",Cx),M3=256;let Sg=M3,Tg;function Sx(t=11){if(!Tg||Sg+t>M3*2){Tg="",Sg=0;for(let e=0;e<M3;e++)Tg+=(256+Math.random()*256|0).toString(16).substring(1)}return Tg.substring(Sg,Sg+++t)}function Tx(t){const{batch:e,chain:r,ccipRead:n,dataSuffix:i,key:s="base",name:o="Base Client",type:a="base"}=t,c=t.experimental_blockTag??(typeof(r==null?void 0:r.experimental_preconfirmationTime)=="number"?"pending":void 0),l=(r==null?void 0:r.blockTime)??12e3,u=Math.min(Math.max(Math.floor(l/2),500),4e3),f=t.pollingInterval??u,d=t.cacheTime??f,h=t.account?so(t.account):void 0,{config:g,request:b,value:w}=t.transport({account:h,chain:r,pollingInterval:f}),x={...g,...w},k={account:h,batch:e,cacheTime:d,ccipRead:n,chain:r,dataSuffix:i,key:s,name:o,pollingInterval:f,request:b,transport:x,type:a,uid:Sx(),...c?{experimental_blockTag:c}:{}};function R(D){return O=>{const M=O(D);for(const H in k)delete M[H];const F={...D,...M};return Object.assign(F,{extend:R(F)})}}return Object.assign(k,{extend:R(k)})}function k_e(){return null}function q5(t){var r,n,i,s,o,a;if(!(t instanceof ue))return!1;const e=t.walk(c=>c instanceof E3);return e instanceof E3?((r=e.data)==null?void 0:r.errorName)==="HttpError"||((n=e.data)==null?void 0:n.errorName)==="ResolverError"||((i=e.data)==null?void 0:i.errorName)==="ResolverNotContract"||((s=e.data)==null?void 0:s.errorName)==="ResolverNotFound"||((o=e.data)==null?void 0:o.errorName)==="ReverseAddressMismatch"||((a=e.data)==null?void 0:a.errorName)==="UnsupportedResolverProfile":!1}function tK(t){const{abi:e,data:r}=t,n=mh(r,0,4),i=e.find(s=>
55s.type==="function"&&n===O1(Ja(s)));if(!i)throw new Iq(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?D1(i.inputs,mh(r,4)):void 0}}const lv="/docs/contract/encodeErrorResult";function C4(t){const{abi:e,errorName:r,args:n}=t;let i=e[0];if(r){const c=M1({abi:e,args:n,name:r});if(!c)throw new VA(r,{docsPath:lv});i=c}if(i.type!=="error")throw new VA(void 0,{docsPath:lv});const s=Ja(i),o=O1(s);let a="0x";if(n&&n.length>0){if(!i.inputs)throw new Sq(i.name,{docsPath:lv});a=Cy(i.inputs,n)}return k1([o,a])}const uv="/docs/contract/encodeFunctionResult";function rK(t){const{abi:e,functionName:r,result:n}=t;let i=e[0];if(r){const o=M1({abi:e,name:r});if(!o)throw new ph(r,{docsPath:uv});i=o}if(i.type!=="function")throw new ph(void 0,{docsPath:uv});if(!i.outputs)throw new oI(i.name,{docsPath:uv});const s=(()=>{if(i.outputs.length===0)return[];if(i.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new aI(n)})();return Cy(i.outputs,s)}const Py="x-batch-gateway:true";async function nK(t){const{data:e,ccipRequest:r}=t,{args:[n]}=tK({abi:k3,data:e}),i=[],s=[];return await Promise.all(n.map(async(o,a)=>{try{s[a]=o.urls.includes(Py)?await nK({data:o.data,ccipRequest:r}):await r(o),i[a]=!1}catch(c){i[a]=!0,s[a]=iK(c)}})),rK({abi:k3,functionName:"query",result:[i,s]})}function iK(t){return t.name==="HttpRequestError"&&t.status?C4({abi:k3,errorName:"HttpError",args:[t.status,t.shortMessage]}):C4({abi:[SI],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}function Nx(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return qc(e)?e:null}function D3(t){let e=new Uint8Array(32).fill(0);if(!t)return ei(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=Nx(r[n]),s=i?x1(i):ou(gf(r[n]),"bytes");e=ou(Vc([e,s]),"bytes")}return ei(e)}function sK(t){return`[${t.slice(2)}]`}function oK(t){const e=new Uint8Array(32).fill(0);return t?Nx(t)||ou(gf(t)):ei(e)}function Ix(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(gf(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s<i.length;s++){let o=gf(i[s]);o.byteLength>255&&(o=gf(sK(oK(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function aK(t,e){const{blockNumber:r,blockTag:n,coinType:i,name:s,gatewayUrls:o,strict:a}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ry({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;const f=(()=>i!=null?[D3(s),BigInt(i)]:[D3(s)])();try{const d=zh({abi:A4,functionName:"addr",args:f}),h={address:l,abi:mx,functionName:"resolveWithGateways",args:[Gc(Ix(s)),d,o??[Py]],blockNumber:r,blockTag:n},b=await Ar(t,Qp,"readContract")(h);if(b[0]==="0x")return null;const w=H1({abi:A4,args:f,functionName:"addr",data:b[0]});return w==="0x"||Vl(w)==="0x00"?null:w}catch(d){if(a)throw d;if(q5(d))return null;throw d}}class cK extends ue{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class s0 extends ue{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class G5 extends ue{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class lK extends ue{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}class O_e extends ue{constructor({chainId:e}){super(`Invalid ENSIP-11 chainId: ${e}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}const uK=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,fK=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,dK=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,hK=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function pK(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function S4(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}
55function xx({uri:t,gatewayUrls:e}){const r=dK.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=S4(e==null?void 0:e.ipfs,"https://ipfs.io"),i=S4(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(uK),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||fK.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(hK,"");if(d.startsWith("<svg")&&(d=`data:image/svg+xml;base64,${btoa(d)}`),d.startsWith("data:")||d.startsWith("{"))return{uri:d,isOnChain:!0,isEncoded:!1};throw new G5({uri:t})}function Rx(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new cK({data:t});return t.image||t.image_url||t.image_data}async function gK({gatewayUrls:t,uri:e}){try{const r=await fetch(e).then(i=>i.json());return await V5({gatewayUrls:t,uri:Rx(r)})}catch{throw new G5({uri:e})}}async function V5({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=xx({uri:e,gatewayUrls:t});if(n||await pK(r))return r;throw new G5({uri:e})}function mK(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new s0({reason:"Only EIP-155 supported"});if(!o)throw new s0({reason:"Chain ID not found"});if(!c)throw new s0({reason:"Contract address not found"});if(!i)throw new s0({reason:"Token ID not found"});if(!a)throw new s0({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function bK(t,{nft:e}){if(e.namespace==="erc721")return Qp(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Qp(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new lK({namespace:e.namespace})}async function yK(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?vK(t,{gatewayUrls:e,record:r}):V5({uri:r,gatewayUrls:e})}async function vK(t,{gatewayUrls:e,record:r}){const n=mK(r),i=await bK(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=xx({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return V5({uri:Rx(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),gK({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function wK(t,e){const{blockNumber:r,blockTag:n,key:i,name:s,gatewayUrls:o,strict:a}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ry({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(f=>s.endsWith(f)))return null;try{const f={address:l,abi:mx,args:[Gc(Ix(s)),zh({abi:E4,functionName:"text",args:[D3(s),i]}),o??[Py]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},h=await Ar(t,Qp,"readContract")(f);if(h[0]==="0x")return null;const g=H1({abi:E4,functionName:"text",data:h[0]});return g===""?null:g}catch(f){if(a)throw f;if(q5(f))return null;throw f}}async function EK(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await Ar(t,wK,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await yK(t,{record:c,gatewayUrls:n})}catch{return null}}async function AK(t,e){const{address:r,blockNumber:n,blockTag:i,coinType:s=60n,gatewayUrls:o,strict:a}=e,{chain:c}=t,l=(()=>
55{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return Ry({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:PW,args:[r,s,o??[Py]],functionName:"reverseWithGateways",blockNumber:n,blockTag:i},f=Ar(t,Qp,"readContract"),[d]=await f(u);return d||null}catch(u){if(a)throw u;if(q5(u))return null;throw u}}async function _K(t){const e=MG(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function CK(t,{address:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest"}){var o,a,c;if((o=t.batch)!=null&&o.multicall&&((c=(a=t.chain)==null?void 0:a.contracts)!=null&&c.multicall3)){const l=t.chain.contracts.multicall3.address,u=zh({abi:db,functionName:"getEthBalance",args:[e]}),{data:f}=await Ar(t,z5,"call")({to:l,data:u,blockNumber:r,blockTag:n});return H1({abi:db,functionName:"getEthBalance",args:[e],data:f||"0x"})}const i=typeof r=="bigint"?Bt(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}const Ng=new R1(8192);function SK(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(Ng.get(r))return Ng.get(r);const n=t().finally(()=>Ng.delete(r));return Ng.set(r,n),n}function TK(t,e={}){return async(r,n={})=>{var f;const{dedupe:i=!1,methods:s,retryDelay:o=150,retryCount:a=3,uid:c}={...e,...n},{method:l}=r;if((f=s==null?void 0:s.exclude)!=null&&f.includes(l))throw new nf(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new nf(new Error("method not supported"),{method:l});const u=i?Ay(`${c}.${$s(r)}`):void 0;return SK(()=>mb(async()=>{try{return await t(r)}catch(d){const h=d;switch(h.code){case Bp.code:throw new Bp(h);case Fp.code:throw new Fp(h);case $p.code:throw new $p(h,{method:r.method});case Lp.code:throw new Lp(h);case Of.code:throw new Of(h);case bh.code:throw new bh(h);case Up.code:throw new Up(h);case Wl.code:throw new Wl(h);case yh.code:throw new yh(h);case nf.code:throw new nf(h,{method:r.method});case vh.code:throw new vh(h);case Hp.code:throw new Hp(h);case _n.code:throw new _n(h);case jp.code:throw new jp(h);case zp.code:throw new zp(h);case Jp.code:throw new Jp(h);case qp.code:throw new qp(h);case Ga.code:throw new Ga(h);case Gp.code:throw new Gp(h);case Vp.code:throw new Vp(h);case Wp.code:throw new Wp(h);case Kp.code:throw new Kp(h);case Xp.code:throw new Xp(h);case Zp.code:throw new Zp(h);case Yp.code:throw new Yp(h);case 5e3:throw new _n(h);case wh.code:throw new wh(h);default:throw d instanceof ue?d:new cV(h)}}},{delay:({count:d,error:h})=>{var g;if(h&&h instanceof G0){const b=(g=h==null?void 0:h.headers)==null?void 0:g.get("Retry-After");if(b!=null&&b.match(/\d/))return Number.parseInt(b,10)*1e3}return~~(1<<d)*o},retryCount:a,shouldRetry:({error:d})=>NK(d)}),{enabled:i,id:u})}}function NK(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===vh.code||t.code===Of.code||t.code===429:t instanceof G0&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function IK(t){const e={formatters:void 0,fees:void 0,serializers:void 0,...t};function r(n){return i=>{const s=typeof i=="function"?i(n):i,o={...n,...s};return Object.assign(o,{extend:r(o)})}}return Object.assign(e,{extend:r(e)})}function M_e(){return{}}function Px(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){(a==null?void 0:a.name)==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function xK(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const T4=xK();function RK(t,e={}){const{url:r,headers:n}=PK(t);return{async request(i){var g,b,w;const{body:s,fetchFn:o=e.fetchFn??fetch,onRequest:a=e.onRequest,onResponse:c=e.onResponse,timeout:l=e.timeout??1e4}=i,u={...e.fetchOptions??{},...i.fetchOptions??{}},{headers:f,method:d,signal:h}=u;try{const x=await Px(async({signal:R})=>{const D={...u,body:Array.isArray(s)?$s(s.map(H=>({jsonrpc:"2.0",id:H.id??T4.take(),...H}))):$s({jsonrpc:"2.0",id:s.id??T4.take(),...s}),headers:{...n,"Content-Type":"application/json",...f},method:d||"POST",signal:h||(l>0?R:null)}
55,O=new Request(r,D),M=await(a==null?void 0:a(O,D))??{...D,url:r};return await o(M.url??r,M)},{errorInstance:new a4({body:s,url:r}),timeout:l,signal:!0});c&&await c(x);let k;if((g=x.headers.get("Content-Type"))!=null&&g.startsWith("application/json"))k=await x.json();else{k=await x.text();try{k=JSON.parse(k||"{}")}catch(R){if(x.ok)throw R;k={error:k}}}if(!x.ok){if(typeof((b=k.error)==null?void 0:b.code)=="number"&&typeof((w=k.error)==null?void 0:w.message)=="string")return k;throw new G0({body:s,details:$s(k.error)||x.statusText,headers:x.headers,status:x.status,url:r})}return k}catch(x){throw x instanceof G0||x instanceof a4?x:new G0({body:s,cause:x,url:r})}}}}function PK(t){try{const e=new URL(t),r=(()=>{if(e.username){const n=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;return e.username="",e.password="",{url:e.toString(),headers:{Authorization:`Basic ${btoa(n)}`}}}})();return{url:e.toString(),...r}}catch{return{url:t}}}class kK extends ue{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function OK(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new kK({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[s,o,a]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${o}.${a}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}async function kx(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s,sender:o,nonce:a}){var d,h,g;const c=n||"latest",l=r!==void 0?Bt(r):void 0;let u=null;if(i?u=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?u=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Bt(s)]},{dedupe:!0}):(l||c)&&typeof s=="number"?u=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||c,Bt(s)]},{dedupe:!!l}):o&&typeof a=="number"&&(u=await t.request({method:"eth_getTransactionBySenderAndNonce",params:[o,Bt(a)]},{dedupe:!0})),!u)throw new PI({blockHash:e,blockNumber:r,blockTag:c,hash:i,index:s});return(((g=(h=(d=t.chain)==null?void 0:d.formatters)==null?void 0:h.transaction)==null?void 0:g.format)||Iy)(u,"getTransaction")}async function fv(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new kI({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||Cx)(r,"getTransactionReceipt")}function MK(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:o=t.pollingInterval}){const a=(()=>typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
55onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))();let c;return a?(()=>{const f=$s(["watchBlockNumber",t.uid,e,r,o]);return hb(f,{onBlockNumber:n,onError:i},d=>Ax(async()=>{var h;try{const g=await Ar(t,KW,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(g===c)return;if(g-c>1&&r)for(let b=c+1n;b<g;b++)d.onBlockNumber(b,c),c=b}(c===void 0||g>c)&&(d.onBlockNumber(g,c),c=g)}catch(g){(h=d.onError)==null||h.call(d,g)}},{emitOnBegin:e,interval:o}))})():(()=>{const f=$s(["watchBlockNumber",t.uid,e,r]);return hb(f,{onBlockNumber:n,onError:i},d=>{let h=!0,g=()=>h=!1;return(async()=>{try{const b=(()=>{if(t.transport.type==="fallback"){const x=t.transport.transports.find(k=>k.config.type==="webSocket"||k.config.type==="ipc");return x?x.value:t.transport}return t.transport})(),{unsubscribe:w}=await b.subscribe({params:["newHeads"],onData(x){var R;if(!h)return;const k=Rf((R=x.result)==null?void 0:R.number);d.onBlockNumber(k,c),c=k},onError(x){var k;(k=d.onError)==null||k.call(d,x)}});g=w,h||g()}catch(b){i==null||i(b)}})(),()=>g()})})()}async function DK(t,e){const{checkReplacement:r=!0,confirmations:n=1,hash:i,onReplaced:s,retryCount:o=6,retryDelay:a=({count:O})=>~~(1<<O)*200,timeout:c=18e4}=e,l=$s(["waitForTransactionReceipt",t.uid,i]),u=(()=>{var O;return e.pollingInterval?e.pollingInterval:(O=t.chain)!=null&&O.experimental_preconfirmationTime?t.chain.experimental_preconfirmationTime:t.pollingInterval})();let f,d,h,g=!1,b,w;const{promise:x,resolve:k,reject:R}=vx(),D=c?setTimeout(()=>{w==null||w(),b==null||b(),R(new tV({hash:i}))},c):void 0;return b=hb(l,{onReplaced:s,resolve:k,reject:R},async O=>{if(h=await Ar(t,fv,"getTransactionReceipt")({hash:i}).catch(()=>{}),h&&n<=1){clearTimeout(D),O.resolve(h),b==null||b();return}w=Ar(t,MK,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(M){const F=U=>{clearTimeout(D),w==null||w(),U(),b==null||b()};let H=M;if(!g)try{if(h){if(n>1&&(!h.blockNumber||H-h.blockNumber+1n<n))return;F(()=>O.resolve(h));return}if(r&&!f&&(g=!0,await mb(async()=>{f=await Ar(t,kx,"getTransaction")({hash:i}),f.blockNumber&&(H=f.blockNumber)},{delay:a,retryCount:o}),g=!1),h=await Ar(t,fv,"getTransactionReceipt")({hash:i}),n>1&&(!h.blockNumber||H-h.blockNumber+1n<n))return;F(()=>O.resolve(h))}catch(U){if(U instanceof PI||U instanceof kI){if(!f){g=!1;return}try{d=f,g=!0;const G=await mb(()=>Ar(t,Eh,"getBlock")({blockNumber:H,includeTransactions:!0}),{delay:a,retryCount:o,shouldRetry:({error:v})=>v instanceof UI});g=!1;const N=G.transactions.find(({from:v,nonce:p})=>v===d.from&&p===d.nonce);if(!N||(h=await Ar(t,fv,"getTransactionReceipt")({hash:N.hash}),n>1&&(!h.blockNumber||H-h.blockNumber+1n<n)))return;let A="replaced";N.to===d.to&&N.value===d.value&&N.input===d.input?A="repriced":N.from===N.to&&N.value===0n&&(A="cancelled"),F(()=>{var v;(v=O.onReplaced)==null||v.call(O,{reason:A,replacedTransaction:d,transaction:N,transactionReceipt:h}),O.resolve(h)})}catch(G){F(()=>O.reject(G))}}else F(()=>O.reject(U))}}})}),x}function BK(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket"&&t.transport.type!=="ipc")?(()=>{const l=$s(["watchPendingTransactions",t.uid,e,s]);return hb(l,{onTransactions:n,onError:r},u=>{let f;const d=Ax(async()=>{var h;try{if(!f)try{f=await Ar(t,_K,"createPendingTransactionFilter")({});return}catch(b){throw d(),b}const g=await Ar(t,XW,"getFilterChanges")({filter:f});if(g.length===0)return;if(e)u.onTransactions(g);else for(const b of g)u.onTransactions([b])}catch(g){(h=u.onError)==null||h.call(u,g)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await Ar(t,ZW,"uninstallFilter")({filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const h=d.result;n([h])},onError(d){r==null||r(d)}});u=f,l||u()}catch(f){r==null||r(f)}})(),()=>u()})()}async function FK(t,{account:e=t.account,message:r}){if(!e)throw new J5({docsPath:"/docs/actions/wallet/signMessage"});const n=so(e);if(n.signMessage)return n.signMessage({message:r});const i=(()=>typeof r=="string"?Ay(r):r.raw instanceof Uint8Array?Gc(r.raw):r.raw)();return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}function W5({key:t,methods:e,name:r,request:n,retryCount:i=3,retryDelay:s=150,timeout:o,type:a},c){const l=Sx();return{config:{key:t,methods:e,name:r,request:n,retryCount:i,retryDelay:s,timeout:o,type:a},request:TK(n,{methods:e,retryCount:i,retryDelay:s,uid:l}),value:c}}function $K(t,e={}){const{key:r="custom",methods:n,name:i="Custom Provider",retryDelay:s}=e;return({retryCount:o})=>W5({key:r,methods:n,name:i,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:s,type:"custom"})}function N4(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,shouldThrow:s=LK,retryCount:o,retryDelay:a}=e;return({chain:c,pollingInterval:l=4e3,timeout:u,...f})=>{let d=t,h=()=>{};const g=W5({key:r,name:n,async request({method:b,params:w}){let x;const k=async(R=0)=>{const D=d[R]({...f,chain:c,retryCount:0,timeout:u});try{const O=await D.request({method:b,params:w});return h({method:b,params:w,response:O,transport:D,status:"success"}),O}catch(O){if(h({error:O,method:b,params:w,transport:D,status:"error"}),s(O)||R===d.length-1||(x??(x=d.slice(R+1).some(M=>{const{include:F,exclude:H}=M({chain:c}).config.methods||{};return F?F.includes(b):H?!H.includes(b):!0})),!x))throw O;return k(R+1)}};return k()},retryCount:o,retryDelay:a,type:"fallback"},{onResponse:b=>h=b,transports:d.map(b=>b({chain:c,retryCount:0}))});if(i){const b=typeof i=="object"?i:{};UK({chain:c,interval:b.interval??l,onTransports:w=>
55d=w,ping:b.ping,sampleCount:b.sampleCount,timeout:b.timeout,transports:d,weights:b.weights})}return g}}function LK(t){return!!("code"in t&&typeof t.code=="number"&&(t.code===yh.code||t.code===_n.code||t.code===wh.code||sf.nodeMessage.test(t.message)||t.code===5e3))}function UK({chain:t,interval:e=4e3,onTransports:r,ping:n,sampleCount:i=10,timeout:s=1e3,transports:o,weights:a={}}){const{stability:c=.7,latency:l=.3}=a,u=[],f=async()=>{const d=await Promise.all(o.map(async b=>{const w=b({chain:t,retryCount:0,timeout:s}),x=Date.now();let k,R;try{await(n?n({transport:w}):w.request({method:"net_listening"})),R=1}catch{R=0}finally{k=Date.now()}return{latency:k-x,success:R}}));u.push(d),u.length>i&&u.shift();const h=Math.max(...u.map(b=>Math.max(...b.map(({latency:w})=>w)))),g=o.map((b,w)=>{const x=u.map(M=>M[w].latency),R=1-x.reduce((M,F)=>M+F,0)/x.length/h,D=u.map(M=>M[w].success),O=D.reduce((M,F)=>M+F,0)/D.length;return O===0?[0,w]:[l*R+c*O,w]}).sort((b,w)=>w[0]-b[0]);r(g.map(([,b])=>o[b])),await pb(e),f()};f()}class HK extends ue{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Ig(t,e={}){const{batch:r,fetchFn:n,fetchOptions:i,key:s="http",methods:o,name:a="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:f}=e;return({chain:d,retryCount:h,timeout:g})=>{const{batchSize:b=1e3,wait:w=0}=typeof r=="object"?r:{},x=e.retryCount??h,k=g??e.timeout??1e4,R=t||(d==null?void 0:d.rpcUrls.default.http[0]);if(!R)throw new HK;const D=RK(R,{fetchFn:n,fetchOptions:i,onRequest:c,onResponse:l,timeout:k});return W5({key:s,methods:o,name:a,async request({method:O,params:M}){const F={method:O,params:M},{schedule:H}=wx({id:R,wait:w,shouldSplitBatch(A){return A.length>b},fn:A=>D.request({body:A}),sort:(A,v)=>A.id-v.id}),U=async A=>r?H(A):[await D.request({body:A})],[{error:G,result:N}]=await U(F);if(f)return{error:G,result:N};if(G)throw new P5({body:F,error:G,url:R});return N},retryCount:x,retryDelay:u,timeout:k,type:"http"},{fetchOptions:i,url:R})}}async function o0(...t){const e=await fetch(...t);if(!e.ok)throw new Error(`HTTP status code: ${e.status}`,{cause:e});return e}class j1{constructor({baseUrl:e,clientId:r}){this.baseUrl=e,this.clientId=r}async get({headers:e,signal:r,cache:n,...i}){const s=this.createUrl(i);return(await o0(s,{method:"GET",headers:e,signal:r,cache:n})).json()}async getBlob({headers:e,signal:r,...n}){const i=this.createUrl(n);return(await o0(i,{method:"GET",headers:e,signal:r})).blob()}async post({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await o0(s,{method:"POST",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async put({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await o0(s,{method:"PUT",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}async delete({body:e,headers:r,signal:n,...i}){const s=this.createUrl(i);return(await o0(s,{method:"DELETE",headers:r,body:e?JSON.stringify(e):void 0,signal:n})).json()}createUrl({path:e,params:r}){const n=new URL(e,this.baseUrl);return r&&Object.entries(r).forEach(([i,s])=>{s&&n.searchParams.append(i,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}sendBeacon({body:e,...r}){const n=this.createUrl(r);return navigator.sendBeacon(n.toString(),e?JSON.stringify(e):void 0)}}const B3={getFeatureValue(t,e){const r=e==null?void 0:e[t];return r===void 0?kt.DEFAULT_FEATURES[t]:r},filterSocialsByPlatform(t){if(!t||!t.length)return t;let e=t;return Ce.isTelegram()&&(Ce.isIos()&&(e=e.filter(r=>r!=="google")),Ce.isMac()&&(e=e.filter(r=>r!=="x")),Ce.isAndroid()&&(e=e.filter(r=>!["facebook","x"].includes(r)))),Ce.isMobile()&&(e=e.filter(r=>r!=="facebook")),e},isSocialsEnabled(){var t,e,r,n;return Array.isArray((t=oe.state.features)==null?void 0:t.socials)&&((e=oe.state.features)==null?void 0:e.socials.length)>0||Array.isArray((r=oe.state.remoteFeatures)==null?void 0:r.socials)&&((n=oe.state.remoteFeatures)==null?void 0:n.socials.length)>0},isEmailEnabled(){var t,e;return!!((t=oe.state.features)!=null&&t.email||(e=oe.state.remoteFeatures)!=null&&e.email)}},Ue=Qr({features:kt.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined",defaultAccountTypes:kt.DEFAULT_ACCOUNT_TYPES,enableNetworkSwitch:!0,experimental_preferUniversalLinks:!1,remoteFeatures:{},enableMobileFullScreen:!1,coinbasePreference:"all"}),oe={state:Ue,subscribeKey(t,e){return Qn(Ue,t,e)},setOptions(t){Object.assign(Ue,t)},setRemoteFeatures(t){var r,n;if(!t)return;const e={...Ue.remoteFeatures,...t};Ue.remoteFeatures=e,(r=Ue.remoteFeatures)!=null&&r.socials&&(Ue.remoteFeatures.socials=B3.filterSocialsByPlatform(Ue.remoteFeatures.socials)),(n=Ue.features)!=null&&n.pay&&(Ue.remoteFeatures.email=!1,Ue.remoteFeatures.socials=!1)},setFeatures(t){var r;if(!t)return;Ue.features||(Ue.features=kt.DEFAULT_FEATURES);const e={...Ue.features,...t};Ue.features=e,(r=Ue.features)!=null&&r.pay&&Ue.remoteFeatures&&(Ue.remoteFeatures.email=!1,Ue.remoteFeatures.socials=!1)},setProjectId(t){Ue.projectId=t},setCustomRpcUrls(t){Ue.customRpcUrls=t},setAllWallets(t){Ue.allWallets=t},setIncludeWalletIds(t){Ue.includeWalletIds=t},setExcludeWalletIds(t){Ue.excludeWalletIds=t},setFeaturedWalletIds(t){Ue.featuredWalletIds=t},setTokens(t){Ue.tokens=t},setTermsConditionsUrl(t){Ue.termsConditionsUrl=t},setPrivacyPolicyUrl(t){Ue.privacyPolicyUrl=t},setCustomWallets(t){Ue.customWallets=t},setIsSiweEnabled(t){Ue.isSiweEnabled=t},setIsUniversalProvider(t){Ue.isUniversalProvider=t},setSdkVersion(t){Ue.sdkVersion=t},setMetadata(t){Ue.metadata=t},setDisableAppend(t){Ue.disableAppend=t},setEIP6963Enabled(t){Ue.enableEIP6963=t},setEnableCoinbase(t){Ue.enableCoinbase=t},setDebug(t){Ue.debug=t},setEnableWalletGuide(t){Ue.enableWalletGuide=t},setEnableAuthLogger(t){Ue.enableAuthLogger=t},setEnableWallets(t){Ue.enableWallets=t},setPreferUniversalLinks(t){Ue.experimental_preferUniversalLinks=t},setSIWX(t){if(t)for(const[e,r]of Object.entries(kt.SIWX_DEFAULTS))t[e]??(t[e]=r);Ue.siwx=t},setConnectMethodsOrder(t){Ue.features={...Ue.features,connectMethodsOrder:t}},setWalletFeaturesOrder(t){Ue.features={...Ue.features,walletFeaturesOrder:t}},setSocialsOrder(t){Ue.remoteFeatures={...Ue.remoteFeatures,socials:t}},setCollapseWallets(t){Ue.features={...Ue.features,collapseWallets:t}},setEnableEmbedded(t){Ue.enableEmbedded=t},setAllowUnsupportedChain(t){Ue.allowUnsupportedChain=t},setManualWCControl(t){Ue.manualWCControl=t},setEnableNetworkSwitch(t){Ue.enableNetworkSwitch=t},setEnableMobileFullScreen(t){Ue.enableMobileFullScreen=Ce.isMobile()&&t},setEnableReconnect(t){Ue.enableReconnect=t},setCoinbasePreference(t){Ue.coinbasePreference=t},setDefaultAccountTypes(t={}){Object.entries(t).forEach(([e,r])=>{r&&(Ue.defaultAccountTypes[e]=r)})},setUniversalProviderConfigOverride(t){Ue.universalProviderConfigOverride=t},getUniversalProviderConfigOverride(){return Ue.universalProviderConfigOverride}
vendor: 4,153 bytes, line 55
55,getSnapshot(){return yp(Ue)}},qu=Object.freeze({message:"",variant:"success",svg:void 0,open:!1,autoClose:!0}),Dn=Qr({...qu}),jK={state:Dn,subscribeKey(t,e){return Qn(Dn,t,e)},showLoading(t,e={}){this._showMessage({message:t,variant:"loading",...e})},showSuccess(t){this._showMessage({message:t,variant:"success"})},showSvg(t,e){this._showMessage({message:t,svg:e})},showError(t){const e=Ce.parseError(t);this._showMessage({message:e,variant:"error"})},hide(){Dn.message=qu.message,Dn.variant=qu.variant,Dn.svg=qu.svg,Dn.open=qu.open,Dn.autoClose=qu.autoClose},_showMessage({message:t,svg:e,variant:r="success",autoClose:n=qu.autoClose}){Dn.open?(Dn.open=!1,setTimeout(()=>{Dn.message=t,Dn.variant=r,Dn.svg=e,Dn.open=!0,Dn.autoClose=n},150)):(Dn.message=t,Dn.variant=r,Dn.svg=e,Dn.open=!0,Dn.autoClose=n)}},_a=jK,zK={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},Ox=Ce.getBlockchainApiUrl(),Oi=Qr({clientId:null,api:new j1({baseUrl:Ox,clientId:null}),supportedChains:{http:[],ws:[]}}),it={state:Oi,async get(t){const{st:e,sv:r}=it.getSdkProperties(),n=oe.state.projectId,i={...t.params||{},st:e,sv:r,projectId:n};return Oi.api.get({...t,params:i})},getSdkProperties(){const{sdkType:t,sdkVersion:e}=oe.state;return{st:t||"unknown",sv:e||"unknown"}},async isNetworkSupported(t){if(!t)return!1;try{Oi.supportedChains.http.length||await it.getSupportedNetworks()}catch{return!1}return Oi.supportedChains.http.includes(t)},async getSupportedNetworks(){try{const t=await it.get({path:"v1/supported-chains"});return Oi.supportedChains=t,t}catch{return Oi.supportedChains}},async fetchIdentity({address:t}){const e=le.getIdentityFromCacheForAddress(t);if(e)return e;const r=await it.get({path:`/v1/identity/${t}`,params:{sender:z.state.activeCaipAddress?Ce.getPlainAddress(z.state.activeCaipAddress):void 0}});return le.updateIdentityCache({address:t,identity:r,timestamp:Date.now()}),r},async fetchTransactions({account:t,cursor:e,signal:r,cache:n,chainId:i}){var c;if(!await it.isNetworkSupported((c=z.state.activeCaipNetwork)==null?void 0:c.caipNetworkId))return{data:[],next:void 0};const o=le.getTransactionsCacheForAddress({address:t,chainId:i});if(o)return o;const a=await it.get({path:`/v1/account/${t}/history`,params:{cursor:e,chainId:i},signal:r,cache:n});return le.updateTransactionsCache({address:t,chainId:i,timestamp:Date.now(),transactions:a}),a},async fetchSwapQuote({amount:t,userAddress:e,from:r,to:n,gasPrice:i}){var o;return await it.isNetworkSupported((o=z.state.activeCaipNetwork)==null?void 0:o.caipNetworkId)?it.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:t,userAddress:e,from:r,to:n,gasPrice:i}}):{quotes:[]}},async fetchSwapTokens({chainId:t}){var r;return await it.isNetworkSupported((r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?it.get({path:"/v1/convert/tokens",params:{chainId:t}}):{tokens:[]}},async getAddressBalance({caipNetworkId:t,address:e,method:r="getAddressBalance",params:n}){return Oi.api.post({path:`/v1?chainId=${t}&projectId=${oe.state.projectId}`,body:{id:"1",jsonrpc:"2.0",method:r,params:n??{address:e}}}).then(i=>i.result)},async fetchTokenPrice({addresses:t,caipNetworkId:e=(r=>(r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)()}
55){if(!await it.isNetworkSupported(e))return{fungibles:[]};const i=le.getTokenPriceCacheForAddresses(t);if(i)return i;const s=await Oi.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:t,projectId:oe.state.projectId},headers:{"Content-Type":"application/json"}});return le.updateTokenPriceCache({addresses:t,timestamp:Date.now(),tokenPrice:s}),s},async fetchSwapAllowance({tokenAddress:t,userAddress:e}){var n;return await it.isNetworkSupported((n=z.state.activeCaipNetwork)==null?void 0:n.caipNetworkId)?it.get({path:"/v1/convert/allowance",params:{tokenAddress:t,userAddress:e},headers:{"Content-Type":"application/json"}}):{allowance:"0"}},async fetchGasPrice({chainId:t}){var i;const{st:e,sv:r}=it.getSdkProperties();if(!await it.isNetworkSupported((i=z.state.activeCaipNetwork)==null?void 0:i.caipNetworkId))throw new Error("Network not supported for Gas Price");return it.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:t,st:e,sv:r}})},async generateSwapCalldata({amount:t,from:e,to:r,userAddress:n,disableEstimate:i}){var o;if(!await it.isNetworkSupported((o=z.state.activeCaipNetwork)==null?void 0:o.caipNetworkId))throw new Error("Network not supported for Swaps");return Oi.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:t,eip155:{slippage:kt.CONVERT_SLIPPAGE_TOLERANCE},projectId:oe.state.projectId,from:e,to:r,userAddress:n,disableEstimate:i}})},async generateApproveCalldata({from:t,to:e,userAddress:r}){var o;const{st:n,sv:i}=it.getSdkProperties();if(!await it.isNetworkSupported((o=z.state.activeCaipNetwork)==null?void 0:o.caipNetworkId))throw new Error("Network not supported for Swaps");return it.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"},params:{userAddress:r,from:t,to:e,st:n,sv:i}})},async getBalance(t,e,r){var l;const{st:n,sv:i}=it.getSdkProperties();if(!await it.isNetworkSupported((l=z.state.activeCaipNetwork)==null?void 0:l.caipNetworkId))return _a.showError("Token Balance Unavailable"),{balances:[]};const o=`${e}:${t}`,a=le.getBalanceCacheForCaipAddress(o);if(a)return a;const c=await it.get({path:`/v1/account/${t}/balance`,params:{currency:"usd",chainId:e,forceUpdate:r,st:n,sv:i}});return le.updateBalanceCache({caipAddress:o,balance:c,timestamp:Date.now()}),c},async lookupEnsName(t){var r;return await it.isNetworkSupported((r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?it.get({path:`/v1/profile/account/${t}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]}},async reverseLookupEnsName({address:t}){var n,i;if(!await it.isNetworkSupported((n=z.state.activeCaipNetwork)==null?void 0:n.caipNetworkId))return[];const r=(i=z.getAccountData())==null?void 0:i.address;return it.get({path:`/v1/profile/reverse/${t}`,params:{sender:r,apiVersion:"2"}})},async getEnsNameSuggestions(t){var r;return await it.isNetworkSupported((r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?it.get({path:`/v1/profile/suggestions/${t}`,params:{zone:"reown.id"}}):{suggestions:[]}},async registerEnsName({coinType:t,address:e,message:r,signature:n}){var s;return await it.isNetworkSupported((s=z.state.activeCaipNetwork)==null?void 0:s.caipNetworkId)?Oi.api.post({path:"/v1/profile/account",body:{coin_type:t,address:e,message:r,signature:n},headers:{"Content-Type":"application/json"}}):{success:!1}},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:r,purchaseAmount:n,paymentAmount:i}){var a;return await it.isNetworkSupported((a=z.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)?(await Oi.api.post({path:"/v1/generators/onrampurl",params:{projectId:oe.state.projectId},body:{destinationWallets:t,defaultNetwork:r,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:i}})).url:""},async getOnrampOptions(){var e;if(!await it.isNetworkSupported((e=z.state.activeCaipNetwork)==null?void 0:e.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await it.get({path:"/v1/onramp/options"})}catch{return zK}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}){var i;try{return await it.isNetworkSupported((i=z.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)?await Oi.api.post({path:"/v1/onramp/quote",params:{projectId:oe.state.projectId},body:{purchaseCurrency:t,paymentCurrency:e,amount:r,network:n}}):null}catch{return{networkFee:{amount:r,currency:e.id},paymentSubtotal:{amount:r,currency:e.id},paymentTotal:{amount:r,currency:e.id},purchaseAmount:{amount:r,currency:e.id},quoteId:"mocked-quote-id"}}},async getSmartSessions(t){var r;return await it.isNetworkSupported((r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)?it.get({path:`/v1/sessions/${t}`}):[]},async revokeSmartSession(t,e,r){var i;return await it.isNetworkSupported((i=z.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)?Oi.api.post({path:`/v1/sessions/${t}/revoke`,params:{projectId:oe.state.projectId},body:{pci:e,signature:r}}):{success:!1}},setClientId(t){Oi.clientId=t,Oi.api=new j1({baseUrl:Ox,clientId:t})}},JK=Object.freeze({enabled:!0,events:[]}),qK=new j1({baseUrl:Ce.getAnalyticsUrl(),clientId:null}),GK=5,VK=60*1e3,ul=Qr({...JK}),WK={state:ul,subscribeKey(t,e){return Qn(ul,t,e)},async sendError(t,e){if(!ul.enabled)return;const r=Date.now();if(ul.events.filter(s=>{const o=new Date(s.properties.timestamp||"").getTime();return r-o<VK}).length>=GK)return;const i={type:"error",event:e,properties:{errorType:t.name,errorMessage:t.message,stackTrace:t.stack,timestamp:new Date().toISOString()}};ul.events.push(i);try{if(typeof window>"u")return;const{projectId:s,sdkType:o,sdkVersion:a}=oe.state;await qK.post({path:"/e",params:{projectId:s,st:o,sv:a||"html-wagmi-4.2.2"},body:{eventId:Ce.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:new Date().toISOString(),props:{type:"error",event:e,errorType:t.name,errorMessage:t.message,stackTrace:t.stack}}})}catch{}},enable(){ul.enabled=!0},disable(){ul.enabled=!1},clearEvents(){ul.events=[]}};
vendor: 5,088 bytes, lines 55-57
55class Mf extends Error{constructor(e,r,n){super(e),this.originalName="AppKitError",this.name="AppKitError",this.category=r,this.originalError=n,n&&n instanceof Error&&(this.originalName=n.name),Object.setPrototypeOf(this,Mf.prototype);let i=!1;if(n instanceof Error&&typeof n.stack=="string"&&n.stack){const s=n.stack,o=s.indexOf(` 56`);if(o>-1){const a=s.substring(o+1);this.stack=`${this.name}: ${this.message} 57${a}`,i=!0}}i||(Error.captureStackTrace?Error.captureStackTrace(this,Mf):this.stack||(this.stack=`${this.name}: ${this.message}`))}}function I4(t,e){let r="";try{t instanceof Error?r=t.message:typeof t=="string"?r=t:typeof t=="object"&&t!==null?Object.keys(t).length===0?r="Unknown error":r=(t==null?void 0:t.message)||JSON.stringify(t):r=String(t)}catch(i){r="Unknown error",console.error("Error parsing error message",i)}const n=t instanceof Mf?t:new Mf(r,e,t);throw WK.sendError(n,n.category),n}function ho(t,e="INTERNAL_SDK_ERROR"){const r={};return Object.keys(t).forEach(n=>{const i=t[n];if(typeof i=="function"){let s=i;i.constructor.name==="AsyncFunction"?s=async(...o)=>{try{return await i(...o)}catch(a){return I4(a,e)}}:s=(...o)=>{try{return i(...o)}catch(a){return I4(a,e)}},r[n]=s}else r[n]=i}),r}const As=Qr({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),KK={state:As,subscribeNetworkImages(t){return di(As.networkImages,()=>t(As.networkImages))},subscribeKey(t,e){return Qn(As,t,e)},subscribe(t){return di(As,()=>t(As))},setWalletImage(t,e){As.walletImages[t]=e},setNetworkImage(t,e){As.networkImages[t]=e},setChainImage(t,e){As.chainImages[t]=e},setConnectorImage(t,e){As.connectorImages={...As.connectorImages,[t]:e}},setTokenImage(t,e){As.tokenImages[t]=e},setCurrencyImage(t,e){As.currencyImages[t]=e}},Ps=ho(KK),x4={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00",cosmos:"",sui:"",stacks:"",ton:"20f673c0-095e-49b2-07cf-eb5049dcf600",tron:"3502bb86-cc4e-420f-a387-59ea63a28b00"},ud=Qr({networkImagePromises:{},tokenImagePromises:{}}),bb={async fetchWalletImage(t){if(t)return await Pe._fetchWalletImage(t),this.getWalletImageById(t)},async fetchNetworkImage(t){if(!t)return;const e=this.getNetworkImageById(t);return e||(ud.networkImagePromises[t]||(ud.networkImagePromises[t]=Pe._fetchNetworkImage(t)),await ud.networkImagePromises[t],this.getNetworkImageById(t))},async fetchTokenImage(t){if(t)return ud.tokenImagePromises[t]||(ud.tokenImagePromises[t]=Pe._fetchTokenImage(t)),await ud.tokenImagePromises[t],this.getTokenImage(t)},getWalletImageById(t){if(t)return Ps.state.walletImages[t]},getWalletImage(t){if(t!=null&&t.image_url)return t==null?void 0:t.image_url;if(t!=null&&t.image_id)return Ps.state.walletImages[t.image_id]},getNetworkImage(t){var e,r,n;if((e=t==null?void 0:t.assets)!=null&&e.imageUrl)return(r=t==null?void 0:t.assets)==null?void 0:r.imageUrl;if((n=t==null?void 0:t.assets)!=null&&n.imageId)return Ps.state.networkImages[t.assets.imageId]},getNetworkImageById(t){if(t)return Ps.state.networkImages[t]},getConnectorImage(t){var e;if(t!=null&&t.imageUrl)return t.imageUrl;if((e=t==null?void 0:t.info)!=null&&e.icon)return t.info.icon;if(t!=null&&t.imageId)return Ps.state.connectorImages[t.imageId]},getChainImage(t){return Ps.state.networkImages[x4[t]]},getTokenImage(t){if(t)return Ps.state.tokenImages[t]},getWalletImageUrl(t){if(!t)return"";const{projectId:e,sdkType:r,sdkVersion:n}=oe.state,i=new URL(`${K.W3M_API_URL}/getWalletImage/${t}`);return i.searchParams.set("projectId",e),i.searchParams.set("st",r),i.searchParams.set("sv",n),i.toString()},getAssetImageUrl(t){if(!t)return"";const{projectId:e,sdkType:r,sdkVersion:n}=oe.state,i=new URL(`${K.W3M_API_URL}/public/getAssetImage/${t}`);return i.searchParams.set("projectId",e),i.searchParams.set("st",r),i.searchParams.set("sv",n),i.toString()},getChainNamespaceImageUrl(t){return this.getAssetImageUrl(x4[t])},async getImageByToken(t,e){if(t==="native"){const n=K.NATIVE_IMAGE_IDS_BY_NAMESPACE[e]??null;return n?bb.fetchNetworkImage(n):void 0}const[,r]=Object.entries(K.TOKEN_SYMBOLS_BY_ADDRESS).find(([n])=>n.toLowerCase()===t.toLowerCase())??[];if(r)return bb.fetchTokenImage(r)}},$n={PHANTOM:{id:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",url:"https://phantom.app",androidPackage:"app.phantom"},SOLFLARE:{id:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",url:"https://solflare.com"},COINBASE:{id:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",url:"https://go.cb-w.com",evmDeeplink:"cbwallet://miniapp"},BINANCE:{id:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25",appId:"yFK5FCqYprrXDiVFbhyRx7",deeplink:"bnc://app.binance.com/mp/app",url:"https://app.binance.com/en/download"}},XK={isCustomDeeplinkWallet(t,e){return t===$n.PHANTOM.id?e===K.CHAIN.SOLANA||e===K.CHAIN.EVM||e===K.CHAIN.BITCOIN:t===$n.SOLFLARE.id?e===K.CHAIN.SOLANA:t===$n.COINBASE.id?e===K.CHAIN.SOLANA||e===K.CHAIN.EVM:t===$n.BINANCE.id?e===K.CHAIN.BITCOIN:!1}
57,handleMobileDeeplinkRedirect(t,e,r){const n=window.location.href,i=encodeURIComponent(n),s=(r==null?void 0:r.isCoinbaseDisabled)??!1;if(t===$n.PHANTOM.id&&!("phantom"in window)){const o=n.startsWith("https")?"https":"http",a=n.split("/")[2],c=encodeURIComponent(`${o}://${a}`),l=`${$n.PHANTOM.url}/ul/browse/${i}?ref=${c}`;if(Ce.isAndroid()){const u=`intent://browse/${i}?ref=${c}#Intent;scheme=phantom;package=${$n.PHANTOM.androidPackage};end`;window.location.href=u}else window.location.href=l}if(t===$n.SOLFLARE.id&&e===K.CHAIN.SOLANA&&!("solflare"in window)&&(window.location.href=`${$n.SOLFLARE.url}/ul/v1/browse/${i}?ref=${i}`),e===K.CHAIN.SOLANA&&t===$n.COINBASE.id&&(s||!("coinbaseSolana"in window))&&(window.location.href=`${$n.COINBASE.url}/dapp?cb_url=${i}`),e===K.CHAIN.EVM&&t===$n.COINBASE.id&&(s||!("coinbaseWalletExtension"in window))&&(window.location.href=`${$n.COINBASE.evmDeeplink}?url=${i}`),e===K.CHAIN.BITCOIN&&t===$n.BINANCE.id&&!("binancew3w"in window)){const o=z.state.activeCaipNetwork,a=window.btoa("/pages/browser/index"),c=window.btoa(`url=${i}&defaultChainId=${(o==null?void 0:o.id)??1}`),l=new URL($n.BINANCE.deeplink);l.searchParams.set("appId",$n.BINANCE.appId),l.searchParams.set("startPagePath",a),l.searchParams.set("startPageQuery",c);const u=new URL($n.BINANCE.url);u.searchParams.set("_dp",window.btoa(l.toString())),window.location.href=u.toString()}}},ZK=Ce.getAnalyticsUrl(),YK=new j1({baseUrl:ZK,clientId:null}),QK=["MODAL_CREATED"],eX=45,R4=1e3*10,mn=Qr({timestamp:Date.now(),lastFlush:Date.now(),reportedErrors:{},data:{type:"track",event:"MODAL_CREATED"},pendingEvents:[],subscribedToVisibilityChange:!1,walletImpressions:[]}),gt={state:mn,subscribe(t){return di(mn,()=>t(mn))},getSdkProperties(){const{projectId:t,sdkType:e,sdkVersion:r}=oe.state;return{projectId:t,st:e,sv:r||"html-wagmi-4.2.2"}},shouldFlushEvents(){const t=JSON.stringify(mn.pendingEvents).length/1024>eX,e=mn.lastFlush+R4<Date.now();return t||e},_setPendingEvent(t){var e,r;try{let n=(e=z.getAccountData())==null?void 0:e.address;if("address"in t.data&&t.data.address&&(n=t.data.address),QK.includes(t.data.event)||typeof window>"u")return;const i=(r=z.getActiveCaipNetwork())==null?void 0:r.caipNetworkId;this.state.pendingEvents.push({eventId:Ce.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:{...t.data,address:n,properties:{..."properties"in t.data?t.data.properties:{},caipNetworkId:i}}}),mn.reportedErrors.FORBIDDEN=!1,gt.shouldFlushEvents()&>._submitPendingEvents()}catch(n){console.warn("_setPendingEvent",n)}},sendEvent(t){var r;mn.timestamp=Date.now(),mn.data=t;const e=["INITIALIZE","CONNECT_SUCCESS","SOCIAL_LOGIN_SUCCESS"];((r=oe.state.features)!=null&&r.analytics||e.includes(t.event))&>._setPendingEvent(mn),this.subscribeToFlushTriggers()},sendWalletImpressionEvent(t){mn.walletImpressions.push(t)},_transformPendingEventsForBatch(t){try{return t.filter(e=>e.props.event!=="WALLET_IMPRESSION_V2")}catch{return t}},_submitPendingEvents(){if(mn.lastFlush=Date.now(),!(mn.pendingEvents.length===0&&mn.walletImpressions.length===0))try{const t=gt._transformPendingEventsForBatch(mn.pendingEvents);mn.walletImpressions.length&&t.push({eventId:Ce.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:Date.now(),props:{type:"track",event:"WALLET_IMPRESSION_V2",items:[...mn.walletImpressions]}}),YK.sendBeacon({path:"/batch",params:gt.getSdkProperties(),body:t}),mn.reportedErrors.FORBIDDEN=!1,mn.pendingEvents=[],mn.walletImpressions=[]}catch{mn.reportedErrors.FORBIDDEN=!0}},subscribeToFlushTriggers(){var t,e,r;mn.subscribedToVisibilityChange||typeof document>"u"||(mn.subscribedToVisibilityChange=!0,(t=document==null?void 0:document.addEventListener)==null||t.call(document,"visibilitychange",()=>{document.visibilityState==="hidden"&>._submitPendingEvents()}),(e=document==null?void 0:document.addEventListener)==null||e.call(document,"freeze",()=>{gt._submitPendingEvents()}),(r=window==null?void 0:window.addEventListener)==null||r.call(window,"pagehide",()=>{gt._submitPendingEvents()}),setInterval(()=>{gt._submitPendingEvents()},R4))}},tX=Ce.getApiUrl(),Mi=new j1({baseUrl:tX,clientId:null}),rX=40,P4=4,nX=20,dt=Qr({promises:{},page:1,count:0,featured:[],allFeatured:[],recommended:[],allRecommended:[],wallets:[],filteredWallets:[],search:[],isAnalyticsEnabled:!1,excludedWallets:[],isFetchingRecommendedWallets:!1,explorerWallets:[],explorerFilteredWallets:[],plan:{tier:"none",hasExceededUsageLimit:!1,limits:{isAboveRpcLim
57it:!1,isAboveMauLimit:!1}}}),Pe={state:dt,subscribeKey(t,e){return Qn(dt,t,e)},_getSdkProperties(){const{projectId:t,sdkType:e,sdkVersion:r}=oe.state;return{projectId:t,st:e||"appkit",sv:r||"html-wagmi-4.2.2"}},_filterOutExtensions(t){return oe.state.isUniversalProvider?t.filter(e=>!!(e.mobile_link||e.desktop_link||e.webapp_link)):t},async _fetchWalletImage(t){const e=`${Mi.baseUrl}/getWalletImage/${t}`,r=await Mi.getBlob({path:e,params:Pe._getSdkProperties()});Ps.setWalletImage(t,URL.createObjectURL(r))},async _fetchNetworkImage(t){const e=`${Mi.baseUrl}/public/getAssetImage/${t}`,r=await Mi.getBlob({path:e,params:Pe._getSdkProperties()});Ps.setNetworkImage(t,URL.createObjectURL(r))},async _fetchConnectorImage(t){const e=`${Mi.baseUrl}/public/getAssetImage/${t}`,r=await Mi.getBlob({path:e,params:Pe._getSdkProperties()});Ps.setConnectorImage(t,URL.createObjectURL(r))},async _fetchCurrencyImage(t){const e=`${Mi.baseUrl}/public/getCurrencyImage/${t}`,r=await Mi.getBlob({path:e,params:Pe._getSdkProperties()});Ps.setCurrencyImage(t,URL.createObjectURL(r))},async _fetchTokenImage(t){const e=`${Mi.baseUrl}/public/getTokenImage/${t}`,r=await Mi.getBlob({path:e,params:Pe._getSdkProperties()});Ps.setTokenImage(t,URL.createObjectURL(r))},_filterWalletsByPlatform(t){const e=t.length,r=Ce.isMobile()?t==null?void 0:t.filter(i=>i.mobile_link||i.webapp_link?!0:Object.values($n).map(o=>o.id).includes(i.id)):t,n=e-r.length;return{filteredWallets:r,mobileFilteredOutWalletsLength:n}},async fetchProjectConfig(){return(await Mi.get({path:"/appkit/v1/config",params:Pe._getSdkProperties()})).features},async fetchUsage(){try{const t=await Mi.get({path:"/appkit/v1/project-limits",params:Pe._getSdkProperties()}),{tier:e,isAboveMauLimit:r,isAboveRpcLimit:n}=t.planLimits,i=e==="starter",s=r||n;Pe.state.plan={tier:e,hasExceededUsageLimit:i&&s,limits:{isAboveRpcLimit:n,isAboveMauLimit:r}}}catch(t){console.warn("Failed to fetch usage",t)}},async fetchAllowedOrigins(){try{const{allowedOrigins:t}=await Mi.get({path:"/projects/v1/origins",params:Pe._getSdkProperties()});return t}catch(t){if(t instanceof Error&&t.cause instanceof Response){const e=t.cause.status;if(e===K.HTTP_STATUS_CODES.TOO_MANY_REQUESTS)throw new Error("RATE_LIMITED",{cause:t});if(e>=K.HTTP_STATUS_CODES.SERVER_ERROR&&e<600)throw new Error("SERVER_ERROR",{cause:t});return[]}return[]}},async fetchNetworkImages(){const t=z.getAllRequestedCaipNetworks(),e=t==null?void 0:t.map(({assets:r})=>r==null?void 0:r.imageId).filter(Boolean).filter(r=>!bb.getNetworkImageById(r));e&&await Promise.allSettled(e.map(r=>Pe._fetchNetworkImage(r)))},async fetchConnectorImages(){const{connectors:t}=be.state,e=t.map(({imageId:r})=>r).filter(Boolean);await Promise.allSettled(e.map(r=>Pe._fetchConnectorImage(r)))},async fetchCurrencyImages(t=[]){await Promise.allSettled(t.map(e=>Pe._fetchCurrencyImage(e)))},async fetchTokenImages(t=[]){await Promise.allSettled(t.map(e=>Pe._fetchTokenImage(e)))},async fetchWallets(t){var o;const e=t.exclude??[];Pe._getSdkProperties().sv.startsWith("html-core-")&&e.push(...Object.values($n).map(a=>a.id));const n=await Mi.get({path:"/getWallets",params:{...Pe._getSdkProperties(),...t,page:String(t.page),entries:String(t.entries),include:(o=t.include)==null?void 0:o.join(","),exclude:e.join(",")}}),{filteredWallets:i,mobileFilteredOutWalletsLength:s}=Pe._filterWalletsByPlatform(n==null?void 0:n.data);return{data:i||[],count:n==null?void 0:n.count,mobileFilteredOutWalletsLength:s}},async prefetchWalletRanks(){const t=be.state.connectors;if(!(t!=null&&t.length))return;const e={page:1,entries:20,badge:"certified"};if(e.names=t.map(i=>i.name).join(","),z.state.activeChain===K.CHAIN.EVM){const i=[...t.flatMap(s=>{var o;return((o=s.connectors)==null?void 0:o.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}))||[]}),...t.map(s=>{var o;return(o=s.info)==null?void 0:o.rdns})].filter(s=>typeof s=="string"&&s.length>0);i.length&&(e.rdns=i.join(","))}const{data:r}=await Pe.fetchWallets(e);dt.explorerWallets=r,be.extendConnectorsWithExplorerWallets(r);const n=z.getRequestedCaipNetworkIds().join(",");dt.explorerFilteredWallets=r.filter(i=>{var s;return(s=i.chains)==null?void 0:s.some(o=>n.includes(o))})},async fetchFeaturedWallets(){const{featuredWalletIds:t}=oe.state;if(t!=null&&t.length){const e={...Pe._getSdkProperties(),page:1,entries:(t==null?void 0:t.length)??P4,include:t},{data:r}=await Pe.fetchWallets(e),n=[...r].sort((s,o)=>t.indexOf(s.id)-t.indexOf(o.id)),i=n.map(s=>
vendor: 4,325 bytes, line 57
57s.image_id).filter(Boolean);await Promise.allSettled(i.map(s=>Pe._fetchWalletImage(s))),dt.featured=n,dt.allFeatured=n}},async fetchRecommendedWallets(){try{dt.isFetchingRecommendedWallets=!0;const{includeWalletIds:t,excludeWalletIds:e,featuredWalletIds:r}=oe.state,n=[...e??[],...r??[]].filter(Boolean),i=z.getRequestedCaipNetworkIds().join(","),s={page:1,entries:P4,include:t,exclude:n,chains:i},{data:o,count:a}=await Pe.fetchWallets(s),c=le.getRecentWallets(),l=o.map(f=>f.image_id).filter(Boolean),u=c.map(f=>f.image_id).filter(Boolean);await Promise.allSettled([...l,...u].map(f=>Pe._fetchWalletImage(f))),dt.recommended=o,dt.allRecommended=o,dt.count=a??0}catch{}finally{dt.isFetchingRecommendedWallets=!1}},async fetchWalletsByPage({page:t,entries:e,badge:r,include:n,exclude:i}){const{includeWalletIds:s,excludeWalletIds:o,featuredWalletIds:a}=oe.state,c=z.getRequestedCaipNetworkIds().join(","),l=[...dt.recommended.map(({id:b})=>b),...o??[],...a??[]].filter(Boolean),u={page:t,entries:e??rX,include:n??s,exclude:i??l,badge_type:r,chains:c},{data:f,count:d,mobileFilteredOutWalletsLength:h}=await Pe.fetchWallets(u);dt.mobileFilteredOutWalletsLength=h+(dt.mobileFilteredOutWalletsLength??0);const g=f.slice(0,nX).map(b=>b.image_id).filter(Boolean);await Promise.allSettled(g.map(b=>Pe._fetchWalletImage(b))),dt.wallets=Ce.uniqueBy([...dt.wallets,...Pe._filterOutExtensions(f)],"id").filter(b=>{var w;return(w=b.chains)==null?void 0:w.some(x=>c.includes(x))}),dt.count=d>dt.count?d:dt.count,dt.page=t},async initializeExcludedWallets({ids:t}){const e={page:1,entries:t.length,include:t},{data:r}=await Pe.fetchWallets(e);r&&r.forEach(n=>{dt.excludedWallets.push({rdns:n.rdns,name:n.name})})},async searchWallet({search:t,badge:e,entries:r,page:n,include:i,exclude:s}){const{includeWalletIds:o,excludeWalletIds:a}=oe.state,c=z.getRequestedCaipNetworkIds().join(",");dt.search=[];const l={page:n??1,entries:r??100,search:t==null?void 0:t.trim(),badge_type:e,include:i??o,exclude:s??a,chains:c},{data:u}=await Pe.fetchWallets(l);gt.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:e??"",search:t??""}});const f=u.map(d=>d.image_id).filter(Boolean);await Promise.allSettled([...f.map(d=>Pe._fetchWalletImage(d)),Ce.wait(300)]),dt.search=Pe._filterOutExtensions(u)},initPromise(t,e){const r=dt.promises[t];return r||(dt.promises[t]=e())},prefetch({fetchConnectorImages:t=!0,fetchFeaturedWallets:e=!0,fetchRecommendedWallets:r=!0,fetchNetworkImages:n=!0,fetchWalletRanks:i=!0}={}){const s=[t&&Pe.initPromise("connectorImages",Pe.fetchConnectorImages),e&&Pe.initPromise("featuredWallets",Pe.fetchFeaturedWallets),r&&Pe.initPromise("recommendedWallets",Pe.fetchRecommendedWallets),n&&Pe.initPromise("networkImages",Pe.fetchNetworkImages),i&&Pe.initPromise("walletRanks",Pe.prefetchWalletRanks)].filter(Boolean);return Promise.allSettled(s)},prefetchAnalyticsConfig(){var t;(t=oe.state.features)!=null&&t.analytics&&Pe.fetchAnalyticsConfig()},async fetchAnalyticsConfig(){try{const{isAnalyticsEnabled:t}=await Mi.get({path:"/getAnalyticsConfig",params:Pe._getSdkProperties()});oe.setFeatures({analytics:t})}catch{oe.setFeatures({analytics:!1})}},filterByNamespaces(t){if(!(t!=null&&t.length)){dt.featured=dt.allFeatured,dt.recommended=dt.allRecommended;return}const e=z.getRequestedCaipNetworkIds().join(",");dt.featured=dt.allFeatured.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),dt.recommended=dt.allRecommended.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),dt.filteredWallets=dt.wallets.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))})},clearFilterByNamespaces(){dt.filteredWallets=[]},setFilterByNamespace(t){if(!t){dt.featured=dt.allFeatured,dt.recommended=dt.allRecommended;return}const e=z.getRequestedCaipNetworkIds().join(",");dt.featured=dt.allFeatured.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),dt.recommended=dt.allRecommended.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))}),dt.filteredWallets=dt.wallets.filter(r=>{var n;return(n=r.chains)==null?void 0:n.some(i=>e.includes(i))})}},Ll={filterOutDuplicatesByRDNS(t){const e=oe.state.enableEIP6963?be.state.connectors:[],r=le.getRecentWallets(),n=e.map(a=>{var c;return(c=a.info)==null?void 0:c.rdns}
57).filter(Boolean),i=r.map(a=>a.rdns).filter(Boolean),s=n.concat(i);if(s.includes("io.metamask.mobile")&&Ce.isMobile()){const a=s.indexOf("io.metamask.mobile");s[a]="io.metamask"}return t.filter(a=>!(a!=null&&a.rdns&&s.includes(String(a.rdns))||!(a!=null&&a.rdns)&&e.some(l=>l.name===a.name)))},filterOutDuplicatesByIds(t){const e=be.state.connectors.filter(a=>a.type==="ANNOUNCED"||a.type==="INJECTED"||a.type==="MULTI_CHAIN"),r=le.getRecentWallets(),n=e.map(a=>{var c;return a.explorerId||((c=a.explorerWallet)==null?void 0:c.id)||a.id}),i=r.map(a=>a.id),s=n.concat(i);return t.filter(a=>!s.includes(a==null?void 0:a.id))},filterOutDuplicateWallets(t){const e=this.filterOutDuplicatesByRDNS(t);return this.filterOutDuplicatesByIds(e)},markWalletsAsInstalled(t){const{connectors:e}=be.state,{featuredWalletIds:r}=oe.state,n=e.filter(o=>o.type==="ANNOUNCED").reduce((o,a)=>{var c;return(c=a.info)!=null&&c.rdns&&(o[a.info.rdns]=!0),o},{});return t.map(o=>({...o,installed:!!o.rdns&&!!n[o.rdns??""]})).sort((o,a)=>{const c=Number(a.installed)-Number(o.installed);if(c!==0)return c;if(r!=null&&r.length){const l=r.indexOf(o.id),u=r.indexOf(a.id);if(l!==-1&&u!==-1)return l-u;if(l!==-1)return-1;if(u!==-1)return 1}return 0})},getConnectOrderMethod(t,e){var c;const r=(t==null?void 0:t.connectMethodsOrder)||((c=oe.state.features)==null?void 0:c.connectMethodsOrder),n=e||be.state.connectors;if(r)return r;const{injected:i,announced:s}=Bi.getConnectorsByType(n,Pe.state.recommended,Pe.state.featured),o=i.filter(Bi.showConnector),a=s.filter(Bi.showConnector);return o.length||a.length?["wallet","email","social"]:kt.DEFAULT_CONNECT_METHOD_ORDER},isExcluded(t){const e=!!t.rdns&&Pe.state.excludedWallets.some(n=>n.rdns===t.rdns),r=!!t.name&&Pe.state.excludedWallets.some(n=>TN.isLowerCaseMatch(n.name,t.name));return e||r},markWalletsWithDisplayIndex(t){return t.map((e,r)=>({...e,display_index:r}))},filterWalletsByWcSupport(t){return Ee.state.wcBasic?t.filter(e=>e.supports_wc):Ce.isMobile()?t.filter(e=>e.supports_wc||kt.MANDATORY_WALLET_IDS_ON_MOBILE.includes(e.id)):t},getWalletConnectWallets(t){var s;const e=[...Pe.state.featured,...Pe.state.recommended];((s=Pe.state.filteredWallets)==null?void 0:s.length)>0?e.push(...Pe.state.filteredWallets):e.push(...t);const r=Ce.uniqueBy(e,"id"),n=Ll.markWalletsAsInstalled(r),i=Ll.filterWalletsByWcSupport(n);return Ll.markWalletsWithDisplayIndex(i)}},Bi={getConnectorsByType(t,e,r){const{customWallets:n}=oe.state,i=le.getRecentWallets(),s=Ll.filterOutDuplicateWallets(e),o=Ll.filterOutDuplicateWallets(r),a=t.filter(f=>f.type==="MULTI_CHAIN"),c=t.filter(f=>f.type==="ANNOUNCED"),l=t.filter(f=>f.type==="INJECTED"),u=t.filter(f=>f.type==="EXTERNAL");return{custom:n,recent:i,external:u,multiChain:a,announced:c,injected:l,recommended:s,featured:o}},showConnector(t){var i;const e=(i=t.info)==null?void 0:i.rdns,r=!!e&&Pe.state.excludedWallets.some(s=>!!s.rdns&&s.rdns===e),n=!!t.name&&Pe.state.excludedWallets.some(s=>TN.isLowerCaseMatch(s.name,t.name));return!(t.type==="INJECTED"&&(t.name==="Browser Wallet"&&(!Ce.isMobile()||Ce.isMobile()&&!e&&!Ee.checkInstalled())||r||n)||(t.type==="ANNOUNCED"||t.type==="EXTERNAL")&&(r||n))},getIsConnectedWithWC(){return Array.from(z.state.chains.values()).some(r=>be.getConnectorId(r.namespace)===K.CONNECTOR_ID.WALLET_CONNECT)},getConnectorTypeOrder({recommended:t,featured:e,custom:r,recent:n,announced:i,injected:s,multiChain:o,external:a,overriddenConnectors:c=(l=>(l=oe.state.features)==null?void 0:l.connectorTypeOrder)()??[]}){const f=[{type:"walletConnect",isEnabled:!0},{type:"recent",isEnabled:n.length>0},{type:"injected",isEnabled:[...s,...i,...o].length>0},{type:"featured",isEnabled:e.length>0},{type:"custom",isEnabled:r&&r.length>0},{type:"external",isEnabled:a.length>0},{type:"recommended",isEnabled:t.length>0}].filter(b=>b.isEnabled),d=new Set(f.map(b=>b.type)),h=c.filter(b=>d.has(b)).map(b=>({type:b,isEnabled:!0})),g=f.filter(({type:b})=>!h.some(({type:x})=>x===b));return Array.from(new Set([...h,...g].map(({type:b})=>b)))},sortConnectorsByExplorerWallet(t){return[...t].sort((e,r)=>e.explorerWallet&&r.explorerWallet?(e.explorerWallet.order??0)-(r.explorerWallet.order??0):e.explorerWallet?-1:r.explorerWallet?1:0)},getPriority(t){return t.id===K.CONNECTOR_ID.BASE_ACCOUNT?0:t.id===K.CONNECTOR_ID.COINBASE||t.id===K.CONNECTOR_ID.COINBASE_SDK?1:2},sortConnectorsByPriority(t){return[...t].sort((e,r)=>
57Bi.getPriority(e)-Bi.getPriority(r))},getAuthName({email:t,socialUsername:e,socialProvider:r}){return e?r&&r==="discord"&&e.endsWith("0")?e.slice(0,-1):e:t.length>30?`${t.slice(0,-3)}...`:t},async fetchProviderData(t){var e,r;try{if(t.name==="Browser Wallet"&&!Ce.isMobile())return{accounts:[],chainId:void 0};if(t.id===K.CONNECTOR_ID.AUTH)return{accounts:[],chainId:void 0};const[n,i]=await Promise.all([(e=t.provider)==null?void 0:e.request({method:"eth_accounts"}),(r=t.provider)==null?void 0:r.request({method:"eth_chainId"}).then(s=>Number(s))]);return{accounts:n,chainId:i}}catch(n){return console.warn(`Failed to fetch provider data for ${t.name}`,n),{accounts:[],chainId:void 0}}},getFilteredCustomWallets(t){const e=le.getRecentWallets(),r=be.state.connectors.map(o=>{var a;return(a=o.info)==null?void 0:a.rdns}).filter(Boolean),n=e.map(o=>o.rdns).filter(Boolean),i=r.concat(n);if(i.includes("io.metamask.mobile")&&Ce.isMobile()){const o=i.indexOf("io.metamask.mobile");i[o]="io.metamask"}return t.filter(o=>!i.includes(String(o==null?void 0:o.rdns)))},hasWalletConnector(t){return be.state.connectors.some(e=>e.id===t.id||e.name===t.name)},isWalletCompatibleWithCurrentChain(t){const e=z.state.activeChain;return e&&t.chains?t.chains.some(r=>{const n=r.split(":")[0];return e===n}):!0},getFilteredRecentWallets(){return le.getRecentWallets().filter(r=>!Ll.isExcluded(r)).filter(r=>!this.hasWalletConnector(r)).filter(r=>this.isWalletCompatibleWithCurrentChain(r))},getCappedRecommendedWallets(t){const{connectors:e}=be.state,{customWallets:r,featuredWalletIds:n}=oe.state,i=e.find(k=>k.id==="walletConnect"),s=e.filter(k=>k.type==="INJECTED"||k.type==="ANNOUNCED"||k.type==="MULTI_CHAIN");if(!i&&!s.length&&!(r!=null&&r.length))return[];const o=B3.isEmailEnabled(),a=B3.isSocialsEnabled(),c=s.filter(k=>k.name!=="Browser Wallet"&&k.name!=="WalletConnect"),l=(n==null?void 0:n.length)||0,u=(r==null?void 0:r.length)||0,f=c.length||0,d=o?1:0,h=a?1:0,g=l+u+f+d+h,w=Math.max(0,4-g);return w<=0?[]:Ll.filterOutDuplicateWallets(t).slice(0,w)},processConnectorsByType(t,e=!0){const r=Bi.sortConnectorsByExplorerWallet([...t]);return e?r.filter(Bi.showConnector):r},connectorList(){const t=Bi.getConnectorsByType(be.state.connectors,Pe.state.recommended,Pe.state.featured),e=this.processConnectorsByType(t.announced.filter(h=>h.id!=="walletConnect")),r=this.processConnectorsByType(t.injected),n=this.processConnectorsByType(t.multiChain.filter(h=>h.name!=="WalletConnect"),!1),i=t.custom,s=t.recent,o=this.processConnectorsByType(t.external.filter(h=>h.id!==K.CONNECTOR_ID.COINBASE_SDK&&h.id!==K.CONNECTOR_ID.BASE_ACCOUNT)),a=t.recommended,c=t.featured,l=Bi.getConnectorTypeOrder({custom:i,recent:s,announced:e,injected:r,multiChain:n,recommended:a,featured:c,external:o}),u=be.state.connectors.find(h=>h.id==="walletConnect"),f=Ce.isMobile(),d=[];for(const h of l)switch(h){case"walletConnect":{!f&&u&&d.push({kind:"connector",subtype:"walletConnect",connector:u});break}case"recent":{Bi.getFilteredRecentWallets().forEach(b=>d.push({kind:"wallet",subtype:"recent",wallet:b}));break}case"injected":{n.forEach(g=>d.push({kind:"connector",subtype:"multiChain",connector:g})),e.forEach(g=>d.push({kind:"connector",subtype:"announced",connector:g})),r.forEach(g=>d.push({kind:"connector",subtype:"injected",connector:g}));break}
57case"featured":{c.forEach(g=>d.push({kind:"wallet",subtype:"featured",wallet:g}));break}case"custom":{Bi.getFilteredCustomWallets(i??[]).forEach(b=>d.push({kind:"wallet",subtype:"custom",wallet:b}));break}case"external":{o.forEach(g=>d.push({kind:"connector",subtype:"external",connector:g}));break}case"recommended":{Bi.getCappedRecommendedWallets(a).forEach(b=>d.push({kind:"wallet",subtype:"recommended",wallet:b}));break}default:console.warn(`Unknown connector type: ${h}`)}return d},hasInjectedConnectors(){return be.state.connectors.filter(t=>(t.type==="INJECTED"||t.type==="ANNOUNCED"||t.type==="MULTI_CHAIN")&&t.name!=="Browser Wallet"&&t.name!=="WalletConnect").length}},iX=["ConnectingExternal","ConnectingMultiChain","ConnectingSocial","ConnectingFarcaster"],Nr=Qr({view:"Connect",history:["Connect"],transactionStack:[]}),sX={state:Nr,subscribeKey(t,e){return Qn(Nr,t,e)},pushTransactionStack(t){Nr.transactionStack.push(t)},popTransactionStack(t){const e=Nr.transactionStack.pop();if(!e)return;const{onSuccess:r,onError:n,onCancel:i}=e;switch(t){case"success":r==null||r();break;case"error":n==null||n(),ze.goBack();break;case"cancel":i==null||i(),ze.goBack();break}},push(t,e){let r=t,n=e;Pe.state.plan.hasExceededUsageLimit&&iX.includes(t)&&(r="UsageExceeded",n=void 0),r!==Nr.view&&(Nr.view=r,Nr.history.push(r),Nr.data=n)},reset(t,e){Nr.view=t,Nr.history=[t],Nr.data=e},replace(t,e){Nr.history.at(-1)===t||(Nr.view=t,Nr.history[Nr.history.length-1]=t,Nr.data=e)},goBack(){var n,i;const t=z.state.activeCaipAddress,e=ze.state.view==="ConnectingFarcaster",r=!t&&e;if(Nr.history.length>1){Nr.history.pop();const[s]=Nr.history.slice(-1);s&&(t&&s==="Connect"?Nr.view="Account":Nr.view=s)}else Dt.close();(n=Nr.data)!=null&&n.wallet&&(Nr.data.wallet=void 0),(i=Nr.data)!=null&&i.redirectView&&(Nr.data.redirectView=void 0),setTimeout(()=>{var s,o,a;if(r){z.setAccountProp("farcasterUrl",void 0,z.state.activeChain);const c=be.getAuthConnector();(s=c==null?void 0:c.provider)==null||s.reload();const l=yp(oe.state);(a=(o=c==null?void 0:c.provider)==null?void 0:o.syncDappData)==null||a.call(o,{metadata:l.metadata,sdkVersion:l.sdkVersion,projectId:l.projectId,sdkType:l.sdkType})}},100)},goBackToIndex(t){if(Nr.history.length>1){Nr.history=Nr.history.slice(0,t+1);const[e]=Nr.history.slice(-1);e&&(Nr.view=e)}},goBackOrCloseModal(){ze.state.history.length>1?ze.goBack():Dt.close()}},ze=ho(sX),ac=Qr({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),F3={state:ac,subscribe(t){return di(ac,()=>t(ac))},setThemeMode(t){ac.themeMode=t;try{const e=be.getAuthConnector();if(e){const r=F3.getSnapshot().themeVariables;e.provider.syncTheme({themeMode:t,themeVariables:r,w3mThemeVariables:Ep(r,t)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(t){ac.themeVariables={...ac.themeVariables,...t};try{const e=be.getAuthConnector();if(e){const r=F3.getSnapshot().themeVariables;e.provider.syncTheme({themeVariables:r,w3mThemeVariables:Ep(ac.themeVariables,ac.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return yp(ac)}},rs=ho(F3),Mx=Object.fromEntries(NN.map(t=>[t,void 0])),oX=Object.fromEntries(NN.map(t=>[t,!0])),Qt=Qr({allConnectors:[],connectors:[],activeConnector:void 0,filterByNamespace:void 0,activeConnectorIds:Mx,filterByNamespaceMap:oX}),aX={state:Qt,subscribe(t){return di(Qt,()=>{t(Qt)})},subscribeKey(t,e){return Qn(Qt,t,e)},initialize(t){t.forEach(e=>{const r=le.getConnectedConnectorId(e);r&&be.setConnectorId(r,e)})},setActiveConnector(t){t&&(Qt.activeConnector=vp(t))},setConnectors(t){t.filter(i=>!Qt.allConnectors.some(s=>s.id===i.id&&be.getConnectorName(s.name)===be.getConnectorName(i.name)&&s.chain===i.chain)).forEach(i=>{i.type!=="MULTI_CHAIN"&&Qt.allConnectors.push(vp(i))});const r=be.getEnabledNamespaces(),n=be.getEnabledConnectors(r);Qt.connectors=be.mergeMultiChainConnectors(n)},filterByNamespaces(t){Object.keys(Qt.filterByNamespaceMap).forEach(e=>{Qt.filterByNamespaceMap[e]=!1}),t.forEach(e=>{Qt.filterByNamespaceMap[e]=!0}),be.updateConnectorsForEnabledNamespaces()},filterByNamespace(t,e){Qt.filterByNamespaceMap[t]=e,be.updateConnectorsForEnabledNamespaces()},updateConnectorsForEnabledNamespaces(){const t=be.getEnabledNamespaces(),e=be.getEnabledConnectors(t),r=be.areAllNamespacesEnabled();Qt.connectors=be.mergeMultiChainConnectors(e),r?Pe.clearFilterByNamespaces():Pe.filterByNamespaces(t)},getEnabledNamespaces(){return Object.entries(Qt.filterByNamespaceMap).filter(([t,e])=>e).map(([t])=>t)},getEnabledConnectors(t){return Qt.allConnectors.filter(e=>t.includes(e.chain))},areAllNamespacesEnabled(){return Object.values(Qt.filterByNamespaceMap).every(t=>t)},mergeMultiChainConnectors(t){const e=be.generateConnectorMapByName(t),r=[];return e.forEach(n=>{const i=n[0],s=(i==null?void 0:i.id)===K.CONNECTOR_ID.AUTH;n.length>
571&&i?r.push({name:i.name,imageUrl:i.imageUrl,imageId:i.imageId,connectors:[...n],type:s?"AUTH":"MULTI_CHAIN",chain:"eip155",id:(i==null?void 0:i.id)||""}):i&&r.push(i)}),r},generateConnectorMapByName(t){const e=new Map;return t.forEach(r=>{const{name:n}=r,i=be.getConnectorName(n);if(!i)return;const s=e.get(i)||[];s.find(a=>a.chain===r.chain)||s.push(r),e.set(i,s)}),e},getConnectorName(t){return t&&({"Trust Wallet":"Trust"}[t]||t)},getUniqueConnectorsByName(t){const e=[];return t.forEach(r=>{e.find(n=>n.chain===r.chain)||e.push(r)}),e},addConnector(t){var e,r,n;if(t.id===K.CONNECTOR_ID.AUTH){const i=t,s=yp(oe.state),o=rs.getSnapshot().themeMode,a=rs.getSnapshot().themeVariables;(r=(e=i==null?void 0:i.provider)==null?void 0:e.syncDappData)==null||r.call(e,{metadata:s.metadata,sdkVersion:s.sdkVersion,projectId:s.projectId,sdkType:s.sdkType}),(n=i==null?void 0:i.provider)==null||n.syncTheme({themeMode:o,themeVariables:a,w3mThemeVariables:Ep(a,o)}),be.setConnectors([t])}else be.setConnectors([t])},getAuthConnector(t){var n;const e=t||z.state.activeChain,r=Qt.connectors.find(i=>i.id===K.CONNECTOR_ID.AUTH);if(r)return(n=r==null?void 0:r.connectors)!=null&&n.length?r.connectors.find(s=>s.chain===e):r},getAnnouncedConnectorRdns(){return Qt.connectors.filter(t=>t.type==="ANNOUNCED").map(t=>{var e;return(e=t.info)==null?void 0:e.rdns})},getConnectorById(t){return Bi.sortConnectorsByPriority(Qt.allConnectors).find(r=>r.id===t)},getConnector({id:t,namespace:e}){const r=e||z.state.activeChain,n=Qt.allConnectors.filter(o=>o.chain===r);return Bi.sortConnectorsByPriority(n).find(o=>o.id===t||o.explorerId===t)},syncIfAuthConnector(t){var s,o;if(t.id!=="AUTH")return;const e=t,r=yp(oe.state),n=rs.getSnapshot().themeMode,i=rs.getSnapshot().themeVariables;(o=(s=e==null?void 0:e.provider)==null?void 0:s.syncDappData)==null||o.call(s,{metadata:r.metadata,sdkVersion:r.sdkVersion,sdkType:r.sdkType,projectId:r.projectId}),e.provider.syncTheme({themeMode:n,themeVariables:i,w3mThemeVariables:Ep(i,n)})},getConnectorsByNamespace(t){const e=Qt.allConnectors.filter(r=>r.chain===t);return be.mergeMultiChainConnectors(e)},canSwitchToSmartAccount(t){return z.checkIfSmartAccountEnabled()&&Li(t)===Tn.ACCOUNT_TYPES.EOA},selectWalletConnector(t){var i;const e=(i=ze.state.data)==null?void 0:i.redirectView,r=z.state.activeChain,n=r?be.getConnector({id:t.id,namespace:r}):void 0;XK.handleMobileDeeplinkRedirect((n==null?void 0:n.explorerId)||t.id,z.state.activeChain,{isCoinbaseDisabled:oe.state.enableCoinbase===!1}),n?ze.push("ConnectingExternal",{connector:n,wallet:t,redirectView:e}):ze.push("ConnectingWalletConnect",{wallet:t,redirectView:e})},getConnectors(t){return t?be.getConnectorsByNamespace(t):be.mergeMultiChainConnectors(Qt.allConnectors)},setFilterByNamespace(t){Qt.filterByNamespace=t,Qt.connectors=be.getConnectors(t),Pe.setFilterByNamespace(t)},setConnectorId(t,e){t&&(Qt.activeConnectorIds={...Qt.activeConnectorIds,[e]:t},le.setConnectedConnectorId(e,t))},removeConnectorId(t){Qt.activeConnectorIds={...Qt.activeConnectorIds,[t]:void 0},le.deleteConnectedConnectorId(t)},getConnectorId(t){if(t)return Qt.activeConnectorIds[t]},isConnected(t){return t?!!Qt.activeConnectorIds[t]:Object.values(Qt.activeConnectorIds).some(e=>!!e)},resetConnectorIds(){Qt.activeConnectorIds={...Mx}},extendConnectorsWithExplorerWallets(t){Qt.allConnectors.forEach(n=>{const i=t.find(s=>{var o;return s.id===n.id||s.rdns&&s.rdns===((o=n.info)==null?void 0:o.rdns)});i&&(n.explorerWallet=i)});const e=be.getEnabledNamespaces(),r=be.getEnabledConnectors(e);Qt.connectors=be.mergeMultiChainConnectors(r)},async connect(t={}){const{namespace:e}=t;return be.setFilterByNamespace(e),ze.push("Connect",{addWalletForNamespace:e}),new Promise((r,n)=>{if(e){const i=z.subscribeChainProp("accountState",o=>{o!=null&&o.caipAddress&&(r({caipAddress:o==null?void 0:o.caipAddress}),i())},e),s=Dt.subscribeKey("open",o=>{o||(n(new Error("Modal closed")),s())})}else{const i=z.subscribeKey("activeCaipAddress",o=>{o&&(r({caipAddress:o}),i())}),s=Dt.subscribeKey("open",o=>{o||(n(new Error("Modal closed")),s())})}})}},be=ho(aX),cX=1e3,a0={checkNamespaceConnectorId(t,e){return be.getConnectorId(t)===e},isSocialProvider(t){return kt.DEFAULT_REMOTE_FEATURES.socials.includes(t)},connectWalletConnect({walletConnect:t,connector:e,closeModalOnConnect:r=!0,redirectViewOnModalClose:n="Connect",onOpen:i,onConnect:s}){return new Promise((o,a)=>
57{if(t&&be.setActiveConnector(e),i==null||i(Ce.isMobile()&&t),n){const l=Dt.subscribeKey("open",u=>{u||(ze.state.view!==n&&ze.replace(n),l(),a(new Error("Modal closed")))})}const c=z.subscribeKey("activeCaipAddress",l=>{l&&(s==null||s(),r&&Dt.close(),c(),o(kn.parseCaipAddress(l)))})})},connectExternal(t){return new Promise((e,r)=>{const n=z.subscribeKey("activeCaipAddress",i=>{i&&(Dt.close(),n(),e(kn.parseCaipAddress(i)))});Ee.connectExternal(t,t.chain).catch(()=>{n(),r(new Error("Connection rejected"))})})},connectSocial({social:t,namespace:e,closeModalOnConnect:r=!0,onOpenFarcaster:n,onConnect:i}){let s,o=!1,a=null;const c=e||z.state.activeChain,l=z.subscribeKey("activeCaipAddress",u=>{u&&(r&&Dt.close(),l())});return new Promise((u,f)=>{async function d(g){var b;if((b=g.data)!=null&&b.resultUri)if(g.origin===K.SECURE_SITE_SDK_ORIGIN){window.removeEventListener("message",d,!1);try{const w=be.getAuthConnector(c);if(w&&!o){s&&s.close(),o=!0;const x=g.data.resultUri;gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:t}}),le.setConnectedSocialProvider(t),await Ee.connectExternal({id:w.id,type:w.type,socialUri:x},w.chain);const k=z.state.activeCaipAddress;if(!k){f(new Error("Failed to connect"));return}u(kn.parseCaipAddress(k)),gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:t}})}}catch(w){gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:t,message:Ce.parseError(w)}}),f(new Error("Failed to connect"))}}else gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:t,message:"Untrusted Origin"}})}async function h(){if(gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:t}}),t==="farcaster"){n==null||n();const g=Dt.subscribeKey("open",w=>{!w&&t==="farcaster"&&(f(new Error("Popup closed")),i==null||i(),g())}),b=be.getAuthConnector();if(b){const w=z.getAccountData(c);if(!(w!=null&&w.farcasterUrl))try{const{url:x}=await b.provider.getFarcasterUri();z.setAccountProp("farcasterUrl",x,c)}catch{f(new Error("Failed to connect to farcaster"))}}}else{const g=be.getAuthConnector();a=Ce.returnOpenHref(`${K.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes");try{if(g){const{uri:b}=await g.provider.getSocialRedirectUri({provider:t});if(a&&b){a.location.href=b,s=a;const w=setInterval(()=>{s!=null&&s.closed&&!o&&(f(new Error("Popup closed")),clearInterval(w))},1e3);window.addEventListener("message",d,!1)}else a==null||a.close(),f(new Error("Failed to initiate social connection"))}}catch{f(new Error("Failed to initiate social connection")),a==null||a.close()}}}h()})},connectEmail({closeModalOnConnect:t=!0,redirectViewOnModalClose:e="Connect",onOpen:r,onConnect:n}){return new Promise((i,s)=>{if(r==null||r(),e){const a=Dt.subscribeKey("open",c=>{c||(ze.state.view!==e&&ze.replace(e),a(),s(new Error("Modal closed")))})}const o=z.subscribeKey("activeCaipAddress",a=>{a&&(n==null||n(),t&&Dt.close(),o(),i(kn.parseCaipAddress(a)))})})},async updateEmail(){const t=le.getConnectedConnectorId(z.state.activeChain),e=be.getAuthConnector();if(!e)throw new Error("No auth connector found");if(t!==K.CONNECTOR_ID.AUTH)throw new Error("Not connected to email or social");const r=e.provider.getEmail()??"";return await Dt.open({view:"UpdateEmailWallet",data:{email:r,redirectView:void 0}}),new Promise((n,i)=>{const s=setInterval(()=>{const a=e.provider.getEmail()??"";a!==r&&(Dt.close(),clearInterval(s),o(),n({email:a}))},cX),o=Dt.subscribeKey("open",a=>{a||(ze.state.view!=="Connect"&&ze.push("Connect"),clearInterval(s),o(),i(new Error("Modal closed")))})})},canSwitchToSmartAccount(t){return z.checkIfSmartAccountEnabled()&&Li(t)===Tn.ACCOUNT_TYPES.EOA}};function Dx(){var n,i;const t=((n=z.state.activeCaipNetwork)==null?void 0:n.chainNamespace)||"eip155",e=((i=z.state.activeCaipNetwork)==null?void 0:i.id)||1,r=kt.NATIVE_TOKEN_ADDRESS[t];return`${t}:${e}:${r}`}function D_e(t){return kt.NATIVE_TOKEN_ADDRESS[t]}function Li(t){var r;return(r=z.getAccountData(t))==null?void 0:r.preferredAccountType}function kc(t){var e,r;return t?(r=(e=z.state.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.caipNetwork:z.state.activeCaipNetwork}const yb={getConnectionStatus(t,e){const r=be.state.activeConnectorIds[e],n=Ee.getConnections(e);return!!r&&t.connectorId===r?"connected":n.some(o=>o.connectorId.toLowerCase()===t.connectorId.toLowerCase())?"active":"disconnected"},excludeConnectorAddressFromConnections({connections:t,connectorId:e,addresses:r}){return t.map(n=>{if((e?n.connectorId.toLowerCase()===e.toLowerCase():!1)&&r){const s=n.accounts.filter(o=>!r.some(c=>
57c.toLowerCase()===o.address.toLowerCase()));return{...n,accounts:s}}return n})},excludeExistingConnections(t,e){const r=new Set(t);return e.filter(n=>!r.has(n.connectorId))},getConnectionsByConnectorId(t,e){return t.filter(r=>r.connectorId.toLowerCase()===e.toLowerCase())},getConnectionsData(t){var a;const e=!!((a=oe.state.remoteFeatures)!=null&&a.multiWallet),r=be.state.activeConnectorIds[t],n=Ee.getConnections(t),s=(Ee.state.recentConnections.get(t)??[]).filter(c=>be.getConnectorById(c.connectorId)),o=yb.excludeExistingConnections([...n.map(c=>c.connectorId),...r?[r]:[]],s);return e?{connections:n,recentConnections:o}:{connections:n.filter(c=>c.connectorId.toLowerCase()===(r==null?void 0:r.toLowerCase())),recentConnections:[]}},onConnectMobile(t,e){const r=Ee.state.wcUri;if(t!=null&&t.mobile_link&&r)try{Ee.setWcError(!1);const{mobile_link:n,link_mode:i,name:s}=t,o=Ce.appendPayToUri(r,e),{redirect:a,redirectUniversalLink:c,href:l}=Ce.formatNativeUrl(n,o,i),u=a,f=c,d=Ce.isIframe()?"_top":"_self";Ee.setWcLinking({name:s,href:l}),Ee.setRecentWallet(t),oe.state.experimental_preferUniversalLinks&&f?Ce.openHref(f,d):Ce.openHref(u,d)}catch(n){gt.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:n instanceof Error?n.message:"Error parsing the deep link",uri:r,mobile_link:t.mobile_link,name:t.name}}),Ee.setWcError(!0)}}},fd=Qr({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0,initialized:!1,connectingWallet:void 0}),Bs={state:fd,subscribe(t){return di(fd,()=>t(fd))},subscribeOpen(t){return Qn(fd,"open",t)},set(t){Object.assign(fd,{...fd,...t})}},rn=Qr({transactions:[],transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),lX={state:rn,subscribe(t){return di(rn,()=>t(rn))},setLastNetworkInView(t){rn.lastNetworkInView=t},async fetchTransactions(t){var e;if(!t)throw new Error("Transactions can't be fetched without an accountAddress");rn.loading=!0;try{const r=await it.fetchTransactions({account:t,cursor:rn.next,chainId:(e=z.state.activeCaipNetwork)==null?void 0:e.caipNetworkId}),n=Am.filterSpamTransactions(r.data),i=Am.filterByConnectedChain(n),s=[...rn.transactions,...i];rn.loading=!1,rn.transactions=s,rn.transactionsByYear=Am.groupTransactionsByYearAndMonth(rn.transactionsByYear,i),rn.empty=s.length===0,rn.next=r.next?r.next:void 0}catch{const n=z.state.activeChain;gt.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:t,projectId:oe.state.projectId,cursor:rn.next,isSmartAccount:Li(n)===Tn.ACCOUNT_TYPES.SMART_ACCOUNT}}),_a.showError("Failed to fetch transactions"),rn.loading=!1,rn.empty=!0,rn.next=void 0}},groupTransactionsByYearAndMonth(t={},e=[]){const r=t;return e.forEach(n=>{const i=new Date(n.metadata.minedAt).getFullYear(),s=new Date(n.metadata.minedAt).getMonth(),o=r[i]??{},c=(o[s]??[]).filter(l=>l.id!==n.id);r[i]={...o,[s]:[...c,n].sort((l,u)=>new Date(u.metadata.minedAt).getTime()-new Date(l.metadata.minedAt).getTime())}}),r},filterSpamTransactions(t){return t.filter(e=>{var n;return!((n=e.transfers)==null?void 0:n.every(i=>{var s;return((s=i.nft_info)==null?void 0:s.flags.is_spam)===!0}))})},filterByConnectedChain(t){var n;const e=(n=z.state.activeCaipNetwork)==null?void 0:n.caipNetworkId;return t.filter(i=>i.metadata.chain===e)},clearCursor(){rn.next=void 0},resetTransactions(){rn.transactions=[],rn.transactionsByYear={},rn.lastNetworkInView=void 0,rn.loading=!1,rn.empty=!1,rn.next=void 0}},Am=ho(lX,"API_ERROR"),vt=Qr({connections:new Map,recentConnections:new Map,isSwitchingConnection:!1,wcError:!1,wcFetchingUri:!1,buffering:!1,status:"disconnected"});let fl;const uX={state:vt,subscribe(t){return di(vt,()=>t(vt))},subscribeKey(t,e){return Qn(vt,t,e)},_getClient(){return vt._client},setClient(t){vt._client=vp(t)},initialize(t){const e=t.filter(r=>!!r.namespace).map(r=>r.namespace);Ee.syncStorageConnections(e)},syncStorageConnections(t){const e=le.getConnections(),r=t??Array.from(z.state.chains.keys());for(const n of r){const i=e[n]??[],s=new Map(vt.recentConnections);s.set(n,i),vt.recentConnections=s}},getConnections(t){return t?vt.connections.get(t)??[]:[]},hasAnyConnection(t){const e=Ee.state.connections;return Array.from(e.values()).flatMap(r=>r).some(({connectorId:r})=>r===t)},async connectWalletConnect({cache:t="auto"}={}){var r,n,i,s;vt.wcFetchingUri=!0;const e=Ce.isTelegram()||Ce.isSafari()&&Ce.isIos();try{if(t==="always"||t==="auto"&&e){if(fl){await fl,fl=void 0;return}if(!Ce.isPairingExpired(vt==null?void 0:vt.wcPairingExpiry)){const o=vt.wcUri;vt.wcUri=o;return}fl=(n=(r=Ee._getClient())==null?void 0:r.connectWalletConnect)==null?void 0:n.call(r),Ee.state.status="connecting",await fl,fl=void 0,vt.wcPairingExpiry=void 0,Ee.state.status="connected"}else await((s=(i=Ee._getClient())==null?void 0:i.connectWalletConnect)==null?void 0:s.call(i))}catch(o){throw vt.wcError=!0,vt.wcFetchingUri=!1,vt.status="disconnected",fl=void 0,o}},async connectExternal(t,e,r=!0){var o,a,c;const n=await((a=(o=Ee._getClient())==null?void 0:o.connectExternal)==null?void 0:a.call(o,t));r&&z.setActiveNamespace(e);const i=be.state.allConnectors.find(l=>l.id===(t==null?void 0:t.id)),s=t.type==="AUTH"?"email":"browser";return gt.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:s,name:(i==null?void 0:i.name)||"Unknown",view:ze.state.view,walletRank:(c=i==null?void 0:i.explorerWallet)==null?void 0:c.order}}),n},async reconnectExternal(t){var r,n;await((n=(r=Ee._getClient())==null?void 0:r.reconnectExternal)==null?void 0:n.call(r,t));const e=t.chain||z.state.activeChain;e&&be.setConnectorId(t.id,e)},async setPreferredAccountType(t,e){var n;if(!e)return;Dt.setLoading(!0,z.state.activeChain);const r=be.getAuthConnector();r&&(z.setAccountProp("preferredAccountType",t,e),await r.provider.setPreferredAccount(t),le.setPreferredAccountTypes(Object.entries(z.state.chains).reduce((i,[s,o])=>{const a=s,c=Li(a);return c!==void 0&&(i[a]=c),i},{})),await Ee.reconnectExternal(r),Dt.setLoading(!1,z.state.activeChain),gt.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:t,network:((n=z.state.activeCaipNetwork)==null?void 0:n.caipNetworkId)||""}}))},async signMessage(t){var e;return(e=Ee._getClient())==null?void 0:e.signMessage(t)},parseUnits(t,e){var r;return(r=Ee._getClient())==null?void 0:r.parseUnits(t,e)},formatUnits(t,e){var r;return(r=Ee._getClient())==null?void 0:r.formatUnits(t,e)},updateBalance(t){var e;return(e=Ee._getClient())==null?void 0:e.updateBalance(t)},async sendTransaction(t){var e;return(e=Ee._getClient())==null?void 0:e.sendTransaction(t)},async getCapabilities(t){var e;return(e=Ee._getClient())==null?void 0:e.getCapabilities(t)},async grantPermissions(t){var e;return(e=Ee._getClient())==null?void 0:e.grantPermissions(t)},async walletGetAssets(t){var e;return((e=Ee._getClient())==null?void 0:e.walletGetAssets(t))??{}},async estimateGas(t){var e;return(e=Ee._getClient())==null?void 0:e.estimateGas(t)},async writeContract(t){var e;return(e=Ee._getClient())==null?void 0:e.writeContract(t)},async writeSolanaTransaction(t){var e;return(e=Ee._getClient())==null?void 0:e.writeSolanaTransaction(t)},async getEnsAddress(t){var e;return(e=Ee._getClient())==null?void 0:e.getEnsAddress(t)},async getEnsAvatar(t){var e;return(e=Ee._getClient())==null?void 0:e.getEnsAvatar(t)},checkInstalled(t){var e,r;return((r=(e=Ee._getClient())==null?void 0:e.checkInstalled)==null?void 0:r.call(e,t))||!1},resetWcConnection(){vt.wcUri=void 0,vt.wcPairingExpiry=void 0,vt.wcLinking=void 0,vt.recentWallet=void 0,vt.wcFetchingUri=!1,vt.status="disconnected",Am.resetTransactions(),le.deleteWalletConnectDeepLink(),le.deleteRecentWallet(),Bs.set({connectingWallet:void 0})},resetUri(){vt.wcUri=void 0,vt.wcPairingExpiry=void 0,fl=void 0,vt.wcFetchingUri=!1,Bs.set({connectingWallet:void 0})},finalizeWcConnection(t){var n,i;const{wcLinking:e,recentWallet:r}=Ee.state;e&&le.setWalletConnectDeepLink(e),r&&le.setAppKitRecent(r),t&>.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:t,properties:{method:e?"mobile":"qrcode",name:((i=(n=ze.state.data)==null?void 0:n.wallet)==null?void 0:i.name)||"Unknown",view:ze.state.view,walletRank:r==null?void 0:r.order}})},setWcBasic(t){vt.wcBasic=t},setUri(t){vt.wcUri=t,vt.wcFetchingUri=!1,vt.wcPairingExpiry=Ce.getPairingExpiry()},setWcLinking(t){vt.wcLinking=t},setWcError(t){vt.wcError=t,vt.wcFetchingUri=!1,vt.buffering=!1},setRecentWallet(t){vt.recentWallet=t},setBuffering(t){vt.buffering=t},setStatus(t){vt.status=t},setIsSwitchingConnection(t){vt.isSwitchingConnection=t},async disconnect({id:t,namespace:e,initialDisconnect:r}={}){var n;try{await((n=Ee._getClient())==null?void 0:n.disconnect({id:t,chainNamespace:e,initialDisconnect:r}))}catch(i){throw new Mf("Failed to disconnect","INTERNAL_SDK_ERROR",i)}},async disconnectConnector({id:t,namespace:e}){var r;try{await((r=Ee._getClient())==null?void 0:r.disconnectConnector({id:t,namespace:e}))}catch(n){throw new Mf("Failed to disconnect connector","INTERNAL_SDK_ERROR",n)}},setConnections(t,e){const r=new Map(vt.connections);r.set(e,t),vt.connections=r},async handleAuthAccountSwitch({address:t,namespace:e}){var s,o;const r=z.getAccountData(e),n=(o=(s=r==null?void 0:r.user)==null?void 0:s.accounts)==null?void 0:o.find(a=>a.type==="smartAccount"),i=n&&n.address.toLowerCase()===t.toLowerCase()&&a0.canSwitchToSmartAccount(e)?"smartAccount":"eoa";await Ee.setPreferredAccountType(i,e)},async handleActiveConnection({connection:t,namespace:e,address:r}){const n=be.getConnectorById(t.connectorId),i=t.connectorId===K.CONNECTOR_ID.AUTH;if(!n)throw new Error(`No connector found for connection: ${t.connectorId}`);if(i)r&&await Ee.handleAuthAccountSwitch({address:r,namespace:e});else{const s=await Ee.connectExternal({id:n.id,type:n.type,provider:n.provider,address:r,chain:e},e);return s==null?void 0:s.address}return r},async handleDisconnectedConnection({connection:t,namespace:e,address:r,closeModalOnConnect:n}){var l,u;const i=be.getConnectorById(t.connectorId),s=(u=(l=t.auth)==null?void 0:l.name)==null?void 0:u.toLowerCase(),o=t.connectorId===K.CONNECTOR_ID.AUTH,a=t.connectorId===K.CONNECTOR_ID.WALLET_CONNECT;if(!i)throw new Error(`No connector found for connection: ${t.connectorId}`);let c;if(o)if(s&&a0.isSocialProvider(s)){const{address:f}=await a0.connectSocial({social:s,closeModalOnConnect:n,onOpenFarcaster(){Dt.open({view:"ConnectingFarcaster"})},onConnect(){ze.replace("ProfileWallets")}});c=f}else{const{address:f}=await a0.connectEmail({closeModalOnConnect:n,onOpen(){Dt.open({view:"EmailLogin"})},onConnect(){ze.replace("ProfileWallets")}});c=f}else if(a){const{address:f}=await a0.connectWalletConnect({walletConnect:!0,connector:i,closeModalOnConnect:n,onOpen(d){const h=d?"AllWallets":"ConnectingWalletConnect";Dt.state.open?ze.push(h):Dt.open({view:h})},onConnect(){ze.replace("ProfileWallets")}});c=f}else{const f=await Ee.connectExternal({id:i.id,type:i.type,provider:i.provider,chain:e},e);f&&(c=f.address)}return o&&r&&await Ee.handleAuthAccountSwitch({address:r,namespace:e}),c},async switchConnection({connection:t,address:e,namespace:r,closeModalOnConnect:n,onChange:i}){var c;let s;const o=(c=z.getAccountData(r))==null?void 0:c.caipAddress;if(o){const{address:l}=kn.parseCaipAddress(o);s=l}const a=yb.getConnectionStatus(t,r);switch(a){case"connected":case"active":{const l=await Ee.handleActiveConnection({connection:t,namespace:r,address:e});if(s&&l){const u=l.toLowerCase()!==s.toLowerCase();i==null||i({address:l,namespace:r,hasSwitchedAccount:u,hasSwitchedWallet:
57a==="active"})}break}case"disconnected":{const l=await Ee.handleDisconnectedConnection({connection:t,namespace:r,address:e,closeModalOnConnect:n});l&&(i==null||i({address:l,namespace:r,hasSwitchedAccount:!0,hasSwitchedWallet:!0}));break}default:throw new Error(`Invalid connection status: ${a}`)}}},Ee=ho(uX),dv={createBalance(t,e){const r={name:t.metadata.name||"",symbol:t.metadata.symbol||"",decimals:t.metadata.decimals||0,value:t.metadata.value||0,price:t.metadata.price||0,iconUrl:t.metadata.iconUrl||""};return{name:r.name,symbol:r.symbol,chainId:e,address:t.address==="native"?void 0:this.convertAddressToCAIP10Address(t.address,e),value:r.value,price:r.price,quantity:{decimals:r.decimals.toString(),numeric:this.convertHexToBalance({hex:t.balance,decimals:r.decimals})},iconUrl:r.iconUrl}},convertHexToBalance({hex:t,decimals:e}){return B1(BigInt(t),e)},convertAddressToCAIP10Address(t,e){return`${e}:${t}`},createCAIP2ChainId(t,e){return`${e}:${parseInt(t,16)}`},getChainIdHexFromCAIP2ChainId(t){const e=t.split(":");if(e.length<2||!e[1])return"0x0";const r=e[1],n=parseInt(r,10);return isNaN(n)?"0x0":`0x${n.toString(16)}`},isWalletGetAssetsResponse(t){return typeof t!="object"||t===null?!1:Object.values(t).every(e=>Array.isArray(e)&&e.every(r=>this.isValidAsset(r)))},isValidAsset(t){return typeof t=="object"&&t!==null&&typeof t.address=="string"&&typeof t.balance=="string"&&(t.type==="ERC20"||t.type==="NATIVE")&&typeof t.metadata=="object"&&t.metadata!==null&&typeof t.metadata.name=="string"&&typeof t.metadata.symbol=="string"&&typeof t.metadata.decimals=="number"&&typeof t.metadata.price=="number"&&typeof t.metadata.iconUrl=="string"}};let hv;async function k4(){if(!hv){const{createPublicClient:t,http:e,defineChain:r}=await Hn(()=>import("./index-97c6b574.js"),["assets/index-97c6b574.js","assets/parseSignature-2702032d.js","assets/verifyHash-9d818d73.js","assets/secp256k1-ee758b7f.js","assets/address-d060e3d7.js","assets/hashTypedData-fc5ab6bd.js","assets/webSocket-37fa1f47.js","assets/compat-ffe38df8.js","assets/ccip-6b409edf.js","assets/serializeAuthorizationList-a84ddc98.js"]);hv={createPublicClient:t,http:e,defineChain:r}}return hv}const $3={getBlockchainApiRpcUrl(t,e){const r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",t),r.searchParams.set("projectId",e),r.toString()},async getViemChain(t){const{defineChain:e}=await k4(),{chainId:r}=kn.parseCaipNetworkId(t.caipNetworkId);return e({...t,id:Number(r)})},async createViemPublicClient(t){const{createPublicClient:e,http:r}=await k4(),n=oe.state.projectId,i=await $3.getViemChain(t);if(!i)throw new Error(`Chain ${t.caipNetworkId} not found in viem/chains`);return e({chain:i,transport:r($3.getBlockchainApiRpcUrl(t.caipNetworkId,n))})}},K5={async getMyTokensWithBalance(t={forceUpdate:void 0,caipNetwork:z.state.activeCaipNetwork,address:(e=>(e=z.getAccountData())==null?void 0:e.address)()}){const{forceUpdate:r,caipNetwork:n,address:i}=t,s=be.getConnectorId("eip155")===K.CONNECTOR_ID.AUTH;if(!i)return[];const o=n?`${n.caipNetworkId}:${i}`:i,a=le.getBalanceCacheForCaipAddress(o);if(a)return a.balances;if(n&&n.chainNamespace===K.CHAIN.EVM&&s){const l=await this.getEIP155Balances(i,n);if(l)return this.filterLowQualityTokens(l)}const c=await it.getBalance(i,n==null?void 0:n.caipNetworkId,r);return this.filterLowQualityTokens(c.balances)},async getEIP155Balances(t,e){var r,n;try{const i=dv.getChainIdHexFromCAIP2ChainId(e.caipNetworkId),s=await Ee.getCapabilities(t);if(!((n=(r=s==null?void 0:s[i])==null?void 0:r.assetDiscovery)!=null&&n.supported))return null;const o=await Ee.walletGetAssets({account:t,chainFilter:[i]});if(!dv.isWalletGetAssetsResponse(o))return null;const c=(o[i]||[]).map(l=>dv.createBalance(l,e.caipNetworkId));return le.updateBalanceCache({caipAddress:`${e.caipNetworkId}:${t}`,balance:{balances:c},timestamp:Date.now()}),c}catch{return null}},filterLowQualityTokens(t){return t.filter(e=>e.quantity.decimals!=="0")},async fetchERC20Balance({caipAddress:t,assetAddress:e,caipNetwork:r}){const n=await $3.createViemPublicClient(r),{address:i}=kn.parseCaipAddress(t),[{result:s},{result:o},{result:a},{result:c}]=await n.multicall({contracts:[{address:e,functionName:"name",args:[],abi:Cg},{address:e,functionName:"symbol",args:[],abi:Cg},{address:e,functionName:"balanceOf",args:[i],abi:Cg},{address:e,functionName:"decimals",args:[],abi:Cg}]});return{name:s,symbol:o,decimals:c,balance:a&&c?B1(a,c):"0"}}},pv={adapters:{}},Bx={state:pv,initialize(t){pv.adapters={...t}},get(t){return pv.adapters[t]}},vb={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0,sui:void 0,stacks:void 0,ton:void 0,tron:void 0},Ki=Qr({providers:{...vb},providerIds:{...vb}}
57),jr={state:Ki,subscribeKey(t,e){return Qn(Ki,t,e)},subscribe(t){return di(Ki,()=>{t(Ki)})},subscribeProviders(t){return di(Ki.providers,()=>t(Ki.providers))},setProvider(t,e){t&&e&&(Ki.providers[t]=vp(e))},getProvider(t){if(t)return Ki.providers[t]},setProviderId(t,e){e&&(Ki.providerIds[t]=e)},getProviderId(t){if(t)return Ki.providerIds[t]},reset(){Ki.providers={...vb},Ki.providerIds={...vb}},resetChain(t){Ki.providers[t]=void 0,Ki.providerIds[t]=void 0}},fX={async getTokenList(t){var n;const e=await it.fetchSwapTokens({chainId:t});return((n=e==null?void 0:e.tokens)==null?void 0:n.map(i=>({...i,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0})))||[]},async fetchGasPrice(){var e;const t=z.state.activeCaipNetwork;if(!t)return null;try{switch(t.chainNamespace){case"solana":const r=(e=await(Ee==null?void 0:Ee.estimateGas({chainNamespace:"solana"})))==null?void 0:e.toString();return{standard:r,fast:r,instant:r};case"eip155":default:return await it.fetchGasPrice({chainId:t.caipNetworkId})}}catch{return null}},async fetchSwapAllowance({tokenAddress:t,userAddress:e,sourceTokenAmount:r,sourceTokenDecimals:n}){const i=await it.fetchSwapAllowance({tokenAddress:t,userAddress:e});if(i!=null&&i.allowance&&r&&n){const s=Ee.parseUnits(r,n)||0;return BigInt(i.allowance)>=s}return!1},async getMyTokensWithBalance(t){var r;const e=await K5.getMyTokensWithBalance({forceUpdate:t,caipNetwork:z.state.activeCaipNetwork,address:(r=z.getAccountData())==null?void 0:r.address});return z.setAccountProp("tokenBalance",e,z.state.activeChain),this.mapBalancesToSwapTokens(e)},mapBalancesToSwapTokens(t){return(t==null?void 0:t.map(e=>({...e,address:e!=null&&e.address?e.address:Dx(),decimals:parseInt(e.quantity.decimals,10),logoUri:e.iconUrl,eip2612:!1})))||[]},async handleSwapError(t){var e,r;try{const n=t==null?void 0:t.cause;if(!(n!=null&&n.json))return;const i=await n.json(),s=(r=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:r.description;return s!=null&&s.includes("insufficient liquidity")?"Insufficient liquidity":void 0}catch{return}}},er=Qr({tokenBalances:[],loading:!1}),dX={state:er,subscribe(t){return di(er,()=>t(er))},subscribeKey(t,e){return Qn(er,t,e)},setToken(t){t&&(er.token=vp(t))},setTokenAmount(t){er.sendTokenAmount=t},setReceiverAddress(t){er.receiverAddress=t},setReceiverProfileImageUrl(t){er.receiverProfileImageUrl=t},setReceiverProfileName(t){er.receiverProfileName=t},setNetworkBalanceInUsd(t){er.networkBalanceInUSD=t},setLoading(t){er.loading=t},getSdkEventProperties(t){var e,r;return{message:Ce.parseError(t),isSmartAccount:Li(z.state.activeChain)===Tn.ACCOUNT_TYPES.SMART_ACCOUNT,token:((e=er.token)==null?void 0:e.symbol)||"",amount:er.sendTokenAmount??0,network:((r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)||""}},async sendToken(){var t;try{switch(Tt.setLoading(!0),(t=z.state.activeCaipNetwork)==null?void 0:t.chainNamespace){case"eip155":await Tt.sendEvmToken();return;case"solana":await Tt.sendSolanaToken();return;default:throw new Error("Unsupported chain")}}catch(e){throw Do.isUserRejectedRequestError(e)?new kd(e):e}finally{Tt.setLoading(!1)}},async sendEvmToken(){var r,n,i;const t=z.state.activeChain;if(!t)throw new Error("SendController:sendEvmToken - activeChainNamespace is required");const e=Li(t);if(!Tt.state.sendTokenAmount||!Tt.state.receiverAddress)throw new Error("An amount and receiver address are required");if(!Tt.state.token)throw new Error("A token is required");if((r=Tt.state.token)!=null&&r.address){gt.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:e===Tn.ACCOUNT_TYPES.SMART_ACCOUNT,token:Tt.state.token.address,amount:Tt.state.sendTokenAmount,network:((n=z.state.activeCaipNetwork)==null?void 0:n.caipNetworkId)||""}});const{hash:s}=await Tt.sendERC20Token({receiverAddress:Tt.state.receiverAddress,tokenAddress:Tt.state.token.address,sendTokenAmount:Tt.state.sendTokenAmount,decimals:Tt.state.token.quantity.decimals});s&&(er.hash=s)}else{gt.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:e===Tn.ACCOUNT_TYPES.SMART_ACCOUNT,token:Tt.state.token.symbol||"",amount:Tt.state.sendTokenAmount,network:((i=z.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)||""}});const{hash:s}=await Tt.sendNativeToken({receiverAddress:Tt.state.receiverAddress,sendTokenAmount:Tt.state.sendTokenAmount,decimals:Tt.state.token.quantity.decimals});s&&(er.hash=s)}},async fetchTokenBalance(t){var o,a,c;er.loading=!0;const e=z.state.activeChain,r=(o=z.state.activeCaipNetwork)==null?void 0:o.caipNetworkId,n=(a=z.state.activeCaipNetwork)==null?void 0:a.chainNamespace,i=((c=z.getAccountData(e))==null?void 0:c.caipAddress)??z.state.activeCaipAddress,s=i?Ce.getPlainAddress(i):void 0;if(er.lastRetry&&!Ce.isAllowedRetry(er.lastRetry,30*kt.ONE_SEC_MS))return er.loading=!1,[];try{if(s&&r&&n){const l=await K5.getMyTokensWithBalance();return er.tokenBalances=l,er.lastRetry=void 0,l}}catch(l){er.lastRetry=Date.now(),t==null||t(l),_a.showError("Token Balance Unavailable")}finally{er.loading=!1}return[]},fetchNetworkBalance(){if(er.tokenBalances.length===0)return;const t=fX.mapBalancesToSwapTokens(er.tokenBalances);if(!t)return;const e=t.find(r=>r.address===Dx());e&&(er.networkBalanceInUSD=e?RN.multiply(e.quantity.numeric,e.price).toString():"0")},async sendNativeToken(t){var o,a,c,l;ze.pushTransactionStack({});const e=t.receiverAddress,r=(o=z.getAccountData())==null?void 0:o.address,n=Ee.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals)),i="0x",s=await Ee.sendTransaction({chainNamespace:K.CHAIN.EVM,to:e,address:r,data:i,value:n??BigInt(0)});return gt.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Li("eip155")===Tn.ACCOUNT_TYPES.SMART_ACCOUNT,token:((a=Tt.state.token)==null?void 0:a.symbol)||"",amount:t.
57sendTokenAmount,network:((c=z.state.activeCaipNetwork)==null?void 0:c.caipNetworkId)||"",hash:s||""}}),(l=Ee._getClient())==null||l.updateBalance("eip155"),Tt.resetSend(),{hash:s}},async sendERC20Token(t){var n,i,s;ze.pushTransactionStack({onSuccess(){ze.replace("Account")}});const e=Ee.parseUnits(t.sendTokenAmount.toString(),Number(t.decimals)),r=(n=z.getAccountData())==null?void 0:n.address;if(r&&t.sendTokenAmount&&t.receiverAddress&&t.tokenAddress){const o=Ce.getPlainAddress(t.tokenAddress);if(!o)throw new Error("SendController:sendERC20Token - tokenAddress is required");const a=await Ee.writeContract({fromAddress:r,tokenAddress:o,args:[t.receiverAddress,e??BigInt(0)],method:"transfer",abi:mH.getERC20Abi(o),chainNamespace:K.CHAIN.EVM});return gt.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Li("eip155")===Tn.ACCOUNT_TYPES.SMART_ACCOUNT,token:((i=Tt.state.token)==null?void 0:i.symbol)||"",amount:t.sendTokenAmount,network:((s=z.state.activeCaipNetwork)==null?void 0:s.caipNetworkId)||"",hash:a||""}}),Tt.resetSend(),{hash:a}}return{hash:void 0}},async sendSolanaToken(){var r,n,i;if(!Tt.state.sendTokenAmount||!Tt.state.receiverAddress)throw new Error("An amount and receiver address are required");ze.pushTransactionStack({onSuccess(){ze.replace("Account")}});let t;Tt.state.token&&Tt.state.token.address!==kt.SOLANA_NATIVE_TOKEN_ADDRESS&&(Ce.isCaipAddress(Tt.state.token.address)?t=Ce.getPlainAddress(Tt.state.token.address):t=Tt.state.token.address);const e=await Ee.sendTransaction({chainNamespace:"solana",tokenMint:t,to:Tt.state.receiverAddress,value:Tt.state.sendTokenAmount});e&&(er.hash=e),(r=Ee._getClient())==null||r.updateBalance("solana"),gt.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:!1,token:((n=Tt.state.token)==null?void 0:n.symbol)||"",amount:Tt.state.sendTokenAmount,network:((i=z.state.activeCaipNetwork)==null?void 0:i.caipNetworkId)||"",hash:e||""}}),Tt.resetSend()},resetSend(){er.token=void 0,er.sendTokenAmount=void 0,er.receiverAddress=void 0,er.receiverProfileImageUrl=void 0,er.receiverProfileName=void 0,er.loading=!1,er.tokenBalances=[]}},Tt=ho(dX),gv={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,user:void 0,preferredAccountType:void 0},xg={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},xe=Qr({chains:iH(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{connectionControllerClient:void 0},isSwitchingNamespace:!1}),Fx={state:xe,subscribe(t){return di(xe,()=>{t(xe)})},subscribeKey(t,e){return Qn(xe,t,e)},subscribeAccountStateProp(t,e,r){var i;const n=r||xe.activeChain;return n?Qn(((i=xe.chains.get(n))==null?void 0:i.accountState)||{},t,e):()=>{}},subscribeChainProp(t,e,r){let n;return di(xe.chains,()=>{var s;const i=r||xe.activeChain;if(i){const o=(s=xe.chains.get(i))==null?void 0:s[t];n!==o&&(n=o,e(o))}})},initialize(t,e,r){const{chainId:n,namespace:i}=le.getActiveNetworkProps(),s=e==null?void 0:e.find(u=>u.id.toString()===(n==null?void 0:n.toString())),a=t.find(u=>(u==null?void 0:u.namespace)===i)||(t==null?void 0:t[0]),c=t.map(u=>u.namespace).filter(u=>u!==void 0),l=oe.state.enableEmbedded?new Set([...c]):new Set([...(e==null?void 0:e.map(u=>u.chainNamespace))??[]]);((t==null?void 0:t.length)===0||!a)&&(xe.noAdapters=!0),xe.noAdapters||(xe.activeChain=a==null?void 0:a.namespace,xe.activeCaipNetwork=s,z.setChainNetworkData(a==null?void 0:a.namespace,{caipNetwork:s}),xe.activeChain&&Bs.set({activeChain:a==null?void 0:a.namespace})),l.forEach(u=>{const f=e==null?void 0:e.filter(g=>g.chainNamespace===u),d=le.getPreferredAccountTypes()||{},h={...oe.state.defaultAccountTypes,...d};z.state.chains.set(u,{namespace:u,networkState:Qr({...xg,caipNetwork:f==null?void 0:f[0]}),accountState:Qr({...gv,preferredAccountType:h[u]}),caipNetworks:f??[],...r}),z.setRequestedCaipNetworks(f??[],u)})},removeAdapter(t){var e,r;if(xe.activeChain===t){const n=Array.from(xe.chains.entries()).find(([i])=>i!==t);if(n){const i=(r=(e=n[1])==null?void 0:e.caipNetworks)==null?void 0:r[0];i&&z.setActiveCaipNetwork(i)}}xe.chains.delete(t)},addAdapter(t,{connectionControllerClient:e},r){if(!t.namespace)throw new Error("ChainController:addAdapter - adapter must have a namespace");xe.chains.set(t.namespace,{namespace:t.namespace,networkState:{...xg,caipNetwork:r[0]},accountState:{...gv},caipNetworks:r,connectionControllerClient:e}),z.setRequestedCaipNetworks((r==null?void 0:r.filter(n=>n.chainNamespace===t.namespace))??[],t.namespace)},addNetwork(t){var r;const e=xe.chains.get(t.chainNamespace);if(e){const n=[...e.caipNetworks||[]];(r=e.caipNetworks)!=null&&r.find(i=>i.id===t.id)||n.push(t),xe.chains.set(t.chainNamespace,{...e,caipNetworks:n}),z.setRequestedCaipNetworks(n,t.chainNamespace),be.filterByNamespace(t.chainNamespace,!0)}},removeNetwork(t,e){var n,i,s;const r=xe.chains.get(t);if(r){const o=((n=xe.activeCaipNetwork)==null?void 0:n.id)===e,a=[...((i=r.caipNetworks)==null?void 0:i.filter(c=>c.id!==e))||[]];o&&((s=r==null?void 0:r.caipNetworks)!=null&&s[0])&&z.setActiveCaipNetwork(r.caipNetworks[0]),xe.chains.set(t,{...r,caipNetworks:a}),z.setRequestedCaipNetworks(a||[],t),a.length===0&&be.filterByNamespace(t,!1)}},setAdapterNetworkState(t,e){const r=xe.chains.get(t);r&&(r.networkState={...r.networkState||xg,...e},xe.chains.set(t,r))},setChainAccountData(t,e,r=!0){if(!t)throw new Error("Chain is required to update chain account data");const n=xe.chains.get(t);if(n){const i={...n.accountState||gv,...e};xe.chains.set(t,{...n,accountState:i}),(xe.chains.size===1||xe.activeChain===t)&&e.caipAddress&&(xe.activeCaipAddress=e.caipAddress)}},setChainNetworkData(t,e){if(!t)return;const r=xe.chains.get(t);if(r){const n={...r.networkState||xg,...e};xe.chains.set(t,{...r,networkState:n})}}
57,setAccountProp(t,e,r,n=!0){z.setChainAccountData(r,{[t]:e},n)},setActiveNamespace(t){var n,i;xe.activeChain=t;const e=t?xe.chains.get(t):void 0,r=(n=e==null?void 0:e.networkState)==null?void 0:n.caipNetwork;r!=null&&r.id&&t&&(xe.activeCaipAddress=(i=e==null?void 0:e.accountState)==null?void 0:i.caipAddress,xe.activeCaipNetwork=r,z.setChainNetworkData(t,{caipNetwork:r}),le.setActiveCaipNetworkId(r==null?void 0:r.caipNetworkId),Bs.set({activeChain:t,selectedNetworkId:r==null?void 0:r.caipNetworkId}))},setActiveCaipNetwork(t){var s,o;if(!t)return;const e=xe.activeChain===t.chainNamespace;e||z.setIsSwitchingNamespace(!0);const r=xe.chains.get(t.chainNamespace);xe.activeChain=t.chainNamespace,xe.activeCaipNetwork=t,z.setChainNetworkData(t.chainNamespace,{caipNetwork:t});let n=(s=r==null?void 0:r.accountState)==null?void 0:s.address;if(n)xe.activeCaipAddress=`${t.chainNamespace}:${t.id}:${n}`;else if(e&&xe.activeCaipAddress){const{address:a}=kn.parseCaipAddress(xe.activeCaipAddress);n=a,xe.activeCaipAddress=`${t.caipNetworkId}:${n}`}else xe.activeCaipAddress=void 0;z.setChainAccountData(t.chainNamespace,{address:n,caipAddress:xe.activeCaipAddress}),Tt.resetSend(),Bs.set({activeChain:xe.activeChain,selectedNetworkId:(o=xe.activeCaipNetwork)==null?void 0:o.caipNetworkId}),le.setActiveCaipNetworkId(t.caipNetworkId),!z.checkIfSupportedNetwork(t.chainNamespace)&&oe.state.enableNetworkSwitch&&!oe.state.allowUnsupportedChain&&!Ee.state.wcBasic&&z.showUnsupportedChainUI()},addCaipNetwork(t){var r;if(!t)return;const e=xe.chains.get(t.chainNamespace);e&&((r=e==null?void 0:e.caipNetworks)==null||r.push(t))},async switchActiveNamespace(t){var i;if(!t)return;const e=t!==z.state.activeChain,r=(i=z.getNetworkData(t))==null?void 0:i.caipNetwork,n=z.getCaipNetworkByNamespace(t,r==null?void 0:r.id);e&&n&&await z.switchActiveNetwork(n)},async switchActiveNetwork(t,{throwOnFailure:e=!1}={}){var o;const r=z.state.activeChain;if(!r)throw new Error("ChainController:switchActiveNetwork - namespace is required");const n=jr.getProviderId(xe.activeChain)==="AUTH",i=(o=z.getAccountData(r))==null?void 0:o.address,s=K.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(t.chainNamespace);try{if(i&&t.chainNamespace===r||n&&s){const a=Bx.get(t.chainNamespace);if(!a)throw new Error("Adapter not found");await a.switchNetwork({caipNetwork:t})}z.setActiveCaipNetwork(t)}catch(a){if(e)throw a}gt.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.caipNetworkId}})},getConnectionControllerClient(t){const e=t||xe.activeChain;if(!e)throw new Error("Chain is required to get connection controller client");const r=xe.chains.get(e);if(!(r!=null&&r.connectionControllerClient))throw new Error("ConnectionController client not set");return r.connectionControllerClient},getNetworkProp(t,e){var n;const r=(n=xe.chains.get(e))==null?void 0:n.networkState;if(r)return r[t]},getRequestedCaipNetworks(t){const e=xe.chains.get(t),{approvedCaipNetworkIds:r=[],requestedCaipNetworks:n=[]}=(e==null?void 0:e.networkState)||{};return Ce.sortRequestedNetworks(r,n).filter(o=>o==null?void 0:o.id)},getAllRequestedCaipNetworks(){const t=[];return xe.chains.forEach(e=>{if(!e.namespace)throw new Error("ChainController:getAllRequestedCaipNetworks - chainAdapter must have a namespace");const r=z.getRequestedCaipNetworks(e.namespace);t.push(...r)}),t},setRequestedCaipNetworks(t,e){z.setAdapterNetworkState(e,{requestedCaipNetworks:t});const n=z.getAllRequestedCaipNetworks().map(s=>s.chainNamespace),i=Array.from(new Set(n));be.filterByNamespaces(i)},getAllApprovedCaipNetworkIds(){const t=[];return xe.chains.forEach(e=>{if(!e.namespace)throw new Error("ChainController:getAllApprovedCaipNetworkIds - chainAdapter must have a namespace");const r=z.getApprovedCaipNetworkIds(e.namespace);t.push(...r)}),t},getActiveCaipNetwork(t){var e,r;return t?(r=(e=xe.chains.get(t))==null?void 0:e.networkState)==null?void 0:r.caipNetwork:xe.activeCaipNetwork},getActiveCaipAddress(){return xe.activeCaipAddress},getApprovedCaipNetworkIds(t){var n;const e=xe.chains.get(t);return((n=e==null?void 0:e.networkState)==null?void 0:n.approvedCaipNetworkIds)||[]},setApprovedCaipNetworksData(t,e){z.setAdapterNetworkState(t,e)},checkIfSupportedNetwork(t,e){var i;const r=e||((i=xe.activeCaipNetwork)==null?void 0:i.caipNetworkId),n=z.getRequestedCaipNetworks(t);return n.length?n==null?void 0:n.some(s=>s.caipNetworkId===r):!0},checkIfSupportedChainId(t){if(!xe.activeChain)return!0;const e=z.getRequestedCaipNetworks(xe.activeChain);return e==null?void 0:e.some(r=>r.id===t)},checkIfSmartAccountEnabled(){var n,i;const t=wp.caipNetworkIdToNumber((n=xe.activeCaipNetwork)==null?void 0:n.caipNetworkId);if(!xe.activeChain||!t)return!1;const r=((i=Ln.get(Be.SMART_ACCOUNT_ENABLED_NETWORKS))==null?void 0:i.split(","))||[];return!!(r!=null&&r.includes(t.toString()))},showUnsupportedChainUI(){Dt.open({view:"UnsupportedChain"})},checkIfNamesSupported(){const t=xe.activeCaipNetwork;return!!(t!=null&&t.chainNamespace&&kt.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(t.chainNamespace))},resetNetwork(t){z.setAdapterNetworkState(t,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})},resetAccount(t){var i,s;const e=t;if(!e)throw new Error("Chain is required to set account prop");const r=(s=(i=z.state.chains.get(e))==null?void 0:i.accountState)==null?void 0:s.preferredAccountType,n=oe.state.defaultAccountTypes[e];xe.activeCaipAddress=void 0,z.setChainAccountData(e,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol
57:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:n||r,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,user:void 0,status:"disconnected"}),be.removeConnectorId(e)},setIsSwitchingNamespace(t){xe.isSwitchingNamespace=t},getFirstCaipNetworkSupportsAuthConnector(){var r,n;const t=[];let e;if(xe.chains.forEach(i=>{K.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(s=>s===i.namespace)&&i.namespace&&t.push(i.namespace)}),t.length>0){const i=t[0];return e=i?(n=(r=xe.chains.get(i))==null?void 0:r.caipNetworks)==null?void 0:n[0]:void 0,e}},getAccountData(t){var r;const e=t||xe.activeChain;if(e)return(r=z.state.chains.get(e))==null?void 0:r.accountState},getNetworkData(t){var r;const e=t||xe.activeChain;if(e)return(r=z.state.chains.get(e))==null?void 0:r.networkState},getCaipNetworkByNamespace(t,e){var i,s,o;if(!t)return;const r=z.state.chains.get(t),n=(i=r==null?void 0:r.caipNetworks)==null?void 0:i.find(a=>a.id.toString()===(e==null?void 0:e.toString()));return n||((s=r==null?void 0:r.networkState)==null?void 0:s.caipNetwork)||((o=r==null?void 0:r.caipNetworks)==null?void 0:o[0])},getRequestedCaipNetworkIds(){const t=be.state.filterByNamespace;return(t?[xe.chains.get(t)]:Array.from(xe.chains.values())).flatMap(r=>(r==null?void 0:r.caipNetworks)||[]).map(r=>r.caipNetworkId)},getCaipNetworks(t){return t?z.getRequestedCaipNetworks(t):z.getAllRequestedCaipNetworks()},getCaipNetworkById(t,e){return Fx.getCaipNetworks(e).find(r=>r.id.toString()===t.toString()||r.caipNetworkId.toString()===t.toString())},setLastConnectedSIWECaipNetwork(t){xe.lastConnectedSIWECaipNetwork=t},getLastConnectedSIWECaipNetwork(){return xe.lastConnectedSIWECaipNetwork},async fetchTokenBalance(t){var o,a;const e=z.getAccountData();if(!e)return[];const r=(o=z.state.activeCaipNetwork)==null?void 0:o.caipNetworkId,n=(a=z.state.activeCaipNetwork)==null?void 0:a.chainNamespace,i=z.state.activeCaipAddress,s=i?Ce.getPlainAddress(i):void 0;if(z.setAccountProp("balanceLoading",!0,n),e.lastRetry&&!Ce.isAllowedRetry(e.lastRetry,30*kt.ONE_SEC_MS))return z.setAccountProp("balanceLoading",!1,n),[];try{if(s&&r&&n){const c=await K5.getMyTokensWithBalance();return z.setAccountProp("tokenBalance",c,n),z.setAccountProp("lastRetry",void 0,n),z.setAccountProp("balanceLoading",!1,n),c}}catch(c){z.setAccountProp("lastRetry",Date.now(),n),t==null||t(c),_a.showError("Token Balance Unavailable")}finally{z.setAccountProp("balanceLoading",!1,n)}return[]},isCaipNetworkDisabled(t){var c;const e=t.chainNamespace,r=!!((c=z.getAccountData(e))!=null&&c.caipAddress),n=z.getAllApprovedCaipNetworkIds(),i=z.getNetworkProp("supportsAllNetworks",e)!==!1,s=be.getConnectorId(e),o=be.getAuthConnector(),a=s===K.CONNECTOR_ID.AUTH&&o;return!r||i||a?!1:!(n!=null&&n.includes(t.caipNetworkId))}},z=ho(Fx),hX={onSwitchNetwork({network:t,ignoreSwitchConfirmation:e=!1}){var d,h;const r=z.state.activeCaipNetwork,n=z.state.activeChain,i=ze.state.data;if(t.id===(r==null?void 0:r.id))return;const o=!!((d=z.getAccountData(n))!=null&&d.address),a=!!((h=z.getAccountData(t.chainNamespace))!=null&&h.address),c=t.chainNamespace!==n,u=be.getConnectorId(n)===K.CONNECTOR_ID.AUTH,f=K.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(g=>g===t.chainNamespace);e||u&&f?ze.push("SwitchNetwork",{...i,network:t}):o&&c&&!a?ze.push("SwitchActiveChain",{switchToChain:t.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:t}):ze.push("SwitchNetwork",{...i,network:t})}},Xi=Qr({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),pX={state:Xi,subscribe(t){return di(Xi,()=>t(Xi))},subscribeKey(t,e){return Qn(Xi,t,e)},async open(t){var o,a;const e=t==null?void 0:t.namespace,r=z.state.activeChain,n=e&&e!==r,i=(o=z.getAccountData(t==null?void 0:t.namespace))==null?void 0:o.caipAddress,s=z.state.noAdapters;if(Ee.state.wcBasic?Pe.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1,fetchWalletRanks:!1}):await Pe.prefetch(),be.setFilterByNamespace(t==null?void 0:t.namespace),Dt.setLoading(!0,e),e&&n){const c=((a=z.getNetworkData(e))==null?void 0:a.caipNetwork)||z.getRequestedCaipNetworks(e)[0];c&&(s?(await z.switchActiveNetwork(c),ze.push("ConnectingWalletConnectBasic")):hX.onSwitchNetwork({network:c,ignoreSwitchConfirmation:!0}))}else oe.state.manualWCControl||s&&!i?Ce.isMobile()?ze.reset("AllWallets"):ze.reset("ConnectingWalletConnectBasic"):t!=null&&t.view?ze.reset(t.view,t.data):i?ze.reset("Account"):ze.reset("Connect");Xi.open=!0,Bs.set({open:!0}),gt.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!i}})},close(){const t=oe.state.enableEmbedded,e=!!z.state.activeCaipAddress;Xi.open&>.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:e}}),Xi.open=!1,ze.reset("Connect"),Dt.clearLoading(),t?e?ze.replace("Account"):ze.push("Connect"):Bs.set({open:!1}),Ee.resetUri()}
57,setLoading(t,e){e&&Xi.loadingNamespaceMap.set(e,t),Xi.loading=t,Bs.set({loading:t})},clearLoading(){Xi.loadingNamespaceMap.clear(),Xi.loading=!1,Bs.set({loading:!1})},shake(){Xi.shake||(Xi.shake=!0,setTimeout(()=>{Xi.shake=!1},500))}},Dt=ho(pX),V0={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},L3={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},gX={providers:PN,selectedProvider:null,error:null,purchaseCurrency:V0,paymentCurrency:L3,purchaseCurrencies:[V0],paymentCurrencies:[],quotesLoading:!1},br=Qr(gX),mX={state:br,subscribe(t){return di(br,()=>t(br))},subscribeKey(t,e){return Qn(br,t,e)},setSelectedProvider(t){var e,r;if(t&&t.name==="meld"){const n=z.state.activeChain,i=n===K.CHAIN.SOLANA?"SOL":"USDC",s=n?((r=(e=z.state.chains.get(n))==null?void 0:e.accountState)==null?void 0:r.address)??"":"",o=new URL(t.url);o.searchParams.append("publicKey",yH),o.searchParams.append("destinationCurrencyCode",i),o.searchParams.append("walletAddress",s),o.searchParams.append("externalCustomerId",oe.state.projectId),br.selectedProvider={...t,url:o.toString()}}else br.selectedProvider=t},setOnrampProviders(t){if(Array.isArray(t)&&t.every(e=>typeof e=="string")){const e=t,r=PN.filter(n=>e.includes(n.name));br.providers=r}else br.providers=[]},setPurchaseCurrency(t){br.purchaseCurrency=t},setPaymentCurrency(t){br.paymentCurrency=t},setPurchaseAmount(t){U3.state.purchaseAmount=t},setPaymentAmount(t){U3.state.paymentAmount=t},async getAvailableCurrencies(){const t=await it.getOnrampOptions();br.purchaseCurrencies=t.purchaseCurrencies,br.paymentCurrencies=t.paymentCurrencies,br.paymentCurrency=t.paymentCurrencies[0]||L3,br.purchaseCurrency=t.purchaseCurrencies[0]||V0,await Pe.fetchCurrencyImages(t.paymentCurrencies.map(e=>e.id)),await Pe.fetchTokenImages(t.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var t,e;br.quotesLoading=!0;try{const r=await it.getOnrampQuote({purchaseCurrency:br.purchaseCurrency,paymentCurrency:br.paymentCurrency,amount:((t=br.paymentAmount)==null?void 0:t.toString())||"0",network:(e=br.purchaseCurrency)==null?void 0:e.symbol});return br.quotesLoading=!1,br.purchaseAmount=Number(r==null?void 0:r.purchaseAmount.amount),r}catch(r){return br.error=r.message,br.quotesLoading=!1,null}finally{br.quotesLoading=!1}},resetState(){br.selectedProvider=null,br.error=null,br.purchaseCurrency=V0,br.paymentCurrency=L3,br.purchaseCurrencies=[V0],br.paymentCurrencies=[],br.paymentAmount=void 0,br.purchaseAmount=void 0,br.quotesLoading=!1}},U3=ho(mX);var X5={exports:{}},Wd=typeof Reflect=="object"?Reflect:null,O4=Wd&&typeof Wd.apply=="function"?Wd.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},_m;Wd&&typeof Wd.ownKeys=="function"?_m=Wd.ownKeys:Object.getOwnPropertySymbols?_m=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:_m=function(e){return Object.getOwnPropertyNames(e)};function bX(t){console&&console.warn&&console.warn(t)}var $x=Number.isNaN||function(e){return e!==e};function zr(){zr.init.call(this)}X5.exports=zr;X5.exports.once=EX;zr.EventEmitter=zr;zr.prototype._events=void 0;zr.prototype._eventsCount=0;zr.prototype._maxListeners=void 0;var M4=10;function ky(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(zr,"defaultMaxListeners",{enumerable:!0,get:function(){return M4},set:function(t){if(typeof t!="number"||t<0||$x(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");M4=t}});zr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};zr.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||$x(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Lx(t){return t._maxListeners===void 0?zr.defaultMaxListeners:t._maxListeners}zr.prototype.getMaxListeners=function(){return Lx(this)};zr.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")O4(c,this,r);else for(var l=c.length,u=Jx(c,l),n=0;n<l;++n)O4(u[n],this,r);return!0};function Ux(t,e,r,n){var i,s,o;if(ky(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)
vendor: 4,903 bytes, lines 57-70
57o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),i=Lx(t),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,bX(a)}return t}zr.prototype.addListener=function(e,r){return Ux(this,e,r,!1)};zr.prototype.on=zr.prototype.addListener;zr.prototype.prependListener=function(e,r){return Ux(this,e,r,!0)};function yX(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Hx(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=yX.bind(n);return i.listener=r,n.wrapFn=i,i}zr.prototype.once=function(e,r){return ky(r),this.on(e,Hx(this,e,r)),this};zr.prototype.prependOnceListener=function(e,r){return ky(r),this.prependListener(e,Hx(this,e,r)),this};zr.prototype.removeListener=function(e,r){var n,i,s,o,a;if(ky(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():vX(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};zr.prototype.off=zr.prototype.removeListener;zr.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function jx(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?wX(i):Jx(i,i.length)}zr.prototype.listeners=function(e){return jx(this,e,!0)};zr.prototype.rawListeners=function(e){return jx(this,e,!1)};zr.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):zx.call(t,e)};zr.prototype.listenerCount=zx;function zx(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}zr.prototype.eventNames=function(){return this._eventsCount>0?_m(this._events):[]};function Jx(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function vX(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function wX(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function EX(t,e){return new Promise(function(r,n){function i(o){t.removeListener(e,s),n(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}qx(t,e,s,{once:!0}),e!=="error"&&AX(t,i,{once:!0})})}function AX(t,e,r){typeof t.on=="function"&&qx(t,"error",e,r)}function qx(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(s){n.once&&t.removeEventListener(e,i),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var po=X5.exports;const Z5=zf(po);var we={};/*! ***************************************************************************** 58Copyright (c) Microsoft Corporation. 59 60Permission to use, copy, modify, and/or distribute this software for any 61purpose with or without fee is hereby granted. 62 63THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 64REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 65AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 66INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 67LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 68OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 69PERFORMANCE OF THIS SOFTWARE. 70***************************************************************************** */var H3=function(t,e){return H3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},H3(t,e)};function _X(t,e){H3(t,e);function r(){this.constructor=t}
vendor: 15,002 bytes, line 70
70t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var j3=function(){return j3=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},j3.apply(this,arguments)};function CX(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function SX(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function TX(t,e){return function(r,n){e(r,n,t)}}function NX(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function IX(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function xX(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function RX(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function PX(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function z3(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Gx(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function kX(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Gx(arguments[e]));return t}function OX(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function e1(t){return this instanceof e1?(this.v=t,this):new e1(t)}function MX(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){n[d]&&(i[d]=function(h){return new Promise(function(g,b){s.push([d,h,g,b])>1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(g){f(s[0][3],g)}}function c(d){d.value instanceof e1?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function DX(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:e1(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function BX(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof z3=="function"?z3(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function FX(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function $X(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function LX(t){return t&&t.__esModule?t:{default:t}}function UX(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function HX(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const jX=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return j3},__asyncDelegator:DX,__asyncGenerator:MX,__asyncValues:BX,__await:e1,__awaiter:IX,__classPrivateFieldGet:UX,__classPrivateFieldSet:HX,__createBinding:RX,__decorate:SX,__exportStar:PX,__extends:_X,__generator:xX,__importDefault:LX,__importStar:$X,__makeTemplateObject:FX,__metadata:NX,__param:TX,__read:Gx,__rest:CX,__spread:kX,__spreadArrays:OX,__values:z3},Symbol.toStringTag,{value:"Module"})),z1=_7(jX);var mv={},c0={},D4;function zX(){if(D4)return c0;D4=1,Object.defineProperty(c0,"__esModule",{value:!0}),c0.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return c0.delay=t,c0}var Du={},bv={},Bu={},B4;function JX(){return B4||(B4=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.ONE_THOUSAND=Bu.ONE_HUNDRED=void 0,Bu.ONE_HUNDRED=100,Bu.ONE_THOUSAND=1e3),Bu}var yv={},F4;function qX(){return F4||(F4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(yv)),yv}var $4;function Vx(){return $4||($4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=z1;e.__exportStar(JX(),t),e.__exportStar(qX(),t)}(bv)),bv}var L4;function GX(){if(L4)return Du;L4=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.fromMiliseconds=Du.toMiliseconds=void 0;const t=Vx();function e(n){return n*t.ONE_THOUSAND}Du.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Du.fromMiliseconds=r,Du}var U4;function VX(){return U4||(U4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=z1;e.__exportStar(zX(),t),e.__exportStar(GX(),t)}(mv)),mv}var dd={},H4;function WX(){if(H4)return dd;H4=1,Object.defineProperty(dd,"__esModule",{value:!0}),dd.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return dd.Watch=t,dd.default=t,dd}var vv={},l0={},j4;function KX(){if(j4)return l0;j4=1,Object.defineProperty(l0,"__esModule",{value:!0}),l0.IWatch=void 0;class t{}return l0.IWatch=t,l0}var z4;function XX(){return z4||(z4=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),z1.__exportStar(KX(),t)}(vv)),vv}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=z1;e.__exportStar(VX(),t),e.__exportStar(WX(),t),e.__exportStar(XX(),t),e.__exportStar(Vx(),t)})(we);class Wf{}let ZX=class extends Wf{constructor(e){super()}};const J4=we.FIVE_SECONDS,Kf={pulse:"heartbeat_pulse"};let YX=class Wx extends ZX{constructor(e){super(e),this.events=new po.EventEmitter,this.interval=J4,this.interval=(e==null?void 0:e.interval)||J4}static async init(e){const r=new Wx(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),we.toMiliseconds(this.interval))}pulse(){this.events.emit(Kf.pulse)}};const QX=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,eZ=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,tZ=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function rZ(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){nZ(t);return}return e}function nZ(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function Rg(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!tZ.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(QX.test(t)||eZ.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,rZ)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function iZ(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Wn(t,...e){try{return iZ(t(...e))}catch(r){return Promise.reject(r)}}function sZ(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function oZ(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function Cm(t){if(sZ(t))return String(t);if(oZ(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Cm(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const J3="base64:";function aZ(t){return typeof t=="string"?t:J3+uZ(t)}function cZ(t){return typeof t!="string"||!t.startsWith(J3)?t:lZ(t.slice(J3.length))}function lZ(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function uZ(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function es(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function fZ(...t){return es(t.join(":"))}function Pg(t){return t=es(t),t?t+":":""}function dZ(t,e){if(e===void 0)return!0;let r=0,n=t.indexOf(":");for(;n>-1;)r++,n=t.indexOf(":",n+1);return r<=e}function hZ(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const pZ="memory",gZ=()=>{const t=new Map;return{name:pZ,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function mZ(t={}){const e={mounts:{"":t.driver||gZ()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const u of e.mountpoints)if(l.startsWith(u))return{base:u,relativeKey:l.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,u)=>e.mountpoints.filter(f=>f.startsWith(l)||u&&l.startsWith(f)).map(f=>({relativeBase:l.length>f.length?l.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(l,u)=>{if(e.watching){u=es(u);for(const f of e.watchListeners)f(l,u)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await q4(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,u,f)=>{const d=new Map,h=g=>{let b=d.get(g.base);return b||(b={driver:g.driver,base:g.base,items:[]},d.set(g.base,b)),b};for(const g of l){const b=typeof g=="string",w=es(b?g:g.key),x=b?void 0:g.value,k=b||!g.options?u:{...u,...g.options},R=r(w);h(R).items.push({key:w,value:x,relativeKey:R.relativeKey,options:k})}return Promise.all([...d.values()].map(g=>f(g))).then(g=>g.flat())},c={hasItem(l,u={}){l=es(l);const{relativeKey:f,driver:d}=r(l);return Wn(d.hasItem,f,u)},getItem(l,u={}){l=es(l);const{relativeKey:f,driver:d}=r(l);return Wn(d.getItem,f,u).then(h=>Rg(h))},getItems(l,u={}){return a(l,u,f=>f.driver.getItems?Wn(f.driver.getItems,f.items.map(d=>({key:d.relativeKey,options:d.options})),u).then(d=>d.map(h=>({key:fZ(f.base,h.key),value:Rg(h.value)}))):Promise.all(f.items.map(d=>Wn(f.driver.getItem,d.relativeKey,d.options).then(h=>({key:d.key,value:Rg(h)})))))},getItemRaw(l,u={}){l=es(l);const{relativeKey:f,driver:d}=r(l);return d.getItemRaw?Wn(d.getItemRaw,f,u):Wn(d.getItem,f,u).then(h=>cZ(h))},async setItem(l,u,f={}){if(u===void 0)return c.removeItem(l);l=es(l);const{relativeKey:d,driver:h}=r(l);h.setItem&&(await Wn(h.setItem,d,Cm(u),f),h.watch||i("update",l))},async setItems(l,u){await a(l,u,async f=>{if(f.driver.setItems)return Wn(f.driver.setItems,f.items.map(d=>({key:d.relativeKey,value:Cm(d.value),options:d.options})),u);f.driver.setItem&&await Promise.all(f.items.map(d=>Wn(f.driver.setItem,d.relativeKey,Cm(d.value),d.options)))})},async setItemRaw(l,u,f={}){if(u===void 0)return c.removeItem(l,f);l=es(l);const{relativeKey:d,driver:h}=r(l);
vendor: 4,770 bytes, line 70
70if(h.setItemRaw)await Wn(h.setItemRaw,d,u,f);else if(h.setItem)await Wn(h.setItem,d,aZ(u),f);else return;h.watch||i("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=es(l);const{relativeKey:f,driver:d}=r(l);d.removeItem&&(await Wn(d.removeItem,f,u),(u.removeMeta||u.removeMata)&&await Wn(d.removeItem,f+"$",u),d.watch||i("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=es(l);const{relativeKey:f,driver:d}=r(l),h=Object.create(null);if(d.getMeta&&Object.assign(h,await Wn(d.getMeta,f,u)),!u.nativeOnly){const g=await Wn(d.getItem,f+"$",u).then(b=>Rg(b));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(h,g))}return h},setMeta(l,u,f={}){return this.setItem(l+"$",u,f)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){var w;l=Pg(l);const f=n(l,!0);let d=[];const h=[];let g=!0;for(const x of f){(w=x.driver.flags)!=null&&w.maxDepth||(g=!1);const k=await Wn(x.driver.getKeys,x.relativeBase,u);for(const R of k){const D=x.mountpoint+es(R);d.some(O=>D.startsWith(O))||h.push(D)}d=[x.mountpoint,...d.filter(R=>!R.startsWith(x.mountpoint))]}const b=u.maxDepth!==void 0&&!g;return h.filter(x=>(!b||dZ(x,u.maxDepth))&&hZ(x,l))},async clear(l,u={}){l=Pg(l),await Promise.all(n(l,!1).map(async f=>{if(f.driver.clear)return Wn(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const d=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(d.map(h=>f.driver.removeItem(h,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>G4(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,u){if(l=Pg(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((f,d)=>d.length-f.length)),e.mounts[l]=u,e.watching&&Promise.resolve(q4(u,i,l)).then(f=>{e.unwatch[l]=f}).catch(console.error),c},async unmount(l,u=!0){var f,d;l=Pg(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&((d=(f=e.unwatch)[l])==null||d.call(f),delete e.unwatch[l]),u&&await G4(e.mounts[l]),e.mountpoints=e.mountpoints.filter(h=>h!==l),delete e.mounts[l])},getMount(l=""){l=es(l)+":";const u=r(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=es(l),n(l,u.parents).map(d=>({driver:d.driver,base:d.mountpoint}))},keys:(l,u={})=>c.getKeys(l,u),get:(l,u={})=>c.getItem(l,u),set:(l,u,f={})=>c.setItem(l,u,f),has:(l,u={})=>c.hasItem(l,u),del:(l,u={})=>c.removeItem(l,u),remove:(l,u={})=>c.removeItem(l,u)};return c}function q4(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function G4(t){typeof t.dispose=="function"&&await Wn(t.dispose)}function Xf(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Kx(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=Xf(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let wv;function J1(){return wv||(wv=Kx("keyval-store","keyval")),wv}function V4(t,e=J1()){return e("readonly",r=>Xf(r.get(t)))}function bZ(t,e,r=J1()){return r("readwrite",n=>(n.put(e,t),Xf(n.transaction)))}function yZ(t,e=J1()){return e("readwrite",r=>(r.delete(t),Xf(r.transaction)))}function vZ(t=J1()){return t("readwrite",e=>(e.clear(),Xf(e.transaction)))}function wZ(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Xf(t.transaction)}function EZ(t=J1()){return t("readonly",e=>{if(e.getAllKeys)return Xf(e.getAllKeys());const r=[];return wZ(e,n=>r.push(n.key)).then(()=>r)})}const AZ=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),_Z=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Df(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return _Z(t)}catch{return t}}function Bf(t){return typeof t=="string"?t:AZ(t)||""}const CZ="idb-keyval";var SZ=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=Kx(t.dbName,t.storeName)),{name:CZ,options:t,async hasItem(i){return!(typeof await V4(r(i),n)>"u")},async getItem(i){return await V4(r(i),n)??null},setItem(i,s){return bZ(r(i),s,n)}
vendor: 8,947 bytes, line 70
70,removeItem(i){return yZ(r(i),n)},getKeys(){return EZ(n)},clear(){return vZ(n)}}};const TZ="WALLET_CONNECT_V2_INDEXED_DB",NZ="keyvaluestorage";let IZ=class{constructor(){this.indexedDb=mZ({driver:SZ({dbName:TZ,storeName:NZ})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Bf(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Ev=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Sm={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ev<"u"&&Ev.localStorage?Sm.exports=Ev.localStorage:typeof window<"u"&&window.localStorage?Sm.exports=window.localStorage:Sm.exports=new e})();function xZ(t){var e;return[t[0],Df((e=t[1])!=null?e:"")]}let RZ=class{constructor(){this.localStorage=Sm.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(xZ)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Df(r)}async setItem(e,r){this.localStorage.setItem(e,Bf(r))}async removeItem(e){this.localStorage.removeItem(e)}};const PZ="wc_storage_version",W4=1,kZ=async(t,e,r)=>{const n=PZ,i=await e.getItem(n);if(i&&i>=W4){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const o=[];for(;s.length;){const a=s.shift();if(!a)continue;const c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(n,W4),r(e),OZ(t,o)},OZ=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let MZ=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new RZ;this.storage=e;try{const r=new IZ;kZ(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};var DZ=Object.defineProperty,BZ=(t,e,r)=>e in t?DZ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,K4=(t,e,r)=>BZ(t,typeof e!="symbol"?e+"":e,r);let FZ=class extends Wf{constructor(e){super(),this.opts=e,K4(this,"protocol","wc"),K4(this,"version",2)}};var $Z=Object.defineProperty,LZ=(t,e,r)=>e in t?$Z(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,UZ=(t,e,r)=>LZ(t,typeof e!="symbol"?e+"":e,r);let HZ=class extends Wf{constructor(e,r){super(),this.core=e,this.logger=r,UZ(this,"records",new Map)}},jZ=class{constructor(e,r){this.logger=e,this.core=r}},zZ=class extends Wf{constructor(e,r){super(),this.relayer=e,this.logger=r}},JZ=class extends Wf{constructor(e){super()}},qZ=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},GZ=class extends Wf{constructor(e,r){super(),this.relayer=e,this.logger=r}},VZ=class extends Wf{constructor(e,r){super(),this.core=e,this.logger=r}},WZ=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},KZ=class{constructor(e,r){this.projectId=e,this.logger=r}},XZ=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}};var ZZ=Object.defineProperty,YZ=(t,e,r)=>e in t?ZZ(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,X4=(t,e,r)=>YZ(t,typeof e!="symbol"?e+"":e,r);let QZ=class{constructor(e){this.opts=e,X4(this,"protocol","wc"),X4(this,"version",2)}},eY=class{constructor(e){this.client=e}};function tY(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Xx(t,...e){if(!tY(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Z4(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function rY(t,e){Xx(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const hd=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Av=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function nY(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function Zx(t){return typeof t=="string"&&(t=nY(t)),Xx(t),t}let iY=class{clone(){return this._cloneInto()}};function sY(t){const e=n=>t().update(Zx(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Yx(t=32){if(hd&&typeof hd.getRandomValues=="function")return hd.getRandomValues(new Uint8Array(t));if(hd&&typeof hd.randomBytes=="function")return hd.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function oY(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}let aY=class extends iY{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Av(this.buffer)}update(e){Z4(this);const{view:r,buffer:n,blockLen:i}=this;e=Zx(e);const s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Av(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Z4(this),rY(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(n,0),o=0);for(let f=o;f<i;f++)r[f]=0;oY(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Av(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.length=i,e.pos=a,e.finished=s,e.destroyed=o,i%r&&e.buffer.set(n),e}};const kg=BigInt(2**32-1),q3=BigInt(32);function Qx(t,e=!1){return e?{h:Number(t&kg),l:Number(t>>q3&kg)}:{h:Number(t>>q3&kg)|0,l:Number(t&kg)|0}}function cY(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=Qx(t[i],e);[r[i],n[i]]=[s,o]}return[r,n]}const lY=(t,e)=>BigInt(t>>>0)<<q3|BigInt(e>>>0),uY=(t,e,r)=>t>>>r,fY=(t,e,r)=>t<<32-r|e>>>r,dY=(t,e,r)=>t>>>r|e<<32-r,hY=(t,e,r)=>t<<32-r|e>>>r,pY=(t,e,r)=>t<<64-r|e>>>r-32,gY=(t,e,r)=>t>>>r-32|e<<64-r,mY=(t,e)=>e,bY=(t,e)=>t,yY=(t,e,r)=>t<<r|e>>>32-r,vY=(t,e,r)=>e<<r|t>>>32-r,wY=(t,e,r)=>e<<r-32|t>>>64-r,EY=(t,e,r)=>t<<r-32|e>>>64-r;function AY(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const _Y=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),CY=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,SY=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),TY=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,NY=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),IY=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,St={fromBig:Qx,split:cY,toBig:lY,shrSH:uY,shrSL:fY,rotrSH:dY,rotrSL:hY,rotrBH:pY,rotrBL:gY,rotr32H:mY,rotr32L:bY,rotlSH:yY,rotlSL:vY,rotlBH:wY,rotlBL:EY,add:AY,add3L:_Y,add3H:CY,add4L:SY,add4H:TY,add5H:IY,add5L:NY},[xY,RY]=(()=>St.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
706f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))))(),dl=new Uint32Array(80),hl=new Uint32Array(80);let PY=class extends aY{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:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:f,Fl:d,Gh:h,Gl:g,Hh:b,Hl:w}=this;return[e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w]}set(e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=g|0,this.Hh=b|0,this.Hl=w|0}process(e,r){for(let R=0;R<16;R++,r+=4)dl[R]=e.getUint32(r),hl[R]=e.getUint32(r+=4);for(let R=16;R<80;R++){const D=dl[R-15]|0,O=hl[R-15]|0,M=St.rotrSH(D,O,1)^St.rotrSH(D,O,8)^St.shrSH(D,O,7),F=St.rotrSL(D,O,1)^St.rotrSL(D,O,8)^St.shrSL(D,O,7),H=dl[R-2]|0,U=hl[R-2]|0,G=St.rotrSH(H,U,19)^St.rotrBH(H,U,61)^St.shrSH(H,U,6),N=St.rotrSL(H,U,19)^St.rotrBL(H,U,61)^St.shrSL(H,U,6),A=St.add4L(F,N,hl[R-7],hl[R-16]),v=St.add4H(A,M,G,dl[R-7],dl[R-16]);dl[R]=v|0,hl[R]=A|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:f,El:d,Fh:h,Fl:g,Gh:b,Gl:w,Hh:x,Hl:k}=this;for(let R=0;R<80;R++){const D=St.rotrSH(f,d,14)^St.rotrSH(f,d,18)^St.rotrBH(f,d,41),O=St.rotrSL(f,d,14)^St.rotrSL(f,d,18)^St.rotrBL(f,d,41),M=f&h^~f&b,F=d&g^~d&w,H=St.add5L(k,O,F,RY[R],hl[R]),U=St.add5H(H,x,D,M,xY[R],dl[R]),G=H|0,N=St.rotrSH(n,i,28)^St.rotrBH(n,i,34)^St.rotrBH(n,i,39),A=St.rotrSL(n,i,28)^St.rotrBL(n,i,34)^St.rotrBL(n,i,39),v=n&s^n&a^s&a,p=i&o^i&c^o&c;x=b|0,k=w|0,b=h|0,w=g|0,h=f|0,g=d|0,{h:f,l:d}=St.add(l|0,u|0,U|0,G|0),l=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=St.add3L(G,A,p);n=St.add3H(m,U,N,v),i=m|0}({h:n,l:i}=St.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=St.add(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=St.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=St.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:f,l:d}=St.add(this.Eh|0,this.El|0,f|0,d|0),{h,l:g}=St.add(this.Fh|0,this.Fl|0,h|0,g|0),{h:b,l:w}=St.add(this.Gh|0,this.Gl|0,b|0,w|0),{h:x,l:k}=St.add(this.Hh|0,this.Hl|0,x|0,k|0),this.set(n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k)}roundClean(){dl.fill(0),hl.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const kY=sY(()=>new PY);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y5=BigInt(0),eR=BigInt(1),OY=BigInt(2);function Q5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function eE(t){if(!Q5(t))throw new Error("Uint8Array expected")}function _v(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const MY=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function tE(t){eE(t);let e="";for(let r=0;r<t.length;r++)e+=MY[t[r]];return e}function tR(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?Y5:BigInt("0x"+t)}const cc={_0:48,_9:57,A:65,F:70,a:97,f:102};function Y4(t){if(t>=cc._0&&t<=cc._9)return t-cc._0;if(t>=cc.A&&t<=cc.F)return t-(cc.A-10);if(t>=cc.a&&t<=cc.f)return t-(cc.a-10)}function rR(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=Y4(t.charCodeAt(s)),a=Y4(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function DY(t){return tR(tE(t))}function Tm(t){return eE(t),tR(tE(Uint8Array.from(t).reverse()))}function nR(t,e){return rR(t.toString(16).padStart(e*2,"0"))}function G3(t,e){return nR(t,e).reverse()}function lc(t,e,r){let n;if(typeof e=="string")try{n=rR(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(Q5(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function Q4(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];eE(i),e+=i.length}
vendor: 6,458 bytes, line 70
70const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}const Cv=t=>typeof t=="bigint"&&Y5<=t;function BY(t,e,r){return Cv(t)&&Cv(e)&&Cv(r)&&e<=t&&t<r}function u0(t,e,r,n){if(!BY(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function FY(t){let e;for(e=0;t>Y5;t>>=eR,e+=1);return e}const $Y=t=>(OY<<BigInt(t-1))-eR,LY={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||Q5(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function rE(t,e,r={}){const n=(i,s,o)=>{const a=LY[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}function e_(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const Zn=BigInt(0),Sn=BigInt(1),Wu=BigInt(2),UY=BigInt(3),V3=BigInt(4),t_=BigInt(5),r_=BigInt(8);function jn(t,e){const r=t%e;return r>=Zn?r:e+r}function HY(t,e,r){if(e<Zn)throw new Error("invalid exponent, negatives unsupported");if(r<=Zn)throw new Error("invalid modulus");if(r===Sn)return Zn;let n=Sn;for(;e>Zn;)e&Sn&&(n=n*t%r),t=t*t%r,e>>=Sn;return n}function ta(t,e,r){let n=t;for(;e-- >Zn;)n*=n,n%=r;return n}function n_(t,e){if(t===Zn)throw new Error("invert: expected non-zero number");if(e<=Zn)throw new Error("invert: expected positive modulus, got "+e);let r=jn(t,e),n=e,i=Zn,s=Sn;for(;r!==Zn;){const o=n/r,a=n%r,c=i-s*o;n=r,r=a,i=s,s=c}if(n!==Sn)throw new Error("invert: does not exist");return jn(i,e)}function jY(t){const e=(t-Sn)/Wu;let r,n,i;for(r=t-Sn,n=0;r%Wu===Zn;r/=Wu,n++);for(i=Wu;i<t&&HY(i,e,t)!==t-Sn;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const o=(t+Sn)/V3;return function(a,c){const l=a.pow(c,o);if(!a.eql(a.sqr(l),c))throw new Error("Cannot find square root");return l}}const s=(r+Sn)/Wu;return function(o,a){if(o.pow(a,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,l=o.pow(o.mul(o.ONE,i),r),u=o.pow(a,s),f=o.pow(a,r);for(;!o.eql(f,o.ONE);){if(o.eql(f,o.ZERO))return o.ZERO;let d=1;for(let g=o.sqr(f);d<c&&!o.eql(g,o.ONE);d++)g=o.sqr(g);const h=o.pow(l,Sn<<BigInt(c-d-1));l=o.sqr(h),u=o.mul(u,h),f=o.mul(f,l),c=d}return u}}function zY(t){if(t%V3===UY){const e=(t+Sn)/V3;return function(r,n){const i=r.pow(n,e);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(t%r_===t_){const e=(t-t_)/r_;return function(r,n){const i=r.mul(n,Wu),s=r.pow(i,e),o=r.mul(n,s),a=r.mul(r.mul(o,Wu),s),c=r.mul(o,r.sub(a,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return jY(t)}const JY=(t,e)=>(jn(t,e)&Sn)===Sn,qY=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function GY(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=qY.reduce((n,i)=>(n[i]="function",n),e);return rE(t,r)}function VY(t,e,r){if(r<Zn)throw new Error("invalid exponent, negatives unsupported");if(r===Zn)return t.ONE;if(r===Sn)return e;let n=t.ONE,i=e;for(;r>Zn;)r&Sn&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Sn;return n}function WY(t,e){const r=new Array(e.length),n=e.reduce((s,o,a)=>t.is0(o)?s:(r[a]=s,t.mul(s,o)),t.ONE),i=t.inv(n);return e.reduceRight((s,o,a)=>t.is0(o)?s:(r[a]=t.mul(s,r[a]),t.mul(s,o)),i),r}function iR(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function sR(t,e,r=!1,n={}){if(t<=Zn)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=iR(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:$Y(i),ZERO:Zn,ONE:Sn,create:c=>jn(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Zn<=c&&c<t},is0:c=>c===Zn,isOdd:c=>(c&Sn)===Sn,neg:c=>jn(-c,t),eql:(c,l)=>c===l,sqr:c=>jn(c*c,t),add:(c,l)=>jn(c+l,t),sub:(c,l)=>jn(c-l,t),mul:(c,l)=>jn(c*l,t),pow:(c,l)=>VY(a,c,l),div:(c,l)=>jn(c*n_(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>n_(c,t),sqrt:n.sqrt||(c=>(o||(o=zY(t)),o(a,c))),invertBatch:c=>WY(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>r?G3(c,s):nR(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?Tm(c):DY(c)}});return Object.freeze(a)}const i_=BigInt(0),Og=BigInt(1);function Sv(t,e){const r=e.negate();return t?r:e}function oR(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Tv(t,e){oR(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function KY(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function XY(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const Nv=new WeakMap,aR=new WeakMap;function Iv(t){return aR.get(t)||1}function ZY(t,e){return{constTimeNegate:Sv,hasPrecomputes(r){return Iv(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>i_;)n&Og&&(i=i.add(s)),s=s.double(),n>>=Og;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=Tv(n,e),o=[];let a=r,c=a;for(let l=0;l<i;l++){c=a,o.push(c);for(let u=1;u<s;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,n,i){const{windows:s,windowSize:o}=Tv(r,e);let a=t.ZERO,c=t.BASE;const l=BigInt(2**r-1),u=2**r,f=BigInt(r);for(let d=0;d<s;d++){const h=d*o;let g=Number(i&l);i>>=f,g>o&&(g-=u,i+=Og);const b=h,w=h+Math.abs(g)-1,x=d%2!==0,k=g<0;g===0?c=c.add(Sv(x,n[b])):a=a.add(Sv(k,n[w]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:o,windowSize:a}=Tv(r,e),c=BigInt(2**r-1),l=2**r,u=BigInt(r);for(let f=0;f<o;f++){const d=f*a;if(i===i_)break;let h=Number(i&c);if(i>>=u,h>a&&(h-=l,i+=Og),h===0)continue;let g=n[d+Math.abs(h)-1];h<0&&(g=g.negate()),s=s.add(g)}return s},getPrecomputes(r,n,i){let s=Nv.get(n);
vendor: 4,086 bytes, line 70
70return s||(s=this.precomputeWindow(n,r),r!==1&&Nv.set(n,i(s))),s},wNAFCached(r,n,i){const s=Iv(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=Iv(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){oR(n,e),aR.set(r,n),Nv.delete(r)}}}function YY(t,e,r,n){if(KY(r,t),XY(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=FY(BigInt(r.length)),o=s>12?s-3:s>4?s-2:s?2:1,a=(1<<o)-1,c=new Array(a+1).fill(i),l=Math.floor((e.BITS-1)/o)*o;let u=i;for(let f=l;f>=0;f-=o){c.fill(i);for(let h=0;h<n.length;h++){const g=n[h],b=Number(g>>BigInt(f)&BigInt(a));c[b]=c[b].add(r[h])}let d=i;for(let h=c.length-1,g=i;h>0;h--)g=g.add(c[h]),d=d.add(g);if(u=u.add(d),f!==0)for(let h=0;h<o;h++)u=u.double()}return u}function QY(t){return GY(t.Fp),rE(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...iR(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const wo=BigInt(0),Zi=BigInt(1),Mg=BigInt(2),eQ=BigInt(8),tQ={zip215:!0};function rQ(t){const e=QY(t);return rE(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function nQ(t){const e=rQ(t),{Fp:r,n,prehash:i,hash:s,randomBytes:o,nByteLength:a,h:c}=e,l=Mg<<BigInt(a*8)-Zi,u=r.create,f=sR(e.n,e.nBitLength),d=e.uvRatio||((m,y)=>{try{return{isValid:!0,value:r.sqrt(m*r.inv(y))}}catch{return{isValid:!1,value:wo}}}),h=e.adjustScalarBytes||(m=>m),g=e.domain||((m,y,T)=>{if(_v("phflag",T),y.length||T)throw new Error("Contexts/pre-hash are not supported");return m});function b(m,y){u0("coordinate "+m,y,wo,l)}function w(m){if(!(m instanceof R))throw new Error("ExtendedPoint expected")}const x=e_((m,y)=>{const{ex:T,ey:I,ez:_}=m,E=m.is0();y==null&&(y=E?eQ:r.inv(_));const C=u(T*y),S=u(I*y),B=u(_*y);if(E)return{x:wo,y:Zi};if(B!==Zi)throw new Error("invZ was invalid");return{x:C,y:S}}),k=e_(m=>{const{a:y,d:T}=e;if(m.is0())throw new Error("bad point: ZERO");const{ex:I,ey:_,ez:E,et:C}=m,S=u(I*I),B=u(_*_),$=u(E*E),P=u($*$),q=u(S*y),V=u($*u(q+B)),X=u(P+u(T*u(S*B)));if(V!==X)throw new Error("bad point: equation left != right (1)");const Z=u(I*_),ie=u(E*C);if(Z!==ie)throw new Error("bad point: equation left != right (2)");return!0});class R{constructor(y,T,I,_){this.ex=y,this.ey=T,this.ez=I,this.et=_,b("x",y),b("y",T),b("z",I),b("t",_),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(y){if(y instanceof R)throw new Error("extended point not allowed");const{x:T,y:I}=y||{};return b("x",T),b("y",I),new R(T,I,Zi,u(T*I))}static normalizeZ(y){const T=r.invertBatch(y.map(I=>I.ez));return y.map((I,_)=>I.toAffine(T[_])).map(R.fromAffine)}static msm(y,T){return YY(R,f,y,T)}_setWindowSize(y){M.setWindowSize(this,y)}assertValidity(){k(this)}equals(y){w(y);const{ex:T,ey:I,ez:_}=this,{ex:E,ey:C,ez:S}=y,B=u(T*S),$=u(E*_),P=u(I*S),q=u(C*_);return B===$&&P===q}is0(){return this.equals(R.ZERO)}negate(){return new R(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:y}=e,{ex:T,ey:I,ez:_}=this,E=u(T*T),C=u(I*I),S=u(Mg*u(_*_)),B=u(y*E),$=T+I,P=u(u($*$)-E-C),q=B+C,V=q-S,X=B-C,Z=u(P*V),ie=u(q*X),ce=u(P*X),se=u(V*q);return new R(Z,ie,se,ce)}add(y){w(y);const{a:T,d:I}=e,{ex:_,ey:E,ez:C,et:S}=this,{ex:B,ey:$,ez:P,et:q}=y;if(T===BigInt(-1)){const $t=u((E-_)*($+B)),Lt=u((E+_)*($-B)),Je=u(Lt-$t);if(Je===wo)return this.double();const Ut=u(C*Mg*q),Ht=u(S*Mg*P),qe=Ht+Ut,jt=Lt+$t,zt=Ht-Ut,Ve=u(qe*Je),Vt=u(jt*zt),Wt=u(qe*zt),We=u(Je*jt);return new R(Ve,Vt,We,Wt)}const V=u(_*B),X=u(E*$),Z=u(S*I*q),ie=u(C*P),ce=u((_+E)*(B+$)-V-X),se=ie-Z,_e=ie+Z,ye=u(X-T*V),Te=u(ce*se),ht=u(_e*ye),Ot=u(ce*ye),Ge=u(se*_e);return new R(Te,ht,Ge,Ot)}subtract(y){return this.add(y.negate())}wNAF(y){return M.wNAFCached(this,y,R.normalizeZ)}multiply(y){const T=y;u0("scalar",T,Zi,n);const{p:I,f:_}=this.wNAF(T);return R.normalizeZ([I,_])[0]}multiplyUnsafe(y,T=R.ZERO){const I=y;
vendor: 10,821 bytes, line 70
70return u0("scalar",I,wo,n),I===wo?O:this.is0()||I===Zi?this:M.wNAFCachedUnsafe(this,I,R.normalizeZ,T)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return M.unsafeLadder(this,n).is0()}toAffine(y){return x(this,y)}clearCofactor(){const{h:y}=e;return y===Zi?this:this.multiplyUnsafe(y)}static fromHex(y,T=!1){const{d:I,a:_}=e,E=r.BYTES;y=lc("pointHex",y,E),_v("zip215",T);const C=y.slice(),S=y[E-1];C[E-1]=S&-129;const B=Tm(C),$=T?l:r.ORDER;u0("pointHex.y",B,wo,$);const P=u(B*B),q=u(P-Zi),V=u(I*P-_);let{isValid:X,value:Z}=d(q,V);if(!X)throw new Error("Point.fromHex: invalid y coordinate");const ie=(Z&Zi)===Zi,ce=(S&128)!==0;if(!T&&Z===wo&&ce)throw new Error("Point.fromHex: x=0 and x_0=1");return ce!==ie&&(Z=u(-Z)),R.fromAffine({x:Z,y:B})}static fromPrivateKey(y){return U(y).point}toRawBytes(){const{x:y,y:T}=this.toAffine(),I=G3(T,r.BYTES);return I[I.length-1]|=y&Zi?128:0,I}toHex(){return tE(this.toRawBytes())}}R.BASE=new R(e.Gx,e.Gy,Zi,u(e.Gx*e.Gy)),R.ZERO=new R(wo,Zi,Zi,wo);const{BASE:D,ZERO:O}=R,M=ZY(R,a*8);function F(m){return jn(m,n)}function H(m){return F(Tm(m))}function U(m){const y=r.BYTES;m=lc("private key",m,y);const T=lc("hashed private key",s(m),2*y),I=h(T.slice(0,y)),_=T.slice(y,2*y),E=H(I),C=D.multiply(E),S=C.toRawBytes();return{head:I,prefix:_,scalar:E,point:C,pointBytes:S}}function G(m){return U(m).pointBytes}function N(m=new Uint8Array,...y){const T=Q4(...y);return H(s(g(T,lc("context",m),!!i)))}function A(m,y,T={}){m=lc("message",m),i&&(m=i(m));const{prefix:I,scalar:_,pointBytes:E}=U(y),C=N(T.context,I,m),S=D.multiply(C).toRawBytes(),B=N(T.context,S,E,m),$=F(C+B*_);u0("signature.s",$,wo,n);const P=Q4(S,G3($,r.BYTES));return lc("result",P,r.BYTES*2)}const v=tQ;function p(m,y,T,I=v){const{context:_,zip215:E}=I,C=r.BYTES;m=lc("signature",m,2*C),y=lc("message",y),T=lc("publicKey",T,C),E!==void 0&&_v("zip215",E),i&&(y=i(y));const S=Tm(m.slice(C,2*C));let B,$,P;try{B=R.fromHex(T,E),$=R.fromHex(m.slice(0,C),E),P=D.multiplyUnsafe(S)}catch{return!1}if(!E&&B.isSmallOrder())return!1;const q=N(_,$.toRawBytes(),B.toRawBytes(),y);return $.add(B.multiplyUnsafe(q)).subtract(P).clearCofactor().equals(R.ZERO)}return D._setWindowSize(8),{CURVE:e,getPublicKey:G,sign:A,verify:p,ExtendedPoint:R,utils:{getExtendedPublicKey:U,randomPrivateKey:()=>o(r.BYTES),precompute(m=8,y=R.BASE){return y._setWindowSize(m),y.multiply(BigInt(3)),y}}}}BigInt(0),BigInt(1);const nE=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),s_=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const iQ=BigInt(1),o_=BigInt(2);BigInt(3);const sQ=BigInt(5),oQ=BigInt(8);function aQ(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=nE,o=t*t%s*t%s,a=ta(o,o_,s)*o%s,c=ta(a,iQ,s)*t%s,l=ta(c,sQ,s)*c%s,u=ta(l,e,s)*l%s,f=ta(u,r,s)*u%s,d=ta(f,n,s)*f%s,h=ta(d,i,s)*d%s,g=ta(h,i,s)*d%s,b=ta(g,e,s)*l%s;return{pow_p_5_8:ta(b,o_,s)*t%s,b2:o}}function cQ(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function lQ(t,e){const r=nE,n=jn(e*e*e,r),i=jn(n*n*e,r),s=aQ(t*i).pow_p_5_8;let o=jn(t*n*s,r);const a=jn(e*o*o,r),c=o,l=jn(o*s_,r),u=a===t,f=a===jn(-t,r),d=a===jn(-t*s_,r);return u&&(o=c),(f||d)&&(o=l),JY(o,r)&&(o=jn(-o,r)),{isValid:u||f,value:o}}const uQ=(()=>sR(nE,void 0,!0))(),fQ=(()=>({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:uQ,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:oQ,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:kY,randomBytes:Yx,adjustScalarBytes:cQ,uvRatio:lQ}))(),cR=(()=>nQ(fQ))(),dQ="EdDSA",hQ="JWT",wb=".",Oy="base64url",lR="utf8",uR="utf8",pQ=":",gQ="did",mQ="key",a_="base58btc",bQ="z",yQ="K36",vQ=32;function iE(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function fR(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?iE(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function dR(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=fR(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return iE(r)}function wQ(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var b=0,w=0,x=0,k=g.length;x!==k&&g[x]===0;)x++,b++;for(var R=(k-x)*u+1>>>0,D=new Uint8Array(R);x!==k;){for(var O=g[x],M=0,F=R-1;(O!==0||M<w)&&F!==-1;F--,M++)O+=256*D[F]>>>0,D[F]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error("Non-zero carry");w=M,x++}for(var H=R-w;H!==R&&D[H]===0;)H++;for(var U=c.repeat(b);H<R;++H)U+=t.charAt(D[H]);return U}function d(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var b=0;if(g[b]!==" "){for(var w=0,x=0;g[b]===c;)w++,b++;for(var k=(g.length-b)*l+1>>>0,R=new Uint8Array(k);g[b];){var D=r[g.charCodeAt(b)];if(D===255)return;for(var O=0,M=k-1;(D!==0||O<x)&&M!==-1;M--,O++)D+=a*R[M]>>>0,R[M]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");x=O,b++}if(g[b]!==" "){for(var F=k-x;F!==k&&R[F]===0;)F++;for(var H=new Uint8Array(w+(k-F)),U=w;F!==k;)H[U++]=R[F++];return H}}}function h(g){var b=d(g);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var EQ=wQ,AQ=EQ;const hR=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},_Q=t=>new TextEncoder().encode(t),CQ=t=>new TextDecoder().decode(t);let SQ=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},TQ=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return pR(this,e)}},NQ=class{constructor(e){this.decoders=e}or(e){return pR(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const pR=(t,e)=>new NQ({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let IQ=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new SQ(e,r,n),this.decoder=new TQ(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const My=({name:t,prefix:e,encode:r,decode:n})=>new IQ(t,e,r,n),q1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=AQ(r,e);return My({prefix:t,name:e,encode:n,decode:s=>hR(i(s))})},xQ=(t,e,r,n)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const f=i[t[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},RQ=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},pi=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>My({prefix:e,name:t,encode(i){return RQ(i,n,r)},decode(i){return xQ(i,n,r,t)}}),PQ=My({prefix:"\0",name:"identity",encode:t=>CQ(t),decode:t=>_Q(t)});var kQ=Object.freeze({__proto__:null,identity:PQ});const OQ=pi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var MQ=Object.freeze({__proto__:null,base2:OQ});const DQ=pi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var BQ=Object.freeze({__proto__:null,base8:DQ});const FQ=q1({prefix:"9",name:"base10",alphabet:"0123456789"});var $Q=Object.freeze({__proto__:null,base10:FQ});const LQ=pi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),UQ=pi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var HQ=Object.freeze({__proto__:null,base16:LQ,base16upper:UQ});const jQ=pi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zQ=pi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),JQ=pi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),qQ=pi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),GQ=pi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),VQ=pi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),WQ=pi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),KQ=pi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),XQ=pi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ZQ=Object.freeze({__proto__:null,base32:jQ,base32upper:zQ,base32pad:JQ,base32padupper:qQ,base32hex:GQ,base32hexupper:VQ,base32hexpad:WQ,base32hexpadupper:KQ,base32z:XQ});const YQ=q1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),QQ=q1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var eee=Object.freeze({__proto__:null,base36:YQ,base36upper:QQ});const tee=q1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ree=q1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var nee=Object.freeze({__proto__:null,base58btc:tee,base58flickr:ree});const iee=pi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
70+/",bitsPerChar:6}),see=pi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),oee=pi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),aee=pi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var cee=Object.freeze({__proto__:null,base64:iee,base64pad:see,base64url:oee,base64urlpad:aee});const gR=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),lee=gR.reduce((t,e,r)=>(t[r]=e,t),[]),uee=gR.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function fee(t){return t.reduce((e,r)=>(e+=lee[r],e),"")}function dee(t){const e=[];for(const r of t){const n=uee[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const hee=My({prefix:"ð",name:"base256emoji",encode:fee,decode:dee});var pee=Object.freeze({__proto__:null,base256emoji:hee}),gee=mR,c_=128,mee=127,bee=~mee,yee=Math.pow(2,31);function mR(t,e,r){e=e||[],r=r||0;for(var n=r;t>=yee;)e[r++]=t&255|c_,t/=128;for(;t&bee;)e[r++]=t&255|c_,t>>>=7;return e[r]=t|0,mR.bytes=r-n+1,e}var vee=W3,wee=128,l_=127;function W3(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw W3.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&l_)<<i:(o&l_)*Math.pow(2,i),i+=7}while(o>=wee);return W3.bytes=s-n,r}var Eee=Math.pow(2,7),Aee=Math.pow(2,14),_ee=Math.pow(2,21),Cee=Math.pow(2,28),See=Math.pow(2,35),Tee=Math.pow(2,42),Nee=Math.pow(2,49),Iee=Math.pow(2,56),xee=Math.pow(2,63),Ree=function(t){return t<Eee?1:t<Aee?2:t<_ee?3:t<Cee?4:t<See?5:t<Tee?6:t<Nee?7:t<Iee?8:t<xee?9:10},Pee={encode:gee,decode:vee,encodingLength:Ree},bR=Pee;const u_=(t,e,r=0)=>(bR.encode(t,e,r),e),f_=t=>bR.encodingLength(t),K3=(t,e)=>{const r=e.byteLength,n=f_(t),i=n+f_(r),s=new Uint8Array(i+r);return u_(t,s,0),u_(r,s,n),s.set(e,i),new kee(t,r,e,s)};let kee=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const yR=({name:t,code:e,encode:r})=>new Oee(t,e,r);let Oee=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?K3(this.code,r):r.then(n=>K3(this.code,n))}else throw Error("Unknown type, must be binary type")}};const vR=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Mee=yR({name:"sha2-256",code:18,encode:vR("SHA-256")}),Dee=yR({name:"sha2-512",code:19,encode:vR("SHA-512")});var Bee=Object.freeze({__proto__:null,sha256:Mee,sha512:Dee});const wR=0,Fee="identity",ER=hR,$ee=t=>K3(wR,ER(t)),Lee={code:wR,name:Fee,encode:ER,digest:$ee};var Uee=Object.freeze({__proto__:null,identity:Lee});new TextEncoder,new TextDecoder;const d_={...kQ,...MQ,...BQ,...$Q,...HQ,...ZQ,...eee,...nee,...cee,...pee};({...Bee,...Uee});function AR(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const h_=AR("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),xv=AR("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=fR(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}
vendor: 5,424 bytes, line 70
70),_R={utf8:h_,"utf-8":h_,hex:d_.base16,latin1:xv,ascii:xv,binary:xv,...d_};function Dy(t,e="utf8"){const r=_R[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function qh(t,e="utf8"){const r=_R[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?iE(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function p_(t){return Df(Dy(qh(t,Oy),lR))}function Eb(t){return Dy(qh(Bf(t),lR),Oy)}function CR(t){const e=qh(yQ,a_),r=bQ+Dy(dR([e,t]),a_);return[gQ,mQ,r].join(pQ)}function Hee(t){return Dy(t,Oy)}function jee(t){return qh(t,Oy)}function zee(t){return qh([Eb(t.header),Eb(t.payload)].join(wb),uR)}function Jee(t){return[Eb(t.header),Eb(t.payload),Hee(t.signature)].join(wb)}function X3(t){const e=t.split(wb),r=p_(e[0]),n=p_(e[1]),i=jee(e[2]),s=qh(e.slice(0,2).join(wb),uR);return{header:r,payload:n,signature:i,data:s}}function g_(t=Yx(vQ)){const e=cR.getPublicKey(t);return{secretKey:dR([t,e]),publicKey:e}}async function qee(t,e,r,n,i=we.fromMiliseconds(Date.now())){const s={alg:dQ,typ:hQ},o=CR(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=zee({header:s,payload:c}),u=cR.sign(l,n.secretKey.slice(0,32));return Jee({header:s,payload:c,signature:u})}var m_=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))},Gee=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),Vee=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Wee=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),Kee=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Xee=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Zee=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Yee=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,b_=3,Qee=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Zee]],y_=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function ete(t){return t?v_(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Xee:typeof navigator<"u"?v_(navigator.userAgent):nte()}function tte(t){return t!==""&&Qee.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function v_(t){var e=tte(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Kee;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<b_&&(i=m_(m_([],i,!0),ite(b_-i.length),!0)):i=[];var s=i.join("."),o=rte(t),a=Yee.exec(t);
70return a&&a[1]?new Wee(r,s,o,a[1]):new Gee(r,s,o)}function rte(t){for(var e=0,r=y_.length;e<r;e++){var n=y_[e],i=n[0],s=n[1],o=s.exec(t);if(o)return i}return null}function nte(){var t=typeof process<"u"&&process.version;return t?new Vee(process.version.slice(1)):null}function ite(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.getLocalStorage=Xr.getLocalStorageOrThrow=Xr.getCrypto=Xr.getCryptoOrThrow=SR=Xr.getLocation=Xr.getLocationOrThrow=sE=Xr.getNavigator=Xr.getNavigatorOrThrow=Ff=Xr.getDocument=Xr.getDocumentOrThrow=Xr.getFromWindowOrThrow=Xr.getFromWindow=void 0;function Zf(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Xr.getFromWindow=Zf;function Gh(t){const e=Zf(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Xr.getFromWindowOrThrow=Gh;function ste(){return Gh("document")}Xr.getDocumentOrThrow=ste;function ote(){return Zf("document")}var Ff=Xr.getDocument=ote;function ate(){return Gh("navigator")}Xr.getNavigatorOrThrow=ate;function cte(){return Zf("navigator")}var sE=Xr.getNavigator=cte;function lte(){return Gh("location")}Xr.getLocationOrThrow=lte;function ute(){return Zf("location")}var SR=Xr.getLocation=ute;function fte(){return Gh("crypto")}Xr.getCryptoOrThrow=fte;function dte(){return Zf("crypto")}Xr.getCrypto=dte;function hte(){return Gh("localStorage")}Xr.getLocalStorageOrThrow=hte;function pte(){return Zf("localStorage")}Xr.getLocalStorage=pte;var oE={};Object.defineProperty(oE,"__esModule",{value:!0});var TR=oE.getWindowMetadata=void 0;const w_=Xr;function gte(){let t,e;try{t=w_.getDocumentOrThrow(),e=w_.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),d=[];for(let h=0;h<f.length;h++){const g=f[h],b=g.getAttribute("rel");if(b&&b.toLowerCase().indexOf("icon")>-1){const w=g.getAttribute("href");if(w)if(w.toLowerCase().indexOf("https:")===-1&&w.toLowerCase().indexOf("http:")===-1&&w.indexOf("//")!==0){let x=e.protocol+"//"+e.host;if(w.indexOf("/")===0)x+=w;
vendor: 41,544 bytes, lines 70-71
70else{const k=e.pathname.split("/");k.pop();const R=k.join("/");x+=R+"/"+w}d.push(x)}else if(w.indexOf("//")===0){const x=e.protocol+w;d.push(x)}else d.push(w)}}return d}function n(...f){const d=t.getElementsByTagName("meta");for(let h=0;h<d.length;h++){const g=d[h],b=["itemprop","property","name"].map(w=>g.getAttribute(w)).filter(w=>w?f.includes(w):!1);if(b.length&&b){const w=g.getAttribute("content");if(w)return w}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}TR=oE.getWindowMetadata=gte;const mte="0.1.1";function bte(){return mte}let Nn=class Z3 extends Error{constructor(e,r={}){const n=(()=>{var c;if(r.cause instanceof Z3){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),i=(()=>r.cause instanceof Z3&&r.cause.docsPath||r.docsPath)(),o=`https://oxlib.sh${i??""}`,a=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${o}`:void 0]:[]].filter(c=>typeof c=="string").join(` 71`);super(a,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${bte()}`}),this.cause=r.cause,this.details=n,this.docs=o,this.docsPath=i,this.shortMessage=e}walk(e){return NR(this,e)}};function NR(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?NR(t.cause,e):e?null:t}const pd=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function yte(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function t1(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function $f(t,...e){if(!yte(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function vte(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");t1(t.outputLen),t1(t.blockLen)}function Sh(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function IR(t,e){$f(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function wte(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Th(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Rv(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function ra(t,e){return t<<32-e|t>>>e}const Ete=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function Ate(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function _te(t){for(let e=0;e<t.length;e++)t[e]=Ate(t[e]);return t}const E_=Ete?t=>t:_te;function Cte(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function By(t){return typeof t=="string"&&(t=Cte(t)),$f(t),t}function Ste(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];$f(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}class aE{}function xR(t){const e=n=>t().update(By(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Tte(t=32){if(pd&&typeof pd.getRandomValues=="function")return pd.getRandomValues(new Uint8Array(t));if(pd&&typeof pd.randomBytes=="function")return Uint8Array.from(pd.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}function Nte(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}function Ite(t,e,r){return t&e^~t&r}function xte(t,e,r){return t&e^t&r^e&r}class Rte extends aE{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Rv(this.buffer)}update(e){Sh(this),e=By(e),$f(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Rv(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Sh(this),IR(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,Th(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let f=o;f<i;f++)r[f]=0;Nte(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Rv(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const pl=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Dg=BigInt(2**32-1),A_=BigInt(32);function Pte(t,e=!1){return e?{h:Number(t&Dg),l:Number(t>>A_&Dg)}:{h:Number(t>>A_&Dg)|0,l:Number(t&Dg)|0}}function kte(t,e=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:o,l:a}=Pte(t[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const Ote=(t,e,r)=>t<<r|e>>>32-r,Mte=(t,e,r)=>e<<r|t>>>32-r,Dte=(t,e,r)=>e<<r-32|t>>>64-r,Bte=(t,e,r)=>t<<r-32|e>>>64-r,Fte=BigInt(0),f0=BigInt(1),$te=BigInt(2),Lte=BigInt(7),Ute=BigInt(256),Hte=BigInt(113),RR=[],PR=[],kR=[];for(let t=0,e=f0,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],RR.push(2*(5*n+r)),PR.push((t+1)*(t+2)/2%64);let i=Fte;for(let s=0;s<7;s++)e=(e<<f0^(e>>Lte)*Hte)%Ute,e&$te&&(i^=f0<<(f0<<BigInt(s))-f0);kR.push(i)}const OR=kte(kR,!0),jte=OR[0],zte=OR[1],__=(t,e,r)=>r>32?Dte(t,e,r):Ote(t,e,r),C_=(t,e,r)=>r>32?Bte(t,e,r):Mte(t,e,r);function Jte(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=__(l,u,1)^r[a],d=C_(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=PR[o],c=__(i,s,a),l=C_(i,s,a),u=RR[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=jte[n],t[1]^=zte[n]}Th(r)}class cE extends aE{constructor(e,r,n,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,t1(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=wte(this.state)}clone(){return this._cloneInto()}keccak(){E_(this.state32),Jte(this.state32,this.rounds),E_(this.state32),this.posOut=0,this.pos=0}update(e){Sh(this),e=By(e),$f(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Sh(this,!1),$f(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return t1(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(IR(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,Th(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new cE(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const qte=(t,e,r)=>xR(()=>new cE(e,t,r)),Gte=(()=>qte(1,136,256/8))(),Vte=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),gl=new Uint32Array(64);let Wte=class extends Rte{constructor(e=32){super(64,e,8,!1),this.A=pl[0]|0,this.B=pl[1]|0,this.C=pl[2]|0,this.D=pl[3]|0,this.E=pl[4]|0,this.F=pl[5]|0,this.G=pl[6]|0,this.H=pl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)gl[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=gl[f-15],h=gl[f-2],g=ra(d,7)^ra(d,18)^d>>>3,b=ra(h,17)^ra(h,19)^h>>>10;gl[f]=b+gl[f-7]+g+gl[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=ra(a,6)^ra(a,11)^ra(a,25),h=u+d+Ite(a,c,l)+Vte[f]+gl[f]|0,b=(ra(n,2)^ra(n,13)^ra(n,22))+xte(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+b|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Th(gl)}destroy(){this.set(0,0,0,0,0,0,0,0),Th(this.buffer)}};const Kte=xR(()=>new Wte);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const lE=BigInt(0),Y3=BigInt(1);function G1(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function uE(t){if(!G1(t))throw new Error("Uint8Array expected")}function r1(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function Bg(t){const e=t.toString(16);return e.length&1?"0"+e:e}function MR(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?lE:BigInt("0x"+t)}const DR=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Xte=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function n1(t){if(uE(t),DR)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=Xte[t[r]];return e}const uc={_0:48,_9:57,A:65,F:70,a:97,f:102};function S_(t){if(t>=uc._0&&t<=uc._9)return t-uc._0;if(t>=uc.A&&t<=uc.F)return t-(uc.A-10);if(t>=uc.a&&t<=uc.f)return t-(uc.a-10)}function Ab(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(DR)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=S_(t.charCodeAt(s)),a=S_(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function mf(t){return MR(n1(t))}function BR(t){return uE(t),MR(n1(Uint8Array.from(t).reverse()))}function V1(t,e){return Ab(t.toString(16).padStart(e*2,"0"))}function FR(t,e){return V1(t,e).reverse()}function Qs(t,e,r){let n;if(typeof e=="string")try{n=Ab(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(G1(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}function _b(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];uE(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}const Pv=t=>typeof t=="bigint"&&lE<=t;function fE(t,e,r){return Pv(t)&&Pv(e)&&Pv(r)&&e<=t&&t<r}function Kd(t,e,r,n){if(!fE(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function Zte(t){let e;for(e=0;t>lE;t>>=Y3,e+=1);return e}const Fy=t=>(Y3<<BigInt(t))-Y3,kv=t=>new Uint8Array(t),T_=t=>Uint8Array.from(t);function Yte(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=kv(t),i=kv(t),s=0;const o=()=>{n.fill(1),i.fill(0),s=0},a=(...f)=>r(i,n,...f),c=(f=kv(0))=>{i=a(T_([0]),f),n=a(),f.length!==0&&(i=a(T_([1]),f),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const d=[];for(;f<e;){n=a();const h=n.slice();d.push(h),f+=n.length}return _b(...d)};return(f,d)=>{o(),c(f);let h;for(;!(h=d(l()));)c();return o(),h}}const Qte={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||G1(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function $y(t,e,r={}){const n=(i,s,o)=>{const a=Qte[s];if(typeof a!="function")throw new Error("invalid validator function");const c=t[i];if(!(o&&c===void 0)&&!a(c,t))throw new Error("param "+String(i)+" is invalid. Expected "+s+", got "+c)};for(const[i,s]of Object.entries(e))n(i,s,!1);for(const[i,s]of Object.entries(r))n(i,s,!0);return t}function N_(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}function ere(t,e){if(P_(t)>e)throw new Ere({givenSize:P_(t),maxSize:e})}const fc={zero:48,nine:57,A:65,F:70,a:97,f:102};function I_(t){if(t>=fc.zero&&t<=fc.nine)return t-fc.zero;if(t>=fc.A&&t<=fc.F)return t-(fc.A-10);if(t>=fc.a&&t<=fc.f)return t-(fc.a-10)}function tre(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;if(t.length>n)throw new Are({size:t.length,targetSize:n,type:"Bytes"});const i=new Uint8Array(n);for(let s=0;s<n;s++){const o=r==="right";i[o?s:n-s-1]=t[o?s:t.length-s-1]}return i}function $R(t,e){if(au(t)>e)throw new fre({givenSize:au(t),maxSize:e})}function rre(t,e){if(typeof e=="number"&&e>0&&e>au(t)-1)throw new HR({offset:e,position:"start",size:au(t)})}function nre(t,e,r){if(typeof e=="number"&&typeof r=="number"&&au(t)!==r-e)throw new HR({offset:r,position:"end",size:au(t)})}function LR(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;const i=t.replace("0x","");if(i.length>n*2)throw new dre({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}const ire="#__bigint";function dE(t,e,r){return JSON.stringify(t,(n,i)=>typeof e=="function"?e(n,i):typeof i=="bigint"?i.toString()+ire:i,r)}const sre=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function ore(t,e={}){const{strict:r=!1}=e;if(!t)throw new x_(t);if(typeof t!="string")throw new x_(t);if(r&&!/^0x[0-9a-fA-F]*$/.test(t))throw new R_(t);if(!t.startsWith("0x"))throw new R_(t)}function are(...t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function hE(t){return t instanceof Uint8Array?Cb(t):Array.isArray(t)?Cb(new Uint8Array(t)):t}function Cb(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=sre[t[i]];const n=`0x${r}`;return typeof e.size=="number"?($R(n,e.size),UR(n,e.size)):n}function Ov(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<o){const l=typeof t=="bigint"?"n":"";throw new ure({max:s?`${s}${l}`:void 0,min:`${o}${l}`,signed:r,size:n,value:`${t}${l}`})}const c=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?cre(c,n):c}function cre(t,e){return LR(t,{dir:"left",size:e})}function UR(t,e){return LR(t,{dir:"right",size:e})}function _c(t,e,r,n={}){const{strict:i}=n;rre(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return i&&nre(s,e,r),s}function au(t){return Math.ceil((t.length-2)/2)}function lre(t,e={}){const{strict:r=!1}=e;try{return ore(t,{strict:r}),!0}catch{return!1}}class ure extends Nn{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number \`${s}\` is not in safe${i?` ${i*8}-bit`:""}${n?" signed":" unsigned"} integer range ${e?`(\`${r}\` to \`${e}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class x_ extends Nn{constructor(e){super(`Value \`${typeof e=="object"?dE(e):e}\` of type \`${typeof e}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class R_ extends Nn{constructor(e){super(`Value \`${e}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}let fre=class extends Nn{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}};class HR extends Nn{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${e}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}let dre=class extends Nn{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};const hre=new TextEncoder;function pre(t){if(!(t instanceof Uint8Array)){if(!t)throw new Fg(t);if(typeof t!="object")throw new Fg(t);if(!("BYTES_PER_ELEMENT"in t))throw new Fg(t);if(t.BYTES_PER_ELEMENT!==1||t.constructor.name!=="Uint8Array")throw new Fg(t)}}function gre(t){return t instanceof Uint8Array?t:typeof t=="string"?bre(t):mre(t)}function mre(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function bre(t,e={}){const{size:r}=e;let n=t;r&&($R(t,r),n=UR(t,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const l=I_(i.charCodeAt(c++)),u=I_(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new Nn(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);o[a]=l*16+u}return o}function yre(t,e={}){const{size:r}=e,n=hre.encode(t);return typeof r=="number"?(ere(n,r),vre(n,r)):n}function vre(t,e){return tre(t,{dir:"right",size:e})}function P_(t){return t.length}function wre(t){try{return pre(t),!0}catch{return!1}}class Fg extends Nn{constructor(e){super(`Value \`${typeof e=="object"?dE(e):e}\` of type \`${typeof e}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}class Ere extends Nn{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}}class Are extends Nn{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${e}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}function jR(t,e={}){const{as:r=typeof t=="string"?"Hex":"Bytes"}=e,n=Gte(gre(t));return r==="Bytes"?n:Cb(n)}class _re extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const Cre={checksum:new _re(8192)},Mv=Cre.checksum;function zR(t,e={}){const{compressed:r}=e,{prefix:n,x:i,y:s}=t;if(r===!1||typeof i=="bigint"&&typeof s=="bigint"){if(n!==4)throw new k_({prefix:n,cause:new Rre});return}if(r===!0||typeof i=="bigint"&&typeof s>"u"){if(n!==3&&n!==2)throw new k_({prefix:n,cause:new xre});return}throw new Ire({publicKey:t})}function Sre(t){const e=(()=>{if(lre(t))return JR(t);if(wre(t))return Tre(t);const{prefix:r,x:n,y:i}=t;return typeof n=="bigint"&&typeof i=="bigint"?{prefix:r??4,x:n,y:i}:{prefix:r,x:n}})();return zR(e),e}function Tre(t){return JR(Cb(t))}function JR(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new Pre({publicKey:t});if(t.length===130){const n=BigInt(_c(t,0,32)),i=BigInt(_c(t,32,64));return{prefix:4,x:n,y:i}}if(t.length===132){const n=Number(_c(t,0,1)),i=BigInt(_c(t,1,33)),s=BigInt(_c(t,33,65));return{prefix:n,x:i,y:s}}const e=Number(_c(t,0,1)),r=BigInt(_c(t,1,33));return{prefix:e,x:r}}function Nre(t,e={}){zR(t);const{prefix:r,x:n,y:i}=t,{includePrefix:s=!0}=e;return are(s?Ov(r,{size:1}):"0x",Ov(n,{size:32}),typeof i=="bigint"?Ov(i,{size:32}):"0x")}class Ire extends Nn{constructor({publicKey:e}){super(`Value \`${dE(e)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class k_ extends Nn{constructor({prefix:e,cause:r}){super(`Prefix "${e}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class xre extends Nn{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class Rre extends Nn{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let Pre=class extends Nn{constructor({publicKey:e}){super(`Value \`${e}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${au(hE(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const kre=/^0x[a-fA-F0-9]{40}$/;function qR(t,e={}){const{strict:r=!0}=e;if(!kre.test(t))throw new O_({address:t,cause:new Dre});if(r){if(t.toLowerCase()===t)return;if(GR(t)!==t)throw new O_({address:t,cause:new Bre})}}function GR(t){if(Mv.has(t))return Mv.get(t);qR(t,{strict:!1});const e=t.substring(2).toLowerCase(),r=jR(yre(e),{as:"Bytes"}),n=e.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&n[s]&&(n[s]=n[s].toUpperCase()),(r[s>>1]&15)>=8&&n[s+1]&&(n[s+1]=n[s+1].toUpperCase());const i=`0x${n.join("")}`;return Mv.set(t,i),i}function Ore(t,e={}){const{checksum:r=!1}=e;return qR(t),r?GR(t):t}function Mre(t,e={}){const r=jR(`0x${Nre(t).slice(4)}`).substring(26);return Ore(`0x${r}`,e)}class O_ extends Nn{constructor({address:e,cause:r}){super(`Address "${e}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class Dre extends Nn{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class Bre extends Nn{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}class VR extends aE{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,vte(e);const n=By(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),Th(s)}update(e){return Sh(this),this.iHash.update(e),this}digestInto(e){Sh(this),$f(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const WR=(t,e,r)=>new VR(t,e).update(r).digest();WR.create=(t,e)=>new VR(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fs=BigInt(0),Ui=BigInt(1),of=BigInt(2),Fre=BigInt(3),KR=BigInt(4),XR=BigInt(5),ZR=BigInt(8);function ss(t,e){const r=t%e;return r>=fs?r:e+r}function Vs(t,e,r){let n=t;for(;e-- >fs;)n*=n,n%=r;return n}function Q3(t,e){if(t===fs)throw new Error("invert: expected non-zero number");if(e<=fs)throw new Error("invert: expected positive modulus, got "+e);let r=ss(t,e),n=e,i=fs,s=Ui;for(;r!==fs;){const a=n/r,c=n%r,l=i-s*a;n=r,r=c,i=s,s=l}if(n!==Ui)throw new Error("invert: does not exist");return ss(i,e)}function YR(t,e){const r=(t.ORDER+Ui)/KR,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw new Error("Cannot find square root");return n}function $re(t,e){const r=(t.ORDER-XR)/ZR,n=t.mul(e,of),i=t.pow(n,r),s=t.mul(e,i),o=t.mul(t.mul(s,of),i),a=t.mul(s,t.sub(o,t.ONE));if(!t.eql(t.sqr(a),e))throw new Error("Cannot find square root");return a}function Lre(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-Ui,r=0;for(;e%of===fs;)e/=of,r++;let n=of;const i=pE(t);for(;M_(i,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return YR;let s=i.pow(n,e);const o=(e+Ui)/of;return function(c,l){if(c.is0(l))return l;if(M_(c,l)!==1)throw new Error("Cannot find square root");let u=r,f=c.mul(c.ONE,s),d=c.pow(l,e),h=c.pow(l,o);for(;!c.eql(d,c.ONE);){if(c.is0(d))return c.ZERO;let g=1,b=c.sqr(d);for(;!c.eql(b,c.ONE);)if(g++,b=c.sqr(b),g===u)throw new Error("Cannot find square root");const w=Ui<<BigInt(u-g-1),x=c.pow(f,w);u=g,f=c.sqr(x),d=c.mul(d,f),h=c.mul(h,x)}return h}}function Ure(t){return t%KR===Fre?YR:t%ZR===XR?$re:Lre(t)}const Hre=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function jre(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Hre.reduce((n,i)=>(n[i]="function",n),e);return $y(t,r)}function zre(t,e,r){if(r<fs)throw new Error("invalid exponent, negatives unsupported");if(r===fs)return t.ONE;if(r===Ui)return e;let n=t.ONE,i=e;for(;r>fs;)r&Ui&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Ui;return n}function QR(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((o,a,c)=>t.is0(a)?o:(n[c]=o,t.mul(o,a)),t.ONE),s=t.inv(i);return e.reduceRight((o,a,c)=>t.is0(a)?o:(n[c]=t.mul(o,n[c]),t.mul(o,a)),s),n}function M_(t,e){const r=(t.ORDER-Ui)/of,n=t.pow(e,r),i=t.eql(n,t.ONE),s=t.eql(n,t.ZERO),o=t.eql(n,t.neg(t.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function eP(t,e){e!==void 0&&t1(e);const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function pE(t,e,r=!1,n={}){if(t<=fs)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=eP(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let o;const a=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:Fy(i),ZERO:fs,ONE:Ui,create:c=>ss(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return fs<=c&&c<t},is0:c=>c===fs,isOdd:c=>(c&Ui)===Ui,neg:c=>ss(-c,t),eql:(c,l)=>c===l,sqr:c=>ss(c*c,t),add:(c,l)=>ss(c+l,t),sub:(c,l)=>ss(c-l,t),mul:(c,l)=>ss(c*l,t),pow:(c,l)=>zre(a,c,l),div:(c,l)=>ss(c*Q3(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>Q3(c,t),sqrt:n.sqrt||(c=>(o||(o=Ure(t)),o(a,c))),toBytes:c=>r?FR(c,s):V1(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?BR(c):mf(c)},invertBatch:c=>QR(a,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(a)}function tP(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function rP(t){const e=tP(t);return e+Math.ceil(e/2)}function Jre(t,e,r=!1){const n=t.length,i=tP(e),s=rP(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const o=r?BR(t):mf(t),a=ss(o,e-Ui)+Ui;return r?FR(a,i):V1(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const D_=BigInt(0),e6=BigInt(1);function Dv(t,e){const r=e.negate();return t?r:e}function nP(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Bv(t,e){nP(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t,s=Fy(t),o=BigInt(t);return{windows:r,windowSize:n,mask:s,maxNumber:i,shiftBy:o}}function B_(t,e,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:o}=r;let a=Number(t&i),c=t>>o;a>n&&(a-=s,c+=e6);const l=e*n,u=l+Math.abs(a)-1,f=a===0,d=a<0,h=e%2!==0;return{nextN:c,offset:u,isZero:f,isNeg:d,isNegF:h,offsetF:l}}function qre(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function Gre(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const Fv=new WeakMap,iP=new WeakMap;function $v(t){return iP.get(t)||1}function Vre(t,e){return{constTimeNegate:Dv,hasPrecomputes(r){return $v(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>D_;)n&e6&&(i=i.add(s)),s=s.double(),n>>=e6;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=Bv(n,e),o=[];let a=r,c=a;for(let l=0;l<i;l++){c=a,o.push(c);for(let u=1;u<s;u++)c=c.add(a),o.push(c);a=c.double()}return o},wNAF(r,n,i){let s=t.ZERO,o=t.BASE;const a=Bv(r,e);for(let c=0;c<a.windows;c++){const{nextN:l,offset:u,isZero:f,isNeg:d,isNegF:h,offsetF:g}=B_(i,c,a);i=l,f?o=o.add(Dv(h,n[g])):s=s.add(Dv(d,n[u]))}return{p:s,f:o}},wNAFUnsafe(r,n,i,s=t.ZERO){const o=Bv(r,e);for(let a=0;a<o.windows&&i!==D_;a++){const{nextN:c,offset:l,isZero:u,isNeg:f}=B_(i,a,o);if(i=c,!u){const d=n[l];s=s.add(f?d.negate():d)}}return s},getPrecomputes(r,n,i){let s=Fv.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&Fv.set(n,i(s))),s},wNAFCached(r,n,i){const s=$v(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const o=$v(r);return o===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(o,this.getPrecomputes(o,r,i),n,s)},setWindowSize(r,n){nP(n,e),iP.set(r,n),Fv.delete(r)}}}function Wre(t,e,r,n){qre(r,t),Gre(n,e);const i=r.length,s=n.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=Zte(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=Fy(c),u=new Array(Number(l)+1).fill(o),f=Math.floor((e.BITS-1)/c)*c;let d=o;for(let h=f;h>=0;h-=c){u.fill(o);for(let b=0;b<s;b++){const w=n[b],x=Number(w>>BigInt(h)&l);u[x]=u[x].add(r[b])}let g=o;for(let b=u.length-1,w=o;b>0;b--)w=w.add(u[b]),g=g.add(w);if(d=d.add(g),h!==0)for(let b=0;b<c;b++)d=d.double()}return d}function sP(t){return jre(t.Fp),$y(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eP(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function F_(t){t.lowS!==void 0&&r1("lowS",t.lowS),t.prehash!==void 0&&r1("prehash",t.prehash)}function Kre(t){const e=sP(t);$y(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}class Xre extends Error{constructor(e=""){super(e)}}const Nc={Err:Xre,_tlv:{encode:(t,e)=>{const{Err:r}=Nc;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=Bg(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?Bg(i.length/2|128):"";return Bg(t)+s+i+e},decode(t,e){const{Err:r}=Nc;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");const l=e.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(n+=c,o<128)throw new r("tlv.decode(long): not minimal encoding")}const a=e.subarray(n,n+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=Nc;if(t<xc)throw new e("integer: negative integers are not allowed");let r=Bg(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=Nc;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return mf(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=Nc,i=Qs("signature",t),{v:s,l:o}=n.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){const{_tlv:e,_int:r}=Nc,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),s=n+i;return e.encode(48,s)}};function Lv(t,e){return n1(V1(t,e))}const xc=BigInt(0),Kn=BigInt(1);BigInt(2);const Uv=BigInt(3),Zre=BigInt(4);function Yre(t){const e=Kre(t),{Fp:r}=e,n=pE(e.n,e.nBitLength),i=e.toBytes||((R,D,O)=>{const M=D.toAffine();return _b(Uint8Array.from([4]),r.toBytes(M.x),r.toBytes(M.y))}),s=e.fromBytes||(R=>{const D=R.subarray(1),O=r.fromBytes(D.subarray(0,r.BYTES)),M=r.fromBytes(D.subarray(r.BYTES,2*r.BYTES));return{x:O,y:M}});function o(R){const{a:D,b:O}=e,M=r.sqr(R),F=r.mul(M,R);return r.add(r.add(F,r.mul(R,D)),O)}function a(R,D){const O=r.sqr(D),M=o(R);return r.eql(O,M)}if(!a(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const c=r.mul(r.pow(e.a,Uv),Zre),l=r.mul(r.sqr(e.b),BigInt(27));if(r.is0(r.add(c,l)))throw new Error("bad curve params: a or b");function u(R){return fE(R,Kn,e.n)}function f(R){const{allowedPrivateKeyLengths:D,nByteLength:O,wrapPrivateKey:M,n:F}=e;if(D&&typeof R!="bigint"){if(G1(R)&&(R=n1(R)),typeof R!="string"||!D.includes(R.length))throw new Error("invalid private key");R=R.padStart(O*2,"0")}let H;try{H=typeof R=="bigint"?R:mf(Qs("private key",R,O))}catch{throw new Error("invalid private key, expected hex or "+O+" bytes, got "+typeof R)}return M&&(H=ss(H,F)),Kd("private key",H,Kn,F),H}function d(R){if(!(R instanceof b))throw new Error("ProjectivePoint expected")}const h=N_((R,D)=>{const{px:O,py:M,pz:F}=R;if(r.eql(F,r.ONE))return{x:O,y:M};const H=R.is0();D==null&&(D=H?r.ONE:r.inv(F));const U=r.mul(O,D),G=r.mul(M,D),N=r.mul(F,D);if(H)return{x:r.ZERO,y:r.ZERO};if(!r.eql(N,r.ONE))throw new Error("invZ was invalid");return{x:U,y:G}}),g=N_(R=>{if(R.is0()){if(e.allowInfinityPoint&&!r.is0(R.py))return;throw new Error("bad point: ZERO")}const{x:D,y:O}=R.toAffine();if(!r.isValid(D)||!r.isValid(O))throw new Error("bad point: x or y not FE");if(!a(D,O))throw new Error("bad point: equation left != right");if(!R.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class b{constructor(D,O,M){if(D==null||!r.isValid(D))throw new Error("x required");if(O==null||!r.isValid(O)||r.is0(O))throw new Error("y required");if(M==null||!r.isValid(M))throw new Error("z required");this.px=D,this.py=O,this.pz=M,Object.freeze(this)}static fromAffine(D){const{x:O,y:M}=D||{};if(!D||!r.isValid(O)||!r.isValid(M))throw new Error("invalid affine point");if(D instanceof b)throw new Error("projective point not allowed");const F=H=>r.eql(H,r.ZERO);return F(O)&&F(M)?b.ZERO:new b(O,M,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(D){const O=QR(r,D.map(M=>M.pz));return D.map((M,F)=>M.toAffine(O[F])).map(b.fromAffine)}static fromHex(D){const O=b.fromAffine(s(Qs("pointHex",D)));return O.assertValidity(),O}static fromPrivateKey(D){return b.BASE.multiply(f(D))}static msm(D,O){return Wre(b,n,D,O)}_setWindowSize(D){k.setWindowSize(this,D)}assertValidity(){g(this)}hasEvenY(){const{y:D}=this.toAffine();if(r.isOdd)return!r.isOdd(D);throw new Error("Field doesn't support isOdd")}equals(D){d(D);const{px:O,py:M,pz:F}=this,{px:H,py:U,pz:G}=D,N=r.eql(r.mul(O,G),r.mul(H,F)),A=r.eql(r.mul(M,G),r.mul(U,F));return N&&A}negate(){return new b(this.px,r.neg(this.py),this.pz)}double(){const{a:D,b:O}=e,M=r.mul(O,Uv),{px:F,py:H,pz:U}=this;let G=r.ZERO,N=r.ZERO,A=r.ZERO,v=r.mul(F,F),p=r.mul(H,H),m=r.mul(U,U),y=r.mul(F,H);return y=r.add(y,y),A=r.mul(F,U),A=r.add(A,A),G=r.mul(D,A),N=r.mul(M,m),N=r.add(G,N),G=r.sub(p,N),N=r.add(p,N),N=r.mul(G,N),G=r.mul(y,G),A=r.mul(M,A),m=r.mul(D,m),y=r.sub(v,m),y=r.mul(D,y),y=r.add(y,A),A=r.add(v,v),v=r.add(A,v),v=r.add(v,m),v=r.mul(v,y),N=r.add(N,v),m=r.mul(H,U),m=r.add(m,m),v=r.mul(m,y),G=r.sub(G,v),A=r.mul(m,p),A=r.add(A,A),A=r.add(A,A),new b(G,N,A)}add(D){d(D);const{px:O,py:M,pz:F}=this,{px:H,py:U,pz:G}=D;let N=r.ZERO,A=r.ZERO,v=r.ZERO;const p=e.a,m=r.mul(e.b,Uv);let y=r.mul(O,H),T=r.mul(M,U),I=r.mul(F,G),_=r.add(O,M),E=r.add(H,U);_=r.mul(_,E),E=r.add(y,T),_=r.sub(_,E),E=r.add(O,F);let C=r.add(H,G);return E=r.mul(E,C),C=r.add(y,I),E=r.sub(E,C),C=r.add(M,F),N=r.add(U,G),C=r.mul(C,N),N=r.add(T,I),C=r.sub(C,N),v=r.mul(p,E),N=r.mul(m,I),v=r.add(N,v),N=r.sub(T,v),v=r.add(T,v),A=r.mul(N,v),T=r.add(y,y),T=r.add(T,y),I=r.mul(p,I),E=r.mul(m,E),T=r.add(T,I),I=r.sub(y,I),I=r.mul(p,I),E=r.add(E,I),y=r.mul(T,E),A=r.add(A,y),y=r.mul(C,E),N=r.mul(_,N),N=r.sub(N,y),y=r.mul(_,T),v=r.mul(C,v),v=r.add(v,y),new b(N,A,v)}subtract(D){return this.add(D.negate())}is0(){return this.equals(b.ZERO)}wNAF(D){return k.wNAFCached(this,D,b.normalizeZ)}multiplyUnsafe(D){const{endo:O,n:M}=e;Kd("scalar",D,xc,M);const F=b.ZERO;if(D===xc)return F;if(this.is0()||D===Kn)return this;if(!O||k.hasPrecomputes(this))return k.wNAFCachedUnsafe(this,D,b.normalizeZ);let{k1neg:H,k1:U,k2neg:G,k2:N}=O.splitScalar(D),A=F,v=F,p=this;for(;
vendor: 4,100 bytes, line 71
71U>xc||N>xc;)U&Kn&&(A=A.add(p)),N&Kn&&(v=v.add(p)),p=p.double(),U>>=Kn,N>>=Kn;return H&&(A=A.negate()),G&&(v=v.negate()),v=new b(r.mul(v.px,O.beta),v.py,v.pz),A.add(v)}multiply(D){const{endo:O,n:M}=e;Kd("scalar",D,Kn,M);let F,H;if(O){const{k1neg:U,k1:G,k2neg:N,k2:A}=O.splitScalar(D);let{p:v,f:p}=this.wNAF(G),{p:m,f:y}=this.wNAF(A);v=k.constTimeNegate(U,v),m=k.constTimeNegate(N,m),m=new b(r.mul(m.px,O.beta),m.py,m.pz),F=v.add(m),H=p.add(y)}else{const{p:U,f:G}=this.wNAF(D);F=U,H=G}return b.normalizeZ([F,H])[0]}multiplyAndAddUnsafe(D,O,M){const F=b.BASE,H=(G,N)=>N===xc||N===Kn||!G.equals(F)?G.multiplyUnsafe(N):G.multiply(N),U=H(this,O).add(H(D,M));return U.is0()?void 0:U}toAffine(D){return h(this,D)}isTorsionFree(){const{h:D,isTorsionFree:O}=e;if(D===Kn)return!0;if(O)return O(b,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:D,clearCofactor:O}=e;return D===Kn?this:O?O(b,this):this.multiplyUnsafe(e.h)}toRawBytes(D=!0){return r1("isCompressed",D),this.assertValidity(),i(b,this,D)}toHex(D=!0){return r1("isCompressed",D),n1(this.toRawBytes(D))}}b.BASE=new b(e.Gx,e.Gy,r.ONE),b.ZERO=new b(r.ZERO,r.ONE,r.ZERO);const{endo:w,nBitLength:x}=e,k=Vre(b,w?Math.ceil(x/2):x);return{CURVE:e,ProjectivePoint:b,normPrivateKeyToScalar:f,weierstrassEquation:o,isWithinCurveOrder:u}}function Qre(t){const e=sP(t);return $y(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function ene(t){const e=Qre(t),{Fp:r,n,nByteLength:i,nBitLength:s}=e,o=r.BYTES+1,a=2*r.BYTES+1;function c(m){return ss(m,n)}function l(m){return Q3(m,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:f,weierstrassEquation:d,isWithinCurveOrder:h}=Yre({...e,toBytes(m,y,T){const I=y.toAffine(),_=r.toBytes(I.x),E=_b;return r1("isCompressed",T),T?E(Uint8Array.from([y.hasEvenY()?2:3]),_):E(Uint8Array.from([4]),_,r.toBytes(I.y))},fromBytes(m){const y=m.length,T=m[0],I=m.subarray(1);if(y===o&&(T===2||T===3)){const _=mf(I);if(!fE(_,Kn,r.ORDER))throw new Error("Point is not on curve");const E=d(_);let C;try{C=r.sqrt(E)}catch($){const P=$ instanceof Error?": "+$.message:"";throw new Error("Point is not on curve"+P)}const S=(C&Kn)===Kn;return(T&1)===1!==S&&(C=r.neg(C)),{x:_,y:C}}else if(y===a&&T===4){const _=r.fromBytes(I.subarray(0,r.BYTES)),E=r.fromBytes(I.subarray(r.BYTES,2*r.BYTES));return{x:_,y:E}}else{const _=o,E=a;throw new Error("invalid Point, expected length of "+_+", or uncompressed "+E+", got "+y)}}});function g(m){const y=n>>Kn;return m>y}function b(m){return g(m)?c(-m):m}const w=(m,y,T)=>mf(m.slice(y,T));class x{constructor(y,T,I){Kd("r",y,Kn,n),Kd("s",T,Kn,n),this.r=y,this.s=T,I!=null&&(this.recovery=I),Object.freeze(this)}static fromCompact(y){const T=i;return y=Qs("compactSignature",y,T*2),new x(w(y,0,T),w(y,T,2*T))}static fromDER(y){const{r:T,s:I}=Nc.toSig(Qs("DER",y));return new x(T,I)}assertValidity(){}addRecoveryBit(y){return new x(this.r,this.s,y)}recoverPublicKey(y){const{r:T,s:I,recovery:_}=this,E=F(Qs("msgHash",y));if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");const C=_===2||_===3?T+e.n:T;if(C>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const S=_&1?"03":"02",B=u.fromHex(S+Lv(C,r.BYTES)),$=l(C),P=c(-E*$),q=c(I*$),V=u.BASE.multiplyAndAddUnsafe(B,P,q);if(!V)throw new Error("point at infinify");return V.assertValidity(),V}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new x(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Ab(this.toDERHex())}toDERHex(){return Nc.hexFromSig(this)}toCompactRawBytes(){return Ab(this.toCompactHex())}toCompactHex(){const y=i;return Lv(this.r,y)+Lv(this.s,y)}}const k={isValidPrivateKey(m){try{return f(m),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const m=rP(e.n);return Jre(e.randomBytes(m),e.n)},precompute(m=8,y=u.BASE){return y._setWindowSize(m),y.multiply(BigInt(3)),y}};function R(m,y=!0){return u.fromPrivateKey(m).toRawBytes(y)}function D(m){if(typeof m=="bigint")return!1;if(m instanceof u)return!0;
vendor: 8,759 bytes, line 71
71const T=Qs("key",m).length,I=r.BYTES,_=I+1,E=2*I+1;if(!(e.allowedPrivateKeyLengths||i===_))return T===_||T===E}function O(m,y,T=!0){if(D(m)===!0)throw new Error("first arg must be private key");if(D(y)===!1)throw new Error("second arg must be public key");return u.fromHex(y).multiply(f(m)).toRawBytes(T)}const M=e.bits2int||function(m){if(m.length>8192)throw new Error("input is too large");const y=mf(m),T=m.length*8-s;return T>0?y>>BigInt(T):y},F=e.bits2int_modN||function(m){return c(M(m))},H=Fy(s);function U(m){return Kd("num < 2^"+s,m,xc,H),V1(m,i)}function G(m,y,T=N){if(["recovered","canonical"].some(Z=>Z in T))throw new Error("sign() legacy options not supported");const{hash:I,randomBytes:_}=e;let{lowS:E,prehash:C,extraEntropy:S}=T;E==null&&(E=!0),m=Qs("msgHash",m),F_(T),C&&(m=Qs("prehashed msgHash",I(m)));const B=F(m),$=f(y),P=[U($),U(B)];if(S!=null&&S!==!1){const Z=S===!0?_(r.BYTES):S;P.push(Qs("extraEntropy",Z))}const q=_b(...P),V=B;function X(Z){const ie=M(Z);if(!h(ie))return;const ce=l(ie),se=u.BASE.multiply(ie).toAffine(),_e=c(se.x);if(_e===xc)return;const ye=c(ce*c(V+_e*$));if(ye===xc)return;let Te=(se.x===_e?0:2)|Number(se.y&Kn),ht=ye;return E&&g(ye)&&(ht=b(ye),Te^=1),new x(_e,ht,Te)}return{seed:q,k2sig:X}}const N={lowS:e.lowS,prehash:!1},A={lowS:e.lowS,prehash:!1};function v(m,y,T=N){const{seed:I,k2sig:_}=G(m,y,T),E=e;return Yte(E.hash.outputLen,E.nByteLength,E.hmac)(I,_)}u.BASE._setWindowSize(8);function p(m,y,T,I=A){var Te;const _=m;y=Qs("msgHash",y),T=Qs("publicKey",T);const{lowS:E,prehash:C,format:S}=I;if(F_(I),"strict"in I)throw new Error("options.strict was renamed to lowS");if(S!==void 0&&S!=="compact"&&S!=="der")throw new Error("format must be compact or der");const B=typeof _=="string"||G1(_),$=!B&&!S&&typeof _=="object"&&_!==null&&typeof _.r=="bigint"&&typeof _.s=="bigint";if(!B&&!$)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let P,q;try{if($&&(P=new x(_.r,_.s)),B){try{S!=="compact"&&(P=x.fromDER(_))}catch(ht){if(!(ht instanceof Nc.Err))throw ht}!P&&S!=="der"&&(P=x.fromCompact(_))}q=u.fromHex(T)}catch{return!1}if(!P||E&&P.hasHighS())return!1;C&&(y=e.hash(y));const{r:V,s:X}=P,Z=F(y),ie=l(X),ce=c(Z*ie),se=c(V*ie),_e=(Te=u.BASE.multiplyAndAddUnsafe(q,ce,se))==null?void 0:Te.toAffine();return _e?c(_e.x)===V:!1}return{CURVE:e,getPublicKey:R,getSharedSecret:O,sign:v,verify:p,ProjectivePoint:u,Signature:x,utils:k}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function tne(t){return{hash:t,hmac:(e,...r)=>WR(t,e,Ste(...r)),randomBytes:Tte}}function rne(t,e){const r=n=>ene({...t,...tne(n)});return{...r(e),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const oP=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),$_=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),nne=BigInt(0),ine=BigInt(1),t6=BigInt(2),L_=(t,e)=>(t+e/t6)/e;function sne(t){const e=oP,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,f=Vs(u,r,e)*u%e,d=Vs(f,r,e)*u%e,h=Vs(d,t6,e)*l%e,g=Vs(h,i,e)*h%e,b=Vs(g,s,e)*g%e,w=Vs(b,a,e)*b%e,x=Vs(w,c,e)*w%e,k=Vs(x,a,e)*b%e,R=Vs(k,r,e)*u%e,D=Vs(R,o,e)*g%e,O=Vs(D,n,e)*l%e,M=Vs(O,t6,e);if(!r6.eql(r6.sqr(M),t))throw new Error("Cannot find square root");return M}const r6=pE(oP,void 0,void 0,{sqrt:sne}),one=rne({a:nne,b:BigInt(7),Fp:r6,n:$_,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=$_,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-ine*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,o=BigInt("0x100000000000000000000000000000000"),a=L_(s*t,e),c=L_(-n*t,e);let l=ss(t-a*r-c*i,e),u=ss(-a*n-c*s,e);const f=l>o,d=u>o;if(f&&(l=e-l),d&&(u=e-u),l>o||u>o)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:l,k2neg:d,k2:u}}}},Kte);function ane(t){if(t.length!==130&&t.length!==132)throw new lne({signature:t});const e=BigInt(_c(t,0,32)),r=BigInt(_c(t,32,64)),n=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return cne(i)}catch{throw new une({value:i})}})();return typeof n>"u"?{r:e,s:r}:{r:e,s:r,yParity:n}}function cne(t){if(t===0||t===27)return 0;if(t===1||t===28)return 1;if(t>=35)return t%2===0?1:0;throw new fne({value:t})}class lne extends Nn{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${au(hE(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class une extends Nn{constructor({value:e}){super(`Value \`${e}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class fne extends Nn{constructor({value:e}){super(`Value \`${e}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function aP(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function cP(t,e){return Array.isArray(e)?e.length===0?!0:t?e.every(r=>typeof r=="string"):e.every(r=>Number.isSafeInteger(r)):!1}function Sb(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function W1(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function Tb(t){if(!Array.isArray(t))throw new Error("array expected")}function Nb(t,e){if(!cP(!0,e))throw new Error(`${t}: array of strings expected`)}function lP(t,e){if(!cP(!1,e))throw new Error(`${t}: array of numbers expected`)}function uP(...t){const e=s=>s,r=(s,o)=>a=>s(o(a)),n=t.map(s=>s.encode).reduceRight(r,e),i=t.map(s=>s.decode).reduce(r,e);return{encode:n,decode:i}}function fP(t){const e=typeof t=="string"?t.split(""):t,r=e.length;Nb("alphabet",e);const n=new Map(e.map((i,s)=>[i,s]));return{encode:i=>(Tb(i),i.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${t}`);return e[s]})),decode:i=>(Tb(i),i.map(s=>{Sb("alphabet.decode",s);const o=n.get(s);if(o===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${t}`);return o}))}}function dP(t=""){return Sb("join",t),{encode:e=>(Nb("join.decode",e),e.join(t)),decode:e=>(Sb("join.decode",e),e.split(t))}}function dne(t,e="="){return W1(t),Sb("padding",e),{encode(r){for(Nb("padding.encode",r);r.length*t%8;)r.push(e);return r},decode(r){Nb("padding.decode",r);let n=r.length;if(n*t%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===e;n--)if((n-1)*t%8===0)throw new Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}function U_(t,e,r){if(e<2)throw new Error(`convertRadix: invalid from=${e}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Tb(t),!t.length)return[];let n=0;const i=[],s=Array.from(t,a=>{if(W1(a),a<0||a>=e)throw new Error(`invalid integer: ${a}`);return a}),o=s.length;for(;;){let a=0,c=!0;for(let l=n;l<o;l++){const u=s[l],f=e*a,d=f+u;if(!Number.isSafeInteger(d)||f/e!==a||d-u!==f)throw new Error("convertRadix: carry overflow");const h=d/r;a=d%r;const g=Math.floor(h);if(s[l]=g,!Number.isSafeInteger(g)||g*r+a!==d)throw new Error("convertRadix: carry overflow");if(c)g?c=!1:n=l;else continue}if(i.push(a),c)break}for(let a=0;a<t.length-1&&t[a]===0;a++)i.push(0);return i.reverse()}const hP=(t,e)=>e===0?t:hP(e,t%e),Ib=(t,e)=>t+(e-hP(t,e)),Hv=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function H_(t,e,r,n){if(Tb(t),e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(Ib(e,r)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${Ib(e,r)}`);let i=0,s=0;const o=Hv[e],a=Hv[r]-1,c=[];for(const l of t){if(W1(l),l>=o)throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);if(i=i<<e|l,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=r;s-=r)c.push((i>>s-r&a)>>>0);const u=Hv[s];if(u===void 0)throw new Error("invalid carry");i&=u-1}if(i=i<<r-s&a,!n&&s>=e)throw new Error("Excess padding");if(!n&&i>0)throw new Error(`Non-zero padding: ${i}`);return n&&s>0&&c.push(i>
71>>0),c}function hne(t){W1(t);const e=2**8;return{encode:r=>{if(!aP(r))throw new Error("radix.encode input should be Uint8Array");return U_(Array.from(r),e,t)},decode:r=>(lP("radix.decode",r),Uint8Array.from(U_(r,t,e)))}}function pne(t,e=!1){if(W1(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Ib(8,t)>32||Ib(t,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!aP(r))throw new Error("radix2.encode input should be Uint8Array");return H_(Array.from(r),8,t,!e)},decode:r=>(lP("radix2.decode",r),Uint8Array.from(H_(r,t,8,e)))}}const gne=uP(pne(5),fP("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),dne(5),dP("")),mne=t=>uP(hne(58),fP(t),dP("")),K1=mne("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function bne(t){return Mre(yne(t))}function yne(t){const{payload:e,signature:r}=t,{r:n,s:i,yParity:s}=r,a=new one.Signature(BigInt(n),BigInt(i)).addRecoveryBit(s).recoverPublicKey(hE(e).substring(2));return Sre(a)}var pP={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||c,d),g=r?r+l:l;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],h]:c._events[g].push(h):(c._events[g]=h,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,g=new Array(h);d<h;d++)g[d]=f[d].fn;return g},a.prototype.listenerCount=function(l){var u=r?r+l:l,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(l,u,f,d,h,g){var b=r?r+l:l;if(!this._events[b])return!1;var w=this._events[b],x=arguments.length,k,R;if(w.fn){switch(w.once&&this.removeListener(l,w.fn,void 0,!0),x){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,u),!0;case 3:return w.fn.call(w.context,u,f),!0;case 4:return w.fn.call(w.context,u,f,d),!0;case 5:return w.fn.call(w.context,u,f,d,h),!0;case 6:return w.fn.call(w.context,u,f,d,h,g),!0}for(R=1,k=new Array(x-1);R<x;R++)k[R-1]=arguments[R];w.fn.apply(w.context,k)}else{var D=w.length,O;for(R=0;R<D;R++)switch(w[R].once&&this.removeListener(l,w[R].fn,void 0,!0),x){case 1:w[R].fn.call(w[R].context);break;case 2:w[R].fn.call(w[R].context,u);break;case 3:w[R].fn.call(w[R].context,u,f);break;case 4:w[R].fn.call(w[R].context,u,f,d);break;default:if(!k)for(O=1,k=new Array(x-1);O<x;O++)k[O-1]=arguments[O];w[R].fn.apply(w[R].context,k)}}return!0},a.prototype.on=function(l,u,f){return s(this,l,u,f,!1)},a.prototype.once=function(l,u,f){return s(this,l,u,f,!0)},a.prototype.removeListener=function(l,u,f,d){var h=r?r+l:l;if(!this._events[h])return this;if(!u)return o(this,h),this;var g=this._events[h];if(g.fn)g.fn===u&&(!d||g.once)&&(!f||g.context===f)&&o(this,h);else{for(var b=0,w=[],x=g.length;b<x;b++)(g[b].fn!==u||d&&!g[b].once||f&&g[b].context!==f)&&w.push(g[b]);w.length?this._events[h]=w.length===1?w[0]:w:o(this,h)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=r?r+l:l,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,t.exports=a})(pP);var vne=pP.exports;const wne=zf(vne);function Ene(t){const e=t.length;let r=0,n=0;for(;n<e;){let i=t.charCodeAt(n++);if(i&4294967168)if(!(i&4294965248))r+=2;else{if(i>=55296&&i<=56319&&n<e){const s=t.charCodeAt(n);(s&64512)===56320&&(++n,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?r+=4:r+=3}else{r++;continue}}return r}function Ane(t,e,r){const n=t.length;let i=r,s=0;for(;s<n;){let o=t.charCodeAt(s++);if(o&4294967168)if(!(o&4294965248))e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<n){const a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}o&4294901760?(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128):(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128)}else{e[i++]=o;continue}e[i++]=o&63|128}}const _ne=new TextEncoder,Cne=50;function Sne(t,e,r){_ne.encodeInto(t,e.subarray(r))}function Tne(t,e,r){t.length>Cne?Sne(t,e,r):Ane(t,e,r)}const Nne=4096;function gP(t,e,r){let n=e;const i=n+r,s=[];let o="";for(;n<i;){const a=t[n++];if(!(a&128))s.push(a);else if((a&224)===192){const c=t[n++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){const c=t[n++]&63,l=t[n++]&63;s.push((a&31)<<12|c<<6|l)}else if((a&248)===240){const c=t[n++]&63,l=t[n++]&63,u=t[n++]&63;let f=(a&7)<<18|c<<12|l<<6|u;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(a);s.length>=Nne&&(o+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}
vendor: 60,531 bytes, lines 71-73
71const Ine=new TextDecoder,xne=200;function Rne(t,e,r){const n=t.subarray(e,e+r);return Ine.decode(n)}function Pne(t,e,r){return r>xne?Rne(t,e,r):gP(t,e,r)}class $g{constructor(e,r){ot(this,"type");ot(this,"data");this.type=e,this.data=r}}class Ns extends Error{constructor(e){super(e);const r=Object.create(Ns.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:Ns.name})}}const d0=4294967295;function kne(t,e,r){const n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function mP(t,e,r){const n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function bP(t,e){const r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function One(t,e){const r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}const Mne=-1,Dne=4294967296-1,Bne=17179869184-1;function Fne({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=Bne)if(e===0&&t<=Dne){const r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t),r}else{const r=t/4294967296,n=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|r&3),s.setUint32(4,n),i}else{const r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,e),mP(n,4,t),r}}function $ne(t){const e=t.getTime(),r=Math.floor(e/1e3),n=(e-r*1e3)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-i*1e9}}function Lne(t){if(t instanceof Date){const e=$ne(t);return Fne(e)}else return null}function Une(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:return{sec:e.getUint32(0),nsec:0};case 8:{const r=e.getUint32(0),n=e.getUint32(4),i=(r&3)*4294967296+n,s=r>>>2;return{sec:i,nsec:s}}case 12:{const r=bP(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new Ns(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function Hne(t){const e=Une(t);return new Date(e.sec*1e3+e.nsec/1e6)}const jne={type:Mne,encode:Lne,decode:Hne},iy=class iy{constructor(){ot(this,"__brand");ot(this,"builtInEncoders",[]);ot(this,"builtInDecoders",[]);ot(this,"encoders",[]);ot(this,"decoders",[]);this.register(jne)}register({type:e,encode:r,decode:n}){if(e>=0)this.encoders[e]=r,this.decoders[e]=n;else{const i=-1-e;this.builtInEncoders[i]=r,this.builtInDecoders[i]=n}}tryToEncode(e,r){for(let n=0;n<this.builtInEncoders.length;n++){const i=this.builtInEncoders[n];if(i!=null){const s=i(e,r);if(s!=null){const o=-1-n;return new $g(o,s)}}}for(let n=0;n<this.encoders.length;n++){const i=this.encoders[n];if(i!=null){const s=i(e,r);if(s!=null){const o=n;return new $g(o,s)}}}return e instanceof $g?e:null}decode(e,r,n){const i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new $g(r,e)}};ot(iy,"defaultCodec",new iy);let xb=iy;function zne(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function n6(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):zne(t)?new Uint8Array(t):Uint8Array.from(t)}const Jne=100,qne=2048;let Gne=class yP{constructor(e){ot(this,"extensionCodec");ot(this,"context");ot(this,"useBigInt64");ot(this,"maxDepth");ot(this,"initialBufferSize");ot(this,"sortKeys");ot(this,"forceFloat32");ot(this,"ignoreUndefined");ot(this,"forceIntegerToFloat");ot(this,"pos");ot(this,"view");ot(this,"bytes");ot(this,"entered",!1);this.extensionCodec=(e==null?void 0:e.extensionCodec)??xb.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.maxDepth=(e==null?void 0:e.maxDepth)??Jne,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??qne,this.sortKeys=(e==null?void 0:e.sortKeys)??!1,this.forceFloat32=(e==null?void 0:e.forceFloat32)??!1,this.ignoreUndefined=(e==null?void 0:e.ignoreUndefined)??!1,this.forceIntegerToFloat=(e==null?void 0:e.forceIntegerToFloat)??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new yP({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,r){if(r>this.maxDepth)throw new Error(`Too deep objects in depth ${r}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,r)}ensureBufferSizeToWrite(e){const r=this.pos+e;this.view.byteLength<r&&this.resizeBuffer(r*2)}resizeBuffer(e){const r=new ArrayBuffer(e),n=new Uint8Array(r),i=new DataView(r);n.set(this.bytes),this.view=i,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const n=Ene(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),Tne(e,this.bytes,this.pos),this.pos+=n}encodeObject(e,r){const n=this.extensionCodec.tryToEncode(e,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(e))this.encodeArray(e,r);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,r);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const r=e.byteLength;if(r<256)this.writeU8(196),this.writeU8(r);else if(r<65536)this.writeU8(197),this.writeU16(r);else if(r<4294967296)this.writeU8(198),this.writeU32(r);else throw new Error(`Too large binary: ${r}`);const n=n6(e);this.writeU8a(n)}encodeArray(e,r){const n=e.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(const i of e)this.doEncode(i,r+1)}countWithoutUndefined(e,r){let n=0;for(const i of r)e[i]!==void 0&&n++;return n}encodeMap(e,r){const n=Object.keys(e);this.sortKeys&&n.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,n):n.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const s of n){const o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,r+1))}}encodeExtension(e){if(typeof e.data=="function"){const n=e.data(this.pos+6),i=n.length;if(i>=4294967296)throw new Error(`Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(n);return}const r=e.data.length;if(r===1)this.writeU8(212);else if(r===2)this.writeU8(213);else if(r===4)this.writeU8(214);else if(r===8)this.writeU8(215);else if(r===16)this.writeU8(216);else if(r<256)this.writeU8(199),this.writeU8(r);else if(r<65536)this.writeU8(200),this.writeU16(r);else if(r<4294967296)this.writeU8(201),this.writeU32(r);else throw new Error(`Too large extension object: ${r}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const r=e.length;this.ensureBufferSizeToWrite(r),this.bytes.set(e,this.pos),this.pos+=r}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),kne(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),mP(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}};function Vne(t,e){return new Gne(e).encodeSharedRef(t)}function jv(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const Wne=16,Kne=16;class Xne{constructor(e=Wne,r=Kne){ot(this,"hit",0);ot(this,"miss",0);ot(this,"caches");ot(this,"maxKeyLength");ot(this,"maxLengthPerKey");this.maxKeyLength=e,this.maxLengthPerKey=r,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,r,n){const i=this.caches[n-1];e:for(const s of i){const o=s.bytes;for(let a=0;a<n;a++)if(o[a]!==e[r+a])continue e;return s.str}return null}store(e,r){const n=this.caches[e.length-1],i={bytes:e,str:r};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=i:n.push(i)}decode(e,r,n){const i=this.find(e,r,n);if(i!=null)return this.hit++,i;this.miss++;const s=gP(e,r,n),o=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(o,s),s}}const i6="array",W0="map_key",vP="map_value",Zne=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new Ns("The type of key must be string or number but "+typeof t)};class Yne{constructor(){ot(this,"stack",[]);ot(this,"stackHeadPosition",-1)}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const r=this.getUninitializedStateFromPool();r.type=i6,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){const r=this.getUninitializedStateFromPool();r.type=W0,r.readCount=0,r.size=e,r.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===i6){const n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===W0||e.type===vP){const n=e;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const h0=-1,gE=new DataView(new ArrayBuffer(0)),Qne=new Uint8Array(gE.buffer);try{gE.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const j_=new RangeError("Insufficient data"),eie=new Xne;let tie=class wP{constructor(e){ot(this,"extensionCodec");ot(this,"context");ot(this,"useBigInt64");ot(this,"rawStrings");ot(this,"maxStrLength");ot(this,"maxBinLength");ot(this,"maxArrayLength");ot(this,"maxMapLength");ot(this,"maxExtLength");ot(this,"keyDecoder");ot(this,"mapKeyConverter");ot(this,"totalPos",0);ot(this,"pos",0);ot(this,"view",gE);ot(this,"bytes",Qne);ot(this,"headByte",h0);ot(this,"stack",new Yne);ot(this,"entered",!1);this.extensionCodec=(e==null?void 0:e.extensionCodec)??xb.defaultCodec,this.context=e==null?void 0:e.context,this.useBigInt64=(e==null?void 0:e.useBigInt64)??!1,this.rawStrings=(e==null?void 0:e.rawStrings)??!1,this.maxStrLength=(e==null?void 0:e.maxStrLength)??d0,this.maxBinLength=(e==null?void 0:e.maxBinLength)??d0,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??d0,this.maxMapLength=(e==null?void 0:e.maxMapLength)??d0,this.maxExtLength=(e==null?void 0:e.maxExtLength)??d0,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:eie,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??Zne}clone(){return new wP({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=h0,this.stack.reset()}setBuffer(e){const r=n6(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===h0&&!this.hasRemaining(1))this.setBuffer(e);else{const r=this.bytes.subarray(this.pos),n=n6(e),i=new Uint8Array(r.length+n.length);i.set(r),i.set(n,r.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:r,pos:n}=this;return new RangeError(`Extra ${r.byteLength-n} of ${r.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const r=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return r}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.entered=!0;let r=!1,n;for await(const a of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{n=this.doDecodeSync(),r=!0}catch(c){if(!(c instanceof RangeError))throw c}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}const{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${jv(i)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,r){if(this.entered){yield*this.clone().decodeMultiAsync(e,r);return}try{this.entered=!0;let n=r,i=-1;for await(const s of e){if(r&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(i=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let r;if(e>=224)r=e-256;else if(e<192)if(e<128)r=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else{const i=e-160;r=this.decodeString(i,0)}else if(e===192)r=null;else if(e===194)r=!1;else if(e===195)r=!0;else if(e===202)r=this.readF32();else if(e===203)r=this.readF64();else if(e===204)r=this.readU8();else if(e===205)r=this.readU16();else if(e===206)r=this.readU32();else if(e===207)this.useBigInt64?r=this.readU64AsBigInt():r=this.readU64();else if(e===208)r=this.readI8();else if(e===209)r=this.readI16();else if(e===210)r=this.readI32();else if(e===211)this.useBigInt64?r=this.readI64AsBigInt():r=this.readI64();else if(e===217){const i=this.lookU8();r=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();r=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();r=this.decodeString(i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else r=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else r={}}else if(e===196){const i=this.lookU8();r=this.decodeBinary(i,1)}else if(e===197){const i=this.lookU16();r=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();r=this.decodeBinary(i,4)}else if(e===212)r=this.decodeExtension(1,0);else if(e===213)r=this.decodeExtension(2,0);else if(e===214)r=this.decodeExtension(4,0);else if(e===215)r=this.decodeExtension(8,0);else if(e===216)r=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();r=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();r=this.decodeExtension(i,2)}else if(e===201){const i=this.lookU32();r=this.decodeExtension(i,4)}else throw new Ns(`Unrecognized type byte: ${jv(e)}`);this.complete();const n=this.stack;for(;n.length>0;){const i=n.top();if(i.type===i6)if(i.array[i.position]=r,i.position++,i.position===i.size)r=i.array,n.release(i);else continue e;else if(i.type===W0){if(r==="__proto__")throw new Ns("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=vP;continue e}else if(i.map[i.key]=r,i.readCount++,i.readCount===i.size)r=i.map,n.release(i);else{i.key=null,i.type=W0;continue e}}return r}}readHeadByte(){return this.headByte===h0&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=h0}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new Ns(`Unrecognized array type byte: ${jv(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new Ns(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new Ns(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,r){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,r):this.decodeBinary(e,r)}decodeUtf8String(e,r){var s;if(e>this.maxStrLength)throw new Ns(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw j_;const n=this.pos+r;let i;return this.stateIsMapKey()&&((s=this.keyDecoder)!=null&&s.canBeCached(e))?i=this.keyDecoder.decode(this.bytes,n,e):i=Pne(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===W0:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new Ns(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw j_;const n=this.pos+r,i=this.bytes.subarray(n,n+e);return this.pos+=r+e,i}decodeExtension(e,r){if(e>this.maxExtLength)throw new Ns(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const n=this.view.getInt8(this.pos+r),i=this.decodeBinary(e,r+1);return this.extensionCodec.decode(i,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=One(this.view,this.pos);return this.pos+=8,e}readI64(){const e=bP(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}};function rie(t,e){return new tie(e).decode(t)}function mE(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function EP(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?mE(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function K0(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=EP(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return mE(r)}function nie(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var b=0,w=0,x=0,k=g.length;x!==k&&g[x]===0;)x++,b++;for(var R=(k-x)*u+1>>>0,D=new Uint8Array(R);x!==k;){for(var O=g[x],M=0,F=R-1;(O!==0||M<w)&&F!==-1;F--,M++)O+=256*D[F]>>>0,D[F]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error("Non-zero carry");w=M,x++}for(var H=R-w;H!==R&&D[H]===0;)H++;for(var U=c.repeat(b);H<R;++H)U+=t.charAt(D[H]);return U}function d(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var b=0;if(g[b]!==" "){for(var w=0,x=0;g[b]===c;)w++,b++;for(var k=(g.length-b)*l+1>>>0,R=new Uint8Array(k);g[b];){var D=r[g.charCodeAt(b)];if(D===255)return;for(var O=0,M=k-1;(D!==0||O<x)&&M!==-1;M--,O++)D+=a*R[M]>>>0,R[M]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");x=O,b++}if(g[b]!==" "){for(var F=k-x;F!==k&&R[F]===0;)F++;for(var H=new Uint8Array(w+(k-F)),U=w;F!==k;)H[U++]=R[F++];return H}}}function h(g){var b=d(g);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var iie=nie,sie=iie;const oie=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},aie=t=>new TextEncoder().encode(t),cie=t=>new TextDecoder().decode(t);class lie{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class uie{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return AP(this,e)}}class fie{constructor(e){this.decoders=e}or(e){return AP(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const AP=(t,e)=>new fie({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class die{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new lie(e,r,n),this.decoder=new uie(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ly=({name:t,prefix:e,encode:r,decode:n})=>new die(t,e,r,n),X1=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=sie(r,e);return Ly({prefix:t,name:e,encode:n,decode:s=>oie(i(s))})},hie=(t,e,r,n)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const f=i[t[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},pie=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},gi=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Ly({prefix:e,name:t,encode(i){return pie(i,n,r)},decode(i){return hie(i,n,r,t)}}),gie=Ly({prefix:"\0",name:"identity",encode:t=>cie(t),decode:t=>aie(t)}),mie=Object.freeze(Object.defineProperty({__proto__:null,identity:gie},Symbol.toStringTag,{value:"Module"})),bie=gi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),yie=Object.freeze(Object.defineProperty({__proto__:null,base2:bie},Symbol.toStringTag,{value:"Module"})),vie=gi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),wie=Object.freeze(Object.defineProperty({__proto__:null,base8:vie},Symbol.toStringTag,{value:"Module"})),Eie=X1({prefix:"9",name:"base10",alphabet:"0123456789"}),Aie=Object.freeze(Object.defineProperty({__proto__:null,base10:Eie},Symbol.toStringTag,{value:"Module"})),_ie=gi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Cie=gi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Sie=Object.freeze(Object.defineProperty({__proto__:null,base16:_ie,base16upper:Cie},Symbol.toStringTag,{value:"Module"})),Tie=gi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Nie=gi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Iie=gi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),xie=gi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Rie=gi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Pie=gi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),kie=gi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Oie=gi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Mie=gi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Die=Object.freeze(Object.defineProperty({__proto__:null,base32:Tie,base32hex:Rie,base32hexpad:kie,base32hexpadupper:Oie,base32hexupper:Pie,base32pad:Iie,base32padupper:xie,base32upper:Nie,base32z:Mie},Symbol.toStringTag,{value:"Module"})),Bie=X1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Fie=X1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),$ie=Object.freeze(Object.defineProperty({__proto__:null,base36:Bie,base36upper:Fie},Symbol.toStringTag,{value:"Module"})),Lie=X1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Uie=X1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Hie=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Lie,base58flickr:Uie},Symbol.toStringTag,{value:"Module"})),jie=gi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),zie=gi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Jie=gi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),qie=gi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Gie=Object.freeze(Object.defineProperty({__proto__:null,base64:jie,base64pad:zie,base64url:Jie,base64urlpad:qie},Symbol.toStringTag,{value:"Module"})),_P=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð ððµðð¤²ð¤ ð¤§ððµð ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Vie=_P.reduce((t,e,r)=>(t[r]=e,t),[]),Wie=_P.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Kie(t){return t.reduce((e,r)=>(e+=Vie[r],e),"")}function Xie(t){const e=[];for(const r of t){const n=Wie[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Zie=Ly({prefix:"ð",name:"base256emoji",encode:Kie,decode:Xie}),Yie=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:Zie},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const z_={...mie,...yie,...wie,...Aie,...Sie,...Die,...$ie,...Hie,...Gie,...Yie};function CP(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const J_=CP("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),zv=CP("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=EP(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),SP={utf8:J_,"utf-8":J_,hex:z_.base16,latin1:zv,ascii:zv,binary:zv,...z_};function no(t,e="utf8"){const r=SP[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?mE(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function ps(t,e="utf8"){const r=SP[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const Qie={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},ese="Input must be an string, Buffer or Uint8Array";function tse(t){let e;if(t instanceof Uint8Array)e=t;else if(typeof t=="string")e=new TextEncoder().encode(t);else throw new Error(ese);return e}function rse(t){return Array.prototype.map.call(t,function(e){return(e<16?"0":"")+e.toString(16)}).join("")}function Lg(t){return(4294967296+t).toString(16).substring(1)}function nse(t,e,r){let n=` 72`+t+" = ";for(let i=0;i<e.length;i+=2){if(r===32)n+=Lg(e[i]).toUpperCase(),n+=" ",n+=Lg(e[i+1]).toUpperCase();else if(r===64)n+=Lg(e[i+1]).toUpperCase(),n+=Lg(e[i]).toUpperCase();else throw new Error("Invalid size "+r);i%6===4?n+=` 73`+new Array(t.length+4).join(" "):i<e.length-2&&(n+=" ")}console.log(n)}function ise(t,e,r){let n=new Date().getTime();const i=new Uint8Array(e);for(let o=0;o<e;o++)i[o]=o%256;const s=new Date().getTime();console.log("Generated random input in "+(s-n)+"ms"),n=s;for(let o=0;o<r;o++){const a=t(i),c=new Date().getTime(),l=c-n;n=c,console.log("Hashed in "+l+"ms: "+a.substring(0,20)+"..."),console.log(Math.round(e/(1<<20)/(l/1e3)*100)/100+" MB PER SECOND")}}var TP={normalizeInput:tse,toHex:rse,debugPrint:nse,testSpeed:ise};const Nm=TP;function Ug(t,e,r){const n=t[e]+t[r];let i=t[e+1]+t[r+1];n>=4294967296&&i++,t[e]=n,t[e+1]=i}function q_(t,e,r,n){let i=t[e]+r;r<0&&(i+=4294967296);let s=t[e+1]+n;i>=4294967296&&s++,t[e]=i,t[e+1]=s}function NP(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function ml(t,e,r,n,i,s){const o=F0[i],a=F0[i+1],c=F0[s],l=F0[s+1];Ug(wt,t,e),q_(wt,t,o,a);let u=wt[n]^wt[t],f=wt[n+1]^wt[t+1];wt[n]=f,wt[n+1]=u,Ug(wt,r,n),u=wt[e]^wt[r],f=wt[e+1]^wt[r+1],wt[e]=u>>>24^f<<8,wt[e+1]=f>>>24^u<<8,Ug(wt,t,e),q_(wt,t,c,l),u=wt[n]^wt[t],f=wt[n+1]^wt[t+1],wt[n]=u>>>16^f<<16,wt[n+1]=f>>>16^u<<16,Ug(wt,r,n),u=wt[e]^wt[r],f=wt[e+1]^wt[r+1],wt[e]=f>>>31^u<<1,wt[e+1]=u>>>31^f<<1}const IP=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),sse=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],wi=new Uint8Array(sse.map(function(t){return t*2})),wt=new Uint32Array(32),F0=new Uint32Array(32);function xP(t,e){let r=0;for(r=0;r<16;r++)wt[r]=t.h[r],wt[r+16]=IP[r];for(wt[24]=wt[24]^t.t,wt[25]=wt[25]^t.t/4294967296,e&&(wt[28]=~wt[28],wt[29]=~wt[29]),r=0;r<32;r++)F0[r]=NP(t.b,4*r);for(r=0;r<12;r++)ml(0,8,16,24,wi[r*16+0],wi[r*16+1]),ml(2,10,18,26,wi[r*16+2],wi[r*16+3]),ml(4,12,20,28,wi[r*16+4],wi[r*16+5]),ml(6,14,22,30,wi[r*16+6],wi[r*16+7]),ml(0,10,20,30,wi[r*16+8],wi[r*16+9]),ml(2,12,22,24,wi[r*16+10],wi[r*16+11]),ml(4,14,16,26,wi[r*16+12],wi[r*16+13]),ml(6,8,18,28,wi[r*16+14],wi[r*16+15]);for(r=0;r<16;r++)t.h[r]=t.h[r]^wt[r]^wt[r+16]}const bl=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function RP(t,e,r,n){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(e&&e.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&r.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&n.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t};bl.fill(0),bl[0]=t,e&&(bl[1]=e.length),bl[2]=1,bl[3]=1,r&&bl.set(r,32),n&&bl.set(n,48);for(let s=0;s<16;s++)i.h[s]=IP[s]^NP(bl,s*4);return e&&(bE(i,e),i.c=128),i}function bE(t,e){for(let r=0;r<e.length;r++)t.c===128&&(t.t+=t.c,xP(t,!1),t.c=0),t.b[t.c++]=e[r]}function PP(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;xP(t,!0);const e=new Uint8Array(t.outlen);for(let r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(r&3);return e}function kP(t,e,r,n,i){r=r||64,t=Nm.normalizeInput(t),n&&(n=Nm.normalizeInput(n)),i&&(i=Nm.normalizeInput(i));const s=RP(r,e,n,i);return bE(s,t),PP(s)}function ose(t,e,r,n,i){const s=kP(t,e,r,n,i);return Nm.toHex(s)}var ase={blake2b:kP,blake2bHex:ose,blake2bInit:RP,blake2bUpdate:bE,blake2bFinal:PP};const OP=TP;function cse(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function yl(t,e,r,n,i,s){wr[t]=wr[t]+wr[e]+i,wr[n]=Hg(wr[n]^wr[t],16),wr[r]=wr[r]+wr[n],wr[e]=Hg(wr[e]^wr[r],12),wr[t]=wr[t]+wr[e]+s,wr[n]=Hg(wr[n]^wr[t],8),wr[r]=wr[r]+wr[n],wr[e]=Hg(wr[e]^wr[r],7)}function Hg(t,e){return t>>>e^t<<32-e}const MP=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ei=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),wr=new Uint32Array(16),ii=new Uint32Array(16);function DP(t,e){let r=0;for(r=0;r<8;r++)wr[r]=t.h[r],wr[r+8]=MP[r];for(wr[12]^=t.t,wr[13]^=t.t/4294967296,e&&(wr[14]=~wr[14]),r=0;r<16;r++)ii[r]=cse(t.b,4*r);for(r=0;r<10;r++)yl(0,4,8,12,ii[Ei[r*16+0]],ii[Ei[r*16+1]]),yl(1,5,9,13,ii[Ei[r*16+2]],ii[Ei[r*16+3]]),yl(2,6,10,14,ii[Ei[r*16+4]],ii[Ei[r*16+5]]),yl(3,7,11,15,ii[Ei[r*16+6]],ii[Ei[r*16+7]]),yl(0,5,10,15,ii[Ei[r*16+8]],ii[Ei[r*16+9]]),yl(1,6,11,12,ii[Ei[r*16+10]],ii[Ei[r*16+11]]),yl(2,7,8,13,ii[Ei[r*16+12]],ii[Ei[r*16+13]]),yl(3,4,9,14,ii[Ei[r*16+14]],ii[Ei[r*16+15]]);for(r=0;r<8;r++)t.h[r]^=wr[r]^wr[r+8]}function BP(t,e){if(!(t>0&&t<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=e?e.length:0;if(e&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(MP),b:new Uint8Array(64),c:0,t:0,outlen:t};return n.h[0]^=16842752^r<<8^t,r>0&&(yE(n,e),n.c=64),n}function yE(t,e){for(let r=0;r<e.length;r++)t.c===64&&(t.t+=t.c,DP(t,!1),t.c=0),t.b[t.c++]=e[r]}function FP(t){for(t.t+=t.c;t.c<64;)t.b[t.c++]=0;DP(t,!0);const e=new Uint8Array(t.outlen);for(let r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(r&3)&255;return e}function $P(t,e,r){r=r||32,t=OP.normalizeInput(t);const n=BP(r,e);return yE(n,t),FP(n)}function lse(t,e,r){const n=$P(t,e,r);return OP.toHex(n)}var use={blake2s:$P,blake2sHex:lse,blake2sInit:BP,blake2sUpdate:yE,blake2sFinal:FP};const p0=ase,g0=use;var fse={blake2b:p0.blake2b,blake2bHex:p0.blake2bHex,blake2bInit:p0.blake2bInit,blake2bUpdate:p0.blake2bUpdate,blake2bFinal:p0.blake2bFinal,blake2s:g0.blake2s,blake2sHex:g0.blake2sHex,blake2sInit:g0.blake2sInit,blake2sUpdate:g0.blake2sUpdate,blake2sFinal:g0.blake2sFinal};const dse=":";function Fc(t){const[e,r]=t.split(dse);return{namespace:e,reference:r}}function LP(t,e){return t.includes(":")?[t]:e.chains||[]}const hse={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},pse={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Se(t,e){const{message:r,code:n}=pse[t];return{message:e?`${r} ${e}`:r,code:n}}function nn(t,e){const{message:r,code:n}=hse[t];return{message:e?`${r} ${e}`:r,code:n}}var gse=Object.defineProperty,mse=Object.defineProperties,bse=Object.getOwnPropertyDescriptors,G_=Object.getOwnPropertySymbols,yse=Object.prototype.hasOwnProperty,vse=Object.prototype.propertyIsEnumerable,s6=(t,e,r)=>e in t?gse(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,V_=(t,e)=>{for(var r in e||(e={}))yse.call(e,r)&&s6(t,r,e[r]);if(G_)for(var r of G_(e))vse.call(e,r)&&s6(t,r,e[r]);return t},wse=(t,e)=>mse(t,bse(e)),W_=(t,e,r)=>s6(t,typeof e!="symbol"?e+"":e,r);const Ese="ReactNative",Fs={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Ase="js";function Rb(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function gu(){return!Ff()&&!!sE()&&navigator.product===Ese}function _se(){return gu()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function Cse(){return gu()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function Vh(){return!Rb()&&!!sE()&&!!Ff()}function Z1(){return gu()?Fs.reactNative:Rb()?Fs.node:Vh()?Fs.browser:Fs.unknown}function K_(){var t;try{return gu()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function Sse(t,e){const r=new URLSearchParams(t);return Object.entries(e).sort(([n],[i])=>n.localeCompare(i)).forEach(([n,i])=>{i!=null&&r.set(n,String(i))}),r.toString()}function Tse(t){var e,r;const n=UP();try{return t!=null&&t.url&&n.url&&new URL(t.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${t.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),t.url=n.url),(e=t==null?void 0:t.icons)!=null&&e.length&&t.icons.length>0&&(t.icons=t.icons.filter(i=>i!=="")),wse(V_(V_({},n),t),{url:(t==null?void 0:t.url)||n.url,name:(t==null?void 0:t.name)||n.name,description:(t==null?void 0:t.description)||n.description,icons:(r=t==null?void 0:t.icons)!=null&&r.length&&t.icons.length>0?t.icons:n.icons})}catch(i){return console.warn("Error populating app metadata",i),t||n}}function UP(){return TR()||{name:"",description:"",url:"",icons:[""]}}function Nse(){if(Z1()===Fs.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=ete();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function Ise(){var t;const e=Z1();return e===Fs.browser?[e,((t=SR())==null?void 0:t.host)||"unknown"].join(":"):e}function HP(t,e,r){const n=Nse(),i=Ise();return[[t,e].join("-"),[Ase,r].join("-"),n,i].join("/")}function xse({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a,packageName:c}){const l=r.split("?"),u=HP(t,e,n),f={auth:i,ua:u,projectId:s,useOnCloseEvent:o||void 0,packageName:c||void 0,bundleId:a||void 0},d=Sse(l[1]||"",f);return l[0]+"?"+d}function af(t,e){return t.filter(r=>e.includes(r)).length===t.length}function o6(t){return Object.fromEntries(t.entries())}function a6(t){return new Map(Object.entries(t))}function Gu(t=we.FIVE_MINUTES,e){const r=we.toMiliseconds(t||we.FIVE_MINUTES);let n,i,s,o;return{resolve:a=>{s&&n&&(clearTimeout(s),n(a),o=Promise.resolve(a))},reject:a=>{s&&i&&(clearTimeout(s),i(a))},done:()=>new Promise((a,c)=>{if(o)return a(o);s=setTimeout(()=>{const l=Se("EXPIRED"),u=new Error(e||l.message);u.code=l.code,c(u)},r),n=a,i=c})}}function Ca(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function jP(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Rse(t){return jP("topic",t)}function Pse(t){return jP("id",t)}function zP(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function xn(t,e){return we.fromMiliseconds((e||Date.now())+we.toMiliseconds(t))}function ma(t){return Date.now()>=we.toMiliseconds(t)}function Pr(t,e){return`${t}${e?`:${e}`:""}`}function Ma(t=[],e=[]){return[...new Set([...t,...e])]}async function kse({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,s=i==null?void 0:i.href;if(typeof s!="string")return;const o=Ose(s,t,e),a=Z1();if(a===Fs.browser){if(!((n=Ff())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}Mse(o)}else a===Fs.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(o)}catch(i){console.error(i)}}function Ose(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const s=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${s}${$se(n,!0)}`}else i=`${i}/wc?${n}`;return i}function Mse(t){let e="_self";Fse()?e="_top":(Bse()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function Dse(t,e){let r="";try{if(Vh()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function X_(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Z_(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function vE(){return typeof process<"u"&&{}.IS_VITEST==="true"}function Bse(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function Fse(){try{return window.self!==window.top}catch{return!1}}function $se(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function JP(t){return Buffer.from(t,"base64").toString("utf-8")}function Lse(t){return new Promise(e=>setTimeout(e,t))}let Use=class{constructor({limit:e}){W_(this,"limit"),W_(this,"set"),this.limit=e,this.set=new Set}add(e){if(!this.set.has(e)){if(this.set.size>=this.limit){const r=this.set.values().next().value;r&&this.set.delete(r)}this.set.add(e)}}has(e){return this.set.has(e)}};const jg=BigInt(2**32-1),Y_=BigInt(32);function qP(t,e=!1){return e?{h:Number(t&jg),l:Number(t>>Y_&jg)}:{h:Number(t>>Y_&jg)|0,l:Number(t&jg)|0}}function GP(t,e=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:o,l:a}=qP(t[s],e);[n[s],i[s]]=[o,a]}return[n,i]}const Q_=(t,e,r)=>t>>>r,eC=(t,e,r)=>t<<32-r|e>>>r,Tl=(t,e,r)=>t>>>r|e<<32-r,Nl=(t,e,r)=>t<<32-r|e>>>r,$0=(t,e,r)=>t<<64-r|e>>>r-32,L0=(t,e,r)=>t>>>r-32|e<<64-r,Hse=(t,e)=>e,jse=(t,e)=>t,zse=(t,e,r)=>t<<r|e>>>32-r,Jse=(t,e,r)=>e<<r|t>>>32-r,qse=(t,e,r)=>e<<r-32|t>>>64-r,Gse=(t,e,r)=>t<<r-32|e>>>64-r;function xo(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const wE=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),EE=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,Vse=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),Wse=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,Kse=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Xse=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,gd=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Uy(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Wc(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Wo(t,...e){if(!Uy(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Hy(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Wc(t.outputLen),Wc(t.blockLen)}function cu(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function AE(t,e){Wo(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function i1(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function oo(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Jv(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function na(t,e){return t<<32-e|t>>>e}const VP=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function WP(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const bc=VP?t=>t:t=>WP(t);function Zse(t){for(let e=0;e<t.length;e++)t[e]=WP(t[e]);return t}const Il=VP?t=>t:Zse,KP=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",Yse=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Xd(t){if(Wo(t),KP)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=Yse[t[r]];return e}const dc={_0:48,_9:57,A:65,F:70,a:97,f:102};function tC(t){if(t>=dc._0&&t<=dc._9)return t-dc._0;if(t>=dc.A&&t<=dc.F)return t-(dc.A-10);if(t>=dc.a&&t<=dc.f)return t-(dc.a-10)}function Pb(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(KP)return Uint8Array.fromHex(t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,s=0;i<r;i++,s+=2){const o=tC(t.charCodeAt(s)),a=tC(t.charCodeAt(s+1));if(o===void 0||a===void 0){const c=t[s]+t[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[i]=o*16+a}return n}function XP(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function zo(t){return typeof t=="string"&&(t=XP(t)),Wo(t),t}function Ml(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];Wo(i),e+=i.length}const r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){const s=t[n];r.set(s,i),i+=s.length}return r}let jy=class{};function Y1(t){const e=n=>t().update(zo(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Qse(t){const e=(n,i)=>t(i).update(zo(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function Yf(t=32){if(gd&&typeof gd.getRandomValues=="function")return gd.getRandomValues(new Uint8Array(t));if(gd&&typeof gd.randomBytes=="function")return Uint8Array.from(gd.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const eoe=BigInt(0),m0=BigInt(1),toe=BigInt(2),roe=BigInt(7),noe=BigInt(256),ioe=BigInt(113),ZP=[],YP=[],QP=[];for(let t=0,e=m0,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],ZP.push(2*(5*n+r)),YP.push((t+1)*(t+2)/2%64);let i=eoe;for(let s=0;s<7;s++)e=(e<<m0^(e>>roe)*ioe)%noe,e&toe&&(i^=m0<<(m0<<BigInt(s))-m0);QP.push(i)}const ek=GP(QP,!0),soe=ek[0],ooe=ek[1],rC=(t,e,r)=>r>32?qse(t,e,r):zse(t,e,r),nC=(t,e,r)=>r>32?Gse(t,e,r):Jse(t,e,r);function aoe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=rC(l,u,1)^r[a],d=nC(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=YP[o],c=rC(i,s,a),l=nC(i,s,a),u=ZP[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=soe[n],t[1]^=ooe[n]}oo(r)}let coe=class tk extends jy{constructor(e,r,n,i=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,Wc(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=i1(this.state)}clone(){return this._cloneInto()}keccak(){Il(this.state32),aoe(this.state32,this.rounds),Il(this.state32),this.posOut=0,this.pos=0}update(e){cu(this),e=zo(e),Wo(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(r-this.pos,i-s);for(let a=0;a<o;a++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){cu(this,!1),Wo(e),this.finish();const r=this.state,{blockLen:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+o),i),this.posOut+=o,i+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Wc(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(AE(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,oo(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new tk(r,n,i,o,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const loe=(t,e,r)=>Y1(()=>new coe(e,t,r)),uoe=loe(1,136,256/8);function foe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}function doe(t,e,r){return t&e^~t&r}function hoe(t,e,r){return t&e^t&r^e&r}let rk=class extends jy{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=Jv(this.buffer)}update(e){cu(this),e=zo(e),Wo(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let o=0;o<s;){const a=Math.min(i-this.pos,s-o);if(a===i){const c=Jv(e);for(;i<=s-o;o+=i)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){cu(this),AE(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:o}=this;r[o++]=128,oo(this.buffer.subarray(o)),this.padOffset>i-o&&(this.process(n,0),o=0);for(let f=o;f<i;f++)r[f]=0;foe(n,i-8,BigInt(this.length*8),s),this.process(n,0);const a=Jv(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<l;f++)a.setUint32(4*f,u[f],s)}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:s,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=s,e.length=i,e.pos=a,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const vl=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ai=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),_i=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),poe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),wl=new Uint32Array(64);class goe extends rk{constructor(e=32){super(64,e,8,!1),this.A=vl[0]|0,this.B=vl[1]|0,this.C=vl[2]|0,this.D=vl[3]|0,this.E=vl[4]|0,this.F=vl[5]|0,this.G=vl[6]|0,this.H=vl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)wl[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=wl[f-15],h=wl[f-2],g=na(d,7)^na(d,18)^d>>>3,b=na(h,17)^na(h,19)^h>>>10;wl[f]=b+wl[f-7]+g+wl[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=na(a,6)^na(a,11)^na(a,25),h=u+d+doe(a,c,l)+poe[f]+wl[f]|0,g=(na(n,2)^na(n,13)^na(n,22))+hoe(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+g|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){oo(wl)}destroy(){this.set(0,0,0,0,0,0,0,0),oo(this.buffer)}}const nk=GP(["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","0xf40e3585
735771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),moe=nk[0],boe=nk[1],El=new Uint32Array(80),Al=new Uint32Array(80);let _E=class extends rk{constructor(e=64){super(128,e,16,!1),this.Ah=_i[0]|0,this.Al=_i[1]|0,this.Bh=_i[2]|0,this.Bl=_i[3]|0,this.Ch=_i[4]|0,this.Cl=_i[5]|0,this.Dh=_i[6]|0,this.Dl=_i[7]|0,this.Eh=_i[8]|0,this.El=_i[9]|0,this.Fh=_i[10]|0,this.Fl=_i[11]|0,this.Gh=_i[12]|0,this.Gl=_i[13]|0,this.Hh=_i[14]|0,this.Hl=_i[15]|0}get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:o,Dh:a,Dl:c,Eh:l,El:u,Fh:f,Fl:d,Gh:h,Gl:g,Hh:b,Hl:w}=this;return[e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w]}set(e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=f|0,this.Fl=d|0,this.Gh=h|0,this.Gl=g|0,this.Hh=b|0,this.Hl=w|0}process(e,r){for(let R=0;R<16;R++,r+=4)El[R]=e.getUint32(r),Al[R]=e.getUint32(r+=4);for(let R=16;R<80;R++){const D=El[R-15]|0,O=Al[R-15]|0,M=Tl(D,O,1)^Tl(D,O,8)^Q_(D,O,7),F=Nl(D,O,1)^Nl(D,O,8)^eC(D,O,7),H=El[R-2]|0,U=Al[R-2]|0,G=Tl(H,U,19)^$0(H,U,61)^Q_(H,U,6),N=Nl(H,U,19)^L0(H,U,61)^eC(H,U,6),A=Vse(F,N,Al[R-7],Al[R-16]),v=Wse(A,M,G,El[R-7],El[R-16]);El[R]=v|0,Al[R]=A|0}let{Ah:n,Al:i,Bh:s,Bl:o,Ch:a,Cl:c,Dh:l,Dl:u,Eh:f,El:d,Fh:h,Fl:g,Gh:b,Gl:w,Hh:x,Hl:k}=this;for(let R=0;R<80;R++){const D=Tl(f,d,14)^Tl(f,d,18)^$0(f,d,41),O=Nl(f,d,14)^Nl(f,d,18)^L0(f,d,41),M=f&h^~f&b,F=d&g^~d&w,H=Kse(k,O,F,boe[R],Al[R]),U=Xse(H,x,D,M,moe[R],El[R]),G=H|0,N=Tl(n,i,28)^$0(n,i,34)^$0(n,i,39),A=Nl(n,i,28)^L0(n,i,34)^L0(n,i,39),v=n&s^n&a^s&a,p=i&o^i&c^o&c;x=b|0,k=w|0,b=h|0,w=g|0,h=f|0,g=d|0,{h:f,l:d}=xo(l|0,u|0,U|0,G|0),l=a|0,u=c|0,a=s|0,c=o|0,s=n|0,o=i|0;const m=wE(G,A,p);n=EE(m,U,N,v),i=m|0}({h:n,l:i}=xo(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:o}=xo(this.Bh|0,this.Bl|0,s|0,o|0),{h:a,l:c}=xo(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=xo(this.Dh|0,this.Dl|0,l|0,u|0),{h:f,l:d}=xo(this.Eh|0,this.El|0,f|0,d|0),{h,l:g}=xo(this.Fh|0,this.Fl|0,h|0,g|0),{h:b,l:w}=xo(this.Gh|0,this.Gl|0,b|0,w|0),{h:x,l:k}=xo(this.Hh|0,this.Hl|0,x|0,k|0),this.set(n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k)}roundClean(){oo(El,Al)}destroy(){oo(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};class yoe extends _E{constructor(){super(48),this.Ah=Ai[0]|0,this.Al=Ai[1]|0,this.Bh=Ai[2]|0,this.Bl=Ai[3]|0,this.Ch=Ai[4]|0,this.Cl=Ai[5]|0,this.Dh=Ai[6]|0,this.Dl=Ai[7]|0,this.Eh=Ai[8]|0,this.El=Ai[9]|0,this.Fh=Ai[10]|0,this.Fl=Ai[11]|0,this.Gh=Ai[12]|0,this.Gl=Ai[13]|0,this.Hh=Ai[14]|0,this.Hl=Ai[15]|0}}const Ci=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class voe extends _E{constructor(){super(32),this.Ah=Ci[0]|0,this.Al=Ci[1]|0,this.Bh=Ci[2]|0,this.Bl=Ci[3]|0,this.Ch=Ci[4]|0,this.Cl=Ci[5]|0,this.Dh=Ci[6]|0,this.Dl=Ci[7]|0,this.Eh=Ci[8]|0,this.El=Ci[9]|0,this.Fh=Ci[10]|0,this.Fl=Ci[11]|0,this.Gh=Ci[12]|0,this.Gl=Ci[13]|0,this.Hh=Ci[14]|0,this.Hl=Ci[15]|0}}const zy=Y1(()=>new goe),woe=Y1(()=>new _E),Eoe=Y1(()=>new yoe),Aoe=Y1(()=>new voe),_oe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Bn=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Re=new Uint32Array(32);function _l(t,e,r,n,i,s){const o=i[s],a=i[s+1];
vendor: 27,629 bytes, lines 73-76
73let c=Re[2*t],l=Re[2*t+1],u=Re[2*e],f=Re[2*e+1],d=Re[2*r],h=Re[2*r+1],g=Re[2*n],b=Re[2*n+1],w=wE(c,u,o);l=EE(w,l,f,a),c=w|0,{Dh:b,Dl:g}={Dh:b^l,Dl:g^c},{Dh:b,Dl:g}={Dh:Hse(b,g),Dl:jse(b)},{h,l:d}=xo(h,d,b,g),{Bh:f,Bl:u}={Bh:f^h,Bl:u^d},{Bh:f,Bl:u}={Bh:Tl(f,u,24),Bl:Nl(f,u,24)},Re[2*t]=c,Re[2*t+1]=l,Re[2*e]=u,Re[2*e+1]=f,Re[2*r]=d,Re[2*r+1]=h,Re[2*n]=g,Re[2*n+1]=b}function Cl(t,e,r,n,i,s){const o=i[s],a=i[s+1];let c=Re[2*t],l=Re[2*t+1],u=Re[2*e],f=Re[2*e+1],d=Re[2*r],h=Re[2*r+1],g=Re[2*n],b=Re[2*n+1],w=wE(c,u,o);l=EE(w,l,f,a),c=w|0,{Dh:b,Dl:g}={Dh:b^l,Dl:g^c},{Dh:b,Dl:g}={Dh:Tl(b,g,16),Dl:Nl(b,g,16)},{h,l:d}=xo(h,d,b,g),{Bh:f,Bl:u}={Bh:f^h,Bl:u^d},{Bh:f,Bl:u}={Bh:$0(f,u,63),Bl:L0(f,u,63)},Re[2*t]=c,Re[2*t+1]=l,Re[2*e]=u,Re[2*e+1]=f,Re[2*r]=d,Re[2*r+1]=h,Re[2*n]=g,Re[2*n+1]=b}function Coe(t,e={},r,n,i){if(Wc(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");const{key:s,salt:o,personalization:a}=e;if(s!==void 0&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(o!==void 0&&o.length!==n)throw new Error("salt must be undefined or "+n);if(a!==void 0&&a.length!==i)throw new Error("personalization must be undefined or "+i)}class Soe extends jy{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,Wc(e),Wc(r),this.blockLen=e,this.outputLen=r,this.buffer=new Uint8Array(e),this.buffer32=i1(this.buffer)}update(e){cu(this),e=zo(e),Wo(e);const{blockLen:r,buffer:n,buffer32:i}=this,s=e.length,o=e.byteOffset,a=e.buffer;for(let c=0;c<s;){this.pos===r&&(Il(i),this.compress(i,0,!1),Il(i),this.pos=0);const l=Math.min(r-this.pos,s-c),u=o+c;if(l===r&&!(u%4)&&c+l<s){const f=new Uint32Array(a,u,Math.floor((s-c)/4));Il(f);for(let d=0;c+r<s;d+=i.length,c+=r)this.length+=r,this.compress(f,d,!1);Il(f);continue}n.set(e.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(e){cu(this),AE(e,this);const{pos:r,buffer32:n}=this;this.finished=!0,oo(this.buffer.subarray(r)),Il(n),this.compress(n,0,!0),Il(n);const i=i1(e);this.get().forEach((s,o)=>i[o]=bc(s))}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){const{buffer:r,length:n,finished:i,destroyed:s,outputLen:o,pos:a}=this;return e||(e=new this.constructor({dkLen:o})),e.set(...this.get()),e.buffer.set(r),e.destroyed=s,e.finished=i,e.length=n,e.pos=a,e.outputLen=o,e}clone(){return this._cloneInto()}}class Toe extends Soe{constructor(e={}){const r=e.dkLen===void 0?64:e.dkLen;super(128,r),this.v0l=Bn[0]|0,this.v0h=Bn[1]|0,this.v1l=Bn[2]|0,this.v1h=Bn[3]|0,this.v2l=Bn[4]|0,this.v2h=Bn[5]|0,this.v3l=Bn[6]|0,this.v3h=Bn[7]|0,this.v4l=Bn[8]|0,this.v4h=Bn[9]|0,this.v5l=Bn[10]|0,this.v5h=Bn[11]|0,this.v6l=Bn[12]|0,this.v6h=Bn[13]|0,this.v7l=Bn[14]|0,this.v7h=Bn[15]|0,Coe(r,e,64,16,16);let{key:n,personalization:i,salt:s}=e,o=0;if(n!==void 0&&(n=zo(n),o=n.length),this.v0l^=this.outputLen|o<<8|65536|1<<24,s!==void 0){s=zo(s);const a=i1(s);this.v4l^=bc(a[0]),this.v4h^=bc(a[1]),this.v5l^=bc(a[2]),this.v5h^=bc(a[3])}if(i!==void 0){i=zo(i);const a=i1(i);this.v6l^=bc(a[0]),this.v6h^=bc(a[1]),this.v7l^=bc(a[2]),this.v7h^=bc(a[3])}if(n!==void 0){const a=new Uint8Array(this.blockLen);a.set(n),this.update(a)}}get(){let{v0l:e,v0h:r,v1l:n,v1h:i,v2l:s,v2h:o,v3l:a,v3h:c,v4l:l,v4h:u,v5l:f,v5h:d,v6l:h,v6h:g,v7l:b,v7h:w}=this;return[e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w]}set(e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w){this.v0l=e|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=s|0,this.v2h=o|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=f|0,this.v5h=d|0,this.v6l=h|0,this.v6h=g|0,this.v7l=b|0,this.v7h=w|0}compress(e,r,n){this.get().forEach((c,l)=>Re[l]=c),Re.set(Bn,16);let{h:i,l:s}=qP(BigInt(this.length));Re[24]=Bn[8]^s,Re[25]=Bn[9]^i,n&&(Re[28]=~Re[28],Re[29]=~Re[29]);let o=0;const a=_oe;for(let c=0;c<12;c++)_l(0,4,8,12,e,r+2*a[o++]),Cl(0,4,8,12,e,r+2*a[o++]),_l(1,5,9,13,e,r+2*a[o++]),Cl(1,5,9,13,e,r+2*a[o++]),_l(2,6,10,14,e,r+2*a[o++]),Cl(2,6,10,14,e,r+2*a[o++]),_l(3,7,11,15,e,r+2*a[o++]),Cl(3,7,11,15,e,r+2*a[o++]),_l(0,5,10,15,e,r+2*a[o++]),Cl(0,5,10,15,e,r+2*a[o++]),_l(1,6,11,12,e,r+2*a[o++]),Cl(1,6,11,12,e,r+2*a[o++]),_l(2,7,8,13,e,r+2*a[o++]),Cl(2,7,8,13,e,r+2*a[o++]),_l(3,4,9,14,e,r+2*a[o++]),Cl(3,4,9,14,e,r+2*a[o++]);this.v0l^=Re[0]^Re[16],this.v0h^=Re[1]^Re[17],this.v1l^=Re[2]^Re[18],this.v1h^=Re[3]^Re[19],this.v2l^=Re[4]^Re[20],this.v2h^=Re[5]^Re[21],this.v3l^=Re[6]^Re[22],this.v3h^=Re[7]^Re[23],this.v4l^=Re[8]^Re[24],this.v4h^=Re[9]^Re[25],this.v5l^=Re[10]^Re[26],this.v5h^=Re[11]^Re[27],this.v6l^=Re[12]^Re[28],this.v6h^=Re[13]^Re[29],this.v7l^=Re[14]^Re[30],this.v7h^=Re[15]^Re[31],oo(Re)}destroy(){this.destroyed=!0,oo(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Noe=Qse(t=>new Toe(t)),Ioe="https://rpc.walletconnect.org/v1";function ik(t){const e=`�Ethereum Signed Message: 74${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(uoe(r)).toString("hex")}async function xoe(t,e,r,n,i,s){switch(r.t){case"eip191":return await Roe(t,e,r.s);case"eip1271":return await Poe(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function Roe(t,e,r){const n=ane(r);return bne({payload:ik(e),signature:n}).toLowerCase()===t.toLowerCase()}async function Poe(t,e,r,n,i,s){const o=Fc(n);if(!o.namespace||!o.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l=r.substring(2),u=(l.length/2).toString(16).padStart(64,"0"),f=(e.startsWith("0x")?e:ik(e)).substring(2),d=a+f+c+u+l,h=await fetch(`${s||Ioe}/?chainId=${n}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:koe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:d},"latest"]})}),{result:g}=await h.json();return g?g.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function koe(){return Date.now()+Math.floor(Math.random()*1e3)}function Ooe(t){const e=atob(t),r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e.charCodeAt(o);const n=r[0];if(n===0)throw new Error("No signatures found");const i=1+n*64;if(r.length<i)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");const s=Buffer.from(t,"base64").slice(1,65);return K1.encode(s)}function Moe(t){const e=new Uint8Array(Buffer.from(t,"base64")),r=Array.from("TransactionData::").map(s=>s.charCodeAt(0)),n=new Uint8Array(r.length+e.length);n.set(r),n.set(e,r.length);const i=Noe(n,{dkLen:32});return K1.encode(i)}function iC(t){const e=new Uint8Array(zy(Doe(t)));return K1.encode(e)}function Doe(t){if(t instanceof Uint8Array)return t;if(Array.isArray(t))return new Uint8Array(t);if(typeof t=="object"&&t!=null&&t.data)return new Uint8Array(Object.values(t.data));if(typeof t=="object"&&t)return new Uint8Array(Object.values(t));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function sC(t){const e=Buffer.from(t,"base64"),r=rie(e).txn;if(!r)throw new Error("Invalid signed transaction: missing 'txn' field");const n=Vne(r),i=Buffer.from("TX"),s=Buffer.concat([i,Buffer.from(n)]),o=Aoe(s);return gne.encode(o).replace(/=+$/,"")}function qv(t){const e=[];let r=BigInt(t);for(;r>=BigInt(128);)e.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return e.push(Number(r)),Buffer.from(e)}function Boe(t){const e=Buffer.from(t.signed.bodyBytes,"base64"),r=Buffer.from(t.signed.authInfoBytes,"base64"),n=Buffer.from(t.signature.signature,"base64"),i=[];i.push(Buffer.from([10])),i.push(qv(e.length)),i.push(e),i.push(Buffer.from([18])),i.push(qv(r.length)),i.push(r),i.push(Buffer.from([26])),i.push(qv(n.length)),i.push(n);const s=Buffer.concat(i),o=zy(s);return Buffer.from(o).toString("hex").toUpperCase()}function Foe(t){var e,r;const n=[];try{if(typeof t=="string")return n.push(t),n;if(typeof t!="object")return n;t!=null&&t.id&&n.push(t.id);const i=(r=(e=t==null?void 0:t.capabilities)==null?void 0:e.caip345)==null?void 0:r.transactionHashes;i&&n.push(...i)}catch(i){console.warn("getWalletSendCallsHashes failed: ",i)}return n}var $oe=Object.defineProperty,Loe=Object.defineProperties,Uoe=Object.getOwnPropertyDescriptors,oC=Object.getOwnPropertySymbols,Hoe=Object.prototype.hasOwnProperty,joe=Object.prototype.propertyIsEnumerable,aC=(t,e,r)=>e in t?$oe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zoe=(t,e)=>{for(var r in e||(e={}))Hoe.call(e,r)&&aC(t,r,e[r]);if(oC)for(var r of oC(e))joe.call(e,r)&&aC(t,r,e[r]);return t},Joe=(t,e)=>Loe(t,Uoe(e));const sk="did:pkh:",qoe={eip155:"Ethereum",solana:"Solana",bip122:"Bitcoin"},Goe=t=>t?qoe[t]||t:"",Jy=t=>t==null?void 0:t.split(":"),Voe=t=>{const e=t&&Jy(t);if(e)return t.includes(sk)?e[3]:e[1]},Woe=t=>{const e=t&&Jy(t);if(e)return t.includes(sk)?e[2]:e[0]},c6=t=>{const e=t&&Jy(t);if(e)return e[2]+":"+e[3]},kb=t=>{const e=t&&Jy(t);if(e)return e.pop()};async function cC(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=ok(i,i.iss),o=kb(i.iss);return await xoe(o,s,n,c6(i.iss),r)}const ok=(t,e)=>{const r=Woe(e);if(!r)throw new Error("Invalid issuer: "+e);const n=`${t.domain} wants you to sign in with your ${Goe(r)} account:`,i=kb(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=t.statement||void 0;const o=`URI: ${t.aud||t.uri}`,a=`Version: ${t.version}`,c=`Chain ID: ${Voe(e)}`,l=`Nonce: ${t.nonce}`,u=`Issued At: ${t.iat}`,f=t.exp?`Expiration Time: ${t.exp}`:void 0,d=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(w=>` 75- ${w}`).join("")}`:void 0,b=Im(t.resources);if(b){const w=s1(b);s=nae(s,w)}return[n,i,"",s,"",o,a,c,l,u,f,d,h,g].filter(w=>w!=null).join(` 76`)};function Koe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function Xoe(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Lf(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const s=n[i];if(!Array.isArray(s))throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);s.forEach(o=>{if(typeof o!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)})})})}function Zoe(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:Yoe(e,r,n)}}}function Yoe(t,e,r={}){e=e==null?void 0:e.sort((i,s)=>i.localeCompare(s));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function ak(t){return Lf(t),`urn:recap:${Koe(t).replace(/=/g,"")}`}function s1(t){const e=Xoe(t.replace("urn:recap:",""));return Lf(e),e}function Qoe(t,e,r){const n=Zoe(t,e,r);return ak(n)}function eae(t){return t&&t.includes("urn:recap:")}function tae(t,e){const r=s1(t),n=s1(e),i=rae(r,n);return ak(i)}function rae(t,e){Lf(t),Lf(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,s)=>i.localeCompare(s)),n={att:{}};return r.forEach(i=>{var s,o;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((o=e.att)==null?void 0:o[i])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;n.att[i]=Joe(zoe({},n.att[i]),{[a]:((c=t.att[i])==null?void 0:c[a])||((l=e.att[i])==null?void 0:l[a])})})}),n}function nae(t="",e){Lf(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(a=>{const c=Object.keys(e.att[a]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));c.sort((f,d)=>f.action.localeCompare(d.action));const l={};c.forEach(f=>{l[f.ability]||(l[f.ability]=[]),l[f.ability].push(f.action)});const u=Object.keys(l).map(f=>(i++,`(${i}) '${f}': '${l[f].join("', '")}' for '${a}'.`));n.push(u.join(", ").replace(".,","."))});const s=n.join(" "),o=`${r}${s}`;return`${t?t+" ":""}${o}`}function lC(t){var e;const r=s1(t);Lf(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function uC(t){const e=s1(t);Lf(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var s;(s=i==null?void 0:i[0])!=null&&s.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function Im(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return eae(e)?e:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function ck(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function l6(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function Gv(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function os(t,...e){if(!ck(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function fC(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function iae(t,e){os(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Kl(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Nh(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function sae(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const oae=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function aae(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function u6(t){if(typeof t=="string")t=aae(t);else if(ck(t))t=f6(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function cae(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function lae(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}const uae=(t,e)=>{function r(n,...i){if(os(n),!oae)throw new Error("Non little-endian hardware is not yet supported");if(t.nonceLength!==void 0){const l=i[0];if(!l)throw new Error("nonce / iv required");t.varSizeNonce?os(l):os(l,t.nonceLength)}const s=t.tagLength;s&&i[1]!==void 0&&os(i[1]);const o=e(n,...i),a=(l,u)=>{if(u!==void 0){if(l!==2)throw new Error("cipher output not supported");os(u)}};let c=!1;return{encrypt(l,u){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,os(l),a(o.encrypt.length,u),o.encrypt(l,u)},decrypt(l,u){if(os(l),s&&l.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return a(o.decrypt.length,u),o.decrypt(l,u)}}}return Object.assign(r,t),r};function dC(t,e,r=!0){if(e===void 0)return new Uint8Array(t);if(e.length!==t)throw new Error("invalid output length, expected "+t+", got: "+e.length);if(r&&!dae(e))throw new Error("invalid output, must be aligned");return e}function hC(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}function fae(t,e,r){l6(r);const n=new Uint8Array(16),i=sae(n);return hC(i,0,BigInt(e),r),hC(i,8,BigInt(t),r),n}function dae(t){return t.byteOffset%4===0}function f6(t){return Uint8Array.from(t)}const lk=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),hae=lk("expand 16-byte k"),pae=lk("expand 32-byte k"),gae=Kl(hae),mae=Kl(pae);function vr(t,e){return t<<e|t>>>32-e}function d6(t){return t.byteOffset%4===0}const zg=64,bae=16,uk=2**32-1,pC=new Uint32Array;function yae(t,e,r,n,i,s,o,a){const c=i.length,l=new Uint8Array(zg),u=Kl(l),f=d6(i)&&d6(s),d=f?Kl(i):pC,h=f?Kl(s):pC;for(let g=0;g<c;o++){if(t(e,r,n,u,o,a),o>=uk)throw new Error("arx: counter overflow");const b=Math.min(zg,c-g);if(f&&b===zg){const w=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let x=0,k;x<bae;x++)k=w+x,h[k]=d[k]^u[x];g+=zg;continue}for(let w=0,x;w<b;w++)x=g+w,s[x]=i[x]^l[w];g+=b}}function vae(t,e){const{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:s,rounds:o}=cae({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return Gv(i),Gv(o),l6(s),l6(r),(a,c,l,u,f=0)=>{os(a),os(c),os(l);const d=l.length;if(u===void 0&&(u=new Uint8Array(d)),os(u),Gv(f),f<0||f>=uk)throw new Error("arx: counter overflow");if(u.length<d)throw new Error(`arx: output (${u.length}) is shorter than data (${d})`);const h=[];let g=a.length,b,w;if(g===32)h.push(b=f6(a)),w=mae;else if(g===16&&r)b=new Uint8Array(32),b.set(a),b.set(a,16),w=gae,h.push(b);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);d6(c)||h.push(c=f6(c));const x=Kl(b);if(n){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");n(w,x,Kl(c.subarray(0,16)),x),c=c.subarray(16)}const k=16-i;if(k!==c.length)throw new Error(`arx: nonce must be ${k} or 16 bytes`);if(k!==12){const D=new Uint8Array(12);D.set(c,s?0:12-c.length),c=D,h.push(c)}const R=Kl(c);return yae(t,w,x,R,l,u,f,o),Nh(...h),u}}const si=(t,e)=>t[e++]&255|(t[e++]&255)<<8;class wae{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,e=u6(e),os(e,32);const r=si(e,0),n=si(e,2),i=si(e,4),s=si(e,6),o=si(e,8),a=si(e,10),c=si(e,12),l=si(e,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|i<<6)&7939,this.r[3]=(i>>>7|s<<9)&8191,this.r[4]=(s>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=si(e,16+2*u)}process(e,r,n=!1){const i=n?0:2048,{h:s,r:o}=this,a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],d=o[5],h=o[6],g=o[7],b=o[8],w=o[9],x=si(e,r+0),k=si(e,r+2),R=si(e,r+4),D=si(e,r+6),O=si(e,r+8),M=si(e,r+10),F=si(e,r+12),H=si(e,r+14);let U=s[0]+(x&8191),G=s[1]+((x>>>13|k<<3)&8191),N=s[2]+((k>>>10|R<<6)&8191),A=s[3]+((R>>>7|D<<9)&8191),v=s[4]+((D>>>4|O<<12)&8191),p=s[5]+(O>>>1&8191),m=s[6]+((O>>>14|M<<2)&8191),y=s[7]+((M>>>11|F<<5)&8191),T=s[8]+((F>>>8|H<<8)&8191),I=s[9]+(H>>>5|i),_=0,E=_+U*a+G*(5*w)+N*(5*b)+A*(5*g)+v*(5*h);_=E>>>13,E&=8191,E+=p*(5*d)+m*(5*f)+y*(5*u)+T*(5*l)+I*(5*c),_+=E>>>13,E&=8191;let C=_+U*c+G*a+N*(5*w)+A*(5*b)+v*(5*g);_=C>>>13,C&=8191,C+=p*(5*h)+m*(5*d)+y*(5*f)+T*(5*u)+I*(5*l),_+=C>>>13,C&=8191;let S=_+U*l+G*c+N*a+A*(5*w)+v*(5*b);_=S>>>13,S&=8191,S+=p*(5*g)+m*(5*h)+y*(5*d)+T*(5*f)+I*(5*u),_+=S>>>13,S&=8191;let B=_+U*u+G*l+N*c+A*a+v*(5*w);_=B>>>13,B&=8191,B+=p*(5*b)+m*(5*g)+y*(5*h)+T*(5*d)+I*(5*f),_+=B>>>13,B&=8191;let $=_+U*f+G*u+N*l+A*c+v*a;_=$>>>13,$&=8191,$+=p*(5*w)+m*(5*b)+y*(5*g)+T*(5*h)+I*(5*d),_+=$>>>13,$&=8191;let P=_+U*d+G*f+N*u+A*l+v*c;_=P>>>13,P&=8191,P+=p*a+m*(5*w)+y*(5*b)+T*(5*g)+I*(5*h),_+=P>>>13,P&=8191;let q=_+U*h+G*d+N*f+A*u+v*l;_=q>>>13,q&=8191,q+=p*c+m*a+y*(5*w)+T*(5*b)+I*(5*g),_+=q>>>13,q&=8191;let V=_+U*g+G*h+N*d+A*f+v*u;_=V>>>13,V&=8191,V+=p*l+m*c+y*a+T*(5*w)+I*(5*b),_+=V>>>13,V&=8191;let X=_+U*b+G*g+N*h+A*d+v*f;_=X>>>13,X&=8191,X+=p*u+m*l+y*c+T*a+I*(5*w),_+=X>>>13,X&=8191;let Z=_+U*w+G*b+N*g+A*h+v*d;_=Z>>>13,Z&=8191,Z+=p*f+m*u+y*l+T*c+I*a,_+=Z>>>13,Z&=8191,_=(_<<2)+_|0,_=_+E|0,E=_&8191,_=_>>>13,C+=_,s[0]=E,s[1]=C,s[2]=S,s[3]=B,s[4]=$,s[5]=P,s[6]=q,s[7]=V,s[8]=X,s[9]=Z}finalize(){const{h:e,pad:r}=this,n=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let a=2;a<10;a++)e[a]+=i,i=e[a]>>>13,e[a]&=8191;e[0]+=i*5,i=e[0]>>>13,e[0]&=8191,e[1]+=i,i=e[1]>>>13,e[1]&=8191,e[2]+=i,n[0]=e[0]+5,i=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=e[a]+i,i=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(i^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)e[a]=e[a]&s|n[a];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+r[0];e[0]=o&65535;for(let a=1;a<8;a++)o=(e[a]+r[a]|0)+(o>>>16)|0,e[a]=o&65535;Nh(n)}update(e){fC(this),e=u6(e),os(e);const{buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){const o=Math.min(n-this.pos,i-s);if(o===n){for(;n<=i-s;s+=n)this.process(e,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){Nh(this.h,this.r,this.buffer,this.pad)}digestInto(e){fC(this),iae(e,this),this.finished=!0;const{buffer:r,h:n}=this;let{pos:i}=this;if(i){for(r[i++]=1;i<16;i++)r[i]=0;this.process(r,0,!0)}this.finalize();let s=0;for(let o=0;o<8;o++)e[s++]=n[o]>>>0,e[s++]=n[o]>>>8;return e}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}}function Eae(t){const e=(n,i)=>t(i).update(u6(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}const Aae=Eae(t=>new wae(t));function _ae(t,e,r,n,i,s=20){let o=t[0],a=t[1],c=t[2],l=t[3],u=e[0],f=e[1],d=e[2],h=e[3],g=e[4],b=e[5],w=e[6],x=e[7],k=i,R=r[0],D=r[1],O=r[2],M=o,F=a,H=c,U=l,G=u,N=f,A=d,v=h,p=g,m=b,y=w,T=x,I=k,_=R,E=D,C=O;for(let B=0;B<s;B+=2)M=M+G|0,I=vr(I^M,16),p=p+I|0,G=vr(G^p,12),M=M+G|0,I=vr(I^M,8),p=p+I|0,G=vr(G^p,7),F=F+N|0,_=vr(_^F,16),m=m+_|0,N=vr(N^m,12),F=F+N|0,_=vr(_^F,8),m=m+_|0,N=vr(N^m,7),H=H+A|0,E=vr(E^H,16),y=y+E|0,A=vr(A^y,12),H=H+A|0,E=vr(E^H,8),y=y+E|0,A=vr(A^y,7),U=U+v|0,C=vr(C^U,16),T=T+C|0,v=vr(v^T,12),U=U+v|0,C=vr(C^U,8),T=T+C|0,v=vr(v^T,7),M=M+N|0,C=vr(C^M,16),y=y+C|0,N=vr(N^y,12),M=M+N|0,C=vr(C^M,8),y=y+C|0,N=vr(N^y,7),F=F+A|0,I=vr(I^F,16),T=T+I|0,A=vr(A^T,12),F=F+A|0,I=vr(I^F,8),T=T+I|0,A=vr(A^T,7),H=H+v|0,_=vr(_^H,16),p=p+_|0,v=vr(v^p,12),H=H+v|0,_=vr(_^H,8),p=p+_|0,v=vr(v^p,7),U=U+G|0,E=vr(E^U,16),m=m+E|0,G=vr(G^m,12),U=U+G|0,E=vr(E^U,8),m=m+E|0,G=vr(G^m,7);let S=0;n[S++]=o+M|0,n[S++]=a+F|0,n[S++]=c+H|0,n[S++]=l+U|0,n[S++]=u+G|0,n[S++]=f+N|0,n[S++]=d+A|0,n[S++]=h+v|0,n[S++]=g+p|0,n[S++]=b+m|0,n[S++]=w+y|0,n[S++]=x+T|0,n[S++]=k+I|0,n[S++]=R+_|0,n[S++]=D+E|0,n[S++]=O+C|0}const Cae=vae(_ae,{counterRight:!1,counterLength:4,allowShortKeys:!1}),Sae=new Uint8Array(16),gC=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(Sae.subarray(r))},Tae=new Uint8Array(32);function mC(t,e,r,n,i){const s=t(e,r,Tae),o=Aae.create(s);i&&gC(o,i),gC(o,n);const a=fae(n.length,i?i.length:0,!0);o.update(a);const c=o.digest();return Nh(s,a),c}const Nae=t=>(e,r,n)=>({encrypt(i,s){const o=i.length;s=dC(o+16,s,!1),s.set(i);const a=s.subarray(0,-16);t(e,r,a,a,1);const c=mC(t,e,r,a,n);return s.set(c,o),Nh(c),s},decrypt(i,s){s=dC(i.length-16,s,!1);const o=i.subarray(0,-16),a=i.subarray(-16),c=mC(t,e,r,o,n);if(!lae(a,c))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),t(e,r,s,s,1),Nh(c),s}}),fk=uae({blockSize:64,nonceLength:12,tagLength:16},Nae(Cae));let dk=class extends jy{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,Hy(e);const n=zo(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(n.length>i?e.create().update(n).digest():n);for(let o=0;o<s.length;o++)s[o]^=54;this.iHash.update(s),this.oHash=e.create();for(let o=0;o<s.length;o++)s[o]^=106;this.oHash.update(s),oo(s)}update(e){return cu(this),this.iHash.update(e),this}digestInto(e){cu(this),Wo(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:o,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=o,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const qy=(t,e,r)=>new dk(t,e).update(r).digest();qy.create=(t,e)=>new dk(t,e);function Iae(t,e,r){return Hy(t),r===void 0&&(r=new Uint8Array(t.outputLen)),qy(t,zo(r),zo(e))}const Vv=Uint8Array.from([0]),bC=Uint8Array.of();function xae(t,e,r,n=32){Hy(t),Wc(n);const i=t.outputLen;if(n>255*i)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(n/i);r===void 0&&(r=bC);const o=new Uint8Array(s*i),a=qy.create(t,e),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;u<s;u++)Vv[0]=u+1,c.update(u===0?bC:l).update(r).update(Vv).digestInto(l),o.set(l,i*u),a._cloneInto(c);return a.destroy(),c.destroy(),oo(l,Vv),o.slice(0,n)}const Rae=(t,e,r,n,i)=>xae(t,Iae(t,e,r),n,i),Gy=zy,CE=BigInt(0),h6=BigInt(1);function Ob(t,e=""){if(typeof t!="boolean"){const r=e&&`"${e}"`;throw new Error(r+"expected boolean, got type="+typeof t)}return t}function cf(t,e,r=""){const n=Uy(t),i=t==null?void 0:t.length,s=e!==void 0;if(!n||s&&i!==e){const o=r&&`"${r}" `,a=s?` of length ${e}`:"",c=n?`length=${i}`:`type=${typeof t}`;throw new Error(o+"expected Uint8Array"+a+", got "+c)}return t}function Jg(t){const e=t.toString(16);return e.length&1?"0"+e:e}function hk(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?CE:BigInt("0x"+t)}function Vy(t){return hk(Xd(t))}function Mb(t){return Wo(t),hk(Xd(Uint8Array.from(t).reverse()))}function SE(t,e){return Pb(t.toString(16).padStart(e*2,"0"))}function TE(t,e){return SE(t,e).reverse()}function Ti(t,e,r){let n;if(typeof e=="string")try{n=Pb(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(Uy(e))n=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(t+" of length "+r+" expected, got "+i);return n}const Wv=t=>typeof t=="bigint"&&CE<=t;function Pae(t,e,r){return Wv(t)&&Wv(e)&&Wv(r)&&e<=t&&t<r}function p6(t,e,r,n){if(!Pae(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function pk(t){let e;for(e=0;t>CE;t>>=h6,e+=1);return e}const Q1=t=>(h6<<BigInt(t))-h6;function kae(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");const n=d=>new Uint8Array(d),i=d=>Uint8Array.of(d);let s=n(t),o=n(t),a=0;const c=()=>{s.fill(1),o.fill(0),a=0},l=(...d)=>r(o,s,...d),u=(d=n(0))=>{o=l(i(0),d),s=l(),d.length!==0&&(o=l(i(1),d),s=l())},f=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const h=[];for(;d<e;){s=l();const g=s.slice();h.push(g),d+=s.length}return Ml(...h)};return(d,h)=>{c(),u(d);let g;for(;!(g=h(f()));)u();return c(),g}}function Wy(t,e,r={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function n(i,s,o){const a=t[i];if(o&&a===void 0)return;const c=typeof a;if(c!==s||a===null)throw new Error(`param "${i}
76" is invalid: expected ${s}, got ${c}`)}Object.entries(e).forEach(([i,s])=>n(i,s,!1)),Object.entries(r).forEach(([i,s])=>n(i,s,!0))}function yC(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const s=t(r,...n);return e.set(r,s),s}}const ds=BigInt(0),Hi=BigInt(1),lf=BigInt(2),gk=BigInt(3),mk=BigInt(4),bk=BigInt(5),Oae=BigInt(7),yk=BigInt(8),Mae=BigInt(9),vk=BigInt(16);function Is(t,e){const r=t%e;return r>=ds?r:e+r}function Io(t,e,r){let n=t;for(;e-- >ds;)n*=n,n%=r;return n}function vC(t,e){if(t===ds)throw new Error("invert: expected non-zero number");if(e<=ds)throw new Error("invert: expected positive modulus, got "+e);let r=Is(t,e),n=e,i=ds,s=Hi;for(;r!==ds;){const o=n/r,a=n%r,c=i-s*o;n=r,r=a,i=s,s=c}if(n!==Hi)throw new Error("invert: does not exist");return Is(i,e)}function NE(t,e,r){if(!t.eql(t.sqr(e),r))throw new Error("Cannot find square root")}function wk(t,e){const r=(t.ORDER+Hi)/mk,n=t.pow(e,r);return NE(t,n,e),n}function Dae(t,e){const r=(t.ORDER-bk)/yk,n=t.mul(e,lf),i=t.pow(n,r),s=t.mul(e,i),o=t.mul(t.mul(s,lf),i),a=t.mul(s,t.sub(o,t.ONE));return NE(t,a,e),a}function Bae(t){const e=mu(t),r=Ek(t),n=r(e,e.neg(e.ONE)),i=r(e,n),s=r(e,e.neg(n)),o=(t+Oae)/vk;return(a,c)=>{let l=a.pow(c,o),u=a.mul(l,n);const f=a.mul(l,i),d=a.mul(l,s),h=a.eql(a.sqr(u),c),g=a.eql(a.sqr(f),c);l=a.cmov(l,u,h),u=a.cmov(d,f,g);const b=a.eql(a.sqr(u),c),w=a.cmov(l,u,b);return NE(a,w,c),w}}function Ek(t){if(t<gk)throw new Error("sqrt is not defined for small field");let e=t-Hi,r=0;for(;e%lf===ds;)e/=lf,r++;let n=lf;const i=mu(t);for(;wC(i,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return wk;let s=i.pow(n,e);const o=(e+Hi)/lf;return function(a,c){if(a.is0(c))return c;if(wC(a,c)!==1)throw new Error("Cannot find square root");let l=r,u=a.mul(a.ONE,s),f=a.pow(c,e),d=a.pow(c,o);for(;!a.eql(f,a.ONE);){if(a.is0(f))return a.ZERO;let h=1,g=a.sqr(f);for(;!a.eql(g,a.ONE);)if(h++,g=a.sqr(g),h===l)throw new Error("Cannot find square root");const b=Hi<<BigInt(l-h-1),w=a.pow(u,b);l=h,u=a.sqr(w),f=a.mul(f,u),d=a.mul(d,w)}return d}}function Fae(t){return t%mk===gk?wk:t%yk===bk?Dae:t%vk===Mae?Bae(t):Ek(t)}const $ae=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Lae(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=$ae.reduce((n,i)=>(n[i]="function",n),e);return Wy(t,r),t}function Uae(t,e,r){if(r<ds)throw new Error("invalid exponent, negatives unsupported");if(r===ds)return t.ONE;if(r===Hi)return e;let n=t.ONE,i=e;for(;r>ds;)r&Hi&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Hi;return n}function Ak(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((o,a,c)=>t.is0(a)?o:(n[c]=o,t.mul(o,a)),t.ONE),s=t.inv(i);return e.reduceRight((o,a,c)=>t.is0(a)?o:(n[c]=t.mul(o,n[c]),t.mul(o,a)),s),n}function wC(t,e){const r=(t.ORDER-Hi)/lf,n=t.pow(e,r),i=t.eql(n,t.ONE),s=t.eql(n,t.ZERO),o=t.eql(n,t.neg(t.ONE));if(!i&&!s&&!o)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function _k(t,e){e!==void 0&&Wc(e);const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function mu(t,e,r=!1,n={}){if(t<=ds)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,s,o=!1,a;if(typeof e=="object"&&e!=null){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const d=e;d.BITS&&(i=d.BITS),d.sqrt&&(s=d.sqrt),typeof d.isLE=="boolean"&&(r=d.isLE),typeof d.modFromBytes=="boolean"&&(o=d.modFromBytes),a=d.allowedLengths}else typeof e=="number"&&(i=e),n.sqrt&&(s=n.sqrt);const{nBitLength:c,nByteLength:l}=_k(t,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const f=Object.freeze({ORDER:t,isLE:r,BITS:c,BYTES:l,MASK:Q1(c),ZERO:ds,ONE:Hi,allowedLengths:a,create:d=>Is(d,t),isValid:d=>{if(typeof d!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof d);return ds<=d&&d<t},is0:d=>d===ds,isValidNot0:d=>!f.is0(d)&&f.isValid(d),isOdd:d=>(d&Hi)===Hi,neg:d=>Is(-d,t),eql:(d,h)=>d===h,sqr:d=>Is(d*d,t),add:(d,h)=>Is(d+h,t),sub:(d,h)=>Is(d-h,t),mul:(d,h)=>Is(d*h,t),pow:(d,h)=>Uae(f,d,h),div:(d,h)=>Is(d*vC(h,t),t),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>vC(d,t),sqrt:s||(d=>(u||(u=Fae(t)),u(f,d))),toBytes:d=>r?TE(d,l):SE(d,l),fromBytes:(d,h=!0)=>
vendor: 30,810 bytes, line 76
76{if(a){if(!a.includes(d.length)||d.length>l)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+d.length);const b=new Uint8Array(l);b.set(d,r?0:b.length-d.length),d=b}if(d.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+d.length);let g=r?Mb(d):Vy(d);if(o&&(g=Is(g,t)),!h&&!f.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g},invertBatch:d=>Ak(f,d),cmov:(d,h,g)=>g?h:d});return Object.freeze(f)}function Ck(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function Sk(t){const e=Ck(t);return e+Math.ceil(e/2)}function Hae(t,e,r=!1){const n=t.length,i=Ck(e),s=Sk(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const o=r?Mb(t):Vy(t),a=Is(o,e-Hi)+Hi;return r?TE(a,i):SE(a,i)}const Ih=BigInt(0),uf=BigInt(1);function Db(t,e){const r=e.negate();return t?r:e}function Kv(t,e){const r=Ak(t.Fp,e.map(n=>n.Z));return e.map((n,i)=>t.fromAffine(n.toAffine(r[i])))}function Tk(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function Xv(t,e){Tk(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t,s=Q1(t),o=BigInt(t);return{windows:r,windowSize:n,mask:s,maxNumber:i,shiftBy:o}}function EC(t,e,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:o}=r;let a=Number(t&i),c=t>>o;a>n&&(a-=s,c+=uf);const l=e*n,u=l+Math.abs(a)-1,f=a===0,d=a<0,h=e%2!==0;return{nextN:c,offset:u,isZero:f,isNeg:d,isNegF:h,offsetF:l}}function jae(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function zae(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const Zv=new WeakMap,Nk=new WeakMap;function Yv(t){return Nk.get(t)||1}function AC(t){if(t!==Ih)throw new Error("invalid wNAF")}class Jae{constructor(e,r){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=r}_unsafeLadder(e,r,n=this.ZERO){let i=e;for(;r>Ih;)r&uf&&(n=n.add(i)),i=i.double(),r>>=uf;return n}precomputeWindow(e,r){const{windows:n,windowSize:i}=Xv(r,this.bits),s=[];let o=e,a=o;for(let c=0;c<n;c++){a=o,s.push(a);for(let l=1;l<i;l++)a=a.add(o),s.push(a);o=a.double()}return s}wNAF(e,r,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let i=this.ZERO,s=this.BASE;const o=Xv(e,this.bits);for(let a=0;a<o.windows;a++){const{nextN:c,offset:l,isZero:u,isNeg:f,isNegF:d,offsetF:h}=EC(n,a,o);n=c,u?s=s.add(Db(d,r[h])):i=i.add(Db(f,r[l]))}return AC(n),{p:i,f:s}}wNAFUnsafe(e,r,n,i=this.ZERO){const s=Xv(e,this.bits);for(let o=0;o<s.windows&&n!==Ih;o++){const{nextN:a,offset:c,isZero:l,isNeg:u}=EC(n,o,s);if(n=a,!l){const f=r[c];i=i.add(u?f.negate():f)}}return AC(n),i}getPrecomputes(e,r,n){let i=Zv.get(r);return i||(i=this.precomputeWindow(r,e),e!==1&&(typeof n=="function"&&(i=n(i)),Zv.set(r,i))),i}cached(e,r,n){const i=Yv(e);return this.wNAF(i,this.getPrecomputes(i,e,n),r)}unsafe(e,r,n,i){const s=Yv(e);return s===1?this._unsafeLadder(e,r,i):this.wNAFUnsafe(s,this.getPrecomputes(s,e,n),r,i)}createCache(e,r){Tk(r,this.bits),Nk.set(e,r),Zv.delete(e)}hasCache(e){return Yv(e)!==1}}function qae(t,e,r,n){let i=e,s=t.ZERO,o=t.ZERO;for(;r>Ih||n>Ih;)r&uf&&(s=s.add(i)),n&uf&&(o=o.add(i)),i=i.double(),r>>=uf,n>>=uf;return{p1:s,p2:o}}function Gae(t,e,r,n){jae(r,t),zae(n,e);const i=r.length,s=n.length;if(i!==s)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,a=pk(BigInt(i));let c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);const l=Q1(c),u=new Array(Number(l)+1).fill(o),f=Math.floor((e.BITS-1)/c)*c;let d=o;for(let h=f;h>=0;h-=c){u.fill(o);for(let b=0;b<s;b++){const w=n[b],x=Number(w>>BigInt(h)&l);u[x]=u[x].add(r[b])}let g=o;for(let b=u.length-1,w=o;b>0;b--)w=w.add(u[b]),g=g.add(w);if(d=d.add(g),h!==0)for(let b=0;b<c;b++)d=d.double()}return d}function _C(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return Lae(e),e}else return mu(t,{isLE:r})}function Vae(t,e,r={},n){if(n===void 0&&(n=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const a of["p","n","h"]){const c=e[a];if(!(typeof c=="bigint"&&c>Ih))throw new Error(`CURVE.${a} must be positive bigint`)}const i=_C(e.p,r.Fp,n),s=_C(e.n,r.Fn,n),o=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(const a of o)if(!i.isValid(e[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:s}}BigInt(0),BigInt(1),BigInt(2),BigInt(8),XP("HashToScalar-");const b0=BigInt(0),md=BigInt(1),qg=BigInt(2);function Wae(t){return Wy(t,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...t})}function Kae(t){const e=Wae(t),{P:r,type:n,adjustScalarBytes:i,powPminus2:s,randomBytes:o}=e,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");const c=o||Yf,l=a?255:448,u=a?32:56,f=BigInt(a?9:5),d=BigInt(a?121665:39081),h=a?qg**BigInt(254):qg**BigInt(447),g=a?BigInt(8)*qg**BigInt(251)-md:BigInt(4)*qg**BigInt(445)-md,b=h+g+md,w=A=>Is(A,r),x=k(f);function k(A){return TE(w(A),u)}function R(A){const v=Ti("u coordinate",A,u);return a&&(v[31]&=127),w(Mb(v))}function D(A){return Mb(i(Ti("scalar",A,u)))}function O(A,v){const p=H(R(v),D(A));if(p===b0)throw new Error("invalid private or public key received");return k(p)}function M(A){return O(A,x)}function F(A,v,p){const m=w(A*(v-p));return v=w(v-m),p=w(p+m),{x_2:v,x_3:p}}function H(A,v){p6("u",A,b0,r),p6("scalar",v,h,b);const p=v,m=A;let y=md,T=b0,I=A,_=md,E=b0;for(let S=BigInt(l-1);S>=b0;S--){const B=p>>S&md;E^=B,{x_2:y,x_3:I}=F(E,y,I),{x_2:T,x_3:_}=F(E,T,_),E=B;const $=y+T,P=w($*$),q=y-T,V=w(q*q),X=P-V,Z=I+_,ie=I-_,ce=w(ie*$),se=w(Z*q),_e=ce+se,ye=ce-se;I=w(_e*_e),_=w(m*w(ye*ye)),y=w(P*V),T=w(X*(P+w(d*X)))}({x_2:y,x_3:I}=F(E,y,I)),{x_2:T,x_3:_}=F(E,T,_);const C=s(T);return w(y*C)}const U={secretKey:u,publicKey:u,seed:u},G=(A=c(u))=>(Wo(A,U.seed),A);function N(A){const v=G(A);return{secretKey:v,publicKey:M(v)}}return{keygen:N,getSharedSecret:(A,v)=>O(A,v),getPublicKey:A=>M(A),scalarMult:O,scalarMultBase:M,utils:{randomSecretKey:G,randomPrivateKey:G},GuBytes:x.slice(),lengths:U}}const Xae=BigInt(1),CC=BigInt(2),Zae=BigInt(3),Yae=BigInt(5),Qae=BigInt(8),Ik=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),ece={p:Ik,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:Qae,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function tce(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=Ik,o=t*t%s*t%s,a=Io(o,CC,s)*o%s,c=Io(a,Xae,s)*t%s,l=Io(c,Yae,s)*c%s,u=Io(l,e,s)*l%s,f=Io(u,r,s)*u%s,d=Io(f,n,s)*f%s,h=Io(d,i,s)*d%s,g=Io(h,i,s)*d%s,b=Io(g,e,s)*l%s;return{pow_p_5_8:Io(b,CC,s)*t%s,b2:o}}function rce(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const nce=mu(ece.p,{isLE:!0}),g6=(()=>{const t=nce.ORDER;return Kae({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:r,b2:n}=tce(e);return Is(Io(r,Zae,t)*n,t)},adjustScalarBytes:rce})})(),SC=(t,e)=>(t+(t>=0?e:-e)/xk)/e;function ice(t,e,r){const[[n,i],[s,o]]=e,a=SC(o*t,r),c=SC(-i*t,r);let l=t-a*n-c*s,u=-a*i-c*o;const f=l<Oc,d=u<Oc;f&&(l=-l),d&&(u=-u);const h=Q1(Math.ceil(pk(r)/2))+Zd;if(l<Oc||l>=h||u<Oc||u>=h)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:f,k1:l,k2neg:d,k2:u}}function m6(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function Qv(t,e){const r={};for(let n of Object.keys(e))r[n]=t[n]===void 0?e[n]:t[n];return Ob(r.lowS,"lowS"),Ob(r.prehash,"prehash"),r.format!==void 0&&m6(r.format),r}class sce extends Error{constructor(e=""){super(e)}}const Ic={Err:sce,_tlv:{encode:(t,e)=>{const{Err:r}=Ic;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=Jg(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?Jg(i.length/2|128):"";return Jg(t)+s+i+e},decode(t,e){const{Err:r}=Ic;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],s=!!(i&128);let o=0;if(!s)o=i;else{const c=i&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");const l=e.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const u of l)o=o<<8|u;if(n+=c,o<128)throw new r("tlv.decode(long): not minimal encoding")}const a=e.subarray(n,n+o);if(a.length!==o)throw new r("tlv.decode: wrong value length");return{v:a,l:e.subarray(n+o)}}},_int:{encode(t){const{Err:e}=Ic;if(t<Oc)throw new e("integer: negative integers are not allowed");let r=Jg(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=Ic;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return Vy(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=Ic,i=Ti("signature",t),{v:s,l:o}=n.decode(48,i);if(o.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){const{_tlv:e,_int:r}=Ic,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),s=n+i;return e.encode(48,s)}},Oc=BigInt(0),Zd=BigInt(1),xk=BigInt(2),Gg=BigInt(3),oce=BigInt(4);function Od(t,e){const{BYTES:r}=t;let n;if(typeof e=="bigint")n=e;else{let i=Ti("private key",e);try{n=t.fromBytes(i)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof e}`)}}if(!t.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function ace(t,e={}){const r=Vae("weierstrass",t,e),{Fp:n,Fn:i}=r;let s=r.CURVE;const{h:o,n:a}=s;Wy(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=e;if(c&&(!n.is0(s.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=Pk(n,i);function u(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function f(A,v,p){const{x:m,y}=v.toAffine(),T=n.toBytes(m);if(Ob(p,"isCompressed"),p){u();const I=!n.isOdd(y);return Ml(Rk(I),T)}else return Ml(Uint8Array.of(4),T,n.toBytes(y))}function d(A){cf(A,void 0,"Point");const{publicKey:v,publicKeyUncompressed:p}=l,m=A.length,y=A[0],T=A.subarray(1);if(m===v&&(y===2||y===3)){const I=n.fromBytes(T);if(!n.isValid(I))throw new Error("bad point: is not on curve, wrong x");const _=b(I);let E;try{E=n.sqrt(_)}catch(S){const B=S instanceof Error?": "+S.message:"";throw new Error("bad point: is not on curve, sqrt error"+B)}u();const C=n.isOdd(E);return(y&1)===1!==C&&(E=n.neg(E)),{x:I,y:E}}else if(m===p&&y===4){const I=n.BYTES,_=n.fromBytes(T.subarray(0,I)),E=n.fromBytes(T.subarray(I,I*2));if(!w(_,E))throw new Error("bad point: is not on curve");return{x:_,y:E}}else throw new Error(`bad point: got length ${m}, expected compressed=${v} or uncompressed=${p}`)}const h=e.toBytes||f,g=e.fromBytes||d;function b(A){const v=n.sqr(A),p=n.mul(v,A);return n.add(n.add(p,n.mul(A,s.a)),s.b)}function w(A,v){const p=n.sqr(v),m=b(A);return n.eql(p,m)}if(!w(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const x=n.mul(n.pow(s.a,Gg),oce),k=n.mul(n.sqr(s.b),BigInt(27));if(n.is0(n.add(x,k)))throw new Error("bad curve params: a or b");function R(A,v,p=!1){if(!n.isValid(v)||p&&n.is0(v))throw new Error(`bad point coordinate ${A}`);return v}function D(A){if(!(A instanceof U))throw new Error("ProjectivePoint expected")}function O(A){if(!c||!c.basises)throw new Error("no endo");return ice(A,c.basises,i.ORDER)}const M=yC((A,v)=>{const{X:p,Y:m,Z:y}=A;if(n.eql(y,n.ONE))return{x:p,y:m};const T=A.is0();v==null&&(v=T?n.ONE:n.inv(y));const I=n.mul(p,v),_=n.mul(m,v),E=n.mul(y,v);if(T)return{x:n.ZERO,y:n.ZERO};if(!n.eql(E,n.ONE))throw new Error("invZ was invalid");return{x:I,y:_}}),F=yC(A=>{if(A.is0()){if(e.allowInfinityPoint&&!n.is0(A.Y))return;throw new Error("bad point: ZERO")}const{x:v,y:p}=A.toAffine();if(!n.isValid(v)||!n.isValid(p))throw new Error("bad point: x or y not field elements");if(!w(v,p))throw new Error("bad point: equation left != right");if(!A.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function H(A,v,p,m,y){return p=new U(n.mul(p.X,A),p.Y,p.Z),v=Db(m,v),p=Db(y,p),v.add(p)}class U{constructor(v,p,m){this.X=R("x",v),this.Y=R("y",p,!0),this.Z=R("z",m),Object.freeze(this)}static CURVE(){return s}static fromAffine(v){const{x:p,y:m}=v||{};if(!v||!n.isValid(p)||!n.isValid(m))throw new Error("invalid affine point");if(v instanceof U)throw new Error("projective point not allowed");return n.is0(p)&&n.is0(m)?U.ZERO:new U(p,m,n.ONE)}static fromBytes(v){const p=U.fromAffine(g(cf(v,void 0,"point")));return p.assertValidity(),p}static fromHex(v){return U.fromBytes(Ti("pointHex",v))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(v=8,p=!0){return N.createCache(this,v),p||this.multiply(Gg),this}assertValidity(){F(this)}hasEvenY(){const{y:v}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(v)}equals(v){D(v);const{X:p,Y:m,Z:y}=this,{X:T,Y:I,Z:_}=v,E=n.eql(n.mul(p,_),n.mul(T,y)),C=n.eql(n.mul(m,_),n.mul(I,y));return E&&C}negate(){return new U(this.X,n.neg(this.Y),this.Z)}double(){const{a:v,b:p}=s,m=n.mul(p,Gg),{X:y,Y:T,Z:I}=this;let _=n.ZERO,E=n.ZERO,C=n.ZERO,S=n.mul(y,y),B=n.mul(T,T),$=n.mul(I,I),P=n.mul(y,T);return P=n.add(P,P),C=n.mul(y,I),C=n.add(C,C),_=n.mul(v,C),E=n.mul(m,$),E=n.add(_,E),_=n.sub(B,E),E=n.add(B,E),E=n.mul(_,E),_=n.mul(P,_),C=n.mul(m,C),$=n.mul(v,$),P=n.sub(S,$),P=n.mul(v,P),P=n.add(P,C),C=n.add(S,S),S=n.add(C,S),S=n.add(S,$),S=n.mul(S,P),E=n.add(E,S),$=n.mul(T,I),$=n.add($,$),S=n.mul($,P),_=n.sub(_,S),C=n.mul($,B),C=n.add(C,C),C=n.add(C,C),new U(_,E,C)}add(v){D(v);const{X:p,Y:m,Z:y}=this,{X:T,Y:I,Z:_}=v;let E=n.ZERO,C=n.ZERO,S=n.ZERO;const B=s.a,$=n.mul(s.b,Gg);let P=n.mul(p,T),q=n.mul(m,I),V=n.mul(y,_),X=n.add(p,m),Z=n.add(T,I);X=n.mul(X,Z),Z=n.add(P,q),X=n.sub(X,Z),Z=n.add(p,y);let ie=n.add(T,_);return Z=n.mul(Z,ie),ie=n.add(P,V),Z=n.sub(Z,ie),ie=n.add(m,y),E=n.add(I,_),ie=n.mul(ie,E),E=n.add(q,V),ie=n.sub(ie,E),S=n.mul(B,Z),E=n.mul($,V),S=n.add(E,S),E=n.sub(q,S),S=n.add(q,S),C=n.mul(E,S),q=n.add(P,P),q=n.add(q,P),V=n.mul(B,V),Z=n.mul($,Z),q=n.add(q,V),V=n.sub(P,V),V=n.mul(B,V),Z=n.add(Z,V),P=n.mul(q,Z),C=n.add(C,P),P=n.mul(ie,Z),E=n.mul(X,E),E=n.sub(E,P),P=n.mul(X,q),S=n.mul(ie,S),S=n.add(S,P),new U(E,C,S)}subtract(v){return this.add(v.negate())}is0(){return this.equals(U.ZERO)}multiply(v){const{endo:p}=e;if(!i.isValidNot0(v))throw new Error("invalid scalar: out of range");let m,y;const T=I=>N.cached(this,I,_=>Kv(U,_));if(p){const{k1neg:I,k1:_,k2neg:E,k2:C}=O(v),{p:S,f:B}=T(_),{p:$,f:P}=T(C);y=B.add(P),m=H(p.beta,S,$,I,E)}else{const{p:I,f:_}=T(v);m=I,y=_}return Kv(U,[m,y])[0]}multiplyUnsafe(v){const{endo:p}=e,m=this;if(!i.isValid(v))throw new Error("invalid scalar: out of range");if(v===Oc||m.is0())return U.ZERO;if(v===Zd)return m;if(N.hasCache(this))return this.multiply(v);if(p){const{k1neg:y,k1:T,k2neg:I,k2:_}=O(v),{p1:E,p2:C}=qae(U,m,T,_);return H(p.beta,E,C,y,I)}else return N.unsafe(m,v)}multiplyAndAddUnsafe(v,p,m){const y=this.multiplyUnsafe(p).add(v.multiplyUnsafe(m));return y.is0()?void 0:y}toAffine(v){return M(this,v)}isTorsionFree(){const{isTorsionFree:v}=e;return o===Zd?!0:v?v(U,this):N.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:v}=e;return o===Zd?this:v?v(U,this):this.multiplyUnsafe(o)}isSmallOrder(){return this.multiplyUnsafe(o).is0()}toBytes(v=!0){return Ob(v,"isCompressed"),this.assertValidity(),h(U,this,v)}toHex(v=!0){return Xd(this.toBytes(v))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(v=!0){return this.toBytes(v)}_setWindowSize(v){this.precompute(v)}static normalizeZ(v){return Kv(U,v)}static msm(v,p){return Gae(U,i,v,p)}static fromPrivateKey(v){return U.BASE.multiply(Od(i,v))}}U.BASE=new U(s.Gx,s.Gy,n.ONE),U.ZERO=new U(n.ZERO,n.ONE,n.ZERO),U.Fp=n,U.Fn=i;const G=i.BITS,N=new Jae(U,e.endo?Math.ceil(G/2):G);return U.BASE.precompute(8),U}function Rk(t){return Uint8Array.of(t?2:3)}function Pk(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function cce(t,e={}){const{Fn:r}=t,n=e.randomBytes||Yf,i=Object.assign(Pk(t.Fp,r),{seed:Sk(r.ORDER)});function s(d){try{return!!Od(r,d)}catch{return!1}}function o(d,h){const{publicKey:g,publicKeyUncompressed:b}=i;try{const w=d.length;return h===!0&&w!==g||h===!1&&w!==b?!1:!!t.fromBytes(d)}catch{return!1}}function a(d=n(i.seed)){return Hae(cf(d,i.seed,"seed"),r.ORDER)}function c(d,h=!0){return t.BASE.multiply(Od(r,d)).toBytes(h)}function l(d){const h=a(d);return{secretKey:h,publicKey:c(h)}}function u(d){if(typeof d=="bigint")return!1;if(d instanceof t)return!0;const{secretKey:h,publicKey:g,publicKeyUncompressed:b}=i;if(r.allowedLengths||h===g)return;const w=Ti("key",d).length;return w===g||w===b}function f(d,h,g=!0){if(u(d)===!0)throw new Error("first arg must be private key");if(u(h)===!1)throw new Error("second arg must be public key");const b=Od(r,d);return t.fromHex(h).multiply(b).toBytes(g)}return Object.freeze({getPublicKey:c,getSharedSecret:f,keygen:l,Point:t,utils:{isValidSecretKey:s,isValidPublicKey:o,randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:d=>Od(r,d),precompute(d=8,h=t.BASE){return h.precompute(d,!1)}},lengths:i})}function lce(t,e,r={}){Hy(e),Wy(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||Yf,i=r.hmac||((p,...m)=>qy(e,p,Ml(...m))),{Fp:s,Fn:o}=t,{ORDER:a,BITS:c}=o,{keygen:l,getPublicKey:u,getSharedSecret:f,utils:d,lengths:h}=cce(t,r),g={prehash:!1,lowS:typeof r.lowS=="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},b="compact";function w(p){const m=a>>Zd;return p>m}function x(p,m){if(!o.isValidNot0(m))throw new Error(`invalid signature ${p}: out of range 1..Point.Fn.ORDER`);return m}function k(p,m){m6(m);const y=h.signature,T=m==="compact"?y:m==="recovered"?y+1:void 0;return cf(p,T,`${m} signature`)}class R{constructor(m,y,T){this.r=x("r",m),this.s=x("s",y),T!=null&&(this.recovery=T),Object.freeze(this)}static fromBytes(m,y=b){k(m,y);let T;if(y==="der"){const{r:C,s:S}=Ic.toSig(cf(m));return new R(C,S)}y==="recovered"&&(T=m[0],y="compact",m=m.subarray(1));const I=o.BYTES,_=m.subarray(0,I),E=m.subarray(I,I*2);return new R(o.fromBytes(_),o.fromBytes(E),T)}static fromHex(m,y){return this.fromBytes(Pb(m),y)}addRecoveryBit(m){return new R(this.r,this.s,m)}recoverPublicKey(m){const y=s.ORDER,{r:T,s:I,recovery:_}=this;if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");if(a*xk<y&&_>1)throw new Error("recovery id is ambiguous for h>1 curve");const E=_===2||_===3?T+a:T;if(!s.isValid(E))throw new Error("recovery id 2 or 3 invalid");const C=s.toBytes(E),S=t.fromBytes(Ml(Rk((_&1)===0),C)),B=o.inv(E),$=O(Ti("msgHash",m)),P=o.create(-$*B),q=o.create(I*B),V=t.BASE.multiplyUnsafe(P).add(S.multiplyUnsafe(q));if(V.is0())throw new Error("point at infinify");return V.assertValidity(),V}hasHighS(){return w(this.s)}toBytes(m=b){if(m6(m),m==="der")return Pb(Ic.hexFromSig(this));const y=o.toBytes(this.r),T=o.toBytes(this.s);if(m==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return Ml(Uint8Array.of(this.recovery),y,T)}return Ml(y,T)}toHex(m){return Xd(this.toBytes(m))}assertValidity(){}static fromCompact(m){return R.fromBytes(Ti("sig",m),"compact")}static fromDER(m){return R.fromBytes(Ti("sig",m),"der")}normalizeS(){return this.hasHighS()?new R(this.r,o.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Xd(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Xd(this.toBytes("compact"))}}const D=r.bits2int||function(p){if(p.length>8192)throw new Error("input is too large");const m=Vy(p),y=p.length*8-c;return y>0?m>>BigInt(y):m},O=r.bits2int_modN||function(p){return o.create(D(p))},M=Q1(c);function F(p){return p6("num < 2^"+c,p,Oc,M),o.toBytes(p)}function H(p,m){return cf(p,void 0,"message"),m?cf(e(p),void 0,"prehashed message"):p}function U(p,m,y){if(["recovered","canonical"].some(q=>q in y))throw new Error("sign() legacy options not supported");const{lowS:T,prehash:I,extraEntropy:_}=Qv(y,g);p=H(p,I);const E=O(p),C=Od(o,m),S=[F(C),F(E)];if(_!=null&&_!==!1){const q=_===!0?n(h.secretKey):_;S.push(Ti("extraEntropy",q))}const B=Ml(...S),$=E;function P(q){const V=D(q);if(!o.isValidNot0(V))return;const X=o.inv(V),Z=t.BASE.multiply(V).toAffine(),ie=o.create(Z.x);if(ie===Oc)return;const ce=o.create(X*o.create($+ie*C));if(ce===Oc)return;let se=(Z.x===ie?0:2)|Number(Z.y&Zd),_e=ce;return T&&w(ce)&&(_e=o.neg(ce),se^=1),new R(ie,_e,se)}return{seed:B,k2sig:P}}function G(p,m,y={}){p=Ti("message",p);const{seed:T,k2sig:I}=U(p,m,y);return kae(e.outputLen,o.BYTES,i)(T,I)}function N(p){let m;const y=typeof p=="string"||Uy(p),T=!y&&p!==null&&typeof p=="object"&&typeof p.r=="bigint"&&typeof p.s=="bigint";if(!y&&!T)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(T)m=new R(p.r,p.s);else if(y){try{m=R.fromBytes(Ti("sig",p),"der")}catch(I){if(!(I instanceof Ic.Err))throw I}if(!m)try{m=R.fromBytes(Ti("sig",p),"compact")}catch{return!1}}return m||!1}function A(p,m,y,T={}){const{lowS:I,prehash:_,format:E}=Qv(T,g);if(y=Ti("publicKey",y),m=H(Ti("message",m),_),"strict"in T)throw new Error("options.strict was renamed to lowS");const C=E===void 0?N(p):R.fromBytes(Ti("sig",p),E);if(C===!1)return!1;try{const S=t.fromBytes(y);if(I&&C.hasHighS())return!1;const{r:B,s:$}=C,P=O(m),q=o.inv($),V=o.create(P*q),X=o.create(B*q),Z=t.BASE.multiplyUnsafe(V).add(S.multiplyUnsafe(X));return Z.is0()?!1:o.create(Z.x)===B}catch{return!1}}function v(p,m,y={}){const{prehash:T}=Qv(y,g);return m=H(m,T),R.fromBytes(p,"recovered").recoverPublicKey(m).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:f,utils:d,lengths:h,Point:t,sign:G,verify:A,recoverPublicKey:v,Signature:R,hash:e})}function uce(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r=t.Fp;let n=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(o=>Math.ceil(o/2)))):void 0;const i=mu(e.n,{BITS:t.nBitLength,allowedLengths:n,modFromBytes:t.wrapPrivateKey}),s={Fp:r,Fn:i,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:s}}function fce(t){const{CURVE:e,curveOpts:r}=uce(t),n={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:r,hash:t.hash,ecdsaOpts:n}}function dce(t,e){const r=e.Point;return Object.assign({},e,{ProjectivePoint:r,CURVE:Object.assign({},t,_k(r.Fn.ORDER,r.Fn.BITS))})}function hce(t){const{CURVE:e,curveOpts:r,hash:n,ecdsaOpts:i}=fce(t),s=ace(e,r),o=lce(s,n,i);return dce(t,o)}function b6(t,e){const r=n=>hce({...t,hash:n});return{...r(e),create:r}}const kk={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},Ok={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},Mk={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},pce=mu(kk.p),gce=mu(Ok.p),mce=mu(Mk.p),bce=b6({...kk,Fp:pce,lowS:!1},zy);b6({...Ok,Fp:gce,lowS:!1},Eoe),b6({...Mk,Fp:mce,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},woe);const yce=bce,Dk="base10",ji="base16",as="base64pad",Dl="base64url",eg="utf8",Bk=0,$c=1,tg=2,vce=0,TC=1,X0=12,IE=32;function wce(){const t=g6.utils.randomPrivateKey(),e=g6.getPublicKey(t);return{privateKey:ps(t,ji),publicKey:ps(e,ji)}}function y6(){const t=Yf(IE);return ps(t,ji)}function Ece(t,e){const r=g6.getSharedSecret(no(t,ji),no(e,ji)),n=Rae(Gy,r,void 0,void 0,IE);return ps(n,ji)}function xm(t){const e=Gy(no(t,ji));return ps(e,ji)}function eo(t){const e=Gy(no(t,eg));return ps(e,ji)}function Fk(t){return no(`${t}`,Dk)}function Uf(t){return Number(ps(t,Dk))}function $k(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Lk(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),r=(4-e.length%4)%4;return e+"=".repeat(r)}function Ace(t){const e=Fk(typeof t.type<"u"?t.type:Bk);if(Uf(e)===$c&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?no(t.senderPublicKey,ji):void 0,n=typeof t.iv<"u"?no(t.iv,ji):Yf(X0),i=no(t.symKey,ji),s=fk(i,n).encrypt(no(t.message,eg)),o=Uk({type:e,sealed:s,iv:n,senderPublicKey:r});return t.encoding===Dl?$k(o):o}function _ce(t){const e=no(t.symKey,ji),{sealed:r,iv:n}=o1({encoded:t.encoded,encoding:t.encoding}),i=fk(e,n).decrypt(r);if(i===null)throw new Error("Failed to decrypt");return ps(i,eg)}function Cce(t,e){const r=Fk(tg),n=Yf(X0),i=no(t,eg),s=Uk({type:r,sealed:i,iv:n});return e===Dl?$k(s):s}function Sce(t,e){const{sealed:r}=o1({encoded:t,encoding:e});return ps(r,eg)}function Uk(t){if(Uf(t.type)===tg)return ps(K0([t.type,t.sealed]),as);if(Uf(t.type)===$c){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ps(K0([t.type,t.senderPublicKey,t.iv,t.sealed]),as)}return ps(K0([t.type,t.iv,t.sealed]),as)}function o1(t){const e=(t.encoding||as)===Dl?Lk(t.encoded):t.encoded,r=no(e,as),n=r.slice(vce,TC),i=TC;if(Uf(n)===$c){const c=i+IE,l=c+X0,u=r.slice(i,c),f=r.slice(c,l),d=r.slice(l);return{type:n,sealed:d,iv:f,senderPublicKey:u}}if(Uf(n)===tg){const c=r.slice(i),l=Yf(X0);return{type:n,sealed:c,iv:l}}const s=i+X0,o=r.slice(i,s),a=r.slice(s);return{type:n,sealed:a,iv:o}}function Tce(t,e){const r=o1({encoded:t,encoding:e==null?void 0:e.encoding});return Hk({type:Uf(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ps(r.senderPublicKey,ji):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Hk(t){const e=(t==null?void 0:t.type)||Bk;if(e===$c){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function NC(t){return t.type===$c&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function IC(t){return t.type===tg}function Nce(t){const e=Buffer.from(t.x,"base64"),r=Buffer.from(t.y,"base64");return K0([new Uint8Array([4]),e,r])}function Ice(t,e){const[r,n,i]=t.split("."),s=Buffer.from(Lk(i),"base64");if(s.length!==64)throw new Error("Invalid signature length");const o=s.slice(0,32),a=s.slice(32,64),c=`${r}.${n}`,l=Gy(c),u=Nce(e);if(!yce.verify(K0([o,a]),l,u))throw new Error("Invalid signature");return X3(t).payload}const xce="irn";function Bb(t){return(t==null?void 0:t.relay)||{protocol:xce}}function Md(t){const e=Qie[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Rce=Object.defineProperty,Pce=Object.defineProperties,kce=Object.getOwnPropertyDescriptors,xC=Object.getOwnPropertySymbols,Oce=Object.prototype.hasOwnProperty,Mce=Object.prototype.propertyIsEnumerable,RC=(t,e,r)=>e in t?Rce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ew=(t,e)=>{for(var r in e||(e={}))Oce.call(e,r)&&RC(t,r,e[r]);if(xC)for(var r of xC(e))Mce.call(e,r)&&RC(t,r,e[r]);return t},Dce=(t,e)=>Pce(t,kce(e));function Bce(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function PC(t){if(!t.includes("wc:")){const l=JP(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=new URLSearchParams(s),a=Object.fromEntries(o.entries()),c=typeof a.methods=="str
76ing"?a.methods.split(","):void 0;return{protocol:n,topic:Fce(i[0]),version:parseInt(i[1],10),symKey:a.symKey,relay:Bce(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function Fce(t){return t.startsWith("//")?t.substring(2):t}function $ce(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=i,o=r+e+s;t[s]&&(n[o]=t[s])}),n}function kC(t){const e=new URLSearchParams,r=ew(ew(Dce(ew({},$ce(t.relay)),{symKey:t.symKey}),t.expiryTimestamp&&{expiryTimestamp:t.expiryTimestamp.toString()}),t.methods&&{methods:t.methods.join(",")});return Object.entries(r).sort(([n],[i])=>n.localeCompare(i)).forEach(([n,i])=>{i!==void 0&&e.append(n,String(i))}),`${t.protocol}:${t.topic}@${t.version}?${e}`}function Vg(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}var Lce=Object.defineProperty,Uce=Object.defineProperties,Hce=Object.getOwnPropertyDescriptors,OC=Object.getOwnPropertySymbols,jce=Object.prototype.hasOwnProperty,zce=Object.prototype.propertyIsEnumerable,MC=(t,e,r)=>e in t?Lce(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Jce=(t,e)=>{for(var r in e||(e={}))jce.call(e,r)&&MC(t,r,e[r]);if(OC)for(var r of OC(e))zce.call(e,r)&&MC(t,r,e[r]);return t},qce=(t,e)=>Uce(t,Hce(e));function Wh(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function jk(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Wh(r.accounts))}),[...new Set(e)]}function Gce(t){const e=[];return Object.values(t).forEach(r=>{e.push(...r.methods)}),[...new Set(e)]}function Vce(t){const e=[];return Object.values(t).forEach(r=>{e.push(...r.events)}),[...new Set(e)]}function Wce(t,e){const r=[];return Object.values(t).forEach(n=>{Wh(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Kce(t,e){const r=[];return Object.values(t).forEach(n=>{Wh(n.accounts).includes(e)&&r.push(...n.events)}),r}function Ky(t){return t.includes(":")}function Dd(t){return Ky(t)?t.split(":")[0]:t}function DC(t){var e,r,n;const i={};if(!Da(t))return i;for(const[s,o]of Object.entries(t)){const a=Ky(s)?[s]:o.chains,c=o.methods||[],l=o.events||[],u=Dd(s);i[u]=qce(Jce({},i[u]),{chains:Ma(a,(e=i[u])==null?void 0:e.chains),methods:Ma(c,(r=i[u])==null?void 0:r.methods),events:Ma(l,(n=i[u])==null?void 0:n.events)})}return i}function Xce(t){const e={};return t==null||t.forEach(r=>{var n;const[i,s]=r.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[],methods:[]}),e[i].accounts.push(r),(n=e[i].chains)==null||n.push(`${i}:${s}`)}),e}function BC(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=Xce(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=Ma(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}function Zce(t,e){var r,n,i,s,o,a;const c=DC(t),l=DC(e),u={},f=Object.keys(c).concat(Object.keys(l));for(const d of f)u[d]={chains:Ma((r=c[d])==null?void 0:r.chains,(n=l[d])==null?void 0:n.chains),methods:Ma((i=c[d])==null?void 0:i.methods,(s=l[d])==null?void 0:s.methods),events:Ma((o=c[d])==null?void 0:o.events,(a=l[d])==null?void 0:a.events)};return u}function Lc(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Da(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function zn(t){return typeof t>"u"}function Pn(t,e){return e&&zn(t)?!0:typeof t=="string"&&!!t.trim().length}function xE(t,e){return e&&zn(t)?!0:typeof t=="number"&&!isNaN(t)}function Yce(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return af(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],u=Wh(a),f=r[o];(!af(LP(o,f),u)||!af(f.methods,c)||!af(f.events,l))&&(s=!1)}),s):!1}function Fb(t){return Pn(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function Qce(t){if(Pn(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&Fb(r)}}return!1}function ele(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(Pn(t,!1)){if(e(t))return!0;const r=JP(t);return e(r)}}catch{}return!1}function tle(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function rle(t){return t==null?void 0:t.topic}function nle(t,e){let r=null;return Pn(t==null?void 0:t.publicKey,!1)||(r=Se("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function FC(t){let e=!0;return Lc(t)?t.length&&(e=t.every(r=>Pn(r,!1))):e=!1,e}function ile(t,e,r){let n=null;return Lc(e)&&e.length?e.forEach(i=>
vendor: 27,207 bytes, lines 76-82
76{n||Fb(i)||(n=nn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):Fb(t)||(n=nn("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function sle(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=ile(i,LP(i,s),`${e} ${r}`);o&&(n=o)}),n}function ole(t,e){let r=null;return Lc(t)?t.forEach(n=>{r||Qce(n)||(r=nn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=nn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function ale(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=ole(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function cle(t,e){let r=null;return FC(t==null?void 0:t.methods)?FC(t==null?void 0:t.events)||(r=nn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=nn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function zk(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=cle(n,`${e}, namespace`);i&&(r=i)}),r}function lle(t,e,r){let n=null;if(t&&Da(t)){const i=zk(t,e);i&&(n=i);const s=sle(t,e,r);s&&(n=s)}else n=Se("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function tw(t,e){let r=null;if(t&&Da(t)){const n=zk(t,e);n&&(r=n);const i=ale(t,e);i&&(r=i)}else r=Se("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Jk(t){return Pn(t.protocol,!0)}function ule(t,e){let r=!1;return e&&!t?r=!0:t&&Lc(t)&&t.length&&t.forEach(n=>{r=Jk(n)}),r}function fle(t){return typeof t=="number"}function ts(t){return typeof t<"u"&&typeof t!==null}function dle(t){return!(!t||typeof t!="object"||!t.code||!xE(t.code,!1)||!t.message||!Pn(t.message,!1))}function hle(t){return!(zn(t)||!Pn(t.method,!1))}function ple(t){return!(zn(t)||zn(t.result)&&zn(t.error)||!xE(t.id,!1)||!Pn(t.jsonrpc,!1))}function gle(t){return!(zn(t)||!Pn(t.name,!1))}function $C(t,e){return!(!Fb(e)||!jk(t).includes(e))}function mle(t,e,r){return Pn(r,!1)?Wce(t,e).includes(r):!1}function ble(t,e,r){return Pn(r,!1)?Kce(t,e).includes(r):!1}function LC(t,e,r){let n=null;const i=yle(t),s=vle(e),o=Object.keys(i),a=Object.keys(s),c=UC(Object.keys(t)),l=UC(Object.keys(e)),u=c.filter(f=>!l.includes(f));return u.length&&(n=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. 77 Required: ${u.toString()} 78 Received: ${Object.keys(e).toString()}`)),af(o,a)||(n=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. 79 Required: ${o.toString()} 80 Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const d=Wh(e[f].accounts);d.includes(f)||(n=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} 81 Required: ${f} 82 Approved: ${d.toString()}`))}),o.forEach(f=>{n||(af(i[f].methods,s[f].methods)?af(i[f].events,s[f].events)||(n=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=Se("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function yle(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function UC(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function vle(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Wh(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function wle(t,e){return xE(t,!1)&&t<=e.max&&t>=e.min}function HC(){const t=Z1();return new Promise(e=>{switch(t){case Fs.browser:e(Ele());break;case Fs.reactNative:e(Ale());break;case Fs.node:e(_le());break;default:e(!0)}})}function Ele(){return Vh()&&(navigator==null?void 0:navigator.onLine)}async function Ale(){if(gu()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function _le(){return!0}function Cle(t){switch(Z1()){case Fs.browser:Sle(t);break;case Fs.reactNative:Tle(t);break}}function Sle(t){!gu()&&Vh()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function Tle(t){gu()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}function Nle(){var t;return Vh()&&Ff()?((t=Ff())==null?void 0:t.visibilityState)==="visible":!0}const rw={};class y0{static get(e){return rw[e]}static set(e,r){rw[e]=r}static delete(e){delete rw[e]}}function Ile(t){const e=K1.decode(t);if(e.length<33)throw new Error("Too short to contain a public key");return e.slice(1,33)}function xle({publicKey:t,signature:e,payload:r}){var n;const i=v6(r.method),s=128|parseInt(((n=r.version)==null?void 0:n.toString())||"4"),o=kle(r.address),a=r.era==="00"?new Uint8Array([0]):v6(r.era);if(a.length!==1&&a.length!==2)throw new Error("Invalid era length");const c=parseInt(r.nonce,16),l=new Uint8Array([c&255,c>>8&255]),u=BigInt(`0x${Ple(r.tip)}`),f=Mle(u),d=new Uint8Array([0,...t,o,...e,...a,...l,...f,...i]),h=Ole(d.length+1);return new Uint8Array([...h,s,...d])}function Rle(t){const e=v6(t),r=fse.blake2b(e,void 0,32);return"0x"+Buffer.from(r).toString("hex")}function v6(t){return new Uint8Array(t.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function Ple(t){return t.startsWith("0x")?t.slice(2):t}function kle(t){const e=K1.decode(t)[0];return e===42?0:e===60?2:1}function Ole(t){if(t<64)return new Uint8Array([t<<2]);if(t<16384){const e=t<<2|1;return new Uint8Array([e&255,e>>8&255])}else if(t<1<<30){const e=t<<2|2;return new Uint8Array([e&255,e>>8&255,e>>16&255,e>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function Mle(t){if(t<BigInt(1)<<BigInt(6))return new Uint8Array([Number(t<<BigInt(2))]);if(t<BigInt(1)<<BigInt(14)){const e=t<<BigInt(2)|BigInt(1);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255))])}else if(t<BigInt(1)<<BigInt(30)){const e=t<<BigInt(2)|BigInt(2);return new Uint8Array([Number(e&BigInt(255)),Number(e>>BigInt(8)&BigInt(255)),Number(e>>BigInt(16)&BigInt(255)),Number(e>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function Dle(t){const e=Uint8Array.from(Buffer.from(t.signature,"hex")),r=Ile(t.transaction.address),n=xle({publicKey:r,signature:e,payload:t.transaction}),i=Buffer.from(n).toString("hex");return Rle(i)}function RE({logger:t,name:e}){const r=typeof t=="string"?wy({opts:{level:t,name:e}}).logger:t;return r.level=typeof t=="string"?t:t.level,r}const Ble="PARSE_ERROR",Fle="INVALID_REQUEST",$le="METHOD_NOT_FOUND",Lle="INVALID_PARAMS",qk="INTERNAL_ERROR",PE="SERVER_ERROR",Ule=[-32700,-32600,-32601,-32602,-32603],Z0={[Ble]:{code:-32700,message:"Parse error"},[Fle]:{code:-32600,message:"Invalid Request"},[$le]:{code:-32601,message:"Method not found"},[Lle]:{code:-32602,message:"Invalid params"},[qk]:{code:-32603,message:"Internal error"},[PE]:{code:-32e3,message:"Server error"}},Gk=PE;function Hle(t){return Ule.includes(t)}function jC(t){return Object.keys(Z0).includes(t)?Z0[t]:Z0[Gk]}function jle(t){const e=Object.values(Z0).find(r=>r.code===t);return e||Z0[Gk]}function Vk(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Wk={},hc={},zC;function zle(){if(zC)return hc;zC=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.isBrowserCryptoAvailable=hc.getSubtleCrypto=hc.getBrowerCrypto=void 0;function t(){return(ro==null?void 0:ro.crypto)||(ro==null?void 0:ro.msCrypto)||{}}hc.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}hc.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return hc.isBrowserCryptoAvailable=r,hc}var pc={},JC;function Jle(){if(JC)return pc;JC=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.isBrowser=pc.isNode=pc.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}pc.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}pc.isNode=e;function r(){return!t()&&!e()}return pc.isBrowser=r,pc}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=z1;e.__exportStar(zle(),t),e.__exportStar(Jle(),t)})(Wk);function ua(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ul(t=6){return BigInt(ua(t))}function Mo(t,e,r){return{id:r||ua(),jsonrpc:"2.0",method:t,params:e}}function a1(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Xy(t,e,r){return{id:t,jsonrpc:"2.0",error:qle(e,r)}}function qle(t,e){return typeof t>"u"?jC(qk):(typeof t=="string"&&(t=Object.assign(Object.assign({},jC(PE)),{message:t})),typeof e<"u"&&(t.data=e),Hle(t.code)&&(t=jle(t.code)),t)}let Gle=class{},Vle=class extends Gle{constructor(){super()}},Wle=class extends Vle{constructor(e){super()}};const Kle="^https?:",Xle="^wss?:";function Zle(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Kk(t,e){const r=Zle(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function qC(t){return Kk(t,Kle)}function GC(t){return Kk(t,Xle)}function Yle(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Xk(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function kE(t){return Xk(t)&&"method"in t}function Zy(t){return Xk(t)&&(fa(t)||to(t))}function fa(t){return"result"in t}function to(t){return"error"in t}let OE=class extends Wle{constructor(e){super(e),this.events=new po.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Mo(e.method,e.params||[],e.id||Ul().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{to(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Zy(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const Qle=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),eue=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",VC=t=>t.split("?")[0],WC=10,tue=Qle();let rue=class{constructor(e){if(this.url=e,this.events=new po.EventEmitter,this.registering=!1,!GC(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Bf(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!GC(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=Wk.isReactNative()?void 0:{rejectUnauthorized:!Yle(e)},s=new tue(e,[],i);eue()?s.onerror=o=>{const a=o;n(this.emitError(a.error))}:s.on("error",o=>{n(this.emitError(o))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Df(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=Xy(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Vk(e,VC(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>WC&&this.events.setMaxListeners(WC)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${VC(this.url)}`));return this.events.emit("register_error",r),r}};const Zk="wc",Yk=2,$b="core",Va=`${Zk}@2:${$b}:`,nue={name:$b,logger:"error"},iue={database:":memory:"},sue="crypto",KC="client_ed25519_seed",oue=we.ONE_DAY,aue="keychain",cue="0.3",lue="messages",uue="0.3",fue=we.SIX_HOURS,due="publisher",Qk="irn",hue="error",eO="wss://relay.walletconnect.org",pue="relayer",Cn={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},gue="_subscription",Ws={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},mue=.1,w6="2.23.7",en={link_mode:"link_mode",relay:"relay"},Rm={inbound:"inbound",outbound:"outbound"},bue="0.3",yue="WALLETCONNECT_CLIENT_ID",XC="WALLETCONNECT_LINK_MODE_APPS",Ss={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},vue="subscription",wue="0.3",Eue="pairing",Aue="0.3",v0={wc_pairingDelete:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:we.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:we.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:we.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:we.ONE_DAY,prompt:!1,tag:0},res:{ttl:we.ONE_DAY,prompt:!1,tag:0}}},Ku={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Eo={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},_ue="history",Cue="0.3",Sue="expirer",Ys={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Tue="0.3",Nue="verify-api",Iue="https://verify.walletconnect.com",tO="https://verify.walletconnect.org",Y0=tO,xue=`${Y0}/v3`,Rue=[Iue,tO],Pue="echo",kue="https://echo.walletconnect.com",oa={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},yc={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Ao={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success",session_request_response_started:"session_request_response_started",session_request_response_validation_success:"session_request_response_validation_success",session_request_response_publish_started:"session_request_response_publish_started"},Fu={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found",session_request_response_validation_failure:"session_request_response_validation_failure",session_request_response_publish_failure:"session_request_response_publish_failure"},$u={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},w0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},Oue=.1,Mue="event-client",Due=86400,Bue="https://pulse.walletconnect.org/batch";function Fue(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var s=t.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=t.length,c=t.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function f(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var b=0,w=0,x=0,k=g.length;x!==k&&g[x]===0;)x++,b++;for(var R=(k-x)*u+1>>>0,D=new Uint8Array(R);x!==k;){for(var O=g[x],M=0,F=R-1;(O!==0||M<w)&&F!==-1;F--,M++)O+=256*D[F]>>>0,D[F]=O%a>>>0,O=O/a>>>0;if(O!==0)throw new Error("Non-zero carry");w=M,x++}for(var H=R-w;H!==R&&D[H]===0;)H++;for(var U=c.repeat(b);H<R;++H)U+=t.charAt(D[H]);return U}function d(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var b=0;if(g[b]!==" "){for(var w=0,x=0;g[b]===c;)w++,b++;for(var k=(g.length-b)*l+1>>>0,R=new Uint8Array(k);g[b];){var D=r[g.charCodeAt(b)];if(D===255)return;for(var O=0,M=k-1;(D!==0||O<x)&&M!==-1;M--,O++)D+=a*R[M]>>>0,R[M]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");x=O,b++}if(g[b]!==" "){for(var F=k-x;F!==k&&R[F]===0;)F++;for(var H=new Uint8Array(w+(k-F)),U=w;F!==k;)H[U++]=R[F++];return H}}}function h(g){var b=d(g);if(b)return b;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var $ue=Fue,Lue=$ue;const rO=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},Uue=t=>new TextEncoder().encode(t),Hue=t=>new TextDecoder().decode(t);class jue{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class zue{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return nO(this,e)}}class Jue{constructor(e){this.decoders=e}or(e){return nO(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const nO=(t,e)=>new Jue({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class que{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new jue(e,r,n),this.decoder=new zue(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Yy=({name:t,prefix:e,encode:r,decode:n})=>new que(t,e,r,n),rg=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Lue(r,e);return Yy({prefix:t,name:e,encode:n,decode:s=>rO(i(s))})},Gue=(t,e,r,n)=>{const i={};for(let u=0;u<e.length;++u)i[e[u]]=u;let s=t.length;for(;t[s-1]==="=";)--s;const o=new Uint8Array(s*r/8|0);let a=0,c=0,l=0;for(let u=0;u<s;++u){const f=i[t[u]];if(f===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|f,a+=r,a>=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},Vue=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",o=0,a=0;for(let c=0;c<t.length;++c)for(a=a<<8|t[c],o+=8;o>r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s},mi=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>Yy({prefix:e,name:t,encode(i){return Vue(i,n,r)},decode(i){return Gue(i,n,r,t)}}),Wue=Yy({prefix:"\0",name:"identity",encode:t=>Hue(t),decode:t=>Uue(t)});var Kue=Object.freeze({__proto__:null,identity:Wue});const Xue=mi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Zue=Object.freeze({__proto__:null,base2:Xue});const Yue=mi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Que=Object.freeze({__proto__:null,base8:Yue});const efe=rg({prefix:"9",name:"base10",alphabet:"0123456789"});var tfe=Object.freeze({__proto__:null,base10:efe});const rfe=mi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),nfe=mi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var ife=Object.freeze({__proto__:null,base16:rfe,base16upper:nfe});const sfe=mi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ofe=mi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),afe=mi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),cfe=mi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),lfe=mi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),ufe=mi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ffe=mi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),dfe=mi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),hfe=mi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var pfe=Object.freeze({__proto__:null,base32:sfe,base32upper:ofe,base32pad:afe,base32padupper:cfe,base32hex:lfe,base32hexupper:ufe,base32hexpad:ffe,base32hexpadupper:dfe,base32z:hfe});const gfe=rg({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),mfe=rg({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var bfe=Object.freeze({__proto__:null,base36:gfe,base36upper:mfe});const yfe=rg({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),vfe=rg({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var wfe=Object.freeze({__proto__:null,base58btc:yfe,base58flickr:vfe});const Efe=mi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
82+/",bitsPerChar:6}),Afe=mi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_fe=mi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Cfe=mi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Sfe=Object.freeze({__proto__:null,base64:Efe,base64pad:Afe,base64url:_fe,base64urlpad:Cfe});const iO=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Tfe=iO.reduce((t,e,r)=>(t[r]=e,t),[]),Nfe=iO.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Ife(t){return t.reduce((e,r)=>(e+=Tfe[r],e),"")}function xfe(t){const e=[];for(const r of t){const n=Nfe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Rfe=Yy({prefix:"ð",name:"base256emoji",encode:Ife,decode:xfe});var Pfe=Object.freeze({__proto__:null,base256emoji:Rfe}),kfe=sO,ZC=128,Ofe=127,Mfe=~Ofe,Dfe=Math.pow(2,31);function sO(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Dfe;)e[r++]=t&255|ZC,t/=128;for(;t&Mfe;)e[r++]=t&255|ZC,t>>>=7;return e[r]=t|0,sO.bytes=r-n+1,e}var Bfe=E6,Ffe=128,YC=127;function E6(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw E6.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&YC)<<i:(o&YC)*Math.pow(2,i),i+=7}while(o>=Ffe);return E6.bytes=s-n,r}var $fe=Math.pow(2,7),Lfe=Math.pow(2,14),Ufe=Math.pow(2,21),Hfe=Math.pow(2,28),jfe=Math.pow(2,35),zfe=Math.pow(2,42),Jfe=Math.pow(2,49),qfe=Math.pow(2,56),Gfe=Math.pow(2,63),Vfe=function(t){return t<$fe?1:t<Lfe?2:t<Ufe?3:t<Hfe?4:t<jfe?5:t<zfe?6:t<Jfe?7:t<qfe?8:t<Gfe?9:10},Wfe={encode:kfe,decode:Bfe,encodingLength:Vfe},oO=Wfe;const QC=(t,e,r=0)=>(oO.encode(t,e,r),e),eS=t=>oO.encodingLength(t),A6=(t,e)=>{const r=e.byteLength,n=eS(t),i=n+eS(r),s=new Uint8Array(i+r);return QC(t,s,0),QC(r,s,n),s.set(e,i),new Kfe(t,r,e,s)};class Kfe{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const aO=({name:t,code:e,encode:r})=>new Xfe(t,e,r);class Xfe{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?A6(this.code,r):r.then(n=>A6(this.code,n))}else throw Error("Unknown type, must be binary type")}}const cO=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Zfe=aO({name:"sha2-256",code:18,encode:cO("SHA-256")}),Yfe=aO({name:"sha2-512",code:19,encode:cO("SHA-512")});var Qfe=Object.freeze({__proto__:null,sha256:Zfe,sha512:Yfe});const lO=0,ede="identity",uO=rO,tde=t=>A6(lO,uO(t)),rde={code:lO,name:ede,encode:uO,digest:tde};var nde=Object.freeze({__proto__:null,identity:rde});new TextEncoder,new TextDecoder;const tS={...Kue,...Zue,...Que,...tfe,...ife,...pfe,...bfe,...wfe,...Sfe,...Pfe};({...Qfe,...nde});function fO(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function ide(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?fO(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function dO(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const rS=dO("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),nw=dO("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=ide(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),sde={utf8:rS,"utf-8":rS,hex:tS.base16,latin1:nw,ascii:nw,binary:nw,...tS};function ode(t,e="utf8"){const r=sde[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?fO(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}var ade=Object.defineProperty,cde=(t,e,r)=>e in t?ade(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ia=(t,e,r)=>cde(t,typeof e!="symbol"?e+"":e,r);class lde{constructor(e,r){this.core=e,this.logger=r,ia(this,"keychain",new Map),ia(this,"name",aue),ia(this,"version",cue),ia(this,"initialized",!1),ia(this,"storagePrefix",Va),ia(this,"init",async()=>
vendor: 54,076 bytes, line 82
82{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}}),ia(this,"has",n=>(this.isInitialized(),this.keychain.has(n))),ia(this,"set",async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()}),ia(this,"get",n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=Se("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i}),ia(this,"del",async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()}),this.core=e,this.logger=vs(r,this.name)}get context(){return ys(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,o6(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?a6(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var ude=Object.defineProperty,fde=(t,e,r)=>e in t?ude(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gn=(t,e,r)=>fde(t,typeof e!="symbol"?e+"":e,r);class dde{constructor(e,r,n){this.core=e,this.logger=r,Gn(this,"name",sue),Gn(this,"keychain"),Gn(this,"randomSessionIdentifier",y6()),Gn(this,"initialized",!1),Gn(this,"clientId"),Gn(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),Gn(this,"hasKeys",i=>(this.isInitialized(),this.keychain.has(i))),Gn(this,"getClientId",async()=>{if(this.isInitialized(),this.clientId)return this.clientId;const i=await this.getClientSeed(),s=g_(i),o=CR(s.publicKey);return this.clientId=o,o}),Gn(this,"generateKeyPair",()=>{this.isInitialized();const i=wce();return this.setPrivateKey(i.publicKey,i.privateKey)}),Gn(this,"signJWT",async i=>{this.isInitialized();const s=await this.getClientSeed(),o=g_(s),a=this.randomSessionIdentifier;return await qee(a,i,oue,o)}),Gn(this,"generateSharedKey",(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=Ece(a,s);return this.setSymKey(c,o)}),Gn(this,"setSymKey",async(i,s)=>{this.isInitialized();const o=s||xm(i);return await this.keychain.set(o,i),o}),Gn(this,"deleteKeyPair",async i=>{this.isInitialized(),await this.keychain.del(i)}),Gn(this,"deleteSymKey",async i=>{this.isInitialized(),await this.keychain.del(i)}),Gn(this,"encode",async(i,s,o)=>{this.isInitialized();const a=Hk(o),c=Bf(s);if(IC(a))return Cce(c,o==null?void 0:o.encoding);if(NC(a)){const d=a.senderPublicKey,h=a.receiverPublicKey;i=await this.generateSharedKey(d,h)}const l=this.getSymKey(i),{type:u,senderPublicKey:f}=a;return Ace({type:u,symKey:l,message:c,senderPublicKey:f,encoding:o==null?void 0:o.encoding})}),Gn(this,"decode",async(i,s,o)=>{this.isInitialized();const a=Tce(s,o);if(IC(a)){const c=Sce(s,o==null?void 0:o.encoding);return Df(c)}if(NC(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=_ce({symKey:c,encoded:s,encoding:o==null?void 0:o.encoding});return Df(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),Gn(this,"getPayloadType",(i,s=as)=>{const o=o1({encoded:i,encoding:s});return Uf(o.type)}),Gn(this,"getPayloadSenderPublicKey",(i,s=as)=>{const o=o1({encoded:i,encoding:s});return o.senderPublicKey?ps(o.senderPublicKey,ji):void 0}),this.core=e,this.logger=vs(r,this.name),this.keychain=n||new lde(this.core,this.logger)}get context(){return ys(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(KC)}catch{e=y6(),await this.keychain.set(KC,e)}return ode(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var hde=Object.defineProperty,pde=Object.defineProperties,gde=Object.getOwnPropertyDescriptors,nS=Object.getOwnPropertySymbols,mde=Object.prototype.hasOwnProperty,bde=Object.prototype.propertyIsEnumerable,_6=(t,e,r)=>e in t?hde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yde=(t,e)=>{for(var r in e||(e={}))mde.call(e,r)&&_6(t,r,e[r]);if(nS)for(var r of nS(e))bde.call(e,r)&&_6(t,r,e[r]);return t},vde=(t,e)=>pde(t,gde(e)),_s=(t,e,r)=>_6(t,typeof e!="symbol"?e+"":e,r);class wde extends jZ{constructor(e,r){super(e,r),this.logger=e,this.core=r,_s(this,"messages",new Map),_s(this,"messagesWithoutClientAck",new Map),_s(this,"name",lue),_s(this,"version",uue),_s(this,"initialized",!1),_s(this,"storagePrefix",Va),_s(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n);const i=await this.getRelayerMessagesWithoutClientAck();typeof i<"u"&&(this.messagesWithoutClientAck=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}}),_s(this,"set",async(n,i,s)=>{this.isInitialized();const o=eo(i);let a=this.messages.get(n);if(typeof a>"u"&&(a={}),typeof a[o]<"u")return o;if(a[o]=i,this.messages.set(n,a),s===Rm.inbound){const c=this.messagesWithoutClientAck.get(n)||{};this.messagesWithoutClientAck.set(n,vde(yde({},c),{[o]:i}))}return await this.persist(),o}),_s(this,"get",n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i}),_s(this,"getWithoutAck",n=>{this.isInitialized();const i={};for(const s of n){const o=this.messagesWithoutClientAck.get(s)||{};i[s]=Object.values(o)}return i}),_s(this,"has",(n,i)=>{this.isInitialized();const s=this.get(n),o=eo(i);return typeof s[o]<"u"}),_s(this,"ack",async(n,i)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(n);if(typeof s>"u")return;const o=eo(i);delete s[o],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(n):this.messagesWithoutClientAck.set(n,s),await this.persist()}),_s(this,"del",async n=>{this.isInitialized(),this.messages.delete(n),this.messagesWithoutClientAck.delete(n),await this.persist()}),this.logger=vs(e,this.name),this.core=r}get context(){return ys(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,o6(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,o6(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?a6(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?a6(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Ede=Object.defineProperty,Ade=Object.defineProperties,_de=Object.getOwnPropertyDescriptors,iS=Object.getOwnPropertySymbols,Cde=Object.prototype.hasOwnProperty,Sde=Object.prototype.propertyIsEnumerable,C6=(t,e,r)=>e in t?Ede(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,bd=(t,e)=>{for(var r in e||(e={}))Cde.call(e,r)&&C6(t,r,e[r]);if(iS)for(var r of iS(e))Sde.call(e,r)&&C6(t,r,e[r]);return t},sS=(t,e)=>Ade(t,_de(e)),Ks=(t,e,r)=>C6(t,typeof e!="symbol"?e+"":e,r);class Tde extends zZ{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,Ks(this,"events",new po.EventEmitter),Ks(this,"name",due),Ks(this,"queue",new Map),Ks(this,"publishTimeout",we.toMiliseconds(we.ONE_MINUTE)),Ks(this,"initialPublishTimeout",we.toMiliseconds(we.ONE_SECOND*15)),Ks(this,"needsTransportRestart",!1),Ks(this,"publish",async(n,i,s)=>{var o,a,c,l,u;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const f=(s==null?void 0:s.ttl)||fue,d=(s==null?void 0:s.prompt)||!1,h=(s==null?void 0:s.tag)||0,g=(s==null?void 0:s.id)||Ul().toString(),b=Md(Bb().protocol),w={id:g,method:(s==null?void 0:s.publishMethod)||b.publish,params:bd({topic:n,message:i,ttl:f,prompt:d,tag:h,attestation:s==null?void 0:s.attestation},s==null?void 0:s.tvf)},x=`Failed to publish payload, please try again. id:${g} tag:${h}`;try{zn((o=w.params)==null?void 0:o.prompt)&&((a=w.params)==null||delete a.prompt),zn((c=w.params)==null?void 0:c.tag)&&((l=w.params)==null||delete l.tag);const k=new Promise(async R=>{const D=({id:M})=>{var F;((F=w.id)==null?void 0:F.toString())===M.toString()&&(this.removeRequestFromQueue(M),this.relayer.events.removeListener(Cn.publish,D),R())};this.relayer.events.on(Cn.publish,D);const O=Ca(new Promise((M,F)=>{this.rpcPublish(w,s).then(M).catch(H=>{this.logger.warn(H,H==null?void 0:H.message),F(H)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${g} tag:${h}`);try{await O,this.events.removeListener(Cn.publish,D)}catch(M){this.queue.set(g,{request:w,opts:s,attempt:1}),this.logger.warn(M,M==null?void 0:M.message)}});this.logger.trace({type:"method",method:"publish",params:{id:g,topic:n,message:i,opts:s}}),await Ca(k,this.publishTimeout,x)}catch(k){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(k),(u=s==null?void 0:s.internal)!=null&&u.throwOnFailedPublish)throw k}finally{this.queue.delete(g)}}),Ks(this,"publishCustom",async n=>{var i,s,o,a,c;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:n});const{payload:l,opts:u={}}=n,{attestation:f,tvf:d,publishMethod:h,prompt:g,tag:b,ttl:w=we.FIVE_MINUTES}=u,x=u.id||Ul().toString(),k=Md(Bb().protocol),R=h||k.publish,D={id:x,method:R,params:bd(sS(bd({},l),{ttl:w,prompt:g,tag:b,attestation:f}),d)},O=`Failed to publish custom payload, please try again. id:${x} tag:${b}`;try{zn((i=D.params)==null?void 0:i.prompt)&&((s=D.params)==null||delete s.prompt),zn((o=D.params)==null?void 0:o.tag)&&((a=D.params)==null||delete a.tag);const M=new Promise(async F=>{const H=({id:G})=>{var N;((N=D.id)==null?void 0:N.toString())===G.toString()&&(this.removeRequestFromQueue(G),this.relayer.events.removeListener(Cn.publish,H),F())};this.relayer.events.on(Cn.publish,H);const U=Ca(new Promise((G,N)=>{this.rpcPublish(D,u).then(G).catch(A=>{this.logger.warn(A,A==null?void 0:A.message),N(A)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${R} id:${x} tag:${b}`);try{await U,this.events.removeListener(Cn.publish,H)}catch(G){this.queue.set(x,{request:D,opts:u,attempt:1}),this.logger.warn(G,G==null?void 0:G.message)}});this.logger.trace({type:"method",method:"publish",params:{id:x,payload:l,opts:u}}),await Ca(M,this.publishTimeout,O)}catch(M){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(M),(c=u==null?void 0:u.internal)!=null&&c.throwOnFailedPublish)throw M}finally{this.queue.delete(x)}}),Ks(this,"on",(n,i)=>{this.events.on(n,i)}),Ks(this,"once",(n,i)=>{this.events.once(n,i)}),Ks(this,"off",(n,i)=>{this.events.off(n,i)}),Ks(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),this.relayer=e,this.logger=vs(r,this.name),this.registerEventListeners()}get context(){return ys(this.logger)}async rpcPublish(e,r){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:e});const n=await this.relayer.request(e);return this.relayer.events.emit(Cn.publish,bd(bd({},e),r)),this.logger.debug("Successfully Published Payload"),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,r)=>{var n;const i=e.attempt+1;this.queue.set(r,sS(bd({},e),{attempt:i})),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${(n=e.request.params)==null?void 0:n.tag}, attempt: ${i}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Kf.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Cn.connection_stalled);return}this.checkQueue()}),this.relayer.on(Cn.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}var Nde=Object.defineProperty,Ide=(t,e,r)=>e in t?Nde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yd=(t,e,r)=>Ide(t,typeof e!="symbol"?e+"":e,r);class xde{constructor(){yd(this,"map",new Map),yd(this,"set",(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])}),yd(this,"get",e=>this.map.get(e)||[]),yd(this,"exists",(e,r)=>this.get(e).includes(r)),yd(this,"delete",(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)}),yd(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}}var Rde=Object.defineProperty,Pde=Object.defineProperties,kde=Object.getOwnPropertyDescriptors,oS=Object.getOwnPropertySymbols,Ode=Object.prototype.hasOwnProperty,Mde=Object.prototype.propertyIsEnumerable,S6=(t,e,r)=>e in t?Rde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E0=(t,e)=>{for(var r in e||(e={}))Ode.call(e,r)&&S6(t,r,e[r]);if(oS)for(var r of oS(e))Mde.call(e,r)&&S6(t,r,e[r]);return t},iw=(t,e)=>Pde(t,kde(e)),qr=(t,e,r)=>S6(t,typeof e!="symbol"?e+"":e,r);class Dde extends GZ{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,qr(this,"subscriptions",new Map),qr(this,"topicMap",new xde),qr(this,"events",new po.EventEmitter),qr(this,"name",vue),qr(this,"version",wue),qr(this,"pending",new Map),qr(this,"cached",[]),qr(this,"initialized",!1),qr(this,"storagePrefix",Va),qr(this,"subscribeTimeout",we.toMiliseconds(we.ONE_MINUTE)),qr(this,"initialSubscribeTimeout",we.toMiliseconds(we.ONE_SECOND*15)),qr(this,"clientId"),qr(this,"batchSubscribeTopicsLimit",500),qr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),qr(this,"subscribe",async(n,i)=>{var s;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const o=Bb(i),a={topic:n,relay:o,transportType:i==null?void 0:i.transportType};(s=i==null?void 0:i.internal)!=null&&s.skipSubscribe||this.pending.set(n,a);const c=await this.rpcSubscribe(n,o,i);return typeof c=="string"&&(this.onSubscribe(c,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),c}catch(o){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(o),o}}),qr(this,"unsubscribe",async(n,i)=>{this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)}),qr(this,"isSubscribed",n=>new Promise(i=>{i(this.topicMap.topics.includes(n))})),qr(this,"isKnownTopic",n=>new Promise(i=>{i(this.topicMap.topics.includes(n)||this.pending.has(n)||this.cached.some(s=>s.topic===n))})),qr(this,"on",(n,i)=>{this.events.on(n,i)}),qr(this,"once",(n,i)=>{this.events.once(n,i)}),qr(this,"off",(n,i)=>{this.events.off(n,i)}),qr(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),qr(this,"start",async()=>{await this.onConnect()}),qr(this,"stop",async()=>{await this.onDisconnect()}),qr(this,"restart",async()=>{await this.restore(),await this.onRestart()}),qr(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const n=[];this.pending.forEach(i=>{n.push(i)}),await this.batchSubscribe(n)}),qr(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Kf.pulse,async()=>{await this.checkPending()}),this.events.on(Ss.created,async n=>{const i=Ss.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(Ss.deleted,async n=>{const i=Ss.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})}),this.relayer=e,this.logger=vs(r,this.name),this.clientId=""}get context(){return ys(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=Bb(n);await this.restartToComplete({topic:e,id:r,relay:i}),await this.rpcUnsubscribe(e,r,i);const s=nn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i,s;const o=await this.getSubscriptionId(e);if((i=n==null?void 0:n.internal)!=null&&i.skipSubscribe)return o;(!n||(n==null?void 0:n.transportType)===en.relay)&&await this.restartToComplete({topic:e,id:e,relay:r});const a={method:Md(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});const c=(s=n==null?void 0:n.internal)==null?void 0:s.throwOnFailedPublish;try{if((n==null?void 0:n.transportType)===en.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(f=>this.logger.warn(f))},we.toMiliseconds(we.ONE_SECOND)),o;const l=new Promise(async f=>{const d=h=>{h.topic===e&&(this.events.removeListener(Ss.created,d),f(h.id))};this.events.on(Ss.created,d);try{const h=await Ca(new Promise((g,b)=>{this.relayer.request(a).catch(w=>{this.logger.warn(w,w==null?void 0:w.message),b(w)}).then(g)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(Ss.created,d),f(h)}catch{}}),u=await Ca(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!u&&c)throw new Error(`Subscribing to ${e} failed, please try again`);return u?o:null}catch(l){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Cn.connection_stalled),c)throw l}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;const r=e[0].relay,n={method:Md(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await Ca(new Promise((i,s)=>{this.relayer.request(n).then(i).catch(o=>{this.logger.warn(o),s(o)})}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again"),!0}catch{return this.relayer.events.emit(Cn.connection_stalled),!1}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:Md(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Ca(new Promise((s,o)=>{this.relayer.request(n).catch(a=>{this.logger.warn(a),o(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Cn.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:Md(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,iw(E0({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,E0({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,E0({},r)),this.topicMap.set(r.topic,e),this.events.emit(Ss.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=Se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Ss.deleted,iw(E0({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Ss.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<r;n++){const i=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(i)}}this.events.emit(Ss.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size&&!e.every(r=>{var n;return r.topic===((n=this.subscriptions.get(r.id))==null?void 0:n.topic)})){const{message:r}=Se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(e.length){if(!await this.rpcBatchSubscribe(e)){this.logger.warn(`Batch subscribe failed for ${e.length} topics, adding to pending for retry`),e.forEach(r=>{this.pending.set(r.topic,r)});return}this.onBatchSubscribe(await Promise.all(e.map(async r=>iw(E0({},r),{id:await this.getSubscriptionId(r.topic)}))))}}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await Lse(we.toMiliseconds(we.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(e){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return eo(e+await this.getClientId())}}var Bde=Object.defineProperty,aS=Object.getOwnPropertySymbols,Fde=Object.prototype.hasOwnProperty,$de=Object.prototype.propertyIsEnumerable,T6=(t,e,r)=>e in t?Bde(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cS=(t,e)=>{for(var r in e||(e={}))Fde.call(e,r)&&T6(t,r,e[r]);if(aS)for(var r of aS(e))$de.call(e,r)&&T6(t,r,e[r]);return t},Ft=(t,e,r)=>T6(t,typeof e!="symbol"?e+"":e,r);class Lde extends JZ{constructor(e){var r;super(e),Ft(this,"protocol","wc"),Ft(this,"version",2),Ft(this,"core"),Ft(this,"logger"),Ft(this,"events",new po.EventEmitter),Ft(this,"provider"),Ft(this,"messages"),Ft(this,"subscriber"),Ft(this,"publisher"),Ft(this,"name",pue),Ft(this,"transportExplicitlyClosed",!1),Ft(this,"initialized",!1),Ft(this,"connectionAttemptInProgress",!1),Ft(this,"relayUrl"),Ft(this,"projectId"),Ft(this,"packageName"),Ft(this,"bundleId"),Ft(this,"hasExperiencedNetworkDisruption",!1),Ft(this,"pingTimeout"),Ft(this,"heartBeatTimeout",we.toMiliseconds(we.THIRTY_SECONDS+we.FIVE_SECONDS)),Ft(this,"reconnectTimeout"),Ft(this,"connectPromise"),Ft(this,"reconnectInProgress",!1),Ft(this,"requestsInFlight",[]),Ft(this,"connectTimeout",we.toMiliseconds(we.ONE_SECOND*15)),Ft(this,"stalledRestartInProgress",!1),Ft(this,"stalledRestartTimeout"),Ft(this,"stalledRestartBackoff",0),Ft(this,"stalledRestartBaseInterval",we.toMiliseconds(we.ONE_SECOND*2)),Ft(this,"stalledRestartMaxInterval",we.toMiliseconds(we.THIRTY_SECONDS)),Ft(this,"request",async n=>{var i,s;this.logger.debug("Publishing Request Payload");const o=n.id||Ul().toString();await this.toEstablishConnection();try{this.logger.trace({id:o,method:n.method,topic:(i=n.params)==null?void 0:i.topic},"relayer.request - publishing...");const a=`${o}:${((s=n.params)==null?void 0:s.tag)||""}`;this.requestsInFlight.push(a);const c=await this.provider.request(n);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==a),c}catch(a){throw this.logger.debug(`Failed to Publish Request: ${o}`),a}}),Ft(this,"resetPingTimeout",()=>{Rb()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var n,i,s,o;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(o=(s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null?void 0:s.terminate)==null||o.call(s)}catch(a){this.logger.warn(a,a==null?void 0:a.message)}},this.heartBeatTimeout))}),Ft(this,"onPayloadHandler",n=>{this.onProviderPayload(n),this.resetPingTimeout()}),Ft(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit(Cn.connect)}),Ft(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()}),Ft(this,"onProviderErrorHandler",n=>{this.logger.fatal(`Fatal socket error: ${n.message}`),this.events.emit(Cn.error,n),this.logger.fatal("Fatal socket error received, closing transport"),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(i=>this.logger.warn(i))}),Ft(this,"registerProviderListeners",()=>{this.provider.on(Ws.payload,this.onPayloadHandler),this.provider.on(Ws.connect,this.onConnectHandler),this.provider.on(Ws.disconnect,this.onDisconnectHandler),this.provider.on(Ws.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger=RE({logger:(r=e.logger)!=null?r:hue,name:this.name}),this.messages=new wde(this.logger,e.core),this.subscriber=new Dde(this,this.logger),this.publisher=new Tde(this,this.logger),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||eO,_se()?this.packageName=K_():Cse()&&(this.bundleId=K_()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(e=>this.logger.warn(e,e==null?void 0:e.message))}get context(){return ys(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1||!1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0||this.connectPromise!==void 0||!1}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:en.relay},Rm.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,r){var n,i,s;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const o=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let a=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"",c;const l=u=>{u.topic===e&&(this.subscriber.off(Ss.created,l),c())};return await Promise.all([new Promise(u=>{c=u,this.subscriber.on(Ss.created,l)}),new Promise(async(u,f)=>{a=await this.subscriber.subscribe(e,cS({internal:{throwOnFailedPublish:o}},r)).catch(d=>{o&&f(d)})||a,u()})]),a}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ca(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(r,n)=>{await this.connect(e).then(r).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await HC())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=xn(we.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(Cn.message,e),await this.recordMessageEvent(e,Rm.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let r=1;for(;r<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise(async(n,i)=>{const s=()=>{i(new Error("Connection interrupted while trying to connect"))};this.provider.once(Ws.disconnect,s),await Ca(new Promise((o,a)=>{this.provider.connect().then(o).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>{i(o)}).finally(()=>{this.provider.off(Ws.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(o,a)=>{const c=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Ws.disconnect,c),await this.subscriber.start().then(o).catch(a).finally(()=>{this.provider.off(Ws.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,n()})}catch(n){await this.subscriber.stop();const i=n;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,we.toMiliseconds(r*1))),r++}}startPingTimeout(){var e,r,n,i,s;if(Rb())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(o){this.logger.warn(o,o==null?void 0:o.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new OE(new rue(xse({sdkVersion:w6,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,r){const{topic:n,message:i}=e;await this.messages.set(n,i,r)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(r))return this.logger.warn(`Ignoring message for unknown topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.warn(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),kE(e)){if(!e.method.endsWith(gue))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:o}=r.data,a={topic:n,message:i,publishedAt:s,transportType:en.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(cS({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(e),await this.onMessageEvent(a)}else Zy(e)&&this.events.emit(Cn.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,Rm.inbound),this.events.emit(Cn.message,e))}async acknowledgePayload(e){const r=a1(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Ws.payload,this.onPayloadHandler),this.provider.off(Ws.connect,this.onConnectHandler),this.provider.off(Ws.disconnect,this.onDisconnectHandler),this.provider.off(Ws.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await HC();Cle(async r=>{e!==r&&(e=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n==null?void 0:n.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Kf.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&Nle())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(r){this.logger.warn(r,r==null?void 0:r.message)}}),this.events.on(Cn.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;const r=this.stalledRestartBackoff===0?0:Math.min(Math.pow(2,this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${r?` in ${r}ms`:""}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(n){this.logger.error(n,n==null?void 0:n.message)}finally{this.stalledRestartInProgress=!1}},r)})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(Cn.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},we.toMiliseconds(mue)))))}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}}function Ude(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function lS(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function uS(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Hde="[object RegExp]",jde="[object String]",zde="[object Number]",Jde="[object Boolean]",fS="[object Arguments]",qde="[object Symbol]",Gde="[object Date]",Vde="[object Map]",Wde="[object Set]",Kde="[object Array]",Xde="[object Function]",Zde="[object ArrayBuffer]",sw="[object Object]",Yde="[object Error]",Qde="[object DataView]",ehe="[object Uint8Array]",the="[object Uint8ClampedArray]",rhe="[object Uint16Array]",nhe="[object Uint32Array]",ihe="[object BigUint64Array]",she="[object Int8Array]",ohe="[object Int16Array]",ahe="[object Int32Array]",che="[object BigInt64Array]",lhe="[object Float32Array]",uhe="[object Float64Array]";function dS(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function fhe(t,e,r){return U0(t,e,void 0,void 0,void 0,void 0,r)}function U0(t,e,r,n,i,s,o){const a=o(t,e,r,n,i,s);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return Q0(t,e,s,o)}return Q0(t,e,s,o)}function Q0(t,e,r,n){if(Object.is(t,e))return!0;let i=uS(t),s=uS(e);if(i===fS&&(i=sw),s===fS&&(s=sw),i!==s)return!1;switch(i){case jde:return t.toString()===e.toString();case zde:{const c=t.valueOf(),l=e.valueOf();return Ude(c,l)}case Jde:case Gde:case qde:return Object.is(t.valueOf(),e.valueOf());case Hde:return t.source===e.source&&t.flags===e.flags;case Xde:return t===e}r=r??new Map;const o=r.get(t),a=r.get(e);if(o!=null&&a!=null)return o===e;r.set(t,e),r.set(e,t);try{switch(i){case Vde:{if(t.size!==e.size)return!1;for(const[c,l]of t.entries())if(!e.has(c)||!U0(l,e.get(c),c,t,e,r,n))return!1;return!0}case Wde:{if(t.size!==e.size)return!1;const c=Array.from(t.values()),l=Array.from(e.values());for(let u=0;u<c.length;u++){const f=c[u],d=l.findIndex(h=>U0(f,h,void 0,t,e,r,n));if(d===-1)return!1;l.splice(d,1)}return!0}case Kde:case ehe:case the:case rhe:case nhe:case ihe:case she:case ohe:case ahe:case che:case lhe:case uhe:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let c=0;c<t.length;c++)if(!U0(t[c],e[c],c,t,e,r,n))return!1;return!0}case Zde:return t.byteLength!==e.byteLength?!1:Q0(new Uint8Array(t),new Uint8Array(e),r,n);case Qde:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:Q0(new Uint8Array(t),new Uint8Array(e),r,n);case Yde:return t.name===e.name&&t.message===e.message;case sw:{if(!(Q0(t.constructor,e.constructor,r,n)||dS(t)&&dS(e)))return!1;const c=[...Object.keys(t),...lS(t)],l=[...Object.keys(e),...lS(e)];if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++){const f=c[u],d=t[f];if(!Object.hasOwn(e,f))return!1;const h=e[f];if(!U0(d,h,f,t,e,r,n))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}function dhe(){}function hhe(t,e){return fhe(t,e,dhe)}var phe=Object.defineProperty,hS=Object.getOwnPropertySymbols,ghe=Object.prototype.hasOwnProperty,mhe=Object.prototype.propertyIsEnumerable,N6=(t,e,r)=>e in t?phe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pS=(t,e)=>{for(var r in e||(e={}))ghe.call(e,r)&&N6(t,r,e[r]);if(hS)for(var r of hS(e))mhe.call(e,r)&&N6(t,r,e[r]);return t},Yi=(t,e,r)=>N6(t,typeof e!="symbol"?e+"":e,r);class Qf extends qZ{constructor(e,r,n,i=Va,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,Yi(this,"map",new Map),Yi(this,"version",bue),Yi(this,"cached",[]),Yi(this,"initialized",!1),Yi(this,"getKey"),Yi(this,"storagePrefix",Va),Yi(this,"recentlyDeleted",[]),Yi(this,"recentlyDeletedLimit",200),Yi(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!zn(o)?this.map.set(this.getKey(o),o):tle(o)?this.map.set(o.id,o):rle(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)}),Yi(this,"set",async(o,a)=>{this.isInitialized(),this.map.has(o)?await this.update(o,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:o,value:a}),this.map.set(o,a),await this.persist())}),Yi(this,"get",o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o))),Yi(this,"getAll",o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>hhe(a[c],o[c]))):this.values)),Yi(this,"update",async(o,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:o,update:a});const c=pS(pS({},this.getData(o)),a);this.map.set(o,c),await this.persist()}),Yi(this,"delete",async(o,a)=>{this.isInitialized(),this.map.has(o)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:o,reason:a}),this.map.delete(o),this.addToRecentlyDeleted(o),await this.persist())}),this.logger=vs(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return ys(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=Se("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=Se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=Se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var bhe=Object.defineProperty,yhe=(t,e,r)=>e in t?bhe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kt=(t,e,r)=>yhe(t,typeof e!="symbol"?e+"":e,r);class vhe{constructor(e,r){this.core=e,this.logger=r,Kt(this,"name",Eue),Kt(this,"version",Aue),Kt(this,"events",new Z5),Kt(this,"pairings"),Kt(this,"initialized",!1),Kt(this,"storagePrefix",Va),Kt(this,"ignoredPayloadTypes",[$c]),Kt(this,"registeredMethods",[]),Kt(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),Kt(this,"register",({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]}),Kt(this,"create",async n=>{this.isInitialized();const i=y6(),s=await this.core.crypto.setSymKey(i),o=xn(we.FIVE_MINUTES),a={protocol:Qk},c={topic:s,expiry:o,relay:a,active:!1,methods:n==null?void 0:n.methods},l=kC({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:a,expiryTimestamp:o,methods:n==null?void 0:n.methods});return this.events.emit(Ku.create,c),this.core.expirer.set(s,o),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n==null?void 0:n.transportType,internal:n==null?void 0:n.internal}),{topic:s,uri:l}}),Kt(this,"pair",async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[oa.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:o,relay:a,expiryTimestamp:c,methods:l}=PC(n.uri);i.props.properties.topic=s,i.addTrace(oa.pairing_uri_validation_success),i.addTrace(oa.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),i.addTrace(oa.existing_pairing),u.active)throw i.setError(yc.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(oa.pairing_not_expired)}const f=c||xn(we.FIVE_MINUTES),d={topic:s,relay:a,expiry:f,active:!1,methods:l};this.core.expirer.set(s,f),await this.pairings.set(s,d),i.addTrace(oa.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(Ku.create,d),i.addTrace(oa.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(o,s),i.addTrace(oa.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(yc.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(h){throw i.setError(yc.subscribe_pairing_topic_failure),h}return i.addTrace(oa.subscribe_pairing_topic_success),d}),Kt(this,"activate",async({topic:n})=>{this.isInitialized();const i=xn(we.FIVE_MINUTES);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})}),Kt(this,"ping",async n=>{this.isInitialized(),await this.isValidPing(n),this.logger.warn("ping() is deprecated and will be removed in the next major release.");const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=Gu();this.events.once(Pr("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}}),Kt(this,"updateExpiry",async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})}),Kt(this,"updateMetadata",async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})}),Kt(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),Kt(this,"disconnect",async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",nn("USER_DISCONNECTED")),await this.deletePairing(i))}),Kt(this,"formatUriFromPairing",n=>{this.isInitialized();const{topic:i,relay:s,expiry:o,methods:a}=n,c=this.core.crypto.keychain.get(i);return kC({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:o,methods:a})}),Kt(this,"sendRequest",async(n,i,s)=>{const o=Mo(i,s),a=await this.core.crypto.encode(n,o),c=v0[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id}),Kt(this,"sendResult",async(n,i,s)=>{const o=a1(n,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,n)).request.method,l=v0[c].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)}),Kt(this,"sendError",async(n,i,s)=>{const o=Xy(n,s),a=await this.core.crypto.encode(i,o),c=(await this.core.history.get(i,n)).request.method,l=v0[c]?v0[c].res:v0.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)}),Kt(this,"deletePairing",async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,nn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])}),Kt(this,"cleanup",async()=>{const n=this.pairings.getAll().filter(i=>ma(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))}),Kt(this,"onRelayEventRequest",async n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(i,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(i,s);default:return await this.onUnknownRpcMethodRequest(i,s)}}),Kt(this,"onRelayEventResponse",async n=>{const{topic:i,payload:s}=n,o=(await this.core.history.get(i,s.id)).request.method;switch(o){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(o)}}),Kt(this,"onPairingPingRequest",async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(Ku.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}}),Kt(this,"onPairingPingResponse",(n,i)=>{const{id:s}=i;setTimeout(()=>{fa(i)?this.events.emit(Pr("pairing_ping",s),{}):to(i)&&this.events.emit(Pr("pairing_ping",s),{error:i.error})},500)}),Kt(this,"onPairingDeleteRequest",async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Ku.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}}),Kt(this,"onUnknownRpcMethodRequest",async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=nn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}}),Kt(this,"onUnknownRpcMethodResponse",n=>{this.registeredMethods.includes(n)||this.logger.error(nn("WC_METHOD_UNSUPPORTED",n))}),Kt(this,"isValidPair",(n,i)=>{var s;if(!ts(n)){const{message:a}=Se("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(yc.malformed_pairing_uri),new Error(a)}if(!ele(n.uri)){const{message:a}=Se("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(yc.malformed_pairing_uri),new Error(a)}const o=PC(n==null?void 0:n.uri);if(!((s=o==null?void 0:o.relay)!=null&&s.protocol)){const{message:a}=Se("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(yc.malformed_pairing_uri),new Error(a)}if(!(o!=null&&o.symKey)){const{message:a}=Se("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(yc.malformed_pairing_uri),new Error(a)}if(o!=null&&o.expiryTimestamp&&we.toMiliseconds(o==null?void 0:o.expiryTimestamp)<Date.now()){i.setError(yc.pairing_expired);const{message:a}=Se("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}}),Kt(this,"isValidPing",async n=>{if(!ts(n)){const{message:s}=Se("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)}),Kt(this,"isValidDisconnect",async n=>{if(!ts(n)){const{message:s}=Se("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)}),Kt(this,"isValidPairingTopic",async n=>{if(!Pn(n,!1)){const{message:i}=Se("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=Se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(ma(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=Se("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}}),this.core=e,this.logger=vs(r,this.name),this.pairings=new Qf(this.core,this.logger,this.name,this.storagePrefix)}get context(){return ys(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Cn.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(this.pairings.keys.includes(r)&&i!==en.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{const s=await this.core.crypto.decode(r,n);kE(s)?(this.core.history.set(r,s),await this.onRelayEventRequest({topic:r,payload:s})):Zy(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id)),await this.core.relayer.messages.ack(r,n)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Ys.expired,async e=>{const{topic:r}=zP(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Ku.expire,{topic:r}))})}}var whe=Object.defineProperty,Ehe=(t,e,r)=>e in t?whe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,oi=(t,e,r)=>Ehe(t,typeof e!="symbol"?e+"":e,r);class Ahe extends HZ{constructor(e,r){super(e,r),this.core=e,this.logger=r,oi(this,"records",new Map),oi(this,"events",new po.EventEmitter),oi(this,"name",_ue),oi(this,"version",Cue),oi(this,"cac
82hed",[]),oi(this,"initialized",!1),oi(this,"storagePrefix",Va),oi(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),oi(this,"set",(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:xn(we.THIRTY_DAYS)};this.records.set(o.id,o),this.persist(),this.events.emit(Eo.created,o)}),oi(this,"resolve",async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=to(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Eo.updated,i))}),oi(this,"get",async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i))),oi(this,"delete",(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(Eo.deleted,s)}}),this.persist()}),oi(this,"exists",async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1)),oi(this,"on",(n,i)=>{this.events.on(n,i)}),oi(this,"once",(n,i)=>{this.events.once(n,i)}),oi(this,"off",(n,i)=>{this.events.off(n,i)}),oi(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),this.logger=vs(r,this.name)}get context(){return ys(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Mo(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=Se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Eo.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Eo.created,e=>{const r=Eo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Eo.updated,e=>{const r=Eo.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Eo.deleted,e=>{const r=Eo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(Kf.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{we.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Eo.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var _he=Object.defineProperty,Che=(t,e,r)=>e in t?_he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Si=(t,e,r)=>Che(t,typeof e!="symbol"?e+"":e,r);class She extends VZ{constructor(e,r){super(e,r),this.core=e,this.logger=r,Si(this,"expirations",new Map),Si(this,"events",new po.EventEmitter),Si(this,"name",Sue),Si(this,"version",Tue),Si(this,"cac
82hed",[]),Si(this,"initialized",!1),Si(this,"storagePrefix",Va),Si(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Si(this,"has",n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}}),Si(this,"set",(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Ys.created,{target:s,expiration:o})}),Si(this,"get",n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)}),Si(this,"del",n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Ys.deleted,{target:i,expiration:s})}}),Si(this,"on",(n,i)=>{this.events.on(n,i)}),Si(this,"once",(n,i)=>{this.events.once(n,i)}),Si(this,"off",(n,i)=>{this.events.off(n,i)}),Si(this,"removeListener",(n,i)=>{this.events.removeListener(n,i)}),this.logger=vs(r,this.name)}get context(){return ys(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return Rse(e);if(typeof e=="number")return Pse(e);const{message:r}=Se("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Ys.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Se("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=Se("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;we.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Ys.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Kf.pulse,()=>this.checkExpirations()),this.events.on(Ys.created,e=>{const r=Ys.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Ys.expired,e=>{const r=Ys.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Ys.deleted,e=>{const r=Ys.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}}var The=Object.defineProperty,Nhe=(t,e,r)=>e in t?The(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,In=(t,e,r)=>Nhe(t,typeof e!="symbol"?e+"":e,r);class Ihe extends WZ{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,In(this,"name",Nue),In(this,"abortController"),In(this,"isDevEnv"),In(this,"verifyUrlV3",xue),In(this,"storagePrefix",Va),In(this,"version",Yk),In(this,"publicKey"),In(this,"fetchPromise"),In(this,"init",async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&we.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),In(this,"register",async i=>{if(!Vh()||this.isDevEnv)return;const s=window.location.origin,{id:o,decryptedId:a}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;try{const l=Ff(),u=this.startAbortTimer(we.ONE_SECOND*5),f=await new Promise((d,h)=>{const g=()=>{window.removeEventListener("message",w),l.body.removeChild(b),h("attestation aborted")};this.abortController.signal.addEventListener("abort",g);const b=l.createElement("iframe");b.src=c,b.style.display="none",b.addEventListener("error",g,{signal:this.abortController.signal});const w=x=>
vendor: 8,786 bytes, line 82
82{if(x.data&&typeof x.data=="string")try{const k=JSON.parse(x.data);if(k.type==="verify_attestation"){if(X3(k.attestation).payload.id!==o)return;clearInterval(u),l.body.removeChild(b),this.abortController.signal.removeEventListener("abort",g),window.removeEventListener("message",w),d(k.attestation===null?"":k.attestation)}}catch(k){this.logger.warn(k)}};l.body.appendChild(b),window.addEventListener("message",w,{signal:this.abortController.signal})});return this.logger.debug(f,"jwt attestation"),f}catch(l){this.logger.warn(l)}return""}),In(this,"resolve",async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:o,encryptedId:a}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(X3(s).payload.id!==a)return;const l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!o)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(o,c)}),In(this,"fetchAttestation",async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const o=this.startAbortTimer(we.ONE_SECOND*5),a=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(o),a.status===200?await a.json():void 0}),In(this,"getVerifyUrl",i=>{let s=i||Y0;return Rue.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Y0}`),s=Y0),s}),In(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(we.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await s.json()}catch(i){this.logger.warn(i)}}),In(this,"persistPublicKey",async i=>{this.logger.debug(i,"persisting public key to local storage"),await this.store.setItem(this.storeKey,i),this.publicKey=i}),In(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),In(this,"isValidJwtAttestation",async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}const o=await this.fetchAndPersistPublicKey();try{if(o)return this.validateAttestation(i,o)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}}),In(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),In(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const o=await this.fetchPublicKey();o&&(await this.persistPublicKey(o),s(o))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i}),In(this,"validateAttestation",(i,s)=>{const o=Ice(i,s.publicKey),a={hasExpired:we.toMiliseconds(o.exp)<Date.now(),payload:o};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}}),this.logger=vs(r,this.name),this.abortController=new AbortController,this.isDevEnv=vE(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return ys(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),we.toMiliseconds(e))}}var xhe=Object.defineProperty,Rhe=(t,e,r)=>e in t?xhe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gS=(t,e,r)=>Rhe(t,typeof e!="symbol"?e+"":e,r);class Phe extends KZ{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,gS(this,"context",Pue),gS(this,"registerDeviceToken",async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${kue}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})}),this.logger=vs(r,this.context)}}var khe=Object.defineProperty,mS=Object.getOwnPropertySymbols,Ohe=Object.prototype.hasOwnProperty,Mhe=Object.prototype.propertyIsEnumerable,I6=(t,e,r)=>e in t?khe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A0=(t,e)=>{for(var r in e||(e={}))Ohe.call(e,r)&&I6(t,r,e[r]);if(mS)for(var r of mS(e))Mhe.call(e,r)&&I6(t,r,e[r]);return t},Vn=(t,e,r)=>I6(t,typeof e!="symbol"?e+"":e,r);class Dhe extends XZ{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,Vn(this,"context",Mue),Vn(this,"storagePrefix",Va),Vn(this,"storageVersion",Oue),Vn(this,"events",new Map),Vn(this,"shouldPersist",!1),Vn(this,"init",async()=>{if(!vE())try{const i={eventId:Z_(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:HP(this.core.relayer.protocol,this.core.relayer.version,w6)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}}),Vn(this,"createEvent",i=>{const{event:s="ERROR",type:o="",properties:{topic:a,trace:c}}=i,l=Z_(),u=this.core.projectId||"",f=Date.now(),d=A0({eventId:l,timestamp:f,props:{event:s,type:o,properties:{topic:a,trace:c}},bundleId:u,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,d),this.shouldPersist=!0),d}),Vn(this,"getEvent",i=>{const{eventId:s,topic:o}=i;if(s)return this.events.get(s);const a=Array.from(this.events.values()).find(c=>c.props.properties.topic===o);if(a)return A0(A0({},a),this.setMethods(a.eventId))}),Vn(this,"deleteEvent",i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0}),Vn(this,"setEventListeners",()=>{this.core.heartbeat.on(Kf.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{we.fromMiliseconds(Date.now())-we.fromMiliseconds(i.timestamp)>Due&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})}),Vn(this,"setMethods",i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)})),Vn(this,"addTrace",(i,s)=>{const o=this.events.get(i);o&&(o.props.properties.trace.push(s),this.events.set(i,o),this.shouldPersist=!0)}),Vn(this,"setError",(i,s)=>{const o=this.events.get(i);o&&(o.props.type=s,o.timestamp=Date.now(),this.events.set(i,o),this.shouldPersist=!0)}),Vn(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),Vn(this,"restore",async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(s=>{this.events.set(s.eventId,A0(A0({},s),this.setMethods(s.eventId)))})}catch(i){this.logger.warn(i)}}),Vn(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,o]of this.events)o.props.type&&i.push(o);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const s of i)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),Vn(this,"sendEvent",async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${Bue}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${w6}${s}`,{method:"POST",body:JSON.stringify(i)})}),Vn(this,"getAppDomain",()=>UP().url),this.logger=vs(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var Bhe=Object.defineProperty,bS=Object.getOwnPropertySymbols,Fhe=Object.prototype.hasOwnProperty,$he=Object.prototype.propertyIsEnumerable,x6=(t,e,r)=>e in t?Bhe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yS=(t,e)=>{for(var r in e||(e={}))Fhe.call(e,r)&&x6(t,r,e[r]);if(bS)for(var r of bS(e))$he.call(e,r)&&x6(t,r,e[r]);return t},Kr=(t,e,r)=>x6(t,typeof e!="symbol"?e+"":e,r);let Lhe=class hO extends FZ{constructor(e){var r;super(e),Kr(this,"protocol",Zk),Kr(this,"version",Yk),Kr(this,"name",$b),Kr(this,"relayUrl"),Kr(this,"projectId"),Kr(this,"customStoragePrefix"),Kr(this,"events",new po.EventEmitter),Kr(this,"logger"),Kr(this,"heartbeat"),Kr(this,"relayer"),Kr(this,"crypto"),Kr(this,"storage"),Kr(this,"history"),Kr(this,"expirer"),Kr(this,"pairing"),Kr(this,"verify"),Kr(this,"echoClient"),Kr(this,"linkModeSupportedApps"),Kr(this,"eventClient"),Kr(this,"initialized",!1),Kr(this,"logChunkController"),Kr(this,"on",(a,c)=>this.events.on(a,c)),Kr(this,"once",(a,c)=>this.events.once(a,c)),Kr(this,"off",(a,c)=>this.events.off(a,c)),Kr(this,"removeListener",(a,c)=>this.events.removeListener(a,c)),Kr(this,"dispatchEnvelope",({topic:a,message:c,sessionExists:l})=>
82{if(!a||!c)return;const u={topic:a,message:c,publishedAt:Date.now(),transportType:en.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:l})});const n=this.getGlobalCore(e==null?void 0:e.customStoragePrefix);if(n)try{return this.customStoragePrefix=n.customStoragePrefix,this.logger=n.logger,this.heartbeat=n.heartbeat,this.crypto=n.crypto,this.history=n.history,this.expirer=n.expirer,this.storage=n.storage,this.relayer=n.relayer,this.pairing=n.pairing,this.verify=n.verify,this.echoClient=n.echoClient,this.linkModeSupportedApps=n.linkModeSupportedApps,this.eventClient=n.eventClient,this.initialized=n.initialized,this.logChunkController=n.logChunkController,n}catch(a){console.warn("Failed to copy global core",a)}this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||eO,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=E5({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:nue.logger,name:$b}),{logger:s,chunkLoggerController:o}=wy({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=o,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,c;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=vs(s,this.name),this.heartbeat=new YX,this.crypto=new dde(this,this.logger,e==null?void 0:e.keychain),this.history=new Ahe(this,this.logger),this.expirer=new She(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new MZ(yS(yS({},iue),e==null?void 0:e.storageOptions)),this.relayer=new Lde({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new vhe(this,this.logger),this.verify=new Ihe(this,this.logger,this.storage),this.echoClient=new Phe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new Dhe(this,this.logger,e==null?void 0:e.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const r=new hO(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(yue,n),r}get context(){return ys(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(XC,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(XC)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(e,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;const r=`_walletConnectCore_${e}`,n=`${r}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[n]} times.`),globalThis[r]}catch(r){console.warn("Failed to get global WalletConnect core",r);return}}setGlobalCore(e){var r;try{if(this.isGlobalCoreDisabled())return;const n=`_walletConnectCore_${((r=e.opts)==null?void 0:r.customStoragePrefix)||""}`;globalThis[n]=e}catch(n){console.warn("Failed to set global WalletConnect core",n)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&{}.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const Uhe=Lhe,pO="wc",gO=2,mO="client",ME=`${pO}@${gO}:${mO}:`,ow={name:mO,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},vS="WALLETCONNECT_DEEPLINK_CHOICE",Hhe="proposal",wS="Proposal expired",jhe="session",vd=we.SEVEN_DAYS,zhe="engine",ai={wc_sessionPropose:{req:{ttl:we.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1104},res:{ttl:we.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1106},res:{ttl:we.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:we.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:we.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:we.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1112},res:{ttl:we.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:we.ONE_DAY,prompt:!1,tag:1114},res:{ttl:we.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:we.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:we.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:we.FIVE_MINUTES,prompt:!1,tag:1119}}},aw={min:we.FIVE_MINUTES,max:we.SEVEN_DAYS},sa={idle:"IDLE",active:"ACTIVE"},Jhe={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""}
vendor: 64,655 bytes, line 82
82,cosmos_signDirect:{key:""}},qhe="request",Ghe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],Vhe="wc",Whe="auth",Khe="authKeys",Xhe="pairingTopics",Zhe="requests",Qy=`${Vhe}@${1.5}:${Whe}:`,Pm=`${Qy}:PUB_KEY`;var Yhe=Object.defineProperty,Qhe=Object.defineProperties,e0e=Object.getOwnPropertyDescriptors,ES=Object.getOwnPropertySymbols,t0e=Object.prototype.hasOwnProperty,r0e=Object.prototype.propertyIsEnumerable,R6=(t,e,r)=>e in t?Yhe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Sr=(t,e)=>{for(var r in e||(e={}))t0e.call(e,r)&&R6(t,r,e[r]);if(ES)for(var r of ES(e))r0e.call(e,r)&&R6(t,r,e[r]);return t},ci=(t,e)=>Qhe(t,e0e(e)),me=(t,e,r)=>R6(t,typeof e!="symbol"?e+"":e,r);class n0e extends eY{constructor(e){super(e),me(this,"name",zhe),me(this,"events",new Z5),me(this,"initialized",!1),me(this,"requestQueue",{state:sa.idle,queue:[]}),me(this,"sessionRequestQueue",{state:sa.idle,queue:[]}),me(this,"emittedSessionRequests",new Use({limit:500})),me(this,"requestQueueDelay",we.ONE_SECOND),me(this,"expectedPairingMethodMap",new Map),me(this,"recentlyDeletedMap",new Map),me(this,"recentlyDeletedLimit",200),me(this,"relayMessageCache",[]),me(this,"pendingSessions",new Map),me(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(ai)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},we.toMiliseconds(this.requestQueueDelay)))}),me(this,"connect",async r=>{var n;this.isInitialized(),await this.confirmOnlineStateOrThrow();const i=ci(Sr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(i),i.optionalNamespaces=Zce(i.requiredNamespaces,i.optionalNamespaces),i.requiredNamespaces={};const{pairingTopic:s,requiredNamespaces:o,optionalNamespaces:a,sessionProperties:c,scopedProperties:l,relays:u,authentication:f,walletPay:d}=i,h=((n=f==null?void 0:f[0])==null?void 0:n.ttl)||ai.wc_sessionPropose.req.ttl||we.FIVE_MINUTES;this.validateRequestExpiry(h);let g=s,b,w=!1;try{if(g){const U=this.client.core.pairing.pairings.get(g);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),w=U.active}}catch(U){throw this.client.logger.error(`connect() -> pairing.get(${g}) failed`),U}if(!g||!w){const{topic:U,uri:G}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});g=U,b=G}if(!g){const{message:U}=Se("NO_MATCHING_KEY",`connect() pairing topic: ${g}`);throw new Error(U)}const x=await this.client.core.crypto.generateKeyPair(),k=xn(h),R=Sr(ci(Sr(Sr({requiredNamespaces:o,optionalNamespaces:a,relays:u??[{protocol:Qk}],proposer:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:k,pairingTopic:g},c&&{sessionProperties:c}),l&&{scopedProperties:l}),{id:ua()}),(f||d)&&{requests:{authentication:f==null?void 0:f.map(U=>{const{domain:G,chains:N,nonce:A,uri:v,exp:p,nbf:m,type:y,statement:T,requestId:I,resources:_,signatureTypes:E}=U;return{domain:G,chains:N,nonce:A,type:y??"caip122",aud:v,version:"1",iat:new Date().toISOString(),exp:p,nbf:m,statement:T,requestId:I,resources:_,signatureTypes:E}}),walletPay:d}}),D=Pr("session_connect",R.id),{reject:O,resolve:M,done:F}=Gu(h,wS),H=({id:U})=>{U===R.id&&(this.client.events.off("proposal_expire",H),this.pendingSessions.delete(R.id),this.events.emit(D,{error:{message:wS,code:0}}))};return this.client.events.on("proposal_expire",H),this.events.once(D,({error:U,session:G})=>{this.client.events.off("proposal_expire",H),U?O(U):G&&M(G)}),await this.setProposal(R.id,R),await this.sendProposeSession({proposal:R,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:R.id}}}).catch(U=>{throw this.deleteProposal(R.id),U}),{uri:b,approval:F}}),me(this,"pair",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}}),me(this,"approve",async r=>{var n,i,s;const o=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[Ao.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(G){throw o.setError(Fu.no_internet_connection),G}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(G){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),o.setError(Fu.proposal_not_found),G}try{await this.isValidApprove(r)}catch(G){throw this.client.logger.error("approve() -> isValidApprove() failed"),o.setError(Fu.session_approve_namespace_validation_failure),G}const{id:a,relayProtocol:c,namespaces:l,sessionProperties:u,scopedProperties:f,sessionConfig:d,proposalRequestsResponses:h}=r,g=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:o.eventId});const{pairingTopic:b,proposer:w,requiredNamespaces:x,optionalNamespaces:k}=g;let R=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:b});R||(R=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Ao.session_approve_started,properties:{topic:b,trace:[Ao.session_approve_started,Ao.session_namespaces_validation_success]}}));const D=await this.client.core.crypto.generateKeyPair(),O=w.publicKey,M=await this.client.core.crypto.generateSharedKey(D,O),F=ci(Sr(Sr(Sr({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:D,metadata:this.client.metadata},expiry:xn(vd)},u&&{sessionProperties:u}),f&&{scopedProperties:f}),d&&{sessionConfig:d}),{proposalRequestsResponses:h}),H=en.relay;R.addTrace(Ao.subscribing_session_topic);try{await this.client.core.relayer.subscribe(M,{transportType:H,internal:{skipSubscribe:!0}})}catch(G){throw R.setError(Fu.subscribe_session_topic_failure),G}R.addTrace(Ao.subscribe_session_topic_success);const U=ci(Sr({},F),{topic:M,requiredNamespaces:x,optionalNamespaces:k,pairingTopic:b,acknowledged:!1,self:F.controller,peer:{publicKey:w.publicKey,metadata:w.metadata},controller:D,transportType:en.relay,authentication:h==null?void 0:h.authentication,walletPayResult:h==null?void 0:h.walletPay});await this.client.session.set(M,U),R.addTrace(Ao.store_session);try{await this.sendApproveSession({sessionTopic:M,proposal:g,pairingProposalResponse:{relay:{protocol:c??"irn"},responderPublicKey:D},sessionSettleRequest:F,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:Sr({correlationId:a},this.getTVFApproveParams(U))}}),R.addTrace(Ao.session_approve_publish_success)}catch(G){throw this.client.logger.error(G),this.client.session.delete(M,nn("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(M),G}return this.client.core.eventClient.deleteEvent({eventId:R.eventId}),await this.client.core.pairing.updateMetadata({topic:b,metadata:w.metadata}),await this.deleteProposal(a),await this.client.core.pairing.activate({topic:b}),await this.setExpiry(M,xn(vd)),{topic:M,acknowledged:()=>Promise.resolve(this.client.session.get(M))}}),me(this,"reject",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(o){throw this.client.logger.error("reject() -> isValidReject() failed"),o}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(o){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),o}s&&await this.sendError({id:n,topic:s,error:i,rpcOpts:ai.wc_sessionPropose.reject}),await this.deleteProposal(n)}),me(this,"update",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:n,namespaces:i}=r,{done:s,resolve:o,reject:a}=Gu(we.FIVE_MINUTES,"Session update request expired without receiving any acknowledgement"),c=ua(),l=Ul().toString(),u=this.client.session.get(n).namespaces;return this.events.once(Pr("session_update",c),({error:f})=>{f?a(f):o()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(f=>{this.client.logger.error(f),this.client.session.update(n,{namespaces:u}),a(f)}),{acknowledged:s}}),me(this,"extend",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}const{topic:n}=r,i=ua(),{done:s,resolve:o,reject:a}=Gu(we.FIVE_MINUTES,"Session extend request expired without receiving any acknowledgement");return this.events.once(Pr("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,xn(vd)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}}),me(this,"request",async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(w){throw this.client.logger.error("request() -> isValidRequest() failed"),w}const{chainId:n,request:i,topic:s,expiry:o=ai.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);(a==null?void 0:a.transportType)===en.relay&&await this.confirmOnlineStateOrThrow();const c=ua(),l=Ul().toString(),{done:u,resolve:f,reject:d}=Gu(o,"Request expired. Please try again.");this.events.once(Pr("session_request",c),({error:w,result:x})=>{w?d(w):f(x)});const h="wc_sessionRequest",g=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(g)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:h,params:{request:ci(Sr({},i),{expiryTimestamp:xn(o)}),chainId:n},expiry:o,throwOnFailedPublish:!0,appLink:g}).catch(w=>d(w)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await u();const b={request:ci(Sr({},i),{expiryTimestamp:xn(o)}),chainId:n};return await Promise.all([new Promise(async w=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:h,params:b,expiry:o,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,b)}).catch(x=>d(x)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),w()}),new Promise(async w=>{var x;if(!((x=a.sessionConfig)!=null&&x.disableDeepLink)){const k=await Dse(this.client.core.storage,vS);await kse({id:c,topic:s,wcDeepLink:k})}w()}),u()]).then(w=>w[2])}),me(this,"respond",async r=>{var n,i;this.isInitialized();const s=this.client.core.eventClient.createEvent({properties:{topic:(r==null?void 0:r.topic)||((i=(n=r==null?void 0:r.response)==null?void 0:n.id)==null?void 0:i.toString()),trace:[Ao.session_request_response_started]}});try{await this.isValidRespond(r)}catch(f){throw s.addTrace(f==null?void 0:f.message),s.setError(Fu.session_request_response_validation_failure),f}s.addTrace(Ao.session_request_response_validation_success);const{topic:o,response:a}=r,{id:c}=a,l=this.client.session.get(o);l.transportType===en.relay&&await this.confirmOnlineStateOrThrow();const u=this.getAppLinkIfEnabled(l.peer.metadata,l.transportType);try{s.addTrace(Ao.session_request_response_publish_started),fa(a)?await this.sendResult({id:c,topic:o,result:a.result,throwOnFailedPublish:!0,appLink:u}):to(a)&&await this.sendError({id:c,topic:o,error:a.error,appLink:u}),this.cleanupAfterResponse(r)}catch(f){throw s.addTrace(f==null?void 0:f.message),s.setError(Fu.session_request_response_publish_failure),f}}),me(this,"ping",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=ua(),s=Ul().toString(),{done:o,resolve:a,reject:c}=Gu(we.FIVE_MINUTES,"Ping request expired without receiving any acknowledgement");this.events.once(Pr("session_ping",i),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),o()])}else this.client.core.pairing.pairings.keys.includes(n)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:n}))}),me(this,"emit",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,o=Ul().toString(),a=ua();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:o,clientRpcId:a})}),me(this,"disconnect",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:nn("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=Se("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}}),me(this,"find",r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Yce(n,r)))),me(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),me(this,"authenticate",async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),o=s?en.link_mode:en.relay;o===en.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:c="",uri:l,domain:u,nonce:f,type:d,exp:h,nbf:g,methods:b=[],expiry:w}=r,x=[...r.resources||[]],{topic:k,uri:R}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:k,uri:R}});const D=await this.client.core.crypto.generateKeyPair(),O=xm(D);if(await Promise.all([this.client.auth.authKeys.set(Pm,{responseTopic:O,publicKey:D}),this.client.auth.pairingTopics.set(O,{topic:O,pairingTopic:k})]),await this.client.core.relayer.subscribe(O,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${k}`),b.length>0){const{namespace:_}=Fc(a[0]);let E=Qoe(_,"request",b);Im(x)&&(E=tae(E,x.pop())),x.push(E)}const M=w&&w>ai.wc_sessionAuthenticate.req.ttl?w:ai.wc_sessionAuthenticate.req.ttl,F={authPayload:{type:d??"caip122",chains:a,statement:c,aud:l,domain:u,version:"1",nonce:f,iat:new Date().toISOString(),exp:h,nbf:g,resources:x},requester:{publicKey:D,metadata:this.client.metadata},expiryTimestamp:xn(M)},H={eip155:{chains:a,methods:[...new Set(["personal_sign",...b])],events:["chainChanged","accountsChanged"]}},U={requiredNamespaces:{},optionalNamespaces:H,relays:[{protocol:"irn"}],pairingTopic:k,proposer:{publicKey:D,metadata:this.client.metadata},expiryTimestamp:xn(ai.wc_sessionPropose.req.ttl),id:ua()},{done:G,resolve:N,reject:A}=Gu(M,"Request expired"),v=ua(),p=Pr("session_connect",U.id),m=Pr("session_request",v),y=async({error:_,session:E})=>{this.events.off(m,T),_?A(_):E&&N({session:E})},T=async _=>{var E,C,S;if(await this.deletePendingAuthRequest(v,{message:"fulfilled",code:0}),_.error){const Z=nn("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return _.error.code===Z.code?void 0:(this.events.off(p,y),A(_.error.message))}await this.deleteProposal(U.id),this.events.off(p,y);const{cacaos:B,responder:$}=_.result,P=[],q=[];for(const Z of B){await cC({cacao:Z,projectId:this.client.core.projectId})||(this.client.logger.error(Z,"Signature verification failed"),A(nn("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:ie}=Z,ce=Im(ie.resources),se=[c6(ie.iss)],_e=kb(ie.iss);if(ce){const ye=lC(ce),Te=uC(ce);P.push(...ye),se.push(...Te)}for(const ye of se)q.push(`${ye}:${_e}`)}const V=await this.client.core.crypto.generateSharedKey(D,$.publicKey);let X;P.length>0&&(X={topic:V,acknowledged:!0,self:{publicKey:D,metadata:this.client.metadata},peer:$,controller:$.publicKey,expiry:xn(vd),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:k,namespaces:BC([...new Set(P)],[...new Set(q)]),transportType:o},await this.client.core.relayer.subscribe(V,{transportType:o}),await this.client.session.set(V,X),k&&await this.client.core.pairing.updateMetadata({topic:k,metadata:$.metadata}),X=this.client.session.get(V)),(E=this.client.metadata.redirect)!=null&&E.linkMode&&(C=$.metadata.redirect)!=null&&C.linkMode&&(S=$.metadata.redirect)!=null&&S.universal&&n&&(this.client.core.addLinkModeSupportedApp($.metadata.redirect.universal),this.client.session.update(V,{transportType:en.link_mode})),N({auths:B,session:X})};this.events.once(p,y),this.events.once(m,T);let I;try{if(s){const _=Mo("wc_sessionAuthenticate",F,v);this.client.core.history.set(k,_);const E=await this.client.core.crypto.encode("",_,{type:tg,encoding:Dl});I=Vg(n,k,E)}else await Promise.all([this.sendRequest({topic:k,method:"wc_sessionAuthenticate",params:F,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:v}),this.sendRequest({topic:k,method:"wc_sessionPropose",params:U,expiry:ai.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:U.id})])}catch(_){throw this.events.off(p,y),this.events.off(m,T),_}return await this.setProposal(U.id,U),await this.setAuthRequest(v,{request:ci(Sr({},F),{verifyContext:{}}),pairingTopic:k,transportType:o}),{uri:I??R,response:G}}),me(this,"approveSessionAuthenticate",async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[$u.authenticated_session_approve_started]}});try{this.isInitialized()}catch(w){throw s.setError(w0.no_internet_connection),w}const o=this.getPendingAuthRequest(n);if(!o)throw s.setError(w0.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const a=o.transportType||en.relay;a===en.relay&&await this.confirmOnlineStateOrThrow();const c=o.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=xm(c),f={type:$c,receiverPublicKey:c,senderPublicKey:l},d=[],h=[];for(const w of i){if(!await cC({cacao:w,projectId:this.client.core.projectId})){s.setError(w0.invalid_cacao);const O=nn("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:O,encodeOpts:f}),new Error(O.message)}s.addTrace($u.cacaos_verified);const{p:x}=w,k=Im(x.resources),R=[c6(x.iss)],D=kb(x.iss);if(k){const O=lC(k),M=uC(k);d.push(...O),R.push(...M)}for(const O of R)h.push(`${O}:${D}`)}const g=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace($u.create_authenticated_session_topic);let b;if((d==null?void 0:d.length)>0){b={topic:g,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:o.requester.metadata},controller:c,expiry:xn(vd),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:BC([...new Set(d)],[...new Set(h)]),transportType:a},s.addTrace($u.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(g,{transportType:a})}catch(w){throw s.setError(w0.subscribe_authenticated_session_topic_failure),w}s.addTrace($u.subscribe_authenticated_session_topic_success),await this.client.session.set(g,b),s.addTrace($u.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}s.addTrace($u.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,a)})}catch(w){throw s.setError(w0.authenticated_session_approve_publish_failure),w}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:b}}),me(this,"rejectSessionAuthenticate",async r=>{this.isInitialized();const{id:n,reason:i}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===en.relay&&await this.confirmOnlineStateOrThrow();const o=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=xm(o),l={type:$c,receiverPublicKey:o,senderPublicKey:a};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:ai.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.deleteProposal(n)}),me(this,"formatAuthMessage",r=>{this.isInitialized();const{request:n,iss:i}=r;return ok(n,i)}),me(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)}),me(this,"cleanupDuplicatePairings",async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(s=>{var o,a;return((o=s.peerMetadata)==null?void 0:o.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}}),me(this,"deleteSession",async r=>{var n;const{topic:i,expirerHasDeleted:s=!1,emitEvent:o=!0,id:a=0}=r,{self:c}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,nn("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),s||this.client.core.expirer.del(i),this.client.core.storage.removeItem(vS).catch(l=>this.client.logger.warn(l)),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=sa.idle),await Promise.all(this.getPendingSessionRequests().filter(l=>l.topic===i).map(l=>this.deletePendingSessionRequest(l.id,nn("USER_DISCONNECTED")))),o&&this.client.events.emit("session_delete",{id:a,topic:i})}),me(this,"deleteProposal",async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:i.pairingTopic});s==null||s.setError(Fu.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,nn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")}),me(this,"deletePendingSessionRequest",async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=sa.idle,this.client.events.emit("session_request_expire",{id:r}))}),me(this,"deletePendingAuthRequest",async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])}),me(this,"setExpiry",async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))}),me(this,"setProposal",async(r,n)=>{this.client.core.expirer.set(r,xn(ai.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)}),me(this,"setAuthRequest",async(r,n)=>{const{request:i,pairingTopic:s,transportType:o=en.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:s,verifyContext:i.verifyContext,transportType:o})}),me(this,"setPendingSessionRequest",async r=>{const{id:n,topic:i,params:s,verifyContext:o}=r,a=s.request.expiryTimestamp||xn(ai.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:o})}),me(this,"sendRequest",async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:f,publishOpts:d={}}=r,h=Mo(i,s,c);let g;const b=!!u;try{const k=b?Dl:as;g=await this.client.core.crypto.encode(n,h,{encoding:k})}catch(k){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),k}let w;if(Ghe.includes(i)){const k=eo(JSON.stringify(h)),R=eo(g);w=await this.client.core.verify.register({id:R,decryptedId:k})}const x=Sr(Sr({},ai[i].req),d);if(x.attestation=w,o&&(x.ttl=o),a&&(x.id=a),this.client.core.history.set(n,h),b){const k=Vg(u,n,g);await global.Linking.openURL(k,this.client.name)}else x.tvf=ci(Sr({},f),{correlationId:h.id}),l?(x.internal=ci(Sr({},x.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,g,x)):this.client.core.relayer.publish(n,g,x).catch(k=>this.client.logger.error(k));return h.id}),me(this,"sendProposeSession",async r=>{const{proposal:n,publishOpts:i}=r,s=Mo("wc_sessionPropose",n,n.id);this.client.core.history.set(n.pairingTopic,s);const o=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:as}),a=eo(JSON.stringify(s)),c=eo(o),l=await this.client.core.verify.register({id:c,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:n.pairingTopic,sessionProposal:o},opts:ci(Sr({},i),{publishMethod:"wc_proposeSession",attestation:l})})}),me(this,"sendApproveSession",async r=>{const{sessionTopic:n,pairingProposalResponse:i,proposal:s,sessionSettleRequest:o,publishOpts:a}=r,c=a1(s.id,i),l=await this.client.core.crypto.encode(s.pairingTopic,c,{encoding:as}),u=Mo("wc_sessionSettle",o,a==null?void 0:a.id),f=await this.client.core.crypto.encode(n,u,{encoding:as});this.client.core.history.set(n,u),await this.client.core.relayer.publishCustom({payload:{sessionTopic:n,pairingTopic:s.pairingTopic,sessionProposalResponse:l,sessionSettlementRequest:f},opts:ci(Sr({},a),{publishMethod:"wc_approveSession"})})}),me(this,"sendResult",async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a,appLink:c}=r,l=a1(n,s);let u;const f=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?Dl:as;u=await this.client.core.crypto.encode(i,l,ci(Sr({},a||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let d,h;try{d=await this.client.core.history.get(i,n);const g=d.request;try{h=this.getTVFParams(n,g.params,s)}catch(b){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${b==null?void 0:b.message}`)}}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(f){const g=Vg(c,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=d.request.method,b=ai[g].res;b.tvf=ci(Sr({},h),{correlationId:n}),o?(b.internal=ci(Sr({},b.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,b)):this.client.core.relayer.publish(i,u,b).catch(w=>this.client.logger.error(w))}await this.client.core.history.resolve(l)}),me(this,"sendError",async r=>{const{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a,appLink:c}=r,l=Xy(n,s);let u;const f=c&&typeof(global==null?void 0:global.Linking)<"u";try{const h=f?Dl:as;u=await this.client.core.crypto.encode(i,l,ci(Sr({},o||{}),{encoding:h}))}catch(h){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),h}let d;try{d=await this.client.core.history.get(i,n)}catch(h){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),h}if(f){const h=Vg(c,i,u);await global.Linking.openURL(h,this.client.name)}else{const h=d.request.method,g=a||ai[h].res;this.client.core.relayer.publish(i,u,g)}await this.client.core.history.resolve(l)}),me(this,"cleanup",async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;ma(i.expiry)&&(s=!0),this.client.core.crypto.keychain.has(i.topic)||(s=!0),s&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{ma(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])}),me(this,"onProviderMessageEvent",async r=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(r):await this.onRelayMessage(r)}),me(this,"onRelayEventRequest",async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()}),me(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===sa.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=sa.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=sa.idle}),me(this,"processRequest",async r=>{const{topic:n,payload:i,attestation:s,transportType:o,encryptedId:a}=r,c=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:a,transportType:o});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),me(this,"onRelayEventResponse",async r=>{const{topic:n,payload:i,transportType:s}=r,o=(await this.client.core.history.get(n,i.id)).request.method;switch(o){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${o}`)}}),me(this,"onRelayEventUnknownPayload",r=>{const{topic:n}=r,{message:i}=Se("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)}),me(this,"shouldIgnorePairingRequest",r=>{const{topic:n,requestMethod:i}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(i)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),me(this,"onSessionProposeRequest",async r=>{const{topic:n,payload:i,attestation:s,encryptedId:o}=r,{params:a,id:c}=i;try{const l=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l==null||l.setError(yc.proposal_listener_not_found)),this.isValidConnect(Sr({},i.params));const u=a.expiryTimestamp||xn(ai.wc_sessionPropose.req.ttl),f=Sr({id:c,pairingTopic:n,expiryTimestamp:u,attestation:s,encryptedId:o},a);await this.setProposal(c,f);const d=await this.getVerifyContext({attestationId:s,hash:eo(JSON.stringify(i)),encryptedId:o,metadata:f.proposer.metadata});l==null||l.addTrace(oa.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:f,verifyContext:d})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:ai.wc_sessionPropose.autoReject}),this.client.logger.error(l)}}),me(this,"onSessionProposeResponse",async(r,n,i)=>{const{id:s}=n;if(fa(n)){const{result:o}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:o});const a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=o.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const u=await this.client.core.crypto.generateSharedKey(c,l);this.pendingSessions.set(s,{sessionTopic:u,pairingTopic:r,proposalId:s,publicKey:c});const f=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else if(to(n)){await this.deleteProposal(s);const o=Pr("session_connect",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners, 954`);this.events.emit(o,{error:n.error})}}),me(this,"onSessionSettleRequest",async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:f,sessionConfig:d,proposalRequestsResponses:h}=n.params,g=[...this.pendingSessions.values()].find(x=>x.sessionTopic===r);if(!g)return this.client.logger.error(`Pending session not found for topic ${r}`);const b=this.client.proposal.get(g.proposalId),w=ci(Sr(Sr(Sr({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:g.pairingTopic,requiredNamespaces:b.requiredNamespaces,optionalNamespaces:b.optionalNamespaces,controller:a.publicKey,self:{publicKey:g.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},u&&{sessionProperties:u}),f&&{scopedProperties:f}),d&&{sessionConfig:d}),{transportType:en.relay,authentication:h==null?void 0:h.authentication,walletPayResult:h==null?void 0:h.walletPay});await this.client.session.set(w.topic,w),await this.setExpiry(w.topic,w.expiry),await this.client.core.pairing.updateMetadata({topic:g.pairingTopic,metadata:w.peer.metadata}),this.pendingSessions.delete(g.proposalId),this.deleteProposal(g.proposalId,!1),this.cleanupDuplicatePairings(w),await this.sendResult({id:n.id,topic:r,throwOnFailedPublish:!0,result:!0}),this.client.events.emit("session_connect",{session:w}),this.events.emit(Pr("session_connect",g.proposalId),{session:w})}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}}),me(this,"onSessionSettleResponse",async(r,n)=>{const{id:i}=n;fa(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Pr("session_approve",i),{})):to(n)&&(await this.client.session.delete(r,nn("USER_DISCONNECTED")),this.events.emit(Pr("session_approve",i),{error:n.error}))}),me(this,"onSessionUpdateRequest",async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=y0.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:nn("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(Sr({topic:r},i));try{y0.set(o,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0})}catch(c){throw y0.delete(o),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(o){await this.sendError({id:s,topic:r,error:o}),this.client.logger.error(o)}}),me(this,"isRequestOutOfSync",(r,n)=>n.toString().slice(0,-3)<r.toString().slice(0,-3)),me(this,"onSessionUpdateResponse",(r,n)=>{const{id:i}=n,s=Pr("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);fa(n)?this.events.emit(Pr("session_update",i),{}):to(n)&&this.events.emit(Pr("session_update",i),{error:n.error})}),me(this,"onSessionExtendRequest",async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,xn(vd)),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}}),me(this,"onSessionExtendResponse",(r,n)=>{const{id:i}=n,s=Pr("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);fa(n)?this.events.emit(Pr("session_extend",i),{}):to(n)&&this.events.emit(Pr("session_extend",i),{error:n.error})}),me(this,"onSessionPingRequest",async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}}),me(this,"onSessionPingResponse",(r,n)=>{const{id:i}=n,s=Pr("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);fa(n)?this.events.emit(Pr("session_ping",i),{}):to(n)&&this.events.emit(Pr("session_ping",i),{error:n.error})},500)}),me(this,"onSessionDeleteRequest",async(r,n)=>{const{id:i}=n;try{await this.isValidDisconnect({topic:r,reason:n.params}),this.cleanupPendingSentRequestsForTopic({topic:r,error:nn("USER_DISCONNECTED")}),await this.deleteSession({topic:r,id:i})}catch(s){this.client.logger.error(s)}}),me(this,"onSessionRequest",async r=>{var n,i,s;const{topic:o,payload:a,attestation:c,encryptedId:l,transportType:u}=r,{id:f,params:d}=a;try{await this.isValidRequest(Sr({topic:o},d));const h=this.client.session.get(o),g=await this.getVerifyContext({attestationId:c,hash:eo(JSON.stringify(Mo("wc_sessionRequest",d,f))),encryptedId:l,metadata:h.peer.metadata,transportType:u}),b={id:f,topic:o,params:d,verifyContext:g};await this.setPendingSessionRequest(b),u===en.link_mode&&(n=h.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=h.peer.metadata.redirect)==null?void 0:i.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(b):(this.addSessionRequestToSessionRequestQueue(b),this.processSessionRequestQueue())}catch(h){await this.sendError({id:f,topic:o,error:h}),this.client.logger.error(h)}}),me(this,"onSessionRequestResponse",(r,n)=>{const{id:i}=n,s=Pr("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);fa(n)?this.events.emit(Pr("session_request",i),{result:n.result}):to(n)&&this.events.emit(Pr("session_request",i),{error:n.error})}),me(this,"onSessionEventRequest",async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=y0.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(Sr({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),y0.set(o,i)}catch(o){await this.sendError({id:i,topic:r,error:o}),this.client.logger.error(o)}}),me(this,"onSessionAuthenticateResponse",(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),fa(n)?this.events.emit(Pr("session_request",i),{result:n.result}):to(n)&&this.events.emit(Pr("session_request",i),{error:n.error})}),me(this,"onSessionAuthenticateRequest",async r=>{var n;const{topic:i,payload:s,attestation:o,encryptedId:a,transportType:c}=r;try{const{requester:l,authPayload:u,expiryTimestamp:f}=s.params,d=await this.getVerifyContext({attestationId:o,hash:eo(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),h={requester:l,pairingTopic:i,id:s.id,authPayload:u,verifyContext:d,expiryTimestamp:f};await this.setAuthRequest(s.id,{request:h,pairingTopic:i,transportType:c}),c===en.link_mode&&(n=l.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:s.params,id:s.id,verifyContext:d})}catch(l){this.client.logger.error(l);const u=s.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),d=this.getAppLinkIfEnabled(s.params.requester.metadata,c),h={type:$c,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:s.id,topic:i,error:l,encodeOpts:h,rpcOpts:ai.wc_sessionAuthenticate.autoReject,appLink:d})}}),me(this,"addSessionRequestToSessionRequestQueue",r=>{this.sessionRequestQueue.queue.push(r)}),me(this,"cleanupAfterResponse",r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=sa.idle,this.processSessionRequestQueue()},we.toMiliseconds(this.requestQueueDelay))}),me(this,"cleanupPendingSentRequestsForTopic",({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{this.events.emit(Pr("session_request",s.request.id),{error:n})})}),me(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===sa.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}}),me(this,"emitSessionRequest",r=>{if(this.emittedSessionRequests.has(r.id)){this.client.logger.warn({id:r.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${r.id}`);return}this.sessionRequestQueue.state=sa.active,this.emittedSessionRequests.add(r.id),this.client.events.emit("session_request",r)}),me(this,"onPairingCreated",r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Mo("wc_sessionPropose",ci(Sr({},n),{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties,scopedProperties:n.scopedProperties}),n.id),attestation:n.attestation,encryptedId:n.encryptedId})}),me(this,"isValidConnect",async r=>{if(!ts(r)){const{message:l}=Se("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,scopedProperties:a,relays:c}=r;if(zn(n)||await this.isValidPairingTopic(n),!ule(c,!0)){const{message:l}=Se("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(i&&!zn(i)&&Da(i)!==0){const l="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(l):this.client.logger.warn(l),this.validateNamespaces(i,"requiredNamespaces")}if(s&&!zn(s)&&Da(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),o&&!zn(o)&&this.validateSessionProps(o,"sessionProperties"),a&&!zn(a)){this.validateSessionProps(a,"scopedProperties");const l=Object.keys(i||{}).concat(Object.keys(s||{}));if(!Object.keys(a).every(u=>l.includes(u.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(l)}`)}}),me(this,"validateNamespaces",(r,n)=>{const i=lle(r,"connect()",n);if(i)throw new Error(i.message)}),me(this,"isValidApprove",async r=>{if(!ts(r))throw new Error(Se("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o,scopedProperties:a}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const c=this.client.proposal.get(n),l=tw(i,"approve()");if(l)throw new Error(l.message);const u=LC(c.requiredNamespaces,i,"approve()");if(u)throw new Error(u.message);if(!Pn(s,!0)){const{message:f}=Se("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(f)}if(o&&!zn(o)&&this.validateSessionProps(o,"sessionProperties"),a&&!zn(a)){this.validateSessionProps(a,"scopedProperties");const f=new Set(Object.keys(i));if(!Object.keys(a).every(d=>f.has(d.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(f).join(", ")}`)}}),me(this,"isValidReject",async r=>{if(!ts(r)){const{message:s}=Se("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!dle(i)){const{message:s}=Se("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}}),me(this,"isValidSessionSettleRequest",r=>{if(!ts(r)){const{message:l}=Se("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!Jk(n)){const{message:l}=Se("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=nle(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=tw(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(ma(o)){const{message:l}=Se("EXPIRED","onSessionSettleRequest()");throw new Error(l)}}),me(this,"isValidUpdate",async r=>{if(!ts(r)){const{message:c}=Se("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=tw(i,"update()");if(o)throw new Error(o.message);const a=LC(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)}),me(this,"isValidExtend",async r=>{if(!ts(r)){const{message:i}=Se("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)}),me(this,"isValidRequest",async r=>{if(!ts(r)){const{message:c}=Se("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!$C(a,s)){const{message:c}=Se("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!hle(i)){const{message:c}=Se("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!mle(a,s,i.method)){const{message:c}=Se("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}this.validateRequestExpiry(o)}),me(this,"isValidRespond",async r=>{var n;if(!ts(r)){const{message:a}=Se("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(a){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),a}if(!ple(s)){const{message:a}=Se("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(a)}const o=this.client.pendingRequest.get(s.id);if(o.topic!==i){const{message:a}=Se("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${s.id}, expected topic: ${o.topic}, received topic: ${i}`);throw new Error(a)}}),me(this,"isValidPing",async r=>{if(!ts(r)){const{message:i}=Se("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}),me(this,"isValidEmit",async r=>{if(!ts(r)){const{message:a}=Se("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!$C(o,s)){const{message:a}=Se("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!gle(i)){const{message:a}=Se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!ble(o,s,i.name)){const{message:a}=Se("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}}),me(this,"isValidDisconnect",async r=>{if(!ts(r)){const{message:i}=Se("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}),me(this,"isValidAuthenticate",r=>{const{chains:n,uri:i,domain:s,nonce:o}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!Pn(i,!1))throw new Error("uri is required parameter");if(!Pn(s,!1))throw new Error("domain is required parameter");if(!Pn(o,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>Fc(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:a}=Fc(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),me(this,"getVerifyContext",async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:o,transportType:a}=r,c={verified:{verifyUrl:o.verifyUrl||Y0,validation:"UNKNOWN",origin:o.url||""}};try{if(a===en.link_mode){const u=this.getAppLinkIfEnabled(o,a);return c.verified.validation=u&&new URL(u).origin===new URL(o.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:o.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(o.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),me(this,"validateSessionProps",(r,n)=>{Object.values(r).forEach((i,s)=>{if(i==null){const{message:o}=Se("MISSING_OR_INVALID",`${n} must contain an existing value for each key. Received: ${i} for key ${Object.keys(r)[s]}`);throw new Error(o)}})}),me(this,"getPendingAuthRequest",r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0}),me(this,"addToRecentlyDeleted",(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const s=this.recentlyDeletedLimit/2;for(const o of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(o)}}}),me(this,"checkRecentlyDeleted",r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=Se("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}}),me(this,"isLinkModeEnabled",(r,n)=>{var i,s,o,a,c,l,u,f,d;return!r||n!==en.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((a=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==void 0&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==""&&((d=r==null?void 0:r.redirect)==null?void 0:d.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"}),me(this,"getAppLinkIfEnabled",(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0}),me(this,"handleLinkModeMessage",({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=X_(r,"topic")||"",i=decodeURIComponent(X_(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:en.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})}),me(this,"registerLinkModeListeners",async()=>{var r;if(vE()||gu()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}),me(this,"getTVFApproveParams",r=>{try{const n=jk(r.namespaces),i=Gce(r.namespaces),s=Vce(r.namespaces),o=r.sessionProperties,a=r.scopedProperties;return{approvedChains:n,approvedMethods:i,approvedEvents:s,sessionProperties:o,scopedProperties:a}}catch(n){return this.client.logger.warn(n,"Error getting TVF approve params"),{}}}),me(this,"getTVFParams",(r,n,i)=>{var s,o,a;if(!((s=n.request)!=null&&s.method))return{};const c={correlationId:r,rpcMethods:[n.request.method],chainId:n.chainId};try{const l=this.extractTxHashesFromResult(n.request,i);c.txHashes=l,c.contractAddresses=this.isValidContractData(n.request.params)?[(a=(o=n.request.params)==null?void 0:o[0])==null?void 0:a.to]:[]}catch(l){this.client.logger.warn(l,"Error getting TVF params")}return c}),me(this,"isValidContractData",r=>{var n;if(!r)return!1;try{const i=(r==null?void 0:r.data)||((n=r==null?void 0:r[0])==null?void 0:n.data);if(!i.startsWith("0x"))return!1;const s=i.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),me(this,"extractTxHashesFromResult",(r,n)=>{var i;try{if(!n)return[];const s=r.method,o=Jhe[s];if(s==="sui_signTransaction")return[Moe(n.transactionBytes)];if(s==="near_signTransaction")return[iC(n)];if(s==="near_signTransactions")return n.map(c=>iC(c));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(i=n.tx_json)==null?void 0:i.hash];if(s==="polkadot_signTransaction")return[Dle({transaction:r.params.transactionPayload,signature:n.signature})];if(s==="algo_signTxn")return Lc(n)?n.map(c=>sC(c)):[sC(n)];if(s==="cosmos_signDirect")return[Boe(n)];if(s==="wallet_sendCalls")return Foe(n);if(typeof n=="string")return[n];const a=n[o.key];if(Lc(a))return s==="solana_signAllTransactions"?a.map(c=>Ooe(c)):a;if(typeof a=="string")return[a]}catch(s){this.client.logger.warn(s,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{const e=this.client.session.keys,r=this.client.core.relayer.messages.getWithoutAck(e);for(const[n,i]of Object.entries(r))for(const s of i)try{await this.onProviderMessageEvent({topic:n,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${n}, message: ${s}`)}}catch(e){this.client.logger.warn(e,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){const{message:e}=Se("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Cn.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(Pm)?this.client.auth.authKeys.get(Pm):{responseTopic:void 0,publicKey:void 0};try{const a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:o,encoding:s===en.link_mode?Dl:as});kE(a)?(this.client.core.history.set(r,a),await this.onRelayEventRequest({topic:r,payload:a,attestation:i,transportType:s,encryptedId:eo(n)})):Zy(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(a)}`),await this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})),await this.client.core.relayer.messages.ack(r,n)}catch(a){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${n}`),this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(Ys.expired,async e=>{const{topic:r,id:n}=zP(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Se("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,Se("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Ku.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Ku.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!Pn(e,!1)){const{message:r}=Se("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=Se("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(ma(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Se("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Pn(e,!1)){const{message:r}=Se("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=Se("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(ma(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Se("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Se("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Pn(e,!1)){const{message:r}=Se("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Se("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!fle(e)){const{message:r}=Se("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Se("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(ma(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Se("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}validateRequestExpiry(e){if(e&&!wle(e,aw)){const{message:r}=Se("MISSING_OR_INVALID",`request() expiry: ${e}. Expiry must be a number (in seconds) between ${aw.min} and ${aw.max}`);throw new Error(r)}}}class i0e extends Qf{constructor(e,r){super(e,r,Hhe,ME),this.core=e,this.logger=r}}let s0e=class extends Qf{constructor(e,r){super(e,r,jhe,ME),this.core=e,this.logger=r}};class o0e extends Qf{constructor(e,r){super(e,r,qhe,ME,n=>n.id),this.core=e,this.logger=r}}class a0e extends Qf{constructor(e,r){super(e,r,Khe,Qy,()=>Pm),this.core=e,this.logger=r}}class c0e extends Qf{constructor(e,r){super(e,r,Xhe,Qy),this.core=e,this.logger=r}}class l0e extends Qf{constructor(e,r){super(e,r,Zhe,Qy,n=>n.id),this.core=e,this.logger=r}}var u0e=Object.defineProperty,f0e=(t,e,r)=>e in t?u0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cw=(t,e,r)=>f0e(t,typeof e!="symbol"?e+"":e,r);class d0e{constructor(e,r){this.core=e,this.logger=r,cw(this,"authKeys"),cw(this,"pairingTopics"),cw(this,"requests"),this.authKeys=new a0e(this.core,this.logger),this.pairingTopics=new c0e(this.core,this.logger),this.requests=new l0e(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var h0e=Object.defineProperty,p0e=(t,e,r)=>e in t?h0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Xt=(t,e,r)=>p0e(t,typeof e!="symbol"?e+"":e,r);class DE extends QZ{constructor(e){super(e),Xt(this,"protocol",pO),Xt(this,"version",gO),Xt(this,"name",ow.name),Xt(this,"metadata"),Xt(this,"core"),Xt(this,"logger"),Xt(this,"events",new po.EventEmitter),Xt(this,"engine"),Xt(this,"session"),Xt(this,"proposal"),Xt(this,"pendingRequest"),Xt(this,"auth"),Xt(this,"signConfig"),Xt(this,"on",(n,i)=>this.events.on(n,i)),Xt(this,"once",(n,i)=>this.events.once(n,i)),Xt(this,"off",(n,i)=>this.events.off(n,i)),Xt(this,"removeListener",(n,i)=>this.events.removeListener(n,i)),Xt(this,"removeAllListeners",n=>this.events.removeAllListeners(n)),Xt(this,"connect",async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"pair",async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"approve",async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"reject",async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"update",async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"extend",async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"request",async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"respond",async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"ping",async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"emit",async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"disconnect",async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"find",n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}}),Xt(this,"authenticate",async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}}),Xt(this,"formatAuthMessage",n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"approveSessionAuthenticate",async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}}),Xt(this,"rejectSessionAuthenticate",async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}}),this.name=(e==null?void 0:e.name)||ow.name,this.metadata=Tse(e==null?void 0:e.metadata),this.signConfig=e==null?void 0:e.signConfig;const r=RE({logger:(e==null?void 0:e.logger)||ow.logger,name:this.name});this.logger=r,this.core=(e==null?void 0:e.core)||new Uhe(e),this.session=new s0e(this.core,this.logger),this.proposal=new i0e(this.core,this.logger),this.pendingRequest=new o0e(this.core,this.logger),this.engine=new n0e(this),this.auth=new d0e(this.core,this.logger)}static async init(e){const r=new DE(e);return await r.initialize(),r}get context(){return ys(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}const g0e=DE;var P6={exports:{}};(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof ro<"u"&&ro,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a=typeof s<"u"&&s||typeof self<"u"&&self||typeof ro<"u"&&ro||{},c={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function l(m){return m&&DataView.prototype.isPrototypeOf(m)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
82]"],f=ArrayBuffer.isView||function(m){return m&&u.indexOf(Object.prototype.toString.call(m))>-1};function d(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(m)||m==="")throw new TypeError('Invalid character in header field name: "'+m+'"');return m.toLowerCase()}function h(m){return typeof m!="string"&&(m=String(m)),m}function g(m){var y={next:function(){var T=m.shift();return{done:T===void 0,value:T}}};return c.iterable&&(y[Symbol.iterator]=function(){return y}),y}function b(m){this.map={},m instanceof b?m.forEach(function(y,T){this.append(T,y)},this):Array.isArray(m)?m.forEach(function(y){if(y.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+y.length);this.append(y[0],y[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(y){this.append(y,m[y])},this)}b.prototype.append=function(m,y){m=d(m),y=h(y);var T=this.map[m];this.map[m]=T?T+", "+y:y},b.prototype.delete=function(m){delete this.map[d(m)]},b.prototype.get=function(m){return m=d(m),this.has(m)?this.map[m]:null},b.prototype.has=function(m){return this.map.hasOwnProperty(d(m))},b.prototype.set=function(m,y){this.map[d(m)]=h(y)},b.prototype.forEach=function(m,y){for(var T in this.map)this.map.hasOwnProperty(T)&&m.call(y,this.map[T],T,this)},b.prototype.keys=function(){var m=[];return this.forEach(function(y,T){m.push(T)}),g(m)},b.prototype.values=function(){var m=[];return this.forEach(function(y){m.push(y)}),g(m)},b.prototype.entries=function(){var m=[];return this.forEach(function(y,T){m.push([T,y])}),g(m)},c.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function w(m){if(!m._noBody){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}}function x(m){return new Promise(function(y,T){m.onload=function(){y(m.result)},m.onerror=function(){T(m.error)}})}function k(m){var y=new FileReader,T=x(y);return y.readAsArrayBuffer(m),T}function R(m){var y=new FileReader,T=x(y),I=/charset=([A-Za-z0-9_-]+)/.exec(m.type),_=I?I[1]:"utf-8";return y.readAsText(m,_),T}function D(m){for(var y=new Uint8Array(m),T=new Array(y.length),I=0;I<y.length;I++)T[I]=String.fromCharCode(y[I]);return T.join("")}function O(m){if(m.slice)return m.slice(0);var y=new Uint8Array(m.byteLength);return y.set(new Uint8Array(m)),y.buffer}function M(){return this.bodyUsed=!1,this._initBody=function(m){this.bodyUsed=this.bodyUsed,this._bodyInit=m,m?typeof m=="string"?this._bodyText=m:c.blob&&Blob.prototype.isPrototypeOf(m)?this._bodyBlob=m:c.formData&&FormData.prototype.isPrototypeOf(m)?this._bodyFormData=m:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)?this._bodyText=m.toString():c.arrayBuffer&&c.blob&&l(m)?(this._bodyArrayBuffer=O(m.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(m)||f(m))?this._bodyArrayBuffer=O(m):this._bodyText=m=Object.prototype.toString.call(m):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof m=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var m=w(this);if(m)return m;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var m=w(this);return m||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(c.blob)return this.blob().then(k);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var m=w(this);if(m)return m;if(this._bodyBlob)return R(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(D(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(G)}),this.json=function(){return this.text().then(JSON.parse)},this}var F=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function H(m){var y=m.toUpperCase();return F.indexOf(y)>-1?y:m}function U(m,y){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object c
82onstructor cannot be called as a function.');y=y||{};var T=y.body;if(m instanceof U){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,y.headers||(this.headers=new b(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!T&&m._bodyInit!=null&&(T=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=y.credentials||this.credentials||"same-origin",(y.headers||!this.headers)&&(this.headers=new b(y.headers)),this.method=H(y.method||this.method||"GET"),this.mode=y.mode||this.mode||null,this.signal=y.signal||this.signal||function(){if("AbortController"in a){var E=new AbortController;return E.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&T)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(T),(this.method==="GET"||this.method==="HEAD")&&(y.cache==="no-store"||y.cache==="no-cache")){var I=/([?&])_=[^&]*/;if(I.test(this.url))this.url=this.url.replace(I,"$1_="+new Date().getTime());else{var _=/\?/;this.url+=(_.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function G(m){var y=new FormData;return m.trim().split("&").forEach(function(T){if(T){var I=T.split("="),_=I.shift().replace(/\+/g," "),E=I.join("=").replace(/\+/g," ");y.append(decodeURIComponent(_),decodeURIComponent(E))}}),y}function N(m){var y=new b,T=m.replace(/\r?\n[\t ]+/g," ");return T.split("\r").map(function(I){return I.indexOf(` 83`)===0?I.substr(1,I.length):I}).forEach(function(I){var _=I.split(":"),E=_.shift().trim();if(E){var C=_.join(":").trim();try{y.append(E,C)}catch(S){console.warn("Response "+S.message)}}}),y}M.call(U.prototype);function A(m,y){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(y||(y={}),this.type="default",this.status=y.status===void 0?200:y.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=y.statusText===void 0?"":""+y.statusText,this.headers=new b(y.headers),this.url=y.url||"",this._initBody(m)}M.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},A.error=function(){var m=new A(null,{status:200,statusText:""});return m.ok=!1,m.status=0,m.type="error",m};var v=[301,302,303,307,308];A.redirect=function(m,y){if(v.indexOf(y)===-1)throw new RangeError("Invalid status code");return new A(null,{status:y,headers:{location:m}})},o.DOMException=a.DOMException;try{new o.DOMException}catch{o.DOMException=function(y,T){this.message=y,this.name=T;var I=Error(y);this.stack=I.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function p(m,y){return new Promise(function(T,I){var _=new U(m,y);if(_.signal&&_.signal.aborted)return I(new o.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function C(){E.abort()}E.onload=function(){var $={statusText:E.statusText,headers:N(E.getAllResponseHeaders()||"")};_.url.indexOf("file://")===0&&(E.status<200||E.status>599)?$.status=200:$.status=E.status,$.url="responseURL"in E?E.responseURL:$.headers.get("X-Request-URL");var P="response"in E?E.response:E.responseText;setTimeout(function(){T(new A(P,$))},0)},E.onerror=function(){setTimeout(function(){I(new TypeError("Network request failed"))},0)},E.ontimeout=function(){setTimeout(function(){I(new TypeError("Network request timed out"))},0)},E.onabort=function(){setTimeout(function(){I(new o.DOMException("Aborted","AbortError"))},0)};function S($){try{return $===""&&a.location.href?a.location.href:$}catch{return $}}if(E.open(_.method,S(_.url),!0),_.credentials==="include"?E.withCredentials=!0:_.credentials==="omit"&&(E.withCredentials=!1),"responseType"in E&&(c.blob?E.responseType="blob":c.arrayBuffer&&(E.responseType="arraybuffer")),y&&typeof y.headers=="object"&&!(y.headers instanceof b||a.Headers&&y.headers instanceof a.Headers)){var B=[];
vendor: 4,551 bytes, line 83
83Object.getOwnPropertyNames(y.headers).forEach(function($){B.push(d($)),E.setRequestHeader($,h(y.headers[$]))}),_.headers.forEach(function($,P){B.indexOf(P)===-1&&E.setRequestHeader(P,$)})}else _.headers.forEach(function($,P){E.setRequestHeader(P,$)});_.signal&&(_.signal.addEventListener("abort",C),E.onreadystatechange=function(){E.readyState===4&&_.signal.removeEventListener("abort",C)}),E.send(typeof _._bodyInit>"u"?null:_._bodyInit)})}return p.polyfill=!0,a.fetch||(a.fetch=p,a.Headers=b,a.Request=U,a.Response=A),o.Headers=b,o.Request=U,o.Response=A,o.fetch=p,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(P6,P6.exports);var m0e=P6.exports;const AS=zf(m0e);var b0e=Object.defineProperty,y0e=Object.defineProperties,v0e=Object.getOwnPropertyDescriptors,_S=Object.getOwnPropertySymbols,w0e=Object.prototype.hasOwnProperty,E0e=Object.prototype.propertyIsEnumerable,CS=(t,e,r)=>e in t?b0e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,SS=(t,e)=>{for(var r in e||(e={}))w0e.call(e,r)&&CS(t,r,e[r]);if(_S)for(var r of _S(e))E0e.call(e,r)&&CS(t,r,e[r]);return t},TS=(t,e)=>y0e(t,v0e(e));const A0e={Accept:"application/json","Content-Type":"application/json"},_0e="POST",NS={headers:A0e,method:_0e},IS=10;let bO=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new po.EventEmitter,this.isAvailable=!1,this.registering=!1,!qC(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Bf(e),n=await(await AS(this.url,TS(SS({},NS),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!qC(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),i(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Bf({id:1,jsonrpc:"2.0",method:"test",params:[]});await AS(e,TS(SS({},NS),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?Df(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=Xy(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return Vk(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>IS&&this.events.setMaxListeners(IS)}};function C0e(t){return Number.isSafeInteger(t)&&t>=0}function S0e(t){return t!=null&&typeof t!="function"&&C0e(t.length)}function T0e(t){return t==="__proto__"}function BE(t){return t==null||typeof t!="object"&&typeof t!="function"}function yO(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function FE(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const N0e="[object RegExp]",vO="[object String]",wO="[object Number]",EO="[object Boolean]",AO="[object Arguments]",I0e="[object Symbol]",x0e="[object Date]",R0e="[object Map]",P0e="[object Set]",k0e="[object Array]",O0e="[object ArrayBuffer]",_O="[object Object]",M0e="[object DataView]",D0e="[object Uint8Array]",B0e="[object Uint8ClampedArray]",F0e="[object Uint16Array]",$0e="[object Uint32Array]",L0e="[object Int8Array]",U0e="[object Int16Array]",H0e="[object Int32Array]",j0e="[object Float32Array]",z0e="[object Float64Array
83]";function $E(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function J0e(t,e){return Bd(t,void 0,t,new Map,e)}function Bd(t,e,r,n=new Map,i=void 0){const s=i==null?void 0:i(t,e,r,n);if(s!==void 0)return s;if(BE(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const o=new Array(t.length);n.set(t,o);for(let a=0;a<t.length;a++)o[a]=Bd(t[a],a,r,n,i);return Object.hasOwn(t,"index")&&(o.index=t.index),Object.hasOwn(t,"input")&&(o.input=t.input),o}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const o=new RegExp(t.source,t.flags);return o.lastIndex=t.lastIndex,o}if(t instanceof Map){const o=new Map;n.set(t,o);for(const[a,c]of t)o.set(a,Bd(c,a,r,n,i));return o}if(t instanceof Set){const o=new Set;n.set(t,o);for(const a of t)o.add(Bd(a,void 0,r,n,i));return o}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if($E(t)){const o=new(Object.getPrototypeOf(t)).constructor(t.length);n.set(t,o);for(let a=0;a<t.length;a++)o[a]=Bd(t[a],a,r,n,i);return o}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const o=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return n.set(t,o),ko(o,t,r,n,i),o}if(typeof File<"u"&&t instanceof File){const o=new File([t],t.name,{type:t.type});return n.set(t,o),ko(o,t,r,n,i),o}if(typeof Blob<"u"&&t instanceof Blob){const o=new Blob([t],{type:t.type});return n.set(t,o),ko(o,t,r,n,i),o}if(t instanceof Error){const o=new t.constructor;return n.set(t,o),o.message=t.message,o.name=t.name,o.stack=t.stack,o.cause=t.cause,ko(o,t,r,n,i),o}if(t instanceof Boolean){const o=new Boolean(t.valueOf());return n.set(t,o),ko(o,t,r,n,i),o}if(t instanceof Number){const o=new Number(t.valueOf());return n.set(t,o),ko(o,t,r,n,i),o}if(t instanceof String){const o=new String(t.valueOf());return n.set(t,o),ko(o,t,r,n,i),o}if(typeof t=="object"&&q0e(t)){const o=Object.create(Object.getPrototypeOf(t));return n.set(t,o),ko(o,t,r,n,i),o}return t}function ko(t,e,r=t,n,i){const s=[...Object.keys(e),...yO(e)];for(let o=0;o<s.length;o++){const a=s[o],c=Object.getOwnPropertyDescriptor(t,a);(c==null||c.writable)&&(t[a]=Bd(e[a],a,r,n,i))}}function q0e(t){switch(FE(t)){case AO:case k0e:case O0e:case M0e:case EO:case x0e:case j0e:case z0e:case L0e:case U0e:case H0e:case R0e:case wO:case _O:case N0e:case P0e:case vO:case I0e:case D0e:case B0e:case F0e:case $0e:return!0;default:return!1}}function G0e(t,e){return J0e(t,(r,n,i,s)=>{const o=e==null?void 0:e(r,n,i,s);if(o!==void 0)return o;if(typeof t=="object"){if(FE(t)===_O&&typeof t.constructor!="function"){const a={};return s.set(t,a),ko(a,t,i,s),a}switch(Object.prototype.toString.call(t)){case wO:case vO:case EO:{const a=new t.constructor(t==null?void 0:t.valueOf());return ko(a,t),a}case AO:{const a={};return ko(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function xS(t){return G0e(t)}function RS(t){return t!==null&&typeof t=="object"&&FE(t)==="[object Arguments]"}function k6(t){return typeof t=="object"&&t!==null}function V0e(t){return k6(t)&&S0e(t)}function W0e(){}function lw(t){return $E(t)}function uw(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const n=t[Symbol.toStringTag];return n==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${n}]`}let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function K0e(t){if(BE(t))return t;if(Array.isArray(t)||$E(t)||t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);const e=Object.getPrototypeOf(t);if(e==null)return Object.assign(Object.create(e),t);const r=e.constructor;if(t instanceof Date||t instanceof Map||t instanceof Set)return new r(t);if(t instanceof RegExp){const n=new r(t);return n.lastIndex=t.lastIndex,n}if(t instanceof DataView)return new r(t.buffer.slice(0));if(t instanceof Error){let n;return t instanceof AggregateError?n=new r(t.errors,t.message,{cause:t.cause}):n=new r(t.message,{cause:t.cause}),n.stack=t.stack,Object.assign(n,t),n}if(typeof File<"u"&&t instanceof File)return new r([t],t.name,{type:t.type,lastModified:t.lastModified});if(typeof t=="object"){const n=Object.create(e);return Object.assign(n,t)}return t}function X0e(t,...e){const r=e.slice(0,-1),n=e[e.length-1];let i=t;for(let s=0;s<r.length;s++){const o=r[s];i=O6(i,o,n,new Map)}return i}function O6(t,e,r,n){if(BE(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(n.has(e))return K0e(n.get(e));if(n.set(e,t),Array.isArray(e)){e=e.slice();for(let s=0;s<e.length;s++)e[s]=e[s]??void 0}const i=[...Object.keys(e),...yO(e)];for(let s=0;s<i.length;s++){const o=i[s];if(T0e(o))continue;let a=e[o],c=t[o];if(RS(a)&&(a={...a}),RS(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=xS(a)),Array.isArray(a))if(Array.isArray(c)){const u=[],f=Reflect.ownKeys(c);for(let d=0;d<f.length;d++){const h=f[d];u[h]=c[h]}c=u}else if(V0e(c)){const u=[];for(let f=0;f<c.length;f++)u[f]=c[f];c=u}else c=[];const l=r(c,a,o,t,e,n);l!==void 0?t[o]=l:Array.isArray(a)||k6(c)&&k6(a)&&(uw(c)||uw(a)||lw(c)||lw(a))?t[o]=O6(c,a,r,n):c==null&&uw(a)?t[o]=O6({},a,r,n):c==null&&lw(a)?t[o]=xS(a):(c===void 0||a!==void 0)&&(t[o]=a)}return t}function Z0e(t,...e){return X0e(t,...e,W0e)}const PS="error",Y0e="wss://relay.walletconnect.org",Q0e="wc",CO="universal_provider",Wg=`${Q0e}@2:${CO}:`,SO="https://rpc.walletconnect.org/v1/",TO="generic",epe=`${SO}bundler`,Yd="call_status",tpe=86400,LE={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var rpe=Object.defineProperty,npe=Object.defineProperties,ipe=Object.getOwnPropertyDescriptors,kS=Object.getOwnPropertySymbols,spe=Object.prototype.hasOwnProperty,ope=Object.prototype.propertyIsEnumerable,OS=(t,e,r)=>e in t?rpe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kg=(t,e)=>{for(var r in e||(e={}))spe.call(e,r)&&OS(t,r,e[r]);if(kS)for(var r of kS(e))ope.call(e,r)&&OS(t,r,e[r]);return t},ape=(t,e)=>npe(t,ipe(e));function NO(t,e,r){var n;const i=Fc(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${SO}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function cpe(t){return t.includes(":")?t.split(":")[1]:t}function IO(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function lpe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>
vendor: 14,200 bytes, line 83
83{const s=e.namespaces[i].accounts;n.push(...s)}),n}function MS(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>{var n,i;return((n=r==null?void 0:r.chains)==null?void 0:n.length)&&((i=r==null?void 0:r.chains)==null?void 0:i.length)>0}))}function Xg(t={},e={}){const r=MS(DS(t)),n=MS(DS(e));return Z0e(r,n)}function DS(t){var e,r,n,i,s;const o={};if(!Da(t))return o;for(const[a,c]of Object.entries(t)){const l=Ky(a)?[a]:c.chains,u=c.methods||[],f=c.events||[],d=c.rpcMap||{},h=Dd(a);o[h]=ape(Kg(Kg({},o[h]),c),{chains:Ma(l,(e=o[h])==null?void 0:e.chains),methods:Ma(u,(r=o[h])==null?void 0:r.methods),events:Ma(f,(n=o[h])==null?void 0:n.events)}),(Da(d)||Da(((i=o[h])==null?void 0:i.rpcMap)||{}))&&(o[h].rpcMap=Kg(Kg({},d),(s=o[h])==null?void 0:s.rpcMap))}return o}function BS(t){return t.includes(":")?t.split(":")[2]:t}function FS(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=Ky(r)?[r]:n.chains?n.chains:IO(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function fw(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}function upe(t){try{const e=JSON.parse(t);return typeof e=="object"&&e!==null&&!Array.isArray(e)}catch{return!1}}const xO={},Qd=t=>xO[t],dw=(t,e)=>{xO[t]=e};var fpe=Object.defineProperty,$S=Object.getOwnPropertySymbols,dpe=Object.prototype.hasOwnProperty,hpe=Object.prototype.propertyIsEnumerable,LS=(t,e,r)=>e in t?fpe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,US=(t,e)=>{for(var r in e||(e={}))dpe.call(e,r)&&LS(t,r,e[r]);if($S)for(var r of $S(e))hpe.call(e,r)&&LS(t,r,e[r]);return t};const HS="eip155",ppe=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],gpe=t=>t&&t.startsWith("0x")?BigInt(t).toString(10):t,hw=t=>t&&t.startsWith("0x")?t:`0x${BigInt(t).toString(16)}`,jS=t=>Object.keys(t).filter(e=>ppe.includes(e)).reduce((e,r)=>(e[r]=mpe(t[r]),e),{}),mpe=t=>typeof t=="string"&&upe(t)?JSON.parse(t):t,bpe=(t,e,r)=>{const{sessionProperties:n={},scopedProperties:i={}}=t,s={};if(!Da(i)&&!Da(n))return;const o=jS(n);for(const a of r){const c=gpe(a);if(!c)continue;s[hw(c)]=o;const l=i==null?void 0:i[`${HS}:${c}`];if(l){const u=l==null?void 0:l[`${HS}:${c}:${e}`];s[hw(c)]=US(US({},s[hw(c)]),jS(u||l))}}for(const[a,c]of Object.entries(s))Object.keys(c).length===0&&delete s[a];return Object.keys(s).length>0?s:void 0};var ype=Object.defineProperty,vpe=(t,e,r)=>e in t?ype(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wpe=(t,e,r)=>vpe(t,typeof e!="symbol"?e+"":e,r);let pw;class UE{constructor(e){wpe(this,"storage"),this.storage=e}async getItem(e){return await this.storage.getItem(e)}async setItem(e,r){return await this.storage.setItem(e,r)}async removeItem(e){return await this.storage.removeItem(e)}static getStorage(e){return pw||(pw=new UE(e)),pw}}var Epe=Object.defineProperty,Ape=Object.defineProperties,_pe=Object.getOwnPropertyDescriptors,zS=Object.getOwnPropertySymbols,Cpe=Object.prototype.hasOwnProperty,Spe=Object.prototype.propertyIsEnumerable,JS=(t,e,r)=>e in t?Epe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Tpe=(t,e)=>{for(var r in e||(e={}))Cpe.call(e,r)&&JS(t,r,e[r]);if(zS)for(var r of zS(e))Spe.call(e,r)&&JS(t,r,e[r]);return t},Npe=(t,e)=>Ape(t,_pe(e));async function Ipe(t,e){const r=Fc(t.result.capabilities.caip345.caip2),n=t.result.capabilities.caip345.transactionHashes,i=await Promise.allSettled(n.map(f=>xpe(r.reference,f,e))),s=i.filter(f=>f.status==="fulfilled").map(f=>f.value).filter(f=>f);i.filter(f=>f.status==="rejected").forEach(f=>console.warn("Failed to fetch transaction receipt:",f.reason));const o=!s.length||s.some(f=>!f),a=s.every(f=>(f==null?void 0:f.status)==="0x1"),c=s.every(f=>(f==null?void 0:f.status)==="0x0"),l=s.some(f=>(f==null?void 0:f.status)==="0x0");let u;return o?u=100:a?u=200:c?u=500:l&&(u=600),{id:t.result.id,version:t.request.version,atomic:t.request.atomicRequired,chainId:t.request.chainId,capabilities:t.result.capabilities,receipts:s,status:u}}async function xpe(t,e,r){return await r(parseInt(t)).request(Mo("eth_getTransactionReceipt",[e]))}async function Rpe({sendCalls:t,storage:e}){const r=await e.getItem(Yd);await e.setItem(Yd,Npe(Tpe({},r),{[t.result.id]:{request:t.request,result:t.result,expiry:xn(tpe)}}))}async function Ppe({resultId:t,storage:e}){const r=await e.getItem(Yd);if(r){delete r[t],await e.setItem(Yd,r);for(const n in r)ma(r[n].expiry)&&delete r[n];await e.setItem(Yd,r)}}async function kpe({resultId:t,storage:e}){const r=await e.getItem(Yd),n=r==null?void 0:r[t];if(n&&!ma(n.expiry))return n;await Ppe({resultId:t,storage:e})}var Ope=Object.defineProperty,Mpe=Object.defineProperties,Dpe=Object.getOwnPropertyDescriptors,qS=Object.getOwnPropertySymbols,Bpe=Object.prototype.hasOwnProperty,Fpe=Object.prototype.propertyIsEnumerable,M6=(t,e,r)=>e in t?Ope(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gw=(t,e)=>{for(var r in e||(e={}))Bpe.call(e,r)&&M6(t,r,e[r]);if(qS)for(var r of qS(e))Fpe.call(e,r)&&M6(t,r,e[r]);return t},mw=(t,e)=>Mpe(t,Dpe(e)),Lu=(t,e,r)=>M6(t,typeof e!="symbol"?e+"":e,r);class $pe{constructor(e){Lu(this,"name","eip155"),Lu(this,"client"),Lu(this,"chainId"),Lu(this,"namespace"),Lu(this,"httpProviders"),Lu(this,"events"),Lu(this,"storage"),this.namespace=e.namespace,this.events=Qd("events"),this.client=Qd("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=UE.getStorage(this.client.core.storage)}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e);case"wallet_sendCalls":return await this.sendCalls(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r);const n=this.chainId;this.chainId=parseInt(e),this.events.emit(LE.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${n}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||NO(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new OE(new bO(n,Qd("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(cpe(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(e){const r=e||this.chainId;return this.httpProviders[r]||(this.httpProviders=mw(gw({},this.httpProviders),{[r]:this.createHttpProvider(r)}),this.httpProviders[r])}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const s=parseInt(i,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i,s,o;const a=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0],c=((s=(i=e.request)==null?void 0:i.params)==null?void 0:s[1])||[];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const l=this.client.session.get(e.topic),u=((o=l==null?void 0:l.sessionProperties)==null?void 0:o.capabilities)||{},f=c.length>0?c.join(","):`0x${this.chainId.toString(16)}`,d=`${a}${f}`,h=u==null?void 0:u[d];if(h)return h;let g;try{g=bpe(l,a,c)}catch(w){console.warn("Failed to extract capabilities from session",w)}if(g)return g;const b=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:mw(gw({},l.sessionProperties||{}),{capabilities:mw(gw({},u||{}),{[d]:b})})})}catch(w){console.warn("Failed to update session with capabilities",w)}return b}async getCallStatus(e){var r,n,i;const s=this.client.session.get(e.topic),o=(r=s.sessionProperties)==null?void 0:r.bundler_name;if(o){const l=this.getBundlerUrl(e.chainId,o);try{return await this.getUserOperationReceipt(l,e)}catch(u){console.warn("Failed to fetch call status from bundler",u,l)}}const a=(n=s.sessionProperties)==null?void 0:n.bundler_url;if(a)try{return await this.getUserOperationReceipt(a,e)}catch(l){console.warn("Failed to fetch call status from custom bundler",l,a)}const c=await kpe({resultId:(i=e.request.params)==null?void 0:i[0],storage:this.storage});if(c)try{return await Ipe(c,this.getHttpProvider.bind(this))}catch(l){console.warn("Failed to fetch call status from stored send calls",l,c)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Mo("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(e,r){return`${epe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}async sendCalls(e){var r,n,i;const s=await this.client.request(e),o=(r=e.request.params)==null?void 0:r[0],a=s==null?void 0:s.id,c=(s==null?void 0:s.capabilities)||{},l=(n=c==null?void 0:c.caip345)==null?void 0:n.caip2,u=(i=c==null?void 0:c.caip345)==null?void 0:i.transactionHashes;return!a||!l||!(u!=null&&u.length)||await Rpe({sendCalls:{request:o,result:s},storage:this.storage}),s}}var Lpe=Object.defineProperty,Upe=(t,e,r)=>e in t?Lpe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wd=(t,e,r)=>Upe(t,typeof e!="symbol"?e+"":e,r);class Hpe{constructor(e){wd(this,"name",TO),wd(this,"client"),wd(this,"httpProviders"),wd(this,"events"),wd(this,"namespace"),wd(this,"chainId"),this.namespace=e.namespace,this.events=Qd("events"),this.client=Qd("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r);const n=this.chainId;this.chainId=e,this.events.emit(LE.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${e}`,previousCaipChainId:`${this.name}:${n}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getNamespaceName(){const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return Fc(e).namespace}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{var s,o;const a=Fc(i),c=(o=(s=this.namespace)==null?void 0:s.rpcMap)==null?void 0:o[`${a.namespace}:${a.reference}`];n[a.reference]=this.createHttpProvider(i,c)}),n}getHttpProvider(e){const r=Fc(e).reference,n=this.httpProviders[r];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return n}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||NO(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new OE(new bO(n,Qd("disableProviderPing")))}}var jpe=Object.defineProperty,zpe=Object.defineProperties,Jpe=Object.getOwnPropertyDescriptors,GS=Object.getOwnPropertySymbols,qpe=Object.prototype.hasOwnProperty,Gpe=Object.prototype.propertyIsEnumerable,D6=(t,e,r)=>e in t?jpe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_0=(t,e)=>{for(var r in e||(e={}))qpe.call(e,r)&&D6(t,r,e[r]);if(GS)for(var r of GS(e))Gpe.call(e,r)&&D6(t,r,e[r]);return t},Zg=(t,e)=>zpe(t,Jpe(e)),Cs=(t,e,r)=>D6(t,typeof e!="symbol"?e+"":e,r);let Vpe=class RO{constructor(e){Cs(this,"client"),Cs(this,"namespaces"),Cs(this,"optionalNamespaces"),Cs(this,"sessionProperties"),Cs(this,"scopedProperties"),Cs(this,"events",new Z5),Cs(this,"rpcProviders",{}),Cs(this,"session"),Cs(this,"providerOpts"),Cs(this,"logger"),Cs(this,"uri"),Cs(this,"disableProviderPing",!1),Cs(this,"connectParam
83s");var r,n;this.providerOpts=e,this.logger=RE({logger:(r=e.logger)!=null?r:PS,name:(n=this.providerOpts.name)!=null?n:CO}),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new RO(e);return await r.initialize(),r}async request(e,r,n){const[i,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:_0({},e),chainId:`${i}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const s=new Date().getTime();this.request(e,n,i).then(o=>r(null,a1(s,o))).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:nn("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.connectParams=e,this.setNamespaces(e),this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const s=await i();if(this.session=s.session,this.session){const o=FS(this.session.namespaces);this.namespaces=Xg(this.namespaces,o),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){var r,n;const{uri:i,approval:s}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties,authentication:(r=this.connectParams)==null?void 0:r.authentication,walletPay:(n=this.connectParams)==null?void 0:n.walletPay});i&&(this.uri=i,this.events.emit("display_uri",i));const o=await s();this.session=o;const a=FS(o.namespaces);return this.namespaces=Xg(this.namespaces,a),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),s=this.getProvider(n);s?s.setDefaultChain(i,r):this.session&&this.logger.warn(`Provider for namespace '${n}' not found in setDefaultChain`)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){try{this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(!Lc(r))return;for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}catch(r){this.logger.warn(r,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var e,r;if(this.client=this.providerOpts.client||await g0e.init({core:this.providerOpts.core,logger:this.providerOpts.logger||PS,relayUrl:this.providerOpts.relayUrl||Y0e,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(n){throw this.logger.error(n,"Failed to get session"),new Error(`The provided session: ${(r=(e=this.providerOpts)==null?void 0:e.session)==null?void 0:r.topic} doesn't exist in the Sign client`)}else{const n=this.client.session.getAll();this.session=n[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Dd(r)))];dw("client",this.client),dw("events",this.events),dw("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=lpe(r,this.session);if((n==null?void 0:n.length)===0)return;const i=IO(n),s=Xg(this.namespaces,this.optionalNamespaces),o=Zg(_0({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new $pe({namespace:o});break;default:this.rpcProviders[r]=new Hpe({namespace:o})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var r;const{topic:n}=e;n===((r=this.session)==null?void 0:r.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var r;const{params:n,topic:i}=e;if(i!==((r=this.session)==null?void 0:r.topic))return;const{event:s}=n;if(s.name==="accountsChanged"){const o=s.data;o&&Lc(o)&&this.events.emit("accountsChanged",o.map(BS))}else if(s.name==="chainChanged"){const o=n.chainId,a=n.event.data,c=Dd(o),l=fw(o)!==fw(a)?`${c}:${fw(a)}`:o;this.onChainChanged({currentCaipChainId:l})}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n,i;if(e!==((n=this.session)==null?void 0:n.topic))return;const{namespaces:s}=r,o=(i=this.client)==null?void 0:i.session.get(e);this.session=Zg(_0({},o),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{var r;e.topic===((r=this.session)==null?void 0:r.topic)&&(await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Zg(_0({},nn("USER_DISCONNECTED")),{data:e.topic})))}),this.on(LE.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(Zg(_0({},e),{internal:!0}))})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[TO]}
vendor: 14,576 bytes, line 83
83onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r={},optionalNamespaces:n={},sessionProperties:i,scopedProperties:s}=e;this.optionalNamespaces=Xg(r,n),this.sessionProperties=i,this.scopedProperties=s}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>Dd(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Dd(Object.keys(this.namespaces)[0]),s=this.rpcProviders[i].getDefaultChain();return[i,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}async onChainChanged({currentCaipChainId:e,previousCaipChainId:r,internal:n=!1}){if(!this.namespaces)return;const[i,s]=this.validateChain(e);if(s){if(this.updateNamespaceChain(i,s),n)this.events.emit("chainChanged",s),this.emitAccountsChangedOnChainChange({namespace:i,currentCaipChainId:e,previousCaipChainId:r});else{const o=this.getProvider(i);o?o.setDefaultChain(s):this.session&&this.logger.warn(`Provider for namespace '${i}' not found during chain change`)}await this.persist("namespaces",this.namespaces)}}emitAccountsChangedOnChainChange({namespace:e,currentCaipChainId:r,previousCaipChainId:n}){var i,s;try{if(n===r)return;const o=(s=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:s.accounts;if(!o)return;const a=o.filter(c=>c.includes(`${r}:`)).map(BS);if(!Lc(a))return;this.events.emit("accountsChanged",a)}catch(o){this.logger.warn(o,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(e,r){if(!this.namespaces)return;const n=this.namespaces[e]?e:`${e}:${r}`,i={chains:[],methods:[],events:[],defaultChain:r};this.namespaces[n]?this.namespaces[n]&&(this.namespaces[n].defaultChain=r):this.namespaces[n]=i}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.connectParams=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(e,r){var n;const i=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.setItem(`${Wg}/${e}${i}`,r)}async getFromStore(e){var r;const n=((r=this.session)==null?void 0:r.topic)||"";return await this.client.core.storage.getItem(`${Wg}/${e}${n}`)}async deleteFromStore(e){var r;const n=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.removeItem(`${Wg}/${e}${n}`)}async cleanupStorage(){var e;try{if(((e=this.client)==null?void 0:e.session.length)>0)return;const r=await this.client.core.storage.getKeys();for(const n of r)n.startsWith(Wg)&&await this.client.core.storage.removeItem(n)}catch(r){this.logger.warn(r,"Failed to cleanup storage")}}};const VS=2147483648,Wpe={convertEVMChainIdToCoinType(t){if(t>=VS)throw new Error("Invalid chainId");return(VS|t)>>>0}},Xs=Qr({suggestions:[],loading:!1}),Kpe={state:Xs,subscribe(t){return di(Xs,()=>t(Xs))},subscribeKey(t,e){return Qn(Xs,t,e)},async resolveName(t){var e,r;try{return await it.lookupEnsName(t)}catch(n){const i=n;throw new Error(((r=(e=i==null?void 0:i.reasons)==null?void 0:e[0])==null?void 0:r.description)||"Error resolving name")}},async isNameRegistered(t){try{return await it.lookupEnsName(t),!0}catch{return!1}},async getSuggestions(t){try{Xs.loading=!0,Xs.suggestions=[];const e=await it.getEnsNameSuggestions(t);return Xs.suggestions=e.suggestions||[],Xs.suggestions}catch(e){const r=ep.parseEnsApiError(e,"Error fetching name suggestions");throw new Error(r)}finally{Xs.loading=!1}},async getNamesForAddress(t){try{if(!z.state.activeCaipNetwork)return[];const r=le.getEnsFromCacheForAddress(t);if(r)return r;const n=await it.reverseLookupEnsName({address:t});return le.updateEnsCache({address:t,ens:n,timestamp:Date.now()}),n}catch(e){const r=ep.parseEnsApiError(e,"Error fetching names for address");throw new Error(r)}},async registerName(t){var i;const e=z.state.activeCaipNetwork,r=(i=z.getAccountData(e==null?void 0:e.chainNamespace))==null?void 0:i.address,n=be.getAuthConnector();if(!e)throw new Error("Network not found");if(!r||!n)throw new Error("Address or auth connector not found");Xs.loading=!0;try{const s=JSON.stringify({name:t,attributes:{},timestamp:Math.floor(Date.now()/1e3)});ze.pushTransactionStack({onCancel(){ze.replace("RegisterAccountName")}});const o=await Ee.signMessage(s);Xs.loading=!1;const a=e.id;if(!a)throw new Error("Network not found");const c=Wpe.convertEVMChainIdToCoinType(Number(a));await it.registerEnsName({coinType:c,address:r,signature:o,message:s}),z.setAccountProp("profileName",t,e.chainNamespace),le.updateEnsCache({address:r,ens:[{name:t,registered_at:new Date().toISOString(),updated_at:void 0,addresses:{},attributes:[]}],timestamp:Date.now()}),ze.replace("RegisterAccountNameSuccess")}catch(s){const o=ep.parseEnsApiError(s,`Error registering name ${t}`);throw ze.replace("RegisterAccountName"),new Error(o)}finally{Xs.loading=!1}},validateName(t){return/^[a-zA-Z0-9-]{4,}$/u.test(t)},parseEnsApiError(t,e){var n,i;const r=t;return((i=(n=r==null?void 0:r.reasons)==null?void 0:n[0])==null?void 0:i.description)||e}},ep=ho(Kpe);function B6(t){try{return new URL(t)}catch{return null}}function Xpe(t){const e=t.split("/"),r=e.length>0&&e[0]!==void 0?e[0]:"",n=r.lastIndexOf(":");return n===-1?{host:r}:{host:r.slice(0,n),port:r.slice(n+1)}}function Zpe(t){const e=t.indexOf("://");if(e===-1)return null;const r=t.slice(0,e),n=e+3;let i=t.indexOf("/",n);i===-1&&(i=t.length);const s=t.slice(n,i),o=s.lastIndexOf(":");return o===-1?{scheme:r,host:s}:{scheme:r,host:s.slice(0,o),port:s.slice(o+1)}}function Ype(t,e){if(e.includes("://")){const o=B6(e);return o?o.origin===t:!1}const{host:r,port:n}=Xpe(e),i=t.indexOf("://");if(i!==-1){const o=i+3;let a=t.indexOf("/",o);a===-1&&(a=t.length);const c=t.slice(o,a);if(n!==void 0)return`${r}:${n}`===c;const l=c.split(":")[0];return r===l}const s=B6(t);return s?n!==void 0?r===s.hostname&&n===(s.port||void 0):r===s.hostname:!1}function Qpe(t,e,r){let n=r,i;const s=n.indexOf("://");s!==-1&&(i=n.slice(0,s),n=n.slice(s+3));const o=n.indexOf("/");o!==-1&&(n=n.slice(0,o));let a=n,c;const l=a.lastIndexOf(":");l!==-1&&(c=a.slice(l+1),a=a.slice(0,l));const u=a.split(".");for(const b of u)if(b.includes("*")&&b!=="*")return!1;const f=t.protocol.replace(/:$/u,"");if(i&&i!==f||c!==void 0&&c!=="*"&&c!==t.port)return!1;const d=Zpe(e),g=(d?d.host:t.hostname).split(".");if(u.length!==g.length)return!1;for(let b=u.length-1;b>=0;b-=1){const w=u[b],x=g[b];if(w!=="*"&&w!==x)return!1}return!0}const e1e={ton:["ton_sendMessage","ton_signData"],solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"],tron:["tron_signMessage","tron_signTransaction"]},Uc={RPC_ERROR_CODE:{USER_REJECTED:5e3,USER_REJECTED_METHODS:5002},getMethodsByChainNamespace(t){return e1e[t]||[]},createDefaultNamespace(t){return{methods:this.getMethodsByChainNamespace(t),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(t,e){if(!e)return{...t};const r={...t},n=new Set;if(e.methods&&Object.keys(e.methods).forEach(i=>n.add(i)),e.chains&&Object.keys(e.chains).forEach(i=>n.add(i)),e.events&&Object.keys(e.events).forEach(i=>n.add(i)),e.rpcMap&&Object.keys(e.rpcMap).forEach(i=>{const[s]=i.split(":");s&&n.add(s)}),n.forEach(i=>{r[i]||(r[i]=this.createDefaultNamespace(i))}),e.methods&&Object.entries(e.methods).forEach(([i,s])=>{r[i]&&(r[i].methods=s)}),e.chains&&Object.entries(e.chains).forEach(([i,s])=>{r[i]&&(r[i].chains=s)}),e.events&&Object.entries(e.events).forEach(([i,s])=>{r[i]&&(r[i].events=s)}),e.rpcMap){const i=new Set;Object.entries(e.rpcMap).forEach(([s,o])=>{const[a,c]=s.split(":");!a||!c||!r[a]||(r[a].rpcMap||(r[a].rpcMap={}),i.has(a)||(r[a].rpcMap={},i.add(a)),r[a].rpcMap[c]=o)})}return r},createNamespaces(t,e){const r=t.reduce((n,i)=>{const{id:s,chainNamespace:o,rpcUrls:a}=i,c=a.default.http[0];n[o]||(n[o]=this.createDefaultNamespace(o));const l=`${o}:${s}`,u=n[o];switch(u.chains.push(l),l){case"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":u.chains.push("solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ");break;case"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1":u.chains.push("solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K");break}return u!=null&&u.rpcMap&&c&&(u.rpcMap[s]=c),n},{});return this.applyNamespaceOverrides(r,e)},resolveReownName:async t=>{var n;const e=await ep.resolveName(t);return((n=(e!=null&&e.addresses?Object.values(e.addresses):[])[0])==null?void 0:n.address)||!1},getChainsFromNamespaces(t={}){return Object.values(t).flatMap(e=>{const r=e.chains||[],n=e.accounts.map(i=>{const[s,o]=i.split(":");return`${s}:${o}`});return Array.from(new Set([...r,...n]))})},isSessionEventData(t){return typeof t=="object"&&t!==null&&"id"in t&&"topic"in t&&"params"in t&&typeof t.params=="object"&&t.params!==null&&"chainId"in t.params&&"event"in t.params&&typeof t.params.event=="object"&&t.params.event!==null},isUserRejectedRequestError(t){try{if(typeof t=="object"&&t!==null){const e=t,r=typeof e.code=="number",n=r&&e.code===Uc.RPC_ERROR_CODE.USER_REJECTED_METHODS,i=r&&e.code===Uc.RPC_ERROR_CODE.USER_REJECTED;return n||i}return!1}catch{return!1}},isOriginAllowed(t,e,r){const n=[...e,...r];if(e.length===0)return!0;const i=B6(t);if(!i)return n.some(s=>!s.includes("*")&&s===t);if(i.hostname==="localhost"||i.hostname==="127.0.0.1")return!0;for(const s of n)if(s.includes("*")){if(Qpe(i,t,s))return!0}else if(Ype(t,s))return!0;return!1},listenWcProvider({universalProvider:t,namespace:e,onConnect:r,onDisconnect:n,onAccountsChanged:i,onChainChanged:s,onDisplayUri:o}){r&&t.on("connect",()=>{const a=Uc.getWalletConnectAccounts(t,e);r(a)}),n&&t.on("disconnect",()=>{n()}),i&&t.on("accountsChanged",a=>{var c,l,u,f,d;try{const h=((u=(l=(c=t.session)==null?void 0:c.namespaces)==null?void 0:l[e])==null?void 0:u.accounts)||[],g=(d=(f=t.rpcProviders)==null?void 0:f[e])==null?void 0:d.getDefaultChain(),b=a.map(w=>{const x=h.find(D=>D.includes(`${e}:${g}:${w}`));if(!x)return;const{chainId:k,chainNamespace:R}=kn.parseCaipAddress(x);return{address:w,chainId:k,chainNamespace:R}}).filter(w=>w!==void 0);b.length>0&&i(b)}catch(h){console.warn("Failed to parse accounts for namespace on accountsChanged event",e,a,h)}}),s&&t.on("chainChanged",a=>{s(a)}),o&&t.on("display_uri",a=>{o(a)})},getWalletConnectAccounts(t,e){var i,s,o,a;const r=new Set,n=(a=(o=(s=(i=t==null?void 0:t.session)==null?void 0:i.namespaces)==null?void 0:s[e])==null?void 0:o.accounts)==null?void 0:a.map(c=>kn.parseCaipAddress(c)).filter(({address:c})=>r.has(c.toLowerCase())?!1:(r.add(c.toLowerCase()),!0));return n&&n.length>0?n:[]}},t1e=[K.CONNECTOR_ID.AUTH,K.CONNECTOR_ID.WALLET_CONNECT];class PO{constructor(e){this.availableConnectors=[],this.availableConnections=[],this.providerHandlers={},this.eventListeners=new Map,this.getCaipNetworks=r=>z.getCaipNetworks(r),this.getConnectorId=r=>be.getConnectorId(r),e&&this.construct(e)}construct(e){this.projectId=e.projectId,this.namespace=e.namespace,this.adapterType=e.adapterType}get connectors(){return this.availableConnectors}get connections(){return this.availableConnections}get networks(){return this.getCaipNetworks(this.namespace)}onAuthConnected({accounts:e,chainId:r}){const n=this.getCaipNetworks().filter(i=>i.chainNamespace===this.namespace).find(i=>i.id.toString()===(r==null?void 0:r.toString()));e&&n&&this.addConnection({connectorId:K.CONNECTOR_ID.AUTH,accounts:e,caipNetwork:n})}setAuthProvider(e){e.onConnect(this.onAuthConnected.bind(this)),e.onSocialConnected(this.onAuthConnected.bind(this)),this.addConnector({id:K.CONNECTOR_ID.AUTH,type:"AUTH",name:K.CONNECTOR_NAMES.AUTH,provider:e,imageId:void 0,chain:this.namespace,chains:[]})}addConnector(...e){const r=new Set;this.availableConnectors=[...e,...this.availableConnectors].filter(n=>r.has(n.id)?!1:(r.add(n.id),!0)),this.emit("connectors",this.availableConnectors)}addConnection(...e){const r=new Set;this.availableConnections=[...e,...this.availableConnections].filter(n=>r.has(n.connectorId.toLowerCase())?!1:(r.add(n.connectorId.toLowerCase()),!0)),this.emit("connections",this.availableConnections)}deleteConnection(e){this.availableConnections=this.availableConnections.filter(r=>r.connectorId.toLowerCase()!==e.toLowerCase()),this.emit("connections",this.availableConnections)}clearConnections(e=!1){this.availableConnections=[],e&&this.emit("connections",this.availableConnections)}setStatus(e,r){z.setAccountProp("status",e,r)}on(e,r){var n;this.eventListeners.has(e)||this.eventListeners.set(e,new Set),(n=this.eventListeners.get(e))==null||n.add(r)}off(e,r){const n=this.eventListeners.get(e);n&&n.delete(r)}removeAllEventListeners(){this.eventListeners.forEach(e=>{e.clear()})}emit(e,r){const n=this.eventListeners.get(e);n&&n.forEach(i=>i(r))}async connectWalletConnect(e){try{return{clientId:(await this.getWalletConnectConnector().connectWalletConnect()).clientId}}catch(r){throw Uc.isUserRejectedRequestError(r)?new kd(r):r}}async switchNetwork(e){var s;const{caipNetwork:r}=e,n=jr.getProviderId(r.chainNamespace),i=jr.getProvider(r.chainNamespace);if(!i)throw new Error("Provider not found");if(n==="WALLET_CONNECT"){i.setDefaultChain(r.caipNetworkId);return}if(n==="AUTH"){const o=(s=be.getAuthConnector())==null?void 0:s.provider;if(!o)throw new Error("Auth provider not found");const a=Li(r.chainNamespace);await o.switchNetwork({chainId:r.caipNetworkId});const c=await o.getUser({chainId:r.caipNetworkId,preferredAccountType:a});
83this.emit("switchNetwork",c)}}getWalletConnectConnector(){const e=this.connectors.find(r=>r.id==="walletConnect");if(!e)throw new Error("WalletConnectConnector not found");return e}onConnect(e,r){if(e.length>0){const{address:n,chainId:i}=Ce.getAccount(e[0]),s=this.getCaipNetworks().filter(a=>a.chainNamespace===this.namespace).find(a=>a.id.toString()===(i==null?void 0:i.toString())),o=this.connectors.find(a=>a.id===r);n&&(this.emit("accountChanged",{address:n,chainId:i,connector:o}),this.addConnection({connectorId:r,accounts:e.map(a=>{const{address:c}=Ce.getAccount(a);return{address:c}}),caipNetwork:s}))}}onAccountsChanged(e,r,n=!0){var i,s;if(e.length>0){const{address:o}=Ce.getAccount(e[0]),a=this.getConnection({connectorId:r,connections:this.connections,connectors:this.connectors});o&&((i=this.getConnectorId(K.CHAIN.EVM))==null?void 0:i.toLowerCase())===r.toLowerCase()&&this.emit("accountChanged",{address:o,chainId:(s=a==null?void 0:a.caipNetwork)==null?void 0:s.id,connector:a==null?void 0:a.connector}),this.addConnection({connectorId:r,accounts:e.map(c=>{const{address:l}=Ce.getAccount(c);return{address:l}}),caipNetwork:a==null?void 0:a.caipNetwork})}else n&&this.onDisconnect(r)}onDisconnect(e){var r;this.removeProviderListeners(e),this.deleteConnection(e),((r=this.getConnectorId(K.CHAIN.EVM))==null?void 0:r.toLowerCase())===e.toLowerCase()&&this.emitFirstAvailableConnection(),this.connections.length===0&&this.emit("disconnect")}onChainChanged(e,r){var o;const n=typeof e=="string"&&e.startsWith("0x")?parseInt(e,16).toString():e.toString(),i=this.getConnection({connectorId:r,connections:this.connections,connectors:this.connectors}),s=this.getCaipNetworks().filter(a=>a.chainNamespace===this.namespace).find(a=>a.id.toString()===n);i&&this.addConnection({connectorId:r,accounts:i.accounts,caipNetwork:s}),((o=this.getConnectorId(K.CHAIN.EVM))==null?void 0:o.toLowerCase())===r.toLowerCase()&&this.emit("switchNetwork",{chainId:n})}listenProviderEvents(e,r){if(t1e.includes(e))return;const n=o=>this.onAccountsChanged(o,e),i=o=>this.onChainChanged(o,e),s=()=>this.onDisconnect(e);this.providerHandlers[e]||(r.on("disconnect",s),r.on("accountsChanged",n),r.on("chainChanged",i),this.providerHandlers[e]={provider:r,disconnect:s,accountsChanged:n,chainChanged:i})}removeProviderListeners(e){if(this.providerHandlers[e]){const{provider:r,disconnect:n,accountsChanged:i,chainChanged:s}=this.providerHandlers[e];r.removeListener("disconnect",n),r.removeListener("accountsChanged",i),r.removeListener("chainChanged",s),this.providerHandlers[e]=null}}emitFirstAvailableConnection(){var r;const e=this.getConnection({connections:this.connections,connectors:this.connectors});if(e){const[n]=e.accounts;this.emit("accountChanged",{address:n==null?void 0:n.address,chainId:(r=e.caipNetwork)==null?void 0:r.id,connector:e.connector})}}getConnection({address:e,connectorId:r,connections:n,connectors:i}){if(r){const o=n.find(l=>l.connectorId.toLowerCase()===r.toLowerCase());if(!o)return null;const a=i.find(l=>l.id.toLowerCase()===o.connectorId.toLowerCase()),c=e?o.accounts.find(l=>l.address.toLowerCase()===e.toLowerCase()):o.accounts[0];return{...o,account:c,connector:a}}const s=n.find(o=>o.accounts.length>0&&i.some(a=>a.id.toLowerCase()===o.connectorId.toLowerCase()));if(s){const[o]=s.accounts,a=i.find(c=>c.id.toLowerCase()===s.connectorId.toLowerCase());return{...s,account:o,connector:a}}return null}}let Uu=null;const ks={getSIWX(){return oe.state.siwx},async initializeIfEnabled(t=z.getActiveCaipAddress()){var s,o,a;const e=oe.state.siwx;if(!(e&&t))return;const[r,n,i]=t.split(":");if(z.checkIfSupportedNetwork(r,`${r}:${n}`))try{if((s=oe.state.remoteFeatures)!=null&&s.emailCapture){const l=(o=z.getAccountData(r))==null?void 0:o.user;await Dt.open({view:"DataCapture",data:{email:(l==null?void 0:l.email)??void 0}});return}if(Uu&&await Uu,(await e.getSessions(`${r}:${n}`,i)).length)return;await Dt.open({view:"SIWXSignMessage"})}catch(c){console.error("SIWXUtil:initializeIfEnabled",c),gt.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(c)}),await((a=Ee._getClient())==null?void 0:a.disconnect().catch(console.error)),ze.reset("Connect"),_a.showError("A problem occurred while trying initialize authentication")}}
83,async isAuthenticated(t=z.getActiveCaipAddress()){if(!oe.state.siwx||!t)return!0;const{chainNamespace:r,chainId:n,address:i}=kn.parseCaipAddress(t),s=`${r}:${n}`;return(await ks.getSessions({address:i,caipNetworkId:s})).length>0},async requestSignMessage(){const t=oe.state.siwx,e=Ce.getPlainAddress(z.getActiveCaipAddress()),r=kc();if(!t)throw new Error("SIWX is not enabled");if(!e)throw new Error("No ActiveCaipAddress found");if(!r)throw new Error("No ActiveCaipNetwork or client found");try{const n=await t.createMessage({chainId:r.caipNetworkId,accountAddress:e}),i=n.toString();let s="";t.signMessage?s=await t.signMessage({message:i,chainId:r.caipNetworkId,accountAddress:e}):(be.getConnectorId(r.chainNamespace)===K.CONNECTOR_ID.AUTH&&ze.pushTransactionStack({}),s=await Ee.signMessage(i)||""),await t.addSession({data:n,message:i,signature:s}),z.setLastConnectedSIWECaipNetwork(r),Dt.close(),gt.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(n){(!Dt.state.open||ze.state.view==="ApproveTransaction")&&await Dt.open({view:"SIWXSignMessage"}),_a.showError("Error signing message"),gt.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(n)}),console.error("SWIXUtil:requestSignMessage",n)}},async cancelSignMessage(){var t;try{const e=this.getSIWX();if((t=e==null?void 0:e.getRequired)==null?void 0:t.call(e)){const n=z.getLastConnectedSIWECaipNetwork();if(n){const i=await(e==null?void 0:e.getSessions(n==null?void 0:n.caipNetworkId,Ce.getPlainAddress(z.getActiveCaipAddress())||""));i&&i.length>0?await z.switchActiveNetwork(n):await Ee.disconnect()}else await Ee.disconnect()}else Dt.close();Dt.close(),gt.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getAllSessions(){const t=this.getSIWX(),e=z.getAllRequestedCaipNetworks(),r=[];return await Promise.all(e.map(async n=>{const i=await(t==null?void 0:t.getSessions(n.caipNetworkId,Ce.getPlainAddress(z.getActiveCaipAddress())||""));i&&r.push(...i)})),r},async getSessions(t){const e=oe.state.siwx;let r=t==null?void 0:t.address;if(!r){const i=z.getActiveCaipAddress();r=Ce.getPlainAddress(i)}let n=t==null?void 0:t.caipNetworkId;if(!n){const i=z.getActiveCaipNetwork();n=i==null?void 0:i.caipNetworkId}return e&&r&&n?e.getSessions(n,r):[]},async isSIWXCloseDisabled(){var e;const t=this.getSIWX();if(t){const r=ze.state.view==="ApproveTransaction",n=ze.state.view==="SIWXSignMessage";if(r||n)return((e=t.getRequired)==null?void 0:e.call(t))&&(await this.get
vendor: 5,466 bytes, line 83
83Sessions()).length===0}return!1},async authConnectorAuthenticate({authConnector:t,chainId:e,socialUri:r,preferredAccountType:n,chainNamespace:i}){var f;const s=ks.getSIWX(),o=kc();if(!s||!i.includes(K.CHAIN.EVM)||(f=oe.state.remoteFeatures)!=null&&f.emailCapture){const d=await t.connect({chainId:e,socialUri:r,preferredAccountType:n});return{address:d.address,chainId:d.chainId,accounts:d.accounts}}const a=`${i}:${e}`,c=await s.createMessage({chainId:a,accountAddress:"<<AccountAddress>>"}),l={accountAddress:c.accountAddress,chainId:c.chainId,domain:c.domain,uri:c.uri,version:c.version,nonce:c.nonce,notBefore:c.notBefore,statement:c.statement,resources:c.resources,requestId:c.requestId,issuedAt:c.issuedAt,expirationTime:c.expirationTime,serializedMessage:c.toString()},u=await t.connect({chainId:e,socialUri:r,siwxMessage:l,preferredAccountType:n});return l.accountAddress=u.address,l.serializedMessage=u.message||"",u.signature&&u.message&&await ks.addEmbeddedWalletSession(l,u.message,u.signature),z.setLastConnectedSIWECaipNetwork(o),{address:u.address,chainId:u.chainId,accounts:u.accounts}},async addEmbeddedWalletSession(t,e,r){if(Uu)return Uu;const n=ks.getSIWX();return n?(Uu=n.addSession({data:t,message:e,signature:r}).finally(()=>{Uu=null}),Uu):Promise.resolve()},async universalProviderAuthenticate({universalProvider:t,chains:e,methods:r}){var l,u,f;const n=ks.getSIWX(),i=kc(),s=new Set(e.map(d=>d.split(":")[0]));if(!n||s.size!==1||!s.has("eip155"))return!1;const o=await n.createMessage({chainId:((l=kc())==null?void 0:l.caipNetworkId)||"",accountAddress:""}),a=await t.authenticate({nonce:o.nonce,domain:o.domain,uri:o.uri,exp:o.expirationTime,iat:o.issuedAt,nbf:o.notBefore,requestId:o.requestId,version:o.version,resources:o.resources,statement:o.statement,chainId:o.chainId,methods:r,chains:[o.chainId,...e.filter(d=>d!==o.chainId)]});_a.showLoading("Authenticating...",{autoClose:!1});const c={...a.session.peer.metadata,name:a.session.peer.metadata.name,icon:(u=a.session.peer.metadata.icons)==null?void 0:u[0],type:"WALLET_CONNECT"};if(z.setAccountProp("connectedWalletInfo",c,Array.from(s)[0]),(f=a==null?void 0:a.auths)!=null&&f.length){const d=a.auths.map(h=>{const g=t.client.formatAuthMessage({request:h.p,iss:h.p.iss});return{data:{...h.p,accountAddress:h.p.iss.split(":").slice(-1).join(""),chainId:h.p.iss.split(":").slice(2,4).join(":"),uri:h.p.aud??"",version:h.p.version||o.version,expirationTime:h.p.exp,issuedAt:h.p.iat,notBefore:h.p.nbf},message:g,signature:h.s.s,cacao:h}});try{await n.setSessions(d),i&&z.setLastConnectedSIWECaipNetwork(i),gt.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:ks.getSIWXEventProperties()})}catch(h){throw console.error("SIWX:universalProviderAuth - failed to set sessions",h),gt.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:ks.getSIWXEventProperties(h)}),await t.disconnect().catch(console.error),h}finally{_a.hide()}}return!0},getSIWXEventProperties(t){var r;const e=z.state.activeChain;if(!e)throw new Error("SIWXUtil:getSIWXEventProperties - namespace is required");return{network:((r=z.state.activeCaipNetwork)==null?void 0:r.caipNetworkId)||"",isSmartAccount:Li(e)===Tn.ACCOUNT_TYPES.SMART_ACCOUNT,message:t?Ce.parseError(t):void 0}},async clearSessions(){const t=this.getSIWX();t&&await t.setSessions([])}};class kO{constructor({provider:e,namespace:r}){this.id=K.CONNECTOR_ID.WALLET_CONNECT,this.name="WalletConnect",this.type="WALLET_CONNECT",this.imageId="ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",this.getCaipNetworks=z.getCaipNetworks.bind(z),this.caipNetworks=this.getCaipNetworks(),this.provider=e,this.chain=r}get chains(){return this.getCaipNetworks()}async connectWalletConnect(){if(!await this.authenticate()){const r=this.getCaipNetworks(),n=oe.state.universalProviderConfigOverride,i=Uc.createNamespaces(r,n);await this.provider.connect({optionalNamespaces:i})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){const e=this.chains.map(r=>r.caipNetworkId);return ks.universalProviderAuthenticate({universalProvider:this.provider,chains:e,methods:r1e})}}const r1e=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],_o=Qr({message:"",variant:"info",open:!1}),n1e={state:_o,subscribeKey(t,e){return Qn(_o,t,e)},open(t,e){const{debug:r}=oe.state,{code:n,displayMessage:i,debugMessage:s}=t;if(i&&r&&(_o.message=i,_o.variant=e,_o.open=!0),s){if(!K.IS_DEVELOPMENT)return;const o=typeof s=="function"?s():s,a=n?{code:n}:void 0;e==="error"?console.error(o,a):e==="warning"?console.warn(o,a):console.info(o,a)}},warn(t,e,r){_o.open=!0,_o.message=t,_o.variant="warning",e&&console.warn(e,r)},close(){_o.open=!1,_o.message="",_o.variant="info"}},bn=ho(n1e),i1e={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}},WS={56:"714",204:"714"};
83class s1e extends Error{}function o1e(){const{sdkType:t,sdkVersion:e,projectId:r}=oe.getSnapshot(),n=new URL("https://rpc.walletconnect.org/v1/json-rpc");return n.searchParams.set("projectId",r),n.searchParams.set("st",t),n.searchParams.set("sv",e),n.searchParams.set("source","fund-wallet"),n.toString()}async function HE(t,e){const r=o1e(),{projectId:n}=oe.getSnapshot(),i={jsonrpc:"2.0",id:1,method:t,params:{...e||{},projectId:n}},o=await(await fetch(r,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})).json();if(o.error)throw new s1e(o.error.message);return o}async function CCe(t){return(await HE("reown_getExchanges",t)).result}async function SCe(t){return(await HE("reown_getExchangePayUrl",t)).result}async function TCe(t){return(await HE("reown_getExchangeBuyStatus",t)).result}function NCe(t,e){const{chainNamespace:r,chainId:n}=kn.parseCaipNetworkId(t),i=i1e[r];if(!i)throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${r}`);let s=i.native.assetNamespace,o=i.native.assetReference;return e!=="native"?(s=i.defaultTokenNamespace,o=e):r==="eip155"&&WS[n]&&(o=WS[n]),`${`${r}:${n}`}/${s}:${o}`}const a1e={network:"eip155:1",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},c1e={network:"eip155:8453",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},OO={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},l1e={network:"eip155:84532",asset:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},u1e={network:"eip155:84532",asset:"native",metadata:{name:"Ethereum",symbol:"ETH",decimals:18}},f1e={network:"eip155:1",asset:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},d1e={network:"eip155:42161",asset:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},h1e={network:"eip155:137",asset:"0x2791bca1f2de4661ed88a30c99a7a9449aa84174",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},p1e={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},g1e={network:"eip155:1",asset:"0xdAC17F958D2ee523a2206206994597C13D831ec7",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},m1e={network:"eip155:10",asset:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},b1e={network:"eip155:42161",asset:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},y1e={network:"eip155:137",asset:"0xc2132d05d31c914a87c6611c10748aeb04b58e8f",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},v1e={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",metadata:{name:"Tether USD",symbol:"USDT",decimals:6}},w1e={network:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",asset:"native",metadata:{name:"Solana",symbol:"SOL",decimals:9}},E1e={ethereumETH:a1e,baseETH:c1e,baseUSDC:OO,baseSepoliaETH:u1e,ethereumUSDC:f1e,arbitrumUSDC:d1e,polygonUSDC:h1e,solanaUSDC:p1e,ethereumUSDT:g1e,optimismUSDT:m1e,arbitrumUSDT:b1e,polygonUSDT:y1e,solanaUSDT:v1e,solanaSOL:w1e};function ICe(t){return Object.values(E1e).filter(e=>e.network===t)}const Or={METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:K.CHAIN.EVM,ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH",getSDKVersionWarningMessage(t,e){return` 84 @@@@@@@ @@@@@@@@@@@@@@@@@@ 85 @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@ 86 @@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ 87 @@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@ 88 @@@@@@@@@@@@@@@ @@@@@@@@@@@@@@ @@@@@@@@@@@ 89 @@@@@@@@@@@@@@@ @@@@@@@@@@@@@ @@@@@@@@@@@@ 90 @@@@@@@@@@@@@@@ @@@@@@@@@@@@@ @@@@@@@@@@@@@ 91 @@@@@@@@@@@@@@@ @@@@@@@@@@@@ @@@@@@@@@@@@@ 92 @@@@@@ @@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@@@ 93 @@@@@@ @@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@@@@ 94 @@@@@@@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@@@@@@ 95 @@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@ 96 @@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@ 97 @@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@ 98 @@@@@ @@@@@@@@@@@@@@@@@@ 99
100AppKit SDK version ${t} is outdated. Latest version is ${e}. Please update to the latest version for bug fixes and new features. 101 102Changelog: https://github.com/reown-com/appkit/releases 103NPM Registry: https://www.npmjs.com/package/@reown/appkit`}},A1e={ConnectorExplorerIds:{[K.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[K.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[K.CONNECTOR_ID.BASE_ACCOUNT]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[K.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[K.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[K.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[Or.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[Or.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[Or.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[Or.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[Or.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[Or.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[Or.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[Or.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[Or.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[Or.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[Or.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13",[Or.OKX_CONNECTOR_NAME]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[Or.BINANCE_CONNECTOR_NAME]:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700","-239":"20f673c0-095e-49b2-07cf-eb5049dcf600","-3":"20f673c0-095e-49b2-07cf-eb5049dcf600","0x2b6653dc":"3502bb86-cc4e-420f-a387-59ea63a28b00","0x94a9059e":"3502bb86-cc4e-420f-a387-59ea63a28b00","0xcd8690dc":"3502bb86-cc4e-420f-a387-59ea63a28b00"},ConnectorImageIds:{[K.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[K.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[K.CONNECTOR_ID.BASE_ACCOUNT]:"bba2c8be-7fd1-463e-42b1-796ecb0ad200",[K.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[K.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[K.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[K.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-454
1030-9e6a2b9cae00"},ConnectorNamesMap:{[K.CONNECTOR_ID.INJECTED]:"Browser Wallet",[K.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[K.CONNECTOR_ID.COINBASE]:"Coinbase",[K.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[K.CONNECTOR_ID.BASE_ACCOUNT]:"Base Account",[K.CONNECTOR_ID.LEDGER]:"Ledger",[K.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[K.CONNECTOR_ID.INJECTED]:"INJECTED",[K.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[K.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[K.CONNECTOR_ID.AUTH]:"AUTH",[Or.CONNECTOR_TYPE_AUTH]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},Mc={getCaipTokens(t){if(!t)return;const e={};return Object.entries(t).forEach(([r,n])=>{e[`${Or.EIP155}:${r}`]=n}),e},isLowerCaseMatch(t,e){return(t==null?void 0:t.toLowerCase())===(e==null?void 0:e.toLowerCase())},getActiveNamespaceConnectedToAuth(){const t=z.state.activeChain;return K.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(e=>be.getConnectorId(e)===K.CONNECTOR_ID.AUTH&&e===t)},withRetry({conditionFn:t,intervalMs:e,maxRetries:r}){let n=0;return new Promise(i=>{async function s(){return n+=1,await t()?i(!0):n>=r?i(!1):(setTimeout(s,e),null)}s()})},userChainIdToChainNamespace(t){if(typeof t=="number")return K.CHAIN.EVM;const[e]=t.split(":");return e},getOtherAuthNamespaces(t){return t?K.AUTH_CONNECTOR_SUPPORTED_CHAINS.filter(n=>n!==t):[]},getConnectorStorageInfo(t,e){const n=le.getConnections()[e]??[];return{hasDisconnected:le.isConnectorDisconnected(t,e),hasConnected:n.some(i=>Mc.isLowerCaseMatch(i.connectorId,t))}}},_1e=new AbortController,sn={EmbeddedWalletAbortController:_1e,UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"ORIGIN_NOT_ALLOWED"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"},INVALID_KEY:{message:"Unauthorized: invalid key",alertErrorKey:"INVALID_PROJECT_ID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{code:"APKT001",displayMessage:"Network Not Found",debugMessage:"The specified network is not recognized. Please ensure it is included in the `networks` array of your `createAppKit` configuration."},ORIGIN_NOT_ALLOWED:{code:"APKT002",displayMessage:"Invalid App Configuration",debugMessage:()=>`The origin ${B0()?window.origin:"unknown"} is not in your allow list. Please update your allowed domains at https://dashboard.reown.com. [PID: ${oe.state.projectId}]`},IFRAME_LOAD_FAILED:{code:"APKT003",displayMessage:"Network Error: Wallet Load Failed",debugMessage:()=>"Failed to load the embedded wallet. This may be due to network issues or server downtime. Please check your network connection and try again shortly. Contact support if the issue persists."},IFRAME_REQUEST_TIMEOUT:{code:"APKT004",displayMessage:"Wallet Request Timeout",debugMessage:()=>"The request to the embedded wallet timed out. Please check your network connection and try again shortly. Contact support if the issue persists."},UNVERIFIED_DOMAIN:{code:"APKT005",displayMessage:"Unverified Domain",debugMessage:()=>"Embedded wallet load failed. Ensure your domain is verified in https://dashboard.reown.com."},JWT_TOKEN_NOT_VALID:{code:"APKT006",displayMessage:"Session Expired",debugMessage:"Your session is invalid or expired. Please check your systemâs date and time settings, then reconnect."},INVALID_PROJECT_ID:{code:"APKT007",displayMessage:"Invalid Project ID",debugMessage:"The specified project ID is invali
103d. Please visit https://dashboard.reown.com to obtain a valid project ID."},PROJECT_ID_NOT_CONFIGURED:{code:"APKT008",displayMessage:"Project ID Missing",debugMessage:"No project ID is configured. You can create and configure a project ID at https://dashboard.reown.com."},SERVER_ERROR_APP_CONFIGURATION:{code:"APKT009",displayMessage:"Server Error",debugMessage:t=>`Unable to fetch App Configuration. ${t}. Please check your network connection and try again shortly. Contact support if the issue persists.`},RATE_LIMITED_APP_CONFIGURATION:{code:"APKT010",displayMessage:"Rate Limited",debugMessage:"You have been rate limited while retrieving App Configuration. Please wait a few minutes and try again. Contact support if the issue persists."}},ALERT_WARNINGS:{LOCAL_CONFIGURATION_IGNORED:{debugMessage:t=>`[Reown Config Notice] ${t}`},INACTIVE_NAMESPACE_NOT_CONNECTED:{code:"APKTW001",displayMessage:"Inactive Namespace Not Connected",debugMessage:(t,e)=>`An error occurred while connecting an inactive namespace ${t}: "${e}"`},INVALID_EMAIL:{code:"APKTW002",displayMessage:"Invalid Email Address",debugMessage:"Please enter a valid email address"}}},MO={TOKEN_ADDRESSES_BY_SYMBOL:{USDC:{8453:OO.asset,84532:l1e.asset}},getTokenSymbolByAddress(t){if(!t)return;const[e]=Object.entries(MO.TOKEN_ADDRESSES_BY_SYMBOL).find(([r,n])=>Object.values(n).includes(t))??[];return e}},C1e={createLogger(t,e="error"){const r=E5({level:e}),{logger:n}=wy({opts:r});return n.error=(...i)=>{for(const s of i)if(s instanceof Error){t(s,...i);return}t(void 0,...i)},n}},S1e="rpc.walletconnect.org";function KS(t,e){const r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",t),r.searchParams.set("projectId",e),r.toString()}const bw=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","eip155:80094","eip155:80069","eip155:560048","eip155:31","eip155:2818","eip155:57054","eip155:911867","eip155:534351","eip155:1112","eip155:534352","eip155:1111","eip155:146","eip155:130","eip155:1284","eip155:30","eip155:2810","eip155:55931","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],wa={extendRpcUrlWithProjectId(t,e){let r=!1;try{r=new URL(t).host===S1e}catch{r=!1}if(r){const n=new URL(t);return n.searchParams.has("projectId")||n.searchParams.set("projectId",e),n.toString()}return t},isCaipNetwork(t){return"chainNamespace"in t&&"caipNetworkId"in t},getChainNamespace(t){return this.isCaipNetwork(t)?t.chainNamespace:K.CHAIN.EVM},getCaipNetworkId(t){return this.isCaipNetwork(t)?t.caipNetworkId:`${K.CHAIN.EVM}:${t.id}`},getDefaultRpcUrl(t,e,r){var i,s,o;const n=(o=(s=(i=t.rpcUrls)==null?void 0:i.default)==null?void 0:s.http)==null?void 0:o[0];return bw.includes(e)?KS(e,r):n||""},extendCaipNetwork(t,{customNetworkImageUrls:e,projectId:r,customRpcUrls:n}){var d,h,g,b,w,x,k;const i=this.getChainNamespace(t),s=this.getCaipNetworkId(t),o=(g=(h=(d=t.rpcUrls)==null?void 0:d.default)==null?void 0:h.http)==null?void 0:g[0],a=this.getDefaultRpcUrl(t,s,r),c=((x=(w=(b=t==null?void 0:t.rpcUrls)==null?void 0:b.chainDefault)==null?void 0:w.http)==null?void 0:x[0])||o,l=((k=n==null?void 0:n[s])==null?void 0:k.map(R=>R.url))||[],u=[...l,...a?[a]:[]],f=[...l];return c&&!f.includes(c)&&f.push(c),{...t,chainNamespace:i,caipNetworkId:s,assets:{imageId:A1e.NetworkImageIds[t.id],imageUrl:e==null?void 0:e[t.id]},rpcUrls:{...t.rpcUrls,default:{http:u},chainDefault:{http:f}}}},extendCaipNetworks(t,{customNetworkImageUrls:e,projectId:r,customRpcUrls:n}){return t.map(i=>wa.extendCaipNetwork(i,{customNetworkImageUrls:e,customRpcUrls:n,projectId:r}))}
103,getViemTransport(t,e,r){var i,s,o;const n=[];return r==null||r.forEach(a=>{n.push(Ig(a.url,a.config))}),bw.includes(t.caipNetworkId)&&n.push(Ig(KS(t.caipNetworkId,e),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),(o=(s=(i=t==null?void 0:t.rpcUrls)==null?void 0:i.default)==null?void 0:s.http)==null||o.forEach(a=>{n.push(Ig(a))}),N4(n)},extendWagmiTransports(t,e,r){if(bw.includes(t.caipNetworkId)){const n=this.getDefaultRpcUrl(t,t.caipNetworkId,e);return N4([r,Ig(n)])}return r},getUnsupportedNetwork(t){return{id:t.split(":")[1],caipNetworkId:t,name:K.UNSUPPORTED_NETWORK_NAME,chainNamespace:t.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}},getCaipNetworkFromStorage(t){var c;const e=le.getActiveCaipNetworkId(),r=z.getAllRequestedCaipNetworks(),n=Array.from(((c=z.state.chains)==null?void 0:c.keys())||[]),i=e==null?void 0:e.split(":")[0],s=i?n.includes(i):!1,o=r==null?void 0:r.find(l=>l.caipNetworkId===e);return s&&!o&&e?this.getUnsupportedNetwork(e):o||t||(r==null?void 0:r[0])}};class bf{constructor(){}static getInstance({projectId:e,chainId:r,enableLogger:n,onTimeout:i,abortController:s,getActiveCaipNetwork:o,getCaipNetworks:a}){var f;const{metadata:c,sdkVersion:l,sdkType:u}=oe.getSnapshot();return bf.instance||(bf.instance=new PJ({projectId:e,chainId:r,enableLogger:n,onTimeout:i,abortController:s,getActiveCaipNetwork:o,getCaipNetworks:a,enableCloudAuthAccount:!!((f=oe.state.remoteFeatures)!=null&&f.emailCapture),metadata:c,sdkVersion:l,sdkType:u})),bf.instance}}/** 104 * @license 105 * Copyright 2019 Google LLC 106 * SPDX-License-Identifier: BSD-3-Clause 107 */const km=globalThis,jE=km.ShadowRoot&&(km.ShadyCSS===void 0||km.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zE=Symbol(),XS=new WeakMap;let DO=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==zE)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(jE&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=XS.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&XS.set(r,e))}return e}toString(){return this.cssText}};const Oo=t=>new DO(typeof t=="string"?t:t+"",void 0,zE),Bl=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1],t[0]);return new DO(r,t,zE)},T1e=(t,e)=>{if(jE)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),i=km.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},ZS=jE?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return Oo(r)})(t):t;/** 108 * @license 109 * Copyright 2017 Google LLC 110 * SPDX-License-Identifier: BSD-3-Clause 111 */const{is:N1e,defineProperty:I1e,getOwnPropertyDescriptor:x1e,getOwnPropertyNames:R1e,getOwnPropertySymbols:P1e,getPrototypeOf:k1e}=Object,Xl=globalThis,YS=Xl.trustedTypes,O1e=YS?YS.emptyScript:"",yw=Xl.reactiveElementPolyfillSupport,tp=(t,e)=>t,F6={toAttribute(t,e){switch(e){case Boolean:t=t?O1e:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},BO=(t,e)=>!N1e(t,e),QS={attribute:!0,type:String,converter:F6,reflect:!1,useDefault:!1,hasChanged:BO};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Xl.litPropertyMetadata??(Xl.litPropertyMetadata=new WeakMap);let Id=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=QS){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&I1e(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){const{get:i,set:s}=x1e(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){const a=i==null?void 0:i.call(this);s==null||s.call(this,o),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??QS}static _$Ei(){if(this.hasOwnProperty(tp("elementProperties")))return;const e=k1e(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(tp("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(tp("properties"))){const r=this.properties,n=[...R1e(r),...P1e(r)];for(const i of n)this.createProperty(i,r[i])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)r.unshift(ZS(i))}else e!==void 0&&r.push(ZS(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}
vendor: 18,790 bytes, lines 111-121
111removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return T1e(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){var s;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const o=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:F6).toAttribute(r,n.type);this._$Em=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(e,r){var s,o;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const a=n.getPropertyOptions(i),c=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)==null?void 0:s.fromAttribute)!==void 0?a.converter:F6;this._$Em=i;const l=c.fromAttribute(r,a.type);this[i]=l??((o=this._$Ej)==null?void 0:o.get(i))??l,this._$Em=null}}requestUpdate(e,r,n,i=!1,s){var o;if(e!==void 0){const a=this.constructor;if(i===!1&&(s=this[e]),n??(n=a.getPropertyOptions(e)),!((n.hasChanged??BO)(s,r)||n.useDefault&&n.reflect&&s===((o=this._$Ej)==null?void 0:o.get(e))&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,o]of this._$Ep)this[s]=o;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,o]of i){const{wrapped:a}=o,c=this[s];a!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,o,c)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(r)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};Id.elementStyles=[],Id.shadowRootOptions={mode:"open"},Id[tp("elementProperties")]=new Map,Id[tp("finalized")]=new Map,yw==null||yw({ReactiveElement:Id}),(Xl.reactiveElementVersions??(Xl.reactiveElementVersions=[])).push("2.1.2");/** 112 * @license 113 * Copyright 2017 Google LLC 114 * SPDX-License-Identifier: BSD-3-Clause 115 */const rp=globalThis,e9=t=>t,Lb=rp.trustedTypes,t9=Lb?Lb.createPolicy("lit-html",{createHTML:t=>t}):void 0,FO="$lit$",Fl=`lit$${Math.random().toFixed(9).slice(2)}$`,$O="?"+Fl,M1e=`<${$O}>`,Hf=document,c1=()=>Hf.createComment(""),l1=t=>t===null||typeof t!="object"&&typeof t!="function",JE=Array.isArray,D1e=t=>JE(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",vw=`[ 116\f\r]`,C0=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,r9=/-->/g,n9=/>/g,Hu=RegExp(`>|${vw}(?:([^\\s"'>=/]+)(${vw}*=${vw}*(?:[^ 117\f\r"'\`<>=]|("|')|))|$)`,"g"),i9=/'/g,s9=/"/g,LO=/^(?:script|style|textarea|title)$/i,UO=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),PCe=UO(1),kCe=UO(2),xh=Symbol.for("lit-noChange"),Xn=Symbol.for("lit-nothing"),o9=new WeakMap,ff=Hf.createTreeWalker(Hf,129);function HO(t,e){if(!JE(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return t9!==void 0?t9.createHTML(e):e}const B1e=(t,e)=>{const r=t.length-1,n=[];let i,s=e===2?"<svg>":e===3?"<math>":"",o=C0;for(let a=0;a<r;a++){const c=t[a];let l,u,f=-1,d=0;for(;d<c.length&&(o.lastIndex=d,u=o.exec(c),u!==null);)d=o.lastIndex,o===C0?u[1]==="!--"?o=r9:u[1]!==void 0?o=n9:u[2]!==void 0?(LO.test(u[2])&&(i=RegExp("</"+u[2],"g")),o=Hu):u[3]!==void 0&&(o=Hu):o===Hu?u[0]===">"?(o=i??C0,f=-1):u[1]===void 0?f=-2:(f=o.lastIndex-u[2].length,l=u[1],o=u[3]===void 0?Hu:u[3]==='"'?s9:i9):o===s9||o===i9?o=Hu:o===r9||o===n9?o=C0:(o=Hu,i=void 0);const h=o===Hu&&t[a+1].startsWith("/>")?" ":"";s+=o===C0?c+M1e:f>=0?(n.push(l),c.slice(0,f)+FO+c.slice(f)+Fl+h):c+Fl+(f===-2?a:h)}return[HO(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class u1{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0;const a=e.length-1,c=this.parts,[l,u]=B1e(e,r);if(this.el=u1.createElement(l,n),ff.currentNode=this.el.content,r===2||r===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=ff.nextNode())!==null&&c.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(const f of i.getAttributeNames())if(f.endsWith(FO)){const d=u[o++],h=i.getAttribute(f).split(Fl),g=/([.?@])?(.*)/.exec(d);c.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?$1e:g[1]==="?"?L1e:g[1]==="@"?U1e:e2}),i.removeAttribute(f)}else f.startsWith(Fl)&&(c.push({type:6,index:s}),i.removeAttribute(f));if(LO.test(i.tagName)){const f=i.textContent.split(Fl),d=f.length-1;if(d>0){i.textContent=Lb?Lb.emptyScript:"";for(let h=0;h<d;h++)i.append(f[h],c1()),ff.nextNode(),c.push({type:2,index:++s});i.append(f[d],c1())}}}else if(i.nodeType===8)if(i.data===$O)c.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(Fl,f+1))!==-1;)c.push({type:7,index:s}),f+=Fl.length-1}s++}}static createElement(e,r){const n=Hf.createElement("template");return n.innerHTML=e,n}}function Rh(t,e,r=t,n){var o,a;if(e===xh)return e;let i=n!==void 0?(o=r._$Co)==null?void 0:o[n]:r._$Cl;const s=l1(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??(r._$Co=[]))[n]=i:r._$Cl=i),i!==void 0&&(e=Rh(t,i._$AS(t,e.values),i,n)),e}class F1e{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??Hf).importNode(r,!0);ff.currentNode=i;let s=ff.nextNode(),o=0,a=0,c=n[0];for(;c!==void 0;){if(o===c.index){let l;c.type===2?l=new ng(s,s.nextSibling,this,e):c.type===1?l=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(l=new H1e(s,this,e)),this._$AV.push(l),c=n[++a]}o!==(c==null?void 0:c.index)&&(s=ff.nextNode(),o++)}return ff.currentNode=Hf,i}p(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class ng{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=Xn,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Rh(this,e,r),l1(e)?e===Xn||e==null||e===""?(this._$AH!==Xn&&this._$AR(),this._$AH=Xn):e!==this._$AH&&e!==xh&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):D1e(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==Xn&&l1(this._$AH)?this._$AA.nextSibling.data=e:this.T(Hf.createTextNode(e)),this._$AH=e}$(e){var s;const{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=u1.createElement(HO(n.h,n.h[0]),this.options)),n);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(r);else{const o=new F1e(i,this),a=o.u(this.options);o.p(r),this.T(a),this._$AH=o}}_$AC(e){let r=o9.get(e.strings);return r===void 0&&o9.set(e.strings,r=new u1(e)),r}k(e){JE(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,i=0;for(const s of e)i===r.length?r.push(n=new ng(this.O(c1()),this.O(c1()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,r);e!==this._$AB;){const i=e9(e).nextSibling;e9(e).remove(),e=i}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class e2{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=Xn,this._$AN=void 0,this.element=e,this.name=r,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Xn}_$AI(e,r=this,n,i){const s=this.strings;let o=!1;if(s===void 0)e=Rh(this,e,r,0),o=!l1(e)||e!==this._$AH&&e!==xh,o&&(this._$AH=e);else{const a=e;let c,l;for(e=s[0],c=0;c<s.length-1;c++)l=Rh(this,a[n+c],r,c),l===xh&&(l=this._$AH[c]),o||(o=!l1(l)||l!==this._$AH[c]),l===Xn?e=Xn:e!==Xn&&(e+=(l??"")+s[c+1]),this._$AH[c]=l}o&&!i&&this.j(e)}j(e){e===Xn?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class $1e extends e2{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Xn?void 0:e}}class L1e extends e2{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Xn)}}let U1e=class extends e2{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=Rh(this,e,r,0)??Xn)===xh)return;const n=this._$AH,i=e===Xn&&n!==Xn||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Xn&&(n===Xn||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}};class H1e{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Rh(this,e)}}const ww=rp.litHtmlPolyfillSupport;ww==null||ww(u1,ng),(rp.litHtmlVersions??(rp.litHtmlVersions=[])).push("3.3.2");const j1e=(t,e,r)=>{const n=(r==null?void 0:r.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const s=(r==null?void 0:r.renderBefore)??null;n._$litPart$=i=new ng(e.insertBefore(c1(),s),s,void 0,r??{})}return i._$AI(t),i};/** 118 * @license 119 * Copyright 2017 Google LLC 120 * SPDX-License-Identifier: BSD-3-Clause 121 */const yf=globalThis;class Om extends Id{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=j1e(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return xh}}var d7;Om._$litElement$=!0,Om.finalized=!0,(d7=yf.litElementHydrateSupport)==null||d7.call(yf,{LitElement:Om});const Ew=yf.litElementPolyfillSupport;Ew==null||Ew({LitElement:Om});(yf.litElementVersions??(yf.litElementVersions=[])).push("4.2.2");const z1e={black:"#202020",white:"#FFFFFF",white010:"rgba(255, 255, 255, 0.1)",accent010:"rgba(9, 136, 240, 0.1)",accent020:"rgba(9, 136, 240, 0.2)",accent030:"rgba(9, 136, 240, 0.3)",accent040:"rgba(9, 136, 240, 0.4)",accent050:"rgba(9, 136, 240, 0.5)",accent060:"rgba(9, 136, 240, 0.6)",accent070:"rgba(9, 136, 240, 0.7)",accent080:"rgba(9, 136, 240, 0.8)",accent090:"rgba(9, 136, 240, 0.9)",accent100:"rgba(9, 136, 240, 1.0)",accentSecondary010:"rgba(199, 185, 148, 0.1)",accentSecondary020:"rgba(199, 185, 148, 0.2)",accentSecondary030:"rgba(199, 185, 148, 0.3)",accentSecondary040:"rgba(199, 185, 148, 0.4)",accentSecondary050:"rgba(199, 185, 148, 0.5)",accentSecondary060:"rgba(199, 185, 148, 0.6)",accentSecondary070:"rgba(199, 185, 148, 0.7)",accentSecondary080:"rgba(199, 185, 148, 0.8)",accentSecondary090:"rgba(199, 185, 148, 0.9)",accentSecondary100:"rgba(199, 185, 148, 1.0)",productWalletKit:"#FFB800",productAppKit:"#FF573B",productCloud:"#0988F0",productDocumentation:"#008847",neutrals050:"#F6F6F6",neutrals100:"#F3F3F3",neutrals200:"#E9E9E9",neutrals300:"#D0D0D0",neutrals400:"#BBB",neutrals500:"#9A9A9A",neutrals600:"#6C6C6C",neutrals700:"#4F4F4F",neutrals800:"#363636",neutrals900:"#2A2A2A",neutrals1000:"#252525",semanticSuccess010:"rgba(48, 164, 107, 0.1)",semanticSuccess020:"rgba(48, 164, 107, 0.2)",semanticSuccess030:"rgba(48, 164, 107, 0.3)",semanticSuccess040:"rgba(48, 164, 107, 0.4)",semanticSuccess050:"rgba(48, 164, 107, 0.5)",semanticSuccess060:"rgba(48, 164, 107, 0.6)",semanticSuccess070:"rgba(48, 164, 107, 0.7)",semanticSuccess080:"rgba(48, 164, 107, 0.8)",semanticSuccess090:"rgba(48, 164, 107, 0.9)",semanticSuccess100:"rgba(48, 164, 107, 1.0)",semanticError010:"rgba(223, 74, 52, 0.1)",semanticError020:"rgba(223, 74, 52, 0.2)",semanticError030:"rgba(223, 74, 52, 0.3)",semanticError040:"rgba(223, 74, 52, 0.4)",semanticError050:"rgba(223, 74, 52, 0.5)",semanticError060:"rgba(223, 74, 52, 0.6)",semanticError070:"rgba(223, 74, 52, 0.7)",semanticError080:"rgba(223, 74, 52, 0.8)",semanticError090:"rgba(223, 74, 52, 0.9)",semanticError100:"rgba(223, 74, 52, 1.0)",semanticWarning010:"rgba(243, 161, 63, 0.1)",semanticWarning020:"rgba(243, 161, 63, 0.2)",semanticWarning030:"rgba(243, 161, 63, 0.3)",semanticWarning040:"rgba(243, 161, 63, 0.4)",semanticWarning050:"rgba(243, 161, 63, 0.5)",semanticWarning060:"rgba(243, 161, 63, 0.6)",semanticWarning070:"rgba(243, 161, 63, 0.7)",semanticWarning080:"rgba(243, 161, 63, 0.8)",semanticWarning090:"rgba(243, 161, 63, 0.9)",semanticWarning100:"rgba(243, 161, 63, 1.0)"},Ub={core:{backgroundAccentPrimary:"#0988F0",backgroundAccentCertified:"#C7B994",backgroundWalletKit:"#FFB800",backgroundAppKit:"#FF573B",backgroundCloud:"#0988F0",backgroundDocumentation:"#008847",backgroundSuccess:"rgba(48, 164, 107, 0.20)",backgroundError:"rgba(223, 74, 52, 0.20)",backgroundWarning:"rgba(243, 161, 63, 0.20)",textAccentPrimary:"#0988F0",textAccentCertified:"#C7B994",textWalletKit:"#FFB800",textAppKit:"#FF573B",textCloud:"#0988F0",textDocumentation:"#008847",textSuccess:"#30A46B",textError:"#DF4A34",textWarning:"#F3A13F",borderAccentPrimary:"#0988F0",borderSecondary:"#C7B994",borderSuccess:"#30A46B",borderError:"#DF4A34",borderWarning:"#F3A13F",foregroundAccent010:"rgba(9, 136, 240, 0.1)",foregroundAccent020:"rgba(9, 136, 240, 0.2)",foregroundAccent040:"rgba(9, 136, 240, 0.4)",foregroundAccent060:"rgba(9, 136, 240, 0.6)",foregroundSecondary020:"rgba(199, 185, 148, 0.2)",foregroundSecondary040:"rgba(199, 185, 148, 0.4)",foregroundSecondary060:"rgba(199, 185, 148, 0.6)",iconAccentPrimary:"#0988F0",iconAccentCertified:"#C7B994",iconSuccess:"#30A46B",iconError:"#DF4A34",iconWarning:"#F3A13F",glass010:"rgba(255, 255, 255, 0.1)",zIndex:"9999"},dark:{overlay:"rgba(0, 0, 0, 0.50)",backgroundPrimary:"#202020",backgroundInvert:"#FFFFFF",textPrimary:"#FFFFFF",textSecondary:"#9A9A9A",textTertiary:"#BBBBBB",textInvert:"#202020",borderPrimary:"#2A2A2A",borderPrimaryDark:"#363636",borderSecondary:"#4F4F4F",foregroundPrimary:"#252525",foregroundSecondary:"#2A2A2A",foregroundTertiary:"#363636",iconDefault:"#9A9A9A",iconInverse:"#FFFFFF"},light:{overlay:"rgba(230 , 230, 230, 0.5)",backgroundPrimary:"#FFFFFF",borderPrimaryDark:"#E9E9E9",backgroundInvert:"#202020",textPrimary:"#202020",textSecondary:"#9A9A9A",textTertiary:"#6C6C6C",textInvert:"#FFFFFF",borderPrimary:"#E9E9E9",borderSecondary:"#D0D0D0",foregroundPrimary:"#F3F3F3",foregroundSecondary:"#E9E9E9",foregroundTertiary:"#D0D0D0",iconDefault:"#9A9A9A",iconInverse:"#202020"}},J1e={1:"4px",2:"8px",10:"10px",3:"12px",4:"16px",6:"24px",5:"20px",8:"32px",16:"64px",20:"80px",32:"128px",64:"256px",128:"512px",round:"9999px"},q1e={0:"0px","01":"2px",1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",12:"48px",14:"56px",16:"64px",20:"80px",32:"128px",64:"256px"},G1e={regular:"KHTeka",mono:"KHTekaMono"},V1e={regular:"400",medium:"500"},W1e={h1:"50px",h2:"44px",h3:"38px",h4:"32px",h5:"26px",h6:"20px",large:"16px",medium:"14px",small:"12px"},K1e={"h1-regular-mono":{lineHeight:"50px",letterSpacing:"-3px"},"h1-regular":{lineHeight:"50px",letterSpacing:"-1px"},"h1-medium":{lineHeight:"50px",letterSpacing:"-0.84px"},"h2-regular-mono":{lineHeight:"44px",letterSpacing:"-2.64px"},"h2-regular":{lineHeight:"44px",letterSpacing:"-0.88px"},"h2-medium":{lineHeight:"44px",letterSpacing:"-0.88px"},"h3-regular-mono":{lineHeight:"38px",letterSpacing:"-2.28px"},"h3-regular":{lineHeight:"38px",letterSpacing:"-0.76px"},"h3-medium":{lineHeight:"38px",letterSpacing:"-0.76px"},"h4-regular-mono":{lineHeight:"32px",letterSpacing:"-1.92px"},"h4-regular":{lineHeight:"32px",letterSpacing:"-0.32px"},"h4-medium":{lineHeight:"32px",letterSpacing:"-0.32px"},"h5-regular-mono":{lineHeight:"26px",letterSpacing:"-1.56px"},"h5-regular":{lineHeight:"26px",letterSpacing:"-0.26px"},"h5-medium":{lineHeight:"26px",letterSpacing:"-0.26px"},"h6-regular-mono":{lineHeight:"20px",letterSpacing:"-1.2px"},"h6-regular":{lineHeight:"20px",letterSpacing:"-0.6px"},"h6-medium":{lineHeight:"20px",letterSpacing:"-0.6px"},"lg-regular-mono":{lineHeight:"16px",letterSpacing:"-0.96px"},"lg-regular":{lineHeight:"18px",letterSpacing:"-0.16px"},"lg-medium":{lineHeight:"18px",letterSpacing:"-0.16px"},"md-regular-mono":{lineHeight:"14px",letterSpacing:"-0.84px"},"md-regular":{lineHeight:"16px",letterSpacing:"-0.14px"},"md-medium":{lineHeight:"16px",letterSpacing:"-0.14px"},"sm-regular-mono":{lineHeight:"12px",letterSpacing:"-0.72px"},"sm-regular":{lineHeight:"14px",letterSpacing:"-0.12px"},"sm-medium":{lineHeight:"14px",letterSpacing:"-0.12px"}}
vendor: 9,010 bytes, lines 121-125
121,X1e={"ease-out-power-2":"cubic-bezier(0.23, 0.09, 0.08, 1.13)","ease-out-power-1":"cubic-bezier(0.12, 0.04, 0.2, 1.06)","ease-in-power-2":"cubic-bezier(0.92, -0.13, 0.77, 0.91)","ease-in-power-1":"cubic-bezier(0.88, -0.06, 0.8, 0.96)","ease-inout-power-2":"cubic-bezier(0.77, 0.09, 0.23, 1.13)","ease-inout-power-1":"cubic-bezier(0.88, 0.04, 0.12, 1.06)"},Z1e={xl:"400ms",lg:"200ms",md:"125ms",sm:"75ms"},$6={colors:z1e,fontFamily:G1e,fontWeight:V1e,textSize:W1e,typography:K1e,tokens:{core:Ub.core,theme:Ub.dark},borderRadius:J1e,spacing:q1e,durations:Z1e,easings:X1e},a9="--apkt";function Yg(t){if(!t)return{};const e={};return e["font-family"]=t["--apkt-font-family"]??t["--w3m-font-family"]??"KHTeka",e.accent=t["--apkt-accent"]??t["--w3m-accent"]??"#0988F0",e["color-mix"]=t["--apkt-color-mix"]??t["--w3m-color-mix"]??"#000",e["color-mix-strength"]=t["--apkt-color-mix-strength"]??t["--w3m-color-mix-strength"]??0,e["font-size-master"]=t["--apkt-font-size-master"]??t["--w3m-font-size-master"]??"10px",e["border-radius-master"]=t["--apkt-border-radius-master"]??t["--w3m-border-radius-master"]??"4px",t["--apkt-z-index"]!==void 0?e["z-index"]=t["--apkt-z-index"]:t["--w3m-z-index"]!==void 0&&(e["z-index"]=t["--w3m-z-index"]),e}const Cc={createCSSVariables(t){const e={},r={};function n(s,o,a=""){for(const[c,l]of Object.entries(s)){const u=a?`${a}-${c}`:c;l&&typeof l=="object"&&Object.keys(l).length?(o[c]={},n(l,o[c],u)):typeof l=="string"&&(o[c]=`${a9}-${u}`)}}function i(s,o){for(const[a,c]of Object.entries(s))c&&typeof c=="object"?(o[a]={},i(c,o[a])):typeof c=="string"&&(o[a]=`var(${c})`)}return n(t,e),i(e,r),{cssVariables:e,cssVariablesVarPrefix:r}},assignCSSVariables(t,e){const r={};function n(i,s,o){for(const[a,c]of Object.entries(i)){const l=o?`${o}-${a}`:a,u=s[a];c&&typeof c=="object"?n(c,u,l):typeof u=="string"&&(r[`${a9}-${l}`]=u)}}return n(t,e),r},createRootStyles(t,e){const r={...$6,tokens:{...$6.tokens,theme:t==="light"?Ub.light:Ub.dark}},{cssVariables:n}=Cc.createCSSVariables(r),i=Cc.assignCSSVariables(n,r),s=Cc.generateW3MVariables(e),o=Cc.generateW3MOverrides(e),a=Cc.generateScaledVariables(e),c=Cc.generateBaseVariables(i),l={...i,...c,...s,...o,...a},u=Cc.applyColorMixToVariables(e,l),f={...l,...u};return`:root {${Object.entries(f).map(([h,g])=>`${h}:${g.replace("/[:;{}</>]/g","")};`).join("")}}`},generateW3MVariables(t){if(!t)return{};const e=Yg(t),r={};return r["--w3m-font-family"]=e["font-family"],r["--w3m-accent"]=e.accent,r["--w3m-color-mix"]=e["color-mix"],r["--w3m-color-mix-strength"]=`${e["color-mix-strength"]}%`,r["--w3m-font-size-master"]=e["font-size-master"],r["--w3m-border-radius-master"]=e["border-radius-master"],r},generateW3MOverrides(t){if(!t)return{};const e=Yg(t),r={};if(t["--apkt-accent"]||t["--w3m-accent"]){const n=e.accent;r["--apkt-tokens-core-iconAccentPrimary"]=n,r["--apkt-tokens-core-borderAccentPrimary"]=n,r["--apkt-tokens-core-textAccentPrimary"]=n,r["--apkt-tokens-core-backgroundAccentPrimary"]=n}return(t["--apkt-font-family"]||t["--w3m-font-family"])&&(r["--apkt-fontFamily-regular"]=e["font-family"]),e["z-index"]!==void 0&&(r["--apkt-tokens-core-zIndex"]=`${e["z-index"]}`),r},generateScaledVariables(t){if(!t)return{};const e=Yg(t),r={};if(t["--apkt-font-size-master"]||t["--w3m-font-size-master"]){const n=parseFloat(e["font-size-master"].replace("px",""));r["--apkt-textSize-h1"]=`${Number(n)*5}px`,r["--apkt-textSize-h2"]=`${Number(n)*4.4}px`,r["--apkt-textSize-h3"]=`${Number(n)*3.8}px`,r["--apkt-textSize-h4"]=`${Number(n)*3.2}px`,r["--apkt-textSize-h5"]=`${Number(n)*2.6}px`,r["--apkt-textSize-h6"]=`${Number(n)*2}px`,r["--apkt-textSize-large"]=`${Number(n)*1.6}px`,r["--apkt-textSize-medium"]=`${Number(n)*1.4}px`,r["--apkt-textSize-small"]=`${Number(n)*1.2}px`}if(t["--apkt-border-radius-master"]||t["--w3m-border-radius-master"]){const n=parseFloat(e["border-radius-master"].replace("px",""));r["--apkt-borderRadius-1"]=`${Number(n)}px`,r["--apkt-borderRadius-2"]=`${Number(n)*2}px`,r["--apkt-borderRadius-3"]=`${Number(n)*3}px`,r["--apkt-borderRadius-4"]=`${Number(n)*4}px`,r["--apkt-borderRadius-5"]=`${Number(n)*5}px`,r["--apkt-borderRadius-6"]=`${Number(n)*6}px`,r["--apkt-borderRadius-8"]=`${Number(n)*8}px`,r["--apkt-borderRadius-16"]=`${Number(n)*16}px`,r["--apkt-borderRadius-20"]=`${Number(n)*20}px`,r["--apkt-borderRadius-32"]=`${Number(n)*32}px`,r["--apkt-borderRadius-64"]=`${Number(n)*64}px`,r["--apkt-borderRadius-128"]=`${Number(n)*128}px`}return r},generateColorMixCSS(t,e){if(!(t!=null&&t["--w3m-color-mix"])||!t["--w3m-color-mix-strength"])return"";const r=t["--w3m-color-mix"],n=t["--w3m-color-mix-strength"];if(!n||n===0)return"";const i=Object.keys(e||{}).filter(o=>{const a=o.includes("-tokens-core-background")||o.includes("-tokens-core-text")||o.includes("-tokens-core-border")||o.includes("-tokens-core-foreground")||o.includes("-tokens-core-icon")||o.includes("-tokens-theme-background")||o.includes("-tokens-theme-text")||o.includes("-tokens-theme-border")||o.includes("-tokens-theme-foreground")||o.includes("-tokens-theme-icon"),c=o.includes("-borderRadius-")||o.includes("-spacing-")||o.includes("-textSize-")||o.includes("-fontFamily-")||o.includes("-fontWeight-")||o.includes("-typography-")||o.includes("-duration-")||o.includes("-ease-")||o.includes("-path-")||o.includes("-width-")||o.includes("-height-")||o.includes("-visual-size-")||o.includes("-modal-width")||o.includes("-cover");return a&&!c});return i.length===0?"":` @supports (background: color-mix(in srgb, white 50%, black)) { 122 :root { 123 ${i.map(o=>{const a=(e==null?void 0:e[o])||"";return a.includes("color-mix")||a.startsWith("#")||a.startsWith("rgb")?`${o}: color-mix(in srgb, ${r} ${n}%, ${a});`:`${o}: color-mix(in srgb, ${r} ${n}%, var(${o}-base, ${a}));`}).join("")} 124 } 125 }`},generateBaseVariables(t){const e={},r=t["--apkt-tokens-theme-backgroundPrimary"];r&&(e["--apkt-tokens-theme-backgroundPrimary-base"]=r);const n=t["--apkt-tokens-core-backgroundAccentPrimary"];return n&&(e["--apkt-tokens-core-backgroundAccentPrimary-base"]=n),e},applyColorMixToVariables(t,e){const r={};e!=null&&e["--apkt-tokens-theme-backgroundPrimary"]&&(r["--apkt-tokens-theme-backgroundPrimary"]="var(--apkt-tokens-theme-backgroundPrimary-base)"),e!=null&&e["--apkt-tokens-core-backgroundAccentPrimary"]&&(r["--apkt-tokens-core-backgroundAccentPrimary"]="var(--apkt-tokens-core-backgroundAccentPrimary-base)");const n=Yg(t),i=n["color-mix"],s=n["color-mix-strength"];if(!s||s===0)return r;const o=Object.keys(e||{}).filter(a=>{const c=a.includes("-tokens-core-background")||a.includes("-tokens-core-text")||a.includes("-tokens-core-border")||a.includes("-tokens-core-foreground")||a.includes("-tokens-core-icon")||a.includes("-tokens-theme-background")||a.includes("-tokens-theme-text")||a.includes("-tokens-theme-border")||a.includes("-tokens-theme-foreground")||a.includes("-tokens-theme-icon")||a.includes("-tokens-theme-overlay"),l=a.includes("-borderRadius-")||a.includes("-spacing-")||a.includes("-textSize-")||a.includes("-fontFamily-")||a.includes("-fontWeight-")||a.includes("-typography-")||a.includes("-duration-")||a.includes("-ease-")||a.includes("-path-")||a.includes("-width-")||a.includes("-height-")||a.includes("-visual-size-")||a.includes("-modal-width")||a.includes("-cover");return c&&!l});return o.length===0||o.forEach(a=>{const c=(e==null?void 0:e[a])||"";a.endsWith("-base")||(a==="--apkt-tokens-theme-backgroundPrimary"||a==="--apkt-tokens-core-backgroundAccentPrimary"?r[a]=`color-mix(in srgb, ${i} ${s}%, var(${a}-base))`:c.includes("color-mix")||c.startsWith("#")||c.startsWith("rgb")?r[a]=`color-mix(in srgb, ${i} ${s}%, ${c})`:r[a]=`color-mix(in srgb, ${i} ${s}%, var(${a}-base, ${c}))`)}),r}},{cssVariablesVarPrefix:Y1e}=Cc.createCSSVariables($6);function MCe(t,...e){return Bl(t,...e.map(r=>Oo(typeof r=="function"?r(Y1e):r)))}let Xu,df,Sa,Os,Hb;const vc={"KHTeka-500-woff2":"https://fonts.reown.com/KHTeka-Medium.woff2","KHTeka-400-woff2":"https://fonts.reown.com/KHTeka-Regular.woff2","KHTeka-300-woff2":"https://fonts.reown.com/KHTeka-Light.woff2","KHTekaMono-400-woff2":"https://fonts.reown.com/KHTekaMono-Regular.woff2","KHTeka-500-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTeka-400-woff":"https://fonts.reown.com/KHTeka-Regular.woff","KHTeka-300-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTekaMono-400-woff":"https://fonts.reown.com/KHTekaMono-Regular.woff"};function jb(t,e="dark"){Xu&&document.head.removeChild(Xu),Xu=document.createElement("style"),Xu.textContent=Cc.createRootStyles(e,t),document.head.appendChild(Xu)}function DCe(t,e="dark"){if(Hb=t,df=document.createElement("style"),Sa=document.createElement("style"),Os=document.createElement("style"),df.textContent=eh(t).core.cssText,Sa.textContent=eh(t).dark.cssText,Os.textContent=eh(t).light.cssText,document.head.appendChild(df),document.head.appendChild(Sa),document.head.appendChild(Os),jb(t,e),L6(e),!((t==null?void 0:t["--apkt-font-family"])||(t==null?void 0:t["--w3m-font-family"]))
125)for(const[n,i]of Object.entries(vc)){const s=document.createElement("link");s.rel="preload",s.href=i,s.as="font",s.type=n.includes("woff2")?"font/woff2":"font/woff",s.crossOrigin="anonymous",document.head.appendChild(s)}L6(e)}function L6(t="dark"){Sa&&Os&&Xu&&(t==="light"?(jb(Hb,t),Sa.removeAttribute("media"),Os.media="enabled"):(jb(Hb,t),Os.removeAttribute("media"),Sa.media="enabled"))}function Q1e(t){var e,r,n;if(Hb=t,df&&Sa&&Os){df.textContent=eh(t).core.cssText,Sa.textContent=eh(t).dark.cssText,Os.textContent=eh(t).light.cssText;const i=(t==null?void 0:t["--apkt-font-family"])||(t==null?void 0:t["--w3m-font-family"]);i&&(df.textContent=(e=df.textContent)==null?void 0:e.replace("font-family: KHTeka",`font-family: ${i}`),Sa.textContent=(r=Sa.textContent)==null?void 0:r.replace("font-family: KHTeka",`font-family: ${i}`),Os.textContent=(n=Os.textContent)==null?void 0:n.replace("font-family: KHTeka",`font-family: ${i}`))}if(Xu){const i=(Os==null?void 0:Os.media)==="enabled"?"light":"dark";jb(t,i)}}function eh(t){const e=!!(t!=null&&t["--apkt-font-family"]||t!=null&&t["--w3m-font-family"]);return{core:Bl` 126 ${e?Bl``:Bl` 127 @font-face { 128 font-family: 'KHTeka'; 129 src: 130 url(${Oo(vc["KHTeka-400-woff2"])}) format('woff2'), 131 url(${Oo(vc["KHTeka-400-woff"])}) format('woff'); 132 font-weight: 400; 133 font-style: normal; 134 font-display: swap; 135 } 136 137 @font-face { 138 font-family: 'KHTeka'; 139 src: 140 url(${Oo(vc["KHTeka-300-woff2"])}) format('woff2'), 141 url(${Oo(vc["KHTeka-300-woff"])}) format('woff'); 142 font-weight: 300; 143 font-style: normal; 144 } 145 146 @font-face { 147 font-family: 'KHTekaMono'; 148 src: 149 url(${Oo(vc["KHTekaMono-400-woff2"])}) format('woff2'), 150 url(${Oo(vc["KHTekaMono-400-woff"])}) format('woff'); 151 font-weight: 400; 152 font-style: normal; 153 } 154 155 @font-face { 156 font-family: 'KHTeka'; 157 src: 158 url(${Oo(vc["KHTeka-400-woff2"])}) format('woff2'), 159 url(${Oo(vc["KHTeka-400-woff"])}) format('woff'); 160 font-weight: 400; 161 font-style: normal; 162 } 163 `} 164 165 @keyframes w3m-shake { 166 0% { 167 transform: scale(1) rotate(0deg); 168 } 169 20% { 170 transform: scale(1) rotate(-1deg); 171 } 172 40% { 173 transform: scale(1) rotate(1.5deg); 174 } 175 60% { 176 transform: scale(1) rotate(-1.5deg); 177 } 178 80% { 179 transform: scale(1) rotate(1deg); 180 } 181 100% { 182 transform: scale(1) rotate(0deg); 183 } 184 } 185 @keyframes w3m-iframe-fade-out { 186 0% { 187 opacity: 1; 188 } 189 100% { 190 opacity: 0; 191 } 192 } 193 @keyframes w3m-iframe-zoom-in { 194 0% { 195 transform: translateY(50px); 196 opacity: 0; 197 } 198 100% { 199 transform: translateY(0px); 200 opacity: 1; 201 } 202 } 203 @keyframes w3m-iframe-zoom-in-mobile { 204 0% { 205 transform: scale(0.95); 206 opacity: 0; 207 } 208 100% { 209 transform: scale(1); 210 opacity: 1; 211 } 212 } 213 :root { 214 --apkt-modal-width: 370px; 215 216 --apkt-visual-size-inherit: inherit; 217 --apkt-visual-size-sm: 40px; 218 --apkt-visual-size-md: 55px; 219 --apkt-visual-size-lg: 80px; 220 221 --apkt-path-network-sm: path( 222 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' 223 ); 224 225 --apkt-path-network-md: path( 226 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' 227 ); 228 229 --apkt-path-network-lg: path( 230 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' 231 ); 232 233 --apkt-width-network-sm: 36px; 234 --apkt-width-network-md: 48px; 235 --apkt-width-network-lg: 86px; 236 237 --apkt-duration-dynamic: 0ms; 238 --apkt-height-network-sm: 40px; 239 --apkt-height-network-md: 54px; 240 --apkt-height-network-lg: 96px; 241 } 242 `,dark:Bl` 243 :root { 244 } 245 `,light:Bl` 246 :root { 247 } 248 `}}const BCe=Bl` 249 div, 250 span, 251 iframe, 252 a, 253 img, 254 form, 255 button, 256 label, 257 *::after, 258 *::before { 259 margin: 0; 260 padding: 0; 261 box-sizing: border-box; 262 font-style: normal; 263 text-rendering: optimizeSpeed; 264 -webkit-font-smoothing: antialiased; 265 -moz-osx-font-smoothing: grayscale; 266 -webkit-tap-highlight-color: transparent; 267 backface-visibility: hidden; 268 } 269 270 :host { 271 font-family: var(--apkt-fontFamily-regular); 272 } 273`,FCe=Bl` 274 button, 275 a { 276 cursor: pointer; 277 display: flex; 278 justify-content: center;
279 align-items: center; 280 position: relative; 281 282 will-change: background-color, color, border, box-shadow, width, height, transform, opacity; 283 outline: none; 284 border: none; 285 text-decoration: none; 286 transition: 287 background-color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 288 color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 289 border var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 290 box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 291 width var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 292 height var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 293 transform var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 294 opacity var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 295 scale var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2), 296 border-radius var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2); 297 will-change: 298 background-color, color, border, box-shadow, width, height, transform, opacity, scale, 299 border-radius; 300 } 301 302 a:active:not([disabled]), 303 button:active:not([disabled]) { 304 scale: 0.975; 305 transform-origin: center; 306 } 307 308 button:disabled { 309 cursor: default; 310 } 311 312 input { 313 border: none; 314 outline: none; 315 appearance: none; 316 } 317`;function ege(t){if(t.length>=255)throw new TypeError("Alphabet too long");const e=new Uint8Array(256);for(let l=0;l<e.length;l++)e[l]=255;for(let l=0;l<t.length;l++){const u=t.charAt(l),f=u.charCodeAt(0);if(e[f]!==255)throw new TypeError(u+" is ambiguous");e[f]=l}const r=t.length,n=t.charAt(0),i=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function o(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let u=0,f=0,d=0;const h=l.length;for(;d!==h&&l[d]===0;)d++,u++;const g=(h-d)*s+1>>>0,b=new Uint8Array(g);for(;d!==h;){let k=l[d],R=0;for(let D=g-1;(k!==0||R<f)&&D!==-1;D--,R++)k+=256*b[D]>>>0,b[D]=k%r>>>0,k=k/r>>>0;if(k!==0)throw new Error("Non-zero carry");f=R,d++}let w=g-f;for(;w!==g&&b[w]===0;)w++;let x=n.repeat(u);for(;w<g;++w)x+=t.charAt(b[w]);return x}function a(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let u=0,f=0,d=0;for(;l[u]===n;)f++,u++;const h=(l.length-u)*i+1>>>0,g=new Uint8Array(h);for(;u<l.length;){const k=l.charCodeAt(u);if(k>255)return;let R=e[k];if(R===255)return;let D=0;for(let O=h-1;(R!==0||D<d)&&O!==-1;O--,D++)R+=r*g[O]>>>0,g[O]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");d=D,u++}let b=h-d;for(;b!==h&&g[b]===0;)b++;const w=new Uint8Array(f+(h-b));let x=f;for(;b!==h;)w[x++]=g[b++];return w}function c(l){const u=a(l);if(u)return u;throw new Error("Non-base"+r+" character")}return{encode:o,decodeUnsafe:a,decode:c}}var tge="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const rge=ege(tge),Qg={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603};class nge extends PO{async setUniversalProvider(e){if(!this.namespace)throw new Error("UniversalAdapter:setUniversalProvider - namespace is required");return this.addConnector(new kO({provider:e,caipNetworks:this.getCaipNetworks(),namespace:this.namespace})),Promise.resolve()}async connect(e){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(e.chainId),provider:this.provider,address:""})}async disconnect(){try{await this.getWalletConnectConnector().disconnect(),this.emit("disconnect")}catch(e){console.warn("UniversalAdapter:disconnect - error",e)}return{connections:[]}}syncConnections(){return Promise.resolve()}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async getAccounts({namespace:e}){var i,s,o;const r=this.provider,n=(((o=(s=(i=r==null?void 0:r.session)==null?void 0:i.namespaces)==null?void 0:s[e])==null?void 0:o.accounts)||[]).filter((a,c,l)=>l.indexOf(a)===c);return Promise.resolve({accounts:n.map(a=>Ce.createAccount({caipAddress:a,type:e==="bip122"?"payment":"eoa"}))})}async syncConnectors(){return Promise.resolve()}async getBalance(e){var o,a,c,l,u;if(!(e.caipNetwork&&kt.BALANCE_SUPPORTED_CHAINS.includes((o=e.caipNetwork)==null?void 0:o.chainNamespace))||(a=e.caipNetwork)!=null&&a.testnet)return{balance:"0.00",symbol:((c=e.caipNetwork)==null?void 0:c.nativeCurrency.symbol)||""};const n=z.getAccountData();if(n!=null&&n.balanceLoading&&e.chainId===((l=z.state.activeCaipNetwork)==null?void 0:l.id))return{balance:(n==null?void 0:n.balance)||"0.00",symbol:(n==null?void 0:n.balanceSymbol)||""};const s=(await z.fetchTokenBalance()).find(f=>{var d,h;return f.chainId===`${(d=e.caipNetwork)==null?void 0:d.chainNamespace}:${e.chainId}`&&f.symbol===((h=e.caipNetwork)==null?void 0:h.nativeCurrency.symbol)});return{balance:(s==null?void 0:s.quantity.numeric)||"0.00",symbol:(s==null?void 0:s.symbol)||((u=e.caipNetwork)==null?void 0:u.nativeCurrency.symbol)||""}}async signMessage(e){var o,a,c;const{provider:r,message:n,address:i}=e;
317if(!r)throw new Error("UniversalAdapter:signMessage - provider is undefined");let s="";return((o=z.state.activeCaipNetwork)==null?void 0:o.chainNamespace)===K.CHAIN.SOLANA?s=(await r.request({method:"solana_signMessage",params:{message:rge.encode(new TextEncoder().encode(n)),pubkey:i}},(a=z.state.activeCaipNetwork)==null?void 0:a.caipNetworkId)).signature:s=await r.request({method:"personal_sign",params:[n,i]},(c=z.state.activeCaipNetwork)==null?void 0:c.caipNetworkId),{signature:s}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(e){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}emitFirstAvailableConnection(){}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(e){var i,s,o,a,c,l;const{caipNetwork:r}=e,n=this.getWalletConnectConnector();if(r.chainNamespace===K.CHAIN.EVM)try{await((i=n.provider)==null?void 0:i.request({method:"wallet_switchEthereumChain",params:[{chainId:Gc(r.id)}]}))}catch(u){if(u.code===Qg.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||u.code===Qg.ERROR_INVALID_CHAIN_ID||u.code===Qg.ERROR_CODE_DEFAULT||((o=(s=u==null?void 0:u.data)==null?void 0:s.originalError)==null?void 0:o.code)===Qg.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await((l=n.provider)==null?void 0:l.request({method:"wallet_addEthereumChain",params:[{chainId:Gc(r.id),rpcUrls:[(a=r==null?void 0:r.rpcUrls.chainDefault)==null?void 0:a.http],chainName:r.name,nativeCurrency:r.nativeCurrency,blockExplorerUrls:[(c=r.blockExplorers)==null?void 0:c.default.url]}]}))}catch{throw new Error("Chain is not supported")}}n.provider.setDefaultChain(r.caipNetworkId)}getWalletConnectProvider(){const e=this.connectors.find(n=>n.type==="WALLET_CONNECT");return e==null?void 0:e.provider}}const ige=["email","socials","swaps","onramp","activity","reownBranding","multiWallet","emailCapture","payWithExchange","payments","reownAuthentication","headless"],em={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return!!t.isEnabled&&e.includes("email")},processFallback:t=>t===void 0?kt.DEFAULT_REMOTE_FEATURES.email:!!t},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return t.isEnabled&&e.length>0?e.filter(r=>r!=="email"):!1},processFallback:t=>t===void 0?kt.DEFAULT_REMOTE_FEATURES.socials:typeof t=="boolean"?t?kt.DEFAULT_REMOTE_FEATURES.socials:!1:t},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return t.isEnabled&&e.length>0?e:!1},processFallback:t=>t===void 0?kt.DEFAULT_REMOTE_FEATURES.swaps:typeof t=="boolean"?t?kt.DEFAULT_REMOTE_FEATURES.swaps:!1:t},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>{if(!(t!=null&&t.config))return!1;const e=t.config;return t.isEnabled&&e.length>0?e:!1},processFallback:t=>t===void 0?kt.DEFAULT_REMOTE_FEATURES.onramp:typeof t=="boolean"?t?kt.DEFAULT_REMOTE_FEATURES.onramp:!1:t},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:t=>t===void 0?kt.DEFAULT_REMOTE_FEATURES.activity:!!t},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:t=>t===void 0?kt.DEFAULT_REMOTE_FEATURES.reownBranding:!!t},emailCapture:{apiFeatureName:"email_capture",localFeatureName:"emailCapture",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>t.isEnabled&&(t.config??[]),processFallback:t=>!1},multiWallet:{apiFeatureName:"multi_wallet",localFeatureName:"multiWallet",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:()=>kt.DEFAULT_REMOTE_FEATURES.multiWallet},payWithExchange:{apiFeatureName:"fund_from_exchange",localFeatureName:"payWithExchange",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:()=>kt.DEFAULT_REMOTE_FEATURES.payWithExchange},payments:{apiFeatureName:"payments",localFeatureName:"payments",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:()=>kt.DEFAULT_REMOTE_FEATURES.payments},reownAuthentication:{apiFeatureName:"reown_authentication",localFeatureName:"reownAuthentication",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:t=>typeof t>"u"?kt.DEFAULT_REMOTE_FEATURES.reownAuthentication:!!t},headless:{apiFeatureName:"headless",localFeatureName:"headless",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:t=>!!t.isEnabled,processFallback:()=>kt.DEFAULT_REMOTE_FEATURES.headless}},sge={localSettingsOverridden:new Set,getApiConfig(t,e){return e==null?void 0:e.find(r=>r.id===t)},addWarning(t,e){if(t!==void 0){const r=em[e],n=r.isLegacy?`"features.${r.localFeatureName}" (now "${e}")`:`"features.${e}"`;this.localSettingsOverridden.add(n)}},processFeature(t,e,r,n,i){const s=em[t],o=e[s.localFeatureName];if(i&&!s.isAvailableOnBasic)return!1;if(n){const a=this.getApiConfig(s.apiFeatureName,r);return(a==null?void 0:a.config)===null?this.processFallbackFeature(t,o):a!=null&&a.config?(o!==void 0&&this.addWarning(o,t),this.processApiFeature(t,a)):!1}return this.processFallbackFeature(t,o)},processApiFeature(t,e){return em[t].processApi(e)},processFallbackFeature(t,e){return em[t].processFallback(e)},async fetchRemoteFeatures(t){const e=t.basic??!1,r=t.features||{};this.localSettingsOverridden.clear();let n=null,i=!1;try{n=await Pe.fetchProjectConfig(),i=n!=null}catch(o){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",o)}const s=i&&!e?kt.DEFAULT_REMOTE_FEATURES:kt.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(const o of ige){const a=this.processFeature(o,r,n,i,e);Object.assign(s,{[o]:a})}}catch(o){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",o),kt.DEFAULT_REMOTE_FEATURES}if(i&&this.localSettingsOverridden.size>0){const o=`Your local configuration for ${Array.from(this.localSettingsOverridden).join(", ")} was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.`;bn.open({debugMessage:sn.ALERT_WARNINGS.LOCAL_CONFIGURATION_IGNORED.debugMessage(o)},"warning")}return s}};class oge{constructor(e){this.chainNamespaces=[],this.features={},this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(r,n)=>{var i,s,o;if(r){const a=(i=z.getCaipNetworks(r))==null?void 0:i.find(u=>u.id===n);if(a)return a;const c=(s=z.getNetworkData(r))==null?void 0:s.caipNetwork;return c||((o=z.getRequestedCaipNetworks(r).filter(u=>u.chainNamespace===r))==null?void 0:o[0])}return z.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{const r=this.getCaipNetwork();if(r)return r.id},this.getCaipNetworks=r=>z.getCaipNetworks(r),this.getActiveChainNamespace=()=>z.state.activeChain,this.setRequestedCaipNetworks=(r,n)=>{z.setRequestedCaipNetworks(r,n)},this.getApprovedCaipNetworkIds=()=>z.getAllApprovedCaipNetworkIds(),this.getCaipAddress=r=>{var n,i;return z.state.activeChain===r||!r?z.state.activeCaipAddress:(i=(n=z.state.chains.get(r))==null?void 0:n.accountState)==null?void 0:i.caipAddress},this.setClientId=r=>{it.setClientId(r)},this.getProvider=r=>jr.getProvider(r),this.getProviderType=r=>jr.getProviderId(r),this.getPreferredAccountType=r=>Li(r),this.setCaipAddress=(r,n,i=!1)=>{z.setAccountProp("caipAddress",r,n,i),z.setAccountProp("address",Ce.getPlainAddress(r),n,i)},this.setBalance=(r,n,i)=>{z.setAccountProp("balance",r,i),z.setAccountProp("balanceSymbol",n,i)},this.setProfileName=(r,n)=>{z.setAccountProp("profileName",r,n)},this.setProfileImage=(r,n)=>{z.setAccountProp("profileImage",r,n)},this.setUser=(r,n)=>{z.setAccountProp("user",r,n)},this.resetAccount=r=>{z.resetAccount(r)},this.setCaipNetwork=r=>{z.setActiveCaipNetwork(r)},this.setCaipNetworkOfNamespace=(r,n)=>{z.setChainNetworkData(n,{caipNetwork:r})},this.setStatus=(r,n)=>{z.setAccountProp("status",r,n),be.isConnected()?le.setConnectionStatus("connected"):le.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=r=>{var n;return(n=z.getAccountData(r))==null?void 0:n.address},this.setConnectors=r=>{const n=[...be.state.allConnectors,...r];be.setConnectors(n)},this.setConnections=(r,n)=>{le.setConnections(r,n),Ee.setConnections(r,n)},this.fetchIdentity=r=>it.fetchIdentity(r),this.getReownName=r=>ep.getNamesForAddress(r),this.getConnectors=()=>be.getConnectors(),this.getConnectorImage=r=>bb.getConnectorImage(r),this.getConnections=r=>this.remoteFeatures.multiWallet?yb.getConnectionsData(r).connections:(bn.open(K.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.getRecentConnections=r=>this.remoteFeatures.multiWallet?yb.getConnectionsData(r).recentConnections:(bn.open(K.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.switchConnection=async r=>{if(!this.remoteFeatures.multiWallet){bn.open(K.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}await Ee.switchConnection(r)},this.deleteConnection=r=>{if(!this.remoteFeatures.multiWallet){bn.open(K.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}le.deleteAddressFromConnection(r),Ee.syncStorageConnections()},this.setConnectedWalletInfo=(r,n)=>{const i=jr.getProviderId(n),s=r?{...r,type:i}:void 0;z.setAccountProp("connectedWalletInfo",s,n)},this.getIsConnectedState=()=>!!z.state.activeCaipAddress,this.addAddressLabel=(r,n,i)=>{var o;const s=((o=z.getAccountData(i))==null?void 0:o.addressLabels)||{};z.setAccountProp("addressLabels",{...s,[r]:n},i)},this.removeAddressLabel=(r,n)=>{var s;const i=((s=z.getAccountData(n))==null?void 0:s.addressLabels)||{};z.setAccountProp("addressLabels",{...i,[r]:void 0},n)},this.getAddress=r=>{var i;const n=r||z.state.activeChain;return(i=z.getAccountData(n))==null?void 0:i.address},this.resetNetwork=r=>{z.resetNetwork(r)},this.addConnector=r=>{be.addConnector(r)},this.resetWcConnection=()=>{Ee.resetWcConnection()},this.setAddressExplorerUrl=(r,n)=>{z.setAccountProp("addressExplorerUrl",r,n)},this.setSmartAccountDeployed=(r,n)=>{z.setAccountProp("smartAccountDeployed",r,n)},this.setPreferredAccountType=(r,n)=>{z.setAccountProp("preferredAccountType",r,n)},this.setEIP6963Enabled=r=>{oe.setEIP6963Enabled(r)},this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.options=e,this.version=e.sdkVersion,this.caipNetworks=this.extendCaipNetworks(e),this.chainNamespaces=this.getChainNamespacesSet(e.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(e),this.chainAdapters=this.createAdapters(e.adapters),this.readyPromise=this.initialize(e)}getChainNamespacesSet(e,r){const n=e==null?void 0:e.map(s=>s.namespace).filter(s=>!!s);if(n!=null&&n.length)return[...new Set(n)];const i=r==null?void 0:r.map(s=>s.chainNamespace);return[...new Set(i)]}async initialize(e){var r,n,i,s,o,a;if(this.initializeProjectSettings(e),this.initControllers(e),await this.initChainAdapters(),this.sendInitializeEvent(e),(r=e.features)!=null&&r.headless&&!Bi.hasInjectedConnectors()&&Pe.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1,fetchWalletRanks:!1,fetchRecommendedWallets:!0}),oe.state.enableReconnect?(await this.syncExistingConnection(),await this.syncAdapterConnections()):await this.unSyncExistingConnection(),!e.basic&&!e.manualWCControl&&(this.remoteFeatures=await sge.fetchRemoteFeatures(e)),await Pe.fetchUsage(),oe.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&U3.setOnrampProviders(this.remoteFeatures.onramp),((n=oe.state.remoteFeatures)!=null&&n.email||Array.isArray((i=oe.state.remoteFeatures)==null?void 0:i.socials)&&((s=oe.state.remoteFeatures)==null?void 0:s.socials.length)>0)&&await this.checkAllowedOrigins(),(o=oe.state.features)!=null&&o.reownAuthentication||(a=oe.state.remoteFeatures)!=null&&a.reownAuthentication){const{ReownAuthentication:c}=await Hn(()=>import("./features-7bc3306b.js"),["assets/features-7bc3306b.js","assets/ReownAuthentication-564e45de.js"]),l=oe.state.siwx;l instanceof c||(l&&console.warn("ReownAuthentication option is enabled, SIWX configuration will be overridden."),oe.setSIWX(new c))}}async openSend(e){var s;const r=e.namespace||z.state.activeChain,n=this.getCaipAddress(r),i=(s=this.getCaipNetwork(r))==null?void 0:s.id;if(!n)throw new Error("openSend: caipAddress not found");if((i==null?void 0:i.toString())!==e.chainId.toString()){const o=z.getCaipNetworkById(e.chainId,r);if(!o)throw new Error(`openSend: caipNetwork with chainId ${e.chainId} not found`);await this.switchNetwork(o,{throwOnFailure:!0})}try{const o=MO.getTokenSymbolByAddress(e.assetAddress);o&&await Pe.fetchTokenImages([o])}catch{}return await Dt.open({view:"WalletSend",data:{send:e}}),new Promise((o,a)=>{const c=Tt.subscribeKey("hash",f=>{f&&(u(),o({hash:f}))}),l=Dt.subscribe(f=>{f.open||(u(),a(new Error("Modal closed")))}),u=this.createCleanupHandler([c,l])})}toModalOptions(){function e(n){return(n==null?void 0:n.view)==="Swap"}function r(n){return(n==null?void 0:n.view)==="WalletSend"}return{isSwap:e,isSend:r}}async checkAllowedOrigins(){try{const e=await Pe.fetchAllowedOrigins();if(!Ce.isClient())return;const r=window.location.origin;Uc.isOriginAllowed(r,e,K.DEFAULT_ALLOWED_ANCESTORS)||bn.open(sn.ALERT_ERRORS.ORIGIN_NOT_ALLOWED,"error")}catch(e){if(!(e instanceof Error))return;switch(e.message){case"RATE_LIMITED":bn.open(sn.ALERT_ERRORS.RATE_LIMITED_APP_CONFIGURATION,"error");break;case"SERVER_ERROR":{const r=e.cause instanceof Error?e.cause:e;bn.open({displayMessage:sn.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.displayMessage,debugMessage:sn.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.debugMessage(r.message)},"error");break}}}}createCleanupHandler(e){return()=>{e.forEach(r=>{try{r()}catch{}})}}sendInitializeEvent(e){var n;const{...r}=e;delete r.adapters,delete r.universalProvider,gt.sendEvent({type:"track",event:"INITIALIZE",properties:{...r,networks:e.networks.map(i=>i.id),siweConfig:{options:((n=e.siweConfig)==null?void 0:n.options)||{}}}})}initControllers(e){this.initializeOptionsController(e),this.initializeChainController(e),this.initializeThemeController(e),this.initializeConnectionController(e),this.initializeConnectorController()}initAdapterController(){Bx.initialize(this.chainAdapters)}initializeThemeController(e){e.themeMode&&rs.setThemeMode(e.themeMode),e.themeVariables&&rs.setThemeVariables(e.themeVariables)}initializeChainController(e){if(!this.connectionControllerClient)throw new Error("ConnectionControllerClient must be set");z.initialize(e.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient});const r=this.getDefaultNetwork();r&&z.setActiveCaipNetwork(r)}initializeConnectionController(e){Ee.initialize(e.adapters??[]),Ee.setWcBasic(e.basic??!1)}initializeConnectorController(){be.initialize(this.chainNamespaces)}initializeProjectSettings(e){oe.setProjectId(e.projectId),oe.setSdkVersion(e.sdkVersion)}initializeOptionsController(e){var i;oe.setDebug(e.debug!==!1),oe.setEnableWalletGuide(e.enableWalletGuide!==!1),oe.setEnableWallets(e.enableWallets!==!1),oe.setEIP6963Enabled(e.enableEIP6963!==!1),oe.setEnableCoinbase(e.enableCoinbase!==!1),oe.setEnableNetworkSwitch(e.enableNetworkSwitch!==!1),oe.setEnableReconnect(e.enableReconnect!==!1),oe.setEnableMobileFullScreen(e.enableMobileFullScreen===!0),oe.setCoinbasePreference(e.coinbasePreference),oe.setEnableAuthLogger(e.enableAuthLogger!==!1),oe.setCustomRpcUrls(e.customRpcUrls),oe.setEna
317bleEmbedded(e.enableEmbedded),oe.setAllWallets(e.allWallets),oe.setIncludeWalletIds(e.includeWalletIds),oe.setExcludeWalletIds(e.excludeWalletIds),oe.setFeaturedWalletIds(e.featuredWalletIds),oe.setTokens(e.tokens),oe.setTermsConditionsUrl(e.termsConditionsUrl),oe.setPrivacyPolicyUrl(e.privacyPolicyUrl),oe.setCustomWallets(e.customWallets),oe.setFeatures(e.features),oe.setAllowUnsupportedChain(e.allowUnsupportedChain),oe.setUniversalProviderConfigOverride(e.universalProviderConfigOverride),oe.setPreferUniversalLinks(e.experimental_preferUniversalLinks),oe.setDefaultAccountTypes(e.defaultAccountTypes);const r=this.getDefaultMetaData();if(!e.metadata&&r&&(e.metadata=r),oe.setMetadata(e.metadata),oe.setDisableAppend(e.disableAppend),oe.setEnableEmbedded(e.enableEmbedded),oe.setSIWX(e.siwx),this.features=oe.state.features??{},!e.projectId){bn.open(sn.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(((i=e.adapters)==null?void 0:i.find(s=>s.namespace===K.CHAIN.EVM))&&e.siweConfig){if(e.siwx)throw new Error("Cannot set both `siweConfig` and `siwx` options");oe.setSIWX(e.siweConfig.mapToSIWX())}}getDefaultMetaData(){var e,r,n,i;return Ce.isClient()?{name:((r=(e=document.getElementsByTagName("title"))==null?void 0:e[0])==null?void 0:r.textContent)||"",description:((n=document.querySelector('meta[property="og:description"]'))==null?void 0:n.content)||"",url:window.location.origin,icons:[((i=document.querySelector('link[rel~="icon"]'))==null?void 0:i.href)||""]}:null}setUnsupportedNetwork(e){const r=this.getActiveChainNamespace();if(r){const n=wa.getUnsupportedNetwork(`${r}:${e}`);z.setActiveCaipNetwork(n)}}getDefaultNetwork(){return wa.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(e,r){return wa.extendCaipNetwork(e,{customNetworkImageUrls:r.chainImages,projectId:r.projectId})}extendCaipNetworks(e){return wa.extendCaipNetworks(e.networks,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId})}extendDefaultCaipNetwork(e){const r=e.networks.find(i=>{var s;return i.id===((s=e.defaultNetwork)==null?void 0:s.id)});return r?wa.extendCaipNetwork(r,{customNetworkImageUrls:e.chainImages,customRpcUrls:e.customRpcUrls,projectId:e.projectId}):void 0}async disconnectConnector(e,r){var n,i;try{this.setLoading(!0,e);let s={connections:[]};const o=this.getAdapter(e);return(((i=(n=z.state.chains.get(e))==null?void 0:n.accountState)==null?void 0:i.caipAddress)||!oe.state.enableReconnect)&&(o!=null&&o.disconnect)&&(s=await o.disconnect({id:r})),this.setLoading(!1,e),s}catch(s){throw this.setLoading(!1,e),new Error(`Failed to disconnect chains: ${s.message}`)}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{var l;const e=z.state.activeChain,r=this.getAdapter(e),n=(l=this.getCaipNetwork(e))==null?void 0:l.id,i=Ee.getConnections(e),s=this.remoteFeatures.multiWallet,o=i.length>0;if(!r)throw new Error("Adapter not found");const a=await r.connectWalletConnect(n);(!o||!s)&&this.close(),this.setClientId((a==null?void 0:a.clientId)||null),le.setConnectedNamespaces([...z.state.chains.keys()]),await this.syncWalletConnectAccount(),await ks.initializeIfEnabled()},connectExternal:async e=>{const r=await this.onConnectExternal(e);return await this.connectInactiveNamespaces(e,r),r?{address:r.address}:void 0},reconnectExternal:async({id:e,info:r,type:n,provider:i})=>{var a;const s=z.state.activeChain,o=this.getAdapter(s);if(!s)throw new Error("reconnectExternal: namespace not found");if(!o)throw new Error("reconnectExternal: adapter not found");o!=null&&o.reconnect&&(await(o==null?void 0:o.reconnect({id:e,info:r,type:n,provider:i,chainId:(a=this.getCaipNetwork())==null?void 0:a.id})),le.addConnectedNamespace(s),this.syncConnectedWalletInfo(s))},disconnectConnector:async e=>{await this.disconnectConnector(e.namespace,e.id)},disconnect:async e=>{var l;const{id:r,chainNamespace:n,initialDisconnect:i}=e||{},s=n||z.state.activeChain,o=be.getConnectorId(s),a=r===K.CONNECTOR_ID.AUTH||o===K.CONNECTOR_ID.AUTH,c=r===K.CONNECTOR_ID.WALLET_CONNECT||o===K.CONNECTOR_ID.WALLET_CONNECT;try{const u=Array.from(z.state.chains.keys());let f=n?[n]:u;(c||a)&&(f=u);const d=f.map(async b=>{const w=be.getConnectorId(b),x=r||w,k=await this.disconnectConnector(b,x);k&&(a&&le.deleteConnectedSocialProvider(),k.connections.forEach(R=>{le.addDisconnectedConnectorId(R.connectorId,b)})),i&&this.onDisconnectNamespace({chainNamespace:b,closeModal:!1})}),h=await Promise.allSettled(d);
317Tt.resetSend(),Ee.resetWcConnection(),(l=ks.getSIWX())!=null&&l.signOutOnDisconnect&&await ks.clearSessions(),be.setFilterByNamespace(void 0),Ee.syncStorageConnections();const g=h.filter(b=>b.status==="rejected");if(g.length>0)throw new Error(g.map(b=>b.reason.message).join(", "));gt.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:n||"all"}})}catch(u){throw new Error(`Failed to disconnect chains: ${u.message}`)}},checkInstalled:e=>e?e.some(r=>{var n;return!!((n=window.ethereum)!=null&&n[String(r)])}):!!window.ethereum,signMessage:async e=>{const r=z.state.activeChain,n=this.getAdapter(z.state.activeChain);if(!r)throw new Error("signMessage: namespace not found");if(!n)throw new Error("signMessage: adapter not found");const i=this.getAddress(r);if(!i)throw new Error("signMessage: address not found");const s=await(n==null?void 0:n.signMessage({message:e,address:i,provider:jr.getProvider(r)}));return(s==null?void 0:s.signature)||""},sendTransaction:async e=>{const r=e.chainNamespace;if(!r)throw new Error("sendTransaction: namespace not found");if(kt.SEND_SUPPORTED_NAMESPACES.includes(r)){const n=this.getAdapter(r);if(!n)throw new Error("sendTransaction: adapter not found");const i=jr.getProvider(r),s=await(n==null?void 0:n.sendTransaction({...e,caipNetwork:this.getCaipNetwork(),provider:i}));return(s==null?void 0:s.hash)||""}return""},estimateGas:async e=>{const r=e.chainNamespace;if(r===K.CHAIN.EVM){const n=this.getAdapter(r);if(!n)throw new Error("estimateGas: adapter is required but got undefined");const i=jr.getProvider(r),s=this.getCaipNetwork();if(!s)throw new Error("estimateGas: caipNetwork is required but got undefined");const o=await(n==null?void 0:n.estimateGas({...e,provider:i,caipNetwork:s}));return(o==null?void 0:o.gas)||0n}return 0n},getEnsAvatar:async()=>{var i;const e=z.state.activeChain;if(!e)throw new Error("getEnsAvatar: namespace is required but got undefined");const r=this.getAddress(e);if(!r)throw new Error("getEnsAvatar: address not found");await this.syncIdentity({address:r,chainId:Number((i=this.getCaipNetwork())==null?void 0:i.id),chainNamespace:e});const n=z.getAccountData();return(n==null?void 0:n.profileImage)||!1},getEnsAddress:async e=>await Uc.resolveReownName(e),writeContract:async e=>{const r=z.state.activeChain,n=this.getAdapter(r);if(!r)throw new Error("writeContract: namespace is required but got undefined");if(!n)throw new Error("writeContract: adapter is required but got undefined");const i=this.getCaipNetwork(),s=this.getCaipAddress(),o=jr.getProvider(r);if(!i||!s)throw new Error("writeContract: caipNetwork or caipAddress is required but got undefined");const a=await(n==null?void 0:n.writeContract({...e,caipNetwork:i,provider:o,caipAddress:s}));return a==null?void 0:a.hash},writeSolanaTransaction:async e=>{const r=z.state.activeChain,n=this.getAdapter(r);if(!r)throw new Error("writeContract: namespace is required but got undefined");if(!n)throw new Error("writeContract: adapter is required but got undefined");const i=this.getCaipNetwork(),s=this.getCaipAddress(),o=jr.getProvider(r);if(!i||!s)throw new Error("writeContract: caipNetwork or caipAddress is required but got undefined");const a=await(n==null?void 0:n.writeSolanaTransaction({...e,caipNetwork:i,provider:o,caipAddress:s}));return a==null?void 0:a.hash},parseUnits:(e,r)=>{const n=this.getAdapter(z.state.activeChain);if(!n)throw new Error("parseUnits: adapter is required but got undefined");return(n==null?void 0:n.parseUnits({value:e,decimals:r}))??0n},formatUnits:(e,r)=>{const n=this.getAdapter(z.state.activeChain);if(!n)throw new Error("formatUnits: adapter is required but got undefined");return(n==null?void 0:n.formatUnits({value:e,decimals:r}))??"0"},getCapabilities:async e=>{const r=this.getAdapter(z.state.activeChain);if(!r)throw new Error("getCapabilities: adapter is required but got undefined");return await(r==null?void 0:r.getCapabilities(e))},grantPermissions:async e=>{const r=this.getAdapter(z.state.activeChain);if(!r)throw new Error("grantPermissions: adapter is required but got undefined");return await(r==null?void 0:r.grantPermissions(e))},revokePermissions:async e=>{const r=this.getAdapter(z.state.activeChain);if(!r)throw new Error("revokePermissions: adapter is required but got undefined");return r!=null&&r.revokePermissions?await r.revokePermissions(e):"0x"},walletGetAssets:async e=>{const r=this.getAdapter(z.state.activeChain);if(!r)throw new Error("walletGetAssets: adapter is required but got undefined");return await(r==null?void 0:r.walletGetAssets(e))??{}},updateBalance:e=>{const r=this.getAddress(e),n=this.getCaipNetwork(e);!n||!r||this.updateNativeBalance(r,n==null?void 0:n.id,e)}},Ee.setClient(this.connectionControllerClient)}async onConnectExternal(e){var l,u,f,d,h,g,b,w;const r=z.state.activeChain,n=e.chain||r,i=this.getAdapter(n);let s=!0;if(e.type===Or.CONNECTOR_TYPE_AUTH&&K.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(R=>be.getConnectorId(R)===K.CONNECTOR_ID.AUTH)&&e.chain!==r&&(s=!1),e.chain&&e.chain!==r&&!e.caipNetwork){const x=this.getCaipNetworks().find(k=>k.chainNamespace===e.chain);x&&s&&this.setCaipNetwork(x)}if(!n)throw new Error("connectExternal: namespace not found");if(!i)throw new Error("connectExternal: adapter not found");const o=this.getCaipNetwork(n),a=e.caipNetwork||o,c=await i.connect({id:e.id,address:e.address,info:e.info,type:e.type,provider:e.provider,socialUri:e.socialUri,chainId:((l=e.caipNetwork)==null?void 0:l.id)||(o==null?void 0:o.id),rpcUrl:((h=(d=(f=(u=e.caipNetwork)==null?void 0:u.rpcUrls)==null?void 0:f.default)==null?void 0:d.http)==null?void 0:h[0])||((w=(b=(g=o==null?void 0:o.rpcUrls)==null?void 0:g.default)==null?void 0:b.http)==null?void 0:w[0])});if(c)return le.addConnectedNamespace(n),this.syncProvider({...c,chainNamespace:n}),this.setStatus("connected",n),this.syncConnectedWalletInfo(n),le.removeDisconnectedConnectorId(e.id,n),{address:c.address,connectedCaipNetwork:a}}async connectInactiveNamespaces(e,r){var a;const n=e.type===Or.CONNECTOR_TYPE_AUTH,i=Mc.getOtherAuthNamespaces((a=r==null?void 0:r.connectedCaipNetwork)==null?void 0:a.chainNamespace),s=z.state.activeCaipNetwork,o=this.getAdapter(s==null?void 0:s.chainNamespace);n&&(await Promise.all(i.map(async c=>{var l,u,f;try{const d=jr.getProvider(c),h=this.getCaipNetwork(c),g=this.getAdapter(c);await(g==null?void 0:g.connect({...e,provider:d,socialUri:void 0,chainId:h==null?void 0:h.id,rpcUrl:(f=(u=(l=h==null?void 0:h.rpcUrls)==null?void 0:l.default)==null?void 0:u.http)==null?void 0:f[0]}))&&(le.addConnectedNamespace(c),le.removeDisconnectedConnectorId(e.id,c),this.setStatus("connected",c),this.syncConnectedWalletInfo(c))}catch(d){bn.warn(sn.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.displayMessage,sn.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.debugMessage(c,d instanceof Error?d.message:void 0),sn.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.code)}})),s&&await(o==null?void 0:o.switchNetwork({caipNetwork:s})))}getApprovedCaipNetworksData(){var r,n,i,s,o;if(jr.getProviderId(z.state.activeChain)===Or.CONNECTOR_TYPE_WALLET_CONNECT){const a=(n=(r=this.universalProvider)==null?void 0:r.session)==null?void 0:n.namespaces;return{supportsAllNetworks:((o=(s=(i=this.universalProvider)==null?void 0:i.session)==null?void 0:s.peer)==null?void 0:o.metadata.name)==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(a)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(e){const r=e.chainNamespace;if(this.getAddressByChainNamespace(e.chainNamespace)){const i=jr.getProviderId(r);if(e.chainNamespace===z.state.activeChain){const s=this.getAdapter(r);await(s==null?void 0:s.switchNetwork({caipNetwork:e}))}else if(this.setCaipNetwork(e),i===Or.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{const s=this.getAddressByChainNamespace(r);s&&this.syncAccount({address:s,chainId:e.id,chainNamespace:r})}}else this.setCaipNetwork(e)}
317getChainsFromNamespaces(e={}){return Object.values(e).flatMap(r=>{const n=r.chains||[],i=r.accounts.map(s=>{const{chainId:o,chainNamespace:a}=kn.parseCaipAddress(s);return`${a}:${o}`});return Array.from(new Set([...n,...i]))})}createAdapters(e){return this.createClients(),this.chainNamespaces.reduce((r,n)=>{var s,o;const i=e==null?void 0:e.find(a=>a.namespace===n);return i?(i.construct({namespace:n,projectId:(s=this.options)==null?void 0:s.projectId,networks:(o=this.caipNetworks)==null?void 0:o.filter(({chainNamespace:a})=>a===n)}),r[n]=i):r[n]=new nge({namespace:n,networks:this.getCaipNetworks()}),r},{})}async initChainAdapter(e){this.onConnectors(e),this.listenAdapter(e);const r=this.getAdapter(e);if(!r)throw new Error("adapter not found");await r.syncConnectors(),await this.createUniversalProviderForAdapter(e)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async e=>{await this.initChainAdapter(e)})),this.initAdapterController()}onConnectors(e){const r=this.getAdapter(e);r==null||r.on("connectors",this.setConnectors.bind(this))}listenAdapter(e){const r=this.getAdapter(e);if(!r)return;const n=le.getConnectionStatus();oe.state.enableReconnect===!1?this.setStatus("disconnected",e):n==="connected"?this.setStatus("connecting",e):n==="disconnected"?(le.clearAddressCache(),this.setStatus(n,e)):this.setStatus(n,e),r.on("switchNetwork",({address:i,chainId:s})=>{var l,u;const o=this.getCaipNetworks().find(f=>f.id.toString()===s.toString()||f.caipNetworkId.toString()===s.toString()),a=z.state.activeChain===e,c=(u=(l=z.state.chains.get(e))==null?void 0:l.accountState)==null?void 0:u.address;if(o){const f=a&&i?i:c;f&&this.syncAccount({address:f,chainId:o.id,chainNamespace:e})}else this.setUnsupportedNetwork(s)}),r.on("disconnect",()=>{const i=this.remoteFeatures.multiWallet,s=Array.from(Ee.state.connections.values()).flat();this.onDisconnectNamespace({chainNamespace:e,closeModal:!i||s.length===0})}),r.on("connections",i=>{this.setConnections(i,e)}),r.on("pendingTransactions",()=>{const i=this.getAddress(e),s=z.state.activeCaipNetwork;!i||!(s!=null&&s.id)||this.updateNativeBalance(i,s.id,s.chainNamespace)}),r.on("accountChanged",({address:i,chainId:s,connector:o})=>{var u,f;this.handlePreviousConnectorConnection(o);const a=z.state.activeChain===e;o!=null&&o.provider&&(this.syncProvider({id:o.id,type:o.type,provider:o==null?void 0:o.provider,chainNamespace:e}),this.syncConnectedWalletInfo(e));const c=(f=(u=z.getNetworkData(e))==null?void 0:u.caipNetwork)==null?void 0:f.id,l=s||c;a&&l?this.syncAccount({address:i,chainId:l,chainNamespace:e}):!a&&l?(this.syncAccountInfo(i,l,e),this.syncBalance({address:i,chainId:l,chainNamespace:e})):this.syncAccountInfo(i,s,e),le.addConnectedNamespace(e)})}async handlePreviousConnectorConnection(e){var c;const r=e==null?void 0:e.chain,n=e==null?void 0:e.id,i=be.getConnectorId(r),s=(c=oe.state.remoteFeatures)==null?void 0:c.multiWallet,a=r&&n&&i&&i!==n&&!s;try{a&&await Ee.disconnect({id:i,namespace:r})}catch(l){console.warn("Error disconnecting previous connector",l)}}async createUniversalProviderForAdapter(e){var r,n,i;await this.getUniversalProvider(),this.universalProvider&&await((i=(n=(r=this.chainAdapters)==null?void 0:r[e])==null?void 0:n.setUniversalProvider)==null?void 0:i.call(n,this.universalProvider))}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(e=>this.syncNamespaceConnection(e)))}async unSyncExistingConnection(){try{await Promise.allSettled(this.chainNamespaces.map(e=>Ee.disconnect({namespace:e,initialDisconnect:!0})))}catch(e){console.error("Error disconnecting existing connections:",e)}}async reconnectWalletConnect(){await this.syncWalletConnectAccount();const e=this.getAddress();this.getCaipAddress()||le.deleteRecentWallet();const r=le.getRecentWallet();gt.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:Ce.isMobile()?"mobile":"qrcode",name:(r==null?void 0:r.name)||"Unknown",reconnect:!0,view:ze.state.view,walletRank:r==null?void 0:r.order}})}async syncNamespaceConnection(e){try{e===K.CHAIN.EVM&&Ce.isSafeApp()&&be.setConnectorId(K.CONNECTOR_ID.SAFE,e);const r=be.getConnectorId(e);switch(this.setStatus("connecting",e),r){case K.CONNECTOR_ID.WALLET_CONNECT:await this.reconnectWalletConnect();break;case K.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(e)}}catch(r){console.warn("AppKit couldn't sync existing connection",r),this.setStatus("disconnected",e)}}onDisconnectNamespace(e){const{chainNamespace:r,closeModal:n}=e||{};z.resetAccount(r),z.resetNetwork(r),le.removeConnectedNamespace(r);const i=Array.from(z.state.chains.keys());
317(r?[r]:i).forEach(o=>le.addDisconnectedConnectorId(be.getConnectorId(o)||"",o)),be.removeConnectorId(r),jr.resetChain(r),this.setUser(null,r),this.setStatus("disconnected",r),this.setConnectedWalletInfo(null,r),n!==!1&&Dt.close()}async syncAdapterConnections(){await Promise.allSettled(this.chainNamespaces.map(e=>{const r=this.getAdapter(e),n=this.getCaipAddress(e),i=this.getCaipNetwork(e);return r==null?void 0:r.syncConnections({connectToFirstConnector:!n,caipNetwork:i})}))}async syncAdapterConnection(e){var a,c,l,u,f;const r=this.getAdapter(e),n=this.getCaipNetwork(e),i=be.getConnectorId(e),o=be.getConnectors(e).find(d=>d.id===i);try{if(!r||!o)throw new Error(`Adapter or connector not found for namespace ${e}`);if(!(n!=null&&n.id))throw new Error("CaipNetwork not found");const d=await(r==null?void 0:r.syncConnection({namespace:e,id:o.id,chainId:n.id,rpcUrl:(l=(c=(a=n==null?void 0:n.rpcUrls)==null?void 0:a.default)==null?void 0:c.http)==null?void 0:l[0]}));d?(this.syncProvider({...d,chainNamespace:e}),await this.syncAccount({...d,chainNamespace:e}),this.setStatus("connected",e),gt.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:d.address,properties:{method:"browser",name:((u=o.info)==null?void 0:u.name)||o.name||"Unknown",reconnect:!0,view:ze.state.view,walletRank:(f=o==null?void 0:o.explorerWallet)==null?void 0:f.order}})):this.setStatus("disconnected",e)}catch{this.onDisconnectNamespace({chainNamespace:e,closeModal:!1})}}async syncWalletConnectAccount(){var n,i;const e=Object.keys(((i=(n=this.universalProvider)==null?void 0:n.session)==null?void 0:i.namespaces)||{}),r=this.chainNamespaces.map(async s=>{var f,d,h,g,b;const o=this.getAdapter(s);if(!o)return;const a=((g=(h=(d=(f=this.universalProvider)==null?void 0:f.session)==null?void 0:d.namespaces)==null?void 0:h[s])==null?void 0:g.accounts)||[],c=(b=z.state.activeCaipNetwork)==null?void 0:b.id,l=a.find(w=>{const{chainId:x}=kn.parseCaipAddress(w);return x===(c==null?void 0:c.toString())})||a[0];if(l){const w=kn.validateCaipAddress(l),{chainId:x,address:k}=kn.parseCaipAddress(w);if(jr.setProviderId(s,Or.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&z.state.activeCaipNetwork&&o.namespace!==K.CHAIN.EVM){const R=o.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:z.state.activeCaipNetwork});jr.setProvider(s,R)}else jr.setProvider(s,this.universalProvider);be.setConnectorId(K.CONNECTOR_ID.WALLET_CONNECT,s),le.addConnectedNamespace(s),await this.syncAccount({address:k,chainId:x,chainNamespace:s})}else e.includes(s)&&this.setStatus("disconnected",s);const u=this.getApprovedCaipNetworksData();this.syncConnectedWalletInfo(s),z.setApprovedCaipNetworksData(s,{approvedCaipNetworkIds:u.approvedCaipNetworkIds,supportsAllNetworks:u.supportsAllNetworks})});await Promise.all(r)}syncProvider({type:e,provider:r,id:n,chainNamespace:i}){jr.setProviderId(i,e),jr.setProvider(i,r),be.setConnectorId(n,i)}async syncAccount(e){var f,d;const r=e.chainNamespace===z.state.activeChain,n=z.getCaipNetworkByNamespace(e.chainNamespace,e.chainId),{address:i,chainId:s,chainNamespace:o}=e,{chainId:a}=le.getActiveNetworkProps(),c=(n==null?void 0:n.id)||a,l=((f=z.state.activeCaipNetwork)==null?void 0:f.name)===K.UNSUPPORTED_NETWORK_NAME,u=z.getNetworkProp("supportsAllNetworks",o);if(this.setStatus("connected",o),!(l&&!u)&&c){let h=this.getCaipNetworks().find(x=>x.id.toString()===c.toString()),g=this.getCaipNetworks().find(x=>x.chainNamespace===o);if(!u&&!h&&!g){const x=this.getApprovedCaipNetworkIds()||[],k=x.find(D=>{var O;return((O=kn.parseCaipNetworkId(D))==null?void 0:O.chainId)===c.toString()}),R=x.find(D=>{var O;return((O=kn.parseCaipNetworkId(D))==null?void 0:O.chainNamespace)===o});h=this.getCaipNetworks().find(D=>D.caipNetworkId===k),g=this.getCaipNetworks().find(D=>D.caipNetworkId===R||"deprecatedCaipNetworkId"in D&&D.deprecatedCaipNetworkId===R)}const b=h||g;(b==null?void 0:b.chainNamespace)===z.state.activeChain?oe.state.enableNetworkSwitch&&!oe.state.allowUnsupportedChain&&((d=z.state.activeCaipNetwork)==null?void 0:d.name)===K.UNSUPPORTED_NETWORK_NAME?z.showUnsupportedChainUI():this.setCaipNetwork(b):r||n&&this.setCaipNetworkOfNamespace(n,o),this.syncConnectedWalletInfo(o);const w=this.getAddress(o);Mc.isLowerCaseMatch(i,w)||this.syncAccountInfo(i,b==null?void 0:b.id,o),r?await this.syncBalance({address:i,chainId:b==null?void 0:b.id,chainNamespace:o}):await this.syncBalance({address:i,chainId:n==null?void 0:n.id,chainNamespace:o}),this.syncIdentity({address:i,chainId:s,chainNamespace:o})}}async syncAccountInfo(e,r,n){const i=this.getCaipAddress(n),s=r||(i==null?void 0:i.split(":")[1]);if(!s)return;const o=`${n}:${s}:${e}`;this.setCaipAddress(o,n,!0),await this.syncIdentity({address:e,chainId:s,chainNamespace:n})}async syncReownName(e,r){try{const n=await this.getReownName(e);
317if(n[0]){const i=n[0];this.setProfileName(i.name,r)}else this.setProfileName(null,r)}catch{this.setProfileName(null,r)}}syncConnectedWalletInfo(e){var i;const r=be.getConnectorId(e),n=jr.getProviderId(e);if(n===Or.CONNECTOR_TYPE_ANNOUNCED||n===Or.CONNECTOR_TYPE_INJECTED){if(r){const o=this.getConnectors().find(a=>{var f,d;const c=a.id===r,l=((f=a.info)==null?void 0:f.rdns)===r,u=(d=a.connectors)==null?void 0:d.some(h=>{var g;return h.id===r||((g=h.info)==null?void 0:g.rdns)===r});return c||l||!!u});if(o){const{info:a,name:c,imageUrl:l}=o,u=l||this.getConnectorImage(o);this.setConnectedWalletInfo({name:c,icon:u,...a},e)}}}else if(n===Or.CONNECTOR_TYPE_WALLET_CONNECT){const s=jr.getProvider(e);s!=null&&s.session&&this.setConnectedWalletInfo({...s.session.peer.metadata,name:s.session.peer.metadata.name,icon:(i=s.session.peer.metadata.icons)==null?void 0:i[0]},e)}else if(r&&(r===K.CONNECTOR_ID.COINBASE_SDK||r===K.CONNECTOR_ID.COINBASE)){const s=this.getConnectors().find(l=>l.id===r),o=(s==null?void 0:s.name)||"Coinbase Wallet",a=(s==null?void 0:s.imageUrl)||this.getConnectorImage(s),c=s==null?void 0:s.info;this.setConnectedWalletInfo({...c,name:o,icon:a},e)}}async syncBalance(e){!wp.getNetworksByNamespace(this.getCaipNetworks(),e.chainNamespace).find(n=>{var i;return n.id.toString()===((i=e.chainId)==null?void 0:i.toString())})||!e.chainId||await this.updateNativeBalance(e.address,e.chainId,e.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(e,r,n){const i=this.getAdapter(n),s=z.getCaipNetworkByNamespace(n,r);if(i){const o=await i.getBalance({address:e,chainId:r,caipNetwork:s,tokens:this.options.tokens});return this.setBalance(o.balance,o.symbol,n),o}}async initializeUniversalAdapter(){var i,s,o,a,c,l,u,f,d,h;const e=C1e.createLogger((g,...b)=>{g&&this.handleAlertError(g),console.error(...b)}),r={projectId:(i=this.options)==null?void 0:i.projectId,metadata:{name:(s=this.options)!=null&&s.metadata?(o=this.options)==null?void 0:o.metadata.name:"",description:(a=this.options)!=null&&a.metadata?(c=this.options)==null?void 0:c.metadata.description:"",url:(l=this.options)!=null&&l.metadata?(u=this.options)==null?void 0:u.metadata.url:"",icons:(f=this.options)!=null&&f.metadata?(d=this.options)==null?void 0:d.metadata.icons:[""]},logger:e};oe.setManualWCControl(!!((h=this.options)!=null&&h.manualWCControl)),this.universalProvider=this.options.universalProvider??await Vpe.init(r);const n=this.universalProvider.disconnect.bind(this.universalProvider);this.universalProvider.disconnect=async()=>{try{return await n()}catch(g){if(g instanceof Error&&g.message.includes("Missing or invalid. Record was recently deleted"))return;throw g}},oe.state.enableReconnect===!1&&this.universalProvider.session&&await this.universalProvider.disconnect(),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&this.chainNamespaces.forEach(e=>{Uc.listenWcProvider({universalProvider:this.universalProvider,namespace:e,onDisplayUri:r=>{Ee.setUri(r)},onConnect:r=>{const{address:n}=Ce.getAccount(r[0]);for(const i of this.chainNamespaces)le.removeDisconnectedConnectorId(K.CONNECTOR_ID.WALLET_CONNECT,i);Ee.finalizeWcConnection(n)},onDisconnect:()=>{z.state.noAdapters&&this.resetAccount(e),Ee.resetWcConnection()},onChainChanged:r=>{const n=z.state.activeChain,i=n&&be.state.activeConnectorIds[n]===K.CONNECTOR_ID.WALLET_CONNECT;if(n===e&&(z.state.noAdapters||i)){const s=this.getCaipNetworks().find(a=>a.id.toString()===r.toString()||a.caipNetworkId.toString()===r.toString()),o=this.getCaipNetwork();if(!s){this.setUnsupportedNetwork(r);return}(o==null?void 0:o.id.toString())!==(s==null?void 0:s.id.toString())&&(o==null?void 0:o.chainNamespace)===(s==null?void 0:s.chainNamespace)&&this.setCaipNetwork(s)}},onAccountsChanged:r=>{const n=z.state.activeChain,i=n&&be.state.activeConnectorIds[n]===K.CONNECTOR_ID.WALLET_CONNECT;if(n===e&&(z.state.noAdapters||i)){const s=r==null?void 0:r[0];s&&this.syncAccount({address:s.address,chainId:s.chainId,chainNamespace:s.chainNamespace})}}})})}createUniversalProvider(){var e;
vendor: 4,180 bytes, line 317
317return!this.universalProviderInitPromise&&Ce.isClient()&&((e=this.options)!=null&&e.projectId)&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(e){gt.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:e instanceof Error?e.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",e)}return this.universalProvider}getDisabledCaipNetworks(){const e=z.getAllApprovedCaipNetworkIds(),r=z.getAllRequestedCaipNetworks();return Ce.sortRequestedNetworks(e,r).filter(i=>z.isCaipNetworkDisabled(i))}handleAlertError(e){const r=Object.entries(sn.UniversalProviderErrors).find(([,{message:a}])=>e.message.includes(a)),[n,i]=r??[],{message:s,alertErrorKey:o}=i??{};if(n&&s&&!this.reportedAlertErrors[n]){const a=sn.ALERT_ERRORS[o];a&&(bn.open(a,"error"),this.reportedAlertErrors[n]=!0)}}getAdapter(e){var r;if(e)return(r=this.chainAdapters)==null?void 0:r[e]}createAdapter(e){var i,s;if(!e)return;const r=e.namespace;if(!r)return;this.createClients();const n=e;n.namespace=r,n.construct({namespace:r,projectId:(i=this.options)==null?void 0:i.projectId,networks:(s=this.caipNetworks)==null?void 0:s.filter(({chainNamespace:o})=>o===r)}),this.chainNamespaces.includes(r)||this.chainNamespaces.push(r),this.chainAdapters&&(this.chainAdapters[r]=n)}async open(e){await this.injectModalUi(),e!=null&&e.uri&&Ee.setUri(e.uri);const{isSwap:r,isSend:n}=this.toModalOptions();return r(e)?Dt.open({...e,data:{swap:e.arguments}}):n(e)&&e.arguments?this.openSend(e.arguments):Dt.open(e)}async close(){await this.injectModalUi(),Dt.close()}setLoading(e,r){Dt.setLoading(e,r)}async disconnect(e){await Ee.disconnect({namespace:e})}getSIWX(){return oe.state.siwx}getError(){return""}getChainId(){var e;return(e=z.state.activeCaipNetwork)==null?void 0:e.id}async switchNetwork(e,{throwOnFailure:r=!1}={}){const n=this.getCaipNetworks().find(i=>i.id===e.id);if(!n){bn.open(sn.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await z.switchActiveNetwork(n,{throwOnFailure:r})}getWalletProvider(){return z.state.activeChain?jr.state.providers[z.state.activeChain]:null}getWalletProviderType(){return jr.getProviderId(z.state.activeChain)}subscribeProviders(e){return jr.subscribeProviders(e)}getThemeMode(){return rs.state.themeMode}getThemeVariables(){return rs.state.themeVariables}setThemeMode(e){rs.setThemeMode(e),L6(rs.state.themeMode)}setTermsConditionsUrl(e){oe.setTermsConditionsUrl(e)}setPrivacyPolicyUrl(e){oe.setPrivacyPolicyUrl(e)}setThemeVariables(e){rs.setThemeVariables(e),Q1e(rs.state.themeVariables)}subscribeTheme(e){return rs.subscribe(e)}subscribeConnections(e){return this.remoteFeatures.multiWallet?Ee.subscribe(e):(bn.open(K.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),()=>{})}getWalletInfo(e){var n,i;if(e)return(i=(n=z.state.chains.get(e))==null?void 0:n.accountState)==null?void 0:i.connectedWalletInfo;const r=z.getAccountData();return r==null?void 0:r.connectedWalletInfo}getAccount(e){const r=e||z.state.activeChain,n=be.getAuthConnector(r),i=z.getAccountData(r),s=le.getConnectedConnectorId(z.state.activeChain),o=Ee.getConnections(r);if(!r)throw new Error("AppKit:getAccount - namespace is required");const a=o.flatMap(c=>{const{caipNetwork:l}=c;return l?c.accounts.map(({address:u,type:f,publicKey:d})=>Ce.createAccount({caipAddress:`${l.caipNetworkId}:${u}`,type:f||"eoa",publicKey:d})):[]});if(i)return{allAccounts:a,caipAddress:i.caipAddress,address:Ce.getPlainAddress(i.caipAddress),isConnected:!!i.caipAddress,status:i.status,embeddedWalletInfo:n&&s===K.CONNECTOR_ID.AUTH?{user:i.user?{...i.user,username:le.getConnectedSocialUsername()}:void 0,authProvider:i.socialProvider||"email",accountType:Li(r),isSmartAccountDeployed:!!i.smartAccountDeployed}:void 0}}subscribeAccount(e,r){const n=[],i=()=>{const o=this.getAccount(r);o&&e(o)};if(r){const o=z.subscribeChainProp("accountState",i,r);n.push(o)}else{const o=z.subscribe(i);n.push(o)}const s=be.subscribe(i);return n.push(s),()=>
317{n.forEach(o=>o())}}subscribeNetwork(e){return z.subscribe(({activeCaipNetwork:r})=>{e({caipNetwork:r,chainId:r==null?void 0:r.id,caipNetworkId:r==null?void 0:r.caipNetworkId})})}subscribeWalletInfo(e,r){return r?z.subscribeChainProp("accountState",n=>e(n==null?void 0:n.connectedWalletInfo),r):z.subscribeChainProp("accountState",n=>e(n==null?void 0:n.connectedWalletInfo))}subscribeShouldUpdateToAddress(e){return z.subscribeChainProp("accountState",r=>e(r==null?void 0:r.shouldUpdateToAddress))}subscribeCaipNetworkChange(e){return z.subscribeKey("activeCaipNetwork",e)}getState(){return Bs.state}getRemoteFeatures(){return oe.state.remoteFeatures}subscribeState(e){return Bs.subscribe(e)}subscribeRemoteFeatures(e){return oe.subscribeKey("remoteFeatures",e)}showErrorMessage(e){_a.showError(e)}showSuccessMessage(e){_a.showSuccess(e)}getEvent(){return{...gt.state}}subscribeEvents(e){return gt.subscribe(e)}replace(e){ze.replace(e)}redirect(e){ze.push(e)}popTransactionStack(e){ze.popTransactionStack(e)}isOpen(){return Dt.state.open}isTransactionStackEmpty(){return ze.state.transactionStack.length===0}static getInstance(){return this.instance}updateFeatures(e){oe.setFeatures(e)}updateRemoteFeatures(e){oe.setRemoteFeatures(e)}updateOptions(e){const n={...oe.state||{},...e};oe.setOptions(n)}setConnectMethodsOrder(e){oe.setConnectMethodsOrder(e)}setWalletFeaturesOrder(e){oe.setWalletFeaturesOrder(e)}setCollapseWallets(e){oe.setCollapseWallets(e)}setSocialsOrder(e){oe.setSocialsOrder(e)}getConnectMethodsOrder(){return Ll.getConnectOrderMethod(oe.state.features,be.getConnectors())}addNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);const n=this.extendCaipNetwork(r,this.options);this.getCaipNetworks().find(i=>i.id===n.id)||z.addNetwork(n)}removeNetwork(e,r){if(this.chainAdapters&&!this.chainAdapters[e])throw new Error(`Adapter for namespace ${e} doesn't exist`);this.getCaipNetworks().find(i=>i.id===r)&&z.removeNetwork(e,r)}}let c9=!1;class age extends oge{async onAuthProviderConnected(e){const r=Mc.userChainIdToChainNamespace(e==null?void 0:e.chainId);if(e.message&&e.signature&&e.siwxMessage&&await ks.addEmbeddedWalletSession({chainId:e.siwxMessage.chainId,accountAddress:e.address,notBefore:e.siwxMessage.notBefore,statement:e.siwxMessage.statement,resources:e.siwxMessage.resources,requestId:e.siwxMessage.requestId,issuedAt:e.siwxMessage.issuedAt,domain:e.siwxMessage.domain,uri:e.siwxMessage.uri,version:e.siwxMessage.version,nonce:e.siwxMessage.nonce},e.message,e.signature),!r)throw new Error("AppKit:onAuthProviderConnected - namespace is required");const n=r===K.CHAIN.EVM?`eip155:${e.chainId}:${e.address}`:`${e.chainId}:${e.address}`,i=oe.state.defaultAccountTypes[r],s=Li(r),o=e.preferredAccountType||s||i;this.setCaipAddress(n,r);const{signature:a,siwxMessage:c,message:l,...u}=e,f=z.getAccountData(r);this.setUser({...(f==null?void 0:f.user)||{},...u},r),this.setSmartAccountDeployed(!!e.smartAccountDeployed,r),this.setPreferredAccountType(o,r),await Promise.all([this.syncAuthConnectorTheme(this.authProvider),this.syncAccount({address:e.address,chainId:e.chainId,chainNamespace:r})]),this.setLoading(!1,r)}setupAuthConnectorListeners(e){e.onRpcRequest(r=>{Ms.checkIfRequestExists(r)?Ms.checkIfRequestIsSafe(r)||this.handleUnsafeRPCRequest():(this.open(),console.error(Tn.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:r.method}),setTimeout(()=>{this.showErrorMessage(Tn.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),e.rejectRpcRequests())}),e.onRpcError(()=>{this.isOpen()&&(this.isTransactionStackEmpty()?this.close():this.popTransactionStack("error"))}),e.onRpcSuccess((r,n)=>{const i=Ms.checkIfRequestIsSafe(n),s=this.getAddress(),o=z.state.activeCaipNetwork;i||(s&&(o!=null&&o.id)&&this.updateNativeBalance(s,o.id,o.chainNamespace),this.isTransactionStackEmpty()?this.close():this.popTransactionStack("success"))}),e.onNotConnected(()=>{const r=z.state.activeChain;if(!r)throw new Error("AppKit:onNotConnected - namespace is required");be.getConnectorId(r)===K.CONNECTOR_ID.AUTH&&(this.setCaipAddress(null,r),this.setLoading(!1,r))}),e.onConnect(this.onAuthProviderConnected.bind(this)),e.onSocialConnected(this.onAuthProviderConnected.bind(this)),e.onSetPreferredAccount(({address:r,type:n})=>{const i=z.state.activeChain;if(!i)throw new Error("AppKit:onSetPreferredAccount - namespace is required");r&&this.setPreferredAccountType(n,i)})}async syncAuthConnectorTheme(e){if(!e)return;const r=rs.getSnapshot();await e.syncTheme({themeMode:r.themeMode,themeVariables:r.themeVariables,w3mThemeVariables:Ep(r.themeVariables,r.themeMode)})}async syncAuthConnector(e,r){var u,f,d,h,g,b,w,x,k;const n=K.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(r),i=r===z.state.activeChain;if(!n)return;this.setLoading(!0,r);const s=e.getLoginEmailUsed();this.setLoading(s,r),s&&this.setStatus("connecting",r);const o=e.getEmail(),a=e.getUsername(),c=((u=z.getAccountData(r))==null?void 0:u.user)||{};this.setUser({...c,username:a,email:o},r),this.setupAuthConnectorListeners(e);const{isConnected:l}=await e.isConnected();if(r&&n&&i)if(l&&((f=this.connectionControllerClient)!=null&&f.connectExternal)){await e.init(
317),await this.syncAuthConnectorTheme(e),await((g=this.connectionControllerClient)==null?void 0:g.connectExternal({id:K.CONNECTOR_ID.AUTH,info:{name:K.CONNECTOR_ID.AUTH},type:Or.CONNECTOR_TYPE_AUTH,provider:e,chainId:(h=(d=z.getNetworkData(r))==null?void 0:d.caipNetwork)==null?void 0:h.id,chain:r})),this.setStatus("connected",r);const R=le.getConnectedSocialProvider();R?gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",address:this.getAddress(),properties:{provider:R,reconnect:!0}}):gt.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:this.getAddress(),properties:{method:"email",name:((k=(x=(w=(b=this.universalProvider)==null?void 0:b.session)==null?void 0:w.peer)==null?void 0:x.metadata)==null?void 0:k.name)||"Unknown",reconnect:!0,view:ze.state.view,walletRank:void 0}})}else be.getConnectorId(r)===K.CONNECTOR_ID.AUTH&&(this.setStatus("disconnected",r),le.removeConnectedNamespace(r));this.setLoading(!1,r)}async checkExistingTelegramSocialConnection(e){var r;try{if(!Ce.isTelegram())return;const n=le.getTelegramSocialProvider();if(!n||!Ce.isClient())return;const s=new URL(window.location.href).searchParams.get("result_uri");if(!s)return;n&&z.setAccountProp("socialProvider",n,e),await((r=this.authProvider)==null?void 0:r.init());const o=be.getAuthConnector();n&&o&&(this.setLoading(!0,e),await Ee.connectExternal({id:o.id,type:o.type,socialUri:s},o.chain),le.setConnectedSocialProvider(n),le.removeTelegramSocialProvider(),gt.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:n}}))}catch(n){this.setLoading(!1,e),console.error("checkExistingSTelegramocialConnection error",n)}try{const n=new URL(window.location.href);n.searchParams.delete("result_uri"),window.history.replaceState({},document.title,n.toString())}catch(n){console.error("tma social login failed",n)}}createAuthProvider(e){var l,u,f,d;if(!K.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e))return;const n=(l=this.remoteFeatures)==null?void 0:l.email,i=Array.isArray((u=this.remoteFeatures)==null?void 0:u.socials)&&this.remoteFeatures.socials.length>0,s=n||i,a=Mc.getActiveNamespaceConnectedToAuth()||e;!this.authProvider&&((f=this.options)!=null&&f.projectId)&&s&&(this.authProvider=bf.getInstance({projectId:this.options.projectId,enableLogger:this.options.enableAuthLogger,chainId:(d=this.getCaipNetwork(a))==null?void 0:d.caipNetworkId,abortController:sn.EmbeddedWalletAbortController,onTimeout:h=>{h==="iframe_load_failed"?bn.open(sn.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):h==="iframe_request_timeout"?bn.open(sn.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):h==="unverified_domain"&&bn.open(sn.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:h=>kc(h),getCaipNetworks:h=>z.getCaipNetworks(h)}),Bs.subscribeOpen(h=>{var g;!h&&this.isTransactionStackEmpty()&&((g=this.authProvider)==null||g.rejectRpcRequests())}));const c=e===z.state.activeChain&&oe.state.enableReconnect;oe.state.enableReconnect===!1?this.syncAuthConnectorTheme(this.authProvider):this.authProvider&&c&&(this.syncAuthConnector(this.authProvider,e),this.checkExistingTelegramSocialConnection(e))}createAuthProviderForAdapter(e){var r,n,i;this.createAuthProvider(e),this.authProvider&&((i=(n=(r=this.chainAdapters)==null?void 0:r[e])==null?void 0:n.setAuthProvider)==null||i.call(n,this.authProvider))}initControllers(e){super.initControllers(e),this.options.excludeWalletIds&&Pe.initializeExcludedWallets({ids:this.options.excludeWalletIds})}async switchCaipNetwork(e){var o,a,c;if(!e)return;const r=z.state.activeChain,n=e.chainNamespace,i=this.getAddressByChainNamespace(n);if(n===r&&((o=z.getAccountData(n))!=null&&o.caipAddress)){const l=this.getAdapter(n);await(l==null?void 0:l.switchNetwork({caipNetwork:e})),this.setCaipNetwork(e)}else{const u=jr.getProviderId(r)===Or.CONNECTOR_TYPE_AUTH,f=jr.getProviderId(n),d=f===Or.CONNECTOR_TYPE_AUTH,h=K.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(n);if(!n)throw new Error("AppKit:switchCaipNetwork - networkNamespace is required");if((u&&f===void 0||d)&&h)try{if(z.state.activeChain=e.chainNamespace,i){const g=this.getAdapter(n);await(g==null?void 0:g.switchNetwork({caipNetwork:e}))}else await((c=(a=this.connectionControllerClient)==null?void 0:a.connectExternal)==null?void 0:c.call(a,{id:K.CONNECTOR_ID.AUTH,provider:this.authProvider,chain:n,chainId:e.id,type:Or.CONNECTOR_TYPE_AUTH,caipNetwork:e}));this.setCaipNetwork(e)}catch{const b=this.getAdapter(n);await(b==null?void 0:b.switchNetwork({caipNetwork:e}))}else if(f===Or.CONNECTOR_TYPE_WALLET_CONNECT){if(!z.state.noAdapters){const g=this.getAdapter(n);await(g==null?void 0:g.switchNetwork({caipNetwork:e}))}this.setCaipNetwork(e),this.syncWalletConnectAccount()}else this.setCaipNetwork(e),i&&this.syncAccount({address:i,chainId:e.id,chainNamespace:n})}}async initialize(e){var r;await super.initialize(e),(r=this.chainNamespaces)==null||r.forEach(n=>{this.createAuthProviderForAdapter(n)}
317),await this.injectModalUi(),Bs.set({initialized:!0})}async syncIdentity({address:e,chainId:r,chainNamespace:n}){var a;if(n!==K.CHAIN.EVM)return;const i=`${n}:${r}`,s=(a=this.caipNetworks)==null?void 0:a.find(c=>c.caipNetworkId===i);if(s!=null&&s.testnet){this.setProfileName(null,n),this.setProfileImage(null,n);return}const o=be.getConnectorId(n)===K.CONNECTOR_ID.AUTH;try{const{name:c,avatar:l}=await this.fetchIdentity({address:e});!c&&o?await this.syncReownName(e,n):(this.setProfileName(c,n),this.setProfileImage(l,n))}catch{r!==1&&this.setProfileImage(null,n)}}syncConnectedWalletInfo(e){const r=jr.getProviderId(e);if(r===Or.CONNECTOR_TYPE_AUTH){const n=this.authProvider;if(n){const i=le.getConnectedSocialProvider()??"email",s=n.getEmail()??n.getUsername();this.setConnectedWalletInfo({name:r,identifier:s,social:i},e)}}else super.syncConnectedWalletInfo(e)}async injectModalUi(){if(!Ce.isClient())return;const e={...kt.DEFAULT_FEATURES,...this.options.features};if(!e.headless&&!c9)try{const r=this.remoteFeatures;if(await this.loadModalComponents(e,r),Ce.isClient()&&!document.querySelector("w3m-modal")){const i=document.createElement("w3m-modal");!oe.state.disableAppend&&!oe.state.enableEmbedded&&document.body.insertAdjacentElement("beforeend",i)}c9=!0}catch(r){console.error("Error injecting modal UI:",r)}}async loadModalComponents(e,r){if(!Ce.isClient())return;const n=[];(r.email||r.socials&&r.socials.length>0)&&n.push(Hn(()=>import("./embedded-wallet-c2cd7109.js"),["assets/embedded-wallet-c2cd7109.js","assets/class-map-57c26684.js","assets/index-58ba9dd2.js","assets/index-500b0381.js","assets/if-defined-2b5452c9.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-f85de7b6.js","assets/HelpersUtil-be76ffbc.js","assets/ConstantsUtil-daa30fef.js","assets/index-ee2d6e6a.js","assets/index-ed56e219.js","assets/index-d63e03b8.js","assets/index-0299b85a.js","assets/index-ce39da69.js","assets/NavigationUtil-a0d0ce87.js"])),r.email&&n.push(Hn(()=>import("./email-10b1f5e7.js"),["assets/email-10b1f5e7.js","assets/index-58ba9dd2.js","assets/class-map-57c26684.js","assets/index-ceb326db.js","assets/index-ce39da69.js","assets/index-f85de7b6.js","assets/index-0299b85a.js","assets/if-defined-2b5452c9.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-d63e03b8.js","assets/index-280db21d.js","assets/index-ee2d6e6a.js"])),r.socials&&n.push(Hn(()=>import("./socials-fc4659df.js"),["assets/socials-fc4659df.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-b73fc515.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-c3173778.js","assets/index-0299b85a.js","assets/ConstantsUtil-daa30fef.js","assets/index-d63e03b8.js","assets/index-f85de7b6.js","assets/index-620310d8.js","assets/index-500b0381.js","assets/browser-e933942f.js","assets/index-260c9722.js"])),r.swaps&&r.swaps.length>0&&n.push(Hn(()=>import("./swaps-37432651.js"),["assets/swaps-37432651.js","assets/class-map-57c26684.js","assets/index-58ba9dd2.js","assets/index-d63e03b8.js","assets/index-f85de7b6.js","assets/index-0299b85a.js","assets/if-defined-2b5452c9.js","assets/index-5af1a01b.js","assets/SwapController-0aba0753.js","assets/index-260c9722.js","assets/index-8db34e28.js","assets/index-500b0381.js","assets/MathUtil-b514a570.js","assets/index-ee2d6e6a.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js"])),e.send&&n.push(Hn(()=>import("./send-7c9dbcc9.js"),["assets/send-7c9dbcc9.js","assets/class-map-57c26684.js","assets/index-58ba9dd2.js","assets/index-d63e03b8.js","assets/index-f85de7b6.js","assets/index-0299b85a.js","assets/if-defined-2b5452c9.js","assets/index-505527ce.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-4126b73f.js","assets/index-ce39da69.js","assets/index-8db34e28.js","assets/index-500b0381.js","assets/index-260c9722.js","assets/SwapController-0aba0753.js","assets/index-ee2d6e6a.js","assets/index-316b2327.js","assets/index-8e53d37b.js"])),e.receive&&n.push(Hn(()=>import("./receive-6cc4193b.js"),["assets/receive-6cc4193b.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-500b0381.js","assets/index-620310d8.js","assets/browser-e933942f.js"])),r.onramp&&r.onramp.length>0&&n.push(Hn(()=>import("./onramp-f18945e8.js"),["assets/onramp-f18945e8.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-bcf2b4f9.js","assets/index-f85de7b6.js","assets/index-b73fc515.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-500b0381.js","assets/index-5c26c4fa.js","assets/index-1548ea37.js","assets/index-ce39da69.js","assets/index-d63e03b8.js","assets/index-0299b85a.js","assets/index-ee2d6e6a.js"])),r.payWithExchange&&n.push(Hn(()=>import("./pay-with-exchange-4ea690df.js"),["assets/pay-with-exchange-4ea690df.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-500b0381.js","assets/index-ed56e219.js","assets/index-bcf2b4f9.js","assets/index-f85de7b6.js","assets/index-260c9722.js","assets/index-d63e03b8.js","assets/index-4126b73f.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-ce39da69.js","assets/ExchangeController-f76837e0.js","assets/index-0299b85a.js","assets/index-ee2d6e6a.js","assets/index-316b2327.js","assets/index-505527ce.js"])),r.activity&&n.push(Hn(()=>import("./transactions-57f3b158.js"),["assets/transactions-57f3b158.js","assets/index-58ba9dd2.js","assets/class-map-57c26684.js","assets/index-6479a043.js","assets/index-0299b85a.js","assets/if-defined-2b5452c9.js","assets/index-ce39da69.js","assets/index-500b0381.js","assets/index-260c9722.js"])),(e.pay||r.payments)&&n.push(Hn(()=>import("./index-c36b4367.js"),["assets/index-c36b4367.js","assets/index-491a2786.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-d63e03b8.js","assets/index-f85de7b6.js","assets/index-ed56e219.js","assets/index-500b0381.js","assets/index-bcf2b4f9.js","assets/index-65cbe616.js","assets/index-0299b85a.js","assets/index-505527ce.js","assets/index-260c9722.js","assets/MathUtil-b514a570.js"])),r.emailCapture&&n.push(Hn(()=>import("./data-capture-022c60ff.js"),["assets/data-capture-022c60ff.js","assets/class-map-57c26684.js","assets/index-58ba9dd2.js","assets/index-ceb326db.js","assets/index-ce39da69.js","assets/index-f85de7b6.js","assets/ReownAuthentication-564e45de.js"])),await Promise.all([...n,Hn(()=>import("./index-c215a615.js"),["assets/index-c215a615.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-500b0381.js","assets/index-f85de7b6.js","assets/index-8e53d37b.js","assets/index-0299b85a.js","assets/index-9d78ffe6.js","assets/index-1548ea37.js","assets/index-ce39da69.js","assets/HelpersUtil-be76ffbc.js","assets/ConstantsUtil-daa30fef.js","assets/index-65cbe616.js","assets/index-ed56e219.js","assets/index-bcf2b4f9.js","assets/index-d63e03b8.js","assets/ExchangeController-f76837e0.js","assets/index-6479a043.js","assets/index-260c9722.js","assets/index-316b2327.js","assets/index-5af1a01b.js","assets/MathUtil-b514a570.js","assets/index-505527ce.js","assets/ref-e1e6c463.js","assets/async-directive-73fd2c02.js","assets/index-ee2d6e6a.js","assets/index-280db21d.js","assets/index-b73fc515.js","assets/index-c3173778.js","assets/index-620310d8.js","assets/browser-e933942f.js","assets/NavigationUtil-a0d0ce87.js","assets/index-5c26c4fa.js"]),Hn(()=>import("./w3m-modal-e1ead98d.js"),["assets/w3m-modal-e1ead98d.js","assets/class-map-57c26684.js","assets/if-defined-2b5452c9.js","assets/index-58ba9dd2.js","assets/index-491a2786.js","assets/index-d63e03b8.js","assets/index-f85de7b6.js","assets/index-ed56e219.js","assets/index-500b0381.js","assets/index-bcf2b4f9.js","assets/index-65cbe616.js","assets/index-0299b85a.js","assets/index-505527ce.js","assets/index-260c9722.js","assets/MathUtil-b514a570.js","assets/HelpersUtil-be76ffbc.js","assets/ConstantsUtil-daa30fef.js","assets/index-5af1a01b.js","assets/index-9d78ffe6.js","assets/index-1548ea37.js","assets/index-ce39da69.js","assets/SwapController-0aba0753.js"])])}}const cge="1.8.19";function lge(t){return new age({...t,sdkVersion:Ce.generateSdkVersion(t.adapters??[],"html",cge)})}function gs(t,e,r){const n=t[e.name];if(typeof n=="function")return n;const i=t[r];return typeof i=="function"?i:s=>e(t,s)}const Mm="3.4.2",uge=()=>`@wagmi/core@${Mm}`;var jO=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");
317return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},zb,zO;class Ko extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return uge()}constructor(e,r={}){var s;super(),zb.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=r.cause instanceof Ko?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof Ko&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` 318`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return jO(this,zb,"m",zO).call(this,this,e)}}zb=new WeakSet,zO=function t(e,r){return r!=null&&r(e)?e:e.cause?jO(this,zb,"m",t).call(this,e.cause,r):e};class f1 extends Ko{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class fge extends Ko{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class dge extends Ko{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class hge extends Ko{constructor({address:e,connector:r}){super(`Account "${e}" not found for connector "${r.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class pge extends Ko{constructor({connectionChainId:e,connectorChainId:r}){super(`The current chain of the connector (id: ${r}) does not match the connection's chain (id: ${e}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class gge extends Ko{constructor({connector:e}){super(`Connector "${e.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function Aw(t,e){var n;let r;if(typeof e.connector=="function"?r=t._internal.connectors.setup(e.connector):r=e.connector,r.uid===t.state.current)throw new fge;try{t.setState(a=>({...a,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const{connector:i,...s}=e,o=await r.connect(s);return r.emitter.off("connect",t._internal.events.connect),r.emitter.on("change",t._internal.events.change),r.emitter.on("disconnect",t._internal.events.disconnect),await((n=t.storage)==null?void 0:n.setItem("recentConnectorId",r.id)),t.setState(a=>({...a,connections:new Map(a.connections).set(r.uid,{accounts:s.withCapabilities?o.accounts.map(c=>typeof c=="object"?c.address:c):o.accounts,chainId:o.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:s.withCapabilities?o.accounts.map(a=>typeof a=="object"?a:{address:a,capabilities:{}}):o.accounts,chainId:o.chainId}}catch(i){throw t.setState(s=>({...s,status:s.current?"connected":"disconnected"})),i}}async function t2(t,e={}){const{assertChainId:r=!0}=e;let n;if(e.connector){const{connector:u}=e;if(t.state.status==="reconnecting"&&!u.getAccounts&&!u.getChainId)throw new gge({connector:u});const[f,d]=await Promise.all([u.getAccounts().catch(h=>{if(e.account===null)return[];throw h}),u.getChainId()]);n={accounts:f,chainId:d,connector:u}}else n=t.state.connections.get(t.state.current);if(!n)throw new dge;const i=e.chainId??n.chainId,s=await n.connector.getChainId();if(r&&s!==i)throw new pge({connectionChainId:i,connectorChainId:s});const o=n.connector;if(o.getClient)return o.getClient({chainId:i});const a=so(e.account??n.accounts[0]);if(a&&(a.address=rf(a.address)),e.account&&!n.accounts.some(u=>u.toLowerCase()===a.address.toLowerCase()))throw new hge({address:a.address,connector:o});const c=t.chains.find(u=>u.id===i),l=await n.connector.getProvider({chainId:i});return Tx({account:a,chain:c,name:"Connector Client",transport:u=>$K(l)({...u,retryCount:0})})}async function U6(t,e={}){var i,s;let r;if(e.connector)r=e.connector;else{const{connections:o,current:a}=t.state,c=o.get(a);r=c==null?void 0:c.connector}const n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(o=>{if(n.size===0)return{...o,connections:new Map,current:null,status:"disconnected"};const a=n.values().next().value;return{...o,connections:new Map(n),current:a.connector.uid}});{const o=t.state.current;if(!o)return;const a=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!a)return;await((s=t.storage)==null?void 0:s.setItem("recentConnectorId",a.id
318))}}async function mge(t,e){const{chainId:r,connector:n,...i}=e;let s;e.account?s=e.account:s=(await t2(t,{account:e.account,assertChainId:!1,chainId:r,connector:n})).account;const o=t.getClient({chainId:r});return gs(o,QI,"estimateGas")({...i,account:s})}async function bge(t,e){const{address:r,blockNumber:n,blockTag:i,chainId:s}=e,o=t.getClient({chainId:s}),c=await gs(o,CK,"getBalance")(n?{address:r,blockNumber:n}:{address:r,blockTag:i}),l=t.chains.find(u=>u.id===s)??o.chain;return{decimals:l.nativeCurrency.decimals,symbol:l.nativeCurrency.symbol,value:c}}function d1(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!d1(t[n],e[n]))return!1;return!0}if(typeof t.valueOf=="function"&&t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(typeof t.toString=="function"&&t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.hasOwn(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!d1(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function th(t){const e=t.state.current,r=t.state.connections.get(e),n=r==null?void 0:r.accounts,i=n==null?void 0:n[0],s=t.chains.find(a=>a.id===(r==null?void 0:r.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}let tm=[];function wc(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||d1(tm,e)?tm:(tm=e,e)}function yge(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return gs(i,aK,"getEnsAddress")(n)}function vge(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return gs(i,EK,"getEnsAvatar")(n)}function wge(t,e){const{chainId:r,...n}=e,i=t.getClient({chainId:r});return gs(i,AK,"getEnsName")(n)}function Ege(t,e={}){const{chainId:r}=e,n=t.getClient({chainId:r});return gs(n,D5,"getGasPrice")({})}async function Age(t,e){const{account:r,chainId:n,...i}=e,s=r??th(t).address,o=t.getClient({chainId:n});return gs(o,$5,"prepareTransactionRequest")({...i,...s?{account:s}:{}})}let _w=!1;async function Dm(t,e={}){var l,u;if(_w)return[];_w=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let d;typeof f=="function"?d=t._internal.connectors.setup(f):d=f,r.push(d)}else r.push(...t.connectors);let n;try{n=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,d)=>(i[f.id]??10)-(i[d.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const d=await f.getProvider().catch(()=>{});if(!d||c.some(b=>b===d)||!await f.isAuthorized())continue;const g=await f.connect({isReconnecting:!0}).catch(()=>null);g&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(b=>{const w=new Map(o?b.connections:new Map).set(f.uid,{accounts:g.accounts,chainId:g.chainId,connector:f});return{...b,current:o?b.current:f.uid,connections:w}}),a.push({accounts:g.accounts,chainId:g.chainId,connector:f}),c.push(d),o=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:null,status:"disconnected"}))),_w=!1,a}async function _ge(t,e){const{account:r,chainId:n,connector:i,...s}=e;let o;typeof r=="object"&&(r==null?void 0:r.type)==="local"?o=t.getClient({chainId:n}):o=await t2(t,{account:r??void 0,assertChainId:!1,chainId:n,connector:i});const a=(()=>{var u;return!n||((u=o.chain)==null?void 0:u.id)===n?o.chain:{id:n}})();return await gs(o,_x,"sendTransaction")({...s,...r?{account:r}:{},assertChainId:!!n,chain:a,gas:s.gas??void 0})}async function JO(t,e){const{account:r,connector:n,...i}=e;let s;return typeof r=="object"&&r.type==="local"?s=t.getClient():s=await t2(t,{account:r,connector:n}),gs(s,FK,"signMessage")({...i,...r?{account:r}:{}})}class xl extends Ko{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class Cge extends Ko{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function l9(t,e){var o;const{addEthereumChainParameter:r,chainId:n}=e,i=t.state.connections.get(((o=e.connector)==null?void 0:o.uid)??t.state.current);if(i){const a=i.connector;if(!a.switchChain)throw new Cge({connector:a});return await a.switchChain({addEthereumChainParameter:r,chainId:n})}const s=t.chains.find(a=>a.id===n);if(!s)throw new f1;return t.setState(a=>({...a,chainId:n})),s}async function qO(t,e){const{chainId:r,timeout:n=0,...i}=e,s=t.getClient({chainId:r}),a=await gs(s,DK,"waitForTransactionReceipt")({...i,timeout:n});if(a.status==="reverted"){const c=gs(s,kx,"getTransaction"),{from:l,...u}=await c({hash:a.transactionHash}),d=await gs(s,z5,"call")({...u,account:l,data:u.input,gasPrice:u.type!=="eip1559"?u.gasPrice:void 0,maxFeePerGas:u.type==="eip1559"?u.maxFeePerGas:void 0,maxPriorityFeePerGas:u.type==="eip1559"?u.maxPriorityFeePerGas:void 0}),h=d!=null&&d.data?uI(`0x${d.data.substring(138)}`):"unknown reason";throw new Error(h)}return{...a,chainId:s.chain.id}}function GO(t,e){const{onChange:r}=e;return t.subscribe(()=>th(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return d1(o,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function Sge(t,e){const{onChange:r}=e;return t.subscribe(()=>wc(t),r,{equalityFn:d1})}function Tge(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}function Nge(t,e){const{syncConnectedChain:r=t._internal.syncConnectedChain,...n}=e;let i;const s=c=>{i&&i();const l=t.getClient({chainId:c});return i=gs(l,BK,"watchPendingTransactions")(n),i},o=s(e.chainId);let a;return r&&!e.chainId&&(a=t.subscribe(({chainId:c})=>c,async c=>
318s(c))),()=>{o==null||o(),a==null||a()}}async function VO(t,e){const{account:r,chainId:n,connector:i,...s}=e;let o;typeof r=="object"&&(r==null?void 0:r.type)==="local"?o=t.getClient({chainId:n}):o=await t2(t,{account:r??void 0,assertChainId:!1,chainId:n,connector:i});const a=(()=>{var u;return!n||((u=o.chain)==null?void 0:u.id)===n?o.chain:{id:n}})();return await gs(o,gb,"writeContract")({...s,...r?{account:r}:{},assertChainId:!!n,chain:a})}function $Ce(t){return t}r2.type="injected";function r2(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:r}=t;function n(){const c=t.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...Ige[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l==null?void 0:l.ethereum}}}let i,s,o,a;return c=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:r2.type,async setup(){const l=await this.getProvider();l!=null&&l.on&&t.target&&(o||(o=this.onConnect.bind(this),l.on("connect",o)),i||(i=this.onAccountsChanged.bind(this),l.on("accountsChanged",i)))},async connect({chainId:l,isReconnecting:u,withCapabilities:f}={}){var g,b,w,x,k,R;const d=await this.getProvider();if(!d)throw new xl;let h=[];if(u)h=await this.getAccounts().catch(()=>[]);else if(e)try{h=(x=(w=(b=(g=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:g.caveats)==null?void 0:b[0])==null?void 0:w.value)==null?void 0:x.map(O=>rf(O)),h.length>0&&(h=await this.getAccounts())}catch(D){const O=D;if(O.code===_n.code)throw new _n(O);if(O.code===Wl.code)throw O}try{!(h!=null&&h.length)&&!u&&(h=(await d.request({method:"eth_requestAccounts"})).map(M=>rf(M))),o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let D=await this.getChainId();if(l&&D!==l){const O=await this.switchChain({chainId:l}).catch(M=>{if(M.code===_n.code)throw M;return{id:D}});D=(O==null?void 0:O.id)??D}return e&&await((k=c.storage)==null?void 0:k.removeItem(`${this.id}.disconnected`)),t.target||await((R=c.storage)==null?void 0:R.setItem("injected.connected",!0)),{accounts:f?h.map(O=>({address:O,capabilities:{}})):h,chainId:D}}catch(D){const O=D;throw O.code===_n.code?new _n(O):O.code===Wl.code?new Wl(O):O}},async disconnect(){var u,f;const l=await this.getProvider();if(!l)throw new xl;s&&(l.removeListener("chainChanged",s),s=void 0),a&&(l.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),l.on("connect",o));try{await Px(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}e&&await((u=c.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((f=c.storage)==null?void 0:f.removeItem("injected.connected"))},async getAccounts(){const l=await this.getProvider();if(!l)throw new xl;return(await l.request({method:"eth_accounts"})).map(f=>rf(f))},async getChainId(){const l=await this.getProvider();if(!l)throw new xl;const u=await l.request({method:"eth_chainId"});return Number(u)}
318,async getProvider(){if(typeof window>"u")return;let l;const u=n();return typeof u.provider=="function"?l=u.provider(window):typeof u.provider=="string"?l=Bm(window,u.provider):l=u.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){var l,u;try{if(e&&await((l=c.storage)==null?void 0:l.getItem(`${this.id}.disconnected`))||!t.target&&!await((u=c.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(r!==void 0&&r!==!1){const g=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",g),!!await this.getProvider()),b=typeof r=="number"?r:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(x=>window.addEventListener("ethereum#initialized",()=>x(g()),{once:!0}))]:[],new Promise(x=>setTimeout(()=>x(g()),b))]))return!0}throw new xl}return!!(await mb(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:u}){var g,b,w,x;const f=await this.getProvider();if(!f)throw new xl;const d=c.chains.find(k=>k.id===u);if(!d)throw new Ga(new f1);const h=new Promise(k=>{const R=D=>{"chainId"in D&&D.chainId===u&&(c.emitter.off("change",R),k())};c.emitter.on("change",R)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:Bt(u)}]}).then(async()=>{await this.getChainId()===u&&c.emitter.emit("change",{chainId:u})}),h]),d}catch(k){const R=k;if(R.code===4902||((b=(g=R==null?void 0:R.data)==null?void 0:g.originalError)==null?void 0:b.code)===4902)try{const{default:D,...O}=d.blockExplorers??{};let M;l!=null&&l.blockExplorerUrls?M=l.blockExplorerUrls:D&&(M=[D.url,...Object.values(O).map(U=>U.url)]);let F;(w=l==null?void 0:l.rpcUrls)!=null&&w.length?F=l.rpcUrls:F=[((x=d.rpcUrls.default)==null?void 0:x.http[0])??""];const H={blockExplorerUrls:M,chainId:Bt(u),chainName:(l==null?void 0:l.chainName)??d.name,iconUrls:l==null?void 0:l.iconUrls,nativeCurrency:(l==null?void 0:l.nativeCurrency)??d.nativeCurrency,rpcUrls:F};return await Promise.all([f.request({method:"wallet_addEthereumChain",params:[H]}).then(async()=>{if(await this.getChainId()===u)c.emitter.emit("change",{chainId:u});else throw new _n(new Error("User rejected switch after adding network."))}),h]),d}catch(D){throw new _n(D)}throw R.code===_n.code?new _n(R):new Ga(R)}},async onAccountsChanged(l){var u;if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f}),e&&await((u=c.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else c.emitter.emit("change",{accounts:l.map(f=>rf(f))})},onChainChanged(l){const u=Number(l);c.emitter.emit("change",{chainId:u})},async onConnect(l){const u=await this.getAccounts();if(u.length===0)return;const f=Number(l.chainId);c.emitter.emit("connect",{accounts:u,chainId:f});const d=await this.getProvider();d&&(o&&(d.removeListener("connect",o),o=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),s||(s=this.onChainChanged.bind(this),d.on("chainChanged",s)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a)))},async onDisconnect(l){const u=await this.getProvider();l&&l.code===1013&&u&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),u&&(s&&(u.removeListener("chainChanged",s),s=void 0),a&&(u.removeListener("disconnect",a),a=void 0),o||(o=this.onConnect.bind(this),u.on("connect",o))))}})}const Ige={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:Bm(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return Bm(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const r=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const n of r)if(e[n])return!1;return!0})}}
318,phantom:{id:"phantom",name:"Phantom",provider(t){var e,r;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(r=t.phantom)==null?void 0:r.ethereum:Bm(t,"isPhantom")}}};function Bm(t,e){function r(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const n=t.ethereum;if(n!=null&&n.providers)return n.providers.find(i=>r(i));if(n&&r(n))return n}function LCe(t){const e=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(t)});window.dispatchEvent(e);const r=()=>window.dispatchEvent(e);return window.addEventListener("eip6963:requestProvider",r),()=>window.removeEventListener("eip6963:requestProvider",r)}function xge(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function Rge(){const t=new Set;let e=[];const r=()=>xge(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const Pge=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=d=>{const h=o(d);if(!u(f,h)){const g=f;a(f=h,g)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},kge=Pge;function Oge(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const H6=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return H6(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return H6(n)(r)}}}},Mge=(t,e)=>(r,n,i)=>{let s={storage:Oge(()=>localStorage),partialize:b=>b,version:0,merge:(b,w)=>({...w,...b}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...b)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...b)},n,i);const u=()=>{const b=s.partialize({...n()});return l.setItem(s.name,{state:b,version:s.version})},f=i.setState;i.setState=(b,w)=>{f(b,w),u()};const d=t((...b)=>{r(...b),u()},n,i);i.getInitialState=()=>d;let h;const g=()=>{var b,w;if(!l)return;o=!1,a.forEach(k=>{var R;return k((R=n())!=null?R:d)});const x=((w=s.onRehydrateStorage)==null?void 0:w.call(s,(b=n())!=null?b:d))||void 0;return H6(l.getItem.bind(l))(s.name).then(k=>{if(k)if(typeof k.version=="number"&&k.version!==s.version){if(s.migrate)return[!0,s.migrate(k.state,k.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,k.state];return[!1,void 0]}).then(k=>{var R;const[D,O]=k;if(h=s.merge(O,(R=n())!=null?R:d),r(h,!0),D)return u()}).then(()=>{x==null||x(h,void 0),h=n(),o=!0,c.forEach(k=>k(h))}).catch(k=>{x==null||x(void 0,k)})};return i.persist={setOptions:b=>{s={...s,...b},b.storage&&(l=b.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:b=>(a.add(b),()=>{a.delete(b)}),onFinishHydration:b=>(c.add(b),()=>{c.delete(b)})},s.skipHydration||g(),h||d},Dge=Mge,u9=t=>{let e;const r=new Set,n=(l,u)=>{const f=typeof l=="function"?l(e):l;if(!Object.is(f,e)){const d=e;e=u??(typeof f!="object"||f===null)?f:Object.assign({},e,f),r.forEach(h=>h(e,d))}},i=()=>e,a={setState:n,getState:i,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=e=t(n,i,a);return a},Cw=t=>t?u9(t):u9;class Bge{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new wne})}on(e,r){this._emitter.on(e,r)}once(e,r){this._emitter.once(e,r)}off(e,r){this._emitter.off(e,r)}emit(e,...r){const n=r[0];this._emitter.emit(e,{uid:this.uid,...n})}listenerCount(e){return this._emitter.listenerCount(e)}}function Fge(t){return new Bge(t)}function $ge(t,e){return JSON.parse(t,(r,n)=>{let i=n;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(r,i))??i})}function f9(t,e){return t.slice(0,e).join(".")||"."}function d9(t,e){const{length:r}=t;for(let n=0;n<r;++n)if(t[n]===e)return n+1;return 0}function Lge(t,e){const r=typeof t=="function",n=typeof e=="function",i=[],s=[];return function(a,c){if(typeof c=="object")if(i.length){const l=d9(i,this);l===0?i[i.length]=this:(i.splice(l),s.splice(l)),s[s.length]=a;const u=d9(i,c);if(u!==0)return n?e.call(this,a,c,f9(s,u)):`[ref=${f9(s,u)}]`}else i[0]=c,s[0]=a;return r?t.call(this,a,c):c}}function Uge(t,e,r,n){return JSON.stringify(t,Lge((i,s)=>{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},n),r??void 0)}function Hge(t){const{deserialize:e=$ge,key:r="wagmi",serialize:n=Uge,storage:i=WO}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:r,async getItem(o,a){const c=i.getItem(`${r}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${r}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,n(a)))},async removeItem(o){await s(i.removeItem(`${r}.${o}`))}}}const WO={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function jge(){const t=(()=>typeof window<"u"&&window.localStorage?window.localStorage:WO)();return{getItem(e){return t.getItem(e)},removeItem(e){t.removeItem(e)},setItem(e,r){try{t.setItem(e,r)}catch{}}}}const j6=256;let rm=j6,nm;
318function zge(t=11){if(!nm||rm+t>j6*2){nm="",rm=0;for(let e=0;e<j6;e++)nm+=(256+Math.random()*256|0).toString(16).substring(1)}return nm.substring(rm,rm+++t)}function Jge(t){const{multiInjectedProviderDiscovery:e=!0,storage:r=Hge({storage:jge()}),syncConnectedChain:n=!0,ssr:i=!1,...s}=t,o=typeof window<"u"&&e?Rge():void 0,a=Cw(()=>s.chains),c=Cw(()=>{const O=[],M=new Set;for(const F of s.connectors??[]){const H=l(F);if(O.push(H),!i&&H.rdns){const U=typeof H.rdns=="string"?[H.rdns]:H.rdns;for(const G of U)M.add(G)}}if(!i&&o){const F=o.getProviders();for(const H of F)M.has(H.info.rdns)||O.push(l(u(H)))}return O});function l(O){var H;const M=Fge(zge()),F={...O({emitter:M,chains:a.getState(),storage:r,transports:s.transports}),emitter:M,uid:M.uid};return M.on("connect",R),(H=F.setup)==null||H.call(F),F}function u(O){const{info:M}=O,F=O.provider;return r2({target:{...M,id:M.rdns,provider:F}})}const f=new Map;function d(O={}){const M=O.chainId??w.getState().chainId,F=a.getState().find(U=>U.id===M);if(O.chainId&&!F)throw new f1;{const U=f.get(w.getState().chainId);if(U&&!F)return U;if(!F)throw new f1}{const U=f.get(M);if(U)return U}let H;if(s.client)H=s.client({chain:F});else{const U=F.id,G=a.getState().map(v=>v.id),N={},A=Object.entries(s);for(const[v,p]of A)if(!(v==="chains"||v==="client"||v==="connectors"||v==="transports"))if(typeof p=="object")if(U in p)N[v]=p[U];else{if(G.some(y=>y in p))continue;N[v]=p}else N[v]=p;H=Tx({...N,chain:F,batch:N.batch??{multicall:!0},transport:v=>s.transports[U]({...v,connectors:c})})}return f.set(M,H),H}function h(){return{chainId:a.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let g;const b="0.0.0-canary-";Mm.startsWith(b)?g=Number.parseInt(Mm.replace(b,""),10):g=Number.parseInt(Mm.split(".")[0]??"0",10);const w=Cw(kge(r?Dge(h,{migrate(O,M){if(M===g)return O;const F=h(),H=x(O,F.chainId);return{...F,chainId:H}},name:"store",partialize(O){return{connections:{__type:"Map",value:Array.from(O.connections.entries()).map(([M,F])=>{const{id:H,name:U,type:G,uid:N}=F.connector;return[M,{...F,connector:{id:H,name:U,type:G,uid:N}}]})},chainId:O.chainId,current:O.current}},merge(O,M){typeof O=="object"&&O&&"status"in O&&delete O.status;const F=x(O,M.chainId);return{...M,...O,chainId:F}},skipHydration:i,storage:r,version:g}):h));w.setState(h());function x(O,M){return O&&typeof O=="object"&&"chainId"in O&&typeof O.chainId=="number"&&a.getState().some(F=>F.id===O.chainId)?O.chainId:M}n&&w.subscribe(({connections:O,current:M})=>{var F;return M?(F=O.get(M))==null?void 0:F.chainId:void 0},O=>{if(a.getState().some(F=>F.id===O))return w.setState(F=>({...F,chainId:O??F.chainId}))}),o==null||o.subscribe(O=>{const M=new Set,F=new Set;for(const U of c.getState())if(M.add(U.id),U.rdns){const G=typeof U.rdns=="string"?[U.rdns]:U.rdns;for(const N of G)F.add(N)}const H=[];for(const U of O){if(F.has(U.info.rdns))continue;const G=l(u(U));M.has(G.id)||H.push(G)}r&&!w.persist.hasHydrated()||c.setState(U=>[...U,...H],!0)});function k(O){w.setState(M=>{const F=M.connections.get(O.uid);return F?{...M,connections:new Map(M.connections).set(O.uid,{accounts:O.accounts??F.accounts,chainId:O.chainId??F.chainId,connector:F.connector})}:M})}function R(O){w.getState().status==="connecting"||w.getState().status==="reconnecting"||w.setState(M=>{const F=c.getState().find(H=>H.uid===O.uid);return F?(F.emitter.listenerCount("connect")&&F.emitter.off("connect",k),F.emitter.listenerCount("change")||F.emitter.on("change",k),F.emitter.listenerCount("disconnect")||F.emitter.on("disconnect",D),{...M,connections:new Map(M.connections).set(O.uid,{accounts:O.accounts,chainId:O.chainId,connector:F}),current:O.uid,status:"connected"}):M})}function D(O){w.setState(M=>{const F=M.connections.get(O.uid);if(F){const U=F.connector;U.emitter.listenerCount("change")&&F.connector.emitter.off("change",k),U.emitter.listenerCount("disconnect")&&F.connector.emitter.off("disconnect",D),U.emitter.listenerCount("connect")||F.connector.emitter.on("connect",R)}if(M.connections.delete(O.uid),M.connections.size===0)return{...M,connections:new Map,current:null,status:"disconnected"};const H=M.connections.values().next().value;
318return{...M,connections:new Map(M.connections),current:H.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return c.getState()},storage:r,getClient:d,get state(){return w.getState()},setState(O){let M;typeof O=="function"?M=O(w.getState()):M=O;const F=h();typeof M!="object"&&(M=F),Object.keys(F).some(U=>!(U in M))&&(M=F),w.setState(M,!0)},subscribe(O,M,F){return w.subscribe(O,M,F?{...F,fireImmediately:F.emitImmediately}:void 0)},_internal:{mipd:o,async revalidate(){const O=w.getState(),M=O.connections;let F=O.current;for(const[,H]of M){const U=H.connector;U.isAuthorized&&await U.isAuthorized()||(M.delete(U.uid),F===U.uid&&(F=null))}w.setState(H=>({...H,connections:M,current:F}))},store:w,ssr:!!i,syncConnectedChain:n,transports:s.transports,chains:{setState(O){const M=typeof O=="function"?O(a.getState()):O;if(M.length!==0)return a.setState(M,!0)},subscribe(O){return a.subscribe(O)}},connectors:{providerDetailToConnector:u,setup:l,setState(O){return c.setState(typeof O=="function"?O(c.getState()):O,!0)},subscribe(O){return c.subscribe(O)}},events:{change:k,connect:R,disconnect:D}}}}const KO=IK({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}});function qge(t){let e=[],r,n;function i(a){var u,f;const c=z.getCaipNetworks(K.CHAIN.EVM);let l=Number(wp.parseEvmChainId(a));if(!c.some(d=>String(d.id)===String(a))){const d=((u=z.getActiveCaipNetwork(K.CHAIN.EVM))==null?void 0:u.id)||((f=c[0])==null?void 0:f.id);d&&Number.isInteger(Number(d))&&(l=Number(d))}if(!l)throw new Error("ChainId not found in networks");return l}function s(){var a;return r||(r=bf.getInstance({projectId:t.options.projectId,chainId:(a=kc())==null?void 0:a.caipNetworkId,enableLogger:t.options.enableAuthLogger,onTimeout:c=>{c==="iframe_load_failed"?bn.open(sn.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):c==="iframe_request_timeout"?bn.open(sn.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):c==="unverified_domain"&&bn.open(sn.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},abortController:sn.EmbeddedWalletAbortController,getActiveCaipNetwork:c=>kc(c),getCaipNetworks:c=>z.getCaipNetworks(c)})),r}async function o(a={}){var b;const c=s();let l=a.chainId;if(a.isReconnecting){const w=wp.parseEvmChainId(c.getLastUsedChainId()||""),x=(b=t.chains)==null?void 0:b[0].id;if(l=w||x,!l)throw new Error("ChainId not found in provider")}const u=Li("eip155"),{address:f,chainId:d,accounts:h}=await ks.authConnectorAuthenticate({authConnector:c,chainId:l,preferredAccountType:u,socialUri:a.socialUri,chainNamespace:K.CHAIN.EVM});e=(h==null?void 0:h.map(w=>w.address))||[f];const g=i(d);return{accounts:e,account:f,chainId:g,chain:{id:g,unsupported:!1}}}return a=>({id:K.CONNECTOR_ID.AUTH,name:K.CONNECTOR_NAMES.AUTH,type:"AUTH",chain:K.CHAIN.EVM,async connect(c={}){if(n){const u=await n;return{accounts:c.withCapabilities?u.accounts.map(f=>({address:f,capabilities:{}})):u.accounts,chainId:u.chainId}}n||(n=new Promise(u=>{u(o(c))}));const l=await n;return n=void 0,{accounts:c.withCapabilities?l.accounts.map(u=>({address:u,capabilities:{}})):l.accounts,chainId:l.chainId}},async disconnect(){await(await this.getProvider()).disconnect()},getAccounts(){return e!=null&&e.length?(a.emitter.emit("change",{accounts:e}),Promise.resolve(e)):Promise.resolve([])},async getProvider(){var c;return this.provider||(this.provider=bf.getInstance({projectId:t.options.projectId,chainId:(c=kc())==null?void 0:c.caipNetworkId,enableLogger:t.options.enableAuthLogger,abortController:sn.EmbeddedWalletAbortController,onTimeout:l=>{l==="iframe_load_failed"?bn.open(sn.ALERT_ERRORS.IFRAME_LOAD_FAILED,"error"):l==="iframe_request_timeout"?bn.open(sn.ALERT_ERRORS.IFRAME_REQUEST_TIMEOUT,"error"):l==="unverified_domain"&&bn.open(sn.ALERT_ERRORS.UNVERIFIED_DOMAIN,"error")},getActiveCaipNetwork:l=>kc(l),getCaipNetworks:l=>z.getCaipNetworks(l)})),Promise.resolve(this.provider)}
318,async getChainId(){const c=await this.getProvider(),{chainId:l}=await c.getChainId();return i(l)},async isAuthorized(){const l=z.state.activeChain===K.CHAIN.EVM;if(K.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(d=>be.getConnectorId(d)===K.CONNECTOR_ID.AUTH)&&!l)return!1;const f=await this.getProvider();return Promise.resolve(f.getLoginEmailUsed())},async switchChain({chainId:c}){var l;try{const u=a.chains.find(g=>g.id===c);if(!u)throw new Ga(new Error("chain not found on connector."));const f=await this.getProvider(),d=Li("eip155"),h=await f.connect({chainId:c,preferredAccountType:d});return e=((l=h==null?void 0:h.accounts)==null?void 0:l.map(g=>g.address))||[h.address],a.emitter.emit("change",{chainId:Number(c),accounts:e}),u}catch(u){throw u instanceof Error?new Ga(u):u}},onAccountsChanged(c){c.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:c.map(rf)})},onChainChanged(c){const l=Number(c);a.emitter.emit("change",{chainId:l})},async onDisconnect(c){await(await this.getProvider()).disconnect()}})}qE.type="walletConnect";function qE(t){const e=t.isNewChainsStale??!0;let r,n,i,s,o,a,c;return l=>({id:"walletConnect",name:"WalletConnect",type:qE.type,provider:t.universalProvider,async setup(){const u=await this.getProvider().catch(()=>null);u&&(s||(s=this.onConnect.bind(this),u.on("connect",s)),a||(a=this.onSessionDelete.bind(this),u.on("session_delete",a)))},async connect({...u}={}){var f,d,h;try{const g=z.getCaipNetworks(),b=await this.getProvider();if(!b)throw new xl;o||(o=this.onDisplayUri,b.on("display_uri",o));const w=await this.isChainsStale();b.session&&w&&await b.disconnect();const x=oe.state.universalProviderConfigOverride;if(!b.session||w){const H=Uc.createNamespaces(g,x);await b.connect({optionalNamespaces:H,..."pairingTopic"in u?{pairingTopic:u.pairingTopic}:{}}),this.setRequestedChainsIds(g.map(U=>Number(U.id)))}const k=await this.getAccounts(),R=await this.getChainId(),D=(h=(d=(f=b.session)==null?void 0:f.namespaces)==null?void 0:d.eip155)==null?void 0:h.chains,O=D==null?void 0:D.some(H=>Number(H.split(":")[1])===R);let M=1;O?M=R:D!=null&&D[0]&&(M=Number(D[0].split(":")[1])),o&&(b.removeListener("display_uri",o),o=void 0),s&&(b.removeListener("connect",s),s=void 0),n||(n=this.onAccountsChanged.bind(this),b.on("accountsChanged",n)),i||(i=this.onChainChanged.bind(this),b.on("chainChanged",i)),c||(c=this.onDisconnect.bind(this),b.on("disconnect",c)),a||(a=this.onSessionDelete.bind(this),b.on("session_delete",a));const F=x==null?void 0:x.defaultChain;return b.setDefaultChain(F??`eip155:${M}`),{accounts:k,chainId:M}}catch(g){throw/(user rejected|connection request reset)/i.test(g==null?void 0:g.message)?new _n(g):g}},async disconnect(){const u=await this.getProvider();try{await(u==null?void 0:u.disconnect())}catch(f){if(!/No matching key/i.test(f.message))throw f}finally{i&&(u==null||u.removeListener("chainChanged",i),i=void 0),c&&(u==null||u.removeListener("disconnect",c),c=void 0),s||(s=this.onConnect.bind(this),u==null||u.on("connect",s)),n&&(u==null||u.removeListener("accountsChanged",n),n=void 0),a&&(u==null||u.removeListener("session_delete",a),a=void 0),this.setRequestedChainsIds([])}},async getAccounts(){var b,w,x;const u=await this.getProvider();if(!((b=u==null?void 0:u.session)!=null&&b.namespaces))return[];const f=(x=(w=u==null?void 0:u.session)==null?void 0:w.namespaces[K.CHAIN.EVM])==null?void 0:x.accounts,d=(f==null?void 0:f.map(k=>k.split(":")[2]))??[],h=new Set;return d.filter(k=>{const R=k==null?void 0:k.toLowerCase();return h.has(R)?!1:(h.add(R),!0)})},async getProvider({chainId:u}={}){var h,g;r||(r=t.universalProvider,r==null||r.events.setMaxListeners(Number.POSITIVE_INFINITY));const f=le.getActiveNamespace(),d=(h=z.getActiveCaipNetwork())==null?void 0:h.id;if(u&&d!==u&&f){const b=le.getStoredActiveCaipNetworkId(),w=f?z.getCaipNetworks(f):[],x=w==null?void 0:w.find(k=>k.id===b);x&&x.chainNamespace===K.CHAIN.EVM&&await((g=this.switchChain)==null?void 0:g.call(this,{chainId:Number(x.id)}))}return r},async getChainId(){var g,b,w,x;const u=(g=z.getActiveCaipNetwork(K.CHAIN.EVM))==null?void 0:g.id;if(u)return u;const d=(x=(w=(b=(await this.getProvider()).session)==null?void 0:b.namespaces[K.CHAIN.EVM])==null?void 0:w.chains)==null?void 0:x[0],h=z.getCaipNetworks().find(k=>k.id===d);return h==null?void 0:h.id},async isAuthorized(){try{const[u,f]=await Promise.all([this.getAccounts(),this.getProvider()]);return u.length?await this.isChainsStale()&&f.session?(await f.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:f}){var g,b,w,x;const d=await this.getProvider();if(!d)throw new xl;const h=z.getCaipNetworks().find(k=>k.id===f);
318if(!h)throw new Ga(new f1);try{await d.request({method:"wallet_switchEthereumChain",params:[{chainId:Bt(f)}]}),h!=null&&h.caipNetworkId&&d.setDefaultChain(h==null?void 0:h.caipNetworkId),l.emitter.emit("change",{chainId:Number(f)});const k=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...k,f]),{...h,id:h.id}}catch(k){const R=k;if(/(?:user rejected)/iu.test(R.message))throw new _n(R);try{let D;u!=null&&u.blockExplorerUrls?D=u.blockExplorerUrls:D=(g=h.blockExplorers)!=null&&g.default.url?[(b=h.blockExplorers)==null?void 0:b.default.url]:[];const O=((x=(w=h.rpcUrls)==null?void 0:w.chainDefault)==null?void 0:x.http)||[],M={blockExplorerUrls:D,chainId:Bt(f),chainName:h.name,iconUrls:u==null?void 0:u.iconUrls,nativeCurrency:h.nativeCurrency,rpcUrls:O};await d.request({method:"wallet_addEthereumChain",params:[M]});const F=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...F,f]),{...h,id:h.id}}catch(D){throw new _n(D)}}},onAccountsChanged(u){u.length===0?this.onDisconnect():l.emitter.emit("change",{accounts:u.map(f=>rf(f))})},onChainChanged(u){const f=Number(u);l.emitter.emit("change",{chainId:f})},onConnect(u){this.setRequestedChainsIds(z.getCaipNetworks().map(f=>Number(f.id)))},async onDisconnect(u){this.setRequestedChainsIds([]),l.emitter.emit("disconnect");const f=await this.getProvider();n&&(f.removeListener("accountsChanged",n),n=void 0),i&&(f.removeListener("chainChanged",i),i=void 0),c&&(f.removeListener("disconnect",c),c=void 0),a&&(f.removeListener("session_delete",a),a=void 0),s||(s=this.onConnect.bind(this),f.on("connect",s))},onDisplayUri(u){l.emitter.emit("message",{type:"display_uri",data:u})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var d,h,g;if(!((d=r==null?void 0:r.session)!=null&&d.namespaces))return[];const u=(g=(h=r==null?void 0:r.session)==null?void 0:h.namespaces[K.CHAIN.EVM])==null?void 0:g.accounts;return(u==null?void 0:u.map(b=>Number.parseInt(b.split(":")[1]??"")))??[]},async getRequestedChainsIds(){var f;const u=await((f=l.storage)==null?void 0:f.getItem(this.requestedChainsStorageKey))??[];return[...new Set(u)]},async isChainsStale(){if(!e)return!1;const u=l.chains.map(h=>h.id),f=this.getNamespaceChainsIds();if(f.length&&!f.some(h=>u.includes(h)))return!1;const d=await this.getRequestedChainsIds();return!u.every(h=>d.includes(Number(h)))},async setRequestedChainsIds(u){var f;await((f=l.storage)==null?void 0:f.setItem(this.requestedChainsStorageKey,u))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}const S0=Qr({pendingTransactions:0}),h9={state:S0,subscribeKey(t,e){return Qn(S0,t,e)},increase(t){S0[t]+=1},decrease(t){S0[t]-=1},reset(t){S0[t]=0}};async function Gge(t){if(Ce.isSafeApp()){const{safe:e}=await Hn(()=>import("./index-fe13b059.js"),["assets/index-fe13b059.js","assets/compat-ffe38df8.js"]);if(e&&!t.some(r=>r.type==="safe"))return e()}return null}async function Vge(t){try{const{baseAccount:e}=await Hn(()=>import("./index-fe13b059.js"),["assets/index-fe13b059.js","assets/compat-ffe38df8.js"]);if(e&&!t.some(r=>r.id==="baseAccount"))return e()}catch(e){console.error("Failed to import Coinbase Wallet SDK:",e)}return null}const Wge={enable:!1,pollingInterval:3e4};class Kge extends PO{constructor(e){const r=wa.extendCaipNetworks(e.networks,{projectId:e.projectId,customNetworkImageUrls:{},customRpcUrls:e.customRpcUrls});super(),this.balancePromises={},this.namespace=K.CHAIN.EVM,this.adapterType=K.ADAPTER_TYPES.WAGMI,this.projectId=e.projectId,this.pendingTransactionsFilter={...Wge,...e.pendingTransactionsFilter??{}},this.createConfig({...e,networks:r}),this.checkChainId()}construct(e){this.checkChainId(),this.setupWatchers()}async getAccounts(e){const r=this.getWagmiConnector(e.id);if(!r)return{accounts:[]};if(r.id===K.CONNECTOR_ID.AUTH){const o=await r.getProvider();if(!(o!=null&&o.user))return{accounts:[]};const{address:a,accounts:c,chainId:l}=o.user;return Promise.resolve({accounts:(c||[{address:a,type:"eoa"}]).map(u=>Ce.createAccount({caipAddress:`eip155:${l}:${u.address}`,type:u.type}))})}const{addresses:n,address:i,chainId:s}=th(this.wagmiConfig);return Promise.resolve({accounts:s?[...new Set(n||[i])].map(o=>Ce.createAccount({caipAddress:`eip155:${s}:${o||""}`,type:"eoa"})):[]})}checkChainId(){const{chainId:e}=th(this.wagmiConfig);
318e&&this.emit("switchNetwork",{chainId:e})}getWagmiConnector(e){return this.wagmiConfig.connectors.find(r=>r.id===e)}createConfig(e){this.wagmiChains=e.networks.filter(i=>i.chainNamespace===K.CHAIN.EVM);const r={},n=[...e.connectors??[]];this.wagmiChains.forEach(i=>{var a,c;const s=(a=e.transports)==null?void 0:a[i.id],o=wa.getCaipNetworkId(i);s?r[i.id]=wa.extendWagmiTransports(i,e.projectId,s):r[i.id]=wa.getViemTransport(i,e.projectId,(c=e.customRpcUrls)==null?void 0:c[o])}),this.wagmiConfig=Jge({...e,chains:this.wagmiChains,connectors:n,transports:r})}setupWatchPendingTransactions(){if(!this.pendingTransactionsFilter.enable||this.unwatchPendingTransactions)return;this.unwatchPendingTransactions=Nge(this.wagmiConfig,{pollingInterval:this.pendingTransactionsFilter.pollingInterval,onError:()=>{},onTransactions:()=>{this.emit("pendingTransactions"),h9.increase("pendingTransactions")}});const e=h9.subscribeKey("pendingTransactions",r=>{var n;r>=K.LIMITS.PENDING_TRANSACTIONS&&((n=this.unwatchPendingTransactions)==null||n.call(this),e())})}setupWatchers(){Sge(this.wagmiConfig,{onChange:e=>{this.clearConnections(),this.addConnection(...e.map(r=>{const n=this.getCaipNetworks().find(s=>s.id===r.chainId),i=r.connector.id===K.CONNECTOR_ID.AUTH;return{accounts:r.accounts.map(s=>({address:this.toChecksummedAddress(s)})),caipNetwork:n,connectorId:r.connector.id,auth:i?{name:le.getConnectedSocialProvider(),username:le.getConnectedSocialUsername()}:void 0}}))}}),GO(this.wagmiConfig,{onChange:(e,r)=>{var n;if(e.status==="disconnected"&&r.address&&this.emit("disconnect"),e!=null&&e.chainId&&(e==null?void 0:e.chainId)!==(r==null?void 0:r.chainId)&&this.emit("switchNetwork",{chainId:e.chainId}),e.status==="connected"){const i=e.address!==(r==null?void 0:r.address),s=e.connector.id!==((n=r.connector)==null?void 0:n.id),o=r.status!=="connected";(i||s||o)&&(this.setupWatchPendingTransactions(),this.handleAccountChanged({address:e.address,chainId:e.chainId,connector:e.connector}))}}})}async addThirdPartyConnectors(){const e=[],{enableCoinbase:r}=oe.state||{};if(r!==!1){const i=await Vge(this.wagmiConfig.connectors);i&&e.push(i)}const n=await Gge(this.wagmiConfig.connectors);n&&e.push(n),await Promise.all(e.map(i=>{const s=this.configureInternalConnector(i);return this.addWagmiConnector(s)}))}addWagmiConnectors(){const e=[];oe.state.enableInjected!==!1&&e.push(r2({shimDisconnect:!0}));const{features:r,remoteFeatures:n,projectId:i,enableAuthLogger:s}=oe.state,o=(n==null?void 0:n.email)??(r==null?void 0:r.email)??!0,a=(n==null?void 0:n.socials)??(r==null?void 0:r.socials),c=Array.isArray(a)&&(a==null?void 0:a.length)>0;(o||c)&&e.push(qge({chains:this.wagmiChains,options:{projectId:i,enableAuthLogger:s}})),e.forEach(l=>{this.configureInternalConnector(l)})}configureInternalConnector(e){const r=this.wagmiConfig._internal.connectors.setup(e);return this.wagmiConfig._internal.connectors.setState(n=>[...n,r]),r}async handleAccountChanged({address:e,chainId:r,connector:n}){if(!this.namespace)throw new Error("WagmiAdapter:handleAccountChanged - namespace is required");const i=await n.getProvider().catch(()=>{});this.emit("accountChanged",{address:this.toChecksummedAddress(e),chainId:r,connector:{id:n.id,name:Di.ConnectorNamesMap[n.id]??n.name,imageId:Di.ConnectorImageIds[n.id],type:Di.ConnectorTypesMap[n.type]??"EXTERNAL",info:n.id===K.CONNECTOR_ID.INJECTED?void 0:{rdns:n.id},provider:i,chain:this.namespace,chains:[]}})}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async signMessage(e){try{return{signature:await JO(this.wagmiConfig,{message:e.message,account:e.address})}}catch{throw new Error("WagmiAdapter:signMessage - Sign message failed")}}async sendTransaction(e){var a;const{chainId:r,address:n}=th(this.wagmiConfig),i=(a=this.wagmiChains)==null?void 0:a.find(c=>c.id===r),s={account:n,to:e.to,value:Number.isNaN(Number(e.value))?BigInt(0):BigInt(e.value),gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,data:e.data,chain:i,type:"legacy",parameters:["nonce"]};await Age(this.wagmiConfig,s);const o=await _ge(this.wagmiConfig,s);return await qO(this.wagmiConfig,{hash:o,timeout:25e3}),{hash:o}}async writeContract(e){var a;const{caipNetwork:r,...n}=e,i=Number(wp.caipNetworkIdToNumber(r.caipNetworkId)),s=(a=this.wagmiChains)==null?void 0:a.find(c=>c.id===i);return{hash:await VO(this.wagmiConfig,{chain:s,address:n.tokenAddress,account:n.fromAddress,abi:n.abi,functionName:n.method,args:n.args,__mode:"prepared"})}}async estimateGas(e){try{return{gas:await mge(this.wagmiConfig,{account:e.address,to:e.to,data:e.data,type:"legacy"})}}catch{throw new Error("WagmiAdapter:estimateGas - error estimating gas")}}parseUnits(e){return OK(e.value,e.decimals)}formatUnits(e){return B1(e.value,e.decimals)}async addWagmiConnector(e){if(!this.namespace)throw new Error("WagmiAdapter:addWagmiConnector - namespace is required");const{enableEIP6963:r}=oe.state||{};if(e.type===K.CONNECTOR_ID.INJECTED&&r===!1||e.id===K.CONNECTOR_ID.AUTH||e.id===K.CONNECTOR_ID.WALLET_CONNECT)return;let n;e.id!==K.CONNECTOR_ID.BASE_ACCOUNT&&(n=await e.getProvider().catch(()=>{}));const i=Ps.state.connectorImages;this.addConnector({id:e.id,explorerId:Di.ConnectorExplorerIds[e.id]??Di.ConnectorExplorerIds[e.name],imageUrl:(i==null?void 0:i[e.id])??e.icon,name:Di.ConnectorNamesMap[e.id]??e.name,imageId:Di.ConnectorImageIds[e.id],type:Di.ConnectorTypesMap[e.type]??"EXTERNAL",info:e.id===K.CONNECTOR_ID.INJECTED?void 0:{rdns:e.id},provider:n,chain:this.namespace,chains:[]})}async syncConnectors(){Tge(this.wagmiConfig,{onChange:e=>{e.forEach(r=>this.addWagmiConnector(r))}}),this.addWagmiConnectors(),await Promise.all(this.wagmiConfig.connectors.map(e=>this.addWagmiConnector(e))),await this.addThirdPartyConnectors()}async syncConnections(){const e=this.connectors.filter(r=>{const{hasDisconnected:n,hasConnected:i}=Mc.getConnectorStorageInfo(r.id,this.namespace);return!n&&i}).map(r=>
318this.getWagmiConnector(r.id)).filter(Boolean);await Dm(this.wagmiConfig,{connectors:e})}async syncConnection(e){var l,u;const{id:r,chainId:n}=e,s=wc(this.wagmiConfig).find(f=>f.connector.id===r),o=this.getWagmiConnector(r),a=await(o==null?void 0:o.getProvider());if(Ce.isSafeApp()&&r===K.CONNECTOR_ID.SAFE&&!(s!=null&&s.accounts.length)){const f=this.getWagmiConnector("safe");if(f){const d=await Aw(this.wagmiConfig,{connector:f,chainId:Number(n)}),h=await f.getProvider();return{chainId:Number(n),address:this.toChecksummedAddress(d.accounts[0]),provider:h,type:(l=s==null?void 0:s.connector.type)==null?void 0:l.toUpperCase(),id:s==null?void 0:s.connector.id}}}return{chainId:Number(s==null?void 0:s.chainId),address:this.toChecksummedAddress(s==null?void 0:s.accounts[0]),provider:a,type:(u=s==null?void 0:s.connector.type)==null?void 0:u.toUpperCase(),id:s==null?void 0:s.connector.id}}async connectWalletConnect(e){try{const r=this.getWalletConnectConnector();await r.authenticate();const n=this.getWagmiConnector("walletConnect");if(!n)throw new Error("UniversalAdapter:connectWalletConnect - connector not found");const i=await Aw(this.wagmiConfig,{connector:n,chainId:e?Number(e):void 0});return i.chainId!==Number(e)&&await l9(this.wagmiConfig,{chainId:i.chainId}),{clientId:await r.provider.client.core.crypto.getClientId()}}catch(r){throw r instanceof _n?new kd(r):Do.isUserRejectedRequestError(r)?new kd(r):r}}async connect(e){var r,n,i,s,o;try{const{id:a,address:c,provider:l,type:u,info:f,chainId:d,socialUri:h}=e,g=this.getWagmiConnector(a);if(!g)throw new Error("connectionControllerClient:connectExternal - connector is undefined");l&&f&&g.id===K.CONNECTOR_ID.EIP6963&&((r=g.setEip6963Wallet)==null||r.call(g,{provider:l,info:f}));const b=(i=(n=this.wagmiConfig.state)==null?void 0:n.connections)==null?void 0:i.get(g.uid);if(b){await((s=this.wagmiConfig.storage)==null?void 0:s.setItem("recentConnectorId",g.id));const k=[...b.accounts].sort((R,D)=>Mc.isLowerCaseMatch(R,c)?-1:Mc.isLowerCaseMatch(D,c)?1:0);return(o=this.wagmiConfig)==null||o.setState(R=>({...R,connections:new Map(R.connections).set(g.uid,{accounts:k,chainId:b.chainId,connector:b.connector}),current:g.uid,status:"connected"})),{address:this.toChecksummedAddress(k[0]),chainId:b.chainId,provider:l,type:u,id:a}}const w=await Aw(this.wagmiConfig,{connector:g,chainId:d?Number(d):void 0,socialUri:h}),x=l??await g.getProvider();return{address:this.toChecksummedAddress(w.accounts[0]),chainId:w.chainId,provider:x,type:u,id:a}}catch(a){throw a instanceof _n?new kd(a):Do.isUserRejectedRequestError(a)?new kd(a):a}}get connections(){return Array.from(this.wagmiConfig.state.connections.values()).map(e=>({accounts:e.accounts.map(r=>({address:this.toChecksummedAddress(r)})),connectorId:e.connector.id}))}async reconnect(e){const{id:r}=e,n=this.getWagmiConnector(r);if(!n)throw new Error("connectionControllerClient:connectExternal - connector is undefined");await Dm(this.wagmiConfig,{connectors:[n]})}async getBalance(e){const r=e.address,n=this.getCaipNetworks().find(i=>i.id===e.chainId);if(!r)return Promise.resolve({balance:"0.00",symbol:"ETH"});if(n&&this.wagmiConfig){const i=`${n.caipNetworkId}:${e.address}`,s=this.balancePromises[i];if(s)return s;const o=le.getNativeBalanceCacheForCaipAddress(i);return o?{balance:o.balance,symbol:o.symbol}:(this.balancePromises[i]=new Promise(async a=>{var c,l;try{const u=Number(e.chainId),f=await bge(this.wagmiConfig,{address:e.address,chainId:u,token:(l=(c=e.tokens)==null?void 0:c[n.caipNetworkId])==null?void 0:l.address});le.updateNativeBalanceCache({caipAddress:i,balance:f.formatted,symbol:f.symbol,timestamp:Date.now()}),a({balance:f.formatted,symbol:f.symbol})}catch(u){console.warn("Appkit:WagmiAdapter:getBalance - Error getting balance",u),a({balance:"0.00",symbol:"ETH"})}}).finally(()=>{delete this.balancePromises[i]}),this.balancePromises[i]||{balance:"0.00",symbol:"ETH"})}return{balance:"",symbol:""}}getWalletConnectProvider(){var e;return(e=this.getWagmiConnector("walletConnect"))==null?void 0:e.provider}async disconnect(e){if(e.id){const r=this.getWagmiConnector(e.id),i=wc(this.wagmiConfig).find(s=>Mc.isLowerCaseMatch(s.connector.id,e.id));return await U6(this.wagmiConfig,{connector:r}),oe.state.enableReconnect===!1&&this.deleteConnection(e.id),i?{connections:[{accounts:i.accounts.map(s=>({address:this.toChecksummedAddress(s)})),connectorId:i.connector.id}]}:{connections:[]}}return this.disconnectAll()}async disconnectAll(){const e=wc(this.wagmiConfig),r=await Promise.allSettled(e.map(async n=>{const i=this.getWagmiConnector(n.connector.id);return i&&await U6(this.wagmiConfig,{connector:i}),n}));return this.wagmiConfig.state.connections.clear(),{connections:r.filter(n=>n.status==="fulfilled").map(({value:n})=>({accounts:n.accounts.map(i=>({address:this.toChecksummedAddress(i)})),connectorId:n.connector.id}))}}async switchNetwork(e){var h,g,b,w,x;const{caipNetwork:r}=e,n=this.wagmiConfig.chains.find(k=>k.id.toString()===r.id.toString());if(!n)throw new Error("connectionControllerClient:switchNetwork - wagmiChain is undefined");const{name:i,nativeCurrency:s,rpcUrls:o,blockExplorers:a,id:c}=n,l=((b=(g=(h=r.rpcUrls)==null?void 0:h.chainDefault)==null?void 0:g.http)==null?void 0:b[0])??o.default.http[0]??"",u=(a==null?void 0:a.default.url)??((x=(w=r.blockExplorers)==null?void 0:w.default)==null?void 0:x.url)??"",f=s??r.nativeCurrency,d=i??r.name;await l9(this.wagmiConfig,{chainId:c,addEthereumChainParameter:{chainName:d,nativeCurrency:f,rpcUrls:[l],blockExplorerUrls:[u]}}),await super.switchNetwork(e)}async getCapabilities(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");const n=wc(this.wagmiConfig)[0],i=n?this.getWagmiConnector(n.connector.id):null;if(!i)throw new Error("connectionControllerClient:getCapabilities - connector is undefined");const s=await i.getProvider();if(!s)throw new Error("connectionControllerClient:getCapabilities - provider is undefined");return await s.request({method:"wallet_getCapabilities",params:[e]})}async grantPermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");const n=wc(this.wagmiConfig)[0],i=n?this.getWagmiConnector(n.connector.id):null;if(!i)throw new Error("connectionControllerClient:grantPermissions - connector is undefined");const s=await i.getProvider();if(!s)throw new Error("connectionControllerClient:grantPermissions - provider is undefined");return s.request({method:"wallet_grantPermissions",params:e})}async revokePermissions(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");const n=wc(this.wagmiConfig)[0],i=n?this.getWagmiConnector(n.connector.id):null;if(!i)throw new Error("connectionControllerClient:revokePermissions - connector is undefined");const s=await i.getProvider();if(!s)throw new Error("connectionControllerClient:revokePermissions - provider is undefined");return s.request({method:"wallet_revokePermissions",params:e})}async walletGetAssets(e){if(!this.wagmiConfig)throw new Error("connectionControllerClient:walletGetAssets - wagmiConfig is undefined");const n=wc(this.wagmiConfig)[0],i=n?this.getWagmiConnector(n.connector.id):null;if(!i)throw new Error("connectionControllerClient:walletGetAssets - connector is undefined");const s=await i.getProvider();if(!s)throw new Error("connectionControllerClient:walletGetAssets - provider is undefined");return s.request({method:"wallet_getAssets",params:[e]})}setAuthProvider(e){if(!this.namespace)throw new Error("WagmiAdapter:setAuthProvider - namespace is required");
318this.addConnector({id:K.CONNECTOR_ID.AUTH,type:"AUTH",name:K.CONNECTOR_NAMES.AUTH,provider:e,imageId:Di.ConnectorImageIds[K.CONNECTOR_ID.AUTH],chain:this.namespace,chains:[]})}async setUniversalProvider(e){e.on("connect",()=>{const n=wc(this.wagmiConfig),i=this.getWagmiConnector("walletConnect");if(i&&!n.find(s=>s.connector.id===i.id)){if(z.state.activeChain==="eip155")return;Dm(this.wagmiConfig,{connectors:[i]})}});const r=qE({universalProvider:e});return this.configureInternalConnector(r),this.addConnector(new kO({provider:e,caipNetworks:this.getCaipNetworks(),namespace:"eip155"})),Promise.resolve()}toChecksummedAddress(e){return P1(e.toLowerCase())}}function Zo(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}Zo({id:"5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",name:"Solana",network:"solana-mainnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!1,chainNamespace:"solana",caipNetworkId:"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",deprecatedCaipNetworkId:"solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"});Zo({id:"EtWTRABZaYq6iMfeYKouRu166VU2xqa1",name:"Solana Devnet",network:"solana-devnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",deprecatedCaipNetworkId:"solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"});Zo({id:"4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",name:"Solana Testnet",network:"solana-testnet",nativeCurrency:{name:"Solana",symbol:"SOL",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Solscan",url:"https://solscan.io"}},testnet:!0,chainNamespace:"solana",caipNetworkId:"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"});Zo({id:"000000000019d6689c085ae165831e93",caipNetworkId:"bip122:000000000019d6689c085ae165831e93",chainNamespace:"bip122",name:"Bitcoin",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}});Zo({id:"000000000933ea01ad0ee984209779ba",caipNetworkId:"bip122:000000000933ea01ad0ee984209779ba",chainNamespace:"bip122",name:"Bitcoin Testnet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});Zo({id:"00000008819873e925422c1ff0f99f7c",caipNetworkId:"bip122:00000008819873e925422c1ff0f99f7c",chainNamespace:"bip122",name:"Bitcoin Signet",nativeCurrency:{name:"Bitcoin",symbol:"BTC",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},testnet:!0});Zo({id:"-239",name:"TON",network:"ton-mainnet",nativeCurrency:{name:"TON",symbol:"TON",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Tonscan",url:"https://tonscan.org"}},testnet:!1,chainNamespace:"ton",caipNetworkId:"ton:-239"});Zo({id:"-3",name:"TON Testnet",network:"ton-testnet",nativeCurrency:{name:"TON",symbol:"TON",decimals:9},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Tonscan",url:"https://testnet.tonscan.org"}},testnet:!0,chainNamespace:"ton",caipNetworkId:"ton:-3"});Zo({id:"0x2b6653dc",name:"TRON",network:"tron-mainnet",nativeCurrency:{name:"TRX",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Tronscan",url:"https://tronscan.org"}},testnet:!1,chainNamespace:"tron",caipNetworkId:"tron:0x2b6653dc"});Zo({id:"0x94a9059e",name:"TRON Shasta",network:"tron-shasta",nativeCurrency:{name:"TRX",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Tronscan",url:"https://shasta.tronscan.org"}},testnet:!0,chainNamespace:"tron",caipNetworkId:"tron:0x94a9059e"});Zo({id:"0xcd8690dc",name:"TRON Nile",network:"tron-nile",nativeCurrency:{name:"TRX",symbol:"TRX",decimals:6},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}},blockExplorers:{default:{name:"Tronscan",url:"https://nile.tronscan.org"}},testnet:!0,chainNamespace:"tron",caipNetworkId:"tron:0xcd8690dc"});const XO="e224ea67c7306d39bb3032dba0a41239",ZO=[KO],YO=new Kge({projectId:XO,networks:ZO}),Yo=YO.wagmiConfig,Xge=lge({adapters:[YO],networks:ZO,defaultNetwork:KO,projectId:XO,features:{email:!1,socials:[]},enableWallets:!0,metadata:{name:"Protocol.art",description:"Protocol.art",url:"https://protocol.art",icons:[]}});function Zge(t,e){return!(t!=null&&t.isConnected)||!t.address||!e?null:{account:t.address,chain:{id:t.chainId},provider:new qU(e)}}async function GE(){const t=th(Yo);if(!t.isConnected||!t.connector)return null;const e=await t.connector.getProvider();return Zge(t,e)}async function Yge(){await Dm(Yo)}function Qge(t){return GO(Yo,{onChange:async()=>{t(await GE())}})}async function eme(){return await Xge.open({view:"Connect"}),GE()}async function tme(){return await U6(Yo),null}async function rme(t){return{hash:await VO(Yo,t)}}async function nme(t){return qO(Yo,t)}async function ime(t){return JO(Yo,t)}async function sme(t){return wge(Yo,t)}async function ome(t){return vge(Yo,t)}async function ame(t){return yge(Yo,t)}async function cme(t={}){return Ege(Yo,t)}function lme(t){let e,r;return e=new un({props:{on_click:t[1],comment:"Connecting",$$slots:{default:[fme]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function ume(t){let e,r;return e=new un({props:{on_click:t[1],$$slots:{default:[dme]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&16&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function fme(t){let e;return{c(){e=pe("Connect Wallet")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function dme(t){let e;return{c(){e=pe("Disconnect")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function hme(t){let e,r,n,i;const s=[ume,lme],o=[];function a(c,l){return c[0]&&c[0].account?0:1}return r=a(t),n=o[r]=s[r](t),{c(){e=J("div"),n.c()},m(c,l){ee(c,e,l),o[r].m(e,null),i=!0},p(c,[l]){let u=r;r=a(c),r===u?o[r].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),n=o[r],n?n.p(c,l):(n=o[r]=s[r](c),n.c()),te(n,1),n.m(e,null))},i(c){i||(te(n),i=!0)},o(c){ne(n),i=!1},d(c){c&&Q(e),o[r].d()}}}function pme(t,e,r){let{client:n}=e,i;async function s(){await Yge(),r(0,n=await GE()),i=Qge(a=>{r(0,n=a)})}sy(s),s5(()=>{i&&i()});async function o(){if(n&&n.account){r(0,n=await tme());return}r(0,n=await eme())}return t.$$set=a=>{"client"in a&&r(0,n=a.client)},[n,o]}class p9 extends Rt{constructor(e){super(),xt(this,e,pme,hme,Ct,{client:0})}}function gme(t){let e,r,n;return{c(){e=J("button"),e.innerHTML=`<div class="svelte-12jmuvt"></div> 319 <div class="svelte-12jmuvt"></div> 320 <div class="svelte-12jmuvt"></div>`,W(e,"class","btn svelte-12jmuvt"),W(e,"align","center")},m(i,s){ee(i,e,s),r||(n=Tr(e,"click",t[0]),r=!0)},p:$e,i:$e,o:$e,d(i){i&&Q(e),r=!1,n()}}}function mme(t){function e(r){pB.call(this,t,r)}return[e]}class bme extends Rt{constructor(e){super(),xt(this,e,mme,gme,Ct,{})}}function Ta(t){return t?(t.substr(0,6)+"..."+t.substr(42-4,4)).toLowerCase():""}function n2(t){return t?t.replace(/\s+/g,"").split(".")[0]:""}function yme(t){return t.Owner=="0x0000000000000000000000000000000000000000"||!t.Expires||t.Expires.valueOf()+1e3*3600*24*31*3<new Date().valueOf()}function z6(t){return/^[^$.,;:=+\\\s]{1,100}.art$/.test(t.toLowerCase())}const Kc=".art",QO="0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb",eM=[{inputs:[{internalType:"string",name:"name",type:"string"}],name:"setName",outputs:[],stateMutability:"nonpayable",type:"function"}],g9="0x828d6e836e586b53f1da3403feda923aed431019",m9=[{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"bytes32",name:"_baseNode",type:"bytes32"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",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:"controller",type:"address"}],name:"ControllerAdded",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"controller",type:"address"}],name:"ControllerRemoved",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"expires",type:"uint256"}],name:"NameMigrated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"uint256",name:"expires",type:"uint256"}],name:"NameRegistered",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"expires",type:"uint256"}],name:"NameRenewed",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:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"GRACE_PERIOD",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"controller",type:"address"}],name:"addController",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"available",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseNode",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"controllers",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"ens",outputs:[{internalType:"contract ENS",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"nameExpires",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"node",type:"bytes32"},{internalType:"bytes32",name:"label",type:"bytes32"}],name:"namehash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"address",name:"owner",type:"address"}],name:"reclaim",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_ens",type:"address"},{internalType:"bytes32",name:"_baseNode",type:"bytes32"}],name:"reconfigure",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"duration",type:"uint256"},{internalType:"bool",name:"avoidable",type:"bool"}],name:"register",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"controller",type:"address"}],name:"removeController",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"duration",type:"uint256"}],name:"renew",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFromCallBack",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:"string",name:"uri",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"resolver",type:"address"}],name:"setResolver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceID",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],tM="0xCbf339F9D0Ca453AD82b1aabAef2D8d36EE2ab01",rM=[{inputs:[{internalType:"address",name:"_registrar",type:"address"},{internalType:"address",name:"_witness",type:"address"},{internalType:"address",name:"_pool",type:"address"}],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"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"bytes32",name:"hash",type:"bytes32"},{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Prepayment",type:"event"},{an
320onymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"id",type:"uint256"}],name:"PrepaymentClose",type:"event"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint64",name:"value",type:"uint64"}],name:"emergencyWithdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"paidCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"}],name:"prepay",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"refund",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_pool",type:"address"}],name:"setPool",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_registrar",type:"address"}],name:"setRegistrar",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_witness",type:"address"}],name:"setWitness",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint64",name:"id",type:"uint64"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"submit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes",name:"data",type:"bytes"},{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"verify",outputs:[],stateMutability:"view",type:"function"}];let Jb=["ð","ð","ð","ð","ð","ð
","ð¤£","ð","ð","ð","ð« ","ð","ð","ð","ð¥°","ð","ð¤©","ð","ð","âº","ð","ð","ð¥²","ð","ð","ð","ð¤ª","ð","ð¤","ð¤","ð¤","ð«¢","ð«£","ð¤«","ð¤","ð«¡","ð¤","ð¤¨","ð","ð","ð¶","ð«¥","ð¶âð«","ð","ð","ð","ð¬","ð®âð¨","ð¤¥","ð«¨","ð","ð","ðª","ð¤¤","ð´","ð·","ð¤","ð¤","ð¤¢","ð¤®","ð¤§","ð¥µ","ð¥¶","ð¥´","ðµ","ðµâð«","ð¤¯","ð¤ ","ð¥³","ð¥¸","ð","ð¤","ð§","ð","ð«¤","ð","ð","â¹","ð®","ð¯","ð²","ð³","ð¥º","ð¥¹","ð¦","ð§","ð¨","ð°","ð¥","ð¢","ð","ð±","ð","ð£","ð","ð","ð©","ð«","ð¥±","ð¤","ð¡","ð ","ð¤¬","ð","ð¿","ð","â ","ð©","ð¤¡","ð¹","ðº","ð»","ð½","ð¾","ð¤","ðº","ð¸","ð¹","ð»","ð¼","ð½","ð","ð¿","ð¾","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","â£","ð","â¤âð¥","â¤âð©¹","â¤","ð©·","ð§¡","ð","ð","ð","ð©µ","ð","ð¤","ð¤","ð©¶","ð¤","ð","ð¯","ð¢","ð¥","ð«","ð¦","ð¨","ð³","ð¬","ðâð¨","ð¨","ð¯","ð","ð¤","ð","ð¤","ð","â","ð","ð«±","ð«²","ð«³","ð«´","ð«·","ð«¸","ð","ð¤","ð¤","â","ð¤","ð«°","ð¤","ð¤","ð¤","ð","ð","ð","ð","ð","â","ð«µ","ð","ð","â","ð","ð¤","ð¤","ð","ð","ð«¶","ð","ð¤²","ð¤","ð","â","ð
","ð¤³","ðª","ð¦¾","ð¦¿","ð¦µ","ð¦¶","ð","ð¦»","ð","ð§ ","ð«","ð«","ð¦·","ð¦´","ð","ð","ð
","ð","ð«¦","ð¶","ð§","ð¦","ð§","ð§","ð±","ð¨","ð§","ð§ââ","ð§ââ","ð¨âð¦°","ð¨âð¦±","ð¨âð¦³","ð¨âð¦²","ð©","ð©âð¦°","ð§âð¦°","ð©âð¦±","ð§âð¦±","ð©âð¦³","ð§âð¦³","ð©âð¦²","ð§âð¦²","ð±ââ","ð±ââ","ð§","ð´","ðµ","ð","ðââ","ðââ","ð","ðââ","ðââ","ð
","ð
ââ","ð
ââ","ð","ðââ","ðââ","ð","ðââ","ðââ","ð","ðââ","ðââ","ð§","ð§ââ","ð§ââ","ð","ðââ","ðââ","ð¤¦","ð¤¦ââ","ð¤¦ââ","ð¤·","ð¤·ââ","ð¤·ââ","ð§ââ","ð¨ââ","ð©ââ","ð§âð","ð¨âð","ð©âð","ð§âð«","ð¨âð«","ð©âð«","ð§ââ","ð¨ââ","ð©ââ","ð§âð¾","ð¨âð¾","ð©âð¾","ð§âð³","ð¨âð³","ð©âð³","ð§âð§","ð¨âð§","ð©âð§","ð§âð","ð¨âð","ð©âð","ð§âð¼","ð¨âð¼","ð©âð¼","ð§âð¬","ð¨âð¬","ð©âð¬","ð§âð»","ð¨âð»","ð©âð»","ð§âð¤","ð¨âð¤","ð©âð¤","ð§âð¨","ð¨âð¨","ð©âð¨","ð§ââ","ð¨ââ","ð©ââ","ð§âð","ð¨âð","ð©âð","ð§âð","ð¨âð","ð©âð","ð®","ð®ââ","ð®ââ","ðµ","ðµââ","ðµââ","ð","ðââ","ðââ","ð¥·","ð·","ð·ââ","ð·ââ","ð«
","ð¤´","ð¸","ð³","ð³ââ","ð³ââ","ð²","ð§","ð¤µ","ð¤µââ","ð¤µââ","ð°","ð°ââ","ð°ââ","ð¤°","ð«","ð«","ð¤±","ð©âð¼","ð¨âð¼","ð§âð¼","ð¼","ð
","ð¤¶","ð§âð","ð¦¸","ð¦¸ââ","ð¦¸ââ","ð¦¹","ð¦¹ââ","ð¦¹ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§","ð","ðââ","ðââ","ð","ðââ","ðââ","ð¶","ð¶ââ","ð¶ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð§âð¦¯","ð¨âð¦¯","ð©âð¦¯","ð§âð¦¼","ð¨âð¦¼","ð©âð¦¼","ð§âð¦½","ð¨âð¦½","ð©âð¦½","ð","ðââ","ðââ","ð","ðº","ð´","ð¯","ð¯ââ","ð¯ââ","ð§","ð§ââ","ð§ââ","ð§","ð§ââ","ð§ââ","ð¤º","ð","â·","ð","ð","ðââ","ðââ","ð","ðââ","ðââ","ð£","ð£ââ","ð£ââ","ð","ðââ","ðââ","â¹","â¹ââ","â¹ââ","ð","ðââ","ðââ","ð´","ð´ââ","ð´ââ","ðµ","ðµââ","ðµââ","ð¤¸","ð¤¸ââ","ð¤¸ââ","ð¤¼","ð¤¼ââ","ð¤¼ââ","ð¤½","ð¤½ââ","ð¤½ââ","ð¤¾","ð¤¾ââ","ð¤¾ââ","ð¤¹","ð¤¹ââ","ð¤¹ââ","ð§","ð§ââ","ð§ââ","ð","ð","ð§âð¤âð§","ð","ð«","ð¬","ð","ð©ââ¤âðâð¨","ð¨ââ¤âðâð¨","ð©ââ¤âðâð©","ð","ð©ââ¤âð¨","ð¨ââ¤âð¨","ð©ââ¤âð©","ðª","ð¨âð©âð¦","ð¨âð©âð§","ð¨âð©âð§âð¦","ð¨âð©âð¦âð¦","ð¨âð©âð§âð§","ð¨âð¨âð¦","ð¨âð¨âð§","ð¨âð¨âð§âð¦","ð¨âð¨âð¦âð¦","ð¨âð¨âð§âð§","ð©âð©âð¦","ð©âð©âð§","ð©âð©âð§âð¦","ð©âð©âð¦âð¦","ð©âð©âð§âð§","ð¨âð¦","ð¨âð¦âð¦","ð¨âð§","ð¨âð§âð¦","ð¨âð§âð§","ð©âð¦","ð©âð¦âð¦","ð©âð§","ð©âð§âð¦","ð©âð§âð§","ð£","ð¤","ð¥","ð«","ð£","ð¦°","ð¦±","ð¦³","ð¦²","ðµ","ð","ð¦","ð¦§","ð¶","ð","ð¦®","ðâð¦º","ð©","ðº","ð¦","ð¦","ð±","ð","ðââ¬","ð¦","ð¯","ð
","ð","ð´","ð«","ð«","ð","ð¦","ð¦","ð¦","ð¦¬","ð®","ð","ð","ð","ð·","ð","ð","ð½","ð","ð","ð","ðª","ð«","ð¦","ð¦","ð","ð¦£","ð¦","ð¦","ð","ð","ð","ð¹","ð°","ð","ð¿","ð¦«","ð¦","ð¦","ð»","ð»ââ","ð¨","ð¼","ð¦¥","ð¦¦","ð¦¨","ð¦","ð¦¡","ð¾","ð¦","ð","ð","ð£","ð¤","ð¥","ð¦","ð§","ð","ð¦
","ð¦","ð¦¢","ð¦","ð¦¤","ðª¶","ð¦©","ð¦","ð¦","ðª½","ð¦ââ¬","ðª¿","ð¸","ð","ð¢","ð¦","ð","ð²","ð","ð¦","ð¦","ð³","ð","ð¬","ð¦","ð","ð ","ð¡","ð¦","ð","ð","ðª¸","ðª¼","ð","ð¦","ð","ð","ð","ðª²","ð","ð¦","ðª³","ð·","ð¸","ð¦","ð¦","ðª°","ðª±","ð¦ ","ð","ð¸","ð®","ðª·","ðµ","ð¹","ð¥","ðº","ð»","ð¼","ð·","ðª»","ð±","ðª´","ð²","ð³","ð´","ðµ","ð¾","ð¿","â","ð","ð","ð","ð","ðª¹","ðªº","ð","ð","ð","ð","ð","ð","ð","ð","ð¥","ð","ð","ð","ð","ð","ð","ð«","ð¥","ð
","ð«","ð¥¥","ð¥","ð","ð¥","ð¥","ð½","ð¶","ð«","ð¥","ð¥¬","ð¥¦","ð§","ð§
","ð¥","ð«","ð°","ð«","ð«","ð","ð¥","ð¥","ð«","ð¥¨","ð¥¯","ð¥","ð§","ð§","ð","ð","ð¥©","ð¥","ð","ð","ð","ð","ð¥ª","ð®","ð¯","ð«","ð¥","ð§","ð¥","ð³","ð¥","ð²","ð«","ð¥£","ð¥","ð¿","ð§","ð§","ð¥«","ð±","ð","ð","ð","ð","ð","ð","ð ","ð¢","ð£","ð¤","ð¥","ð¥®","ð¡","ð¥","ð¥ ","ð¥¡","ð¦","ð¦","ð¦","ð¦","ð¦ª","ð¦","ð§","ð¨","ð©","ðª","ð","ð°","ð§","ð¥§","ð«","ð¬","ð","ð®","ð¯","ð¼","ð¥","â","ð«","ðµ","ð¶","ð¾","ð·","ð¸","ð¹","ðº","ð»","ð¥","ð¥","ð«","ð¥¤","ð§","ð§","ð§","ð§","ð¥¢","ð½","ð´","ð¥","ðª","ð«","ðº","ð","ð","ð","ð","ðº","ð¾","ð§","ð","â°","ð","ð»","ð","ð","ð","ð","ð","ð","ð","ð","ð§±","ðª¨","ðªµ","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð¨","ð©","ðª","ð«","ð¬","ð","ð¯","ð°","ð","ð¼","ð½","âª","ð","ð","ð","â©","ð","â²","âº","ð","ð","ð","ð","ð
","ð","ð","ð","â¨","ð ","ð","ð¡","ð¢","ð","ðª","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð»","ð","ð","ð","ð","ð","ðµ","ð¦½","ð¦¼","ðº","ð²","ð´","ð¹","ð¼","ð","ð£","ð¤","ð¢","â½","ð","ð¨","ð¥","ð¦","ð","ð§","â","ð","âµ","ð¶","ð¤","ð³","â´","ð¥","ð¢","â","ð©","ð«","ð¬","ðª","ðº","ð","ð","ð ","ð¡","ð°","ð","ð¸","ð","ð§³","â","â³","â","â°","â±","â²","ð°","ð","ð§","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð","ð¡","ð","ð¢","ð","ð£","ð","ð¤","ð","ð¥","ð","ð¦","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð¡","â","ð","ð","ðª","â","ð","ð ","ð","â","â
","â","ð¤","ð¥","ð¦","ð§","ð¨","ð©","ðª","ð«","ð¬","ð","ð","ð","â","â","â±","â¡","â","â","â","â","ð¥","ð§","ð","ð","ð","ð","ð","ð§¨","â¨","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð§§","ð","ð","ð","ð","ð«","ð","ð","ð
","ð¥","ð¥","ð¥","â½","â¾","ð¥","ð","ð","ð","ð","ð¾","ð¥","ð³","ð","ð","ð","ð¥","ð","ð¸","ð¥","ð¥","ð¥
","â³","â¸","ð£","ð¤¿","ð½","ð¿","ð·","ð¥","ð¯","ðª","ðª","ð«","ð±","ð®","ðª","ð®","ð¹","ð°","ð²","ð§©","ð§¸","ðª
320
","ðª©","ðª","â ","â¥","â¦","â£","â","ð","ð","ð´","ð","ð¼","ð¨","ð§µ","ðª¡","ð§¶","ðª¢","ð","ð¶","ð¥½","ð¥¼","ð¦º","ð","ð","ð","ð§£","ð§¤","ð§¥","ð§¦","ð","ð","ð¥»","ð©±","ð©²","ð©³","ð","ð","ðª","ð","ð","ð","ð","ð","ð©´","ð","ð","ð¥¾","ð¥¿","ð ","ð¡","ð©°","ð¢","ðª®","ð","ð","ð©","ð","ð§¢","ðª","â","ð¿","ð","ð","ð","ð","ð","ð","ð","ð¢","ð£","ð¯","ð","ð","ð¼","ðµ","ð¶","ð","ð","ð","ð¤","ð§","ð»","ð·","ðª","ð¸","ð¹","ðº","ð»","ðª","ð¥","ðª","ðª","ðª","ð±","ð²","â","ð","ð","ð ","ð","ðª«","ð","ð»","ð¥","ð¨","â¨","ð±","ð²","ð½","ð¾","ð¿","ð","ð§®","ð¥","ð","ð½","ð¬","ðº","ð·","ð¸","ð¹","ð¼","ð","ð","ð¯","ð¡","ð¦","ð®","ðª","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð°","ð","ð","ð","ð·","ð°","ðª","ð´","ðµ","ð¶","ð·","ð¸","ð³","ð§¾","ð¹","â","ð§","ð¨","ð©","ð¤","ð¥","ð¦","ð«","ðª","ð¬","ð","ð®","ð³","â","â","ð","ð","ð","ð","ð","ð¼","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","â","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð¨","ðª","â","â","ð ","ð¡","â","ð£","ðª","ð¹","ð¡","ðª","ð§","ðª","ð©","â","ð","â","ð¦¯","ð","â","ðª","ð§°","ð§²","ðª","â","ð§ª","ð§«","ð§¬","ð¬","ð","ð¡","ð","ð©¸","ð","ð©¹","ð©¼","ð©º","ð©»","ðª","ð","ðª","ðª","ð","ð","ðª","ð½","ðª ","ð¿","ð","ðª¤","ðª","ð§´","ð§·","ð§¹","ð§º","ð§»","ðª£","ð§¼","ð«§","ðª¥","ð§½","ð§¯","ð","ð¬","â°","ðª¦","â±","ð§¿","ðª¬","ð¿","ðª§","ðªª","ð§","ð®","ð°","â¿","ð¹","ðº","ð»","ð¼","ð¾","ð","ð","ð","ð
","â ","ð¸","â","ð«","ð³","ð","ð¯","ð±","ð·","ðµ","ð","â¢","â£","â¬","â","â¡","â","â¬","â","â¬
","â","â","â","â©","âª","⤴","⤵","ð","ð","ð","ð","ð","ð","ð","ð","â","ð","â¡","â¸","â¯","â","â¦","âª","â®","ð","ð¯","ðª¯","â","â","â","â","â","â","â","â","â","â","â","â","â","ð","ð","ð","â¶","â©","â","â¯","â","âª","â®","ð¼","â«","ð½","â¬","â¸","â¹","âº","â","ð¦","ð
","ð","ð¶","ð","ð³","ð´","â","â","â§","â","â","â","â","ð°","â¾","â","â","â","â","ã°","ð±","ð²","â","â»","â","ð±","ð","ð°","â","â
","â","â","â","â","â°","â¿","ã½","â³","â´","â","©","®","tm","#â£","*â£","0â£","1â£","2â£","3â£","4â£","5â£","6â£","7â£","8â£","9â£","ð","ð ","ð¡","ð¢","ð£","ð¤","ð
°","ð","ð
±","ð","ð","ð","ð","ð","ð","ð
¾","ð","ð
¿","ð","ð","ð","ã³ã³","ãµ","æ","æ","æ","å¾","å²","ç¡","ç¦","å¯","ç³","å","空","ç¥","ç§","å¶","æº","ð´","ð ","ð¡","ð¢","ðµ","ð£","ð¤","â«","âª","ð¥","ð§","ð¨","ð©","ð¦","ðª","ð«","â¬","â¬","â¼","â»","â¾","â½","âª","â«","ð¶","ð·","ð¸","ð¹","ðº","ð»","ð ","ð","ð³","ð²","ð","ð©","ð","ð´","ð³","ð³âð","ð³ââ§","ð´ââ ","ð¦ð¨","ð¦ð©","ð¦ðª","ð¦ð«","ð¦ð¬","ð¦ð®","ð¦ð±","ð¦ð²","ð¦ð´","ð¦ð¶","ð¦ð·","ð¦ð¸","ð¦ð¹","ð¦ðº","ð¦ð¼","ð¦ð½","ð¦ð¿","ð§ð¦","ð§ð§","ð§ð©","ð§ðª","ð§ð«","ð§ð¬","ð§ð","ð§ð®","ð§ð¯","ð§ð±","ð§ð²","ð§ð³","ð§ð´","ð§ð¶","ð§ð·","ð§ð¸","ð§ð¹","ð§ð»","ð§ð¼","ð§ð¾","ð§ð¿","ð¨ð¦","ð¨ð¨","ð¨ð©","ð¨ð«","ð¨ð¬","ð¨ð","ð¨ð®","ð¨ð°","ð¨ð±","ð¨ð²","ð¨ð³","ð¨ð´","ð¨ðµ","ð¨ð·","ð¨ðº","ð¨ð»","ð¨ð¼","ð¨ð½","ð¨ð¾","ð¨ð¿","ð©ðª","ð©ð¬","ð©ð¯","ð©ð°","ð©ð²","ð©ð´","ð©ð¿","ðªð¦","ðªð¨","ðªðª","ðªð¬","ðªð","ðªð·","ðªð¸","ðªð¹","ðªðº","ð«ð®","ð«ð¯","ð«ð°","ð«ð²","ð«ð´","ð«ð·","ð¬ð¦","ð¬ð§","ð¬ð©","ð¬ðª","ð¬ð«","ð¬ð¬","ð¬ð","ð¬ð®","ð¬ð±","ð¬ð²","ð¬ð³","ð¬ðµ","ð¬ð¶","ð¬ð·","ð¬ð¸","ð¬ð¹","ð¬ðº","ð¬ð¼","ð¬ð¾","ðð°","ðð²","ðð³","ðð·","ðð¹","ððº","ð®ð¨","ð®ð©","ð®ðª","ð®ð±","ð®ð²","ð®ð³","ð®ð´","ð®ð¶","ð®ð·","ð®ð¸","ð®ð¹","ð¯ðª","ð¯ð²","ð¯ð´","ð¯ðµ","ð°ðª","ð°ð¬","ð°ð","ð°ð®","ð°ð²","ð°ð³","ð°ðµ","ð°ð·","ð°ð¼","ð°ð¾","ð°ð¿","ð±ð¦","ð±ð§","ð±ð¨","ð±ð®","ð±ð°","ð±ð·","ð±ð¸","ð±ð¹","ð±ðº","ð±ð»","ð±ð¾","ð²ð¦","ð²ð¨","ð²ð©","ð²ðª","ð²ð«","ð²ð¬","ð²ð","ð²ð°","ð²ð±","ð²ð²","ð²ð³","ð²ð´","ð²ðµ","ð²ð¶","ð²ð·","ð²ð¸","ð²ð¹","ð²ðº","ð²ð»","ð²ð¼","ð²ð½","ð²ð¾","ð²ð¿","ð³ð¦","ð³ð¨","ð³ðª","ð³ð«","ð³ð¬","ð³ð®","ð³ð±","ð³ð´","ð³ðµ","ð³ð·","ð³ðº","ð³ð¿","ð´ð²","ðµð¦","ðµðª","ðµð«","ðµð¬","ðµð","ðµð°","ðµð±","ðµð²","ðµð³","ðµð·","ðµð¸","ðµð¹","ðµð¼","ðµð¾","ð¶ð¦","ð·ðª","ð·ð´","ð·ð¸","ð·ðº","ð·ð¼","ð¸ð¦","ð¸ð§","ð¸ð¨","ð¸ð©","ð¸ðª","ð¸ð¬","ð¸ð","ð¸ð®","ð¸ð¯","ð¸ð°","ð¸ð±","ð¸ð²","ð¸ð³","ð¸ð´","ð¸ð·","ð¸ð¸","ð¸ð¹","ð¸ð»","ð¸ð½","ð¸ð¾","ð¸ð¿","ð¹ð¦","ð¹ð¨","ð¹ð©","ð¹ð«","ð¹ð¬","ð¹ð","ð¹ð¯","ð¹ð°","ð¹ð±","ð¹ð²","ð¹ð³","ð¹ð´","ð¹ð·","ð¹ð¹","ð¹ð»","ð¹ð¼","ð¹ð¿","ðºð¦","ðºð¬","ðºð²","ðºð³","ðºð¸","ðºð¾","ðºð¿","ð»ð¦","ð»ð¨","ð»ðª","ð»ð¬","ð»ð®","ð»ð³","ð»ðº","ð¼ð«","ð¼ð¸","ð½ð°","ð¾ðª","ð¾ð¹","ð¿ð¦","ð¿ð²","ð¿ð¼","ð´ó §ó ¢ó ¥ó ®ó §ó ¿","ð´ó §ó ¢ó ³ó £ó ´ó ¿","ð´ó §ó ¢ó ·ó ¬ó ³ó ¿"];function b9(t,e,r){const n=t.slice();return n[2]=e[r],n}function y9(t){let e,r=t[2]+"",n,i,s;function o(){return t[1](t[2])}return{c(){e=J("button"),n=pe(r),W(e,"class","btn noselect")}
320,m(a,c){ee(a,e,c),L(e,n),i||(s=Tr(e,"click",o),i=!0)},p(a,c){t=a},d(a){a&&Q(e),i=!1,s()}}}function vme(t){let e,r=Jb,n=[];for(let i=0;i<r.length;i+=1)n[i]=y9(b9(t,r,i));return{c(){e=J("div");for(let i=0;i<n.length;i+=1)n[i].c();W(e,"class","block main svelte-18nsykz")},m(i,s){ee(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,[s]){if(s&1){r=Jb;let o;for(o=0;o<r.length;o+=1){const a=b9(i,r,o);n[o]?n[o].p(a,s):(n[o]=y9(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=r.length}},i:$e,o:$e,d(i){i&&Q(e),hu(n,i)}}}function wme(t,e,r){let{value:n}=e;const i=s=>{r(0,n+=s)};return t.$$set=s=>{"value"in s&&r(0,n=s.value)},[n,i]}class nM extends Rt{constructor(e){super(),xt(this,e,wme,vme,Ct,{value:0})}}const Eme="https://api.protocol.art/api";function zi(t,e){const r=Eme.replace(/\/$/,""),n=String(t).replace(/^\/+/,"");let i=`${r}/${n}`;if(e==null)return i;const s=e instanceof URLSearchParams?e.toString():new URLSearchParams(Object.fromEntries(Object.entries(e).map(([o,a])=>[o,a==null?"":String(a)]))).toString();return s?`${i}?${s}`:i}function v9(t,e,r){const n=t.slice();return n[10]=e[r],n}function w9(t){let e,r,n,i;function s(a){t[5](a)}let o={};return t[1]!==void 0&&(o.value=t[1]),r=new nM({props:o}),Mr.push(()=>Vr(r,"value",s)),{c(){e=J("div"),he(r.$$.fragment),W(e,"class","emojis svelte-iesnd6"),an(e,"emojis-header",t[0]),an(e,"emojis-notheader",!t[0])},m(a,c){ee(a,e,c),fe(r,e,null),i=!0},p(a,c){const l={};!n&&c&2&&(n=!0,l.value=a[1],Gr(()=>n=!1)),r.$set(l),(!i||c&1)&&an(e,"emojis-header",a[0]),(!i||c&1)&&an(e,"emojis-notheader",!a[0])},i(a){i||(te(r.$$.fragment,a),i=!0)},o(a){ne(r.$$.fragment,a),i=!1},d(a){a&&Q(e),de(r)}}}function Ame(t){let e;return{c(){e=pe("Emojis")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function E9(t){let e,r=t[3],n=[];for(let i=0;i<r.length;i+=1)n[i]=A9(v9(t,r,i));return{c(){e=J("div");for(let i=0;i<n.length;i+=1)n[i].c();W(e,"class","suggestions svelte-iesnd6")},m(i,s){ee(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,s){if(s&24){r=i[3];let o;for(o=0;o<r.length;o+=1){const a=v9(i,r,o);n[o]?n[o].p(a,s):(n[o]=A9(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=r.length}},d(i){i&&Q(e),hu(n,i)}}}function _me(t){let e,r=Ta(t[10].Owner)+"",n;return{c(){e=J("div"),n=pe(r)},m(i,s){ee(i,e,s),L(e,n)},p(i,s){s&8&&r!==(r=Ta(i[10].Owner)+"")&<(n,r)},d(i){i&&Q(e)}}}function Cme(t){let e;return{c(){e=J("div"),e.textContent="available",W(e,"class","green svelte-iesnd6")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function Sme(t){let e;return{c(){e=J("div"),e.textContent="name is not valid",W(e,"class","red svelte-iesnd6")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function A9(t){let e,r,n=t[10].Name+Kc+"",i,s,o,a,c,l;function u(g,b){return b&8&&(o=null),g[10].invalid?Sme:(o==null&&(o=!!yme(g[10])),o?Cme:_me)}let f=u(t,-1),d=f(t);function h(){return t[8](t[10])}return{c(){e=J("div"),r=J("div"),i=pe(n),s=Y(),d.c(),a=Y(),W(r,"class","spacer"),W(e,"class","suggestion svelte-iesnd6")},m(g,b){ee(g,e,b),L(e,r),L(r,i),L(e,s),d.m(e,null),L(e,a),c||(l=Tr(e,"click",h),c=!0)},p(g,b){t=g,b&8&&n!==(n=t[10].Name+Kc+"")&<(i,n),f===(f=u(t,b))&&d?d.p(t,b):(d.d(1),d=f(t),d&&(d.c(),d.m(e,a)))},d(g){g&&Q(e),d.d(),c=!1,l()}}}function Tme(t){let e,r,n,i,s,o,a,c,l,u,f=t[2]&&w9(t);i=new un({props:{on_click:t[6],$$slots:{default:[Ame]},$$scope:{ctx:t}}});let d=t[3]&&E9(t);return{c(){e=J("div"),f&&f.c(),r=Y(),n=J("div"),he(i.$$.fragment),s=Y(),o=J("input"),a=Y(),d&&d.c(),W(n,"class","emojis-btn svelte-iesnd6"),W(o,"type","text"),W(o,"class","name svelte-iesnd6"),W(o,"placeholder","Type name"),W(e,"class","main svelte-iesnd6")},m(h,g){ee(h,e,g),f&&f.m(e,null),L(e,r),L(e,n),fe(i,n,null),L(e,s),L(e,o),Ir(o,t[1]),L(e,a),d&&d.m(e,null),c=!0,l||(u=Tr(o,"input",t[7]),l=!0)},p(h,[g]){h[2]?f?(f.p(h,g),g&4&&te(f,1)):(f=w9(h),f.c(),te(f,1),f.m(e,r)):f&&(_r(),ne(f,1,1,()=>{f=null}),Cr());const b={};g&4&&(b.on_click=h[6]),g&8192&&(b.$$scope={dirty:g,ctx:h}),i.$set(b),g&2&&o.value!==h[1]&&Ir(o,h[1]),h[3]?d?d.p(h,g):(d=E9(h),d.c(),d.m(e,null)):d&&(d.d(1),d=null)},i(h){c||(te(f),te(i.$$.fragment,h),c=!0)},o(h){ne(f),ne(i.$$.fragment,h),c=!1},d(h){h&&Q(e),f&&f.d(),de(i),d&&d.d(),l=!1,u()}}}function Nme(t,e,r){let n="",i=!1,s=[],{header:o=!1}=e;function a(h){r(1,n=""),r(3,s=[]),r(2,i=!1),_1("/name/"+h+Kc)}async function c(h){try{let g=n2(h);if(!z6(g+Kc))return;let b=await fetch(zi("art-tokens/suggest",{name:g}));
320b.status==200?r(3,s=await b.json()):r(3,s=[{Name:g,invalid:!0}])}catch(g){console.log(g)}}function l(h){n=h,r(1,n)}const u=()=>{r(2,i=!i)};function f(){n=this.value,r(1,n)}const d=h=>{a(h.Name)};return t.$$set=h=>{"header"in h&&r(0,o=h.header)},t.$$.update=()=>{t.$$.dirty&2&&c(n)},[o,n,i,s,a,l,u,f,d]}class VE extends Rt{constructor(e){super(),xt(this,e,Nme,Tme,Ct,{header:0})}}function _9(t){let e,r;return e=new ah({props:{to:"/account/"+t[1],$$slots:{default:[Ime]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.to="/account/"+n[1]),i&87&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Ime(t){let e,r,n,i,s,o=(t[0]||Ta(t[1]))+"",a;return{c(){e=J("div"),r=J("div"),i=Y(),s=J("div"),a=pe(o),W(r,"class","avatar svelte-rjqhz2"),W(r,"style",n=t[2]?"background-image:url("+t[2]+");":t[4]),an(r,"empty",!t[2]&&!t[4]),W(s,"class","name svelte-rjqhz2"),W(e,"class","main btn-like svelte-rjqhz2")},m(c,l){ee(c,e,l),L(e,r),L(e,i),L(e,s),L(s,a)},p(c,l){l&20&&n!==(n=c[2]?"background-image:url("+c[2]+");":c[4])&&W(r,"style",n),l&20&&an(r,"empty",!c[2]&&!c[4]),l&3&&o!==(o=(c[0]||Ta(c[1]))+"")&<(a,o)},d(c){c&&Q(e)}}}function xme(t){let e,r,n=t[3]&&_9(t);return{c(){n&&n.c(),e=ti()},m(i,s){n&&n.m(i,s),ee(i,e,s),r=!0},p(i,[s]){i[3]?n?(n.p(i,s),s&8&&te(n,1)):(n=_9(i),n.c(),te(n,1),n.m(e.parentNode,e)):n&&(_r(),ne(n,1,1,()=>{n=null}),Cr())},i(i){r||(te(n),r=!0)},o(i){ne(n),r=!1},d(i){n&&n.d(i),i&&Q(e)}}}function Rme(t,e,r){let{client:n}=e,{name:i,address:s,avatar:o}=e,a;async function c(){if(n){r(4,a=void 0),r(1,s=n.account),r(0,i=await sme({chainId:1,address:s})),r(2,o=await ome({chainId:1,address:s}));let l=Number(BigInt(s)%BigInt(360));r(4,a="background:linear-gradient("+l+30+"deg,hsla("+l+",80%, 72%, 1), hsla("+(l-90)+", 80%, 72%, 1));")}}return t.$$set=l=>{"client"in l&&r(3,n=l.client),"name"in l&&r(0,i=l.name),"address"in l&&r(1,s=l.address),"avatar"in l&&r(2,o=l.avatar)},t.$$.update=()=>{t.$$.dirty&8&&c()},[i,s,o,n,a]}class J6 extends Rt{constructor(e){super(),xt(this,e,Rme,xme,Ct,{client:3,name:0,address:1,avatar:2})}}function Pme(t){let e,r;return{c(){e=J("img"),W(e,"class","logo svelte-19gctm7"),p7(e.src,r="/logo.svg")||W(e,"src",r)},m(n,i){ee(n,e,i)},p:$e,d(n){n&&Q(e)}}}function C9(t){let e,r,n;return r=new VE({props:{header:"true"}}),{c(){e=J("div"),he(r.$$.fragment),On(e,"font-size","0.75em"),On(e,"max-width","25em")},m(i,s){ee(i,e,s),fe(r,e,null),n=!0},i(i){n||(te(r.$$.fragment,i),n=!0)},o(i){ne(r.$$.fragment,i),n=!1},d(i){i&&Q(e),de(r)}}}function kme(t){let e,r;return{c(){e=J("img"),W(e,"class","logo svelte-19gctm7"),p7(e.src,r="/logo.svg")||W(e,"src",r)},m(n,i){ee(n,e,i)},p:$e,d(n){n&&Q(e)}}}function S9(t){let e,r,n;return r=new VE({props:{header:"true"}}),{c(){e=J("div"),he(r.$$.fragment),W(e,"class","spacer svelte-19gctm7"),On(e,"flex-grow","10"),On(e,"font-size","0.75em"),On(e,"max-width","25em")},m(i,s){ee(i,e,s),fe(r,e,null),n=!0},i(i){n||(te(r.$$.fragment,i),n=!0)},o(i){ne(r.$$.fragment,i),n=!1},d(i){i&&Q(e),de(r)}}}function Ome(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M,F,H,U,G,N,A,v,p,m,y,T,I,_,E,C,S,B;n=new ah({props:{to:"/",$$slots:{default:[Pme]},$$scope:{ctx:t}}});let $=t[1]&&C9();f=new J6({props:{client:t[0]}});function P(ie){t[4](ie)}let q={};t[0]!==void 0&&(q.client=t[0]),h=new p9({props:q}),Mr.push(()=>Vr(h,"client",P)),R=new ah({props:{to:"/",$$slots:{default:[kme]},$$scope:{ctx:t}}});let V=t[1]&&S9();N=new bme({}),N.$on("click",t[5]),_=new J6({props:{client:t[0]}});function X(ie){t[6](ie)}let Z={};return t[0]!==void 0&&(Z.client=t[0]),C=new p9({props:Z}),Mr.push(()=>Vr(C,"client",X)),{c(){e=J("div"),r=J("div"),he(n.$$.fragment),i=Y(),$&&$.c(),s=Y(),o=J("div"),a=Y(),c=J("a"),c.textContent="FAQ",l=Y(),u=J("div"),he(f.$$.fragment),d=Y(),he(h.$$.fragment),b=Y(),w=J("div"),x=J("div"),k=J("div"),he(R.$$.fragment),D=Y(),O=J("div"),M=Y(),V&&V.c(),F=Y(),H=J("div"),U=Y(),G=J("div"),he(N.$$.fragment),A=Y(),v=J("div"),p=J("div"),m=Y(),y=J("a"),y.textContent="FAQ",T=Y(),I=J("div"),he(_.$$.fragment),E=Y(),he(C.$$.fragment),W(o,"class","spacer svelte-19gctm7"),W(c,"href","https://docs.protocol.art/"),W(c,"target","_blank"),W(c,"class","menu-item svelte-19gctm7"),W(u,"class","menu-item svelte-19gctm7"),W(r,"class","main desktop svelte-19gctm7"),W(O,"class","spacer svelte-19gctm7"),W(H,"class","spacer svelte-19gctm7"),W(x,"class","row svelte-19gctm7"),W(p,"class","spacer svelte-19gctm7"),W(y,"href","https://docs.protocol.art/"),W(y,"target","_blank"),W(y,"class","menu-item svelte-19gctm7"),W(I,"class","menu-item svelte-19gctm7"),W(v,"align","center"),W(v,"class","svelte-19gctm7"),an(v,"drop",t[2]),an(v,"drop-hidden",!t[2]),W(w,"class","main mobile svelte-19gctm7")},m(ie,ce){ee(ie,e,ce),L(e,r),fe(n,r,null),L(r,i),$&&$.m(r,null),L(r,s),L(r,o),L(r,a),L(r,c),L(r,l),L(r,u),fe(f,u,null),L(r,d),fe(h,r,null),L(e,b),L(e,w),L(w,x),L(x,k),fe(R,k,null),L(x,D),L(x,O),L(x,M),V&&V.m(x,null),L(x,F),L(x,H),L(x,U),L(x,G),fe(N,G,null),L(w,A),L(w,v),L(v,p),L(v,m),L(v,y),L(v,T),L(v,I),fe(_,I,null),L(v,E),fe(C,v,null),B=!0},p(ie,[ce]){const se={};ce&128&&(se.$$scope={dirty:ce,ctx:ie}),n.$set(se),ie[1]?$?ce&2&&te($,1):($=C9(),$.c(),te($,1),$.m(r,s)):$&&(_r(),ne($,1,1,()=>{$=null}),Cr());const _e={};
320ce&1&&(_e.client=ie[0]),f.$set(_e);const ye={};!g&&ce&1&&(g=!0,ye.client=ie[0],Gr(()=>g=!1)),h.$set(ye);const Te={};ce&128&&(Te.$$scope={dirty:ce,ctx:ie}),R.$set(Te),ie[1]?V?ce&2&&te(V,1):(V=S9(),V.c(),te(V,1),V.m(x,F)):V&&(_r(),ne(V,1,1,()=>{V=null}),Cr());const ht={};ce&1&&(ht.client=ie[0]),_.$set(ht);const Ot={};!S&&ce&1&&(S=!0,Ot.client=ie[0],Gr(()=>S=!1)),C.$set(Ot),(!B||ce&4)&&an(v,"drop",ie[2]),(!B||ce&4)&&an(v,"drop-hidden",!ie[2])},i(ie){B||(te(n.$$.fragment,ie),te($),te(f.$$.fragment,ie),te(h.$$.fragment,ie),te(R.$$.fragment,ie),te(V),te(N.$$.fragment,ie),te(_.$$.fragment,ie),te(C.$$.fragment,ie),B=!0)},o(ie){ne(n.$$.fragment,ie),ne($),ne(f.$$.fragment,ie),ne(h.$$.fragment,ie),ne(R.$$.fragment,ie),ne(V),ne(N.$$.fragment,ie),ne(_.$$.fragment,ie),ne(C.$$.fragment,ie),B=!1},d(ie){ie&&Q(e),de(n),$&&$.d(),de(f),de(h),de(R),V&&V.d(),de(N),de(_),de(C)}}}function Mme(t,e,r){let{client:n,url:i,search:s}=e,o=!1;function a(u){n=u,r(0,n)}const c=()=>{r(2,o=!o)};function l(u){n=u,r(0,n)}return t.$$set=u=>{"client"in u&&r(0,n=u.client),"url"in u&&r(3,i=u.url),"search"in u&&r(1,s=u.search)},[n,s,o,i,a,c,l]}class Dme extends Rt{constructor(e){super(),xt(this,e,Mme,Ome,Ct,{client:0,url:3,search:1})}}function Bme(t){let e,r;const n=t[1].default,i=Ya(n,t,t[0],null);return{c(){e=J("div"),i&&i.c(),W(e,"class","main svelte-16m1g8f")},m(s,o){ee(s,e,o),i&&i.m(e,null),r=!0},p(s,[o]){i&&i.p&&(!r||o&1)&&ec(i,n,s,s[0],r?Qa(n,s[0],o,null):tc(s[0]),null)},i(s){r||(te(i,s),r=!0)},o(s){ne(i,s),r=!1},d(s){s&&Q(e),i&&i.d(s)}}}function Fme(t,e,r){let{$$slots:n={},$$scope:i}=e;return t.$$set=s=>{"$$scope"in s&&r(0,i=s.$$scope)},[i,n]}class bu extends Rt{constructor(e){super(),xt(this,e,Fme,Bme,Ct,{})}}function $me(t){let e;return{c(){e=J("div"),e.textContent="starts now",W(e,"class","title t2 svelte-12k1azd")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function Lme(t){let e;return{c(){e=J("div"),e.textContent=`starts in ${Math.trunc(t[1])}d ${t[2]}h ${t[3]}m`,W(e,"class","title t2 svelte-12k1azd")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function Ume(t){let e;return{c(){e=pe("Premium names list")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Hme(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D;function O(H,U){return H[0]>0?Lme:$me}let F=O(t)(t);return l=new VE({}),f=new ah({props:{to:"/premium",$$slots:{default:[Ume]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),r.textContent="Decentralized .ART identity",n=Y(),i=J("div"),i.textContent="Premium names registration",s=Y(),F.c(),o=Y(),a=J("div"),a.textContent="Register Your ENS .ART Identity The First DNS-compatible ENS domain zone. Get a unique ENS name or your ENS match for your DNS .ART name",c=Y(),he(l.$$.fragment),u=Y(),he(f.$$.fragment),d=Y(),h=J("br"),g=Y(),b=J("br"),w=Y(),x=J("br"),k=Y(),R=J("br"),W(r,"class","title t1 svelte-12k1azd"),W(i,"class","title t2 svelte-12k1azd"),W(a,"class","subtitle t2 svelte-12k1azd"),W(e,"class","main svelte-12k1azd"),W(e,"align","center")},m(H,U){ee(H,e,U),L(e,r),L(e,n),L(e,i),L(e,s),F.m(e,null),L(e,o),L(e,a),L(e,c),fe(l,e,null),L(e,u),fe(f,e,null),L(e,d),L(e,h),L(e,g),L(e,b),L(e,w),L(e,x),L(e,k),L(e,R),D=!0}
320,p(H,[U]){F.p(H,U);const G={};U&128&&(G.$$scope={dirty:U,ctx:H}),f.$set(G)},i(H){D||(te(l.$$.fragment,H),te(f.$$.fragment,H),D=!0)},o(H){ne(l.$$.fragment,H),ne(f.$$.fragment,H),D=!1},d(H){H&&Q(e),F.d(),de(l),de(f)}}}function jme(t,e,r){let{hidesearch:n}=e,i=new Date,o=(new Date("2023-04-11T17:00:00Z").valueOf()-i.valueOf())/1e3,a=Math.trunc(o/3600/24),c=Math.trunc(o/3600%24),l=Math.trunc(o/60%60);return sy(()=>{r(4,n=!0)}),s5(()=>{r(4,n=!1)}),t.$$set=u=>{"hidesearch"in u&&r(4,n=u.hidesearch)},[o,a,c,l,n]}class zme extends Rt{constructor(e){super(),xt(this,e,jme,Hme,Ct,{hidesearch:4})}}function T9(t){let e,r,n;return r=new A7({}),{c(){e=J("div"),he(r.$$.fragment),W(e,"class","loader svelte-1l997mw")},m(i,s){ee(i,e,s),fe(r,e,null),n=!0},i(i){n||(te(r.$$.fragment,i),n=!0)},o(i){ne(r.$$.fragment,i),n=!1},d(i){i&&Q(e),de(r)}}}function Jme(t){let e,r,n;const i=t[2].default,s=Ya(i,t,t[1],null);let o=t[0]&&T9();return{c(){e=J("div"),s&&s.c(),r=Y(),o&&o.c(),W(e,"class","main svelte-1l997mw")},m(a,c){ee(a,e,c),s&&s.m(e,null),L(e,r),o&&o.m(e,null),n=!0},p(a,[c]){s&&s.p&&(!n||c&2)&&ec(s,i,a,a[1],n?Qa(i,a[1],c,null):tc(a[1]),null),a[0]?o?c&1&&te(o,1):(o=T9(),o.c(),te(o,1),o.m(e,null)):o&&(_r(),ne(o,1,1,()=>{o=null}),Cr())},i(a){n||(te(s,a),te(o),n=!0)},o(a){ne(s,a),ne(o),n=!1},d(a){a&&Q(e),s&&s.d(a),o&&o.d()}}}function qme(t,e,r){let{$$slots:n={},$$scope:i}=e,{loading:s=!1}=e;return t.$$set=o=>{"loading"in o&&r(0,s=o.loading),"$$scope"in o&&r(1,i=o.$$scope)},[s,i,n]}class WE extends Rt{constructor(e){super(),xt(this,e,qme,Jme,Ct,{loading:0})}}function Gme(t){let e,r,n,i,s,o,a,c=t[0]>1?"s":"",l,u,f,d,h;return{c(){e=J("div"),r=J("button"),r.textContent="-",n=Y(),i=J("div"),s=pe(t[0]),o=Y(),a=pe(t[1]),l=pe(c),u=Y(),f=J("button"),f.textContent="+",W(r,"class","btn svelte-1qzpufc"),W(i,"class","spacer value svelte-1qzpufc"),W(f,"class","btn svelte-1qzpufc"),W(e,"class","years svelte-1qzpufc"),W(e,"align","center")},m(g,b){ee(g,e,b),L(e,r),L(e,n),L(e,i),L(i,s),L(i,o),L(i,a),L(i,l),L(e,u),L(e,f),d||(h=[Tr(r,"click",t[2]),Tr(f,"click",t[3])],d=!0)},p(g,[b]){b&1&<(s,g[0]),b&2&<(a,g[1]),b&1&&c!==(c=g[0]>1?"s":"")&<(l,c)},i:$e,o:$e,d(g){g&&Q(e),d=!1,co(h)}}}function Vme(t,e,r){let{value:n=1}=e,{unit:i}=e;const s=()=>{r(0,n--,n)},o=()=>{r(0,n++,n)};return t.$$set=a=>{"value"in a&&r(0,n=a.value),"unit"in a&&r(1,i=a.unit)},t.$$.update=()=>{t.$$.dirty&1&&r(0,n=n<1?1:n)},[n,i,s,o]}class iM extends Rt{constructor(e){super(),xt(this,e,Vme,Gme,Ct,{value:0,unit:1})}}function Wme(t){let e,r,n;return r=new un({props:{disabled:!0,$$slots:{default:[Xme]},$$scope:{ctx:t}}}),{c(){e=J("span"),he(r.$$.fragment),W(e,"title","Wallet is not connected")},m(i,s){ee(i,e,s),fe(r,e,null),n=!0},p(i,s){const o={};s&65536&&(o.$$scope={dirty:s,ctx:i}),r.$set(o)},i(i){n||(te(r.$$.fragment,i),n=!0)},o(i){ne(r.$$.fragment,i),n=!1},d(i){i&&Q(e),de(r)}}}function Kme(t){let e,r;return e=new un({props:{on_click:t[3],disabled:t[1],comment:t[2],$$slots:{default:[Zme]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.disabled=n[1]),i&4&&(s.comment=n[2]),i&65536&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Xme(t){let e;const r=t[15].default,n=Ya(r,t,t[16],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&65536)&&ec(n,r,i,i[16],e?Qa(r,i[16],s,null):tc(i[16]),null)},i(i){e||(te(n,i),e=!0)},o(i){ne(n,i),e=!1},d(i){n&&n.d(i)}}}function Zme(t){let e;const r=t[15].default,n=Ya(r,t,t[16],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&65536)&&ec(n,r,i,i[16],e?Qa(r,i[16],s,null):tc(i[16]),null)},i(i){e||(te(n,i),e=!0)},o(i){ne(n,i),e=!1},d(i){n&&n.d(i)}}}function Yme(t){let e,r,n,i;const s=[Kme,Wme],o=[];function a(c,l){return c[0]?0:1}return e=a(t),r=o[e]=s[e](t),{c(){r.c(),n=ti()},m(c,l){o[e].m(c,l),ee(c,n,l),i=!0},p(c,[l]){let u=e;e=a(c),e===u?o[e].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),r=o[e],r?r.p(c,l):(r=o[e]=s[e](c),r.c()),te(r,1),r.m(n.parentNode,n))},i(c){i||(te(r),i=!0)},o(c){ne(r),i=!1},d(c){o[e].d(c),c&&Q(n)}}}function Qme(t,e,r){let{$$slots:n={},$$scope:i}=e,{client:s,address:o,abi:a,method:c,args:l,value:u,error:f,then:d,step:h,steps:g,disabled:b,fetchCallParams:w}=e,{chain_id:x=1}=e,k,R;async function D(){if(w){let O=await w();r(4,c=O.Method),r(5,l=O.Args),r(6,u=O.Value),r(8,h=O.Step),r(9,g=O.Steps)}console.log(R);try{if(s.chain.id!=x){alert("Please, switch network!");return}r(2,k="Confirm in wallet");let{hash:O}=await rme({address:o,abi:a,functionName:c,args:l,value:u||0});r(2,k="Pending"),await nme({confirmations:h==g?1:7,hash:O}),r(2,k=""),h>=g?d&&d():await D()}catch(O){if(console.log(O),O.message){if(O.message.includes("denied")){r(7,f="The transaction was rejected");return}if(O.message.includes("insufficient funds")){r(7,f="Insufficient funds");return}else{r(7,f="An error has occurred");return}}typeof O=="string"&&r(7,f=O)}}return t.$$set=O=>{"client"in O&&r(0,s=O.client),"address"in O&&r(10,o=O.address),"abi"in O&&r(11,a=O.abi),"method"in O&&r(4,c=O.method),"args"in O&&r(5,l=O.args),"value"in O&&r(6,u=O.value),"error"in O&&r(7,f=O.error),"then"in O&&r(12,d=O.then),"step"in O&&r(8,h=O.
vendor: 4,297 bytes, lines 320-329
320step),"steps"in O&&r(9,g=O.steps),"disabled"in O&&r(1,b=O.disabled),"fetchCallParams"in O&&r(13,w=O.fetchCallParams),"chain_id"in O&&r(14,x=O.chain_id),"$$scope"in O&&r(16,i=O.$$scope)},[s,b,k,D,c,l,u,f,h,g,o,a,d,w,x,n,i]}class Ph extends Rt{constructor(e){super(),xt(this,e,Qme,Yme,Ct,{client:0,address:10,abi:11,method:4,args:5,value:6,error:7,then:12,step:8,steps:9,disabled:1,fetchCallParams:13,chain_id:14})}}function N9(t){let e,r,n,i,s,o,a,c,l,u,f;const d=t[2].default,h=Ya(d,t,t[1],null);return{c(){e=J("div"),r=J("div"),n=Y(),i=J("div"),s=J("div"),o=J("div"),a=J("div"),a.textContent="Ã",c=Y(),h&&h.c(),W(r,"class","back svelte-1nvwut1"),W(a,"class","close noselect svelte-1nvwut1"),W(o,"class",""),W(s,"class","wrap block svelte-1nvwut1"),W(i,"class","modal svelte-1nvwut1")},m(g,b){ee(g,e,b),L(e,r),L(e,n),L(e,i),L(i,s),L(s,o),L(o,a),L(o,c),h&&h.m(o,null),l=!0,u||(f=[Tr(r,"click",t[3]),Tr(a,"click",t[4])],u=!0)},p(g,b){h&&h.p&&(!l||b&2)&&ec(h,d,g,g[1],l?Qa(d,g[1],b,null):tc(g[1]),null)},i(g){l||(te(h,g),l=!0)},o(g){ne(h,g),l=!1},d(g){g&&Q(e),h&&h.d(g),u=!1,co(f)}}}function ebe(t){let e,r,n=t[0]&&N9(t);return{c(){n&&n.c(),e=ti()},m(i,s){n&&n.m(i,s),ee(i,e,s),r=!0},p(i,[s]){i[0]?n?(n.p(i,s),s&1&&te(n,1)):(n=N9(i),n.c(),te(n,1),n.m(e.parentNode,e)):n&&(_r(),ne(n,1,1,()=>{n=null}),Cr())},i(i){r||(te(n),r=!0)},o(i){ne(n),r=!1},d(i){n&&n.d(i),i&&Q(e)}}}function tbe(t,e,r){let{$$slots:n={},$$scope:i}=e,{open:s=!1}=e;const o=()=>r(0,s=!1),a=()=>r(0,s=!s);return t.$$set=c=>{"open"in c&&r(0,s=c.open),"$$scope"in c&&r(1,i=c.$$scope)},[s,i,n,o,a]}class KE extends Rt{constructor(e){super(),xt(this,e,tbe,ebe,Ct,{open:0})}}function rbe(t){let e;return{c(){e=pe("Close")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function nbe(t){let e,r,n,i,s,o;return s=new un({props:{on_click:t[1],$$slots:{default:[rbe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),r.innerHTML=`<p>APPENDIX 321.ART SPECIFIC CONDITIONS FOR LINKING ENS AND DNS REGISTRATIONS 322Note that whenever the term âdomainâ, âdomain nameâ â.ART DNS nameâ or âDNS nameâ is used in these conditions, reference is made to a DNS domain name that is registered via an ICANN-accredited registrar or a reseller thereof and resolves via the Domain Name System based on the root servers governed by ICANN. 323Whenever the term â.ART ENS nameâ or âENS nameâ is used, reference is made to domain names registered via the Web3 / Ethereum Name System (ENS) distributed, open, and extensible naming system based on the Ethereum blockchain.</p> 324 325<p>1. .ART DNS Names 326Should you seek to register a .ART domain name («Registry .ART») from UK Creative Ideas Limited («Registry»), you must agree to be bound by the terms of the registrant agreement provided by the registrar used by the registrant. In cases where the registrant uses get.art as the registrar, and in cases describing the registration of a DNS name subsequent to the registration of an ENS name (described below) the following terms apply. 327Terms covering Description of DNS Services, Limitation of Liability, Fees, Multiple Domain Registrations, Required Domain Registration Information, Domain Privacy Service, Domain Parking, Registration Renewal, Domain Dispute Resolution Policy, Change of Registrant, Agents and Licensing, Representations and Warranties, Indemnification, Warranty Disclaimer, Limitation of Liability, Term and Termination, and Additional Terms can be found in the body of the agreement at https://static.get.art/doc/legal/2-registrar-registrant-agreement-for-domain-names.pdf?_gl=1*1i1o9yl*_ga*ODE2ODA1MTc1LjE2ODIzNzIwMjY.*_ga_LCJHL5V2GP*MTY4ODYzMzQxMy41LjEuMTY4ODYzMzQ2Ny42LjAuMA.[a] This document is an Appendix to that agreement. 3281. You agree to be bound by the terms and conditions of the initial launch of the Registry TLD (including all of the applicable periods defined in the Launch Policy http://nic.art/index.php/ policies/) and further acknowledge that, to the extent permitted by Applicable Law, Registry has no liability of any kind for any loss or liability resulting from the proceedings and processes relating to any of the applicable registration periods defined in the Launch Policy (http://nic.art/ index.php/policies/), including: 329(1) the ability or inability of a registrant to obtain a Registered Name during the peri
329ods defined therein, and; 330(2) the results of any dispute over registrations that are an identical match to trademarks or service marks listed in the Trademark Clearinghouse. 331</p><p>2. You acknowledge and agree to comply with all ICANN standards, policies, procedures and practices, as may be adopted or amended from time to time, as well as all Registry Policies (http:// nic.art/index.php/policies/). 332</p><p>3. You consent to the use, copying, distribution, publication, modification and other processing of yourâs or Registered Name Holderâs Personal Data by Registry and its designees and agents in 333a manner consistent with the Registry Privacy Policies (http://nic.art/index.php/policies/), ICANN policies, and with relevant mandatory local data protection and privacy laws. 334</p><p>4. You consent to submit to proceedings commenced under, and abide by all decisions made 335by panels in accordance with, ICANNâs Uniform Domain Name Dispute Resolution Policy (UDRP), Post-Delegation Dispute Resolution Procedures (PDDRP) (https://newgtlds.icann.org/en/program- status/pddrp), and the Uniform Rapid Suspension System (URS). 336</p><p>5. You agree to immediately correct and update the Registration Information for the domain name during the registration term. 337</p><p>6. You will implement reasonable and appropriate security measures commensurate with the offering of any services, as defined by applicable law, rules, policies and/or regulations if you collect and maintain sensitive health or financial data. 338</p><p>7. You have any necessary authorizations, charters, licenses and/or related credentials for any participation in the relevant markets. 339</p><p>8. You will comply with all ICANN requirements, including without limitation Consensus Policies, and all operational standards, policies, procedures and practices for the Registry TLD established from time to time consistent with ICANN requirements. 340</p><p>9. You will comply with all applicable laws, rules, policies and/or regulations, including those that relate to privacy, data collection, consumer protection (including in relation to misleading and deceptive content), fair lending, debt collection, organic farming, disclosure of data, and financial disclosures. 341</p><p>10. You acknowledge and agree that Registry reserves the right to deny, cancel or transfer any registration or transaction, or place any domain name(s) on registry lock, hold or similar status, that it deems necessary, in its sole discretion: 342</p><p>(1) to comply with specifications adopted by any industry group generally recognized as authoritative with respect to the Internet (e.g., RFCs); 343</p><p>(2) to protect the rights and property of Registry and to avoid any potential or actual liability, civil or criminal, on the part of Registry as well as its affiliates, subsidiaries, officers, directors, representatives, employees, or stockholders; 344</p><p>(3) to protect the integrity and stability of the Registry and the operation of the DNS; and 345</p><p>(4) to comply with all applicable laws, government rules or requirements, requests of law enforcement, or any dispute resolution process. 346</p><p>11. You consent to the collection and use of your personal data for the provision of services by Registry and consent to being contacted by Registry in accordance with Registry Policies (http:// nic.art/index.php/policies/). 347</p><p>12. You agree to comply with the Registryâs Acceptable Use Policy contained in the Registry Policies at http://nic.art/index.php/policies/. 348 349 350</p><p>2. .ART ENS Names 351 352 353Should you seek to register or become the owner of a .ART ENS name, you must agree to be bound by the following additional terms entered into with UKCI Holdings Ltd. In the event that a term in this section conflicts with the Registration Agreement for DNS names, the terms for the DNS names shall prevail. 354The Registry seeks to ensure that matching DNS names and ENS names cannot have different holders. As a consequence, there are dependencies between the DNS and the ENS terms and the use of the matching DNS and ENS names. 355Note that we provide no guarantee of the value, suitability or potential profit of any .ART DNS or ENS names minted and/
355or registered through our service. 356It is your sole responsibility to securely store and manage your access to your .ART ENS and DNS names. We cannot be held accountable for any loss due to your errors, the loss of credentials or any other factors outside our control. 357You wish to register a .ART ENS name and do not hold the .ART DNS name? 358in order to ensure that no third-party can register the corresponding DNS name identical with your ENS name, UKCI Holdings Ltd., an affiliated company of the Registry has registered that DNS name at the time the ENS name was created. 359Note that in this scenario, the DNS name must remain at get.art (UKCI Holdings Ltd.) as the registrar and the DNS name cannot be transferred to another registrar. You can use our privacy service for the DNS name registration. 360You already hold a .ART DNS name? 361If you already hold a DNS name, you can seek to register the corresponding identical name as an ENS name. You can do so at protocol.art (UKCI Holdings Ltd.) regardless of the registrar of the DNS name. You need to confirm your ownership of the DNS name to us at protocol.art so we can connect your DNS name with the corresponding identical ENS name. Note that after adding an ENS name to your DNS name, additional terms affect your DNS name registration. The applicable fees can be found at 362You only wish to hold a .ART ENS name? 363It is possible to only register and hold a .ART ENS name. However, this is only possible where a) a corresponding DNS name is not allowed, i.e. an emoji or other special character(s) that are not allowed to be used in a DNS .ART domain, or b) the corresponding DNS name is unregistered and available. Where a DNS name is available, UKCI Holdings Ltd. registers the identical second-level domain name as a .ART DNS name. You can use the DNS name and not obtain ownership of the DNS name in this case. However, certain obligations arise as described or referenced in these terms. Section 7. a-c. of this Registrar Registrant agreement for Domain Names applies as if the DNS name was yours. 364You wish to add a .ART DNS name to your .ART ENS name? 365Should you seek to own the corresponding identical DNS name in addition to your ENS name, you may obtain ownership of the identical string as a DNS name under the .ART Top Level Domain from UKCI Holdings Ltd. 366In order to obtain the .ART DNS name, you need to go through the registration process for DNS names including the verification of the Registered Name Holderâs contact information, see Section 5. G. of this Registrar Registrant Agreement for Domain Names at get.art. Upon successful completion of the registration and verification process, the DNS name will be transferred to you by UKCI Holdings Ltd. The term for the DNS name will be the term of the original ENS name and can be renewed. 367When you take ownership: (1) The name will be registered at get.art and you can use our privacy service for the DNS name registration; (2) the DNS name can be transferred from get.art (UKCI Holdings Ltd.) to another registrar using approved transfer processes. 368When you obtain ownership of the DNS name, the DNS name becomes the âmaster,â meaning that ownership must be maintained in order to keep control of the ENS name. 369In case you fail to successfully complete the registration and verification process, you cannot obtain the DNS name. 370</p><p>1. Our platform / infrastructure 371The access and use of our services at protocol.art is conditional to your agreement to and acceptance of the terms of these conditions. 372Note that we perform the verification of the Registrant of a DNS name to the matching ENS name and the minting of the ENS name as well as the publication of the domain name and associated records, but blockchain networks are operated by other parties and infrastructure that is not controlled by us. Any disruptions or issues on third-party infrastructure that may affect our service are outside of our control and responsibility. 373This includes issues due to errors in the ENS root contract or misinterpretations of the .ART ENS and DNS names or any other flaws or issues that may occur within the Etherum blockchain and/or other blockchain networks. 374You acknowledge that while we make reasonable efforts to ensure the security and reliability of the ENS minting process, we cannot provide an absolute guarantee against potential hacking or cyber-attacks that may compromise the system. 375We reserve the right to make changes to the services offered at any time giving notice on our website or via an e-mail to you in the case you have an account with us. 376</p><p>2. Representations 377By using our services, you represent and warrant that 378* you are at least 18 years old; 379* all information you provide is true and accurate; 380* and that you will not use our services or make available via our services any content or services in violation of applicable laws or regulations; 381* you will not use our services services or make available via our services any content or services infringing upon third-partiesâ rights; 382* you will only use our services for the purpose of using and managing your DNS and ENS names. 383</p><p>3. Termination 384We reserve the right to suspend, cancel, transfer or modify your ENS name registration if: (a) you materially breach this Registration Agreement (including the Dispute Policy) and do not cure such breach within ten (10) days of notice by us; (b) you use the domain to send unsolicited email, in violation of this Registration Agreement or applicable laws; (c) you use your ENS name in connection with unlawful activity; or (d) you otherwise violate this Registration Agreement as determined by us in our sole discretion. 385</p><p>4. Term / Fees / Refund Policy 386The fee for the .ART ENS name without a DNS name includes the .ART DNS name fee for the initial registration as well as annual renewals. Unless otherwise stated the Registrant is fully responsible for any transaction or gas fee that may apply. 387Once the ENS name has been minted and is under your control, no refund will be granted. All fees for .ART ENS names paid prior to minting are refundable and will be processes with the same payment method of your payment at the then-current spot rates for the USD value of your purchase at the point in t
387ime when the refund is executed. 388</p><p>5. Transfer of .ART ENS name without you holding a DNS name 389If you transfer your ENS name to another registrant, it is your obligation to ensure that the terms of both the DNS name as well as the ENS name are made available to and accepted by the new owner. 390</p><p>6. Transfer or Expiry of the .ART DNS name if you hold the .ART ENS name 391If you hold both the ENS and the corresponding identical DNS name and let the DNS name expire or transfer it to another holder, you will lose control over the ENS name, which will no longer point to your wallet or other destination. I.e., the ENS name will be set to âzeroâ and no longer point to the previous ownerâs wallet.You herewith agree to cede the rights in the ENS name to the new DNS name holder. 392</p><p>7. Infringements 393Section 9. of this Registrar Registrant Agreement for Domain Names and Section 4 of Appendix CY (dotART Specific Conditions) apply to your ENS name registration. Both the registration and use of the ENS name as well as of the corresponding identical DNS name may be subject to a UDRP, PDDRP or URS proceedings. Registrations of ENS or DNS names as well as content or services made available thereunder will be imputed on the corresponding identical ENS or DNS name so that infringements via a ENS name will attributed to the DNS name and vice versa. Notice of such proceedings will be given via a message to your wallet or the contact data you provided to us when creating an account. 394</p><p>8. Indemnification 395Section 13. of this Registrar Registrant Agreement for Domain Names applies to the registration of the corresponding identical DNS name held by UKCI Holdings Ltd.</p>`,n=Y(),i=J("div"),he(s.$$.fragment),W(i,"align","center")},m(a,c){ee(a,e,c),L(e,r),L(e,n),L(e,i),fe(s,i,null),o=!0},p(a,c){const l={};c&1&&(l.on_click=a[1]),c&8&&(l.$$scope={dirty:c,ctx:a}),s.$set(l)},i(a){o||(te(s.$$.fragment,a),o=!0)},o(a){ne(s.$$.fragment,a),o=!1},d(a){a&&Q(e),de(s)}}}function ibe(t){let e,r,n;function i(o){t[2](o)}let s={$$slots:{default:[nbe]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new KE({props:s}),Mr.push(()=>Vr(e,"open",i)),{c(){he(e.$$.fragment)},m(o,a){fe(e,o,a),n=!0},p(o,[a]){const c={};a&9&&(c.$$scope={dirty:a,ctx:o}),!r&&a&1&&(r=!0,c.open=o[0],Gr(()=>r=!1)),e.$set(c)},i(o){n||(te(e.$$.fragment,o),n=!0)},o(o){ne(e.$$.fragment,o),n=!1},d(o){de(e,o)}}}function sbe(t,e,r){let{open:n}=e;const i=()=>r(0,n=!1);function s(o){n=o,r(0,n)}return t.$$set=o=>{"open"in o&&r(0,n=o.open)},[n,i,s]}class obe extends Rt{constructor(e){super(),xt(this,e,sbe,ibe,Ct,{open:0})}}function abe(t){let e,r,n,i,s,o,a,c,l,u,f;function d(R,D){if(R[2])return ube;if(R[0])return lbe}let h=d(t),g=h&&h(t);i=new un({props:{on_click:t[12],comment:"Confirm in wallet",$$slots:{default:[fbe]},$$scope:{ctx:t}}});function b(R){t[19](R)}let w={$$slots:{default:[hbe]},$$scope:{ctx:t}};t[1]!==void 0&&(w.open=t[1]),o=new KE({props:w}),Mr.push(()=>Vr(o,"open",b));function x(R){t[20](R)}let k={};return t[8]!==void 0&&(k.open=t[8]),l=new obe({props:k}),Mr.push(()=>Vr(l,"open",x)),{c(){e=J("div"),r=J("div"),g&&g.c(),n=Y(),he(i.$$.fragment),s=Y(),he(o.$$.fragment),c=Y(),he(l.$$.fragment),W(r,"align","center"),W(e,"class","block main svelte-mz4v0g")},m(R,D){ee(R,e,D),L(e,r),g&&g.m(r,null),L(r,n),fe(i,r,null),ee(R,s,D),fe(o,R,D),ee(R,c,D),fe(l,R,D),f=!0},p(R,D){h===(h=d(R))&&g?g.p(R,D):(g&&g.d(1),g=h&&h(R),g&&(g.c(),g.m(r,
395n)));const O={};D&2&&(O.on_click=R[12]),D&2097152&&(O.$$scope={dirty:D,ctx:R}),i.$set(O);const M={};D&2097656&&(M.$$scope={dirty:D,ctx:R}),!a&&D&2&&(a=!0,M.open=R[1],Gr(()=>a=!1)),o.$set(M);const F={};!u&&D&256&&(u=!0,F.open=R[8],Gr(()=>u=!1)),l.$set(F)},i(R){f||(te(i.$$.fragment,R),te(o.$$.fragment,R),te(l.$$.fragment,R),f=!0)},o(R){ne(i.$$.fragment,R),ne(o.$$.fragment,R),ne(l.$$.fragment,R),f=!1},d(R){R&&Q(e),g&&g.d(),de(i),R&&Q(s),de(o,R),R&&Q(c),de(l,R)}}}function cbe(t){let e;const r=t[11].default,n=Ya(r,t,t[21],null);return{c(){n&&n.c()},m(i,s){n&&n.m(i,s),e=!0},p(i,s){n&&n.p&&(!e||s&2097152)&&ec(n,r,i,i[21],e?Qa(r,i[21],s,null):tc(i[21]),null)},i(i){e||(te(n,i),e=!0)},o(i){ne(n,i),e=!1},d(i){n&&n.d(i)}}}function lbe(t){let e,r,n,i,s;return{c(){e=J("span"),r=pe("Login using "),n=pe(t[0]),i=J("br"),s=J("br")},m(o,a){ee(o,e,a),L(e,r),L(e,n),ee(o,i,a),ee(o,s,a)},p(o,a){a&1&<(n,o[0])},d(o){o&&Q(e),o&&Q(i),o&&Q(s)}}}function ube(t){let e,r,n,i,s;return{c(){e=J("span"),r=pe("Switch account to "),n=pe(t[0]),i=J("br"),s=J("br")}
395,m(o,a){ee(o,e,a),L(e,r),L(e,n),ee(o,i,a),ee(o,s,a)},p(o,a){a&1&<(n,o[0])},d(o){o&&Q(e),o&&Q(i),o&&Q(s)}}}function fbe(t){let e;return{c(){e=pe("Sign Message")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function dbe(t){let e;return{c(){e=pe("Confirm")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function hbe(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M,F,H,U,G,N,A,v,p,m,y,T,I,_,E,C,S;return _=new un({props:{disabled:!(t[3]&&t[4]&&t[5]&&t[6]&&t[7]),on_click:t[9],comment:"Confirm in wallet",$$slots:{default:[dbe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("h2"),r.textContent="Submit your details",n=Y(),i=J("div"),s=J("b"),s.textContent="Full Name",o=Y(),a=J("input"),c=Y(),l=J("div"),u=J("b"),u.textContent="Email",f=Y(),d=J("input"),h=Y(),g=J("div"),b=J("b"),b.textContent="Phone",w=Y(),x=J("input"),k=Y(),R=J("div"),D=J("b"),D.textContent="Address",O=Y(),M=J("input"),F=Y(),H=J("br"),U=Y(),G=J("div"),N=J("input"),A=J("span"),v=pe("Agreed with "),p=J("a"),p.textContent="terms of service",m=Y(),y=J("br"),T=Y(),I=J("div"),he(_.$$.fragment),W(a,"type","text"),W(i,"class","field svelte-mz4v0g"),W(d,"type","text"),W(l,"class","field svelte-mz4v0g"),W(x,"type","text"),W(g,"class","field svelte-mz4v0g"),W(M,"type","text"),W(R,"class","field svelte-mz4v0g"),W(N,"type","checkbox"),On(N,"height","1.5em"),On(N,"width","1.5em"),W(G,"class","terms svelte-mz4v0g"),W(I,"align","center"),W(e,"align","left")},m(B,$){ee(B,e,$),L(e,r),L(e,n),L(e,i),L(i,s),L(i,o),L(i,a),Ir(a,t[3]),L(e,c),L(e,l),L(l,u),L(l,f),L(l,d),Ir(d,t[4]),L(e,h),L(e,g),L(g,b),L(g,w),L(g,x),Ir(x,t[5]),L(e,k),L(e,R),L(R,D),L(R,O),L(R,M),Ir(M,t[6]),L(e,F),L(e,H),L(e,U),L(e,G),L(G,N),N.checked=t[7],L(G,A),L(A,v),L(A,p),L(e,m),L(e,y),L(e,T),L(e,I),fe(_,I,null),E=!0,C||(S=[Tr(a,"input",t[13]),Tr(d,"input",t[14]),Tr(x,"input",t[15]),Tr(M,"input",t[16]),Tr(N,"change",t[17]),Tr(p,"click",t[18])],C=!0)},p(B,$){$&8&&a.value!==B[3]&&Ir(a,B[3]),$&16&&d.value!==B[4]&&Ir(d,B[4]),$&32&&x.value!==B[5]&&Ir(x,B[5]),$&64&&M.value!==B[6]&&Ir(M,B[6]),$&128&&(N.checked=B[7]);const P={};$&248&&(P.disabled=!(B[3]&&B[4]&&B[5]&&B[6]&&B[7])),$&2097152&&(P.$$scope={dirty:$,ctx:B}),_.$set(P)},i(B){E||(te(_.$$.fragment,B),E=!0)},o(B){ne(_.$$.fragment,B),E=!1},d(B){B&&Q(e),de(_),C=!1,co(S)}}}function pbe(t){let e,r,n,i;const s=[cbe,abe],o=[];function a(c,l){return c[2]&&c[2]==c[0]?0:1}return r=a(t),n=o[r]=s[r](t),{c(){e=J("div"),n.c()},m(c,l){ee(c,e,l),o[r].m(e,null),i=!0},p(c,[l]){let u=r;r=a(c),r===u?o[r].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),n=o[r],n?n.p(c,l):(n=o[r]=s[r](c),n.c()),te(n,1),n.m(e,null))},i(c){i||(te(n),i=!0)},o(c){ne(n),i=!1},d(c){c&&Q(e),o[r].d()}}}function gbe(t,e,r){let{$$slots:n={},$$scope:i}=e,{domain:s}=e,o,a,c;async function l(){let N=await(await fetch(zi("web3/domain",{domain:s}),{credentials:"include"})).json();r(0,o=N.Need),r(2,c=N.Current),console.log(N)}l();let u,f,d,h,g,b=!1;async function w(){let G=`Signed message for Protocol.art I agree to the terms of use and understand the responsibility. I provide personal information. Full Name : ${u} Email : ${f} Phone : ${d} Address : ${h}`,N=await ime({message:G});await fetch(zi("web3/auth",{signature:N.substr(2),message:G}),{credentials:"include"}),l(),r(1,a=!1)}const x=()=>{r(1,a=!0)};function k(){u=this.value,r(3,u)}function R(){f=this.value,r(4,f)}function D(){d=this.value,r(5,d)}function O(){h=this.value,r(6,h)}function M(){g=this.checked,r(7,g)}const F=()=>r(8,b=!0);function H(G){a=G,r(1,a)}function U(G){b=G,r(8,b)}return t.$$set=G=>{"domain"in G&&r(10,s=G.domain),"$$scope"in G&&r(21,i=G.$$scope)},[o,a,c,u,f,d,h,g,b,w,s,n,x,k,R,D,O,M,F,H,U,i]}class mbe extends Rt{constructor(e){super(),xt(this,e,gbe,pbe,Ct,{domain:10})}}function I9(t,e,r){const n=t.slice();return n[3]=e[r],n}function x9(t){let e,r=t[3]+"",n,i,s;function o(){return t[2](t[3])}return{c(){e=J("div"),n=pe(r),W(e,"class","item svelte-q2w472"),an(e,"active",t[0]==t[3])},m(a,c){ee(a,e,c),L(e,n),i||(s=Tr(e,"click",o),i=!0)},p(a,c){t=a,c&2&&r!==(r=t[3]+"")&<(n,r),c&3&&an(e,"active",t[0]==t[3])},d(a){a&&Q(e),i=!1,s()}}}function bbe(t){let e,r=t[1],n=[];for(let i=0;i<r.length;i+=1)n[i]=x9(I9(t,r,i));return{c(){e=J("div");for(let i=0;i<n.length;i+=1)n[i].c();W(e,"class","selector noselect svelte-q2w472")},m(i,s){ee(i,e,s);for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(e,null)},p(i,[s]){if(s&3){r=i[1];let o;for(o=0;o<r.length;o+=1){const a=I9(i,r,o);n[o]?n[o].p(a,s):(n[o]=x9(a),n[o].c(),n[o].m(e,null))}for(;o<n.length;o+=1)n[o].d(1);n.length=r.length}},i:$e,o:$e,d(i){i&&Q(e),hu(n,i)}}}function ybe(t,e,r){let{items:n=[]}=e,{value:i}=e;const s=o=>{r(0,i=o)};return t.$$set=o=>{"items"in o&&r(1,n=o.items),"value"in o&&r(0,i=o.value)},[i,n,s]}class vbe extends Rt{constructor(e){super(),xt(this,e,ybe,bbe,Ct,{items:1,value:0})}}function R9(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g;return d=new un({props:{disabled:t[1]<=0||t[0]<=1,small:!0,on_click:t[5],$$slots:{default:[wbe]},$$scope:{ctx:t}}}),h=new un({props:{disabled:t[0]>=t[3],small:!0,on_click:t[6],$$slots:{default:[Ebe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("b"),n=pe("Total "),i=pe(t[2]),s=pe(" Â Â Page "),o=pe(t[0]),a=pe(" of "),c=pe(t[3]),l=Y(),u=J("div"),f=Y(),he(d.$$.fragment),he(h.$$.fragment),W(u,"class","spacer"),W(e,"class","pages svelte-1heqduw")},m(b,w){ee(b,e,w),L(e,r),L(r,n),L(r,i),L(r,s),L(r,o),L(r,a),L(r,c),L(e,l),L(e,u),L(e,f),fe(d,e,null),fe(h,e,null),g=!0},p(b,w){(!g||w&4)&<(i,b[2]),(!g||w&1)&<(o,b[0]),(!g||w&8)&<(c,b[3]);const x={};w&3&&(x.disabled=b[1]<=0||b[0]<=1),w&19&&(x.on_click=b[5]),w&128&&(x.$$scope={dirty:w,ctx:b}),d.$set(x);const k={};w&9&&(k.disabled=b[0]>=b[3]),w&19&&(k.on_click=b[6]),w&128&&(k.$$scope={dirty:w,ctx:b}),h.$set(k)},i(b){g||(te(d.$$.fragment,b),te(h.$$.fragment,b),g=!0)},o(b){ne(d.$$.fragment,b),ne(h.$$.fragment,b),g=!1},d(b){b&&Q(e),de(d),de(h)}}}function wbe(t){let e;return{c(){e=pe("Prev")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Ebe(t){let e;return{c(){e=pe("Next")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Abe(t){let e,r,n=t[2]>0&&R9(t);return{c(){n&&n.c(),e=ti()},m(i,s){n&&n.m(i,s),ee(i,e,s),r=!0},p(i,[s]){i[2]>0?n?(n.p(i,s),s&4&&te(n,1)):(n=R9(i),n.c(),te(n,1),n.m(e.parentNode,e)):n&&(_r(),ne(n,1,1,()=>{n=null}),Cr())},i(i){r||(te(n),r=!0)},o(i){ne(n),r=!1},d(i){n&&n.d(i),i&&Q(e)}}}
395function _be(t,e,r){let{count:n=0}=e,{page:i=0}=e,{pages:s=0}=e,{limit:o=10}=e,{offset:a=0}=e;const c=()=>{r(1,a-=o),r(0,i-=1)},l=()=>{r(1,a+=o),r(0,i+=1)};return t.$$set=u=>{"count"in u&&r(2,n=u.count),"page"in u&&r(0,i=u.page),"pages"in u&&r(3,s=u.pages),"limit"in u&&r(4,o=u.limit),"offset"in u&&r(1,a=u.offset)},[i,a,n,s,o,c,l]}class sM extends Rt{constructor(e){super(),xt(this,e,_be,Abe,Ct,{count:2,page:0,pages:3,limit:4,offset:1})}}function P9(t){let e,r,n,i,s,o;return{c(){e=J("div"),r=J("b"),r.textContent="Priority",n=Y(),i=J("input"),W(i,"type","text"),W(e,"class","param svelte-114rrid")},m(a,c){ee(a,e,c),L(e,r),L(e,n),L(e,i),Ir(i,t[6]),s||(o=Tr(i,"input",t[17]),s=!0)},p(a,c){c&64&&i.value!==a[6]&&Ir(i,a[6])},d(a){a&&Q(e),s=!1,o()}}}function k9(t){let e,r,n,i,s,o,a,c,l,u,f;return{c(){e=J("div"),r=J("b"),r.textContent="Port",n=Y(),i=J("input"),s=Y(),o=J("div"),a=J("b"),a.textContent="Weight",c=Y(),l=J("input"),W(i,"type","text"),W(e,"class","param svelte-114rrid"),W(l,"type","text"),W(o,"class","param svelte-114rrid")},m(d,h){ee(d,e,h),L(e,r),L(e,n),L(e,i),Ir(i,t[7]),ee(d,s,h),ee(d,o,h),L(o,a),L(o,c),L(o,l),Ir(l,t[8]),u||(f=[Tr(i,"input",t[18]),Tr(l,"input",t[19])],u=!0)},p(d,h){h&128&&i.value!==d[7]&&Ir(i,d[7]),h&256&&l.value!==d[8]&&Ir(l,d[8])},d(d){d&&Q(e),d&&Q(s),d&&Q(o),u=!1,co(f)}}}function Cbe(t){let e,r;return e=new un({props:{on_click:t[11],$$slots:{default:[Tbe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&8388608&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Sbe(t){let e,r,n,i;return e=new un({props:{outline:!0,on_click:t[12],$$slots:{default:[Nbe]},$$scope:{ctx:t}}}),n=new un({props:{on_click:t[13],$$slots:{default:[Ibe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment),r=Y(),he(n.$$.fragment)},m(s,o){fe(e,s,o),ee(s,r,o),fe(n,s,o),i=!0},p(s,o){const a={};o&8388608&&(a.$$scope={dirty:o,ctx:s}),e.$set(a);const c={};o&8388608&&(c.$$scope={dirty:o,ctx:s}),n.$set(c)},i(s){i||(te(e.$$.fragment,s),te(n.$$.fragment,s),i=!0)},o(s){ne(e.$$.fragment,s),ne(n.$$.fragment,s),i=!1},d(s){de(e,s),s&&Q(r),de(n,s)}}}function Tbe(t){let e;return{c(){e=pe("Save")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Nbe(t){let e;return{c(){e=pe("Delete")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Ibe(t){let e;return{c(){e=pe("Save")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function xbe(t){let e,r,n=t[3]?"Edit":"Add",i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M,F,H,U,G,N,A,v,p,m,y,T,I,_,E,C,S,B,$,P,q,V=(t[2]=="SRV"||t[2]=="MX")&&P9(t),X=t[2]=="SRV"&&k9(t);const Z=[Sbe,Cbe],ie=[];function ce(se,_e){return se[3]?0:1}return E=ce(t),C=ie[E]=Z[E](t),{c(){e=J("div"),r=J("h2"),i=pe(n),s=Y(),o=pe(t[2]),a=pe(" record for "),c=pe(t[1]),l=Y(),u=J("div"),f=J("b"),f.textContent="Host",d=Y(),h=J("input"),g=Y(),b=J("div"),w=J("b"),w.textContent="Value",x=Y(),k=J("input"),R=Y(),D=J("div"),O=J("b"),O.textContent="TTL",M=Y(),F=J("input"),H=Y(),V&&V.c(),U=Y(),X&&X.c(),G=Y(),N=J("br"),A=Y(),v=J("div"),p=J("span"),m=pe(t[10]),y=Y(),T=J("div"),I=J("div"),_=Y(),C.c(),S=Y(),B=J("div"),W(h,"type","text"),W(u,"class","param svelte-114rrid"),W(k,"type","text"),W(b,"class","param svelte-114rrid"),W(F,"type","text"),W(D,"class","param svelte-114rrid"),On(p,"color","red"),W(v,"align","center"),W(I,"class","spacer"),W(B,"class","spacer"),W(T,"class","flex svelte-114rrid")},m(se,_e){ee(se,e,_e),L(e,r),L(r,i),L(r,s),L(r,o),L(r,a),L(r,c),L(e,l),L(e,u),L(u,f),L(u,d),L(u,h),Ir(h,t[4]),L(e,g),L(e,b),L(b,w),L(b,x),L(b,k),Ir(k,t[5]),L(e,R),L(e,D),L(D,O),L(D,M),L(D,F),Ir(F,t[9]),L(e,H),V&&V.m(e,null),L(e,U),X&&X.m(e,null),L(e,G),L(e,N),L(e,A),L(e,v),L(v,p),L(p,m),L(e,y),L(e,T),L(T,I),L(T,_),ie[E].m(T,null),L(T,S),L(T,B),$=!0,P||(q=[Tr(h,"input",t[14]),Tr(k,"input",t[15]),Tr(F,"input",t[16])],P=!0)},p(se,_e){(!$||_e&8)&&n!==(n=se[3]?"Edit":"Add")&<(i,n),(!$||_e&4)&<(o,se[2]),(!$||_e&2)&<(c,se[1]),_e&16&&h.value!==se[4]&&Ir(h,se[4]),_e&32&&k.value!==se[5]&&Ir(k,se[5]),_e&512&&F.value!==se[9]&&Ir(F,se[9]),se[2]=="SRV"||se[2]=="MX"?V?V.p(se,_e):(V=P9(se),V.c(),V.m(e,U)):V&&(V.d(1),V=null),se[2]=="SRV"?X?X.p(se,_e):(X=k9(se),X.c(),X.m(e,G)):X&&(X.d(1),X=null),(!$||_e&1024)&<(m,se[10]);let ye=E;E=ce(se),E===ye?ie[E].p(se,_e):(_r(),ne(ie[ye],1,1,()=>{ie[ye]=null}),Cr(),C=ie[E],C?C.p(se,_e):(C=ie[E]=Z[E](se),C.c()),te(C,1),C.m(T,S))},i(se){$||(te(C),$=!0)},o(se){ne(C),$=!1},d(se){se&&Q(e),V&&V.d(),X&&X.d(),ie[E].d(),P=!1,co(q)}}}function Rbe(t){let e,r,n;function i(o){t[20](o)}let s={$$slots:{default:[xbe]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new KE({props:s}),Mr.push(()=>Vr(e,"open",i)),{c(){he(e.$$.fragment)},m(o,a){fe(e,o,a),n=!0},p(o,[a]){const c={};
395a&8390654&&(c.$$scope={dirty:a,ctx:o}),!r&&a&1&&(r=!0,c.open=o[0],Gr(()=>r=!1)),e.$set(c)},i(o){n||(te(e.$$.fragment,o),n=!0)},o(o){ne(e.$$.fragment,o),n=!1},d(o){de(e,o)}}}function Pbe(t,e,r){let{open:n=!1}=e,{domain:i,recordType:s}=e,{item:o}=e,a,c,l,u,f,d=14400,h="";sy(()=>{});function g(G){G&&(r(4,a=G.host),r(5,c=G.value),r(9,d=G.timetolive||14400),r(6,l=G.priority),r(7,u=G.port),r(8,f=G.weight))}function b(G){G.status=="Failed"?r(10,h=G.msg):r(0,n=!1)}async function w(){let N=await(await fetch(zi("dns/set",{type:s,domain:i,host:a,value:c,ttl:d,priority:l,port:u,weight:f}),{credentials:"include"})).json();b(N),console.log(N)}async function x(){let N=await(await fetch(zi("dns/delete",{type:o.type,domain:i,host:o.host,value:o.value,ttl:o.timetolive,priority:o.priority,port:o.port,weight:o.weight}),{credentials:"include"})).json();b(N),console.log(N)}async function k(){let N=await(await fetch(zi("dns/update",{type:s,domain:i,host:a,"new-value":c,"current-value":o.value,ttl:d,priority:l,port:u,weight:f}),{credentials:"include"})).json();b(N),console.log(N)}function R(){a=this.value,r(4,a)}function D(){c=this.value,r(5,c)}function O(){d=this.value,r(9,d)}function M(){l=this.value,r(6,l)}function F(){u=this.value,r(7,u)}function H(){f=this.value,r(8,f)}function U(G){n=G,r(0,n)}return t.$$set=G=>{"open"in G&&r(0,n=G.open),"domain"in G&&r(1,i=G.domain),"recordType"in G&&r(2,s=G.recordType),"item"in G&&r(3,o=G.item)},t.$$.update=()=>{t.$$.dirty&8&&g(o),t.$$.dirty&1&&n&&r(10,h="")},[n,i,s,o,a,c,l,u,f,d,h,w,x,k,R,D,O,M,F,H,U]}class O9 extends Rt{constructor(e){super(),xt(this,e,Pbe,Rbe,Ct,{open:0,domain:1,recordType:2,item:3})}}function M9(t,e,r){const n=t.slice();return n[19]=e[r],n}function kbe(t){let e,r,n,i,s,o;return s=new un({props:{on_click:t[14],$$slots:{default:[Mbe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),n=J("span"),n.textContent="No records found",i=pe("Â Â "),he(s.$$.fragment),W(e,"class","filler svelte-9w3m8c")},m(a,c){ee(a,e,c),L(e,r),L(r,n),L(r,i),fe(s,r,null),o=!0},p(a,c){const l={};c&2&&(l.on_click=a[14]),c&4194312&&(l.$$scope={dirty:c,ctx:a}),s.$set(l)},i(a){o||(te(s.$$.fragment,a),o=!0)},o(a){ne(s.$$.fragment,a),o=!1},d(a){a&&Q(e),de(s)}}}function Obe(t){let e,r,n,i,s,o,a=t[7],c=[];for(let l=0;l<a.length;l+=1)c[l]=D9(M9(t,a,l));return s=new un({props:{expand:!0,on_click:t[13],$$slots:{default:[Dbe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),r.innerHTML=`<b>Host</b> 396 <b>Value</b> 397 <b>TTL</b>`,n=Y();for(let l=0;l<c.length;l+=1)c[l].c();i=Y(),he(s.$$.fragment),W(r,"class","item item-inactive svelte-9w3m8c"),W(e,"class","items svelte-9w3m8c")},m(l,u){ee(l,e,u),L(e,r),L(e,n);for(let f=0;f<c.length;f+=1)c[f]&&c[f].m(e,null);L(e,i),fe(s,e,null),o=!0},p(l,u){if(u&196){a=l[7];let d;for(d=0;d<a.length;d+=1){const h=M9(l,a,d);c[d]?c[d].p(h,u):(c[d]=D9(h),c[d].c(),c[d].m(e,i))}for(;d<c.length;d+=1)c[d].d(1);c.length=a.length}const f={};u&2&&(f.on_click=l[13]),u&4194312&&(f.$$scope={dirty:u,ctx:l}),s.$set(f)},i(l){o||(te(s.$$.fragment,l),o=!0)},o(l){ne(s.$$.fragment,l),o=!1},d(l){l&&Q(e),hu(c,l),de(s)}}}function Mbe(t){let e,r,n;return{c(){e=pe("Add new "),r=pe(t[3]),n=pe(" record")},m(i,s){ee(i,e,s),ee(i,r,s),ee(i,n,s)},p(i,s){s&8&<(r,i[3])},d(i){i&&Q(e),i&&Q(r),i&&Q(n)}}}function D9(t){let e,r,n,i,s,o,a,c,l,u,f;function d(){return t[12](t[19])}return{c(){e=J("div"),r=J("input"),i=Y(),s=J("input"),a=Y(),c=J("input"),W(r,"type","text"),r.disabled=!0,r.value=n=t[19].host,W(r,"class","svelte-9w3m8c"),W(s,"type","text"),s.disabled=!0,s.value=o=t[19].value,W(s,"class","svelte-9w3m8c"),W(c,"type","text"),c.disabled=!0,c.value=l=t[19].timetolive,W(c,"class","svelte-9w3m8c"),W(e,"class","item svelte-9w3m8c")},m(h,g){ee(h,e,g),L(e,r),L(e,i),L(e,s),L(e,a),L(e,c),u||(f=Tr(e,"click",d),u=!0)},p(h,g){t=h,g&128&&n!==(n=t[19].host)&&r.value!==n&&(r.value=n),g&128&&o!==(o=t[19].value)&&s.value!==o&&(s.value=o),g&128&&l!==(l=t[19].timetolive)&&c.value!==l&&(c.value=l)},d(h){h&&Q(e),u=!1,f()}}}function Dbe(t){let e,r,n;return{c(){e=pe("Add new "),r=pe(t[3]),n=pe(" record")},m(i,s){ee(i,e,s),ee(i,r,s),ee(i,n,s)},p(i,s){s&8&<(r,i[3])},d(i){i&&Q(e),i&&Q(r),i&&Q(n)}}}function Bbe(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D;function O(y){t[11](y)}let M={items:t[10]};t[3]!==void 0&&(M.value=t[3]),i=new vbe({props:M}),Mr.push(()=>Vr(i,"value",O));const F=[Obe,kbe],H=[];function U(y,T){return y[7].length>0?0:1}l=U(t),u=H[l]=F[l](t);function G(y){t[15](y)}let N={count:t[4],pages:t[8]};t[5]!==void 0&&(N.page=t[5]),d=new sM({props:N}),Mr.push(()=>Vr(d,"page",G));function A(y){t[16](y)}let v={item:t[6],recordType:t[3],domain:t[0]};t[2]!==void 0&&(v.open=t[2]),b=new O9({props:v}),Mr.push(()=>Vr(b,"open",A));function p(y){t[17](y)}let m={recordType:t[3],domain:t[0]};return t[1]!==void 0&&(m.open=t[1]),k=new O9({props:m}),Mr.push(()=>Vr(k,"open",p)),{c(){e=J("div"),r=J("h2"),r.textContent="Records type",n=Y(),he(i.$$.fragment),o=Y(),a=J("br"),c=Y(),u.c(),f=Y(),he(d.$$.fragment),g=Y(),he(b.$$.fragment),x=Y(),he(k.$$.fragment),W(e,"class","block main svelte-9w3m8c"),W(e,"align","left")}
397,m(y,T){ee(y,e,T),L(e,r),L(e,n),fe(i,e,null),L(e,o),L(e,a),L(e,c),H[l].m(e,null),L(e,f),fe(d,e,null),L(e,g),fe(b,e,null),L(e,x),fe(k,e,null),D=!0},p(y,T){const I={};!s&&T&8&&(s=!0,I.value=y[3],Gr(()=>s=!1)),i.$set(I);let _=l;l=U(y),l===_?H[l].p(y,T):(_r(),ne(H[_],1,1,()=>{H[_]=null}),Cr(),u=H[l],u?u.p(y,T):(u=H[l]=F[l](y),u.c()),te(u,1),u.m(e,f));const E={};T&16&&(E.count=y[4]),T&256&&(E.pages=y[8]),!h&&T&32&&(h=!0,E.page=y[5],Gr(()=>h=!1)),d.$set(E);const C={};T&64&&(C.item=y[6]),T&8&&(C.recordType=y[3]),T&1&&(C.domain=y[0]),!w&&T&4&&(w=!0,C.open=y[2],Gr(()=>w=!1)),b.$set(C);const S={};T&8&&(S.recordType=y[3]),T&1&&(S.domain=y[0]),!R&&T&2&&(R=!0,S.open=y[1],Gr(()=>R=!1)),k.$set(S)},i(y){D||(te(i.$$.fragment,y),te(u),te(d.$$.fragment,y),te(b.$$.fragment,y),te(k.$$.fragment,y),D=!0)},o(y){ne(i.$$.fragment,y),ne(u),ne(d.$$.fragment,y),ne(b.$$.fragment,y),ne(k.$$.fragment,y),D=!1},d(y){y&&Q(e),de(i),H[l].d(),de(d),de(b),de(k)}}}function Fbe(t){let e,r;return e=new WE({props:{loading:t[9],$$slots:{default:[Bbe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&512&&(s.loading=n[9]),i&4194815&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function $be(t){let e,r,n,i,s,o,a,c,l;return c=new mbe({props:{domain:t[0],$$slots:{default:[Fbe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),n=pe("Manage "),i=pe(t[0]),s=Y(),o=J("br"),a=Y(),he(c.$$.fragment),W(r,"class","t1")},m(u,f){ee(u,e,f),L(e,r),L(r,n),L(r,i),L(e,s),L(e,o),L(e,a),fe(c,e,null),l=!0},p(u,[f]){(!l||f&1)&<(i,u[0]);const d={};f&1&&(d.domain=u[0]),f&4195327&&(d.$$scope={dirty:f,ctx:u}),c.$set(d)},i(u){l||(te(c.$$.fragment,u),l=!0)},o(u){ne(c.$$.fragment,u),l=!1},d(u){u&&Q(e),de(c)}}}function Lbe(t,e,r){let{name:n}=e,i=!1,s=!1,o,a=["A","MX","CNAME","TXT","NS","SRV","AAAA"],c=a[0],l=[],u=0,f=0,d=1,h=!1;async function g(){r(9,h=!0);try{let F=await(await fetch(zi("dns/search",{type:c,domain:n,page:d}),{credentials:"include"})).json();r(7,l=[]),r(4,u=F.recsindb);for(let H=1;H<=F.recsonpage;H++)l.push(F[H]);r(7,l=[...l]),console.log(l),console.log(F)}catch(M){console.log(M)}r(9,h=!1)}function b(M){c=M,r(3,c)}const w=M=>{r(6,o=M),r(2,s=!0)},x=()=>r(1,i=!0),k=()=>r(1,i=!0);function R(M){d=M,r(5,d),r(3,c)}function D(M){s=M,r(2,s)}function O(M){i=M,r(1,i)}return t.$$set=M=>{"name"in M&&r(0,n=M.name)},t.$$.update=()=>{t.$$.dirty&16&&r(8,f=Math.ceil(u/10)),t.$$.dirty&8&&c&&r(5,d=1),t.$$.dirty&40&&g(),t.$$.dirty&2&&(i||g()),t.$$.dirty&4&&(s||g())},[n,i,s,c,u,d,o,l,f,h,a,b,w,x,k,R,D,O]}class Ube extends Rt{constructor(e){super(),xt(this,e,Lbe,$be,Ct,{name:0})}}function Hbe(t){let e;return{c(){e=J("div"),W(e,"class","block empty")},m(r,n){ee(r,e,n)},p:$e,i:$e,o:$e,d(r){r&&Q(e)}}}function jbe(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g=Ta(t[4].Owner)+"",b,w,x,k,R=Ta(t[5]||"")+"",D,O,M,F,H=t[0]&&t[0].account.toLowerCase()==t[4].Owner.toLowerCase(),U,G,N,A,v,p,m;o=new un({props:{on_click:t[7],$$slots:{default:[zbe]},$$scope:{ctx:t}}});let y=t[4].Expires&&B9(t),T=H&&F9(t),I=t[4].DNSOwned&&$9(t);return{c(){e=J("div"),r=J("div"),n=J("div"),i=pe(t[1]),s=Y(),he(o.$$.fragment),a=Y(),c=J("br"),l=Y(),u=J("div"),y&&y.c(),f=Y(),d=J("div"),d.textContent="Owner",h=J("div"),b=pe(g),w=Y(),x=J("div"),x.textContent="Address",k=J("div"),D=pe(R),O=Y(),M=J("br"),F=Y(),T&&T.c(),U=Y(),G=J("div"),N=Y(),A=J("br"),v=Y(),I&&I.c(),p=ti(),W(n,"class","t1 spacer"),On(r,"display","flex"),W(d,"class","t2 svelte-1em2eyr"),W(h,"class","svelte-1em2eyr"),W(x,"class","t2 svelte-1em2eyr"),W(k,"class","svelte-1em2eyr"),W(u,"class","info svelte-1em2eyr"),W(G,"align","center"),W(e,"class","block main svelte-1em2eyr")},m(_,E){ee(_,e,E),L(e,r),L(r,n),L(n,i),L(r,s),fe(o,r,null),L(e,a),L(e,c),L(e,l),L(e,u),y&&y.m(u,null),L(u,f),L(u,d),L(u,h),L(h,b),L(u,w),L(u,x),L(u,k),L(k,D),L(e,O),L(e,M),L(e,F),T&&T.m(e,null),L(e,U),L(e,G),ee(_,N,E),ee(_,A,E),ee(_,v,E),I&&I.m(_,E),ee(_,p,E),m=!0},p(_,E){(!m||E&2)&<(i,_[1]);const C={};E&2&&(C.on_click=_[7]),E&2048&&(C.$$scope={dirty:E,ctx:_}),o.$set(C),_[4].Expires?y?y.p(_,E):(y=B9(_),y.c(),y.m(u,f)):y&&(y.d(1),y=null),(!m||E&16)&&g!==(g=Ta(_[4].Owner)+"")&<(b,g),(!m||E&32)&&R!==(R=Ta(_[5]||"")+"")&<(D,R),E&17&&(H=_[0]&&_[0].account.toLowerCase()==_[4].Owner.toLowerCase()),H?T?(T.p(_,E),E&17&&te(T,1)):(T=F9(_),T.c(),te(T,1),T.m(e,U)):T&&(_r(),ne(T,1,1,()=>{T=null}),Cr()),_[4].DNSOwned?I?(I.p(_,E),E&16&&te(I,1)):(I=$9(_),I.c(),te(I,1),I.m(p.parentNode,p)):I&&(_r(),ne(I,1,1,()=>{I=null}),Cr())},i(_){m||(te(o.$$.fragment,_),te(T),te(I),m=!0)},o(_){ne(o.$$.fragment,_),ne(T),ne(I),m=!1},d(_){_&&Q(e),de(o),y&&y.d(),T&&T.d(),_&&Q(N),_&&Q(A),_&&Q(v),I&&I.d(_),_&&Q(p)}}}function zbe(t){let e;return{c(){e=pe("Renew â")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function B9(t){let e,r,n=new Date(t[4].Expires).toDateString()+"",i;return{c(){e=J("div"),e.textContent="Expires",r=J("div"),i=pe(n),W(e,"class","t2 svelte-1em2eyr"),W(r,"class","svelte-1em2eyr")}
397,m(s,o){ee(s,e,o),ee(s,r,o),L(r,i)},p(s,o){o&16&&n!==(n=new Date(s[4].Expires).toDateString()+"")&<(i,n)},d(s){s&&Q(e),s&&Q(r)}}}function F9(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D;return a=new Ph({props:{client:t[0],method:"safeTransferFrom",address:g9,abi:m9,params:[t[4].Owner,t[2],t[4].TokenId],$$slots:{default:[Jbe]},$$scope:{ctx:t}}}),x=new Ph({props:{client:t[0],method:"reclaim",address:g9,abi:m9,params:[t[4].TokenId,t[3]],$$slots:{default:[qbe]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),r.innerHTML="<b>Transfer ownership</b>",n=Y(),i=J("div"),s=J("input"),o=Y(),he(a.$$.fragment),c=Y(),l=J("br"),u=Y(),f=J("div"),d=J("div"),d.innerHTML="<b>Set controller</b>",h=Y(),g=J("div"),b=J("input"),w=Y(),he(x.$$.fragment),W(r,"class","t2"),W(s,"class","spacer"),W(s,"type","text"),W(s,"name",""),W(i,"class","field svelte-1em2eyr"),W(d,"class","t2"),W(b,"class","spacer"),W(b,"type","text"),W(b,"name",""),W(g,"class","field svelte-1em2eyr")},m(O,M){ee(O,e,M),L(e,r),L(e,n),L(e,i),L(i,s),Ir(s,t[2]),L(i,o),fe(a,i,null),ee(O,c,M),ee(O,l,M),ee(O,u,M),ee(O,f,M),L(f,d),L(f,h),L(f,g),L(g,b),Ir(b,t[3]),L(g,w),fe(x,g,null),k=!0,R||(D=[Tr(s,"input",t[8]),Tr(b,"input",t[9])],R=!0)},p(O,M){M&4&&s.value!==O[2]&&Ir(s,O[2]);const F={};M&1&&(F.client=O[0]),M&20&&(F.params=[O[4].Owner,O[2],O[4].TokenId]),M&2048&&(F.$$scope={dirty:M,ctx:O}),a.$set(F),M&8&&b.value!==O[3]&&Ir(b,O[3]);const H={};M&1&&(H.client=O[0]),M&24&&(H.params=[O[4].TokenId,O[3]]),M&2048&&(H.$$scope={dirty:M,ctx:O}),x.$set(H)},i(O){k||(te(a.$$.fragment,O),te(x.$$.fragment,O),k=!0)},o(O){ne(a.$$.fragment,O),ne(x.$$.fragment,O),k=!1},d(O){O&&Q(e),de(a),O&&Q(c),O&&Q(l),O&&Q(u),O&&Q(f),de(x),R=!1,co(D)}}}function Jbe(t){let e;return{c(){e=pe("Transfer")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function qbe(t){let e;return{c(){e=pe("Set")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function $9(t){let e,r;return e=new Ube({props:{name:t[1]}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.name=n[1]),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Gbe(t){let e,r,n,i;const s=[jbe,Hbe],o=[];function a(c,l){return c[4]?0:1}return e=a(t),r=o[e]=s[e](t),{c(){r.c(),n=ti()},m(c,l){o[e].m(c,l),ee(c,n,l),i=!0},p(c,[l]){let u=e;e=a(c),e===u?o[e].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),r=o[e],r?r.p(c,l):(r=o[e]=s[e](c),r.c()),te(r,1),r.m(n.parentNode,n))},i(c){i||(te(r),i=!0)},o(c){ne(r),i=!1},d(c){o[e].d(c),c&&Q(n)}}}function Vbe(t,e,r){let{client:n,name:i}=e,s,o,a,c;function l(g){_1("/renew/"+g)}async function u(g){if(!z6(g))return;let b=n2(g),w=await fetch(zi("art-tokens",{exact:b,limit:1}));w=await w.json(),w.Items.length>0&&r(4,a=w.Items[0]),r(5,c=await ame({name:g,chainId:1}))}const f=()=>{l(i)};function d(){s=this.value,r(2,s)}function h(){o=this.value,r(3,o)}return t.$$set=g=>{"client"in g&&r(0,n=g.client),"name"in g&&r(1,i=g.name)},t.$$.update=()=>{t.$$.dirty&2&&u(i),t.$$.dirty&2&&z6(i)},[n,i,s,o,a,c,l,f,d,h]}class oM extends Rt{constructor(e){super(),xt(this,e,Vbe,Gbe,Ct,{client:0,name:1})}}function Wbe(t){let e;return{c(){e=pe("â¼")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Kbe(t){let e;return{c(){e=pe("â²")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Xbe(t){let e,r;function n(o,a){return o[0]?Kbe:Wbe}let i=n(t),s=i(t);return{c(){e=pe("Domain registrar "),s.c(),r=ti()},m(o,a){ee(o,e,a),s.m(o,a),ee(o,r,a)},p(o,a){i!==(i=n(o))&&(s.d(1),s=i(o),s&&(s.c(),s.m(r.parentNode,r)))},d(o){o&&Q(e),s.d(o),o&&Q(r)}}}function L9(t){let e;return{c(){e=J("div"),e.innerHTML=`<a target="_blank" href="https://docs.protocol.art/.art-all-about-ens-mint/how-to-mint-ens-from-dns/verify-on-get.art" class="svelte-rcnhkj">GET.ART</a> 398 <a target="_blank" href="https://docs.protocol.art/.art-all-about-ens-mint/how-to-mint-ens-from-dns/verify-on-namecheap.com" class="svelte-rcnhkj">NAMECHEAP.COM</a> 399 <a target="_blank" href="https://docs.protocol.art/.art-all-about-ens-mint/how-to-mint-ens-from-dns/verify-on-godaddy.com" class="svelte-rcnhkj">GODADDY.COM</a> 400 <a target="_blank" href="https://docs.protocol.art/.art-all-about-ens-mint/how-to-mint-ens-from-dns/verify-on-porkbun.com" class="svelte-rcnhkj">PORKBUN.COM</a> 401 <a target="_blank" href="https://docs.protocol.art/.art-all-about-ens-mint/how-to-mint-ens-from-dns/" class="svelte-rcnhkj">ANY</a>`,W(e,"class","dropdown-list svelte-rcnhkj")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Zbe(t){let e,r,n,i,s;n=new un({props:{on_click:t[1],$$slots:{default:[Xbe]},$$scope:{ctx:t}}});let o=t[0]&&L9();return{c(){e=J("div"),r=J("div"),he(n.$$.fragment),i=Y(),o&&o.c(),W(r,"class","dropdown svelte-rcnhkj"),W(e,"align","center")},m(a,c){ee(a,e,c),L(e,r),fe(n,r,null),L(r,i),o&&o.m(r,null),s=!0},p(a,[c]){const l={};c&1&&(l.on_click=a[1]),c&5&&(l.$$scope={dirty:c,ctx:a}),n.$set(l),a[0]?o||(o=L9(),o.c(),o.m(r,null)):o&&(o.d(1),o=null)},i(a){s||(te(n.$$.fragment,a),s=!0)},o(a){ne(n.$$.fragment,a),s=!1},d(a){a&&Q(e),de(n),o&&o.d()}}}function Ybe(t,e,r){let n=!1;return[n,()=>{r(0,n=!n)}]}class aM extends Rt{constructor(e){super(),xt(this,e,Ybe,Zbe,Ct,{})}}function U9(t){let e,r,n;return{c(){e=J("div"),r=Y(),n=J("div"),n.textContent="copied",W(e,"class","triangle svelte-nrqa06"),W(n,"class","copied svelte-nrqa06")},m(i,s){ee(i,e,s),ee(i,r,s),ee(i,n,s)},d(i){i&&Q(e),i&&Q(r),i&&Q(n)}}}function Qbe(t){let e,r,n,i,s,o,a=t[0]&&U9();return{c(){e=J("div"),r=J("div"),n=J("div"),n.innerHTML=`<div class="frame svelte-nrqa06"></div> 402 <div class="square svelte-nrqa06"></div>`,i=Y(),a&&a.c(),W(n,"class","icon-wrap svelte-nrqa06"),W(r,"class","copy svelte-nrqa06"),W(e,"class","copy-wrap noselect svelte-nrqa06")},m(c,l){ee(c,e,l),L(e,r),L(r,n),L(r,i),a&&a.m(r,null),s||(o=Tr(e,"click",t[1]),s=!0)},p(c,[l]){c[0]?a||(a=U9(),a.c(),a.m(r,null)):a&&(a.d(1),a=null)},i:$e,o:$e,d(c){c&&Q(e),a&&a.d(),s=!1,o()}}}function eye(t,e,r){let{value:n=""}=e,i=!1;function s(){r(0,i=!0),navigator.clipboard.writeText(n)}return t.$$set=o=>{"value"in o&&r(2,n=o.value)},[i,s,n]}class qb extends Rt{constructor(e){super(),xt(this,e,eye,Qbe,Ct,{value:2})}}function tye(t){let e,r,n,i,s,o,a,c,l,u,f,d=(t[0]?t[0].account:"0x0000....0000")+"",h,g,b,w;return c=new qb({props:{value:"_ens"}}),b=new qb({props:{value:t[0]?t[0].account:null}}),{c(){e=J("div"),r=J("div"),r.textContent="Host",n=Y(),i=J("div"),i.textContent="Value",s=Y(),o=J("div"),a=pe(`_ens 403 `),he(c.$$.fragment),l=Y(),u=J("div"),f=J("div"),h=pe(d),g=Y(),he(b.$$.fragment),W(o,"class","field svelte-1potakq"),On(f,"position","absolute"),On(f,"width","90%"),On(f,"overflow","hidden"),W(u,"class","field svelte-1potakq"),W(e,"class","txt-record svelte-1potakq")},m(x,k){ee(x,e,k),L(e,r),L(e,n),L(e,i),L(e,s),L(e,o),L(o,a),fe(c,o,null),L(e,l),L(e,u),L(u,f),L(f,h),L(u,g),fe(b,u,null),w=!0},p(x,[k]){(!w||k&1)&&d!==(d=(x[0]?x[0].account:"0x0000....0000")+"")&<(h,d);const R={};k&1&&(R.value=x[0]?x[0].account:null),b.$set(R)},i(x){w||(te(c.$$.fragment,x),te(b.$$.fragment,x),w=!0)},o(x){ne(c.$$.fragment,x),ne(b.$$.fragment,x),w=!1},d(x){x&&Q(e),de(c),de(b)}}}function rye(t,e,r){let{client:n}=e;return t.$$set=i=>{"client"in i&&r(0,n=i.client)},[n]}class cM extends Rt{constructor(e){super(),xt(this,e,rye,tye,Ct,{client:0})}}function nye(t){let e,r,n,i=t[1]>1?"s":"",s,o;return{c(){e=J("div"),r=pe(t[1]),n=pe(" year"),s=pe(i),o=pe(" registration"),W(e,"class","svelte-1fg6a7k")},m(a,c){ee(a,e,c),L(e,r),L(e,n),L(e,s),L(e,o)},p(a,c){c&2&<(r,a[1]),c&2&&i!==(i=a[1]>1?"s":"")&<(s,i)},d(a){a&&Q(e)}}}function iye(t){let e;return{c(){e=J("div"),e.textContent="Registration",W(e,"class","svelte-1fg6a7k")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function sye(t){let e,r,n,i,s=t[2].toFixed(4)+"",o,a,c,l,u,f,d=((t[0].FirstYear+t[0].Renew*(t[1]-1))/t[0].Eth).toFixed(4)+"",h,g,b,w,x,k,R,D=((t[0].FirstYear+t[0].Renew*(t[1]-1))/t[0].Eth+t[2]).toFixed(4)+"",O,M,F;function H(N,A){return N[0].Renew==0?iye:nye}let U=H(t),G=U(t);return{c(){e=J("div"),r=J("div"),r.textContent="Network fee",n=Y(),i=J("div"),o=pe(s),a=Y(),c=J("b"),c.textContent="ETH",l=Y(),G.c(),u=Y(),f=J("div"),h=pe(d),g=Y(),b=J("b"),b.textContent="ETH",w=Y(),x=J("div"),x.textContent="Estimate total",k=Y(),R=J("div"),O=pe(D),M=Y(),F=J("b"),F.textContent="ETH",W(r,"class","svelte-1fg6a7k"),W(i,"class","svelte-1fg6a7k"),W(f,"class","svelte-1fg6a7k"),W(x,"class","svelte-1fg6a7k"),W(R,"class","svelte-1fg6a7k"),W(e,"class","table svelte-1fg6a7k")},m(N,A){ee(N,e,A),L(e,r),L(e,n),L(e,i),L(i,o),L(i,a),L(i,c),L(e,l),G.m(e,null),L(e,u),L(e,f),L(f,h),L(f,g),L(f,b),L(e,w),L(e,x),L(e,k),L(e,R),L(R,O),L(R,M),L(R,F)},p(N,[A]){A&4&&s!==(s=N[2].toFixed(4)+"")&<(o,s),U===(U=H(N))&&G?G.p(N,A):(G.d(1),G=U(N),G&&(G.c(),G.m(e,u))),A&3&&d!==(d=((N[0].FirstYear+N[0].Renew*(N[1]-1))/N[0].Eth).toFixed(4)+"")&<(h,d),A&7&&D!==(D=((N[0].FirstYear+N[0].Renew*(N[1]-1))/N[0].Eth+N[2]).toFixed(4)+"")&<(O,D)},i:$e,o:$e,d(N){N&&Q(e),G.d()}}}function oye(t,e,r){let{pricing:n,years:i}=e,s=0;async function o(){try{r(2,s=Number(await cme())*15e5/1e19)}catch(a){console.log(a)}}return o(),t.$$set=a=>{"pricing"in a&&r(0,n=a.pricing),"years"in a&&r(1,i=a.years)},[n,i,s]}class lM extends Rt{constructor(e){super(),xt(this,e,oye,sye,Ct,{pricing:0,years:1})}}function aye(t){let e;return{c(){e=J("div"),W(e,"class","block empty")},m(r,n){ee(r,e,n)},p:$e,i:$e,o:$e,d(r){r&&Q(e)}}}function cye(t){let e,r;return e=new oM({props:{client:t[1],name:t[0]}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),i&1&&(s.name=n[0]),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function lye(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M=(t[6]||t[3].Note||"")+"",F,H,U,G,N,A=(t[3].Method=="prepay"||t[3].Method=="submit")&&H9();const v=[fye,uye],p=[];function m(I,_){return I[3].Pricing.Renew==0?0:1}f=m(t),d=p[f]=v[f](t),w=new lM({props:{pricing:t[3].Pricing,years:t[2]}});function y(I){t[10](I)}let T={client:t[1],abi:rM,fetchCallParams:t[7],address:tM,then:t[8],$$slots:{default:[dye]},$$scope:{ctx:t}};return t[6]!==void 0&&(T.error=t[6]),U=new Ph({props:T}),Mr.push(()=>Vr(U,"error",y)),{c(){e=J("div"),r=J("div"),n=pe(t[0]),i=Y(),s=J("br"),o=Y(),a=J("div"),c=J("br"),l=Y(),A&&A.c(),u=Y(),d.c(),h=Y(),g=J("br"),b=Y(),he(w.$$.fragment),x=Y(),k=J("br"),R=Y(),D=J("div"),O=J("div"),F=
403pe(M),H=Y(),he(U.$$.fragment),W(r,"class","t1"),W(r,"align","center"),W(O,"class","error svelte-qyb4pm"),W(D,"align","center"),W(a,"class","main block svelte-qyb4pm")},m(I,_){ee(I,e,_),L(e,r),L(r,n),L(e,i),L(e,s),L(e,o),L(e,a),L(a,c),L(a,l),A&&A.m(a,null),L(a,u),p[f].m(a,null),L(a,h),L(a,g),L(a,b),fe(w,a,null),L(a,x),L(a,k),L(a,R),L(a,D),L(D,O),L(O,F),L(D,H),fe(U,D,null),N=!0},p(I,_){(!N||_&1)&<(n,I[0]),I[3].Method=="prepay"||I[3].Method=="submit"?A||(A=H9(),A.c(),A.m(a,u)):A&&(A.d(1),A=null);let E=f;f=m(I),f===E?p[f].p(I,_):(_r(),ne(p[E],1,1,()=>{p[E]=null}),Cr(),d=p[f],d?d.p(I,_):(d=p[f]=v[f](I),d.c()),te(d,1),d.m(a,h));const C={};_&8&&(C.pricing=I[3].Pricing),_&4&&(C.years=I[2]),w.$set(C),(!N||_&72)&&M!==(M=(I[6]||I[3].Note||"")+"")&<(F,M);const S={};_&2&&(S.client=I[1]),_&4096&&(S.$$scope={dirty:_,ctx:I}),!G&&_&64&&(G=!0,S.error=I[6],Gr(()=>G=!1)),U.$set(S)},i(I){N||(te(d),te(w.$$.fragment,I),te(U.$$.fragment,I),N=!0)},o(I){ne(d),ne(w.$$.fragment,I),ne(U.$$.fragment,I),N=!1},d(I){I&&Q(e),A&&A.d(),p[f].d(),de(w),de(U)}}}function H9(t){let e;return{c(){e=J("p"),e.textContent="This domain is available and can be registered as a DNS & ENS NFT."},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function uye(t){let e,r,n,i;function s(a){t[9](a)}let o={unit:"year"};return t[2]!==void 0&&(o.value=t[2]),r=new iM({props:o}),Mr.push(()=>Vr(r,"value",s)),{c(){e=J("div"),he(r.$$.fragment),W(e,"align","center")},m(a,c){ee(a,e,c),fe(r,e,null),i=!0},p(a,c){const l={};!n&&c&4&&(n=!0,l.value=a[2],Gr(()=>n=!1)),r.$set(l)},i(a){i||(te(r.$$.fragment,a),i=!0)},o(a){ne(r.$$.fragment,a),i=!1},d(a){a&&Q(e),de(r)}}}function fye(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w;return f=new aM({}),b=new cM({props:{client:t[1]}}),{c(){e=J("div"),r=J("p"),n=pe("Create TXT record for "),i=pe(t[0]),s=pe(" in your domain manager."),o=Y(),a=J("p"),a.textContent=`Only the registrant of a DNS .ART domain can register the matching ENS name. To validate your DNS name you'll need to add a TXT record in your domain manager. Visit your domain registrar and follow the instructions in the drop down menu using the Host and Value data listed below. Then return to this page and select "Register" It may take a few moments for the TXT record to resolve.`,c=Y(),l=J("br"),u=Y(),he(f.$$.fragment),d=Y(),h=J("br"),g=Y(),he(b.$$.fragment)},m(x,k){ee(x,e,k),L(e,r),L(r,n),L(r,i),L(r,s),L(e,o),L(e,a),L(e,c),L(e,l),L(e,u),fe(f,e,null),L(e,d),L(e,h),ee(x,g,k),fe(b,x,k),w=!0},p(x,k){(!w||k&1)&<(i,x[0]);const R={};k&2&&(R.client=x[1]),b.$set(R)},i(x){w||(te(f.$$.fragment,x),te(b.$$.fragment,x),w=!0)},o(x){ne(f.$$.fragment,x),ne(b.$$.fragment,x),w=!1},d(x){x&&Q(e),de(f),x&&Q(g),de(b,x)}}}function dye(t){let e;return{c(){e=pe("Confirm")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function hye(t){let e,r,n,i;const s=[lye,cye,aye],o=[];function a(c,l){return c[3]?0:c[4]==506?1:2}return e=a(t),r=o[e]=s[e](t),{c(){r.c(),n=ti()},m(c,l){o[e].m(c,l),ee(c,n,l),i=!0},p(c,l){let u=e;e=a(c),e===u?o[e].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),r=o[e],r?r.p(c,l):(r=o[e]=s[e](c),r.c()),te(r,1),r.m(n.parentNode,n))},i(c){i||(te(r),i=!0)},o(c){ne(r),i=!1},d(c){o[e].d(c),c&&Q(n)}}}function pye(t){let e,r;return e=new WE({props:{loading:t[5],$$slots:{default:[hye]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,[i]){const s={};i&32&&(s.loading=n[5]),i&4191&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function gye(t,e,r){let{name:n,client:i}=e,s=1,o,a,c=!1;async function l(){try{let b=n2(n),w=await fetch(zi("register-new",{owner:i?i.account:"0x522002971ed5D51C2c6535083edfB2f6faf8b35E",domain:b,years:s}));if(r(4,a=w.status),a!=200){r(3,o=void 0);return}r(3,o=await w.json())}catch(b){console.log(b)}return r(5,c=!1),o}async function u(){r(5,c=!0),r(6,f=!1),await l(),r(5,c=!1)}let f;async function d(){_1("/registered/"+n),window.open("https://app.ens.domains/name/"+n)}function h(b){s=b,r(2,s)}function g(b){f=b,r(6,f)}return t.$$set=b=>{"name"in b&&r(0,n=b.name),"client"in b&&r(1,i=b.client)},t.$$.update=()=>{t.$$.dirty&3&&u()},[n,i,s,o,a,c,f,l,d,h,g]}class mye extends Rt{constructor(e){super(),xt(this,e,gye,pye,Ct,{name:0,client:1})}}function bye(t){let e;return{c(){e=J("div"),e.innerHTML=`<div><a href="https://protocol.art">Back to main page</a></div> 404 <br/> 405 <div>UKCI Holdings Limited © 2023</div>`,W(e,"class","main svelte-1vc2zkl")},m(r,n){ee(r,e,n)},p:$e,i:$e,o:$e,d(r){r&&Q(e)}}}class yye extends Rt{constructor(e){super(),xt(this,e,null,bye,Ct,{})}}function j9(t){let e,r,n,i;function s(a){t[2](a)}let o={};return t[0]!==void 0&&(o.value=t[0]),r=new nM({props:o}),Mr.push(()=>Vr(r,"value",s)),{c(){e=J("div"),he(r.$$.fragment),W(e,"class","emojis svelte-1a75utm")},m(a,c){ee(a,e,c),fe(r,e,null),i=!0},p(a,c){const l={};!n&&c&1&&(n=!0,l.value=a[0],Gr(()=>n=!1)),r.$set(l)},i(a){i||(te(r.$$.fragment,a),i=!0)},o(a){ne(r.$$.fragment,a),i=!1},d(a){a&&Q(e),de(r)}}}function vye(t){let e;return{c(){e=J("div"),e.textContent="ð¤¡",On(e,"font-size","3em")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function wye(t){let e,r,n,i,s,o,a,c,l,u=t[1]&&j9(t);return o=new un({props:{on_click:t[4],$$slots:{default:[vye]},$$scope:{ctx:t}}}),{c(){e=J("div"),u&&u.c(),r=Y(),n=J("input"),i=Y(),s=J("div"),he(o.$$.fragment),W(n,"type","text"),W(n,"placeholder","Search"),W(n,"class","search svelte-1a75utm"),W(s,"class","emojis-btn svelte-1a75utm"),W(e,"class","main svelte-1a75utm")},m(f,d){ee(f,e,d),u&&u.m(e,null),L(e,r),L(e,n),Ir(n,t[0]),L(e,i),L(e,s),fe(o,s,null),a=!0,c||(l=Tr(n,"input",t[3]),c=!0)},p(f,[d]){f[1]?u?(u.p(f,d),d&2&&te(u,1)):(u=j9(f),u.c(),te(u,1),u.m(e,r)):u&&(_r(),ne(u,1,1,()=>{u=null}),Cr()),d&1&&n.value!==f[0]&&Ir(n,f[0]);const h={};d&2&&(h.on_click=f[4]),d&32&&(h.$$scope={dirty:d,ctx:f}),o.$set(h)},i(f){a||(te(u),te(o.$$.fragment,f),a=!0)},o(f){ne(u),ne(o.$$.fragment,f),a=!1},d(f){f&&Q(e),u&&u.d(),de(o),c=!1,l()}}}function Eye(t,e,r){let{value:n}=e,i=!1;function s(c){n=c,r(0,n)}function o(){n=this.value,r(0,n)}const a=()=>{r(1,i=!i)};return t.$$set=c=>{"value"in c&&r(0,n=c.value)},[n,i,s,o,a]}class Aye extends Rt{constructor(e){super(),xt(this,e,Eye,wye,Ct,{value:0})}}function z9(t,e,r){const n=t.slice();return n[5]=e[r],n}function J9(t){let e,r=t[5]+"",n,i,s;function o(){return t[3](t[5])}return{c(){e=J("div"),n=pe(r),W(e,"class","item svelte-42pf3c")}
405,m(a,c){ee(a,e,c),L(e,n),i||(s=Tr(e,"click",o),i=!0)},p(a,c){t=a,c&2&&r!==(r=t[5]+"")&<(n,r)},d(a){a&&Q(e),i=!1,s()}}}function _ye(t){let e,r,n,i,s,o,a,c,l=t[1],u=[];for(let f=0;f<l.length;f+=1)u[f]=J9(z9(t,l,f));return{c(){e=J("div"),r=pe(t[0]),n=Y(),i=J("div"),i.textContent="â¹",s=Y(),o=J("div");for(let f=0;f<u.length;f+=1)u[f].c();W(i,"class","arrow svelte-42pf3c"),W(o,"class","list svelte-42pf3c"),W(e,"class","main noselect svelte-42pf3c"),an(e,"active",t[2])},m(f,d){ee(f,e,d),L(e,r),L(e,n),L(e,i),L(e,s),L(e,o);for(let h=0;h<u.length;h+=1)u[h]&&u[h].m(o,null);a||(c=Tr(e,"click",t[4]),a=!0)},p(f,[d]){if(d&1&<(r,f[0]),d&3){l=f[1];let h;for(h=0;h<l.length;h+=1){const g=z9(f,l,h);u[h]?u[h].p(g,d):(u[h]=J9(g),u[h].c(),u[h].m(o,null))}for(;h<u.length;h+=1)u[h].d(1);u.length=l.length}d&4&&an(e,"active",f[2])},i:$e,o:$e,d(f){f&&Q(e),hu(u,f),a=!1,c()}}}function Cye(t,e,r){let n=!1,{list:i=[]}=e,{value:s=i[0]||""}=e;const o=c=>{r(0,s=c)},a=()=>{r(2,n=!n)};return t.$$set=c=>{"list"in c&&r(1,i=c.list),"value"in c&&r(0,s=c.value)},[s,i,n,o,a]}class uM extends Rt{constructor(e){super(),xt(this,e,Cye,_ye,Ct,{list:1,value:0})}}function Sye(t){let e;return{c(){e=pe("Save")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Tye(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M,F,H,U,G,N;function A(y){t[4](y)}let v={client:t[0]};t[3]!==void 0&&(v.name=t[3]),d=new J6({props:v}),Mr.push(()=>Vr(d,"name",A));function p(y){t[5](y)}let m={list:t[2]};return t[1]!==void 0&&(m.value=t[1]),R=new uM({props:m}),Mr.push(()=>Vr(R,"value",p)),M=new Ph({props:{disabled:t[1]==""||t[1]==t[3],client:t[0],abi:eM,method:"setName",params:[t[1]],address:QO,$$slots:{default:[Sye]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),r.textContent="Set primary name",n=Y(),i=J("br"),s=Y(),o=J("div"),a=J("div"),a.textContent="Сhoose a name to be displayed instead of your address",c=Y(),l=J("br"),u=Y(),f=J("div"),he(d.$$.fragment),g=Y(),b=J("br"),w=Y(),x=J("div"),k=J("div"),he(R.$$.fragment),O=Y(),he(M.$$.fragment),F=Y(),H=J("br"),U=Y(),G=J("br"),W(r,"class","t1"),W(a,"class","t2"),W(f,"class","btns svelte-o3vew6"),W(f,"align","center"),W(k,"class","spacer svelte-o3vew6"),W(x,"class","btns svelte-o3vew6"),W(o,"class","main block svelte-o3vew6")},m(y,T){ee(y,e,T),L(e,r),L(e,n),L(e,i),L(e,s),L(e,o),L(o,a),L(o,c),L(o,l),L(o,u),L(o,f),fe(d,f,null),L(o,g),L(o,b),L(o,w),L(o,x),L(x,k),fe(R,k,null),L(x,O),fe(M,x,null),L(e,F),L(e,H),L(e,U),L(e,G),N=!0},p(y,[T]){const I={};T&1&&(I.client=y[0]),!h&&T&8&&(h=!0,I.name=y[3],Gr(()=>h=!1)),d.$set(I);const _={};T&4&&(_.list=y[2]),!D&&T&2&&(D=!0,_.value=y[1],Gr(()=>D=!1)),R.$set(_);const E={};T&10&&(E.disabled=y[1]==""||y[1]==y[3]),T&1&&(E.client=y[0]),T&2&&(E.params=[y[1]]),T&128&&(E.$$scope={dirty:T,ctx:y}),M.$set(E)},i(y){N||(te(d.$$.fragment,y),te(R.$$.fragment,y),te(M.$$.fragment,y),N=!0)},o(y){ne(d.$$.fragment,y),ne(R.$$.fragment,y),ne(M.$$.fragment,y),N=!1},d(y){y&&Q(e),de(d),de(R),de(M)}}}function Nye(t,e,r){let{client:n}=e,i,s=[],o="";async function a(){let f=await(await fetch(zi("art-tokens",{owner:n.account}))).json();r(2,s=[]),f.Items.forEach(d=>{s.push(d.Name+Kc)}),r(2,s=[...s])}a();function c(u){o=u,r(3,o)}function l(u){i=u,r(1,i)}return t.$$set=u=>{"client"in u&&r(0,n=u.client)},t.$$.update=()=>{t.$$.dirty&1&&a()},[n,i,s,o,c,l]}class Iye extends Rt{constructor(e){super(),xt(this,e,Nye,Tye,Ct,{client:0})}}function q9(t,e,r){const n=t.slice();return n[17]=e[r],n}function G9(t){let e,r;return e=new Iye({props:{client:t[1]}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function V9(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M;n=new uM({props:{list:["Name","Expiry date"]}}),o=new un({props:{on_click:t[10],$$slots:{default:[Pye]},$$scope:{ctx:t}}});function F(I){t[11](I)}let H={};t[3]!==void 0&&(H.value=t[3]),u=new Aye({props:H}),Mr.push(()=>Vr(u,"value",F));let U=t[7].length==0&&W9(),G=t[7],N=[];for(let I=0;I<G.length;I+=1)N[I]=X9(q9(t,G,I));const A=I=>ne(N[I],1,1,()=>{N[I]=null});
405function v(I){t[12](I)}function p(I){t[13](I)}function m(I){t[14](I)}function y(I){t[15](I)}let T={count:t[2]};return t[5]!==void 0&&(T.offset=t[5]),t[9]!==void 0&&(T.pages=t[9]),t[8]!==void 0&&(T.page=t[8]),t[6]!==void 0&&(T.limit=t[6]),x=new sM({props:T}),Mr.push(()=>Vr(x,"offset",v)),Mr.push(()=>Vr(x,"pages",p)),Mr.push(()=>Vr(x,"page",m)),Mr.push(()=>Vr(x,"limit",y)),{c(){e=J("div"),r=J("div"),he(n.$$.fragment),i=Y(),s=J("div"),he(o.$$.fragment),a=Y(),c=J("div"),l=Y(),he(u.$$.fragment),d=Y(),h=J("div"),g=J("div"),U&&U.c(),b=Y();for(let I=0;I<N.length;I+=1)N[I].c();w=Y(),he(x.$$.fragment),On(s,"font-size","0.3em"),W(r,"class","header-row svelte-1s8itge"),W(c,"class","spacer"),W(e,"class","header svelte-1s8itge"),W(g,"class","table svelte-1s8itge")},m(I,_){ee(I,e,_),L(e,r),fe(n,r,null),L(r,i),L(r,s),fe(o,s,null),L(e,a),L(e,c),L(e,l),fe(u,e,null),ee(I,d,_),ee(I,h,_),L(h,g),U&&U.m(g,null),L(g,b);for(let E=0;E<N.length;E+=1)N[E]&&N[E].m(g,null);ee(I,w,_),fe(x,I,_),M=!0},p(I,_){const E={};_&16&&(E.on_click=I[10]),_&1048592&&(E.$$scope={dirty:_,ctx:I}),o.$set(E);const C={};if(!f&&_&8&&(f=!0,C.value=I[3],Gr(()=>f=!1)),u.$set(C),I[7].length==0?U||(U=W9(),U.c(),U.m(g,b)):U&&(U.d(1),U=null),_&128){G=I[7];let B;for(B=0;B<G.length;B+=1){const $=q9(I,G,B);N[B]?(N[B].p($,_),te(N[B],1)):(N[B]=X9($),N[B].c(),te(N[B],1),N[B].m(g,null))}for(_r(),B=G.length;B<N.length;B+=1)A(B);Cr()}const S={};_&4&&(S.count=I[2]),!k&&_&32&&(k=!0,S.offset=I[5],Gr(()=>k=!1)),!R&&_&512&&(R=!0,S.pages=I[9],Gr(()=>R=!1)),!D&&_&256&&(D=!0,S.page=I[8],Gr(()=>D=!1)),!O&&_&64&&(O=!0,S.limit=I[6],Gr(()=>O=!1)),x.$set(S)},i(I){if(!M){te(n.$$.fragment,I),te(o.$$.fragment,I),te(u.$$.fragment,I);for(let _=0;_<G.length;_+=1)te(N[_]);te(x.$$.fragment,I),M=!0}},o(I){ne(n.$$.fragment,I),ne(o.$$.fragment,I),ne(u.$$.fragment,I),N=N.filter(Boolean);for(let _=0;_<N.length;_+=1)ne(N[_]);ne(x.$$.fragment,I),M=!1},d(I){I&&Q(e),de(n),de(o),de(u),I&&Q(d),I&&Q(h),U&&U.d(),hu(N,I),I&&Q(w),de(x,I)}}}function xye(t){let e;return{c(){e=J("div"),e.textContent=" â ",On(e,"font-size","3em")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Rye(t){let e;return{c(){e=J("div"),e.textContent=" â ",On(e,"font-size","3em")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Pye(t){let e;function r(s,o){return s[4]?Rye:xye}let n=r(t),i=n(t);return{c(){i.c(),e=ti()},m(s,o){i.m(s,o),ee(s,e,o)},p(s,o){n!==(n=r(s))&&(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&Q(e)}}}function W9(t){let e;return{c(){e=J("div"),e.innerHTML="<div>No names found for this address</div>",W(e,"class","empty-list svelte-1s8itge")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function kye(t){let e;return{c(){e=pe("-")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function Oye(t){let e=new Date(t[17].Expires).toDateString()+"",r;return{c(){r=pe(e)},m(n,i){ee(n,r,i)},p(n,i){i&128&&e!==(e=new Date(n[17].Expires).toDateString()+"")&<(r,e)},d(n){n&&Q(r)}}}function K9(t){let e,r;return e=new ah({props:{to:"/name/"+t[17].Name+Kc,$$slots:{default:[Mye]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&128&&(s.to="/name/"+n[17].Name+Kc),i&1048576&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Mye(t){let e;return{c(){e=pe("View")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function X9(t){let e,r,n,i=t[17].Name+".art",s,o,a,c,l,u,f,d,h,g,b,w,x,k;function R(F,H){return H&128&&(f=null),f==null&&(f=new Date(F[17].Expires).valueOf()>946674e6),f?Oye:kye}let D=R(t,-1),O=D(t),M=t[17].Expires!="1970-01-01T00:00:00Z"&&K9(t);return{c(){e=J("div"),r=J("div"),n=J("div"),s=pe(i),o=Y(),a=J("div"),c=J("sub"),l=J("b"),l.textContent="Expires",u=Y(),O.c(),d=Y(),M&&M.c(),h=Y(),g=J("a"),b=pe("Edit"),x=Y(),W(r,"class","spacer"),W(g,"href",w="https://app.ens.domains/name/"+t[17].Name+Kc),W(e,"class","item svelte-1s8itge")},m(F,H){ee(F,e,H),L(e,r),L(r,n),L(n,s),L(r,o),L(r,a),L(a,c),L(c,l),L(c,u),O.m(c,null),L(e,d),M&&M.m(e,null),L(e,h),L(e,g),L(g,b),L(e,x),k=!0},p(F,H){(!k||H&128)&&i!==(i=F[17].Name+".art")&<(s,i),D===(D=R(F,H))&&O?O.p(F,H):(O.d(1),O=D(F),O&&(O.c(),O.m(c,null))),F[17].Expires!="1970-01-01T00:00:00Z"?M?(M.p(F,H),H&128&&te(M,1)):(M=K9(F),M.c(),te(M,1),M.m(e,h)):M&&(_r(),ne(M,1,1,()=>{M=null}),Cr()),(!k||H&128&&w!==(w="https://app.ens.domains/name/"+F[17].Name+Kc))&&W(g,"href",w)},i(F){k||(te(M),k=!0)},o(F){ne(M),k=!1},d(F){F&&Q(e),O.d(),M&&M.d()}}}function Dye(t){let e,r=t[1]&&t[0]&&t[0].toLowerCase()==t[1].account.toLowerCase(),n,i,s,o=Ta(t[0])+"",a,c,l,u,f,d,h=r&&G9(t),g=t[7]&&V9(t);return{c(){e=J("div"),h&&h.c(),n=Y(),i=J("div"),s=pe("Names "),a=pe(o),c=Y(),l=J("br"),u=Y(),f=J("div"),g&&g.c(),W(i,"class","t1"),W(f,"value",fM),W(f,"class","block main svelte-1s8itge"),an(f,"empty",!t[7])},m(b,w){ee(b,e,w),h&&h.m(e,null),L(e,n),L(e,i),L(i,s),L(i,a),L(e,c),L(e,l),L(e,u),L(e,f),g&&g.m
405(f,null),d=!0},p(b,[w]){w&3&&(r=b[1]&&b[0]&&b[0].toLowerCase()==b[1].account.toLowerCase()),r?h?(h.p(b,w),w&3&&te(h,1)):(h=G9(b),h.c(),te(h,1),h.m(e,n)):h&&(_r(),ne(h,1,1,()=>{h=null}),Cr()),(!d||w&1)&&o!==(o=Ta(b[0])+"")&<(a,o),b[7]?g?(g.p(b,w),w&128&&te(g,1)):(g=V9(b),g.c(),te(g,1),g.m(f,null)):g&&(_r(),ne(g,1,1,()=>{g=null}),Cr()),(!d||w&128)&&an(f,"empty",!b[7])},i(b){d||(te(h),te(g),d=!0)},o(b){ne(h),ne(g),d=!1},d(b){b&&Q(e),h&&h.d(),g&&g.d()}}}let fM="Name";function Bye(t,e,r){let n,i,s=0,o="",{account:a,client:c}=e,l=!0,u=0,f=10,d;async function h(){try{let D=await fetch(zi("art-tokens",{name:o,owner:a,limit:f,offset:u,order:fM,asc:l}));D=await D.json(),r(7,i=D.Items),r(2,s=D.Count)}catch(D){console.log(D)}}h();const g=()=>{r(4,l=!l)};function b(D){o=D,r(3,o)}function w(D){u=D,r(5,u)}function x(D){n=D,r(9,n),r(2,s),r(6,f)}function k(D){d=D,r(8,d),r(5,u),r(6,f)}function R(D){f=D,r(6,f)}return t.$$set=D=>{"account"in D&&r(0,a=D.account),"client"in D&&r(1,c=D.client)},t.$$.update=()=>{t.$$.dirty&96&&r(8,d=Math.ceil(u/f)+1),t.$$.dirty&68&&r(9,n=Math.ceil(s/f)),t.$$.dirty&57&&h()},[a,c,s,o,l,u,f,i,d,n,g,b,w,x,k,R]}class Fye extends Rt{constructor(e){super(),xt(this,e,Bye,Dye,Ct,{account:0,client:1})}}function $ye(t){let e;return{c(){e=J("div"),W(e,"class","block empty")},m(r,n){ee(r,e,n)},p:$e,i:$e,o:$e,d(r){r&&Q(e)}}}function Lye(t){let e,r;return e=new oM({props:{client:t[1],name:t[0]}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),i&1&&(s.name=n[0]),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Uye(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D,O,M=(t[6]||t[3].Note||"")+"",F,H,U,G,N,A=(t[3].Method=="prepay"||t[3].Method=="submit")&&Z9();const v=[jye,Hye],p=[];function m(I,_){return I[3].Pricing.Renew==0?0:1}f=m(t),d=p[f]=v[f](t),w=new lM({props:{pricing:t[3].Pricing,years:t[2]}});function y(I){t[10](I)}let T={client:t[1],abi:rM,fetchCallParams:t[7],address:tM,then:t[8],$$slots:{default:[zye]},$$scope:{ctx:t}};return t[6]!==void 0&&(T.error=t[6]),U=new Ph({props:T}),Mr.push(()=>Vr(U,"error",y)),{c(){e=J("div"),r=J("div"),n=pe(t[0]),i=Y(),s=J("br"),o=Y(),a=J("div"),c=J("br"),l=Y(),A&&A.c(),u=Y(),d.c(),h=Y(),g=J("br"),b=Y(),he(w.$$.fragment),x=Y(),k=J("br"),R=Y(),D=J("div"),O=J("div"),F=pe(M),H=Y(),he(U.$$.fragment),W(r,"class","t1"),W(r,"align","center"),W(O,"class","error svelte-qyb4pm"),W(D,"align","center"),W(a,"class","main block svelte-qyb4pm")},m(I,_){ee(I,e,_),L(e,r),L(r,n),L(e,i),L(e,s),L(e,o),L(e,a),L(a,c),L(a,l),A&&A.m(a,null),L(a,u),p[f].m(a,null),L(a,h),L(a,g),L(a,b),fe(w,a,null),L(a,x),L(a,k),L(a,R),L(a,D),L(D,O),L(O,F),L(D,H),fe(U,D,null),N=!0},p(I,_){(!N||_&1)&<(n,I[0]),I[3].Method=="prepay"||I[3].Method=="submit"?A||(A=Z9(),A.c(),A.m(a,u)):A&&(A.d(1),A=null);let E=f;f=m(I),f===E?p[f].p(I,_):(_r(),ne(p[E],1,1,()=>{p[E]=null}),Cr(),d=p[f],d?d.p(I,_):(d=p[f]=v[f](I),d.c()),te(d,1),d.m(a,h));const C={};_&8&&(C.pricing=I[3].Pricing),_&4&&(C.years=I[2]),w.$set(C),(!N||_&72)&&M!==(M=(I[6]||I[3].Note||"")+"")&<(F,M);const S={};_&2&&(S.client=I[1]),_&4096&&(S.$$scope={dirty:_,ctx:I}),!G&&_&64&&(G=!0,S.error=I[6],Gr(()=>G=!1)),U.$set(S)},i(I){N||(te(d),te(w.$$.fragment,I),te(U.$$.fragment,I),N=!0)},o(I){ne(d),ne(w.$$.fragment,I),ne(U.$$.fragment,I),N=!1},d(I){I&&Q(e),A&&A.d(),p[f].d(),de(w),de(U)}}}function Z9(t){let e;return{c(){e=J("p"),e.textContent="This domain is available and can be registered as a DNS & ENS NFT."},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Hye(t){let e,r,n,i;function s(a){t[9](a)}let o={unit:"year"};return t[2]!==void 0&&(o.value=t[2]),r=new iM({props:o}),Mr.push(()=>Vr(r,"value",s)),{c(){e=J("div"),he(r.$$.fragment),W(e,"align","center")},m(a,c){ee(a,e,c),fe(r,e,null),i=!0},p(a,c){const l={};!n&&c&4&&(n=!0,l.value=a[2],Gr(()=>n=!1)),r.$set(l)},i(a){i||(te(r.$$.fragment,a),i=!0)},o(a){ne(r.$$.fragment,a),i=!1},d(a){a&&Q(e),de(r)}}}function jye(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w;return f=new aM({}),b=new cM({props:{client:t[1]}}),{c(){e=J("div"),r=J("p"),n=pe("Create TXT record for "),i=pe(t[0]),s=pe(" in your domain manager."),o=Y(),a=J("p"),a.textContent=`Only the registrant of a DNS .ART domain can register the matching ENS name. To validate your DNS name you'll need to add a TXT record
405in your domain manager. Visit your domain registrar and follow the instructions in the drop down menu using the Host and Value data listed below. Then return to this page and select "Register" It may take a few moments for the TXT record to resolve.`,c=Y(),l=J("br"),u=Y(),he(f.$$.fragment),d=Y(),h=J("br"),g=Y(),he(b.$$.fragment)},m(x,k){ee(x,e,k),L(e,r),L(r,n),L(r,i),L(r,s),L(e,o),L(e,a),L(e,c),L(e,l),L(e,u),fe(f,e,null),L(e,d),L(e,h),ee(x,g,k),fe(b,x,k),w=!0},p(x,k){(!w||k&1)&<(i,x[0]);const R={};k&2&&(R.client=x[1]),b.$set(R)},i(x){w||(te(f.$$.fragment,x),te(b.$$.fragment,x),w=!0)},o(x){ne(f.$$.fragment,x),ne(b.$$.fragment,x),w=!1},d(x){x&&Q(e),de(f),x&&Q(g),de(b,x)}}}function zye(t){let e;return{c(){e=pe("Confirm")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Jye(t){let e,r,n,i;const s=[Uye,Lye,$ye],o=[];function a(c,l){return c[3]?0:c[4]==506?1:2}return e=a(t),r=o[e]=s[e](t),{c(){r.c(),n=ti()},m(c,l){o[e].m(c,l),ee(c,n,l),i=!0},p(c,l){let u=e;e=a(c),e===u?o[e].p(c,l):(_r(),ne(o[u],1,1,()=>{o[u]=null}),Cr(),r=o[e],r?r.p(c,l):(r=o[e]=s[e](c),r.c()),te(r,1),r.m(n.parentNode,n))},i(c){i||(te(r),i=!0)},o(c){ne(r),i=!1},d(c){o[e].d(c),c&&Q(n)}}}function qye(t){let e,r;return e=new WE({props:{loading:t[5],$$slots:{default:[Jye]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,[i]){const s={};i&32&&(s.loading=n[5]),i&4191&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function Gye(t,e,r){let{name:n,client:i}=e,s=1,o,a,c=!1;async function l(){try{let b=n2(n),w=await fetch(zi("renew-new",{owner:i?i.account:"0x522002971ed5D51C2c6535083edfB2f6faf8b35E",domain:b,years:s}));if(r(4,a=w.status),a!=200){r(3,o=void 0);return}r(3,o=await w.json())}catch(b){console.log(b)}return r(5,c=!1),o}async function u(){r(5,c=!0),r(6,f=!1),await l(),r(5,c=!1)}let f;async function d(){_1("/registered/"+n),window.open("https://app.ens.domains/name/"+n)}function h(b){s=b,r(2,s)}function g(b){f=b,r(6,f)}return t.$$set=b=>{"name"in b&&r(0,n=b.name),"client"in b&&r(1,i=b.client)},t.$$.update=()=>{t.$$.dirty&3&&u()},[n,i,s,o,a,c,f,l,d,h,g]}class Vye extends Rt{constructor(e){super(),xt(this,e,Gye,qye,Ct,{name:0,client:1})}}function Wye(t){let e,r,n;return r=new mye({props:{client:t[0],name:t[1]}}),{c(){e=J("div"),he(r.$$.fragment)},m(i,s){ee(i,e,s),fe(r,e,null),n=!0},p(i,[s]){const o={};s&1&&(o.client=i[0]),s&2&&(o.name=i[1]),r.$set(o)},i(i){n||(te(r.$$.fragment,i),n=!0)},o(i){ne(r.$$.fragment,i),n=!1},d(i){i&&Q(e),de(r)}}}function Kye(t,e,r){let{client:n,name:i}=e;return t.$$set=s=>{"client"in s&&r(0,n=s.client),"name"in s&&r(1,i=s.name)},[n,i]}class Xye extends Rt{constructor(e){super(),xt(this,e,Kye,Wye,Ct,{client:0,name:1})}}function Zye(t){let e;return{c(){e=pe("Apply name")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Yye(t){let e;return{c(){e=pe("My names")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Qye(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R,D;return x=new Ph({props:{disabled:t[0]=="",client:t[1],abi:eM,method:"setName",params:[t[0]],address:QO,$$slots:{default:[Zye]},$$scope:{ctx:t}}}),R=new un({props:{on_click:t[2],$$slots:{default:[Yye]},$$scope:{ctx:t}}}),{c(){e=J("div"),r=J("div"),r.textContent="Successfully registered!",n=Y(),i=J("br"),s=Y(),o=J("br"),a=Y(),c=J("div"),l=J("div"),u=pe(t[0]),f=Y(),d=J("br"),h=Y(),g=J("br"),b=Y(),w=J("div"),he(x.$$.fragment),k=Y(),he(R.$$.fragment),W(r,"class","t1"),W(l,"class","spacer"),W(c,"class","t1 name svelte-1u4krof"),W(w,"class","btns svelte-1u4krof"),W(e,"class","main block svelte-1u4krof"),W(e,"align","center")},m(O,M){ee(O,e,M),L(e,r),L(e,n),L(e,i),L(e,s),L(e,o),L(e,a),L(e,c),L(c,l),L(l,u),L(e,f),L(e,d),L(e,h),L(e,g),L(e,b),L(e,w),fe(x,w,null),L(w,k),fe(R,w,null),D=!0},p(O,[M]){(!D||M&1)&<(u,O[0]);const F={};M&1&&(F.disabled=O[0]==""),M&2&&(F.client=O[1]),M&1&&(F.params=[O[0]]),M&8&&(F.$$scope={dirty:M,ctx:O}),x.$set(F);const H={};M&2&&(H.on_click=O[2]),M&8&&(H.$$scope={dirty:M,ctx:O}),R.$set(H)},i(O){D||(te(x.$$.fragment,O),te(R.$$.fragment,O),D=!0)},o(O){ne(x.$$.fragment,O),ne(R.$$.fragment,O),D=!1},d(O){O&&Q(e),de(x),de(R)}}}function e2e(t,e,r){let{name:n,client:i}=e;const s=()=>{_1("/account/"+i.account)};return t.$$set=o=>
vendor: 10,849 bytes, line 405
405{"name"in o&&r(0,n=o.name),"client"in o&&r(1,i=o.client)},[n,i,s]}class t2e extends Rt{constructor(e){super(),xt(this,e,e2e,Qye,Ct,{name:0,client:1})}}var dM=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ed(t,e,r){return r={path:e,exports:{},require:function(n,i){return r2e(n,i??r.path)}},t(r,r.exports),r.exports}function r2e(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var yt=ed(function(t){(function(e,r){function n(N,A){if(!N)throw new Error(A||"Assertion failed")}function i(N,A){N.super_=A;var v=function(){};v.prototype=A.prototype,N.prototype=new v,N.prototype.constructor=N}function s(N,A,v){if(s.isBN(N))return N;this.negative=0,this.words=null,this.length=0,this.red=null,N!==null&&((A==="le"||A==="be")&&(v=A,A=10),this._init(N||0,A||10,v||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=null.Buffer}catch{}s.isBN=function(A){return A instanceof s?!0:A!==null&&typeof A=="object"&&A.constructor.wordSize===s.wordSize&&Array.isArray(A.words)},s.max=function(A,v){return A.cmp(v)>0?A:v},s.min=function(A,v){return A.cmp(v)<0?A:v},s.prototype._init=function(A,v,p){if(typeof A=="number")return this._initNumber(A,v,p);if(typeof A=="object")return this._initArray(A,v,p);v==="hex"&&(v=16),n(v===(v|0)&&v>=2&&v<=36),A=A.toString().replace(/\s+/g,"");var m=0;A[0]==="-"&&(m++,this.negative=1),m<A.length&&(v===16?this._parseHex(A,m,p):(this._parseBase(A,v,m),p==="le"&&this._initArray(this.toArray(),v,p)))},s.prototype._initNumber=function(A,v,p){A<0&&(this.negative=1,A=-A),A<67108864?(this.words=[A&67108863],this.length=1):A<4503599627370496?(this.words=[A&67108863,A/67108864&67108863],this.length=2):(n(A<9007199254740992),this.words=[A&67108863,A/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),v,p)},s.prototype._initArray=function(A,v,p){if(n(typeof A.length=="number"),A.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(A.length/3),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y,T,I=0;if(p==="be")for(m=A.length-1,y=0;m>=0;m-=3)T=A[m]|A[m-1]<<8|A[m-2]<<16,this.words[y]|=T<<I&67108863,this.words[y+1]=T>>>26-I&67108863,I+=24,I>=26&&(I-=26,y++);else if(p==="le")for(m=0,y=0;m<A.length;m+=3)T=A[m]|A[m+1]<<8|A[m+2]<<16,this.words[y]|=T<<I&67108863,this.words[y+1]=T>>>26-I&67108863,I+=24,I>=26&&(I-=26,y++);return this.strip()};function a(N,A){var v=N.charCodeAt(A);return v>=65&&v<=70?v-55:v>=97&&v<=102?v-87:v-48&15}function c(N,A,v){var p=a(N,v);return v-1>=A&&(p|=a(N,v-1)<<4),p}s.prototype._parseHex=function(A,v,p){this.length=Math.ceil((A.length-v)/6),this.words=new Array(this.length);for(var m=0;m<this.length;m++)this.words[m]=0;var y=0,T=0,I;if(p==="be")for(m=A.length-1;m>=v;m-=2)I=c(A,v,m)<<y,this.words[T]|=I&67108863,y>=18?(y-=18,T+=1,this.words[T]|=I>>>26):y+=8;else{var _=A.length-v;for(m=_%2===0?v+1:v;m<A.length;m+=2)I=c(A,v,m)<<y,this.words[T]|=I&67108863,y>=18?(y-=18,T+=1,this.words[T]|=I>>>26):y+=8}this.strip()};function l(N,A,v,p){for(var m=0,y=Math.min(N.length,v),T=A;T<y;T++){var I=N.charCodeAt(T)-48;m*=p,I>=49?m+=I-49+10:I>=17?m+=I-17+10:m+=I}return m}s.prototype._parseBase=function(A,v,p){this.words=[0],this.length=1;for(var m=0,y=1;y<=67108863;y*=v)m++;m--,y=y/v|0;for(var T=A.length-p,I=T%m,_=Math.min(T,T-I)+p,E=0,C=p;C<_;C+=m)E=l(A,C,C+m,v),this.imuln(y),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E);if(I!==0){var S=1;for(E=l(A,C,A.length,v),C=0;C<I;C++)S*=v;this.imuln(S),this.words[0]+E<67108864?this.words[0]+=E:this._iaddn(E)}this.strip()},s.prototype.copy=function(A){A.words=new Array(this.length);for(var v=0;v<this.length;v++)A.words[v]=this.words[v];A.length=this.length,A.negative=this.negative,A.red=this.red},s.prototype.clone=function(){var A=new s(null);return this.copy(A),A},s.prototype._expand=function(A){for(;this.length<A;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(A,v){A=A||10,v=v|0||1;var p;if(A===16||A==="hex"){p="";for(var m=0,y=0,T=0;T<this.length;T++){var I=this.words[T],_=((I<<m|y)&16777215).toString(16);y=I>>>24-m&16777215,y!==0||T!==this.length-1?p=u[6-_.length]+_+p:p=_+p,m+=2,m>=26&&(m-=26,T--)}for(y!==0&&(p=y.toString(16)+p);p.length%v!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(A===(A|0)&&A>=2&&A<=36){var E=f[A],C=d[A];p="";var S=this.clone();for(S.negative=0;!S.isZero();){var B=S.modn(C).toString(A);S=S.idivn(C),S.isZero()?p=B+p:p=u[E-B.length]+B+p}for(this.isZero()&&(p="0"+p);p.length%v!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var A=this.words[0];return this.length===2?A+=this.words[1]*67108864:this.length===3&&this.words[2]===1?A+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-A:A},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(A,v){return n(typeof o<"u"),this.toArrayLike(o,A,v)},s.prototype.toArray=function(A,v){return this.toArrayLike(Array,A,v)},s.prototype.toArrayLike=function(A,v,p){var m=this.byteLength(),y=p||Math.max(1,m);n(m<=y,"byte array longer than desired length"),n(y>0,"Requested array length <= 0"),this.strip();var T=v==="le",I=new A(y),_,E,C=this.clone();if(T){for(E=0;!C.isZero();E++)_=C.andln(255),C.iushrn(8),I[E]=_;for(;E<y;E++)I[E]=0}else{for(E=0;E<y-m;E++)I[E]=0;for(E=0;!C.isZero();E++)_=C.andln(255),C.iushrn(8),I[y-E-1]=_}return I},Math.clz32?s.prototype._countBits=function(A){return 32-Math.clz32(A)}:s.prototype._countBits=function(A){var v=A,p=0;return v>=4096&&(p+=13,v>>>=13),v>=64&&(p+=7,v>>>=7),v>=8&&(p+=4,v>>>=4),v>=2&&(p+=2,v>>>=2),p+v},s.prototype._zeroBits=function(A){if(A===0)return 26;var v=A,p=0;return v&8191||(p+=13,v>>>=13),v&127||(p+=7,v>>>=7),v&15||(p+=4,v>>>=4),v&3||(p+=2,v>>>=2),v&1||p++,p},s.prototype.bitLength=function(){var A=this.words[this.length-1],v=this._countBits(A);return(this.length-1)*26+v};function h(N){for(var A=new Array(N.bitLength()),v=0;v<A.length;v++){var p=v/26|0,m=v%26;A[v]=(N.words[p]&1<<m)>>>m}return A}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var A=0,v=0;v<this.length;v++){var p=this._zeroBits(this.words[v]);if(A+=p,p!==26)break}return A},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(A){return this.negative!==0?this.abs().inotn(A).iaddn(1):this.clone()},s.prototype.fromTwos=function(A){return this.testn(A-1)?this.notn(A).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(A){for(;this.length<A.length;)this.words[this.length++]=0;for(var v=0;v<A.length;v++)this.words[v]=this.words[v]|A.words[v];return this.strip()},s.prototype.ior=function(A){return n((this.negative|A.negative)===0),this.iuor(A)},s.prototype.or=function(A){return this.length>A.length?this.clone().ior(A):A.clone().ior(this)},s.prototype.uor=function(A){return this.length>A.length?this.clone().iuor(A):A.clone().iuor(this)},s.prototype.iuand=function(A){var v;this.length>A.length?v=A:v=this;for(var p=0;p<v.length;p++)this.words[p]=this.words[p]&A.words[p];return this.length=v.length,this.strip()},s.prototype.iand=function(A){return n((this.negative|A.negative)===0),this.iuand(A)},s.prototype.and=function(A){return this.length>A.length?this.clone().iand(A):A.clone().iand(this)},s.prototype.uand=function(A){return this.length>A.length?this.clone().iuand(A):A.clone().iuand(this)},s.prototype.iuxor=function(A){var v,p;this.length>A.length?(v=this,p=A):(v=A,p=this);for(var m=0;m<p.length;m++)this.words[m]=v.words[m]^p.words[m];if(this!==v)for(;m<v.length;m++)this.words[m]=v.words[m];return this.length=v.length,this.strip()},s.prototype.ixor=function(A){return n((this.negative|A.negative)===0),this.iuxor(A)},s.prototype.xor=function(A){return this.length>A.length?this.clone().ixor(A):A.clone().ixor(this)},s.prototype.uxor=function(A){return this.length>A.length?this.clone().iuxor(A):A.clone().iuxor(this)},s.prototype.inotn=function(A){n(typeof A=="number"&&A>=0);var v=Math.ceil(A/26)|0,p=A%26;this._expand(v),p>0&&v--;for(var m=0;m<v;m++)this.words[m]=~this.words[m]&67108863;return p>0&&(this.words[m]=~this.words[m]&67108863>>26-p),this.strip()},s.prototype.notn=function(A){return this.clone().inotn(A)},s.prototype.setn=function(A,v){n(typeof A=="number"&&A>=0);var p=A/26|0,m=A%26;return this._expand(p+1),v?this.words[p]=this.words[p]|1<<m:this.words[p]=this.words[p]&~(1<<m),this.strip()},s.prototype.iadd=function(A){var v;if(this.negative!==0&&A.negative===0)return this.negative=0,v=this.isub(A),this.negative^=1,this._normSign();if(this.negative===0&&A.negative!==0)return A.negative=0,v=this.isub(A),A.negative=1,v._normSign();var p,m;this.length>A.length?(p=this,m=A):(p=A,m=this);for(var y=0,T=0;T<m.length;T++)v=(p.words[T]|0)+(m.words[T]|0)+y,this.words[T]=v&67108863,y=v>>>26;for(;y!==0&&T<p.length;T++)v=(p.words[T]|0)+y,this.words[T]=v&67108863,y=v>>>26;if(this.length=p.length,y!==0)this.words[this.length]=y,this.length++;else if(p!==this)for(;T<p.length;T++)this.words[T]=p.words[T];return this},s.prototype.add=function(A){var v;return A.negative!==0&&this.negative===0?(A.negative=0,v=this.sub(A),A.negative^=1,v):A.negative===0&&this.negative!==0?(this.negative=0,v=A.sub(this),this.negative=1,v):this.length>A.length?this.clone().iadd(A):A.clone().iadd(this)},s.prototype.isub=function(A){if(A.negative!==0){A.negative=0;
vendor: 7,356 bytes, line 405
405var v=this.iadd(A);return A.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(A),this.negative=1,this._normSign();var p=this.cmp(A);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;p>0?(m=this,y=A):(m=A,y=this);for(var T=0,I=0;I<y.length;I++)v=(m.words[I]|0)-(y.words[I]|0)+T,T=v>>26,this.words[I]=v&67108863;for(;T!==0&&I<m.length;I++)v=(m.words[I]|0)+T,T=v>>26,this.words[I]=v&67108863;if(T===0&&I<m.length&&m!==this)for(;I<m.length;I++)this.words[I]=m.words[I];return this.length=Math.max(this.length,I),m!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(A){return this.clone().isub(A)};function g(N,A,v){v.negative=A.negative^N.negative;var p=N.length+A.length|0;v.length=p,p=p-1|0;var m=N.words[0]|0,y=A.words[0]|0,T=m*y,I=T&67108863,_=T/67108864|0;v.words[0]=I;for(var E=1;E<p;E++){for(var C=_>>>26,S=_&67108863,B=Math.min(E,A.length-1),$=Math.max(0,E-N.length+1);$<=B;$++){var P=E-$|0;m=N.words[P]|0,y=A.words[$]|0,T=m*y+S,C+=T/67108864|0,S=T&67108863}v.words[E]=S|0,_=C|0}return _!==0?v.words[E]=_|0:v.length--,v.strip()}var b=function(A,v,p){var m=A.words,y=v.words,T=p.words,I=0,_,E,C,S=m[0]|0,B=S&8191,$=S>>>13,P=m[1]|0,q=P&8191,V=P>>>13,X=m[2]|0,Z=X&8191,ie=X>>>13,ce=m[3]|0,se=ce&8191,_e=ce>>>13,ye=m[4]|0,Te=ye&8191,ht=ye>>>13,Ot=m[5]|0,Ge=Ot&8191,$t=Ot>>>13,Lt=m[6]|0,Je=Lt&8191,Ut=Lt>>>13,Ht=m[7]|0,qe=Ht&8191,jt=Ht>>>13,zt=m[8]|0,Ve=zt&8191,Vt=zt>>>13,Wt=m[9]|0,We=Wt&8191,tr=Wt>>>13,rr=y[0]|0,Xe=rr&8191,nr=rr>>>13,ir=y[1]|0,Ze=ir&8191,sr=ir>>>13,or=y[2]|0,Ye=or&8191,ar=or>>>13,cr=y[3]|0,Qe=cr&8191,lr=cr>>>13,ur=y[4]|0,et=ur&8191,fr=ur>>>13,dr=y[5]|0,tt=dr&8191,hr=dr>>>13,pr=y[6]|0,rt=pr&8191,gr=pr>>>13,mr=y[7]|0,nt=mr&8191,Fr=mr>>>13,$r=y[8]|0,ut=$r&8191,Lr=$r>>>13,Ur=y[9]|0,ft=Ur&8191,Hr=Ur>>>13;p.negative=A.negative^v.negative,p.length=19,_=Math.imul(B,Xe),E=Math.imul(B,nr),E=E+Math.imul($,Xe)|0,C=Math.imul($,nr);var xr=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(xr>>>26)|0,xr&=67108863,_=Math.imul(q,Xe),E=Math.imul(q,nr),E=E+Math.imul(V,Xe)|0,C=Math.imul(V,nr),_=_+Math.imul(B,Ze)|0,E=E+Math.imul(B,sr)|0,E=E+Math.imul($,Ze)|0,C=C+Math.imul($,sr)|0;var Rr=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,_=Math.imul(Z,Xe),E=Math.imul(Z,nr),E=E+Math.imul(ie,Xe)|0,C=Math.imul(ie,nr),_=_+Math.imul(q,Ze)|0,E=E+Math.imul(q,sr)|0,E=E+Math.imul(V,Ze)|0,C=C+Math.imul(V,sr)|0,_=_+Math.imul(B,Ye)|0,E=E+Math.imul(B,ar)|0,E=E+Math.imul($,Ye)|0,C=C+Math.imul($,ar)|0;var Hs=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Hs>>>26)|0,Hs&=67108863,_=Math.imul(se,Xe),E=Math.imul(se,nr),E=E+Math.imul(_e,Xe)|0,C=Math.imul(_e,nr),_=_+Math.imul(Z,Ze)|0,E=E+Math.imul(Z,sr)|0,E=E+Math.imul(ie,Ze)|0,C=C+Math.imul(ie,sr)|0,_=_+Math.imul(q,Ye)|0,E=E+Math.imul(q,ar)|0,E=E+Math.imul(V,Ye)|0,C=C+Math.imul(V,ar)|0,_=_+Math.imul(B,Qe)|0,E=E+Math.imul(B,lr)|0,E=E+Math.imul($,Qe)|0,C=C+Math.imul($,lr)|0;var js=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(js>>>26)|0,js&=67108863,_=Math.imul(Te,Xe),E=Math.imul(Te,nr),E=E+Math.imul(ht,Xe)|0,C=Math.imul(ht,nr),_=_+Math.imul(se,Ze)|0,E=E+Math.imul(se,sr)|0,E=E+Math.imul(_e,Ze)|0,C=C+Math.imul(_e,sr)|0,_=_+Math.imul(Z,Ye)|0,E=E+Math.imul(Z,ar)|0,E=E+Math.imul(ie,Ye)|0,C=C+Math.imul(ie,ar)|0,_=_+Math.imul(q,Qe)|0,E=E+Math.imul(q,lr)|0,E=E+Math.imul(V,Qe)|0,C=C+Math.imul(V,lr)|0,_=_+Math.imul(B,et)|0,E=E+Math.imul(B,fr)|0,E=E+Math.imul($,et)|0,C=C+Math.imul($,fr)|0;var zs=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(zs>>>26)|0,zs&=67108863,_=Math.imul(Ge,Xe),E=Math.imul(Ge,nr),E=E+Math.imul($t,Xe)|0,C=Math.imul($t,nr),_=_+Math.imul(Te,Ze)|0,E=E+Math.imul(Te,sr)|0,E=E+Math.imul(ht,Ze)|0,C=C+Math.imul(ht,sr)|0,_=_+Math.imul(se,Ye)|0,E=E+Math.imul(se,ar)|0,E=E+Math.imul(_e,Ye)|0,C=C+Math.imul(_e,ar)|0,_=_+Math.imul(Z,Qe)|0,E=E+Math.imul(Z,lr)|0,E=E+Math.imul(ie,Qe)|0,C=C+Math.imul(ie,lr)|0,_=_+Math.imul(q,et)|0,E=E+Math.imul(q,fr)|0,E=E+Math.imul(V,et)|0,C=C+Math.imul(V,fr)|0,_=_+Math.imul(B,tt)|0,E=E+Math.imul(B,hr)|0,E=E+Math.imul($,tt)|0,C=C+Math.imul($,hr)|0;var Js=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Js>>>26)|0,Js&=67108863,_=Math.imul(Je,Xe),E=Math.imul(Je,nr),E=E+Math.imul(Ut,Xe)|0,C=Math.imul(Ut,nr),_=_+Math.imul(Ge,Ze)|0,E=E+Math.imul(Ge,sr)|0,E=E+Math.imul($t,Ze)|0,C=C+Math.imul($t,sr)|0,_=_+Math.imul(Te,Ye)|0,E=E+Math.imul(Te,ar)|0,E=E+Math.imul(ht,Ye)|0,C=C+Math.imul(ht,ar)|0,_=_+Math.imul(se,Qe)|0,E=E+Math.imul(se,lr)|0,E=E+Math.imul(_e,Qe)|0,C=C+Math.imul(_e,lr)|0,_=_+Math.imul(Z,et)|0,E=E+Math.imul(Z,fr)|0,E=E+Math.imul(ie,et)|0,C=C+Math.imul(ie,fr)|0,_=_+Math.imul(q,tt)|0,E=E+Math.imul(q,hr)|0,E=E+Math.imul(V,tt)|0,C=C+Math.imul(V,hr)|0,_=_+Math.imul(B,rt)|0,E=E+Math.imul(B,gr)|0,E=E+Math.imul($,rt)|0,C=C+Math.imul($,gr)|0;var qs=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(qs>>>26)|0,qs&=67108863,_=Math.imul(qe,Xe),E=Math.imul(qe,nr),E=E+Math.imul(jt,Xe)|0,C=Math.imul(jt,nr),_=_+Math.imul(Je,Ze)|0,E=E+Math.imul(Je,sr)|0,E=E+Math.imul(Ut,Ze)|0,C=C+Math.imul(Ut,sr)|0,_=_+Math.imul(Ge,Ye)|0,E=E+Math.imul(Ge,ar)|0,E=E+Math.imul($t,Ye)|0,C=C+Math.imul($t,ar)|0,_=_+Math.imul(Te,Qe)|0,E=E+Math.imul(Te,lr)|0,E=E+Math.imul(ht,Qe)|0,C=C+Math.imul(ht,lr)|0,_=_+Math.imul(se,et)|0,E=E+Math.imul(se,fr)|0,E=E+Math.imul(_e,et)|0,C=C+Math.imul(_e,fr)|0,_=_+Math.imul(Z,tt)|0,E=E+Math.imul(Z,hr)|0,E=E+Math.imul(ie,tt)|0,C=C+Math.imul(ie,hr)|0,_=_+Math.imul(q,rt)|0,E=E+Math.imul(q,gr)|0,E=E+Math.imul(V,rt)|0,C=C+Math.imul(V,gr)|0,_=_+Math.imul(B,nt)|0,E=E+Math.imul(B,Fr)|0,E=E+Math.imul($,nt)|0,C=C+Math.imul($,Fr)|0;var Au=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Au>>>26)|0,Au&=67108863,_=Math.imul(Ve,Xe),E=Math.imul(Ve,nr),E=E+Math.imul(Vt,Xe)|0,C=Math.imul(Vt,nr),_=_+Math.imul(qe,Ze)|0,E=E+Math.imul(qe,sr)|0,E=E+Math.imul(jt,Ze)|0,C=C+Math.imul(jt,sr)|0,_=_+Math.imul(Je,Ye)|0,E=E+Math.imul(Je,ar)|0,E=E+Math.imul(Ut,Ye)|0,C=C+Math.imul(Ut,ar)|0,_=_+Math.imul(Ge,Qe)|0,E=E+Math.imul(Ge,lr)|0,E=E+Math.imul($t,Qe)|0,C=C+Math.imul($t,lr)|0,_=_+Math.imul(Te,et)|0,E=E+Math.imul(Te,fr)|0,E=E+Math.imul(ht,et)|0,C=C+Math.imul(ht,fr)|0,_=_+Math.imul(se,tt)|0,E=E+Math.imul(se,hr)|0,E=E+Math.imul(_e,tt)|0,C=C+Math.imul(_e,hr)|0,_=_+Math.imul(Z,rt)|0,E=E+Math.imul(Z,gr)|0,E=E+Math.imul(ie,rt)|0,C=C+Math.imul(ie,gr)|0,_=_+Math.imul(q,nt)|0,E=E+Math.imul(q,Fr)|0,E=E+Math.imul(V,nt)|0,C=C+Math.imul(V,Fr)|0,_=_+Math.imul(B,ut)|0,E=E+Math.imul(B,Lr)|0,E=E+Math.imul($,ut)|0,C=C+Math.imul($,Lr)|0;var _u=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(_u>>>26)|0,_u&=67108863,_=Math.imul(We,Xe),E=Math.imul(We,nr),E=E+Math.imul(tr,Xe)|0,C=Math.imul(tr,nr),_=_+Math.imul(Ve,Ze)|0,E=E+Math.imul(Ve,sr)|0,E=E+Math.imul(Vt,Ze)|0,C=C+Math.imul(Vt,sr)|0,_=_+Math.imul(qe,Ye)|0,E=E+Math.imul(qe,ar)|0,E=E+Math.imul(jt,Ye)|0,C=C+Math.imul(jt,ar)|0,_=_+Math.imul(Je,Qe)|0,E=E+Math.imul(Je,lr)|0,E=E+Math.imul(Ut,Qe)|0,C=C+Math.imul(Ut,lr)|0,_=_+Math.imul(Ge,et)|0,E=E+Math.imul(Ge,fr)|0,E=E+Math.imul($t,et)|0,C=C+Math.imul($t,fr)|0,_=_+Math.imul(Te,tt)|0,E=E+Math.imul(Te,hr)|0,E=E+Math.imul(ht,tt)|0,C=C+Math.imul(ht,hr)|0,_=_+Math.imul(se,rt)|0,E=E+Math.imul(se,gr)|0,E=E+Math.imul(_e,rt)|0,C=C+Math.imul(_e,gr)|0,_=_+Math.imul(Z,nt)|0,E=E+Math.imul(Z,Fr)|0,E=E+Math.imul(ie,nt)|0,C=C+Math.imul(ie,Fr)|0,_=_+Math.imul(q,ut)|0,E=E+Math.imul(q,Lr)|0,E=E+Math.imul(V,ut)|0,C=C+Math.imul(V,Lr)|0,_=_+Math.imul(B,ft)|0,E=E+Math.imul(B,Hr)|0,E=E+Math.imul($,ft)|0,C=C+Math.imul($,Hr)|0;
vendor: 6,661 bytes, line 405
405var Cu=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Cu>>>26)|0,Cu&=67108863,_=Math.imul(We,Ze),E=Math.imul(We,sr),E=E+Math.imul(tr,Ze)|0,C=Math.imul(tr,sr),_=_+Math.imul(Ve,Ye)|0,E=E+Math.imul(Ve,ar)|0,E=E+Math.imul(Vt,Ye)|0,C=C+Math.imul(Vt,ar)|0,_=_+Math.imul(qe,Qe)|0,E=E+Math.imul(qe,lr)|0,E=E+Math.imul(jt,Qe)|0,C=C+Math.imul(jt,lr)|0,_=_+Math.imul(Je,et)|0,E=E+Math.imul(Je,fr)|0,E=E+Math.imul(Ut,et)|0,C=C+Math.imul(Ut,fr)|0,_=_+Math.imul(Ge,tt)|0,E=E+Math.imul(Ge,hr)|0,E=E+Math.imul($t,tt)|0,C=C+Math.imul($t,hr)|0,_=_+Math.imul(Te,rt)|0,E=E+Math.imul(Te,gr)|0,E=E+Math.imul(ht,rt)|0,C=C+Math.imul(ht,gr)|0,_=_+Math.imul(se,nt)|0,E=E+Math.imul(se,Fr)|0,E=E+Math.imul(_e,nt)|0,C=C+Math.imul(_e,Fr)|0,_=_+Math.imul(Z,ut)|0,E=E+Math.imul(Z,Lr)|0,E=E+Math.imul(ie,ut)|0,C=C+Math.imul(ie,Lr)|0,_=_+Math.imul(q,ft)|0,E=E+Math.imul(q,Hr)|0,E=E+Math.imul(V,ft)|0,C=C+Math.imul(V,Hr)|0;var Su=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Su>>>26)|0,Su&=67108863,_=Math.imul(We,Ye),E=Math.imul(We,ar),E=E+Math.imul(tr,Ye)|0,C=Math.imul(tr,ar),_=_+Math.imul(Ve,Qe)|0,E=E+Math.imul(Ve,lr)|0,E=E+Math.imul(Vt,Qe)|0,C=C+Math.imul(Vt,lr)|0,_=_+Math.imul(qe,et)|0,E=E+Math.imul(qe,fr)|0,E=E+Math.imul(jt,et)|0,C=C+Math.imul(jt,fr)|0,_=_+Math.imul(Je,tt)|0,E=E+Math.imul(Je,hr)|0,E=E+Math.imul(Ut,tt)|0,C=C+Math.imul(Ut,hr)|0,_=_+Math.imul(Ge,rt)|0,E=E+Math.imul(Ge,gr)|0,E=E+Math.imul($t,rt)|0,C=C+Math.imul($t,gr)|0,_=_+Math.imul(Te,nt)|0,E=E+Math.imul(Te,Fr)|0,E=E+Math.imul(ht,nt)|0,C=C+Math.imul(ht,Fr)|0,_=_+Math.imul(se,ut)|0,E=E+Math.imul(se,Lr)|0,E=E+Math.imul(_e,ut)|0,C=C+Math.imul(_e,Lr)|0,_=_+Math.imul(Z,ft)|0,E=E+Math.imul(Z,Hr)|0,E=E+Math.imul(ie,ft)|0,C=C+Math.imul(ie,Hr)|0;var Tu=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Tu>>>26)|0,Tu&=67108863,_=Math.imul(We,Qe),E=Math.imul(We,lr),E=E+Math.imul(tr,Qe)|0,C=Math.imul(tr,lr),_=_+Math.imul(Ve,et)|0,E=E+Math.imul(Ve,fr)|0,E=E+Math.imul(Vt,et)|0,C=C+Math.imul(Vt,fr)|0,_=_+Math.imul(qe,tt)|0,E=E+Math.imul(qe,hr)|0,E=E+Math.imul(jt,tt)|0,C=C+Math.imul(jt,hr)|0,_=_+Math.imul(Je,rt)|0,E=E+Math.imul(Je,gr)|0,E=E+Math.imul(Ut,rt)|0,C=C+Math.imul(Ut,gr)|0,_=_+Math.imul(Ge,nt)|0,E=E+Math.imul(Ge,Fr)|0,E=E+Math.imul($t,nt)|0,C=C+Math.imul($t,Fr)|0,_=_+Math.imul(Te,ut)|0,E=E+Math.imul(Te,Lr)|0,E=E+Math.imul(ht,ut)|0,C=C+Math.imul(ht,Lr)|0,_=_+Math.imul(se,ft)|0,E=E+Math.imul(se,Hr)|0,E=E+Math.imul(_e,ft)|0,C=C+Math.imul(_e,Hr)|0;var Nu=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Nu>>>26)|0,Nu&=67108863,_=Math.imul(We,et),E=Math.imul(We,fr),E=E+Math.imul(tr,et)|0,C=Math.imul(tr,fr),_=_+Math.imul(Ve,tt)|0,E=E+Math.imul(Ve,hr)|0,E=E+Math.imul(Vt,tt)|0,C=C+Math.imul(Vt,hr)|0,_=_+Math.imul(qe,rt)|0,E=E+Math.imul(qe,gr)|0,E=E+Math.imul(jt,rt)|0,C=C+Math.imul(jt,gr)|0,_=_+Math.imul(Je,nt)|0,E=E+Math.imul(Je,Fr)|0,E=E+Math.imul(Ut,nt)|0,C=C+Math.imul(Ut,Fr)|0,_=_+Math.imul(Ge,ut)|0,E=E+Math.imul(Ge,Lr)|0,E=E+Math.imul($t,ut)|0,C=C+Math.imul($t,Lr)|0,_=_+Math.imul(Te,ft)|0,E=E+Math.imul(Te,Hr)|0,E=E+Math.imul(ht,ft)|0,C=C+Math.imul(ht,Hr)|0;var Iu=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Iu>>>26)|0,Iu&=67108863,_=Math.imul(We,tt),E=Math.imul(We,hr),E=E+Math.imul(tr,tt)|0,C=Math.imul(tr,hr),_=_+Math.imul(Ve,rt)|0,E=E+Math.imul(Ve,gr)|0,E=E+Math.imul(Vt,rt)|0,C=C+Math.imul(Vt,gr)|0,_=_+Math.imul(qe,nt)|0,E=E+Math.imul(qe,Fr)|0,E=E+Math.imul(jt,nt)|0,C=C+Math.imul(jt,Fr)|0,_=_+Math.imul(Je,ut)|0,E=E+Math.imul(Je,Lr)|0,E=E+Math.imul(Ut,ut)|0,C=C+Math.imul(Ut,Lr)|0,_=_+Math.imul(Ge,ft)|0,E=E+Math.imul(Ge,Hr)|0,E=E+Math.imul($t,ft)|0,C=C+Math.imul($t,Hr)|0;var xu=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(xu>>>26)|0,xu&=67108863,_=Math.imul(We,rt),E=Math.imul(We,gr),E=E+Math.imul(tr,rt)|0,C=Math.imul(tr,gr),_=_+Math.imul(Ve,nt)|0,E=E+Math.imul(Ve,Fr)|0,E=E+Math.imul(Vt,nt)|0,C=C+Math.imul(Vt,Fr)|0,_=_+Math.imul(qe,ut)|0,E=E+Math.imul(qe,Lr)|0,E=E+Math.imul(jt,ut)|0,C=C+Math.imul(jt,Lr)|0,_=_+Math.imul(Je,ft)|0,E=E+Math.imul(Je,Hr)|0,E=E+Math.imul(Ut,ft)|0,C=C+Math.imul(Ut,Hr)|0;var Ru=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Ru>>>26)|0,Ru&=67108863,_=Math.imul(We,nt),E=Math.imul(We,Fr),E=E+Math.imul(tr,nt)|0,C=Math.imul(tr,Fr),_=_+Math.imul(Ve,ut)|0,E=E+Math.imul(Ve,Lr)|0,E=E+Math.imul(Vt,ut)|0,C=C+Math.imul(Vt,Lr)|0,_=_+Math.imul(qe,ft)|0,E=E+Math.imul(qe,Hr)|0,E=E+Math.imul(jt,ft)|0,C=C+Math.imul(jt,Hr)|0;var Pu=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(Pu>>>26)|0,Pu&=67108863,_=Math.imul(We,ut),E=Math.imul(We,Lr),E=E+Math.imul(tr,ut)|0,C=Math.imul(tr,Lr),_=_+Math.imul(Ve,ft)|0,E=E+Math.imul(Ve,Hr)|0,E=E+Math.imul(Vt,ft)|0,C=C+Math.imul(Vt,Hr)|0;var ku=(I+_|0)+((E&8191)<<13)|0;I=(C+(E>>>13)|0)+(ku>>>26)|0,ku&=67108863,_=Math.imul(We,ft),E=Math.imul(We,Hr),E=E+Math.imul(tr,ft)|0,C=Math.imul(tr,Hr);var Ou=(I+_|0)+((E&8191)<<13)|0;return I=(C+(E>>>13)|0)+(Ou>>>26)|0,Ou&=67108863,T[0]=xr,T[1]=Rr,T[2]=Hs,T[3]=js,T[4]=zs,T[5]=Js,T[6]=qs,T[7]=Au,T[8]=_u,T[9]=Cu,T[10]=Su,T[11]=Tu,T[12]=Nu,T[13]=Iu,T[14]=xu,T[15]=Ru,T[16]=Pu,T[17]=ku,T[18]=Ou,I!==0&&(T[19]=I,p.length++),p};Math.imul||(b=g);function w(N,A,v){v.negative=A.negative^N.negative,v.length=N.length+A.length;for(var p=0,m=0,y=0;y<v.length-1;y++){var T=m;m=0;for(var I=p&67108863,_=Math.min(y,A.length-1),E=Math.max(0,y-N.length+1);E<=_;E++){var C=y-E,S=N.words[C]|0,B=A.words[E]|0,$=S*B,P=$&67108863;T=T+($/67108864|0)|0,P=P+I|0,I=P&67108863,T=T+(P>>>26)|0,m+=T>>>26,T&=67108863}v.words[y]=I,p=T,T=m}return p!==0?v.words[y]=p:v.length--,v.strip()}function x(N,A,v){var p=new k;return p.mulp(N,A,v)}s.prototype.mulTo=function(A,v){var p,m=this.length+A.length;return this.length===10&&A.length===10?p=b(this,A,v):m<63?p=g(this,A,v):m<1024?p=w(this,A,v):p=x(this,A,v),p};function k(N,A){this.x=N,this.y=A}k.prototype.makeRBT=function(A){for(var v=new Array(A),p=s.prototype._countBits(A)-1,m=0;m<A;m++)v[m]=this.revBin(m,p,A);return v},k.prototype.revBin=function(A,v,p){if(A===0||A===p-1)return A;for(var m=0,y=0;y<v;y++)m|=(A&1)<<v-y-1,A>>=1;return m},k.prototype.permute=function(A,v,p,m,y,T){for(var I=0;I<T;I++)m[I]=v[A[I]],y[I]=p[A[I]]},k.prototype.transform=function(A,v,p,m,y,T){this.permute(T,A,v,p,m,y);for(var I=1;I<y;I<<=1)for(var _=I<<1,E=Math.cos(2*Math.PI/_),C=Math.sin(2*Math.PI/_),S=0;S<y;S+=_)for(var B=E,$=C,P=0;P<I;P++){var q=p[S+P],V=m[S+P],X=p[S+P+I],Z=m[S+P+I],ie=B*X-$*Z;Z=B*Z+$*X,X=ie,p[S+P]=q+X,m[S+P]=V+Z,p[S+P+I]=q-X,m[S+P+I]=V-Z,P!==_&&(ie=E*B-C*$,$=E*$+C*B,B=ie)}},k.prototype.guessLen13b=function(A,v){var p=Math.max(v,A)|1,m=p&1,y=0;for(p=p/2|0;p;p=p>>>1)y++;return 1<<y+1+m},k.prototype.conjugate=function(A,v,p){if(!(p<=1))for(var m=0;m<p/2;m++){var y=A[m];A[m]=A[p-m-1],A[p-m-1]=y,y=v[m],v[m]=-v[p-m-1],v[p-m-1]=-y}},k.prototype.normalize13b=function(A,v){for(var p=0,m=0;m<v/2;
vendor: 14,081 bytes, line 405
405m++){var y=Math.round(A[2*m+1]/v)*8192+Math.round(A[2*m]/v)+p;A[m]=y&67108863,y<67108864?p=0:p=y/67108864|0}return A},k.prototype.convert13b=function(A,v,p,m){for(var y=0,T=0;T<v;T++)y=y+(A[T]|0),p[2*T]=y&8191,y=y>>>13,p[2*T+1]=y&8191,y=y>>>13;for(T=2*v;T<m;++T)p[T]=0;n(y===0),n((y&-8192)===0)},k.prototype.stub=function(A){for(var v=new Array(A),p=0;p<A;p++)v[p]=0;return v},k.prototype.mulp=function(A,v,p){var m=2*this.guessLen13b(A.length,v.length),y=this.makeRBT(m),T=this.stub(m),I=new Array(m),_=new Array(m),E=new Array(m),C=new Array(m),S=new Array(m),B=new Array(m),$=p.words;$.length=m,this.convert13b(A.words,A.length,I,m),this.convert13b(v.words,v.length,C,m),this.transform(I,T,_,E,m,y),this.transform(C,T,S,B,m,y);for(var P=0;P<m;P++){var q=_[P]*S[P]-E[P]*B[P];E[P]=_[P]*B[P]+E[P]*S[P],_[P]=q}return this.conjugate(_,E,m),this.transform(_,E,$,T,m,y),this.conjugate($,T,m),this.normalize13b($,m),p.negative=A.negative^v.negative,p.length=A.length+v.length,p.strip()},s.prototype.mul=function(A){var v=new s(null);return v.words=new Array(this.length+A.length),this.mulTo(A,v)},s.prototype.mulf=function(A){var v=new s(null);return v.words=new Array(this.length+A.length),x(this,A,v)},s.prototype.imul=function(A){return this.clone().mulTo(A,this)},s.prototype.imuln=function(A){n(typeof A=="number"),n(A<67108864);for(var v=0,p=0;p<this.length;p++){var m=(this.words[p]|0)*A,y=(m&67108863)+(v&67108863);v>>=26,v+=m/67108864|0,v+=y>>>26,this.words[p]=y&67108863}return v!==0&&(this.words[p]=v,this.length++),this},s.prototype.muln=function(A){return this.clone().imuln(A)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(A){var v=h(A);if(v.length===0)return new s(1);for(var p=this,m=0;m<v.length&&v[m]===0;m++,p=p.sqr());if(++m<v.length)for(var y=p.sqr();m<v.length;m++,y=y.sqr())v[m]!==0&&(p=p.mul(y));return p},s.prototype.iushln=function(A){n(typeof A=="number"&&A>=0);var v=A%26,p=(A-v)/26,m=67108863>>>26-v<<26-v,y;if(v!==0){var T=0;for(y=0;y<this.length;y++){var I=this.words[y]&m,_=(this.words[y]|0)-I<<v;this.words[y]=_|T,T=I>>>26-v}T&&(this.words[y]=T,this.length++)}if(p!==0){for(y=this.length-1;y>=0;y--)this.words[y+p]=this.words[y];for(y=0;y<p;y++)this.words[y]=0;this.length+=p}return this.strip()},s.prototype.ishln=function(A){return n(this.negative===0),this.iushln(A)},s.prototype.iushrn=function(A,v,p){n(typeof A=="number"&&A>=0);var m;v?m=(v-v%26)/26:m=0;var y=A%26,T=Math.min((A-y)/26,this.length),I=67108863^67108863>>>y<<y,_=p;if(m-=T,m=Math.max(0,m),_){for(var E=0;E<T;E++)_.words[E]=this.words[E];_.length=T}if(T!==0)if(this.length>T)for(this.length-=T,E=0;E<this.length;E++)this.words[E]=this.words[E+T];else this.words[0]=0,this.length=1;var C=0;for(E=this.length-1;E>=0&&(C!==0||E>=m);E--){var S=this.words[E]|0;this.words[E]=C<<26-y|S>>>y,C=S&I}return _&&C!==0&&(_.words[_.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(A,v,p){return n(this.negative===0),this.iushrn(A,v,p)},s.prototype.shln=function(A){return this.clone().ishln(A)},s.prototype.ushln=function(A){return this.clone().iushln(A)},s.prototype.shrn=function(A){return this.clone().ishrn(A)},s.prototype.ushrn=function(A){return this.clone().iushrn(A)},s.prototype.testn=function(A){n(typeof A=="number"&&A>=0);var v=A%26,p=(A-v)/26,m=1<<v;if(this.length<=p)return!1;var y=this.words[p];return!!(y&m)},s.prototype.imaskn=function(A){n(typeof A=="number"&&A>=0);var v=A%26,p=(A-v)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(v!==0&&p++,this.length=Math.min(p,this.length),v!==0){var m=67108863^67108863>>>v<<v;this.words[this.length-1]&=m}return this.strip()},s.prototype.maskn=function(A){return this.clone().imaskn(A)},s.prototype.iaddn=function(A){return n(typeof A=="number"),n(A<67108864),A<0?this.isubn(-A):this.negative!==0?this.length===1&&(this.words[0]|0)<A?(this.words[0]=A-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(A),this.negative=1,this):this._iaddn(A)},s.prototype._iaddn=function(A){this.words[0]+=A;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},s.prototype.isubn=function(A){if(n(typeof A=="number"),n(A<67108864),A<0)return this.iaddn(-A);if(this.negative!==0)return this.negative=0,this.iaddn(A),this.negative=1,this;if(this.words[0]-=A,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this.strip()},s.prototype.addn=function(A){return this.clone().iaddn(A)},s.prototype.subn=function(A){return this.clone().isubn(A)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(A,v,p){var m=A.length+p,y;this._expand(m);var T,I=0;for(y=0;y<A.length;y++){T=(this.words[y+p]|0)+I;var _=(A.words[y]|0)*v;T-=_&67108863,I=(T>>26)-(_/67108864|0),this.words[y+p]=T&67108863}for(;y<this.length-p;y++)T=(this.words[y+p]|0)+I,I=T>>26,this.words[y+p]=T&67108863;if(I===0)return this.strip();for(n(I===-1),I=0,y=0;y<this.length;y++)T=-(this.words[y]|0)+I,I=T>>26,this.words[y]=T&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(A,v){var p=this.length-A.length,m=this.clone(),y=A,T=y.words[y.length-1]|0,I=this._countBits(T);p=26-I,p!==0&&(y=y.ushln(p),m.iushln(p),T=y.words[y.length-1]|0);var _=m.length-y.length,E;if(v!=="mod"){E=new s(null),E.length=_+1,E.words=new Array(E.length);for(var C=0;C<E.length;C++)E.words[C]=0}var S=m.clone()._ishlnsubmul(y,1,_);S.negative===0&&(m=S,E&&(E.words[_]=1));for(var B=_-1;B>=0;B--){var $=(m.words[y.length+B]|0)*67108864+(m.words[y.length+B-1]|0);for($=Math.min($/T|0,67108863),m._ishlnsubmul(y,$,B);m.negative!==0;)$--,m.negative=0,m._ishlnsubmul(y,1,B),m.isZero()||(m.negative^=1);E&&(E.words[B]=$)}return E&&E.strip(),m.strip(),v!=="div"&&p!==0&&m.iushrn(p),{div:E||null,mod:m}},s.prototype.divmod=function(A,v,p){if(n(!A.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,y,T;return this.negative!==0&&A.negative===0?(T=this.neg().divmod(A,v),v!=="mod"&&(m=T.div.neg()),v!=="div"&&(y=T.mod.neg(),p&&y.negative!==0&&y.iadd(A)),{div:m,mod:y}):this.negative===0&&A.negative!==0?(T=this.divmod(A.neg(),v),v!=="mod"&&(m=T.div.neg()),{div:m,mod:T.mod}):this.negative&A.negative?(T=this.neg().divmod(A.neg(),v),v!=="div"&&(y=T.mod.neg(),p&&y.negative!==0&&y.isub(A)),{div:T.div,mod:y}):A.length>this.length||this.cmp(A)<0?{div:new s(0),mod:this}:A.length===1?v==="div"?{div:this.divn(A.words[0]),mod:null}:v==="mod"?{div:null,mod:new s(this.modn(A.words[0]))}:{div:this.divn(A.words[0]),mod:new s(this.modn(A.words[0]))}:this._wordDiv(A,v)},s.prototype.div=function(A){return this.divmod(A,"div",!1).div},s.prototype.mod=function(A){return this.divmod(A,"mod",!1).mod},s.prototype.umod=function(A){return this.divmod(A,"mod",!0).mod},s.prototype.divRound=function(A){var v=this.divmod(A);if(v.mod.isZero())return v.div;var p=v.div.negative!==0?v.mod.isub(A):v.mod,m=A.ushrn(1),y=A.andln(1),T=p.cmp(m);return T<0||y===1&&T===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},s.prototype.modn=function(A){n(A<=67108863);for(var v=(1<<26)%A,p=0,m=this.length-1;m>=0;m--)p=(v*p+(this.words[m]|0))%A;return p},s.prototype.idivn=function(A){n(A<=67108863);for(var v=0,p=this.length-1;p>=0;p--){var m=(this.words[p]|0)+v*67108864;this.words[p]=m/A|0,v=m%A}return this.strip()},s.prototype.divn=function(A){return this.clone().idivn(A)},s.prototype.egcd=function(A){n(A.negative===0),n(!A.isZero());var v=this,p=A.clone();v.negative!==0?v=v.umod(A):v=v.clone();for(var m=new s(1),y=new s(0),T=new s(0),I=new s(1),_=0;v.isEven()&&p.isEven();)v.iushrn(1),p.iushrn(1),++_;for(var E=p.clone(),C=v.clone();!v.isZero();){for(var S=0,B=1;!(v.words[0]&B)&&S<26;++S,B<<=1);if(S>0)for(v.iushrn(S);S-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(E),y.isub(C)),m.iushrn(1),y.iushrn(1);for(var $=0,P=1;!(p.words[0]&P)&&$<26;++$,P<<=1);if($>0)for(p.iushrn($);$-- >0;)(T.isOdd()||I.isOdd())&&(T.iadd(E),I.isub(C)),T.iushrn(1),I.iushrn(1);v.cmp(p)>=0?(v.isub(p),m.isub(T),y.isub(I)):(p.isub(v),T.isub(m),I.isub(y))}return{a:T,b:I,gcd:p.iushln(_)}},s.prototype._invmp=function(A){n(A.negative===0),n(!A.isZero());var v=this,p=A.clone();v.negative!==0?v=v.umod(A):v=v.clone();for(var m=new s(1),y=new s(0),T=p.clone();v.cmpn(1)>0&&p.cmpn(1)>0;){for(var I=0,_=1;!(v.words[0]&_)&&I<26;++I,_<<=1);if(I>0)for(v.iushrn(I);I-- >0;)m.isOdd()&&m.iadd(T),m.iushrn(1);for(var E=0,C=1;!(p.words[0]&C)&&E<26;++E,C<<=1);if(E>0)for(p.iushrn(E);E-- >0;)y.isOdd()&&y.iadd(T),y.iushrn(1);v.cmp(p)>=0?(v.isub(p),m.isub(y)):(p.isub(v),y.isub(m))}var S;return v.cmpn(1)===0?S=m:S=y,S.cmpn(0)<0&&S.iadd(A),S},s.prototype.gcd=function(A){if(this.isZero())return A.abs();if(A.isZero())return this.abs();var v=this.clone(),p=A.clone();v.negative=0,p.negative=0;for(var m=0;v.isEven()&&p.isEven();m++)v.iushrn(1),p.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;p.isEven();)p.iushrn(1);var y=v.cmp(p);if(y<0){var T=v;v=p,p=T}else if(y===0||p.cmpn(1)===0)break;v.isub(p)}while(!0);return p.iushln(m)},s.prototype.invm=function(A){return this.egcd(A).a.umod(A)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(A){return this.words[0]&A},s.prototype.bincn=function(A){n(typeof A=="number");var v=A%26,p=(A-v)/26,m=1<<v;if(this.length<=p)return this._expand(p+1),this.words[p]|=m,this;for(var y=m,T=p;y!==0&&T<this.length;T++){var I=this.words[T]|0;I+=y,y=I>>>26,I&=67108863,this.words[T]=I}return y!==0&&(this.words[T]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(A){var v=A<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this.strip();var p;if(this.length>1)p=1;else{v&&(A=-A),n(A<=67108863,"Number is too big");var m=this.words[0]|0;p=m===A?0:m<A?-1:1}return this.negative!==0?-p|0:p},s.prototype.cmp=function(A){if(this.negative!==0&&A.negative===0)return-1;if(this.negative===0&&A.negative!==0)return 1;var v=this.ucmp(A);return this.negative!==0?-v|0:v},s.prototype.ucmp=function(A){if(this.length>A.length)return 1;if(this.length<A.length)return-1;for(var v=0,p=this.length-1;p>=0;p--){var m=this.words[p]|0,y=A.words[p]|0;if(m!==y){m<y?v=-1:m>y&&(v=1);break}}return v},s.prototype.gtn=function(A){return this.cmpn(A)===1},s.prototype.gt=function(A){return this.cmp(A)===1},s.prototype.gten=function(A){return this.cmpn(A)>=0},s.prototype.gte=function(A){return this.cmp(A)>=0},s.prototype.ltn=function(A){return this.cmpn(A)===-1},s.prototype.lt=function(A){return this.cmp(A)===-1},s.prototype.lten=function(A){return this.cmpn(A)<=0},s.prototype.lte=function(A){return this.cmp(A)<=0},s.prototype.eqn=function(A){return this.cmpn(A)===0},s.prototype.eq=function(A){return this.cmp(A)===0},s.red=function(A){return new U(A)},s.prototype.toRed=function(A){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),A.convertTo(this)._forceRed(A)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(A){return this.red=A,this},s.prototype.forceRed=function(A){return n(!this.red,"Already a number in reduction context"),this._forceRed(A)},s.prototype.redAdd=function(A){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,A)},s.prototype.redIAdd=function(A){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,A)},s.prototype.redSub=function(A){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,A)},s.prototype.redISub=function(A){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,A)},s.prototype.redShl=function(A){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,A)},s.prototype.redMul=function(A){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.mul(this,A)},s.prototype.redIMul=function(A){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,A),this.red.imul(this,A)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(A){return n(this.red&&!A.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,A)};var R={k256:null,p224:null,p192:null,p25519:null};function D(N,A){this.name=N,this.p=new s(A,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var A=new s(null);return A.words=new Array(Math.ceil(this.n/13)),A},D.prototype.ireduce=function(A){var v=A,p;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),p=v.bitLength();while(p>this.n);var m=p<this.n?-1:v.ucmp(this.p);return m===0?(v.words[0]=0,v.length=1):m>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},D.prototype.split=function(A,v){A.iushrn(this.n,0,v)},D.prototype.imulK=function(A){return A.imul(this.k)};function O(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(O,D),O.prototype.split=function(A,v){for(var p=4194303,m=Math.min(A.length,9),y=0;y<m;
vendor: 5,458 bytes, line 405
405y++)v.words[y]=A.words[y];if(v.length=m,A.length<=9){A.words[0]=0,A.length=1;return}var T=A.words[9];for(v.words[v.length++]=T&p,y=10;y<A.length;y++){var I=A.words[y]|0;A.words[y-10]=(I&p)<<4|T>>>22,T=I}T>>>=22,A.words[y-10]=T,T===0&&A.length>10?A.length-=10:A.length-=9},O.prototype.imulK=function(A){A.words[A.length]=0,A.words[A.length+1]=0,A.length+=2;for(var v=0,p=0;p<A.length;p++){var m=A.words[p]|0;v+=m*977,A.words[p]=v&67108863,v=m*64+(v/67108864|0)}return A.words[A.length-1]===0&&(A.length--,A.words[A.length-1]===0&&A.length--),A};function M(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(M,D);function F(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(F,D);function H(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(H,D),H.prototype.imulK=function(A){for(var v=0,p=0;p<A.length;p++){var m=(A.words[p]|0)*19+v,y=m&67108863;m>>>=26,A.words[p]=y,v=m}return v!==0&&(A.words[A.length++]=v),A},s._prime=function(A){if(R[A])return R[A];var v;if(A==="k256")v=new O;else if(A==="p224")v=new M;else if(A==="p192")v=new F;else if(A==="p25519")v=new H;else throw new Error("Unknown prime "+A);return R[A]=v,v};function U(N){if(typeof N=="string"){var A=s._prime(N);this.m=A.p,this.prime=A}else n(N.gtn(1),"modulus must be greater than 1"),this.m=N,this.prime=null}U.prototype._verify1=function(A){n(A.negative===0,"red works only with positives"),n(A.red,"red works only with red numbers")},U.prototype._verify2=function(A,v){n((A.negative|v.negative)===0,"red works only with positives"),n(A.red&&A.red===v.red,"red works only with red numbers")},U.prototype.imod=function(A){return this.prime?this.prime.ireduce(A)._forceRed(this):A.umod(this.m)._forceRed(this)},U.prototype.neg=function(A){return A.isZero()?A.clone():this.m.sub(A)._forceRed(this)},U.prototype.add=function(A,v){this._verify2(A,v);var p=A.add(v);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},U.prototype.iadd=function(A,v){this._verify2(A,v);var p=A.iadd(v);return p.cmp(this.m)>=0&&p.isub(this.m),p},U.prototype.sub=function(A,v){this._verify2(A,v);var p=A.sub(v);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},U.prototype.isub=function(A,v){this._verify2(A,v);var p=A.isub(v);return p.cmpn(0)<0&&p.iadd(this.m),p},U.prototype.shl=function(A,v){return this._verify1(A),this.imod(A.ushln(v))},U.prototype.imul=function(A,v){return this._verify2(A,v),this.imod(A.imul(v))},U.prototype.mul=function(A,v){return this._verify2(A,v),this.imod(A.mul(v))},U.prototype.isqr=function(A){return this.imul(A,A.clone())},U.prototype.sqr=function(A){return this.mul(A,A)},U.prototype.sqrt=function(A){if(A.isZero())return A.clone();var v=this.m.andln(3);if(n(v%2===1),v===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(A,p)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);n(!m.isZero());var T=new s(1).toRed(this),I=T.redNeg(),_=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new s(2*E*E).toRed(this);this.pow(E,_).cmp(I)!==0;)E.redIAdd(I);for(var C=this.pow(E,m),S=this.pow(A,m.addn(1).iushrn(1)),B=this.pow(A,m),$=y;B.cmp(T)!==0;){for(var P=B,q=0;P.cmp(T)!==0;q++)P=P.redSqr();n(q<$);var V=this.pow(C,new s(1).iushln($-q-1));S=S.redMul(V),C=V.redSqr(),B=B.redMul(C),$=q}return S},U.prototype.invm=function(A){var v=A._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},U.prototype.pow=function(A,v){if(v.isZero())return new s(1).toRed(this);if(v.cmpn(1)===0)return A.clone();var p=4,m=new Array(1<<p);m[0]=new s(1).toRed(this),m[1]=A;for(var y=2;y<m.length;y++)m[y]=this.mul(m[y-1],A);var T=m[0],I=0,_=0,E=v.bitLength()%26;for(E===0&&(E=26),y=v.length-1;y>=0;y--){for(var C=v.words[y],S=E-1;S>=0;S--){var B=C>>S&1;if(T!==m[0]&&(T=this.sqr(T)),B===0&&I===0){_=0;continue}I<<=1,I|=B,_++,!(_!==p&&(y!==0||S!==0))&&(T=this.mul(T,m[I]),_=0,I=0)}E=26}return T},U.prototype.convertTo=function(A){var v=A.umod(this.m);return v===A?v.clone():v},U.prototype.convertFrom=function(A){var v=A.clone();return v.red=null,v},s.mont=function(A){return new G(A)};function G(N){U.call(this,N),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(G,U),G.prototype.convertTo=function(A){return this.imod(A.ushln(this.shift))},G.prototype.convertFrom=function(A){var v=this.imod(A.mul(this.rinv));return v.red=null,v},G.prototype.imul=function(A,v){if(A.isZero()||v.isZero())return A.words[0]=0,A.length=1,A;var p=A.imul(v),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=p.isub(m).iushrn(this.shift),T=y;return y.cmp(this.m)>=0?T=y.isub(this.m):y.cmpn(0)<0&&(T=y.iadd(this.m)),T._forceRed(this)},G.prototype.mul=function(A,v){if(A.isZero()||v.isZero())return new s(0)._forceRed(this);var p=A.mul(v),m=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=p.isub(m).iushrn(this.shift),T=y;return y.cmp(this.m)>=0?T=y.isub(this.m):y.cmpn(0)<0&&(T=y.iadd(this.m)),T._forceRed(this)},G.prototype.invm=function(A){var v=this.imod(A._invmp(this.m).mul(this.r2));return v._forceRed(this)}})(t,dM)});const n2e="logger/5.2.0";let Y9=!1,Q9=!1;const Fm={debug:1,default:2,info:2,warning:3,error:4,off:5};let eT=Fm.default,Sw=null;
405function i2e(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const tT=i2e();var q6;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(q6||(q6={}));var Gb;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED"})(Gb||(Gb={}));class re{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Fm[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(eT>Fm[n])&&console.log.apply(console,r)}debug(...e){this._log(re.levels.DEBUG,e)}info(...e){this._log(re.levels.INFO,e)}warn(...e){this._log(re.levels.WARNING,e)}makeError(e,r,n){if(Q9)return this.makeError("censored error",r,{});r||(r=re.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(a=>{try{i.push(a+"="+JSON.stringify(n[a]))}catch{i.push(a+"="+JSON.stringify(n[a].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;i.length&&(e+=" ("+i.join(", ")+")");const o=new Error(e);return o.reason=s,o.code=r,Object.keys(n).forEach(function(a){o[a]=n[a]}),o}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,re.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){tT&&this.throwError("platform missing String.prototype.normalize",re.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:tT})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,re.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,re.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",e<r&&this.throwError("missing argument"+n,re.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+n,re.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",re.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",re.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",re.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Sw||(Sw=new re(n2e)),Sw}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",re.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Y9){if(!e)return;this.globalLogger().throwError("error censorship permanent",re.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Q9=!!e,Y9=!!r}static setLogLevel(e){const r=Fm[e.toLowerCase()];if(r==null){re.globalLogger().warn("invalid log level - "+e);return}eT=r}static from(e){return new re(e)}}re.errors=Gb;re.levels=q6;const s2e="bytes/5.2.0",vn=new re(s2e);function hM(t){return!!t.toHexString}function rh(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return rh(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function ig(t){return _t(t)&&!(t.length%2)||yu(t)}function yu(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;
405if(typeof t=="string"||t.length==null)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(typeof r!="number"||r<0||r>=256||r%1)return!1}return!0}function ve(t,e){if(e||(e={}),typeof t=="number"){vn.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),rh(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),hM(t)&&(t=t.toHexString()),_t(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":vn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return rh(new Uint8Array(n))}return yu(t)?rh(new Uint8Array(t)):vn.throwArgumentError("invalid arrayify value","value",t)}function tn(t){const e=t.map(i=>ve(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),rh(n)}function Zl(t){let e=ve(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function np(t,e){t=ve(t),t.length>e&&vn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),rh(r)}function _t(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const Tw="0123456789abcdef";function Ne(t,e){if(e||(e={}),typeof t=="number"){vn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=Tw[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),hM(t))return t.toHexString();if(_t(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":vn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(yu(t)){let r="0x";for(let n=0;n<t.length;n++){let i=t[n];r+=Tw[(i&240)>>4]+Tw[i&15]}return r}return vn.throwArgumentError("invalid hexlify value","value",t)}function lu(t){if(typeof t!="string")t=Ne(t);else if(!_t(t)||t.length%2)return null;return(t.length-2)/2}function ms(t,e,r){return typeof t!="string"?t=Ne(t):(!_t(t)||t.length%2)&&vn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Yl(t){let e="0x";return t.forEach(r=>{e+=Ne(r).substring(2)}),e}function sg(t){const e=pM(Ne(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function pM(t){typeof t!="string"&&(t=Ne(t)),_t(t)||vn.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e<t.length&&t[e]==="0";)e++;return"0x"+t.substring(e)}function cn(t,e){for(typeof t!="string"?t=Ne(t):_t(t)||vn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&vn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Kh(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(ig(t)){const r=ve(t);r.length!==65&&vn.throwArgumentError("invalid signature string; must be 65 bytes","signature",t),e.r=Ne(r.slice(0,32)),e.s=Ne(r.slice(32,64)),e.v=r[64],e.v<27&&(e.v===0||e.v===1?e.v+=27:vn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Ne(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=np(ve(e._vs),32);e._vs=Ne(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&vn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=Ne(i);e.s==null?e.s=o:e.s!==o&&vn.throwArgumentError("signature v mismatch _vs","signature",t)}e.recoveryParam==null?e.v==null?vn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2:e.v==null?e.v=27+e.recoveryParam:e.recoveryParam!==1-e.v%2&&vn.throwArgumentError("signature recoveryParam mismatch v","signature",t),e.r==null||!_t(e.r)?vn.throwArgumentError("signature missing or invalid r","signature",t):e.r=cn(e.r,32),e.s==null||!_t(e.s)?vn.throwArgumentError("signature missing or invalid s","signature",t):e.s=cn(e.s,32);const r=ve(e.s);r[0]>=128&&vn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Ne(r);e._vs&&(_t(e._vs)||vn.throwArgumentError("signature invalid _vs","signature",t),e._vs=cn(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&vn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e}function G6(t){return t=Kh(t),Ne(tn([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const gM="bignumber/5.2.0";var h1=yt.BN;const da=new re(gM),Nw={},rT=9007199254740991;function o2e(t){return t!=null&&(Ie.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||_t(t)||typeof t=="bigint"||yu(t))}let nT=!1;class Ie{constructor(e,r){da.checkNew(new.target,Ie),e!==Nw&&da.throwError("cannot call constructor directly; use BigNumber.from",re.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Qi(qt(this).fromTwos(e))}toTwos(e){return Qi(qt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Ie.from(this._hex.substring(1)):this}add(e){return Qi(qt(this).add(qt(e)))}sub(e){return Qi(qt(this).sub(qt(e)))}div(e){return Ie.from(e).isZero()&&Zs("division by zero","div"),Qi(qt(this).div(qt(e)))}mul(e){return Qi(qt(this).mul(qt(e)))}mod(e){const r=qt(e);return r.isNeg()&&Zs("cannot modulo negative values","mod"),Qi(qt(this).umod(r))}pow(e){const r=qt(e);return r.isNeg()&&Zs("cannot raise to negative values","pow"),Qi(qt(this).pow(r))}and(e){const r=qt(e);return(this.isNegative()||r.isNeg())&&Zs("cannot 'and' negative values","and"),Qi(qt(this).and(r))}or(e){const r=qt(e);return(this.isNegative()||r.isNeg())&&Zs("cannot 'or' negative values","or"),Qi(qt(this).or(r))}xor(e){const r=qt(e);return(this.isNegative()||r.isNeg())&&Zs("cannot 'xor' negative values","xor"),Qi(qt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Zs("cannot mask negative values","mask"),Qi(qt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Zs("cannot shift negative values","shl"),Qi(qt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Zs("cannot shift negative values","shr"),Qi(qt(this).shrn(e))}eq(e){return qt(this).eq(qt(e))}lt(e){return qt(this).lt(qt(e))}lte(e){return qt(this).lte(qt(e))}gt(e){return qt(this).gt(qt(e))}gte(e){return qt(this).gte(qt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return qt(this).isZero()}toNumber(){try{return qt(this).toNumber()}catch{Zs("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return da.throwError("this platform does not support BigInt",re.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?nT||(nT=!0,da.warn("BigNumber.toString does not accept any parameters;
405 base-10 is assumed")):arguments[0]===16?da.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",re.errors.UNEXPECTED_ARGUMENT,{}):da.throwError("BigNumber.toString does not accept parameters",re.errors.UNEXPECTED_ARGUMENT,{})),qt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Ie)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Ie(Nw,p1(e)):e.match(/^-?[0-9]+$/)?new Ie(Nw,p1(new h1(e))):da.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Zs("underflow","BigNumber.from",e),(e>=rT||e<=-rT)&&Zs("overflow","BigNumber.from",e),Ie.from(String(e));const r=e;if(typeof r=="bigint")return Ie.from(r.toString());if(yu(r))return Ie.from(Ne(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Ie.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(_t(n)||n[0]==="-"&&_t(n.substring(1))))return Ie.from(n)}return da.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function p1(t){if(typeof t!="string")return p1(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&da.throwArgumentError("invalid hex","value",t),t=p1(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Qi(t){return Ie.from(p1(t))}function qt(t){const e=Ie.from(t).toHexString();return e[0]==="-"?new h1("-"+e.substring(3),16):new h1(e.substring(2),16)}function Zs(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),da.throwError(t,re.errors.NUMERIC_FAULT,n)}function a2e(t){return new h1(t,36).toString(16)}function c2e(t){return new h1(t,16).toString(36)}const Ii=new re(gM),ip={},mM=Ie.from(0),bM=Ie.from(-1);function yM(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Ii.throwError(t,re.errors.NUMERIC_FAULT,i)}let sp="0";for(;sp.length<256;)sp+=sp;function XE(t){if(typeof t!="number")try{t=Ie.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+sp.substring(0,t):Ii.throwArgumentError("invalid decimal size","decimals",t)}function $m(t,e){e==null&&(e=0);const r=XE(e);t=Ie.from(t);const n=t.lt(mM);n&&(t=t.mul(bM));let i=t.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=t.div(r).toString();return r.length===1?t=s:t=s+"."+i,n&&(t="-"+t),t}function aa(t,e){e==null&&(e=0);const r=XE(e);(typeof t!="string"||!t.match(/^-?[0-9.,]+$/))&&Ii.throwArgumentError("invalid decimal value","value",t);const n=t.substring(0,1)==="-";n&&(t=t.substring(1)),t==="."&&Ii.throwArgumentError("missing value","value",t);const i=t.split(".");i.length>2&&Ii.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0"),o.replace(/^([0-9]*?)(0*)$/,(f,d,h)=>d).length>r.length-1&&yM("fractional component exceeds decimals","underflow","parseFixed");o.length<r.length-1;)o+="0";const a=Ie.from(s),c=Ie.from(o);let l=a.mul(r).add(c);return n&&(l=l.mul(bM)),l}class nh{constructor(e,r,n,i){e!==ip&&Ii.throwError("cannot use FixedFormat constructor; use FixedFormat.from",re.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=XE(i),Object.freeze(this)}static from(e){if(e instanceof nh)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,n=128,i=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);s||Ii.throwArgumentError("invalid fixed format","format",e),r=s[1]!=="u",n=parseInt(s[2]),i=parseInt(s[3])}}else if(e){const s=(o,a,c)=>e[o]==null?c:(typeof e[o]!==a&&Ii.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Ii.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Ii.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new nh(ip,r,n,i)}}class Un{constructor(e,r,n,i){Ii.checkNew(new.target,Un),e!==ip&&Ii.throwError("cannot use FixedNumber constructor; use FixedNumber.from",re.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Ii.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=aa(this._value,this.format.decimals),n=aa(e._value,e.format.decimals);return Un.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=aa(this._value,this.format.decimals),n=aa(e._value,e.format.decimals);return Un.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=aa(this._value,this.format.decimals),n=aa(e._value,e.format.decimals);return Un.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=aa(this._value,this.format.decimals),n=aa(e._value,e.format.decimals);return Un.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Un.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(iT)),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=Un.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(iT)),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Ii.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=Un.from("1"+sp.substring(0,e));return this.mulUnsafe(n).addUnsafe(l2e).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Ii.throwArgumentError("invalid byte width","width",e);const r=Ie.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return cn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Un.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!o2e(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),Un.fromString($m(e,r),nh.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=nh.from(r),i=aa(e,n.decimals);!n.signed&&i.lt(mM)&&yM("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=cn(s,n.width/8));const o=$m(i,n.decimals);return new Un(ip,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=nh.from(r);
405if(ve(e).length>n.width/8)throw new Error("overflow");let i=Ie.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=$m(i,n.decimals);return new Un(ip,s,o,n)}static from(e,r){if(typeof e=="string")return Un.fromString(e,r);if(yu(e))return Un.fromBytes(e,r);try{return Un.fromValue(e,0,r)}catch(n){if(n.code!==re.errors.INVALID_ARGUMENT)throw n}return Ii.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const iT=Un.from(1),l2e=Un.from("0.5"),u2e="properties/5.2.0";var f2e=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Vb=new re(u2e);function ae(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Yn(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function En(t){return f2e(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function ZE(t,e){(!t||typeof t!="object")&&Vb.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Vb.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function wn(t){const e={};for(const r in t)e[r]=t[r];return e}const d2e={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function vM(t){if(t==null||d2e[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;r<e.length;r++)if(!vM(t[e[r]]))return!1;return!0}return Vb.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function h2e(t){if(vM(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>Ji(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ae(e,r,Ji(n))}return e}return Vb.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Ji(t){return h2e(t)}class Xh{constructor(e){for(const r in e)this[r]=Ji(e[r])}}const og="abi/5.2.0",Yt=new re(og),jf={};let sT={calldata:!0,memory:!0,storage:!0},p2e={calldata:!0,memory:!0};function im(t,e){if(t==="bytes"||t==="string"){if(sT[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&p2e[e])return!0;return(sT[e]||e==="payable")&&Yt.throwArgumentError("invalid modifier","name",e),!1}function g2e(t,e){let r=t;function n(a){Yt.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;a<t.length;a++){let c=t[a];switch(c){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||n(a),o.state.allowType=!1,o.type=xd(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(e||n(a),o.indexed=!0,o.name=""),im(o.type,o.name)&&(o.name=""),o.type=xd(o.type);let l=o;o=o.parent,o||n(a),delete l.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(e||n(a),o.indexed=!0,o.name=""),im(o.type,o.name)&&(o.name=""),o.type=xd(o.type);let u=i(o.parent);o.parent.components.push(u),delete o.parent,o=u;break;case" ":o.state.allowType&&o.type!==""&&(o.type=xd(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(e||n(a),o.indexed&&n(a),o.indexed=!0,o.name=""):im(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(a),o.type+=c,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(a),o.type+=c,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=c,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=c,delete o.state.allowArray):o.state.readArray?o.type+=c:n(a)}}return o.parent&&Yt.throwArgumentError("unexpected eof","param",t),delete s.state,o.name==="indexed"?(e||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):im(o.type,o.name)&&(o.name=""),s.type=xd(s.type),s}function Lm(t,e){for(let r in e)ae(t,r,e[r])}const yr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),m2e=new RegExp(/^(.*)\[([0-9]*)\]$/);class Jn{constructor(e,r){e!==jf&&Yt.throwError("use fromString",re.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Lm(this,r);let n=this.type.match(m2e);n?Lm(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Jn.fromObject({type:n[1],components:this.components}),baseType:"array"}):Lm(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.t
405ype}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=yr.sighash),yr[e]||Yt.throwArgumentError("invalid format type","format",e),e===yr.json){let n={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==yr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===yr.full?", ":",")+")"):r+=this.type,e!==yr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===yr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Jn.fromString(e,r):Jn.fromObject(e)}static fromObject(e){return Jn.isParamType(e)?e:new Jn(jf,{name:e.name||null,type:xd(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Jn.fromObject):null})}static fromString(e,r){function n(i){return Jn.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(g2e(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function g1(t,e){return y2e(t).map(r=>Jn.fromString(r,e))}class Na{constructor(e,r){e!==jf&&Yt.throwError("use a static from method",re.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Lm(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Na.isFragment(e)?e:typeof e=="string"?Na.fromString(e):Na.fromObject(e)}static fromObject(e){if(Na.isFragment(e))return e;switch(e.type){case"function":return Fo.fromObject(e);case"event":return Ea.fromObject(e);case"constructor":return Aa.fromObject(e);case"error":return Rc.fromObject(e);case"fallback":case"receive":return null}return Yt.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Ea.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Fo.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Aa.fromString(e.trim()):e.split(" ")[0]==="error"?Rc.fromString(e.substring(5).trim()):Yt.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Ea extends Na{format(e){if(e||(e=yr.sighash),yr[e]||Yt.throwArgumentError("invalid format type","format",e),e===yr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==yr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===yr.full?", ":",")+") ",e!==yr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Ea.fromString(e):Ea.fromObject(e)}static fromObject(e){if(Ea.isEventFragment(e))return e;e.type!=="event"&&Yt.throwArgumentError("invalid event object","value",e);const r={name:m1(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Jn.fromObject):[],type:"event"};return new Ea(jf,r)}static fromString(e){let r=e.match(b1);r||Yt.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Yt.warn("unknown modifier: "+i)}}),Ea.fromObject({name:r[1].trim(),anonymous:n,inputs:g1(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function wM(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Yt.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Yt.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=Ie.from(r[1]),r[0]):t}function EM(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function AM(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Yt.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Yt.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Yt.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Yt.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Yt.throwArgumentError("unable to determine stateMutability","value",t),e}class Aa extends Na{format(e){if(e||(e=yr.sighash),yr[e]||Yt.throwArgumentError("invalid format type","format",e),e===yr.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===yr.sighash&&Yt.throwError("cannot format a constructor for sighash",re.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===yr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Aa.fromString(e):Aa.fromObject(e)}static fromObject(e){if(Aa.isConstructorFragment(e))return e;e.type!=="constructor"&&Yt.throwArgumentError("invalid constructor object","value",e);let r=AM(e);r.constant&&Yt.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Jn.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Ie.from(e.gas):null};return new Aa(jf,n)}static fromString(e){let r={type:"constructor"};e=wM(e,r);let n=e.match(b1);return(!n||n[1].trim()!=="constructor")&&Yt.throwArgumentError("invalid constructor string","value",e),r.inputs=g1(n[2].trim(),!1),EM(n[3].trim(),r),Aa.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}
405class Fo extends Aa{format(e){if(e||(e=yr.sighash),yr[e]||Yt.throwArgumentError("invalid format type","format",e),e===yr.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?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==yr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===yr.full?", ":",")+") ",e!==yr.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Fo.fromString(e):Fo.fromObject(e)}static fromObject(e){if(Fo.isFunctionFragment(e))return e;e.type!=="function"&&Yt.throwArgumentError("invalid function object","value",e);let r=AM(e);const n={type:e.type,name:m1(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Jn.fromObject):[],outputs:e.outputs?e.outputs.map(Jn.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Ie.from(e.gas):null};return new Fo(jf,n)}static fromString(e){let r={type:"function"};e=wM(e,r);let n=e.split(" returns ");n.length>2&&Yt.throwArgumentError("invalid function string","value",e);let i=n[0].match(b1);if(i||Yt.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&m1(r.name),r.inputs=g1(i[2],!1),EM(i[3].trim(),r),n.length>1){let s=n[1].match(b1);(s[1].trim()!=""||s[3].trim()!="")&&Yt.throwArgumentError("unexpected tokens","value",e),r.outputs=g1(s[2],!1)}else r.outputs=[];return Fo.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function oT(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Yt.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class Rc extends Na{format(e){if(e||(e=yr.sighash),yr[e]||Yt.throwArgumentError("invalid format type","format",e),e===yr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==yr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===yr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Rc.fromString(e):Rc.fromObject(e)}static fromObject(e){if(Rc.isErrorFragment(e))return e;e.type!=="error"&&Yt.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:m1(e.name),inputs:e.inputs?e.inputs.map(Jn.fromObject):[]};return oT(new Rc(jf,r))}static fromString(e){let r={type:"error"},n=e.match(b1);return n||Yt.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&m1(r.name),r.inputs=g1(n[2],!1),oT(Rc.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function xd(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const b2e=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m1(t){return(!t||!t.match(b2e))&&Yt.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const b1=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function y2e(t){t=t.trim();let e=[],r="",n=0;for(let i=0;i<t.length;i++){let s=t[i];s===","&&n===0?(e.push(r),r=""):(r+=s,s==="("?n++:s===")"&&(n--,n===-1&&Yt.throwArgumentError("unbalanced parenthesis","value",t)))}return r&&e.push(r),e}const YE=new re(og);function _M(t){const e=[],r=function(n,i){if(Array.isArray(i))for(let s in i){const o=n.slice();o.push(s);try{r(o,i[s])}catch(a){e.push({path:o,error:a})}}};return r([],t),e}class rl{constructor(e,r,n,i){this.name=e,this.type=r,this.localName=n,this.dynamic=i}_throwError(e,r){YE.throwArgumentError(e,this.localName,r)}}class V6{constructor(e){ae(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Yl(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(tn(e._data))}writeBytes(e){let r=ve(e);const n=r.length%this.wordSize;
405return n&&(r=tn([r,this._padding.slice(n)])),this._writeData(r)}_getValue(e){let r=ve(Ie.from(e));return r.length>this.wordSize&&YE.throwError("value out-of-bounds",re.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=tn([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class Wb{constructor(e,r,n,i){ae(this,"_data",ve(e)),ae(this,"wordSize",r||32),ae(this,"_coerceFunc",n),ae(this,"allowLoose",i),this._offset=0}get data(){return Ne(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):Wb.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:YE.throwError("data out-of-bounds",re.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new Wb(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return Ie.from(this.readBytes(this.wordSize))}}var v2e=ed(function(t){(function(){var e=typeof window=="object"?window:{},r=!e.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;r&&(e=dM);for(var n=!e.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,i="0123456789abcdef".split(""),s=[31,7936,2031616,520093696],o=[1,256,65536,16777216],a=[6,1536,393216,100663296],c=[0,8,16,24],l=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],u=[224,256,384,512],f=[128,256],d=["hex","buffer","arrayBuffer","array"],h=function(N,A,v){return function(p){return new U(N,A,N).update(p)[v]()}},g=function(N,A,v){return function(p,m){return new U(N,A,m).update(p)[v]()}},b=function(N,A){var v=h(N,A,"hex");v.create=function(){return new U(N,A,N)},v.update=function(y){return v.create().update(y)};for(var p=0;p<d.length;++p){var m=d[p];v[m]=h(N,A,m)}return v},w=function(N,A){var v=g(N,A,"hex");v.create=function(y){return new U(N,A,y)},v.update=function(y,T){return v.create(T).update(y)};for(var p=0;p<d.length;++p){var m=d[p];v[m]=g(N,A,m)}return v},x=[{name:"keccak",padding:o,bits:u,createMethod:b},{name:"sha3",padding:a,bits:u,createMethod:b},{name:"shake",padding:s,bits:f,createMethod:w}],k={},R=[],D=0;D<x.length;++D)for(var O=x[D],M=O.bits,F=0;F<M.length;++F){var H=O.name+"_"+M[F];R.push(H),k[H]=O.createMethod(M[F],O.padding)}function U(N,A,v){this.blocks=[],this.s=[],this.padding=A,this.outputBits=v,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(N<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=v>>5,this.extraBytes=(v&31)>>3;for(var p=0;p<50;++p)this.s[p]=0}U.prototype.update=function(N){var A=typeof N!="string";A&&N.constructor===ArrayBuffer&&(N=new Uint8Array(N));for(var v=N.length,p=this.blocks,m=this.byteCount,y=this.blockCount,T=0,I=this.s,_,E;T<v;){if(this.reset)for(this.reset=!1,p[0]=this.block,_=1;_<y+1;++_)p[_]=0;if(A)for(_=this.start;T<v&&_<m;++T)p[_>>2]|=N[T]<<c[_++&3];else for(_=this.start;T<v&&_<m;++T)E=N.charCodeAt(T),E<128?p[_>>2]|=E<<c[_++&3]:E<2048?(p[_>>2]|=(192|E>>6)<<c[_++&3],p[_>>2]|=(128|E&63)<<c[_++&3]):E<55296||E>=57344?(p[_>>2]|=(224|E>>12)<<c[_++&3],p[_>>2]|=(128|E>>6&63)<<c[_++&3],p[_>>2]|=(128|E&63)<<c[_++&3]):(E=65536+((E&1023)<<10|N.charCodeAt(++T)&1023),p[_>>2]|=(240|E>>18)<<c[_++&3],p[_>>2]|=(128|E>>12&63)<<c[_++&3],p[_>>2]|=(128|E>>6&63)<<c[_++&3],p[_>>2]|=(128|E&63)<<c[_++&3]);if(this.lastByteIndex=_,_>=m){for(this.start=_-m,this.block=p[y],_=0;_<y;++_)I[_]^=p[_];G(I),this.reset=!0}else this.start=_}return this},U.prototype.finalize=function(){var N=this.blocks,A=this.lastByteIndex,v=this.blockCount,p=this.s;if(N[A>>2]|=this.padding[A&3],this.lastByteIndex===this.byteCount)for(N[0]=N[v],A=1;A<v+1;++A)N[A]=0;for(N[v-1]|=2147483648,A=0;A<v;++A)p[A]^=N[A];G(p)},U.prototype.toString=U.prototype.hex=function(){this.finalize();for(var N=this.blockCount,A=this.s,v=this.outputBlocks,p=this.extraBytes,m=0,y=0,T="",I;y<v;){for(m=0;m<N&&y<v;++m,++y)I=A[m],T+=i[I>>4&15]+i[I&15]+i[I>>12&15]+i[I>>8&15]+i[I>>20&15]+i[I>>16&15]+i[I>>28&15]+i[I>>
40524&15];y%N===0&&(G(A),m=0)}return p&&(I=A[m],p>0&&(T+=i[I>>4&15]+i[I&15]),p>1&&(T+=i[I>>12&15]+i[I>>8&15]),p>2&&(T+=i[I>>20&15]+i[I>>16&15])),T},U.prototype.arrayBuffer=function(){this.finalize();var N=this.blockCount,A=this.s,v=this.outputBlocks,p=this.extraBytes,m=0,y=0,T=this.outputBits>>3,I;p?I=new ArrayBuffer(v+1<<2):I=new ArrayBuffer(T);for(var _=new Uint32Array(I);y<v;){for(m=0;m<N&&y<v;++m,++y)_[y]=A[m];y%N===0&&G(A)}return p&&(_[m]=A[m],I=I.slice(0,T)),I},U.prototype.buffer=U.prototype.arrayBuffer,U.prototype.digest=U.prototype.array=function(){this.finalize();for(var N=this.blockCount,A=this.s,v=this.outputBlocks,p=this.extraBytes,m=0,y=0,T=[],I,_;y<v;){for(m=0;m<N&&y<v;++m,++y)I=y<<2,_=A[m],T[I]=_&255,T[I+1]=_>>8&255,T[I+2]=_>>16&255,T[I+3]=_>>24&255;y%N===0&&G(A)}return p&&(I=y<<2,_=A[m],p>0&&(T[I]=_&255),p>1&&(T[I+1]=_>>8&255),p>2&&(T[I+2]=_>>16&255)),T};var G=function(N){var A,v,p,m,y,T,I,_,E,C,S,B,$,P,q,V,X,Z,ie,ce,se,_e,ye,Te,ht,Ot,Ge,$t,Lt,Je,Ut,Ht,qe,jt,zt,Ve,Vt,Wt,We,tr,rr,Xe,nr,ir,Ze,sr,or,Ye,ar,cr,Qe,lr,ur,et,fr,dr,tt,hr,pr,rt,gr,mr,nt;for(p=0;p<48;p+=2)m=N[0]^N[10]^N[20]^N[30]^N[40],y=N[1]^N[11]^N[21]^N[31]^N[41],T=N[2]^N[12]^N[22]^N[32]^N[42],I=N[3]^N[13]^N[23]^N[33]^N[43],_=N[4]^N[14]^N[24]^N[34]^N[44],E=N[5]^N[15]^N[25]^N[35]^N[45],C=N[6]^N[16]^N[26]^N[36]^N[46],S=N[7]^N[17]^N[27]^N[37]^N[47],B=N[8]^N[18]^N[28]^N[38]^N[48],$=N[9]^N[19]^N[29]^N[39]^N[49],A=B^(T<<1|I>>>31),v=$^(I<<1|T>>>31),N[0]^=A,N[1]^=v,N[10]^=A,N[11]^=v,N[20]^=A,N[21]^=v,N[30]^=A,N[31]^=v,N[40]^=A,N[41]^=v,A=m^(_<<1|E>>>31),v=y^(E<<1|_>>>31),N[2]^=A,N[3]^=v,N[12]^=A,N[13]^=v,N[22]^=A,N[23]^=v,N[32]^=A,N[33]^=v,N[42]^=A,N[43]^=v,A=T^(C<<1|S>>>31),v=I^(S<<1|C>>>31),N[4]^=A,N[5]^=v,N[14]^=A,N[15]^=v,N[24]^=A,N[25]^=v,N[34]^=A,N[35]^=v,N[44]^=A,N[45]^=v,A=_^(B<<1|$>>>31),v=E^($<<1|B>>>31),N[6]^=A,N[7]^=v,N[16]^=A,N[17]^=v,N[26]^=A,N[27]^=v,N[36]^=A,N[37]^=v,N[46]^=A,N[47]^=v,A=C^(m<<1|y>>>31),v=S^(y<<1|m>>>31),N[8]^=A,N[9]^=v,N[18]^=A,N[19]^=v,N[28]^=A,N[29]^=v,N[38]^=A,N[39]^=v,N[48]^=A,N[49]^=v,P=N[0],q=N[1],sr=N[11]<<4|N[10]>>>28,or=N[10]<<4|N[11]>>>28,$t=N[20]<<3|N[21]>>>29,Lt=N[21]<<3|N[20]>>>29,rt=N[31]<<9|N[30]>>>23,gr=N[30]<<9|N[31]>>>23,Xe=N[40]<<18|N[41]>>>14,nr=N[41]<<18|N[40]>>>14,jt=N[2]<<1|N[3]>>>31,zt=N[3]<<1|N[2]>>>31,V=N[13]<<12|N[12]>>>20,X=N[12]<<12|N[13]>>>20,Ye=N[22]<<10|N[23]>>>22,ar=N[23]<<10|N[22]>>>22,Je=N[33]<<13|N[32]>>>19,Ut=N[32]<<13|N[33]>>>19,mr=N[42]<<2|N[43]>>>30,nt=N[43]<<2|N[42]>>>30,et=N[5]<<30|N[4]>>>2,fr=N[4]<<30|N[5]>>>2,Ve=N[14]<<6|N[15]>>>26,Vt=N[15]<<6|N[14]>>>26,Z=N[25]<<11|N[24]>>>21,ie=N[24]<<11|N[25]>>>21,cr=N[34]<<15|N[35]>>>17,Qe=N[35]<<15|N[34]>>>17,Ht=N[45]<<29|N[44]>>>3,qe=N[44]<<29|N[45]>>>3,Te=N[6]<<28|N[7]>>>4,ht=N[7]<<28|N[6]>>>4,dr=N[17]<<23|N[16]>>>9,tt=N[16]<<23|N[17]>>>9,Wt=N[26]<<25|N[27]>>>7,We=N[27]<<25|N[26]>>>7,ce=N[36]<<21|N[37]>>>11,se=N[37]<<21|N[36]>>>11,lr=N[47]<<24|N[46]>>>8,ur=N[46]<<24|N[47]>>>8,ir=N[8]<<27|N[9]>>>5,Ze=N[9]<<27|N[8]>>>5,Ot=N[18]<<20|N[19]>>>12,Ge=N[19]<<20|N[18]>>>12,hr=N[29]<<7|N[28]>>>25,pr=N[28]<<7|N[29]>>>25,tr=N[38]<<8|N[39]>>>24,rr=N[39]<<8|N[38]>>>24,_e=N[48]<<14|N[49]>>>18,ye=N[49]<<14|N[48]>>>18,N[0]=P^~V&Z,N[1]=q^~X&ie,N[10]=Te^~Ot&$t,N[11]=ht^~Ge&Lt,N[20]=jt^~Ve&Wt,N[21]=zt^~Vt&We,N[30]=ir^~sr&Ye,N[31]=Ze^~or&ar,N[40]=et^~dr&hr,N[41]=fr^~tt&pr,N[2]=V^~Z&ce,N[3]=X^~ie&se,N[12]=Ot^~$t&Je,N[13]=Ge^~Lt&Ut,N[22]=Ve^~Wt&tr,N[23]=Vt^~We&rr,N[32]=sr^~Ye&cr,N[33]=or^~ar&Qe,N[42]=dr^~hr&rt,N[43]=tt^~pr&gr,N[4]=Z^~ce&_e,N[5]=ie^~se&ye,N[14]=$t^~Je&Ht,N[15]=Lt^~Ut&qe,N[24]=Wt^~tr&Xe,N[25]=We^~rr&nr,N[34]=Ye^~cr&lr,N[35]=ar^~Qe&ur,N[44]=hr^~rt&mr,N[45]=pr^~gr&nt,N[6]=ce^~_e&P,N[7]=se^~ye&q,N[16]=Je^~Ht&Te,N[17]=Ut^~qe&ht,N[26]=tr^~Xe&jt,N[27]=rr^~nr&zt,N[36]=cr^~lr&ir,N[37]=Qe^~ur&Ze,N[46]=rt^~mr&et,N[47]=gr^~nt&fr,N[8]=_e^~P&V,N[9]=ye^~q&X,N[18]=Ht^~Te&Ot,N[19]=qe^~ht&Ge,N[28]=Xe^~jt&Ve,N[29]=nr^~zt&Vt,N[38]=lr^~ir&sr,N[39]=ur^~Ze&or,N[48]=mr^~et&dr,N[49]=nt^~fr&tt,N[0]^=l[p],N[1]^=l[p+1]};if(n)t.exports=k;else for(var D=0;D<R.length;++D)e[R[D]]=k[R[D]]})()});function Wr(t){return"0x"+v2e.keccak_256(ve(t))}const w2e="rlp/5.2.0",pa=new re(w2e);function aT(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function cT(t,e,r){let n=0;for(let i=0;i<r;i++)n=n*256+t[e+i];return n}function CM(t){if(Array.isArray(t)){let n=[];
405if(t.forEach(function(s){n=n.concat(CM(s))}),n.length<=55)return n.unshift(192+n.length),n;const i=aT(n.length);return i.unshift(247+i.length),i.concat(n)}ig(t)||pa.throwArgumentError("RLP object must be BytesLike","object",t);const e=Array.prototype.slice.call(ve(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const r=aT(e.length);return r.unshift(183+r.length),r.concat(e)}function kh(t){return Ne(CM(t))}function lT(t,e,r,n){const i=[];for(;r<e+1+n;){const s=SM(t,r);i.push(s.result),r+=s.consumed,r>e+1+n&&pa.throwError("child data too short",re.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function SM(t,e){if(t.length===0&&pa.throwError("data too short",re.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&pa.throwError("data short segment too short",re.errors.BUFFER_OVERRUN,{});const n=cT(t,e+1,r);return e+1+r+n>t.length&&pa.throwError("data long segment too short",re.errors.BUFFER_OVERRUN,{}),lT(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&pa.throwError("data array too short",re.errors.BUFFER_OVERRUN,{}),lT(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&pa.throwError("data array too short",re.errors.BUFFER_OVERRUN,{});const n=cT(t,e+1,r);e+1+r+n>t.length&&pa.throwError("data array too short",re.errors.BUFFER_OVERRUN,{});const i=Ne(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&pa.throwError("data too short",re.errors.BUFFER_OVERRUN,{});const n=Ne(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Ne(t[e])}}function QE(t){const e=ve(t),r=SM(e,0);return r.consumed!==e.length&&pa.throwArgumentError("invalid rlp data","data",t),r.result}var E2e=Object.freeze({__proto__:null,encode:kh,decode:QE});const A2e="address/5.2.0",Hl=new re(A2e);function uT(t){_t(t,20)||Hl.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=ve(Wr(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const _2e=9007199254740991;function C2e(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const e8={};for(let t=0;t<10;t++)e8[String(t)]=String(t);for(let t=0;t<26;t++)e8[String.fromCharCode(65+t)]=String(10+t);const fT=Math.floor(C2e(_2e));function TM(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>e8[n]).join("");for(;e.length>=fT;){let n=e.substring(0,fT);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Jr(t){let e=null;if(typeof t!="string"&&Hl.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=uT(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Hl.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==TM(t)&&Hl.throwArgumentError("bad icap checksum","address",t),e=a2e(t.substring(4));e.length<40;)e="0"+e;e=uT("0x"+e)}else Hl.throwArgumentError("invalid address","address",t);return e}function S2e(t){try{return Jr(t),!0}catch{}return!1}function T2e(t){let e=c2e(Jr(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+TM("XE00"+e)+e}function i2(t){let e=null;try{e=Jr(t.from)}catch{Hl.throwArgumentError("missing from address","transaction",t)}const r=Zl(ve(Ie.from(t.nonce).toHexString()));return Jr(ms(Wr(kh([e,r])),12))}function N2e(t,e,r){return lu(e)!==32&&Hl.throwArgumentError("salt must be 32 bytes","salt",e),lu(r)!==32&&Hl.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Jr(ms(Wr(tn(["0xff",Jr(t),e,r])),12))}class I2e extends rl{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{Jr(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Jr(cn(e.readValue().toHexString(),20))}}class x2e extends rl{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}
405defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Fd=new re(og);function NM(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||Fd.throwError("cannot encode object for signature with missing names",re.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&Fd.throwError("cannot encode object for signature with duplicate names",re.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else Fd.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Fd.throwArgumentError("types/value length mismatch","tuple",r);let i=new V6(t.wordSize),s=new V6(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function IM(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===re.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===re.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{get:()=>{throw c}}):r[a]=c});for(let s=0;s<r.length;s++){const o=r[s];o instanceof Error&&Object.defineProperty(r,s,{get:()=>{throw o}})}return Object.freeze(r)}class R2e extends rl{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(e);return r}encode(e,r){Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,e.writeValue(r.length)),Fd.checkArgumentCount(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let s=0;s<r.length;s++)i.push(this.coder);return NM(e,i,r)}decode(e){let r=this.length;r===-1&&(r=e.readValue().toNumber(),r*32>e._data.length&&Fd.throwError("insufficient data length",re.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i<r;i++)n.push(new x2e(this.coder));return e.coerce(this.name,IM(e,n))}}class P2e extends rl{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,r){return e.writeValue(r?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class xM extends rl{constructor(e,r){super(e,e,r,!0)}defaultValue(){return"0x"}encode(e,r){r=ve(r);let n=e.writeValue(r.length);return n+=e.writeBytes(r),n}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class k2e extends xM{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Ne(super.decode(e)))}}class O2e extends rl{constructor(e,r){let n="bytes"+String(e);super(n,n,r,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,r){let n=ve(r);return n.length!==this.size&&this._throwError("incorrect data length",r),e.writeBytes(n)}decode(e){return e.coerce(this.name,Ne(e.readBytes(this.size)))}}class M2e extends rl{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,r){return r!=null&&this._throwError("not null",r),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const RM="0x0000000000000000000000000000000000000000",PM=Ie.from(-1),t8=Ie.from(0),kM=Ie.from(1),D2e=Ie.from(2),B2e=Ie.from("1000000000000000000"),OM=Ie.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),r8="0x0000000000000000000000000000000000000000000000000000000000000000",F2e="Î";var $2e=Object.freeze({__proto__:null,AddressZero:RM,NegativeOne:PM,Zero:t8,One:kM,Two:D2e,WeiPerEther:B2e,MaxUint256:OM,HashZero:r8,EtherSymbol:F2e});class L2e extends rl{constructor(e,r,n){const i=(r?"int":"uint")+e*8;super(i,i,n,!1),this.size=e,this.signed=r}defaultValue(){return 0}encode(e,r){let n=Ie.from(r),i=OM.mask(e.wordSize*8);if(this.signed){let s=i.mask(this.size*8-1);(n.gt(s)||n.lt(s.add(kM).mul(PM)))&&this._throwError("value out-of-bounds",r)}else(n.lt(t8)||n.gt(i.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*e.wordSize)),e.writeValue(n)}decode(e){let r=e.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),e.coerce(this.name,r)}}const U2e="strings/5.2.0",MM=new re(U2e);var Wa;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Wa||(Wa={}));var cs;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(cs||(cs={}));function H2e(t,e,r,n,i){return MM.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function DM(t,e,r,n,i){if(t===cs.BAD_PREFIX||t===cs.UNEXPECTED_CONTINUE){let s=0;for(let o=e+1;o<r.length&&r[o]>>6===2;o++)s++;return s}return t===cs.OVERRUN?r.length-e-1:0}function j2e(t,e,r,n,i){return t===cs.OVERLONG?(n.push(i),0):(n.push(65533),DM(t,e,r))}const BM=Object.freeze({error:H2e,ignore:DM,replace:j2e});function n8(t,e){e==null&&(e=BM.error),t=ve(t);const r=[];let n=0;for(;n<t.length;){const i=t[n++];if(!(i>>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(cs.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(cs.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(cs.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c<s;c++){let l=t[n];if((l&192)!=128){n+=e(cs.MISSING_CONTINUE,n,t,r),a=null;break}a=a<<6|l&63,n++}if(a!==null){if(a>1114111){n+=e(cs.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(cs.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(cs.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function ln(t,e=Wa.current){e!=Wa.current&&(MM.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n<t.length;n++){const i=t.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return ve(r)}function Iw(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function z2e(t,e){return'"'+n8(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?Iw(r):(r-=65536,Iw((r>>10&1023)+55296)+Iw((r&1023)+56320))}).join("")+'"'}function W6(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function on(t,e){return W6(n8(t,e))}function K6(t,e=Wa.current){return n8(ln(t,e))}function J2e(t){const e=ln(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Ne(tn([e,r8]).slice(0,32))}function q2e(t){const e=ve(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return on(e.slice(0,r))}function G2e(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function i8(t,e){e||(e=function(i){return[parseInt(i,16)]});let r=0,n={};return t.split(",").forEach(i=>
405{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function FM(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function s8(t,e){let r=0;for(let n=0;n<e.length;n++){let i=e[n];if(r+=i.l,t>=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const V2e=FM("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),W2e="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),K2e=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],X2e=i8("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Z2e=i8("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Y2e=i8("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",G2e),Q2e=FM("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function eve(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function tve(t){return!!s8(t,V2e)}function rve(t){let e=s8(t,K2e);if(e)return[t+e.s];let r=X2e[t];if(r)return r;let n=Z2e[t];if(n)return[t+n[0]];let i=Y2e[t];return i||null}function nve(t){return!!s8(t,Q2e)}function o8(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=K6(t);e=eve(e.map(n=>{if(W2e.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=rve(n);return i||[n]})),e=K6(W6(e),Wa.NFKC),e.forEach(n=>{if(nve(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(tve(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=W6(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");if(r.length>63)throw new Error("too long");return r}class ive extends xM{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,ln(r))}decode(e){return on(super.decode(e))}}class sm extends rl{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];
405this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return NM(e,this.coders,r)}decode(e){return e.coerce(this.name,IM(e,this.coders))}}const T0=new re(og),sve=new RegExp(/^bytes([0-9]*)$/),ove=new RegExp(/^(u?int)([0-9]*)$/);class s2{constructor(e){T0.checkNew(new.target,s2),ae(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new I2e(e.name);case"bool":return new P2e(e.name);case"string":return new ive(e.name);case"bytes":return new k2e(e.name);case"array":return new R2e(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new sm((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new M2e(e.name)}let r=e.type.match(ove);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&T0.throwArgumentError("invalid "+r[1]+" bit length","param",e),new L2e(n/8,r[1]==="int",e.name)}if(r=e.type.match(sve),r){let n=parseInt(r[1]);return(n===0||n>32)&&T0.throwArgumentError("invalid bytes length","param",e),new O2e(n,e.name)}return T0.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new Wb(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new V6(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Jn.from(i)));return new sm(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&T0.throwError("types/values length mismatch",re.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Jn.from(o))),i=new sm(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Jn.from(o)));return new sm(i,"_").decode(this._getReader(ve(r),n))}}const $M=new s2;function jl(t){return Wr(ln(t))}const LM="hash/5.2.0",ave=new re(LM),UM=new Uint8Array(32);UM.fill(0);const cve=new RegExp("^((.*)\\.)?([^.]+)$");function lve(t){try{const e=t.split(".");for(let r=0;r<e.length;r++)if(o8(e[r]).length===0)throw new Error("empty");return!0}catch{}return!1}function y1(t){typeof t!="string"&&ave.throwArgumentError("invalid address - "+String(t),"name",t);let e=UM;for(;t.length;){const r=t.match(cve),n=ln(o8(r[3]));e=Wr(tn([e,Wr(n)])),t=r[2]||""}return Ne(e)}const uve=`�Ethereum Signed Message: 406`;function a8(t){return typeof t=="string"&&(t=ln(t)),Wr(tn([ln(uve),ln(String(t.length)),t]))}var fve=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const hn=new re(LM),HM=new Uint8Array(32);HM.fill(0);const dve=Ie.from(-1),jM=Ie.from(0),zM=Ie.from(1),hve=Ie.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function pve(t){const e=ve(t),r=e.length%32;return r?Yl([e,HM.slice(r)]):Ne(e)}const gve=cn(zM.toHexString(),32),mve=cn(jM.toHexString(),32),dT={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},xw=["name","version","chainId","verifyingContract","salt"];function hT(t){return function(e){return typeof e!="string"&&hn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const bve={name:hT("name"),version:hT("version"),chainId:function(t){try{return Ie.from(t).toString()}catch{}return hn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Jr(t).toLowerCase()}catch{}return hn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=ve(t);if(e.length!==32)throw new Error("bad length");return Ne(e)}catch{}return hn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Rw(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&hn.throwArgumentError("invalid numeric width","type",t);const i=hve.mask(r?n-1:n),s=r?i.add(zM).mul(dve):jM;return function(o){const a=Ie.from(o);return(a.lt(s)||a.gt(i))&&hn.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),cn(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&hn.throwArgumentError("invalid bytes width","type",t),function(n){return ve(n).length!==r&&hn.throwArgumentError(`invalid length for ${t}`,"value",n),pve(n)}}}switch(t){case"address":return function(e){return cn(Jr(e),32)};case"bool":return function(e){return e?gve:mve};case"bytes":return function(e){return Wr(e)};case"string":return function(e){return jl(e)}}return null}function pT(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class ui{constructor(e){ae(this,"types",Object.freeze(Ji(e))),ae(this,"_encoderCache",{}),ae(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};
406e[a].forEach(l=>{c[l.name]&&hn.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&hn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!Rw(u)&&(n[u]||hn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?hn.throwArgumentError("missing primary type","types",e):s.length>1&&hn.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),ae(this,"primaryType",s[0]);function o(a,c){c[a]&&hn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=pT(a,e[a])+c.map(l=>pT(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Rw(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&hn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Wr)),Wr(Yl(c))}}const n=this.types[e];if(n){const i=jl(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Wr(l):l});return o.unshift(i),Yl(o)}}return hn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||hn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Wr(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Rw(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&hn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):hn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new ui(e)}static getPrimaryType(e){return ui.from(e).primaryType}static hashStruct(e,r,n){return ui.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=dT[n];i||hn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>xw.indexOf(n.name)-xw.indexOf(i.name)),ui.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Yl(["0x1901",ui.hashDomain(e),ui.from(r).hash(n)])}static hash(e,r,n){return Wr(ui.encode(e,r,n))}static resolveNames(e,r,n,i){return fve(this,void 0,void 0,function*(){e=wn(e);const s={};e.verifyingContract&&!_t(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=ui.from(r);o.visit(n,(a,c)=>(a==="address"&&!_t(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){ui.hashDomain(e);const i={},s=[];xw.forEach(c=>{const l=e[c];l!=null&&(i[c]=bve[c](l),s.push({name:c,type:dT[c]}))});const o=ui.from(r),a=wn(r);return a.EIP712Domain?hn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Ne(ve(l));if(c.match(/^u?int/))return Ie.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&hn.throwArgumentError("invalid string","value",l),l}return hn.throwArgumentError("unsupported type","type",c)})}}}const fn=new re(og);class JM extends Xh{}class qM extends Xh{}class Kb extends Xh{static isIndexed(e){return!!(e&&e._isIndexed)}}const yve={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function gT(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class v1{constructor(e){fn.checkNew(new.target,v1);let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ae(this,"fragments",r.map(n=>Na.from(n)).filter(n=>n!=null)),ae(this,"_abiCoder",Yn(new.target,"getAbiCoder")()),ae(this,"functions",{}),ae(this,"errors",{}),ae(this,"events",{}),ae(this,"structs",{}
406),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){fn.warn("duplicate definition - constructor");return}ae(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){fn.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||ae(this,"deploy",Aa.from({payable:!1,type:"constructor"})),ae(this,"_isInterface",!0)}format(e){e||(e=yr.full),e===yr.sighash&&fn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===yr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return $M}static getAddress(e){return Jr(e)}static getSighash(e){return ms(jl(e.format()),0,4)}static getEventTopic(e){return jl(e.format())}getFunction(e){if(_t(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];fn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?fn.throwArgumentError("no matching function","name",n):i.length>1&&fn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Fo.fromString(e).format()];return r||fn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(_t(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];fn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?fn.throwArgumentError("no matching event","name",n):i.length>1&&fn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ea.fromString(e).format()];return r||fn.throwArgumentError("no matching event","signature",e),r}getError(e){if(_t(e)){const n=Yn(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}fn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?fn.throwArgumentError("no matching error","name",n):i.length>1&&fn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Fo.fromString(e).format()];return r||fn.throwArgumentError("no matching error","signature",e),r}getSighash(e){return typeof e=="string"&&(e=this.getFunction(e)),Yn(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Yn(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=ve(r);return Ne(n.slice(0,4))!==this.getSighash(e)&&fn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ne(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Ne(tn([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=ve(r),i=null,s=null,o=null,a=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const c=Ne(n.slice(0,4)),l=yve[c];if(l)s=this._abiCoder.decode(l.inputs,n.slice(4)),o=l.name,a=l.signature,l.reason&&(i=s[0]);else try{const u=this.getError(c);s=this._abiCoder.decode(u.inputs,n.slice(4)),o=u.name,a=u.format()}catch(u){console.log(u)}break}}return fn.throwError("call revert exception",re.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:s,errorName:o,errorSignature:a,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Ne(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>
406e.inputs.length&&fn.throwError("too many arguments for "+e.format(),re.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?jl(o):s.type==="bytes"?Wr(Ne(o)):(s.type==="address"&&this._abiCoder.encode(["address"],[o]),cn(Ne(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&fn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?fn.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&fn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(jl(c));else if(o.type==="bytes")n.push(Wr(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!_t(n[0],32)||n[0].toLowerCase()!==d)&&fn.throwError("fragment/topic mismatch",re.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Jn.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,tn(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,h)=>{if(d.indexed)if(a==null)l[h]=new Kb({_isIndexed:!0,hash:null});else if(o[h])l[h]=new Kb({_isIndexed:!0,hash:a[f++]});else try{l[h]=a[f++]}catch(g){l[h]=g}else try{l[h]=c[u++]}catch(g){l[h]=g}if(d.name&&l[d.name]==null){const g=l[h];g instanceof Error?Object.defineProperty(l,d.name,{get:()=>{throw gT(`property ${JSON.stringify(d.name)}`,g)}}):l[d.name]=g}});for(let d=0;d<l.length;d++){const h=l[d];h instanceof Error&&Object.defineProperty(l,d,{get:()=>{throw gT(`index ${d}`,h)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new qM({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Ie.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new JM({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}static isInterface(e){return!!(e&&e._isInterface)}}const vve="abstract-provider/5.2.0",wve=new re(vve);class Eve extends Xh{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class uu{constructor(){wve.checkAbstract(new.target,uu),ae(this,"_isProvider",!0)}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const Ave="abstract-signer/5.2.0";var gc=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Sc=new re(Ave),_ve=["accessList","chainId","data","from","gasLimit","gasPrice","nonce","to","type","value"],Cve=[re.errors.INSUFFICIENT_FUNDS,re.errors.NONCE_EXPIRED,re.errors.REPLACEMENT_UNDERPRICED];class vu{constructor(){Sc.checkAbstract(new.target,vu),ae(this,"_isSigner",!0)}getBalance(e){return gc(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return gc(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return gc(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield En(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return gc(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield En(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return this._checkProvider("sendTransaction"),this.populateTransaction(e).then(r=>this.signTransaction(r).then(n=>this.provider.sendTransaction(n)))}getChainId(){return gc(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return gc(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}resolveName(e){return gc(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)_ve.indexOf(n)===-1&&Sc.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=wn(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Sc.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return gc(this,void 0,void 0,function*(){const r=yield En(this.checkTransaction(e));return r.to!=null&&(r.to=Promise.resolve(r.to).then(n=>gc(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.resolveName(n);return i==null&&Sc.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),r.gasPrice==null&&(r.gasPrice=this.getGasPrice()),r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLim
406it==null&&(r.gasLimit=this.estimateGas(r).catch(n=>{if(Cve.indexOf(n.code)>=0)throw n;return Sc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",re.errors.UNPREDICTABLE_GAS_LIMIT,{error:n,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(n=>(n[1]!==0&&n[0]!==n[1]&&Sc.throwArgumentError("chainId address mismatch","transaction",e),n[0])),yield En(r)})}_checkProvider(e){this.provider||Sc.throwError("missing provider",re.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class w1 extends vu{constructor(e,r){Sc.checkNew(new.target,w1),super(),ae(this,"address",e),ae(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Sc.throwError(e,re.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new w1(this.address,e)}}var ag=GM;function GM(t,e){if(!t)throw new Error(e||"Assertion failed")}GM.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Sve=ed(function(t){typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),Tve=ed(function(t){try{var e=null;if(typeof e.inherits!="function")throw"";t.exports=e.inherits}catch{t.exports=Sve}}),Nve=Tve;function Ive(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/gi,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var n=0;n<t.length;n++){var i=t.charCodeAt(n),s=i>>8,o=i&255;s?r.push(s,o):r.push(o)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}var xve=Ive;function Rve(t){for(var e="",r=0;r<t.length;r++)e+=WM(t[r].toString(16));return e}var Pve=Rve;function VM(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}var kve=VM;function Ove(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];e==="little"&&(i=VM(i)),r+=KM(i.toString(16))}return r}var Mve=Ove;function WM(t){return t.length===1?"0"+t:t}var Dve=WM;function KM(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}var Bve=KM;function Fve(t,e,r,n){var i=r-e;ag(i%4===0);for(var s=new Array(i/4),o=0,a=e;o<s.length;o++,a+=4){var c;n==="big"?c=t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]:c=t[a+3]<<24|t[a+2]<<16|t[a+1]<<8|t[a],s[o]=c>>>0}return s}var $ve=Fve;function Lve(t,e){for(var r=new Array(t.length*4),n=0,i=0;n<t.length;n++,i+=4){var s=t[n];e==="big"?(r[i]=s>>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}var Uve=Lve;function Hve(t,e){return t>>>e|t<<32-e}var jve=Hve;function zve(t,e){return t<<e|t>>>32-e}var Jve=zve;function qve(t,e){return t+e>>>0}var Gve=qve;function Vve(t,e,r){return t+e+r>>>0}var Wve=Vve;function Kve(t,e,r,n){return t+e+r+n>>>0}var Xve=Kve;function Zve(t,e,r,n,i){return t+e+r+n+i>>>0}var Yve=Zve;function Qve(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o<n?1:0)+r+i;t[e]=a>>>0,t[e+1]=o}var ewe=Qve;function twe(t,e,r,n){var i=e+n>>>0,s=(i<e?1:0)+t+r;return s>>>0}var rwe=twe;function nwe(t,e,r,n){var i=e+n;return i>>>0}var iwe=nwe;function swe(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l<e?1:0,l=l+s>>>0,c+=l<s?1:0,l=l+a>>>0,c+=l<a?1:0;var u=t+r+i+o+c;return u>>>0}var owe=swe;function awe(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}var cwe=awe;function lwe(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f<e?1:0,f=f+s>>>0,u+=f<s?1:0,f=f+a>>>0,u+=f<a?1:0,f=f+l>>>0,u+=f<l?1:0;var d=t+r+i+o+c+u;return d>>>0}var uwe=lwe;function fwe(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}var dwe=fwe;function hwe(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}var pwe=hwe;function gwe(t,e,r){var n=t<<32-r|e>>
406>r;return n>>>0}var mwe=gwe;function bwe(t,e,r){return t>>>r}var ywe=bwe;function vwe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}var wwe=vwe,bt={inherits:Nve,toArray:xve,toHex:Pve,htonl:kve,toHex32:Mve,zero2:Dve,zero8:Bve,join32:$ve,split32:Uve,rotr32:jve,rotl32:Jve,sum32:Gve,sum32_3:Wve,sum32_4:Xve,sum32_5:Yve,sum64:ewe,sum64_hi:rwe,sum64_lo:iwe,sum64_4_hi:owe,sum64_4_lo:cwe,sum64_5_hi:uwe,sum64_5_lo:dwe,rotr64_hi:pwe,rotr64_lo:mwe,shr64_hi:ywe,shr64_lo:wwe};function o2(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var Ewe=o2;o2.prototype.update=function(e,r){if(e=bt.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=bt.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this};o2.prototype.digest=function(e){return this.update(this._pad()),ag(this.pending===null),this._digest(e)};o2.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var s=1;s<n;s++)i[s]=0;if(e<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=e>>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o<this.padLength;o++)i[s++]=0;return i};var cg={BlockHash:Ewe},Ba=bt.rotr32;function Awe(t,e,r,n){if(t===0)return XM(e,r,n);if(t===1||t===3)return YM(e,r,n);if(t===2)return ZM(e,r,n)}var _we=Awe;function XM(t,e,r){return t&e^~t&r}var Cwe=XM;function ZM(t,e,r){return t&e^t&r^e&r}var Swe=ZM;function YM(t,e,r){return t^e^r}var Twe=YM;function Nwe(t){return Ba(t,2)^Ba(t,13)^Ba(t,22)}var Iwe=Nwe;function xwe(t){return Ba(t,6)^Ba(t,11)^Ba(t,25)}var Rwe=xwe;function Pwe(t){return Ba(t,7)^Ba(t,18)^t>>>3}var kwe=Pwe;function Owe(t){return Ba(t,17)^Ba(t,19)^t>>>10}var Mwe=Owe,td={ft_1:_we,ch32:Cwe,maj32:Swe,p32:Twe,s0_256:Iwe,s1_256:Rwe,g0_256:kwe,g1_256:Mwe},Pw=bt.rotl32,N0=bt.sum32,Dwe=bt.sum32_5,Bwe=td.ft_1,QM=cg.BlockHash,Fwe=[1518500249,1859775393,2400959708,3395469782];function Ka(){if(!(this instanceof Ka))return new Ka;QM.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}bt.inherits(Ka,QM);var $we=Ka;Ka.blockSize=512;Ka.outSize=160;Ka.hmacStrength=80;Ka.padLength=64;Ka.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=Pw(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var s=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],l=this.h[4];for(i=0;i<n.length;i++){var u=~~(i/20),f=Dwe(Pw(s,5),Bwe(u,o,a,c),l,n[i],Fwe[u]);l=c,c=a,a=Pw(o,30),o=s,s=f}this.h[0]=N0(this.h[0],s),this.h[1]=N0(this.h[1],o),this.h[2]=N0(this.h[2],a),this.h[3]=N0(this.h[3],c),this.h[4]=N0(this.h[4],l)};Ka.prototype._digest=function(e){return e==="hex"?bt.toHex32(this.h,"big"):bt.split32(this.h,"big")};var Co=bt.sum32,Lwe=bt.sum32_4,Uwe=bt.sum32_5,Hwe=td.ch32,jwe=td.maj32,zwe=td.s0_256,Jwe=td.s1_256,qwe=td.g0_256,Gwe=td.g1_256,eD=cg.BlockHash,Vwe=[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,2756
vendor: 3,243 bytes, line 406
406734187,3204031479,3329325298];function Xa(){if(!(this instanceof Xa))return new Xa;eD.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Vwe,this.W=new Array(64)}bt.inherits(Xa,eD);var c8=Xa;Xa.blockSize=512;Xa.outSize=256;Xa.hmacStrength=192;Xa.padLength=64;Xa.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;i<n.length;i++)n[i]=Lwe(Gwe(n[i-2]),n[i-7],qwe(n[i-15]),n[i-16]);var s=this.h[0],o=this.h[1],a=this.h[2],c=this.h[3],l=this.h[4],u=this.h[5],f=this.h[6],d=this.h[7];for(ag(this.k.length===n.length),i=0;i<n.length;i++){var h=Uwe(d,Jwe(l),Hwe(l,u,f),this.k[i],n[i]),g=Co(zwe(s),jwe(s,o,a));d=f,f=u,u=l,l=Co(c,h),c=a,a=o,o=s,s=Co(h,g)}this.h[0]=Co(this.h[0],s),this.h[1]=Co(this.h[1],o),this.h[2]=Co(this.h[2],a),this.h[3]=Co(this.h[3],c),this.h[4]=Co(this.h[4],l),this.h[5]=Co(this.h[5],u),this.h[6]=Co(this.h[6],f),this.h[7]=Co(this.h[7],d)};Xa.prototype._digest=function(e){return e==="hex"?bt.toHex32(this.h,"big"):bt.split32(this.h,"big")};function Xc(){if(!(this instanceof Xc))return new Xc;c8.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}bt.inherits(Xc,c8);var Wwe=Xc;Xc.blockSize=512;Xc.outSize=224;Xc.hmacStrength=192;Xc.padLength=64;Xc.prototype._digest=function(e){return e==="hex"?bt.toHex32(this.h.slice(0,7),"big"):bt.split32(this.h.slice(0,7),"big")};var Fa=bt.rotr64_hi,$a=bt.rotr64_lo,tD=bt.shr64_hi,rD=bt.shr64_lo,Sl=bt.sum64,kw=bt.sum64_hi,Ow=bt.sum64_lo,Kwe=bt.sum64_4_hi,Xwe=bt.sum64_4_lo,Zwe=bt.sum64_5_hi,Ywe=bt.sum64_5_lo,nD=cg.BlockHash,Qwe=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
4061126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Xo(){if(!(this instanceof Xo))return new Xo;nD.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Qwe,this.W=new Array(160)}bt.inherits(Xo,nD);var l8=Xo;Xo.blockSize=1024;Xo.outSize=512;Xo.hmacStrength=192;Xo.padLength=128;Xo.prototype._prepareBlock=function(e,r){for(var n=this.W,i=0;i<32;i++)n[i]=e[r+i];for(;i<n.length;i+=2){var s=u3e(n[i-4],n[i-3]),o=f3e(n[i-4],n[i-3]),a=n[i-14],c=n[i-13],l=c3e(n[i-30],n[i-29]),u=l3e(n[i-30],n[i-29]),f=n[i-32],d=n[i-31];n[i]=Kwe(s,o,a,c,l,u,f,d),n[i+1]=Xwe(s,o,a,c,l,u,f,d)}};Xo.prototype._update=function(e,r){this._prepareBlock(e,r);var n=this.W,i=this.h[0],s=this.h[1],o=this.h[2],a=this.h[3],c=this.h[4],l=this.h[5],u=this.h[6],f=this.h[7],d=this.h[8],h=this.h[9],g=this.h[10],b=this.h[11],w=this.h[12],x=this.h[13],k=this.h[14],R=this.h[15];ag(this.k.length===n.length);for(var D=0;D<n.length;D+=2){var O=k,M=R,F=o3e(d,h),H=a3e(d,h),U=e3e(d,h,g,b,w),G=t3e(d,h,g,b,w,x),N=this.k[D],A=this.k[D+1],v=n[D],p=n[D+1],m=Zwe(O,M,F,H,U,G,N,A,v,p),y=Ywe(O,M,F,H,U,G,N,A,v,p);O=i3e(i,s),M=s3e(i,s),F=r3e(i,s,o,a,c),H=n3e(i,s,o,a,c,l);var T=kw(O,M,F,H),I=Ow(O,M,F,H);k=w,R=x,w=g,x=b,g=d,b=h,d=kw(u,f,m,y),h=Ow(f,f,m,y),u=c,f=l,c=o,l=a,o=i,a=s,i=kw(m,y,T,I),s=Ow(m,y,T,I)}Sl(this.h,0,i,s),Sl(this.h,2,o,a),Sl(this.h,4,c,l),Sl(this.h,6,u,f),Sl(this.h,8,d,h),Sl(this.h,10,g,b),Sl(this.h,12,w,x),Sl(this.h,14,k,R)};Xo.prototype._digest=function(e){return e==="hex"?bt.toHex32(this.h,"big"):bt.split32(this.h,"big")};function e3e(t,e,r,n,i){var s=t&r^~t&i;return s<0&&(s+=4294967296),s}function t3e(t,e,r,n,i,s){var o=e&n^~e&s;return o<0&&(o+=4294967296),o}function r3e(t,e,r,n,i){var s=t&r^t&i^r&i;return s<0&&(s+=4294967296),s}function n3e(t,e,r,n,i,s){var o=e&n^e&s^n&s;return o<0&&(o+=4294967296),o}function i3e(t,e){var r=Fa(t,e,28),n=Fa(e,t,2),i=Fa(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function s3e(t,e){var r=$a(t,e,28),n=$a(e,t,2),i=$a(e,t,7),s=r^n^i;return s<0&&(s+=4294967296),s}function o3e(t,e){var r=Fa(t,e,14),n=Fa(t,e,18),i=Fa(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function a3e(t,e){var r=$a(t,e,14),n=$a(t,e,18),i=$a(e,t,9),s=r^n^i;return s<0&&(s+=4294967296),s}function c3e(t,e){var r=Fa(t,e,1),n=Fa(t,e,8),i=tD(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function l3e(t,e){var r=$a(t,e,1),n=$a(t,e,8),i=rD(t,e,7),s=r^n^i;return s<0&&(s+=4294967296),s}function u3e(t,e){var r=Fa(t,e,19),n=Fa(e,t,29),i=tD(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}function f3e(t,e){var r=$a(t,e,19),n=$a(e,t,29),i=rD(t,e,6),s=r^n^i;return s<0&&(s+=4294967296),s}function Zc(){if(!(this instanceof Zc))return new Zc;l8.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}bt.inherits(Zc,l8);var d3e=Zc;Zc.blockSize=1024;Zc.outSize=384;Zc.hmacStrength=192;Zc.padLength=128;Zc.prototype._digest=function(e){return e==="hex"?bt.toHex32(this.h.slice(0,12),"big"):bt.split32(this.h.slice(0,12),"big")};var h3e=$we,p3e=Wwe,g3e=c8,m3e=d3e,b3e=l8,y3e={sha1:h3e,sha224:p3e,sha256:g3e,sha384:m3e,sha512:b3e},om=bt.rotl32,mT=bt.sum32,I0=bt.sum32_3,bT=bt.sum32_4,iD=cg.BlockHash;function Za(){if(!(this instanceof Za))return new Za;iD.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}bt.inherits(Za,iD);var v3e=Za;Za.blockSize=512;Za.outSize=160;Za.hmacStrength=192;Za.padLength=64;Za.prototype._update=function(e,r){for(var n=this.h[0],i=this.h[1],s=this.h[2],o=this.h[3],a=this.h[4],c=n,l=i,u=s,f=o,d=a,h=0;h<80;h++){var g=mT(om(bT(n,yT(h,i,s,o),e[A3e[h]+r],w3e(h)),C3e[h]),a);n=a,a=o,o=om(s,10),s=i,i=g,g=mT(om(bT(c,yT(79-h,l,u,f),e[_3e[h]+r],E3e(h)),S3e[h]),d),c=d,d=f,f=om(u,10),u=l,l=g}g=I0(this.h[1],s,f),this.h[1]=I0(this.h[2],o,d),this.h[2]=I0(this.h[3],a,c),this.h[3]=I0(this.h[4],n,l),this.h[4]=I0(this.h[0],i,u),this.h[0]=g};Za.prototype._digest=function(e){return e==="hex"?bt.toHex32(this.h,"little"):bt.split32(this.h,"little")};function yT(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function w3e(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function E3e(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var A3e=[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],_3e=[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],C3e=[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],S3e=[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],T3e={ripemd160:v3e};function Oh(t,e,r){if(!(this instanceof Oh))return new Oh(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(bt.toArray(e,r))}var N3e=Oh;Oh.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),ag(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)};Oh.prototype.update=function(e,r){return this.inner.update(e,r),this};Oh.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var ns=ed(function(t,e){var r=e;r.utils=bt,r.common=cg,r.sha=y3e,r.ripemd=T3e,r.hmac=N3e,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160});function Zh(t,e,r){return r={path:e,exports:{},require:function(n,i){return I3e(n,i??r.path)}},t(r,r.exports),r.exports}function I3e(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var u8=sD;function sD(t,e){if(!t)throw new Error(e||"Assertion failed")}sD.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Uo=Zh(function(t,e){var r=e;function n(o,a){if(Array.isArray(o))return o.slice();if(!o)return[];var c=[];if(typeof o!="string"){for(var l=0;l<o.length;l++)c[l]=o[l]|0;return c}if(a==="hex"){o=o.replace(/[^a-z0-9]+/gi,""),o.length%2!==0&&(o="0"+o);for(var l=0;l<o.length;l+=2)c.push(parseInt(o[l]+o[l+1],16))}else for(var l=0;l<o.length;
406l++){var u=o.charCodeAt(l),f=u>>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c<o.length;c++)a+=i(o[c].toString(16));return a}r.toHex=s,r.encode=function(a,c){return c==="hex"?s(a):a}}),Us=Zh(function(t,e){var r=e;r.assert=u8,r.toArray=Uo.toArray,r.zero2=Uo.zero2,r.toHex=Uo.toHex,r.encode=Uo.encode;function n(c,l,u){var f=new Array(Math.max(c.bitLength(),u)+1);f.fill(0);for(var d=1<<l+1,h=c.clone(),g=0;g<f.length;g++){var b,w=h.andln(d-1);h.isOdd()?(w>(d>>1)-1?b=(d>>1)-w:b=w,h.isubn(b)):b=0,f[g]=b,h.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var g=c.andln(3)+f&3,b=l.andln(3)+d&3;g===3&&(g=-1),b===3&&(b=-1);var w;g&1?(h=c.andln(7)+f&7,(h===3||h===5)&&b===2?w=-g:w=g):w=0,u[0].push(w);var x;b&1?(h=l.andln(7)+d&7,(h===3||h===5)&&g===2?x=-b:x=b):x=0,u[1].push(x),2*f===w+1&&(f=1-f),2*d===x+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new yt(c,"hex","le")}r.intFromLE=a}),Xb=Us.getNAF,x3e=Us.getJSF,Zb=Us.assert;function wu(t,e){this.type=t,this.p=new yt(e.p,16),this.red=e.prime?yt.red(e.prime):yt.mont(this.p),this.zero=new yt(0).toRed(this.red),this.one=new yt(1).toRed(this.red),this.two=new yt(2).toRed(this.red),this.n=e.n&&new yt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var rd=wu;wu.prototype.point=function(){throw new Error("Not implemented")};wu.prototype.validate=function(){throw new Error("Not implemented")};wu.prototype._fixedNafMul=function(e,r){Zb(e.precomputed);var n=e._getDoubles(),i=Xb(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var o=[],a,c;for(a=0;a<i.length;a+=n.step){c=0;for(var l=a+n.step-1;l>=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a<o.length;a++)c=o[a],c===d?f=f.mixedAdd(n.points[a]):c===-d&&(f=f.mixedAdd(n.points[a].neg()));u=u.add(f)}return u.toP()};wu.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,o=Xb(r,n,this._bitLength),a=this.jpoint(null,null,null),c=o.length-1;c>=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];Zb(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};wu.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u<i;u++){d=r[u];var h=d._getNAFPoints(e);o[u]=h.wnd,a[u]=h.points}for(u=i-1;u>=1;u-=2){var g=u-1,b=u;if(o[g]!==1||o[b]!==1){c[g]=Xb(n[g],o[g],this._bitLength),c[b]=Xb(n[b],o[b],this._bitLength),l=Math.max(c[g].length,l),l=Math.max(c[b].length,l);continue}
406var w=[r[g],null,null,r[b]];r[g].y.cmp(r[b].y)===0?(w[1]=r[g].add(r[b]),w[2]=r[g].toJ().mixedAdd(r[b].neg())):r[g].y.cmp(r[b].y.redNeg())===0?(w[1]=r[g].toJ().mixedAdd(r[b]),w[2]=r[g].add(r[b].neg())):(w[1]=r[g].toJ().mixedAdd(r[b]),w[2]=r[g].toJ().mixedAdd(r[b].neg()));var x=[-3,-1,-5,-7,0,7,5,1,3],k=x3e(n[g],n[b]);for(l=Math.max(k[0].length,l),c[g]=new Array(l),c[b]=new Array(l),f=0;f<l;f++){var R=k[0][f]|0,D=k[1][f]|0;c[g][f]=x[(R+1)*3+(D+1)],c[b][f]=0,a[g]=w}}var O=this.jpoint(null,null,null),M=this._wnafT4;for(u=l;u>=0;u--){for(var F=0;u>=0;){var H=!0;for(f=0;f<i;f++)M[f]=c[f][u]|0,M[f]!==0&&(H=!1);if(!H)break;F++,u--}if(u>=0&&F++,O=O.dblp(F),u<0)break;for(f=0;f<i;f++){var U=M[f];U!==0&&(U>0?d=a[f][U-1>>1]:U<0&&(d=a[f][-U-1>>1].neg()),d.type==="affine"?O=O.mixedAdd(d):O=O.add(d))}}for(u=0;u<i;u++)a[u]=null;return s?O:O.toP()};function go(t,e){this.curve=t,this.type=e,this.precomputed=null}wu.BasePoint=go;go.prototype.eq=function(){throw new Error("Not implemented")};go.prototype.validate=function(){return this.curve.validate(this)};wu.prototype.decodePoint=function(e,r){e=Us.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Zb(e[e.length-1]%2===0):e[0]===7&&Zb(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};go.prototype.encodeCompressed=function(e){return this.encode(e,!0)};go.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};go.prototype.encode=function(e,r){return Us.encode(this._encode(r),e)};go.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};go.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};go.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<r;s+=e){for(var o=0;o<e;o++)i=i.dbl();n.push(i)}return{step:e,points:n}};go.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(i);return{wnd:e,points:r}};go.prototype._getBeta=function(){return null};go.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r};var f8=Zh(function(t){typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),R3e=Us.assert;function mo(t){rd.call(this,"short",t),this.a=new yt(t.a,16).toRed(this.red),this.b=new yt(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}f8(mo,rd);var P3e=mo;mo.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new yt(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)n=new yt(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],R3e(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var o;return e.basis?o=e.basis.map(function(a){return{a:new yt(a.a,16),b:new yt(a.b,16)}}):o=this._getEndoBasis(n),{beta:r,lambda:n,basis:o}}};mo.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:yt.mont(e),n=new yt(2).toRed(r).redInvm(),i=n.redNeg(),s=new yt(3).toRed(r).redNeg().redSqrt().redMul(n),o=i.redAdd(s).fromRed(),a=i.redSub(s).fromRed();return[o,a]};mo.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new yt(1),o=new yt(0),a=new yt(0),c=new yt(1),l,u,f,d,h,g,b,w=0,x,k;n.cmpn(0)!==0;){var R=i.div(n);x=i.sub(R.mul(n)),k=a.sub(R.mul(s));var D=c.sub(R.mul(o));if(!f&&x.cmp(r)<0)l=b.neg(),u=s,f=x.neg(),d=k;else if(f&&++w===2)break;b=x,i=n,n=x,a=s,s=k,c=o,o=D}h=x.neg(),g=k;var O=f.sqr().add(d.sqr()),M=h.sqr().add(g.sqr());return M.cmp(O)>=0&&(h=l,g=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),g=g.neg()),[{a:f,b
406:d},{a:h,b:g}]};mo.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};mo.prototype.pointFromX=function(e,r){e=new yt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};mo.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};mo.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(r[o]),c=e[o],l=c._getBeta();a.k1.negative&&(a.k1.ineg(),c=c.neg(!0)),a.k2.negative&&(a.k2.ineg(),l=l.neg(!0)),i[o*2]=c,i[o*2+1]=l,s[o*2]=a.k1,s[o*2+1]=a.k2}for(var u=this._wnafMulAdd(1,i,s,o*2,n),f=0;f<o*2;f++)i[f]=null,s[f]=null;return u};function ni(t,e,r,n){rd.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new yt(e,16),this.y=new yt(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}f8(ni,rd.BasePoint);mo.prototype.point=function(e,r,n){return new ni(this,e,r,n)};mo.prototype.pointFromJSON=function(e,r){return ni.fromJSON(this,e,r)};ni.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=function(s){return n.point(s.x.redMul(n.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};ni.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};ni.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function s(a){return e.point(a[0],a[1],n)}var o=r[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(s))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(s))}},i};ni.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};ni.prototype.isInfinity=function(){return this.inf};ni.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};ni.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};ni.prototype.getX=function(){return this.x.fromRed()};ni.prototype.getY=function(){return this.y.fromRed()};ni.prototype.mul=function(e){return e=new yt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};ni.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};ni.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};ni.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};ni.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());
vendor: 4,851 bytes, line 406
406if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};ni.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function bi(t,e,r,n){rd.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yt(0)):(this.x=new yt(e,16),this.y=new yt(r,16),this.z=new yt(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}f8(bi,rd.BasePoint);mo.prototype.jpoint=function(e,r,n){return new bi(this,e,r,n)};bi.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};bi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};bi.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),g=l.redMul(d.redISub(h)).redISub(o.redMul(f)),b=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,g,b)};bi.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),g=this.z.redMul(a);return this.curve.jpoint(d,h,g)};bi.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,o=this.x,a=this.y,c=this.z,l=c.redSqr().redSqr(),u=a.redAdd(a);for(r=0;r<e;r++){var f=o.redSqr(),d=u.redSqr(),h=d.redSqr(),g=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(l)),b=o.redMul(d),w=g.redSqr().redISub(b.redAdd(b)),x=b.redISub(w),k=g.redMul(x);k=k.redIAdd(k).redISub(h);var R=u.redMul(c);r+1<e&&(l=l.redMul(h)),o=w,c=R,u=k}return this.curve.jpoint(o,u.redMul(s),c)};bi.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};bi.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var c=i.redAdd(i).redIAdd(i),l=c.redSqr().redISub(a).redISub(a),u=o.redIAdd(o);u=u.redIAdd(u),u=u.redIAdd(u),e=l,r=c.redMul(a.redISub(l)).redISub(u),n=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),g=this.x.redAdd(d).redSqr().redISub(f).redISub(h);g=g.redIAdd(g);var b=f.redAdd(f).redIAdd(f),w=b.redSqr(),x=h.redIAdd(h);x=x.redIAdd(x),x=x.redIAdd(x),e=w.redISub(g).redISub(g),r=b.redMul(g.redISub(e)).redISub(x),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};bi.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),o=s.redSqr(),a=this.x.redAdd(s).redSqr().redISub(i).redISub(o);a=a.redIAdd(a);var c=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),l=c.redSqr().redISub(a).redISub(a);e=l;var u=o.redIAdd(o);u=u.redIAdd(u),u=u.redIAdd(u),r=c.redMul(a.redISub(l)).redISub(u),n=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),g=this.x.redSub(f).redMul(this.x.redAdd(f));g=g.redAdd(g).redIAdd(g);var b=h.redIAdd(h);b=b.redIAdd(b);var w=b.redAdd(b);e=g.redSqr().redISub(w),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(f);var x=d.redSqr();x=x.redIAdd(x),x=x.redIAdd(x),x=x.redIAdd(x),r=g.redMul(b.redISub(e)).redISub(x)}return this.curve.jpoint(e,r,n)};bi.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),o=r.redSqr(),a=n.redSqr(),c=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(s)),l=r.redAdd(r);l=l.redIAdd(l);var u=l.redMul(a),f=c.redSqr().redISub(u.redAdd(u)),d=u.redISub(f),h=a.redSqr();h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=c.redMul(d).redISub(h),b=n.redAdd(n).redMul(i);return this.curve.jpoint(f,g,b)};bi.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
406var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),s=e.redAdd(e).redIAdd(e),o=s.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(o);var c=a.redSqr(),l=i.redIAdd(i);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var u=s.redIAdd(a).redSqr().redISub(o).redISub(c).redISub(l),f=r.redMul(u);f=f.redIAdd(f),f=f.redIAdd(f);var d=this.x.redMul(c).redISub(f);d=d.redIAdd(d),d=d.redIAdd(d);var h=this.y.redMul(u.redMul(l.redISub(u)).redISub(a.redMul(c)));h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=this.z.redAdd(a).redSqr().redISub(n).redISub(c);return this.curve.jpoint(d,h,g)};bi.prototype.mul=function(e,r){return e=new yt(e,r),this.curve._wnafMul(this,e)};bi.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0};bi.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};bi.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};bi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Um=Zh(function(t,e){var r=e;r.base=rd,r.short=P3e,r.mont=null,r.edwards=null}),Hm=Zh(function(t,e){var r=e,n=Us.assert;function i(a){a.type==="short"?this.curve=new Um.short(a):a.type==="edwards"?this.curve=new Um.edwards(a):this.curve=new Um.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:ns.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:ns.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:ns.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:ns.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:ns.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ns.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ns.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:ns.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
406,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function fu(t){if(!(this instanceof fu))return new fu(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Uo.toArray(t.entropy,t.entropyEnc||"hex"),r=Uo.toArray(t.nonce,t.nonceEnc||"hex"),n=Uo.toArray(t.pers,t.persEnc||"hex");u8(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var oD=fu;fu.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};fu.prototype._hmac=function(){return new ns.hmac(this.hash,this.K)};fu.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};fu.prototype.reseed=function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=Uo.toArray(e,r),n=Uo.toArray(n,i),u8(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};fu.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Uo.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(n),this._reseed++,Uo.encode(o,r)};var X6=Us.assert;function Ri(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var d8=Ri;Ri.fromPublic=function(e,r,n){return r instanceof Ri?r:new Ri(e,{pub:r,pubEnc:n})};Ri.fromPrivate=function(e,r,n){return r instanceof Ri?r:new Ri(e,{priv:r,privEnc:n})};Ri.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Ri.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Ri.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Ri.prototype._importPrivate=function(e,r){this.priv=new yt(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Ri.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?X6(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&X6(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Ri.prototype.derive=function(e){return e.validate()||X6(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Ri.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};Ri.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Ri.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var k3e=Us.assert;function a2(t,e){if(t instanceof a2)return t;this._importDER(t,e)||(k3e(t.r&&t.s,"Signature without r or s"),this.r=new yt(t.r,16),this.s=new yt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var c2=a2;function O3e(){this.place=0}function Mw(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s<n;s++,o++)i<<=8,i|=t[o],i>>>=0;return i<=127?!1:(e.place=o,i)}function vT(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}a2.prototype._importDER=function(e,r){e=Us.toArray(e,r);var n=new O3e;if(e[n.place++]!==48)return!1;var i=Mw(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Mw(e,n);if(s===!1)return!1;var o=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var a=Mw(e,n);if(a===!1||e.length!==a+n.place)return!1;var c=e.slice(n.place,a+n.place);
406if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new yt(o),this.s=new yt(c),this.recoveryParam=null,!0};function Dw(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}a2.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=vT(r),n=vT(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Dw(i,r.length),i=i.concat(r),i.push(2),Dw(i,n.length);var s=i.concat(n),o=[48];return Dw(o,s.length),o=o.concat(s),Us.encode(o,e)};var M3e=function(){throw new Error("unsupported")},aD=Us.assert;function ao(t){if(!(this instanceof ao))return new ao(t);typeof t=="string"&&(aD(Object.prototype.hasOwnProperty.call(Hm,t),"Unknown curve "+t),t=Hm[t]),t instanceof Hm.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var D3e=ao;ao.prototype.keyPair=function(e){return new d8(this,e)};ao.prototype.keyFromPrivate=function(e,r){return d8.fromPrivate(this,e,r)};ao.prototype.keyFromPublic=function(e,r){return d8.fromPublic(this,e,r)};ao.prototype.genKeyPair=function(e){e||(e={});for(var r=new oD({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||M3e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yt(2));;){var s=new yt(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ao.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ao.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yt(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new oD({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new yt(1)),u=0;;u++){var f=i.k?i.k(u):new yt(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),g=h.umod(this.n);if(g.cmpn(0)!==0){var b=f.invm(this.n).mul(g.mul(r.getPrivate()).iadd(e));if(b=b.umod(this.n),b.cmpn(0)!==0){var w=(d.getY().isOdd()?1:0)|(h.cmp(g)!==0?2:0);return i.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),w^=1),new c2({r:g,s:b,recoveryParam:w})}}}}}};ao.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yt(e,16)),n=this.keyFromPublic(n,i),r=new c2(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};ao.prototype.recoverPubKey=function(t,e,r,n){aD((3&r)===r,"The recovery param is more than two bits"),e=new c2(e,n);var i=this.n,s=new yt(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};ao.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new c2(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var B3e=Zh(function(t,e){var r=e;r.version="6.5.4",r.utils=Us,r.rand=function(){throw new Error("unsupported")},r.curve=Um,r.curves=Hm,r.ec=D3e,r.eddsa=null}),F3e=B3e.ec;const $3e="signing-key/5.2.0",cD=new re($3e);let Bw=null;function ba(){return Bw||(Bw=new F3e("secp256k1")),Bw}class vf{constructor(e){ae(this,"curve","secp256k1"),ae(this,"privateKey",Ne(e));const r=ba().keyFromPrivate(ve(this.privateKey));ae(this,"publicKey","0x"+r.getPublic(!1,"hex")),ae(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ae(this,"_isSigningKey",!0)}_addPoint(e){const r=ba().keyFromPublic(ve(this.publicKey)),n=ba().keyFromPublic(ve(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}
406signDigest(e){const r=ba().keyFromPrivate(ve(this.privateKey)),n=ve(e);n.length!==32&&cD.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return Kh({recoveryParam:i.recoveryParam,r:cn("0x"+i.r.toString(16),32),s:cn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=ba().keyFromPrivate(ve(this.privateKey)),n=ba().keyFromPublic(ve(h8(e)));return cn("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function lD(t,e){const r=Kh(e),n={r:ve(r.r),s:ve(r.s)};return"0x"+ba().recoverPubKey(ve(t),n,r.recoveryParam).encode("hex",!1)}function h8(t,e){const r=ve(t);if(r.length===32){const n=new vf(r);return e?"0x"+ba().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?Ne(r):"0x"+ba().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+ba().keyFromPublic(r).getPublic(!0,"hex"):Ne(r)}return cD.throwArgumentError("invalid public or private key","key","[REDACTED]")}const L3e="transactions/5.2.0",ls=new re(L3e);function uD(t){return t==="0x"?null:Jr(t)}function ya(t){return t==="0x"?t8:Ie.from(t)}const U3e=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],H3e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0};function Ql(t){const e=h8(t);return Jr(ms(Wr(ms(e,1)),12))}function lg(t,e){return Ql(lD(ve(t),e))}function Ed(t,e){const r=Zl(Ie.from(t).toHexString());return r.length>32&&ls.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Fw(t,e){return{address:Jr(t),storageKeys:(e||[]).map((r,n)=>(lu(r)!==32&&ls.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function nd(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&ls.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Fw(r[0],r[1])):Fw(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Fw(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function j3e(t){return nd(t).map(e=>[e.address,e.storageKeys])}function fD(t,e){const r=[Ed(t.chainId||0,"chainId"),Ed(t.nonce||0,"nonce"),Ed(t.gasPrice||0,"gasPrice"),Ed(t.gasLimit||0,"gasLimit"),t.to!=null?Jr(t.to):"0x",Ed(t.value||0,"value"),t.data||"0x",j3e(t.accessList||[])];if(e){const n=Kh(e);r.push(Ed(n.recoveryParam,"recoveryParam")),r.push(Zl(n.r)),r.push(Zl(n.s))}return Yl(["0x01",kh(r)])}function z3e(t,e){ZE(t,H3e);const r=[];U3e.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=ve(Ne(a,c)),o.length&&a.length!==o.length&&a.length>0&&ls.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=Zl(a),a.length>o.maxLength&&ls.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(Ne(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&ls.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!ig(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(Ne(n)),r.push("0x"),r.push("0x")),!e)return kh(r);const i=Kh(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&ls.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&ls.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Ne(s)),r.push(Zl(ve(i.r))),r.push(Zl(ve(i.s))),kh(r)}function Z6(t,e){if(t.type==null)return t.accessList!=null&&ls.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),z3e(t,e);switch(t.type){case 1:return fD(t,e)}return ls.throwError(`unsupported transaction type: ${t.type}`,re.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function J3e(t){const e=QE(t.slice(1));e.length!==8&&e.length!==11&&ls.throwArgumentError("invalid component count for transaction type: 1","payload",Ne(t));const r={type:1,chainId:ya(e[0]).toNumber(),nonce:ya(e[1]).toNumber(),gasPrice:ya(e[2]),gasLimit:ya(e[3]),to:uD(e[4]),value:ya(e[5]),data:e[6],accessList:nd(e[7])};if(e.length===8)return r;try{const n=ya(e[8]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");r.v=n}catch{ls.throwArgumentError("invalid v for transaction type: 1","v",e[8])}r.r=cn(e[9],32),r.s=cn(e[10],32);try{const n=Wr(fD(r));r.from=lg(n,{r:r.r,s:r.s,recoveryParam:r.v})}catch(n){console.log(n)}return r.hash=Wr(t),r}function q3e(t){const e=QE(t);e.length!==9&&e.length!==6&&ls.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:ya(e[0]).toNumber(),gasPrice:ya(e[1]),gasLimit:ya(e[2]),to:uD(e[3]),value:ya(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=Ie.from(e[6]).toNumber()}catch(n){return console.log(n),r}if(r.r=cn(e[7],32),r.s=cn(e[8],32),Ie.from(r.r).isZero()&&Ie.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(Ne(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Wr(kh(i));try{r.from=lg(s,{r:Ne(r.r),s:Ne(r.s),recoveryParam:n})}catch(o){console.log(o)}r.hash=Wr(t)}return r.type=null,r}function dD(t){const e=ve(t);if(e[0]>127)return q3e(e);switch(e[0]){case 1:return J3e(e)}return ls.throwError(`unsupported transaction type: ${e[0]}`,re.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const G3e="contracts/5.2.0";var du=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};
406const Zr=new re(G3e),V3e={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0};function Yb(t,e){return du(this,void 0,void 0,function*(){const r=yield e;try{return Jr(r)}catch{}t||Zr.throwError("a provider or signer is needed to resolve ENS names",re.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&Zr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function op(t,e,r){return du(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>op(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield Yb(t,e):r.type==="tuple"?yield op(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>op(t,n,r.arrayChildren))):Promise.reject(new Error("invalid value for array")):e})}function l2(t,e,r){return du(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=wn(r.pop())),Zr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=En({override:Yb(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>du(this,void 0,void 0,function*(){return Jr(l.signer)!==l.override&&Zr.throwError("Contract with a Signer cannot override from",re.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=Yb(t.provider,n.from));const i=yield En({args:op(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:En(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=Ie.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=Ie.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=Ie.from(a.gasPrice)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=nd(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=ve(s);for(let f=0;f<u.length;f++)l+=4,u[f]&&(l+=64);o.gasLimit=Ie.from(e.gas).add(l)}if(a.value){const l=Ie.from(a.value);!l.isZero()&&!e.payable&&Zr.throwError("non-payable method cannot override value",re.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),o.value=l}delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList;const c=Object.keys(n).filter(l=>n[l]!=null);return c.length&&Zr.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,re.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function W3e(t,e){return function(...r){return l2(t,e,r)}}function K3e(t,e){const r=t.signer||t.provider;return function(...n){return du(this,void 0,void 0,function*(){r||Zr.throwError("estimate require a provider or signer",re.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield l2(t,e,n);return yield r.estimateGas(i)})}}function hD(t,e,r){const n=t.signer||t.provider;return function(...i){return du(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=wn(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield l2(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===re.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function X3e(t,e){return function(...r){return du(this,void 0,void 0,function*(){t.signer||Zr.throwError("sending a transaction requires a signer",re.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield l2(t,e,r),i=yield t.signer.sendTransaction(n),s=i.wait.bind(i);return i.wait=o=>s(o).then(a=>(a.events=a.logs.map(c=>{let l=Ji(c),u=null;try{u=t.interface.parseLog(c)}catch{}return u&&(l.args=u.args,l.decode=(f,d)=>t.interface.decodeEventLog(u.eventFragment,f,d),l.event=u.name,l.eventSignature=u.signature),l.removeListener=()=>t.provider,l.getBlock=()=>t.provider.getBlock(a.blockHash),l.getTransaction=()=>t.provider.getTransaction(a.transactionHash),l.getTransactionReceipt=()=>Promise.resolve(a),l}),a)),i})}}function wT(t,e,r){return e.constant?hD(t,e,r):X3e(t,e)}function pD(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.to
406pics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class E1{constructor(e,r){ae(this,"tag",e),ae(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class Z3e extends E1{constructor(){super("error",null)}}class ET extends E1{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&Zr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(pD(s),s),ae(this,"address",e),ae(this,"interface",r),ae(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=_M(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class AT extends E1{constructor(e,r){super("*",{address:e}),ae(this,"address",e),ae(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class gD{constructor(e,r,n){Zr.checkNew(new.target,Qb),ae(this,"interface",Yn(new.target,"getInterface")(r)),n==null?(ae(this,"provider",null),ae(this,"signer",null)):vu.isSigner(n)?(ae(this,"provider",n.provider||null),ae(this,"signer",n)):uu.isProvider(n)?(ae(this,"provider",n),ae(this,"signer",null)):Zr.throwArgumentError("invalid signer or provider","signerOrProvider",n),ae(this,"callStatic",{}),ae(this,"estimateGas",{}),ae(this,"functions",{}),ae(this,"populateTransaction",{}),ae(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];ae(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?ae(this.filters,a,this.filters[c[0]]):Zr.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(ae(this,"_runningEvents",{}),ae(this,"_wrappedEmits",{}),e==null&&Zr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ae(this,"address",e),this.provider)ae(this,"resolvedAddress",Yb(this.provider,e));else try{ae(this,"resolvedAddress",Promise.resolve(Jr(e)))}catch{Zr.throwError("provider is required to use ENS name as contract address",re.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){Zr.warn(`Duplicate ABI entry for ${JSON.stringify(name)}`);return}s[o]=!0;{const c=a.name;i[c]||(i[c]=[]),i[c].push(o)}this[o]==null&&ae(this,o,wT(this,a,!0)),this.functions[o]==null&&ae(this.functions,o,wT(this,a,!1)),this.callStatic[o]==null&&ae(this.callStatic,o,hD(this,a,!0)),this.populateTransaction[o]==null&&ae(this.populateTransaction,o,W3e(this,a)),this.estimateGas[o]==null&&ae(this.estimateGas,o,K3e(this,a))}
406),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;const c=a[0];try{this[o]==null&&ae(this,o,this[c])}catch{}this.functions[o]==null&&ae(this.functions,o,this.functions[c]),this.callStatic[o]==null&&ae(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&ae(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&ae(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return i2(e)}static getInterface(e){return v1.isInterface(e)?e:new v1(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&Zr.throwError("contract not deployed",re.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Zr.throwError("sending a transactions require a signer",re.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=wn(e||{});return["from","to"].forEach(function(n){r[n]!=null&&Zr.throwError("cannot override "+n,re.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new w1(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ae(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Kb.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new Z3e);if(e==="event")return this._normalizeRunningEvent(new E1("event",null));if(e==="*")return this._normalizeRunningEvent(new AT(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new ET(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new ET(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new E1(pD(r),r))}return this._normalizeRunningEvent(new AT(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Ji(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||Zr.throwError("events require a provider or a signer with a provider",re.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=wn(i.filter);return typeof r=="string"&&_t(r,32)?(n!=null&&Zr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}
406listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class Qb extends gD{}class Y3e{constructor(e,r,n){let i=null;typeof r=="string"?i=r:yu(r)?i=Ne(r):r&&typeof r.object=="string"?i=r.object:i="!",i.substring(0,2)!=="0x"&&(i="0x"+i),(!_t(i)||i.length%2)&&Zr.throwArgumentError("invalid bytecode","bytecode",r),n&&!vu.isSigner(n)&&Zr.throwArgumentError("invalid signer","signer",n),ae(this,"bytecode",i),ae(this,"interface",Yn(new.target,"getInterface")(e)),ae(this,"signer",n||null)}getDeployTransaction(...e){let r={};if(e.length===this.interface.deploy.inputs.length+1&&typeof e[e.length-1]=="object"){r=wn(e.pop());for(const n in r)if(!V3e[n])throw new Error("unknown transaction override "+n)}return["data","from","to"].forEach(n=>{r[n]!=null&&Zr.throwError("cannot override "+n,re.errors.UNSUPPORTED_OPERATION,{operation:n})}),Zr.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),r.data=Ne(tn([this.bytecode,this.interface.encodeDeploy(e)])),r}deploy(...e){return du(this,void 0,void 0,function*(){let r={};e.length===this.interface.deploy.inputs.length+1&&(r=e.pop()),Zr.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const n=yield op(this.signer,e,this.interface.deploy.inputs);n.push(r);const i=this.getDeployTransaction(...n),s=yield this.signer.sendTransaction(i),o=Yn(this.constructor,"getContractAddress")(s),a=Yn(this.constructor,"getContract")(o,this.interface,this.signer);return ae(a,"deployTransaction",s),a})}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,r){e==null&&Zr.throwError("missing compiler output",re.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),typeof e=="string"&&(e=JSON.parse(e));const n=e.abi;let i=null;return e.bytecode?i=e.bytecode:e.evm&&e.evm.bytecode&&(i=e.evm.bytecode),new this(n,i,r)}static getInterface(e){return Qb.getInterface(e)}static getContractAddress(e){return i2(e)}static getContract(e,r,n){return new Qb(e,r,n)}}class mD{constructor(e){ae(this,"alphabet",e),ae(this,"base",e.length),ae(this,"_alphabetMap",{}),ae(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=ve(e);if(r.length===0)return"";let n=[0];for(let s=0;s<r.length;++s){let o=r[s];for(let a=0;a<n.length;++a)o+=n[a]<<8,n[a]=o%this.base,o=o/this.base|0;for(;o>0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s<r.length-1;++s)i+=this._leader;for(let s=n.length-1;s>=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n<e.length;n++){let i=this._alphabetMap[e[n]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let s=i;for(let o=0;o<r.length;++o)s+=r[o]*this.base,r[o]=s&255,s>>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n<e.length-1;++n)r.push(0);return ve(new Uint8Array(r.reverse()))}}new mD("abcdefghijklmnopqrstuvwxyz234567");const ug=new mD("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Mh;(function(t){t.sha256="sha256",t.sha512="sha512"})(Mh||(Mh={}));const Q3e="sha2/5.2.0",e6e=new re(Q3e);function bD(t){return"0x"+ns.ripemd160().update(ve(t)).digest("hex")}function Yc(t){return"0x"+ns.sha256().update(ve(t)).digest("hex")}function t6e(t){return"0x"+ns.sha512().update(ve(t)).digest("hex")}function A1(t,e,r){return Mh[t]||e6e.throwError("unsupported algorithm "+t,re.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+ns.hmac(ns[t],ve(e)).update(ve(r)).digest("hex")}function p8(t,e,r,n,i){t=ve(t),e=ve(e);let s,o=1;const a=new Uint8Array(n),c=new Uint8Array(e.length+4);c.set(e);let l,u;for(let f=1;f<=o;f++){c[e.length]=f>>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=ve(A1(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let b=1;b<r;b++){d=ve(A1(i,t,d));for(let w=0;w<s;w++)u[w]^=d[w]}const h=(f-1)*s,g=f===o?l:s;a.set(ve(u).slice(0,g),h)}return Ne(a)}const r6e="wordlists/5.2.0",u2=new re(r6e);class Br{constructor(e){u2.checkAbstract(new.target,Br),ae(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const r=[];for(let n=0;n<2048;n++){const i=e.getWord(n);if(n!==e.getWordIndex(i))return"0x";r.push(i)}return jl(r.join(` 407`)+` 408`)}static register(e,r){r||(r=e.locale)}}const n6e="AbdikaceAbecedaAdresaAgreseAkceAktovkaAlejAlkoholAmputaceAnanasAndulkaAnekdotaAnketaAntikaAnulovatArchaAroganceAsfaltAsistentAspiraceAstmaA
408stronomAtlasAtletikaAtolAutobusAzylBabkaBachorBacilBaculkaBadatelBagetaBagrBahnoBakterieBaladaBaletkaBalkonBalonekBalvanBalzaBambusBankomatBarbarBaretBarmanBarokoBarvaBaterkaBatohBavlnaBazalkaBazilikaBazukaBednaBeranBesedaBestieBetonBezinkaBezmocBeztakBicyklBidloBiftekBikinyBilanceBiografBiologBitvaBizonBlahobytBlatouchBlechaBleduleBleskBlikatBliznaBlokovatBlouditBludBobekBobrBodlinaBodnoutBohatostBojkotBojovatBokorysBolestBorecBoroviceBotaBoubelBouchatBoudaBouleBouratBoxerBradavkaBramboraBrankaBratrBreptaBriketaBrkoBrlohBronzBroskevBrunetkaBrusinkaBrzdaBrzyBublinaBubnovatBuchtaBuditelBudkaBudovaBufetBujarostBukviceBuldokBulvaBundaBunkrBurzaButikBuvolBuzolaBydletBylinaBytovkaBzukotCapartCarevnaCedrCeduleCejchCejnCelaCelerCelkemCelniceCeninaCennostCenovkaCentrumCenzorCestopisCetkaChalupaChapadloCharitaChataChechtatChemieChichotChirurgChladChlebaChlubitChmelChmuraChobotChocholChodbaCholeraChomoutChopitChorobaChovChrapotChrlitChrtChrupChtivostChudinaChutnatChvatChvilkaChvostChybaChystatChytitCibuleCigaretaCihelnaCihlaCinkotCirkusCisternaCitaceCitrusCizinecCizostClonaCokolivCouvatCtitelCtnostCudnostCuketaCukrCupotCvaknoutCvalCvikCvrkotCyklistaDalekoDarebaDatelDatumDceraDebataDechovkaDecibelDeficitDeflaceDeklDekretDemokratDepreseDerbyDeskaDetektivDikobrazDiktovatDiodaDiplomDiskDisplejDivadloDivochDlahaDlouhoDluhopisDnesDobroDobytekDocentDochutitDodnesDohledDohodaDohraDojemDojniceDokladDokolaDoktorDokumentDolarDolevaDolinaDomaDominantDomluvitDomovDonutitDopadDopisDoplnitDoposudDoprovodDopustitDorazitDorostDortDosahDoslovDostatekDosudDosytaDotazDotekDotknoutDoufatDoutnatDovozceDozaduDoznatDozorceDrahotaDrakDramatikDravecDrazeDrdolDrobnostDrogerieDrozdDrsnostDrtitDrzostDubenDuchovnoDudekDuhaDuhovkaDusitDusnoDutostDvojiceDvorecDynamitEkologEkonomieElektronElipsaEmailEmiseEmoceEmpatieEpizodaEpochaEpopejEposEsejEsenceEskortaEskymoEtiketaEuforieEvoluceExekuceExkurzeExpediceExplozeExportExtraktFackaFajfkaFakultaFanatikFantazieFarmacieFavoritFazoleFederaceFejetonFenkaFialkaFigurantFilozofFiltrFinanceFintaFixaceFjordFlanelFlirtFlotilaFondFosforFotbalFotkaFotonFrakceFreskaFrontaFukarFunkceFyzikaGalejeGarantGenetikaGeologGilotinaGlazuraGlejtGolemGolfistaGotikaGrafGramofonGranuleGrepGrilGrogGroteskaGumaHadiceHadrHalaHalenkaHanbaHanopisHarfaHarpunaHavranHebkostHejkalHejnoHejtmanHektarHelmaHematomHerecHernaHesloHezkyHistorikHladovkaHlasivkyHlavaHledatHlenHlodavecHlohHloupostHltatHlubinaHluchotaHmatHmotaHmyzHnisHnojivoHnoutHoblinaHobojHochHodinyHodlatHodnotaHodovatHojnostHokejHolinkaHolkaHolubHomoleHonitbaHonoraceHoralHordaHorizontHorkoHorlivecHormonHorninaHoroskopHorstvoHospodaHostinaHotovostHoubaHoufHoupatHouskaHovorHradbaHraniceHravostHrazdaHrbolekHrdinaHrdloHrdostHrnekHrobkaHromadaHrotHroudaHrozenHrstkaHrubostHryzatHubenostHubnoutHudbaHukotHumrHusitaHustotaHvozdHybnostHydrantHygienaHymnaHysterikIdylkaIhnedIkonaIluzeImunitaInfekceInflaceInkasoInovaceInspekceInternetInvalidaInvestorInzerceIronieJablkoJachtaJahodaJakmileJakostJalovecJantarJarmarkJaroJasanJasnoJatkaJavorJazykJedinecJedleJednatelJehlanJekotJelenJelitoJemnostJenomJepiceJeseterJevitJezdecJezeroJinakJindyJinochJiskraJistotaJitrniceJizvaJmenovatJogurtJurtaKabaretKabelKabinetKachnaKadetKadidloKahanKajakKajutaKakaoKaktusKalamitaKalhotyKalibrKalnostKameraKamkolivKamnaKanibalKanoeKantorKapalinaKapelaKapitolaKapkaKapleKapotaKaprKapustaKapybaraKaramelKarotkaKartonKasaKatalogKatedraKauceKauzaKavalecKazajkaKazetaKazivostKdekolivKdesiKedlubenKempKeramikaKinoKlacekKladivoKlamKlapotKlasikaKlaunKlecKlenbaKlepatKlesnoutKlidKlimaKlisnaKloboukKlokanKlopaKloubKlubovnaKlusatKluzkostKmenKmitatKmotrKnihaKnotKoaliceKoberecKobkaKoblihaKobylaKocourKohoutKojenecKokosKoktejlKolapsKoledaKolizeKoloKomandoKometaKomikKomnataKomoraKompasKomunitaKonatKonceptKondiceKonecKonfeseKongresKoninaKonkursKontaktKonzervaKopanecKopieKopnoutKoprovkaKorbelKorektorKormidloKoroptevKorpusKorunaKorytoKorzetKosatecKostkaKotelKotletaKotoulKoukatKoupelnaKousekKouzloKovbojKozaKozorohKrabiceKrachKrajinaKralovatKrasopisKravataKreditKrejcarKresbaKrevetaKriketKritikKrizeKrkavecKrmelecKrmivoKrocanKrokKronikaKropitKroupaKrovkaKrtekKruhadloKrupiceKrutostKrvinkaKrychleKryptaKrystalKrytKudlankaKufrKujnostKuklaKulajdaKulichKulkaKulometKulturaKunaKupodivuKurtKurzorKutilKvalitaKvasinkaKvestorKynologKyselinaKytaraKyticeKytkaKytovecKyvadloLabradorLachtanLadnostLaikLakomecLamelaLampaLanovkaLasiceLasoLasturaLatinkaLavinaLebkaLeckdyLedenLedniceLedovkaLedvinaLegendaLegieLegraceLehceLehkostLehnoutLektvarLenocho
408dLentilkaLepenkaLepidloLetadloLetecLetmoLetokruhLevhartLevitaceLevobokLibraLichotkaLidojedLidskostLihovinaLijavecLilekLimetkaLinieLinkaLinoleumListopadLitinaLitovatLobistaLodivodLogikaLogopedLokalitaLoketLomcovatLopataLopuchLordLososLotrLoudalLouhLoukaLouskatLovecLstivostLucernaLuciferLumpLuskLustraceLviceLyraLyrikaLysinaMadamMadloMagistrMahagonMajetekMajitelMajoritaMakakMakoviceMakrelaMalbaMalinaMalovatMalviceMaminkaMandleMankoMarnostMasakrMaskotMasopustMaticeMatrikaMaturitaMazanecMazivoMazlitMazurkaMdlobaMechanikMeditaceMedovinaMelasaMelounMentolkaMetlaMetodaMetrMezeraMigraceMihnoutMihuleMikinaMikrofonMilenecMilimetrMilostMimikaMincovnaMinibarMinometMinulostMiskaMistrMixovatMladostMlhaMlhovinaMlokMlsatMluvitMnichMnohemMobilMocnostModelkaModlitbaMohylaMokroMolekulaMomentkaMonarchaMonoklMonstrumMontovatMonzunMosazMoskytMostMotivaceMotorkaMotykaMouchaMoudrostMozaikaMozekMozolMramorMravenecMrkevMrtvolaMrzetMrzutostMstitelMudrcMuflonMulatMumieMuniceMusetMutaceMuzeumMuzikantMyslivecMzdaNabouratNachytatNadaceNadbytekNadhozNadobroNadpisNahlasNahnatNahodileNahraditNaivitaNajednouNajistoNajmoutNaklonitNakonecNakrmitNalevoNamazatNamluvitNanometrNaokoNaopakNaostroNapadatNapevnoNaplnitNapnoutNaposledNaprostoNaroditNarubyNarychloNasaditNasekatNaslepoNastatNatolikNavenekNavrchNavzdoryNazvatNebeNechatNeckyNedalekoNedbatNeduhNegaceNehetNehodaNejenNejprveNeklidNelibostNemilostNemocNeochotaNeonkaNepokojNerostNervNesmyslNesouladNetvorNeuronNevinaNezvykleNicotaNijakNikamNikdyNiklNikterakNitroNoclehNohaviceNominaceNoraNorekNositelNosnostNouzeNovinyNovotaNozdraNudaNudleNugetNutitNutnostNutrieNymfaObalObarvitObavaObdivObecObehnatObejmoutObezitaObhajobaObilniceObjasnitObjektObklopitOblastOblekOblibaOblohaObludaObnosObohatitObojekOboutObrazecObrnaObrubaObrysObsahObsluhaObstaratObuvObvazObvinitObvodObvykleObyvatelObzorOcasOcelOcenitOchladitOchotaOchranaOcitnoutOdbojOdbytOdchodOdcizitOdebratOdeslatOdevzdatOdezvaOdhadceOdhoditOdjetOdjinudOdkazOdkoupitOdlivOdlukaOdmlkaOdolnostOdpadOdpisOdploutOdporOdpustitOdpykatOdrazkaOdsouditOdstupOdsunOdtokOdtudOdvahaOdvetaOdvolatOdvracetOdznakOfinaOfsajdOhlasOhniskoOhradaOhrozitOhryzekOkapOkeniceOklikaOknoOkouzlitOkovyOkrasaOkresOkrsekOkruhOkupantOkurkaOkusitOlejninaOlizovatOmakOmeletaOmezitOmladinaOmlouvatOmluvaOmylOnehdyOpakovatOpasekOperaceOpiceOpilostOpisovatOporaOpoziceOpravduOprotiOrbitalOrchestrOrgieOrliceOrlojOrtelOsadaOschnoutOsikaOsivoOslavaOslepitOslnitOslovitOsnovaOsobaOsolitOspalecOstenOstrahaOstudaOstychOsvojitOteplitOtiskOtopOtrhatOtrlostOtrokOtrubyOtvorOvanoutOvarOvesOvlivnitOvoceOxidOzdobaPachatelPacientPadouchPahorekPaktPalandaPalecPalivoPalubaPamfletPamlsekPanenkaPanikaPannaPanovatPanstvoPantoflePaprikaParketaParodiePartaParukaParybaPasekaPasivitaPastelkaPatentPatronaPavoukPaznehtPazourekPeckaPedagogPejsekPekloPelotonPenaltaPendrekPenzePeriskopPeroPestrostPetardaPeticePetrolejPevninaPexesoPianistaPihaPijavicePiklePiknikPilinaPilnostPilulkaPinzetaPipetaPisatelPistolePitevnaPivnicePivovarPlacentaPlakatPlamenPlanetaPlastikaPlatitPlavidloPlazPlechPlemenoPlentaPlesPletivoPlevelPlivatPlnitPlnoPlochaPlodinaPlombaPloutPlukPlynPobavitPobytPochodPocitPoctivecPodatPodcenitPodepsatPodhledPodivitPodkladPodmanitPodnikPodobaPodporaPodrazPodstataPodvodPodzimPoeziePohankaPohnutkaPohovorPohromaPohybPointaPojistkaPojmoutPokazitPoklesPokojPokrokPokutaPokynPolednePolibekPolknoutPolohaPolynomPomaluPominoutPomlkaPomocPomstaPomysletPonechatPonorkaPonurostPopadatPopelPopisekPoplachPoprositPopsatPopudPoradcePorcePorodPoruchaPoryvPosaditPosedPosilaPoskokPoslanecPosouditPospoluPostavaPosudekPosypPotahPotkanPotleskPotomekPotravaPotupaPotvoraPoukazPoutoPouzdroPovahaPovidlaPovlakPovozPovrchPovstatPovykPovzdechPozdravPozemekPoznatekPozorPozvatPracovatPrahoryPraktikaPralesPraotecPraporekPrasePravdaPrincipPrknoProbuditProcentoProdejProfeseProhraProjektProlomitPromilePronikatPropadProrokProsbaProtonProutekProvazPrskavkaPrstenPrudkostPrutPrvekPrvohoryPsanecPsovodPstruhPtactvoPubertaPuchPudlPukavecPuklinaPukrlePultPumpaPuncPupenPusaPusinkaPustinaPutovatPutykaPyramidaPyskPytelRacekRachotRadiaceRadniceRadonRaftRagbyRaketaRakovinaRamenoRampouchRandeRarachRaritaRasovnaRastrRatolestRazanceRazidloReagovatReakceReceptRedaktorReferentReflexRejnokReklamaRekordRekrutRektorReputaceRevizeRevmaRevolverRezervaRiskovatRizikoRobotikaRodokmenRohovkaRokleRokokoRomanetoRopovodRopuchaRorejsRosolRostlinaRotmistrRotopedRotundaRoubenkaRouchoRoupRouraRovinaRovniceRozborRozchodRozdatRozeznatRozhodceRozinkaRozjezdRozkazRozlohaRozmarRozpadRozruchRozsahRoztokRozumRozvodRubrikaRuchadloRukaviceRukopisRybaRybolovRychlostRydloRypadloRytinaRyzostSadistaSahatSakoSamecSamizdatSamotaSanitkaSardinkaSasankaSatelitSazbaSazeniceSborSchovatSebrankaSeceseSedadloSedimentSedloSehnatSejmoutSekeraSektaSekundaSekvojeSemenoSenoServisSesaditSeshoraSeskokSeslatSestraSesuvSesypatSetbaSetinaSetkatSetnoutSetrvatSeverSeznamShodaShrnoutSifonSilniceSirkaSirotekSirupSituaceSkafandrSkaliskoSkanzenSkautSkeptikSkicaSkladbaSkleniceSkloSkluzSkobaSkokanSkoroSkriptaSkrzSkupinaSkvostSkvrnaSlabikaSladidloSlaninaSlastSlavnostSledovatSlepecSlevaSlezinaSlibSlinaSlizniceSlonSloupekSlovoSluchSluhaSlunceSlupkaSlzaSmaragdSmetanaSmilstvoSmlouvaSmogSmradSmrkSmrtkaSmutekSmyslSnadSnahaSnobSobotaSochaSodovkaSokolSopkaSotvaSoubojSoucitSoudceSouhlasSouladSoumrakSoupravaSousedSoutokSouvisetSpalovnaSpasitelSpisSplavSpodekSpojenecSpoluSponzorSpornostSpoustaSprchaSpustitSrandaSrazSrdceSrnaSrnecSrovnatSrpenSrstSrubStaniceStarostaStatikaStavbaStehnoStezkaStodolaStolekStopaStornoStoupatStrachStresStrhnoutStromStrunaStudnaStupniceStvolStykSubjektSubtropySucharSudostSuknoSundatSunoutSurikataSurovinaSvahSvalstvoSvetrSvatbaSvazekSvisleSvitekSvobodaSvodidloSvorkaSvrabSykavkaSykotSynekSynovecSypatSypkostSyrovostSyselSytostTabletkaTabuleTah
408ounTajemnoTajfunTajgaTajitTajnostTaktikaTamhleTamponTancovatTanecTankerTapetaTaveninaTazatelTechnikaTehdyTekutinaTelefonTemnotaTendenceTenistaTenorTeplotaTepnaTeprveTerapieTermoskaTextilTichoTiskopisTitulekTkadlecTkaninaTlapkaTleskatTlukotTlupaTmelToaletaTopinkaTopolTorzoTouhaToulecTradiceTraktorTrampTrasaTraverzaTrefitTrestTrezorTrhavinaTrhlinaTrochuTrojiceTroskaTroubaTrpceTrpitelTrpkostTrubecTruchlitTruhliceTrusTrvatTudyTuhnoutTuhostTundraTuristaTurnajTuzemskoTvarohTvorbaTvrdostTvrzTygrTykevUbohostUbozeUbratUbrousekUbrusUbytovnaUchoUctivostUdivitUhraditUjednatUjistitUjmoutUkazatelUklidnitUklonitUkotvitUkrojitUliceUlitaUlovitUmyvadloUnavitUniformaUniknoutUpadnoutUplatnitUplynoutUpoutatUpravitUranUrazitUsednoutUsilovatUsmrtitUsnadnitUsnoutUsouditUstlatUstrnoutUtahovatUtkatUtlumitUtonoutUtopenecUtrousitUvalitUvolnitUvozovkaUzdravitUzelUzeninaUzlinaUznatVagonValchaValounVanaVandalVanilkaVaranVarhanyVarovatVcelkuVchodVdovaVedroVegetaceVejceVelbloudVeletrhVelitelVelmocVelrybaVenkovVerandaVerzeVeselkaVeskrzeVesniceVespoduVestaVeterinaVeverkaVibraceVichrVideohraVidinaVidleVilaViniceVisetVitalitaVizeVizitkaVjezdVkladVkusVlajkaVlakVlasecVlevoVlhkostVlivVlnovkaVloupatVnucovatVnukVodaVodivostVodoznakVodstvoVojenskyVojnaVojskoVolantVolbaVolitVolnoVoskovkaVozidloVozovnaVpravoVrabecVracetVrahVrataVrbaVrcholekVrhatVrstvaVrtuleVsaditVstoupitVstupVtipVybavitVybratVychovatVydatVydraVyfotitVyhledatVyhnoutVyhoditVyhraditVyhubitVyjasnitVyjetVyjmoutVyklopitVykonatVylekatVymazatVymezitVymizetVymysletVynechatVynikatVynutitVypadatVyplatitVypravitVypustitVyrazitVyrovnatVyrvatVyslovitVysokoVystavitVysunoutVysypatVytasitVytesatVytratitVyvinoutVyvolatVyvrhelVyzdobitVyznatVzaduVzbuditVzchopitVzdorVzduchVzdychatVzestupVzhledemVzkazVzlykatVznikVzorekVzpouraVztahVztekXylofonZabratZabydletZachovatZadarmoZadusitZafoukatZahltitZahoditZahradaZahynoutZajatecZajetZajistitZaklepatZakoupitZalepitZamezitZamotatZamysletZanechatZanikatZaplatitZapojitZapsatZarazitZastavitZasunoutZatajitZatemnitZatknoutZaujmoutZavalitZaveletZavinitZavolatZavrtatZazvonitZbavitZbrusuZbudovatZbytekZdalekaZdarmaZdatnostZdivoZdobitZdrojZdvihZdymadloZeleninaZemanZeminaZeptatZezaduZezdolaZhatitZhltnoutZhlubokaZhotovitZhrubaZimaZimniceZjemnitZklamatZkoumatZkratkaZkumavkaZlatoZlehkaZlobaZlomZlostZlozvykZmapovatZmarZmatekZmijeZmizetZmocnitZmodratZmrzlinaZmutovatZnakZnalostZnamenatZnovuZobrazitZotavitZoubekZoufaleZploditZpomalitZprava
408ZprostitZprudkaZprvuZradaZranitZrcadloZrnitostZrnoZrovnaZrychlitZrzavostZtichaZtratitZubovinaZubrZvednoutZvenkuZveselaZvonZvratZvukovodZvyk";let ap=null;function _T(t){if(ap==null&&(ap=n6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Br.check(t)!=="0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"))throw ap=null,new Error("BIP39 Wordlist for en (English) FAILED")}class i6e extends Br{constructor(){super("cz")}getWord(e){return _T(this),ap[e]}getWordIndex(e){return _T(this),ap.indexOf(e)}}const yD=new i6e;Br.register(yD);const s6e="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductC
408onfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMu
408seumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThe
408nTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let cp=null;function CT(t){if(cp==null&&(cp=s6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Br.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw cp=null,new Error("BIP39 Wordlist for en (English) FAILED")}class o6e extends Br{constructor(){super("en")}getWord(e){return CT(this),cp[e]}getWordIndex(e){return CT(this),cp.indexOf(e)}}const vD=new o6e;Br.register(vD);const a6e="A/bacoAbdomenAbejaAbiertoAbogadoAbonoAbortoAbrazoAbrirAbueloAbusoAcabarAcademiaAccesoAccio/nAceiteAcelgaAcentoAceptarA/cidoAclararAcne/AcogerAcosoActivoActoActrizActuarAcudirAcuerdoAcusarAdictoAdmitirAdoptarAdornoAduanaAdultoAe/reoAfectarAficio/nAfinarAfirmarA/gilAgitarAgoni/aAgostoAgotarAgregarAgrioAguaAgudoA/guilaAgujaAhogoAhorroAireAislarAjedrezAjenoAjusteAlacra/nAlambreAlarmaAlbaA/lbumAlcaldeAldeaAlegreAlejarAlertaAletaAlfilerAlgaAlgodo/nAliadoAlientoAlivioAlmaAlmejaAlmi/barAltarAltezaAltivoAltoAlturaAlumnoAlzarAmableAmanteAmapolaAmargoAmasarA/mbarA/mbitoAmenoAmigoAmistadAmorAmparoAmplioAnchoAncianoAnclaAndarAnde/nAnemiaA/nguloAnilloA/nimoAni/sAnotarAntenaAntiguoAntojoAnualAnularAnuncioA~adirA~ejoA~oApagarAparatoApetitoApioAplicarApodoAporteApoyoAprenderAprobarApuestaApuroAradoAra~aArarA/rbitroA/rbolArbustoArchivoArcoArderArdillaArduoA/reaA/ridoAriesArmoni/aArne/sAromaArpaArpo/nArregloArrozArrugaArteArtistaAsaAsadoAsaltoAscensoAsegurarAseoAsesorAsientoAsiloAsistirAsnoAsombroA/speroAstillaAstroAstutoAsumirAsuntoAtajoAtaqueAtarAtentoAteoA/ticoAtletaA/tomoAtraerAtrozAtu/nAudazAudioAugeAulaAumentoAusenteAutorAvalAvanceAvaroAveAvellanaAvenaAvestruzAvio/nAvisoAyerAyudaAyunoAzafra/nAzarAzoteAzu/carAzufreAzulBabaBaborBacheBahi/aBaileBajarBalanzaBalco/nBaldeBambu/BancoBandaBa~oBarbaBarcoBarnizBarroBa/sculaBasto/nBasuraBatallaBateri/aBatirBatutaBau/lBazarBebe/BebidaBelloBesarBesoBestiaBichoBienBingoBlancoBloqueBlusaBoaBobinaBoboBocaBocinaBodaBodegaBoinaBolaBoleroBolsaBombaBondadBonitoBonoBonsa/iBordeBorrarBosqueBoteBoti/nBo/vedaBozalBravoBrazoBrechaBreveBrilloBrincoBrisaBrocaBromaBronceBroteBrujaBruscoBrutoBuceoBucleBuenoBueyBufandaBufo/nBu/hoBuitreBultoBurbujaBurlaBurroBuscarButacaBuzo/nCaballoCabezaCabinaCabraCacaoCada/verCadenaCaerCafe/Cai/daCaima/nCajaCajo/nCalCalamarCalcioCaldoCalidadCalleCalmaCalorCalvoCamaCambioCamelloCaminoCampoCa/ncerCandilCanelaCanguroCanicaCantoCa~aCa~o/nCaobaCaosCapazCapita/nCapoteCaptarCapuchaCaraCarbo/nCa/rcelCaretaCargaCari~oCarneCarpetaCarroCartaCasaCascoCaseroCaspaCastorCatorceCatreCaudalCausaCazoCebollaCederCedroCeldaCe/lebreCelosoCe/lulaCementoCenizaCentroCercaCerdoCerezaCeroCerrarCertezaCe/spedCetroChacalChalecoChampu/ChanclaChapaCharlaChicoChisteChivoChoqueChozaChuletaChuparCiclo/nCiegoCieloCienCiertoCifraCigarroCimaCincoCineCintaCipre/sCircoCiruelaCisneCitaCiudadClamorClanClaroClaseClaveClienteClimaCli/nicaCobreCoccio/nCochinoCocinaCocoCo/digoCodoCofreCogerCoheteCoji/nCojoColaColchaColegioColgarColinaCollarColmoColumnaCombateComerComidaCo/modoCompraCondeConejoCongaConocerConsejoContarCopaCopiaCorazo/nCorbataCorchoCordo/nCoronaCorrerCoserCosmosCostaCra/neoCra/terCrearCrecerCrei/doCremaCri/aCrimenCriptaCrisisCromoCro/nicaCroquetaCrudoCruzCuadroCuartoCuatroCuboCubrirCucharaCuelloCuentoCuerdaCuestaCuevaCuidarCulebraCulpaCultoCumbreCumplir
408CunaCunetaCuotaCupo/nCu/pulaCurarCuriosoCursoCurvaCutisDamaDanzaDarDardoDa/tilDeberDe/bilDe/cadaDecirDedoDefensaDefinirDejarDelfi/nDelgadoDelitoDemoraDensoDentalDeporteDerechoDerrotaDesayunoDeseoDesfileDesnudoDestinoDesvi/oDetalleDetenerDeudaDi/aDiabloDiademaDiamanteDianaDiarioDibujoDictarDienteDietaDiezDifi/cilDignoDilemaDiluirDineroDirectoDirigirDiscoDise~oDisfrazDivaDivinoDobleDoceDolorDomingoDonDonarDoradoDormirDorsoDosDosisDrago/nDrogaDuchaDudaDueloDue~oDulceDu/oDuqueDurarDurezaDuroE/banoEbrioEcharEcoEcuadorEdadEdicio/nEdificioEditorEducarEfectoEficazEjeEjemploElefanteElegirElementoElevarElipseE/liteElixirElogioEludirEmbudoEmitirEmocio/nEmpateEmpe~oEmpleoEmpresaEnanoEncargoEnchufeEnci/aEnemigoEneroEnfadoEnfermoEnga~oEnigmaEnlaceEnormeEnredoEnsayoEnse~arEnteroEntrarEnvaseEnvi/oE/pocaEquipoErizoEscalaEscenaEscolarEscribirEscudoEsenciaEsferaEsfuerzoEspadaEspejoEspi/aEsposaEspumaEsqui/EstarEsteEstiloEstufaEtapaEternoE/ticaEtniaEvadirEvaluarEventoEvitarExactoExamenExcesoExcusaExentoExigirExilioExistirE/xitoExpertoExplicarExponerExtremoFa/bricaFa/bulaFachadaFa/cilFactorFaenaFajaFaldaFalloFalsoFaltarFamaFamiliaFamosoFarao/nFarmaciaFarolFarsaFaseFatigaFaunaFavorFaxFebreroFechaFelizFeoFeriaFerozFe/rtilFervorFesti/nFiableFianzaFiarFibraFiccio/nFichaFideoFiebreFielFieraFiestaFiguraFijarFijoFilaFileteFilialFiltroFinFincaFingirFinitoFirmaFlacoFlautaFlechaFlorFlotaFluirFlujoFlu/orFobiaFocaFogataFogo/nFolioFolletoFondoFormaForroFortunaForzarFosaFotoFracasoFra/gilFranjaFraseFraudeFrei/rFrenoFresaFri/oFritoFrutaFuegoFuenteFuerzaFugaFumarFuncio/nFundaFurgo/nFuriaFusilFu/tbolFuturoGacelaGafasGaitaGajoGalaGaleri/aGalloGambaGanarGanchoGangaGansoGarajeGarzaGasolinaGastarGatoGavila/nGemeloGemirGenGe/neroGenioGenteGeranioGerenteGermenGestoGiganteGimnasioGirarGiroGlaciarGloboGloriaGolGolfoGolosoGolpeGomaGordoGorilaGorraGotaGoteoGozarGradaGra/ficoGranoGrasaGratisGraveGrietaGrilloGripeGrisGritoGrosorGru/aGruesoGrumoGrupoGuanteGuapoGuardiaGuerraGui/aGui~oGuionGuisoGuitarraGusanoGustarHaberHa/bilHablarHacerHachaHadaHallarHamacaHarinaHazHaza~aHebillaHebraHechoHeladoHelioHembraHerirHermanoHe/roeHervirHieloHierroHi/gadoHigieneHijoHimnoHistoriaHocicoHogarHogueraHojaHombreHongoHonorHonraHoraHormigaHornoHostilHoyoHuecoHuelgaHuertaHuesoHuevoHuidaHuirHumanoHu/medoHumildeHumoHundirHuraca/nHurtoIconoIdealIdiomaI/doloIglesiaIglu/IgualIlegalIlusio/nImagenIma/nImitarImparImperioImponerImpulsoIncapazI/ndiceInerteInfielInformeIngenioInicioInmensoInmuneInnatoInsectoInstanteIntere/sI/ntimoIntuirInu/tilInviernoIraIrisIroni/aIslaIsloteJabali/Jabo/nJamo/nJarabeJardi/nJarraJaulaJazmi/nJefeJeringaJineteJornadaJorobaJovenJoyaJuergaJuevesJuezJugadorJugoJugueteJuicioJuncoJunglaJunioJuntarJu/piterJurarJustoJuvenilJuzgarKiloKoalaLabioLacioLacraLadoLadro/nLagartoLa/grimaLagunaLaicoLamerLa/minaLa/mparaLanaLanchaLangostaLanzaLa/pizLargoLarvaLa/stimaLataLa/texLatirLaurelLavarLazoLealLeccio/nLecheLectorLeerLegio/nLegumbreLejanoLenguaLentoLe~aLeo/nLeopardoLesio/nLetalLetraLeveLeyendaLibertadLibroLicorLi/derLidiarLienzoLigaLigeroLimaLi/miteLimo/nLimpioLinceLindoLi/neaLingoteLinoLinternaLi/quidoLisoListaLiteraLitioLitroLlagaLlamaLlantoLlaveLlegarLlenarLlevarLlorarLloverLluviaLoboLocio/nLocoLocuraLo/gicaLogroLombrizLomoLonjaLoteLuchaLucirLugarLujoLunaLunesLupaLustroLutoLuzMacetaMachoMaderaMadreMaduroMaestroMafiaMagiaMagoMai/zMaldadMaletaMallaMaloMama/MamboMamutMancoMandoManejarMangaManiqui/ManjarManoMansoMantaMa~anaMapaMa/quinaMarMarcoMareaMarfilMargenMaridoMa/rmolMarro/nMartesMarzoMasaMa/scaraMasivoMatarMateriaMatizMatrizMa/ximoMayorMazorcaMechaMedallaMedioMe/dulaMejillaMejorMelenaMelo/nMemoriaMenorMensajeMenteMenu/MercadoMerengueMe/ritoMesMeso/nMetaMeterMe/todoMetroMezclaMiedoMielMiembroMigaMilMilagroMilitarMillo/nMimoMinaMineroMi/nimoMinutoMiopeMirarMisaMiseriaMisilMismoMitadMitoMochilaMocio/nModaModeloMohoMojarMoldeMolerMolinoMomentoMomiaMonarcaMonedaMonjaMontoMo~oMoradaMorderMorenoMorirMorroMorsaMortalMoscaMostrarMotivoMoverMo/vilMozoMuchoMudarMuebleMuelaMuerteMuestraMugreMujerMulaMuletaMultaMundoMu~ecaMuralMuroMu/sculoMuseoMusgoMu/sicaMusloNa/carNacio/nNadarNaipeNaranjaNarizNarrarNasalNatalN
408ativoNaturalNa/useaNavalNaveNavidadNecioNe/ctarNegarNegocioNegroNeo/nNervioNetoNeutroNevarNeveraNichoNidoNieblaNietoNi~ezNi~oNi/tidoNivelNoblezaNocheNo/minaNoriaNormaNorteNotaNoticiaNovatoNovelaNovioNubeNucaNu/cleoNudilloNudoNueraNueveNuezNuloNu/meroNutriaOasisObesoObispoObjetoObraObreroObservarObtenerObvioOcaOcasoOce/anoOchentaOchoOcioOcreOctavoOctubreOcultoOcuparOcurrirOdiarOdioOdiseaOesteOfensaOfertaOficioOfrecerOgroOi/doOi/rOjoOlaOleadaOlfatoOlivoOllaOlmoOlorOlvidoOmbligoOndaOnzaOpacoOpcio/nO/peraOpinarOponerOptarO/pticaOpuestoOracio/nOradorOralO/rbitaOrcaOrdenOrejaO/rganoOrgi/aOrgulloOrienteOrigenOrillaOroOrquestaOrugaOsadi/aOscuroOseznoOsoOstraOto~oOtroOvejaO/vuloO/xidoOxi/genoOyenteOzonoPactoPadrePaellaPa/ginaPagoPai/sPa/jaroPalabraPalcoPaletaPa/lidoPalmaPalomaPalparPanPanalPa/nicoPanteraPa~ueloPapa/PapelPapillaPaquetePararParcelaParedParirParoPa/rpadoParquePa/rrafoPartePasarPaseoPasio/nPasoPastaPataPatioPatriaPausaPautaPavoPayasoPeato/nPecadoPeceraPechoPedalPedirPegarPeinePelarPelda~oPeleaPeligroPellejoPeloPelucaPenaPensarPe~o/nPeo/nPeorPepinoPeque~oPeraPerchaPerderPerezaPerfilPericoPerlaPermisoPerroPersonaPesaPescaPe/simoPesta~aPe/taloPetro/leoPezPezu~aPicarPicho/nPiePiedraPiernaPiezaPijamaPilarPilotoPimientaPinoPintorPinzaPi~aPiojoPipaPirataPisarPiscinaPisoPistaPito/nPizcaPlacaPlanPlataPlayaPlazaPleitoPlenoPlomoPlumaPluralPobrePocoPoderPodioPoemaPoesi/aPoetaPolenPolici/aPolloPolvoPomadaPomeloPomoPompaPonerPorcio/nPortalPosadaPoseerPosiblePostePotenciaPotroPozoPradoPrecozPreguntaPremioPrensaPresoPrevioPrimoPri/ncipePrisio/nPrivarProaProbarProcesoProductoProezaProfesorProgramaProlePromesaProntoPropioPro/ximoPruebaPu/blicoPucheroPudorPuebloPuertaPuestoPulgaPulirPulmo/nPulpoPulsoPumaPuntoPu~alPu~oPupaPupilaPure/QuedarQuejaQuemarQuererQuesoQuietoQui/micaQuinceQuitarRa/banoRabiaRaboRacio/nRadicalRai/zRamaRampaRanchoRangoRapazRa/pidoRaptoRasgoRaspaRatoRayoRazaRazo/nReaccio/nRealidadReba~oReboteRecaerRecetaRechazoRecogerRecreoRectoRecursoRedRedondoReducirReflejoReformaRefra/nRefugioRegaloRegirReglaRegresoRehe/nReinoRei/rRejaRelatoRelevoRelieveRellenoRelojRemarRemedioRemoRencorRendirRentaRepartoRepetirReposoReptilResRescateResinaRespetoRestoResumenRetiroRetornoRetratoReunirReve/sRevistaReyRezarRicoRiegoRiendaRiesgoRifaRi/gidoRigorRinco/nRi~o/nRi/oRiquezaRisaRitmoRitoRizoRobleRoceRociarRodarRodeoRodillaRoerRojizoRojoRomeroRomperRonRoncoRondaRopaRoperoRosaRoscaRostroRotarRubi/RuborRudoRuedaRugirRuidoRuinaRuletaRuloRumboRumorRupturaRutaRutinaSa/badoSaberSabioSableSacarSagazSagradoSalaSaldoSaleroSalirSalmo/nSalo/nSalsaSaltoSaludSalvarSambaSancio/nSandi/aSanearSangreSanidadSanoSantoSapoSaqueSardinaSarte/nSastreSata/nSaunaSaxofo/nSeccio/nSecoSecretoSectaSedSeguirSeisSelloSelvaSemanaSemillaSendaSensorSe~alSe~orSepararSepiaSequi/aSerSerieSermo/nServirSesentaSesio/nSetaSetentaSeveroSexoSextoSidraSiestaSieteSigloSignoSi/labaSilbarSilencioSillaSi/mboloSimioSirenaSistemaSitioSituarSobreSocioSodioSolSolapaSoldadoSoledadSo/lidoSoltarSolucio/nSombraSondeoSonidoSonoroSonrisaSopaSoplarSoporteSordoSorpresaSorteoSoste/nSo/tanoSuaveSubirSucesoSudorSuegraSueloSue~oSuerteSufrirSujetoSulta/nSumarSuperarSuplirSuponerSupremoSurSurcoSure~oSurgirSustoSutilTabacoTabiqueTablaTabu/TacoTactoTajoTalarTalcoTalentoTallaTalo/nTama~oTamborTangoTanqueTapaTapeteTapiaTapo/nTaquillaTardeTareaTarifaTarjetaTarotTarroTartaTatuajeTauroTazaTazo/nTeatroTechoTeclaTe/cnicaTejadoTejerTejidoTelaTele/fonoTemaTemorTemploTenazTenderTenerTenisTensoTeori/aTerapiaTercoTe/rminoTernuraTerrorTesisTesoroTestigoTeteraTextoTezTibioTiburo/nTiempoTiendaTierraTiesoTigreTijeraTildeTimbreTi/midoTimoTintaTi/oTi/picoTipoTiraTiro/nTita/nTi/tereTi/tuloTizaToallaTobilloTocarTocinoTodoTogaToldoTomarTonoTontoToparTopeToqueTo/raxToreroTormentaTorneoToroTorpedoTorreTorsoTortugaTosToscoToserTo/xicoTrabajoTractorTraerTra/ficoTragoTrajeTramoTranceTratoTraumaTrazarTre/bolTreguaTreintaTrenTreparTresTribuTrigoTripaTristeTriunfoTrofeoTrompaTroncoTropaTroteTrozoTrucoTruenoTrufaTuberi/aTuboTuertoTumbaTumorTu/nelTu/nicaTurbinaTurismoTurnoTutorUbicarU/lceraUmbralUnidadUnirUniversoUnoUntarU~aUrbanoUrbeUrgenteUrnaUsarUsuarioU/tilUtopi/aUvaVacaVaci/oVacunaVagarVagoVainaVajillaValeVa/lidoValleValorVa/lvulaVampiroVaraVariarVaro/nVasoVecinoVectorVehi/culoVeinteVejezVelaVeleroVelozVenaVencerVendaVenenoVengarVenirVentaVenusVerVeranoVerboVerdeVeredaVerjaVersoVerterVi/aViajeVibrarVicioVi/ctimaVidaVi/deoVidrioViejoViernesVigorVilVillaVinagreVinoVi~edoVioli/nViralVirgoVirtudVisorVi/speraVistaVitaminaViudoVivazViveroVivirVivoVolca/nVolumenVolverVorazVotarVotoVozVueloVulgarYacerYateYeguaYemaYernoYesoYodoYogaYogurZafiroZanjaZapatoZarzaZonaZorroZumoZurdo",wD={};let H0=null;function ED(t){return u2.checkNormalize(),on(Array.prototype.filter.call(ln(t.normalize("NFD").toLowerCase()),e=>e>=65&&e<=90||e>=97&&e<=123))}function c6e(t){const e=[];return Array.prototype.forEach.call(ln(t),r=>
408{r===47?(e.push(204),e.push(129)):r===126?(e.push(110),e.push(204),e.push(131)):e.push(r)}),on(e)}function ST(t){if(H0==null&&(H0=a6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" ").map(e=>c6e(e)),H0.forEach((e,r)=>{wD[ED(e)]=r}),Br.check(t)!=="0xf74fb7092aeacdfbf8959557de22098da512207fb9f109cb526994938cf40300"))throw H0=null,new Error("BIP39 Wordlist for es (Spanish) FAILED")}class l6e extends Br{constructor(){super("es")}getWord(e){return ST(this),H0[e]}getWordIndex(e){return ST(this),wD[ED(e)]}}const AD=new l6e;Br.register(AD);const u6e="AbaisserAbandonAbdiquerAbeilleAbolirAborderAboutirAboyerAbrasifAbreuverAbriterAbrogerAbruptAbsenceAbsoluAbsurdeAbusifAbyssalAcade/mieAcajouAcarienAccablerAccepterAcclamerAccoladeAccrocheAccuserAcerbeAchatAcheterAcidulerAcierAcompteAcque/rirAcronymeActeurActifActuelAdepteAde/quatAdhe/sifAdjectifAdjugerAdmettreAdmirerAdopterAdorerAdoucirAdresseAdroitAdulteAdverbeAe/rerAe/ronefAffaireAffecterAfficheAffreuxAffublerAgacerAgencerAgileAgiterAgraferAgre/ableAgrumeAiderAiguilleAilierAimableAisanceAjouterAjusterAlarmerAlchimieAlerteAlge-breAlgueAlie/nerAlimentAlle/gerAlliageAllouerAllumerAlourdirAlpagaAltesseAlve/oleAmateurAmbiguAmbreAme/nagerAmertumeAmidonAmiralAmorcerAmourAmovibleAmphibieAmpleurAmusantAnalyseAnaphoreAnarchieAnatomieAncienAne/antirAngleAngoisseAnguleuxAnimalAnnexerAnnonceAnnuelAnodinAnomalieAnonymeAnormalAntenneAntidoteAnxieuxApaiserApe/ritifAplanirApologieAppareilAppelerApporterAppuyerAquariumAqueducArbitreArbusteArdeurArdoiseArgentArlequinArmatureArmementArmoireArmureArpenterArracherArriverArroserArsenicArte/rielArticleAspectAsphalteAspirerAssautAsservirAssietteAssocierAssurerAsticotAstreAstuceAtelierAtomeAtriumAtroceAttaqueAttentifAttirerAttraperAubaineAubergeAudaceAudibleAugurerAuroreAutomneAutrucheAvalerAvancerAvariceAvenirAverseAveugleAviateurAvideAvionAviserAvoineAvouerAvrilAxialAxiomeBadgeBafouerBagageBaguetteBaignadeBalancerBalconBaleineBalisageBambinBancaireBandageBanlieueBannie-reBanquierBarbierBarilBaronBarqueBarrageBassinBastionBatailleBateauBatterieBaudrierBavarderBeletteBe/lierBeloteBe/ne/ficeBerceauBergerBerlineBermudaBesaceBesogneBe/tailBeurreBiberonBicycleBiduleBijouBilanBilingueBillardBinaireBiologieBiopsieBiotypeBiscuitBisonBistouriBitumeBizarreBlafardBlagueBlanchirBlessantBlinderBlondBloquerBlousonBobardBobineBoireBoiserBolideBonbonBondirBonheurBonifierBonusBordureBorneBotteBoucleBoueuxBougieBoulonBouquinBourseBoussoleBoutiqueBoxeurBrancheBrasierBraveBrebisBre-cheBreuvageBricolerBrigadeBrillantBriocheBriqueBrochureBroderBronzerBrousseBroyeurBrumeBrusqueBrutalBruyantBuffleBuissonBulletinBureauBurinBustierButinerButoirBuvableBuvetteCabanonCabineCachetteCadeauCadreCafe/ineCaillouCaissonCalculerCalepinCalibreCalmerCalomnieCalvaireCamaradeCame/raCamionCampagneCanalCanetonCanonCantineCanularCapableCaporalCapriceCapsuleCapterCapucheCarabineCarboneCaresserCaribouCarnageCarotteCarreauCartonCascadeCasierCasqueCassureCauserCautionCavalierCaverneCaviarCe/dilleCeintureCe/lesteCelluleCendrierCensurerCentralCercleCe/re/bralCeriseCernerCerveauCesserChagrinChaiseChaleurChambreChanceChapitreCharbonChasseurChatonChaussonChavirerChemiseChenilleChe/quierChercherChevalChienChiffreChignonChime-reChiotChlorureChocolatChoisirChoseChouetteChromeChuteCigareCigogneCimenterCine/maCintrerCirculerCirerCirqueCiterneCitoyenCitronCivilClaironClameurClaquerClasseClavierClientClignerClimatClivageClocheClonageCloporteCobaltCobraCocasseCocotierCoderCodifierCoffreCognerCohe/sionCoifferCoincerCole-reColibriCollineColmaterColonelCombatCome/dieCommandeCompactConcertConduireConfierCongelerConnoterConsonneContactConvexeCopainCopieCorailCorbeauCordageCornicheCorpusCorrectCorte-geCosmiqueCostumeCotonCoudeCoupureCourageCouteauCouvrirCoyoteCrabeCrainteCravateCrayonCre/atureCre/diterCre/meuxCreuserCrevetteCriblerCrierCristalCrite-reCroireCroquerCrotaleCrucialCruelCrypterCubiqueCueillirCuille-reCuisineCuivreCulminerCultiverCumulerCupideCuratifCurseurCyanureCycleCylindreCyniqueDaignerDamierDangerDanseurDauphinDe/battreDe/biterDe/borderDe/briderDe/butantDe/calerDe/cembreDe/chirerDe/ciderDe/clarerDe/corerDe/crireDe/cuplerDe/daleDe/ductifDe/esseDe/fensifDe/filerDe/frayerDe/gagerDe/givrerDe/glutirDe/graferDe/jeunerDe/liceDe/logerDemanderDemeurerDe/molirDe/nicherDe/nouerDentelleDe/nuderDe/partDe/penserDe/phaserDe/placerDe/poserDe/rangerDe/roberDe/sastreDescenteDe/sertDe/signerDe/sobe/irDessinerDestrierDe/tacherDe/testerDe/tourerDe/tresseDevancerDevenirDevinerDevoirDiableDialogueDiamantDicterDiffe/rerDige/rerDigitalDigneDiluerDimancheDiminuerDioxydeDirectifDirigerDiscuterDisposerDissiperDistanceDivertirDiviserDocileDocteurDogmeDoigtDomaineDomicileDompterDonateurDonjonDonnerDopamineDortoirDorureDosageDoseurDossierDotationDouanierDoubleDouceurDouterDoyenDragonDraperDresserDribblerDroitureDuperieDuplexeDurableDurcirDynastieE/blouirE/carterE/charpeE/chelleE/clairerE/clipseE/cloreE/cluseE/coleE/conomieE/corceE/couterE/craserE/cre/merE/crivainE/crouE/cumeE/cureuilE/difierE/duquerEffacerEffectifEffigieEffortEffrayerEffusionE/galiserE/garerE/jecterE/laborerE/largirE/lectronE/le/gantE/le/phantE/le-veE/ligibleE/litismeE/logeE/luciderE/luderEmballerEmbellirEmbryonE/meraudeE/missionEmmenerE/motionE/mouvoirEmpereurEmployerEmporterEmpriseE/mulsionEncadrerEnche-reEnclaveEncocheEndiguerEndosserEndroitEnduireE/nergieEnfanceEnfermerEnfouirEngagerEnginEngloberE/nigmeEnjamberEnjeuEnleverEnnemiEnnuyeuxEnrichirEnrobageEnseigneEntasserEntendreEntierEntourerEntraverE/nume/rerEnvahirEnv
408iableEnvoyerEnzymeE/olienE/paissirE/pargneE/patantE/pauleE/picerieE/pide/mieE/pierE/pilogueE/pineE/pisodeE/pitapheE/poqueE/preuveE/prouverE/puisantE/querreE/quipeE/rigerE/rosionErreurE/ruptionEscalierEspadonEspe-ceEspie-gleEspoirEspritEsquiverEssayerEssenceEssieuEssorerEstimeEstomacEstradeE/tage-reE/talerE/tancheE/tatiqueE/teindreE/tendoirE/ternelE/thanolE/thiqueEthnieE/tirerE/tofferE/toileE/tonnantE/tourdirE/trangeE/troitE/tudeEuphorieE/valuerE/vasionE/ventailE/videnceE/viterE/volutifE/voquerExactExage/rerExaucerExcellerExcitantExclusifExcuseExe/cuterExempleExercerExhalerExhorterExigenceExilerExisterExotiqueExpe/dierExplorerExposerExprimerExquisExtensifExtraireExulterFableFabuleuxFacetteFacileFactureFaiblirFalaiseFameuxFamilleFarceurFarfeluFarineFaroucheFascinerFatalFatigueFauconFautifFaveurFavoriFe/brileFe/conderFe/de/rerFe/linFemmeFe/murFendoirFe/odalFermerFe/roceFerveurFestivalFeuilleFeutreFe/vrierFiascoFicelerFictifFide-leFigureFilatureFiletageFilie-reFilleulFilmerFilouFiltrerFinancerFinirFioleFirmeFissureFixerFlairerFlammeFlasqueFlatteurFle/auFle-cheFleurFlexionFloconFloreFluctuerFluideFluvialFolieFonderieFongibleFontaineForcerForgeronFormulerFortuneFossileFoudreFouge-reFouillerFoulureFourmiFragileFraiseFranchirFrapperFrayeurFre/gateFreinerFrelonFre/mirFre/ne/sieFre-reFriableFrictionFrissonFrivoleFroidFromageFrontalFrotterFruitFugitifFuiteFureurFurieuxFurtifFusionFuturGagnerGalaxieGalerieGambaderGarantirGardienGarnirGarrigueGazelleGazonGe/antGe/latineGe/luleGendarmeGe/ne/ralGe/nieGenouGentilGe/ologieGe/ome-treGe/raniumGermeGestuelGeyserGibierGiclerGirafeGivreGlaceGlaiveGlisserGlobeGloireGlorieuxGolfeurGommeGonflerGorgeGorilleGoudronGouffreGoulotGoupilleGourmandGoutteGraduelGraffitiGraineGrandGrappinGratuitGravirGrenatGriffureGrillerGrimperGrognerGronderGrotteGroupeGrugerGrutierGruye-reGue/pardGuerrierGuideGuimauveGuitareGustatifGymnasteGyrostatHabitudeHachoirHalteHameauHangarHannetonHaricotHarmonieHarponHasardHe/liumHe/matomeHerbeHe/rissonHermineHe/ronHe/siterHeureuxHibernerHibouHilarantHistoireHiverHomardHommageHomoge-neHonneurHonorerHonteuxHordeHorizonHorlogeHormoneHorribleHouleuxHousseHublotHuileuxHumainHumbleHumideHumourHurlerHydromelHygie-neHymneHypnoseIdylleIgnorerIguaneIlliciteIllusionImageImbiberImiterImmenseImmobileImmuableImpactImpe/rialImplorerImposerImprimerImputerIncarnerIncendieIncidentInclinerIncoloreIndexerIndiceInductifIne/ditIneptieInexactInfiniInfligerInformerInfusionInge/rerInhalerInhiberInjecterInjureInnocentInoculerInonderInscrireInsecteInsigneInsoliteInspirerInstinctInsulterIntactIntenseIntimeIntrigueIntuitifInutileInvasionInventerInviterInvoquerIroniqueIrradierIrre/elIrriterIsolerIvoireIvresseJaguarJaillirJambeJanvierJardinJaugerJauneJavelotJetableJetonJeudiJeunesseJoindreJoncherJonglerJoueurJouissifJournalJovialJoyauJoyeuxJubilerJugementJuniorJuponJuristeJusticeJuteuxJuve/nileKayakKimonoKiosqueLabelLabialLabourerLace/rerLactoseLaguneLaineLaisserLaitierLambeauLamelleLampeLanceurLangageLanterneLapinLargeurLarmeLaurierLavaboLavoirLectureLe/galLe/gerLe/gumeLessiveLettreLevierLexiqueLe/zardLiasseLibe/rerLibreLicenceLicorneLie-geLie-vreLigatureLigoterLigueLimerLimiteLimonadeLimpideLine/aireLingotLionceauLiquideLisie-reListerLithiumLitigeLittoralLivreurLogiqueLointainLoisirLombricLoterieLouerLourdLoutreLouveLoyalLubieLucideLucratifLueurLugubreLuisantLumie-reLunaireLundiLuronLutterLuxueuxMachineMagasinMagentaMagiqueMaigreMaillonMaintienMairieMaisonMajorerMalaxerMale/ficeMalheurMaliceMalletteMammouthMandaterManiableManquantManteauManuelMarathonMarbreMarchandMardiMaritimeMarqueurMarronMartelerMascotteMassifMate/rielMatie-reMatraqueMaudireMaussadeMauveMaximalMe/chantMe/connuMe/dailleMe/decinMe/diterMe/duseMeilleurMe/langeMe/lodieMembreMe/moireMenacerMenerMenhirMensongeMentorMercrediMe/riteMerleMessagerMesureMe/talMe/te/oreMe/thodeMe/tierMeubleMiaulerMicrobeMietteMignonMigrerMilieuMillionMimiqueMinceMine/ralMinimalMinorerMinuteMiracleMiroiterMissileMixteMobileModerneMoelleuxMondialMoniteurMonnaieMonotoneMonstreMontagneMonumentMoqueurMorceauMorsureMortierMoteurMotifMoucheMoufleMoulinMoussonMoutonMouvantMultipleMunitionMurailleMure-neMurmureMuscleMuse/umMusicienMutationMuterMutuelMyriadeMyrtilleMyste-reMythiqueNageurNappeNarquoisNarrerNatationNationNatureNaufrageNautiqueNavireNe/buleuxNectarNe/fasteNe/gationNe/gligerNe/gocierNeigeNerveuxNettoyerNeuroneNeutronNeveuNiche
408NickelNitrateNiveauNobleNocifNocturneNoirceurNoisetteNomadeNombreuxNommerNormatifNotableNotifierNotoireNourrirNouveauNovateurNovembreNoviceNuageNuancerNuireNuisibleNume/roNuptialNuqueNutritifObe/irObjectifObligerObscurObserverObstacleObtenirObturerOccasionOccuperOce/anOctobreOctroyerOctuplerOculaireOdeurOdorantOffenserOfficierOffrirOgiveOiseauOisillonOlfactifOlivierOmbrageOmettreOnctueuxOndulerOne/reuxOniriqueOpaleOpaqueOpe/rerOpinionOpportunOpprimerOpterOptiqueOrageuxOrangeOrbiteOrdonnerOreilleOrganeOrgueilOrificeOrnementOrqueOrtieOscillerOsmoseOssatureOtarieOuraganOursonOutilOutragerOuvrageOvationOxydeOxyge-neOzonePaisiblePalacePalmare-sPalourdePalperPanachePandaPangolinPaniquerPanneauPanoramaPantalonPapayePapierPapoterPapyrusParadoxeParcelleParesseParfumerParlerParoleParrainParsemerPartagerParureParvenirPassionPaste-quePaternelPatiencePatronPavillonPavoiserPayerPaysagePeignePeintrePelagePe/licanPellePelousePeluchePendulePe/ne/trerPe/niblePensifPe/nuriePe/pitePe/plumPerdrixPerforerPe/riodePermuterPerplexePersilPertePeserPe/talePetitPe/trirPeuplePharaonPhobiePhoquePhotonPhrasePhysiquePianoPicturalPie-cePierrePieuvrePilotePinceauPipettePiquerPiroguePiscinePistonPivoterPixelPizzaPlacardPlafondPlaisirPlanerPlaquePlastronPlateauPleurerPlexusPliagePlombPlongerPluiePlumagePochettePoe/siePoe-tePointePoirierPoissonPoivrePolairePolicierPollenPolygonePommadePompierPonctuelPonde/rerPoneyPortiquePositionPosse/derPosturePotagerPoteauPotionPoucePoulainPoumonPourprePoussinPouvoirPrairiePratiquePre/cieuxPre/direPre/fixePre/ludePre/nomPre/sencePre/textePre/voirPrimitifPrincePrisonPriverProble-meProce/derProdigeProfondProgre-sProieProjeterProloguePromenerPropreProspe-reProte/gerProuesseProverbePrudencePruneauPsychosePublicPuceronPuiserPulpePulsarPunaisePunitifPupitrePurifierPuzzlePyramideQuasarQuerelleQuestionQuie/tudeQuitterQuotientRacineRaconterRadieuxRagondinRaideurRaisinRalentirRallongeRamasserRapideRasageRatisserRavagerRavinRayonnerRe/actifRe/agirRe/aliserRe/animerRecevoirRe/citerRe/clamerRe/colterRecruterReculerRecyclerRe/digerRedouterRefaireRe/flexeRe/formerRefrainRefugeRe/galienRe/gionRe/glageRe/gulierRe/ite/rerRejeterRejouerRelatifReleverReliefRemarqueReme-deRemiseRemonterRemplirRemuerRenardRenfortReniflerRenoncerRentrerRenvoiReplierReporterRepriseReptileRequinRe/serveRe/sineuxRe/soudreRespectResterRe/sultatRe/tablirRetenirRe/ticuleRetomberRetracerRe/unionRe/ussirRevancheRevivreRe/volteRe/vulsifRichesseRideauRieurRigideRigolerRincerRiposterRisibleRisqueRituelRivalRivie-reRocheuxRomanceRompreRonceRondinRoseauRosierRotatifRotorRotuleRougeRouilleRouleauRoutineRoyaumeRubanRubisRucheRuelleRugueuxRuinerRuisseauRuserRustiqueRythmeSablerSaboterSabreSacocheSafariSagesseSaisirSaladeSaliveSalonSaluerSamediSanctionSanglierSarcasmeSardineSaturerSaugrenuSaumonSauterSauvageSavantSavonnerScalpelScandaleSce/le/ratSce/narioSceptreSche/maScienceScinderScoreScrutinSculpterSe/anceSe/cableSe/cherSecouerSe/cre/terSe/datifSe/duireSeigneurSe/jourSe/lectifSemaineSemblerSemenceSe/minalSe/nateurSensibleSentenceSe/parerSe/quenceSereinSergentSe/rieuxSerrureSe/rumServiceSe/sameSe/virSevrageSextupleSide/ralSie-cleSie/gerSifflerSigleSignalSilenceSiliciumSimpleSince-reSinistreSiphonSiropSismiqueSituerSkierSocialSocleSodiumSoigneuxSoldatSoleilSolitudeSolubleSombreSommeilSomnolerSondeSongeurSonnetteSonoreSorcierSortirSosieSottiseSoucieuxSoudureSouffleSouleverSoupapeSourceSoutirerSouvenirSpacieuxSpatialSpe/cialSphe-reSpiralStableStationSternumStimulusStipulerStrictStudieuxStupeurStylisteSublimeSubstratSubtilSubvenirSucce-sSucreSuffixeSugge/rerSuiveurSulfateSuperbeSupplierSurfaceSuricateSurmenerSurpriseSursautSurvieSuspectSyllabeSymboleSyme/trieSynapseSyntaxeSyste-meTabacTablierTactileTaillerTalentTalismanTalonnerTambourTamiserTangibleTapisTaquinerTarderTarifTartineTasseTatamiTatouageTaupeTaureauTaxerTe/moinTemporelTenailleTendreTeneurTenirTensionTerminerTerneTerribleTe/tineTexteThe-meThe/orieThe/rapieThoraxTibiaTie-deTimideTirelireTiroirTissuTitaneTitreTituberTobogganTole/rantTomateToniqueTonneauToponymeTorcheTordreTornadeTorpilleTorrentTorseTortueTotemToucherTournageTousserToxineTractionTraficTragiqueTrahirTrainTrancherTravailTre-fleTremperTre/sorTreuilTriageTribunalTricoterTrilogieTriompheTriplerTriturerTrivialTromboneTroncTropicalTroupeauTuileTulipeTumulteTunnelTurbineTuteurTutoyerTuyauTympanTyphonTypiqueTyranUbuesqueUltimeUltrasonUnanimeUnifierUnionUniqueUnitaireUniversUraniumUrbainUrticantUsageUsineUsuelUsureUtileUtopieVacarmeVaccinVagabondVagueVaillantVaincreVaisseauValableValiseVallonValveVampireVanilleVapeurVarierVaseuxVassalVasteVecteurVedetteVe/ge/talVe/hiculeVeinardVe/loceVendrediVe/ne/rerVengerVenimeuxVentouseVerdureVe/rinVernirVerrouVerserVertuVestonVe/te/ranVe/tusteVexantVexerViaducViandeVictoireVidangeVide/oVignetteVigueurVilainVillageVinaigreViolonVipe-reVirementVirtuoseVirusVisageViseurVisionVisqueuxVisuelVitalVitesseViticoleVitrineVivaceVivipareVocationVoguerVoileVoisinVoitureVolailleVolcanVoltigerVolumeVoraceVortexVoterVouloirVoyageVoyelleWagonXe/nonYachtZe-breZe/nithZesteZoologie";let j0=null;const _D={};function CD(t){return u2.checkNormalize(),on(Array.prototype.filter.call(ln(t.normalize("NFD").toLowerCase()),e=>e>=65&&e<=90||e>=97&&e<=123))}function f6e(t){const e=[];return Array.prototype.forEach.call(ln(t),r=>{r===47?(e.push(204),e.push(129)):r===45?(e.push(204),e.push(128)):e.push(r)}),on(e)}function TT(t){if(j0==null&&(j0=u6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" ").map(e=>f6e(e)),j0.forEach((e,r)=>{_D[CD(e)]=r}),Br.check(t)!=="0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045"))throw j0=null,new Error("BIP39 Wordlist for fr (French) FAILED")}class d6e extends Br{constructor(){super("fr")}getWord(e){return TT(this),j0[e]}getWordIndex(e){return TT(this),_D[CD(e)]}}const SD=new d6e;Br.register(SD);
408const h6e=["AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHGIFGgBGVXGVEGVRGmXGsXGdYGoSGbRGnXGwXGwDGWRGFNGFLGFOGFdGFkEABEBDEBFEXOEaBEKSENBENDEYXEIgEIkEgBEgQEgHEhFEudEuFEiBEiHEiFEZDEvBEsXEsFEdXEdREkFEbBEbRElFEPCEfkEFNYAEYAhYBNYQdYDXYSRYCEYYoYgQYgRYuRYmCYZTYdBYbEYlXYjQYRbYWRpKXpQopQnpSFpCXpIBpISphNpdBpdRpbRpcZpFBpFNpFDpFopFrLADLBuLXQLXcLaFLCXLEhLpBLpFLHXLeVLhILdHLdRLoDLbRLrXIABIBQIBCIBsIBoIBMIBRIXaIaRIKYIKRINBINuICDIGBIIDIIkIgRIxFIyQIiHIdRIbYIbRIlHIwRIMYIcRIRVITRIFBIFNIFQOABOAFOBQOaFONBONMOQFOSFOCDOGBOEQOpBOLXOIBOIFOgQOgFOyQOycOmXOsXOdIOkHOMEOMkOWWHBNHXNHXWHNXHDuHDRHSuHSRHHoHhkHmRHdRHkQHlcHlRHwBHWcgAEgAggAkgBNgBQgBEgXOgYcgLXgHjgyQgiBgsFgdagMYgWSgFQgFEVBTVXEVKBVKNVKDVKYVKRVNBVNYVDBVDxVSBVSRVCjVGNVLXVIFVhBVhcVsXVdRVbRVlRhBYhKYhDYhGShxWhmNhdahdkhbRhjohMXhTRxAXxXSxKBxNBxEQxeNxeQxhXxsFxdbxlHxjcxFBxFNxFQxFOxFoyNYyYoybcyMYuBQuBRuBruDMuCouHBudQukkuoBulVuMXuFEmCYmCRmpRmeDmiMmjdmTFmFQiADiBOiaRiKRiNBiNRiSFiGkiGFiERipRiLFiIFihYibHijBijEiMXiWBiFBiFCUBQUXFUaRUNDUNcUNRUNFUDBUSHUCDUGBUGFUEqULNULoUIRUeEUeYUgBUhFUuRUiFUsXUdFUkHUbBUjSUjYUwXUMDUcHURdUTBUrBUrXUrQZAFZXZZaRZKFZNBZQFZCXZGBZYdZpBZLDZIFZHXZHNZeQZVRZVFZmXZiBZvFZdFZkFZbHZbFZwXZcCZcRZRBvBQvBGvBLvBWvCovMYsAFsBDsaRsKFsNFsDrsSHsSFsCXsCRsEBsEHsEfspBsLBsLDsIgsIRseGsbRsFBsFQsFSdNBdSRdCVdGHdYDdHcdVbdySduDdsXdlRdwXdWYdWcdWRkBMkXOkaRkNIkNFkSFkCFkYBkpRkeNkgBkhVkmXksFklVkMBkWDkFNoBNoaQoaFoNBoNXoNaoNEoSRoEroYXoYCoYbopRopFomXojkowXorFbBEbEIbdBbjYlaRlDElMXlFDjKjjSRjGBjYBjYkjpRjLXjIBjOFjeVjbRjwBnXQnSHnpFnLXnINnMBnTRwXBwXNwXYwNFwQFwSBwGFwLXwLDweNwgBwuHwjDwnXMBXMpFMIBMeNMTHcaQcNBcDHcSFcCXcpBcLXcLDcgFcuFcnXcwXccDcTQcrFTQErXNrCHrpFrgFrbFrTHrFcWNYWNbWEHWMXWTR","ABGHABIJAEAVAYJQALZJAIaRAHNXAHdcAHbRAZJMAZJRAZTRAdVJAklmAbcNAjdRAMnRAMWYAWpRAWgRAFgBAFhBAFdcBNJBBNJDBQKBBQhcBQlmBDEJBYJkBYJTBpNBBpJFBIJBBIJDBIcABOKXBOEJBOVJBOiJBOZJBepBBeLXBeIFBegBBgGJBVJXBuocBiJRBUJQBlXVBlITBwNFBMYVBcqXBTlmBWNFBWiJBWnRBFGHBFwXXKGJXNJBXNZJXDTTXSHSXSVRXSlHXCJDXGQJXEhXXYQJXYbRXOfXXeNcXVJFXhQJXhEJXdTRXjdXXMhBXcQTXRGBXTEBXTnQXFCXXFOFXFgFaBaFaBNJaBCJaBpBaBwXaNJKaNJDaQIBaDpRaEPDaHMFamDJalEJaMZJaFaFaFNBaFQJaFLDaFVHKBCYKBEBKBHDKXaFKXGdKXEJKXpHKXIBKXZDKXwXKKwLKNacKNYJKNJoKNWcKDGdKDTRKChXKGaRKGhBKGbRKEBTKEaRKEPTKLMDKLWRKOHDKVJcKdBcKlIBKlOPKFSBKFEPKFpFNBNJNJBQNBGHNBEPNBHXNBgFNBVXNBZDNBsXNBwXNNaRNNJDNNJENNJkNDCJNDVDNGJRNJiDNZJNNsCJNJFNNFSBNFCXNFEPNFLXNFIFQJBFQCaRQJEQQLJDQLJFQIaRQOqXQHaFQHHQQVJXQVJDQhNJQmEIQZJFQsJXQJrFQWbRDJABDBYJDXNFDXCXDXLXDXZDDXsJDQqXDSJFDJCXDEPkDEqXDYmQDpSJDOCkDOGQDHEIDVJDDuDuDWEBDJFgSBNDSBSFSBGHSBIBSBTQSKVYSJQNSJQiSJCXSEqXSJYVSIiJSOMYSHAHSHaQSeCFSepQSegBSHdHSHrFShSJSJuHSJUFSkNRSrSrSWEBSFaHSJFQSFCXSFGDSFYXSFODSFgBSFVXSFhBSFxFSFkFSFbBSFMFCADdCJXBCXaFCXKFCXNFCXCXCXGBCXEJCXYBCXLDCXIBCXOPCXHXCXgBCXhBCXiBCXlDCXcHCJNBCJNFCDCJCDGBCDVXCDhBCDiDCDJdCCmNCpJFCIaRCOqXCHCHCHZJCViJCuCuCmddCJiFCdNBCdHhClEJCnUJCreSCWlgCWTRCFBFCFNBCFYBCFVFCFhFCFdSCFTBCFWDGBNBGBQFGJBCGBEqGBpBGBgQGNBEGNJYGNkOGNJRGDUFGJpQGHaBGJeNGJeEGVBlGVKjGiJDGvJHGsVJGkEBGMIJGWjNGFBFGFCXGFGBGFYXGFpBGFMFEASJEAWpEJNFECJVEIXSEIQJEOqXEOcFEeNcEHEJEHlFEJgFEhlmEmDJEmZJEiMBEUqXEoSREPBFEPXFEPKFEPSFEPEFEPpFEPLXEPIBEJPdEPcFEPTBEJnXEqlHEMpREFCXEFODEFcFYASJYJAFYBaBYBVXYXpFYDhBYCJBYJGFYYbRYeNcYJeVYiIJYZJcYvJgYvJRYJsXYsJFYMYMYreVpBNHpBEJpBwXpQxFpYEJpeNDpJeDpeSFpeCHpHUJpHbBpHcHpmUJpiiJpUJrpsJuplITpFaBpFQqpFGBpFEfpFYBpFpBpFLJpFIDpFgBpFVXpFyQpFuFpFlFpFjDpFnXpFwXpJFMpFTBLXCJLXEFLXhFLXUJLXbFLalmLNJBLSJQLCLCLGJBLLDJLHaFLeNFLeSHLeCXLepFLhaRLZsJLsJDLsJrLocaLlLlLMdbLFNBLFSBLFEHLFkFIBBFIBXFIBaQIBKXIBSFIBpHIBLXIBgBIBhBIBuHIBmXIBiFIBZXIBvFIBbFIBjQIBwXIBWFIKTRIQUJIDGFICjQIYSRIINXIJeCIVaRImEkIZJFIvJRIsJXIdCJIJoRIbBQIjYBIcqXITFVIreVIFKFIFSFIFCJIFGFIFLDIFIBIJFOIFgBIFVXIJFhIFxFIFmXIFdHIFbBIJFrIJFWOBGBOQfXOOKjOUqXOfXBOqXEOcqXORVJOFIBOFlDHBIOHXiFHNTRHCJXH
408IaRHHJDHHEJHVbRHZJYHbIBHRsJHRkDHWlmgBKFgBSBgBCDgBGHgBpBgBIBgBVJgBuBgBvFgKDTgQVXgDUJgGSJgOqXgmUMgZIJgTUJgWIEgFBFgFNBgFDJgFSFgFGBgFYXgJFOgFgQgFVXgFhBgFbHgJFWVJABVQKcVDgFVOfXVeDFVhaRVmGdViJYVMaRVFNHhBNDhBCXhBEqhBpFhBLXhNJBhSJRheVXhhKEhxlmhZIJhdBQhkIJhbMNhMUJhMZJxNJgxQUJxDEkxDdFxSJRxplmxeSBxeCXxeGFxeYXxepQxegBxWVcxFEQxFLXxFIBxFgBxFxDxFZtxFdcxFbBxFwXyDJXyDlcuASJuDJpuDIBuCpJuGSJuIJFueEFuZIJusJXudWEuoIBuWGJuFBcuFKEuFNFuFQFuFDJuFGJuFVJuFUtuFdHuFTBmBYJmNJYmQhkmLJDmLJomIdXmiJYmvJRmsJRmklmmMBymMuCmclmmcnQiJABiJBNiJBDiBSFiBCJiBEFiBYBiBpFiBLXiBTHiJNciDEfiCZJiECJiJEqiOkHiHKFieNDiHJQieQcieDHieSFieCXieGFieEFieIHiegFihUJixNoioNXiFaBiFKFiFNDiFEPiFYXitFOitFHiFgBiFVEiFmXiFitiFbBiFMFiFrFUCXQUIoQUIJcUHQJUeCEUHwXUUJDUUqXUdWcUcqXUrnQUFNDUFSHUFCFUFEfUFLXUtFOZBXOZXSBZXpFZXVXZEQJZEJkZpDJZOqXZeNHZeCDZUqXZFBQZFEHZFLXvBAFvBKFvBCXvBEPvBpHvBIDvBgFvBuHvQNJvFNFvFGBvFIBvJFcsXCDsXLXsXsXsXlFsXcHsQqXsJQFsEqXseIFsFEHsFjDdBxOdNpRdNJRdEJbdpJRdhZJdnSJdrjNdFNJdFQHdFhNkNJDkYaRkHNRkHSRkVbRkuMRkjSJkcqDoSJFoEiJoYZJoOfXohEBoMGQocqXbBAFbBXFbBaFbBNDbBGBbBLXbBTBbBWDbGJYbIJHbFQqbFpQlDgQlOrFlVJRjGEBjZJRnXvJnXbBnEfHnOPDngJRnxfXnUJWwXEJwNpJwDpBwEfXwrEBMDCJMDGHMDIJMLJDcQGDcQpHcqXccqNFcqCXcFCJRBSBRBGBRBEJRBpQTBNFTBQJTBpBTBVXTFABTFSBTFCFTFGBTFMDrXCJrXLDrDNJrEfHrFQJrFitWNjdWNTR","AKLJMANOPFASNJIAEJWXAYJNRAIIbRAIcdaAeEfDAgidRAdjNYAMYEJAMIbRAFNJBAFpJFBBIJYBDZJFBSiJhBGdEBBEJfXBEJqXBEJWRBpaUJBLXrXBIYJMBOcfXBeEfFBestXBjNJRBcDJOBFEqXXNvJRXDMBhXCJNYXOAWpXONJWXHDEBXeIaRXhYJDXZJSJXMDJOXcASJXFVJXaBQqXaBZJFasXdQaFSJQaFEfXaFpJHaFOqXKBNSRKXvJBKQJhXKEJQJKEJGFKINJBKIJjNKgJNSKVElmKVhEBKiJGFKlBgJKjnUJKwsJYKMFIJKFNJDKFIJFKFOfXNJBSFNJBCXNBpJFNJBvQNJBMBNJLJXNJOqXNJeCXNJeGFNdsJCNbTKFNwXUJQNFEPQDiJcQDMSJQSFpBQGMQJQJeOcQyCJEQUJEBQJFBrQFEJqDXDJFDJXpBDJXIMDGiJhDIJGRDJeYcDHrDJDVXgFDkAWpDkIgRDjDEqDMvJRDJFNFDJFIBSKclmSJQOFSJQVHSJQjDSJGJBSJGJFSECJoSHEJqSJHTBSJVJDSViJYSZJNBSJsJDSFSJFSFEfXSJFLXCBUJVCJXSBCJXpBCXVJXCJXsXCJXdFCJNJHCLIJgCHiJFCVNJMChCJhCUHEJCsJTRCJdYcCoQJCCFEfXCFIJgCFUJxCFstFGJBaQGJBIDGQJqXGYJNRGJHKFGeQqDGHEJFGJeLXGHIiJGHdBlGUJEBGkIJTGFQPDGJFEqEAGegEJIJBEJVJXEhQJTEiJNcEJZJFEJoEqEjDEqEPDsXEPGJBEPOqXEPeQFEfDiDEJfEFEfepQEfMiJEqXNBEqDIDEqeSFEqVJXEMvJRYXNJDYXEJHYKVJcYYJEBYJeEcYJUqXYFpJFYFstXpAZJMpBSJFpNBNFpeQPDpHLJDpHIJFpHgJFpeitFpHZJFpJFADpFSJFpJFCJpFOqXpFitBpJFZJLXIJFLIJgRLVNJWLVHJMLwNpJLFGJBLFLJDLFOqXLJFUJIBDJXIBGJBIJBYQIJBIBIBOqXIBcqDIEGJFILNJTIIJEBIOiJhIJeNBIJeIBIhiJIIWoTRIJFAHIJFpBIJFuHIFUtFIJFTHOSBYJOEcqXOHEJqOvBpFOkVJrObBVJOncqDOcNJkHhNJRHuHJuHdMhBgBUqXgBsJXgONJBgHNJDgHHJQgJeitgHsJXgJyNagyDJBgZJDrgsVJQgkEJNgkjSJgJFAHgFCJDgFZtMVJXNFVXQfXVJXDJVXoQJVQVJQVDEfXVDvJHVEqNFVeQfXVHpJFVHxfXVVJSRVVmaRVlIJOhCXVJhHjYkhxCJVhWVUJhWiJcxBNJIxeEqDxfXBFxcFEPxFSJFxFYJXyBDQJydaUJyFOPDuYCJYuLvJRuHLJXuZJLDuFOPDuFZJHuFcqXmKHJdmCQJcmOsVJiJAGFitLCFieOfXiestXiZJMEikNJQirXzFiFQqXiFIJFiFZJFiFvtFUHpJFUteIcUteOcUVCJkUhdHcUbEJEUJqXQUMNJhURjYkUFitFZDGJHZJIxDZJVJXZJFDJZJFpQvBNJBvBSJFvJxBrseQqDsVFVJdFLJDkEJNBkmNJYkFLJDoQJOPoGsJRoEAHBoEJfFbBQqDbBZJHbFVJXlFIJBjYIrXjeitcjjCEBjWMNBwXQfXwXOaFwDsJXwCJTRwrCZJMDNJQcDDJFcqDOPRYiJFTBsJXTQIJBTFEfXTFLJDrXEJFrEJXMrFZJFWEJdEWYTlm","ABCDEFACNJTRAMBDJdAcNJVXBLNJEBXSIdWRXErNJkXYDJMBXZJCJaXMNJaYKKVJKcKDEJqXKDcNJhKVJrNYKbgJVXKFVJSBNBYBwDNJeQfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC","BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD","QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD","IJBEJqXZJ"],p6e="~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt";let Ts=null;function NT(t){return Ne(ln(t))}const g6e="0xe3818de38284e3818f",m6e="0xe3818de38283e3818f";function IT(t){if(Ts!==null)return;Ts=[];const e={};e[on([227,130,154])]=!1,e[on([227,130,153])]=!1,e[on([227,130,133])]=on([227,130,134]),e[on([227,129,163])]=on([227,129,164]),e[on([227,130,131])]=on([227,130,132]),e[on([227,130,135])]=on([227,130,136]);function r(i){let s="";for(let o=0;o<i.length;o++){let a=i[o];const c=e[a];c!==!1&&(c&&(a=c),s+=a)}return s}function n(i,s){return i=r(i),s=r(s),i<s?-1:i>s?1:0}for(let i=3;i<=9;i++){const s=h6e[i-3];for(let o=0;o<s.length;o+=i){const a=[];for(let c=0;c<i;c++){const l=p6e.indexOf(s[o+c]);a.push(227),a.push(l&64?130:129),a.push((l&63)+128)}Ts.push(on(a))}}if(Ts.sort(n),NT(Ts[442])===g6e&&NT(Ts[443])===m6e){const i=Ts[442];Ts[442]=Ts[443],Ts[443]=i}if(Br.check(t)!=="0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600")throw Ts=null,new Error("BIP39 Wordlist for ja (Japanese) FAILED")}class b6e extends Br{constructor(){super("ja")}getWord(e){return IT(this),Ts[e]}getWordIndex(e){return IT(this),Ts.indexOf(e)}split(e){return u2.checkNormalize(),e.split(/(?:\u3000| )+/g)}join(e){return e.join("ã")}}const TD=new b6e;Br.register(TD);const y6e=["OYAa","ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZoCbLnrCboOTCboScCbrFnCbvLnCb8AgCb8HgCb$LnCkLfoClBn3CloDUDTHT8DTLl3DTSU8DTrAaDTrLXDTrLjDTrOYDTrOgDTvFXDTvFnDT3HUDT3LfDUCT9DUDT4DUFVoDUFV8DUFkoDUGgrDUJnrDULl8DUMT8DUMXrDUMX4DUMg8DUOUoDUOgvDUOg8DUSToDUSZ8DbDXoDbDgoDbGT8DbJn3DbLg3DbLn4DbMXrDbMg8DbOToDboJXGTClvGTDT8GTFZrGTLVoGTLlvGTLl3GTMg8GTOTvGTSlrGToCUGTrDgGTrJYGTrScGTtLnGTvAnGTvQgGUCZrGUDTvGUFZoGUHXrGULnvGUMT8GUoMgGXoLnGXrMXGXrMnGXvFnGYLnvGZOnvGZvOnGZ8LaGZ8LmGbAl3GbDYvGbDlrGbHX3GbJl4GbLV8GbLn3GbMn4GboJTGboRfGbvFUGb3GUGb4JnGgDX3GgFl$GgJlrGgLX6GgLZoGgLf8GgOXoGgrAgGgrJXGgrMYGgrScGgvATGgvOYGnAgoGnJgvGnLZoGnLg3GnLnrGnQn8GnSbrGnrMgHTClvHTDToHTFT3HTQT8HToJTHToJgHTrDUHTrMnHTvFYHTvRfHT8MnHT8SUHUAZ8HUBb4HUDTvHUoMYHXFl6HXJX6HXQlrHXrAUHXrMnHXrSbHXvFYHXvKXHX3LjHX3MeHYvQlHZrScHZvDbHbAcrHbFT3HbFl3HbJT8HbLTrHbMT8HbMXrHbMbrHbQb8HbSX3HboDbHboJTHbrFUHbrHgHbrJTHb8JTHb8MnHb8QgHgAlrHgDT3HgGgrHgHgrHgJTrHgJT8HgLX@HgLnrHgMT8HgMX8HgMboHgOnrHgQToHgRg3HgoHgHgrCbHgrFnHgrLVHgvAcHgvAfHnAloHnCTrHnCnvHnGTrHnGZ8HnGnvHnJT8HnLf8HnLkvHnMg8HnRTrITvFUITvFnJTAXrJTCV8JTFT3JTFT8JTFn4JTGgvJTHT8JTJT8JTJXvJTJl3JTJnvJTLX4JTLf8JTLhvJTMT8JTMXrJTMnrJTObrJTQT8JTSlvJT8DUJT8FkJT8MTJT8OXJT8OgJT8QUJT8RfJUHZoJXFT4JXFlrJXGZ8JXGnrJXLV8JXLgvJXMXoJXMX3JXNboJXPlvJXoJTJXoLkJXrAXJXrHUJXrJgJXvJTJXvOnJX4KnJYAl3JYJT8JYLhvJYQToJYrQXJY6NUJbAl3JbCZrJbDloJbGT8JbGgrJbJXvJbJboJbLf8JbLhrJbLl3JbMnvJbRg8JbSZ8JboDbJbrCZJbrSUJb3KnJb8LnJfRn8JgAXrJgCZrJgDTrJgGZrJgGZ8JgHToJgJT8JgJXoJgJgvJgLX4JgLZ3JgLZ8JgLn4JgMgrJgMn4JgOgvJgPX6JgRnvJgSToJgoCZJgoJbJgoMYJgrJXJgrJgJgrLjJg6MTJlCn3JlGgvJlJl8Jl4AnJl8FnJl8HgJnAToJnATrJnAbvJnDUoJnGnrJnJXrJnJXvJnLhvJnLnrJnLnvJnMToJnMT8JnMXvJnMX3JnMg8JnMlrJnMn4JnOX8JnST4JnSX3JnoAgJnoAnJnoJTJnoObJnrAbJnrAkJnrHnJnrJTJnrJYJnrOYJnrScJnvCUJnvFaJnvJgJnvJnJnvOYJnvQUJnvRUJn3FnJn3JTKnFl3KnLT6LTDlvLTMnoLTOn3LTRl3LTSb4LTSlrLToAnLToJgLTrAULTrAcLTrCULTrHgLTrMgLT3JnLULnrLUMX8LUoJgLVATrLVDTrLVLb8LVoJgLV8MgLV8RTLXDg3LXFlrLXrCnLXrLXLX3GTLX4GgLX4OYLZAXrLZAcrLZAgrLZAhrLZDXyLZDlrLZFbrLZFl3LZJX6LZJX8LZLc8LZLnrLZSU8LZoJTLZoJnLZrAgLZrAnLZrJYLZrLULZrMgLZrSkL
408ZvAnLZvGULZvJeLZvOTLZ3FZLZ4JXLZ8STLZ8ScLaAT3LaAl3LaHT8LaJTrLaJT8LaJXrLaJgvLaJl4LaLVoLaMXrLaMXvLaMX8LbClvLbFToLbHlrLbJn4LbLZ3LbLhvLbMXrLbMnoLbvSULcLnrLc8HnLc8MTLdrMnLeAgoLeOgvLeOn3LfAl3LfLnvLfMl3LfOX8Lf8AnLf8JXLf8LXLgJTrLgJXrLgJl8LgMX8LgRZrLhCToLhrAbLhrFULhrJXLhvJYLjHTrLjHX4LjJX8LjLhrLjSX3LjSZ4LkFX4LkGZ8LkGgvLkJTrLkMXoLkSToLkSU8LkSZ8LkoOYLl3FfLl3MgLmAZrLmCbrLmGgrLmHboLmJnoLmJn3LmLfoLmLhrLmSToLnAX6LnAb6LnCZ3LnCb3LnDTvLnDb8LnFl3LnGnrLnHZvLnHgvLnITvLnJT8LnJX8LnJlvLnLf8LnLg6LnLhvLnLnoLnMXrLnMg8LnQlvLnSbrLnrAgLnrAnLnrDbLnrFkLnrJdLnrMULnrOYLnrSTLnvAnLnvDULnvHgLnvOYLnvOnLn3GgLn4DULn4JTLn4JnMTAZoMTAloMTDb8MTFT8MTJnoMTJnrMTLZrMTLhrMTLkvMTMX8MTRTrMToATMTrDnMTrOnMT3JnMT4MnMT8FUMT8FaMT8FlMT8GTMT8GbMT8GnMT8HnMT8JTMT8JbMT8OTMUCl8MUJTrMUJU8MUMX8MURTrMUSToMXAX6MXAb6MXCZoMXFXrMXHXrMXLgvMXOgoMXrAUMXrAnMXrHgMXrJYMXrJnMXrMTMXrMgMXrOYMXrSZMXrSgMXvDUMXvOTMX3JgMX3OTMX4JnMX8DbMX8FnMX8HbMX8HgMX8HnMX8LbMX8MnMX8OnMYAb8MYGboMYHTvMYHX4MYLTrMYLnvMYMToMYOgvMYRg3MYSTrMbAToMbAXrMbAl3MbAn8MbGZ8MbJT8MbJXrMbMXvMbMX8MbMnoMbrMUMb8AfMb8FbMb8FkMcJXoMeLnrMgFl3MgGTvMgGXoMgGgrMgGnrMgHT8MgHZrMgJnoMgLnrMgLnvMgMT8MgQUoMgrHnMgvAnMg8HgMg8JYMg8LfMloJnMl8ATMl8AXMl8JYMnAToMnAT4MnAZ8MnAl3MnAl4MnCl8MnHT8MnHg8MnJnoMnLZoMnLhrMnMXoMnMX3MnMnrMnOgvMnrFbMnrFfMnrFnMnrNTMnvJXNTMl8OTCT3OTFV8OTFn3OTHZvOTJXrOTOl3OT3ATOT3JUOT3LZOT3LeOT3MbOT8ATOT8AbOT8AgOT8MbOUCXvOUMX3OXHXvOXLl3OXrMUOXvDbOX6NUOX8JbOYFZoOYLbrOYLkoOYMg8OYSX3ObHTrObHT4ObJgrObLhrObMX3ObOX8Ob8FnOeAlrOeJT8OeJXrOeJnrOeLToOeMb8OgJXoOgLXoOgMnrOgOXrOgOloOgoAgOgoJbOgoMYOgoSTOg8AbOjLX4OjMnoOjSV8OnLVoOnrAgOn3DUPXQlrPXvFXPbvFTPdAT3PlFn3PnvFbQTLn4QToAgQToMTQULV8QURg8QUoJnQXCXvQbFbrQb8AaQb8AcQb8FbQb8MYQb8ScQeAlrQeLhrQjAn3QlFXoQloJgQloSnRTLnvRTrGURTrJTRUJZrRUoJlRUrQnRZrLmRZrMnRZrSnRZ8ATRZ8JbRZ8ScRbMT8RbST3RfGZrRfMX8RfMgrRfSZrRnAbrRnGT8RnvJgRnvLfRnvMTRn8AaSTClvSTJgrSTOXrSTRg3STRnvSToAcSToAfSToAnSToHnSToLjSToMTSTrAaSTrEUST3BYST8AgST8LmSUAZvSUAgrSUDT4SUDT8SUGgvSUJXoSUJXvSULTrSU8JTSU8LjSV8AnSV8JgSXFToSXLf8SYvAnSZrDUSZrMUSZrMnSZ8HgSZ8JTSZ8JgSZ8MYSZ8QUSaQUoSbCT3SbHToSbQYvSbSl4SboJnSbvFbSb8HbSb8JgSb8OTScGZrScHgrScJTvScMT8ScSToScoHbScrMTScvAnSeAZrSeAcrSeHboSeJUoSeLhrSeMT8SeMXrSe6JgSgHTrSkJnoSkLnvSk8CUSlFl3SlrSnSl8GnSmAboSmGT8SmJU8","ATLnDlATrAZoATrJX4ATrMT8ATrMX4ATrRTrATvDl8ATvJUoATvMl8AT3AToAT3MX8AT8CT3AT8DT8AT8HZrAT8HgoAUAgFnAUCTFnAXoMX8AXrAT8AXrGgvAXrJXvAXrOgoAXvLl3AZvAgoAZvFbrAZvJXoAZvJl8AZvJn3AZvMX8AZvSbrAZ8FZoAZ8LZ8AZ8MU8AZ8OTvAZ8SV8AZ8SX3AbAgFZAboJnoAbvGboAb8ATrAb8AZoAb8AgrAb8Al4Ab8Db8Ab8JnoAb8LX4Ab8LZrAb8LhrAb8MT8Ab8OUoAb8Qb8Ab8ST8AcrAUoAcrAc8AcrCZ3AcrFT3AcrFZrAcrJl4AcrJn3AcrMX3AcrOTvAc8AZ8Ac8MT8AfAcJXAgoFn4AgoGgvAgoGnrAgoLc8AgoMXoAgrLnrAkrSZ8AlFXCTAloHboAlrHbrAlrLhrAlrLkoAl3CZrAl3LUoAl3LZrAnrAl4AnrMT8An3HT4BT3IToBX4MnvBb!Ln$CTGXMnCToLZ4CTrHT8CT3JTrCT3RZrCT#GTvCU6GgvCU8Db8CU8GZrCU8HT8CboLl3CbrGgrCbrMU8Cb8DT3Cb8GnrCb8LX4Cb8MT8Cb8ObrCgrGgvCgrKX4Cl8FZoDTrAbvDTrDboDTrGT6DTrJgrDTrMX3DTrRZrDTrRg8DTvAVvDTvFZoDT3DT8DT3Ln3DT4HZrDT4MT8DT8AlrDT8MT8DUAkGbDUDbJnDYLnQlDbDUOYDbMTAnDbMXSnDboAT3DboFn4DboLnvDj6JTrGTCgFTGTGgFnGTJTMnGTLnPlGToJT8GTrCT3GTrLVoGTrLnvGTrMX3GTrMboGTvKl3GZClFnGZrDT3GZ8DTrGZ8FZ8GZ8MXvGZ8On8GZ8ST3GbCnQXGbMbFnGboFboGboJg3GboMXoGb3JTvGb3JboGb3Mn6Gb3Qb8GgDXLjGgMnAUGgrDloGgrHX4GgrSToGgvAXrGgvAZvGgvFbrGgvLl3GgvMnvGnDnLXGnrATrGnrMboGnuLl3HTATMnHTAgCnHTCTCTHTrGTvHTrHTvHTrJX8HTrLl8HTrMT8HTrMgoHTrOTrHTuOn3HTvAZrHTvDTvHTvGboHTvJU8HTvLl3HTvMXrHTvQb4HT4GT6HT4JT8HT4Jb#HT8Al3HT8GZrHT8GgrHT8HX4HT8Jb8HT8JnoHT8LTrHT8LgvHT8SToHT8SV8HUoJUoHUoJX8HUoLnrHXrLZoHXvAl3HX3LnrHX4FkvHX4LhrHX4MXoHX4OnoHZrAZ8HZrDb8HZrGZ8HZrJnrHZvGZ8HZvLnvHZ8JnvHZ8LhrHbCXJlHbMTAnHboJl4HbpLl3HbrJX8HbrLnrHbrMnvHbvRYrHgoSTrHgrFV8HgrGZ8HgrJXoHgrRnvHgvBb!HgvGTrHgvHX4HgvHn!HgvLTrHgvSU8HnDnLbHnFbJbHnvDn8Hn6GgvHn!BTvJTCTLnJTQgFnJTrAnvJTrLX4JTrOUoJTvFn3JTvLnrJTvNToJT3AgoJT3Jn4JT3LhvJT3ObrJT8AcrJT8Al3JT8JT8JT8JnoJT8LX4JT8LnrJT8MX3JT8Rg3JT8Sc8JUoBTvJU8AToJU8GZ8JU8GgvJU8JTrJU8JXrJU8JnrJU8LnvJU8ScvJXHnJlJXrGgvJXrJU8JXrLhrJXrMT8JXrMXrJXrQUoJXvCTvJXvGZ8JXvGgrJXvQT8JX8Ab8JX8DT8JX8GZ8JX8HZvJX8LnrJX8MT8JX8MXoJX8MnvJX8ST3JYGnCTJbAkGbJbCTAnJbLTAcJboDT3JboLb6JbrAnvJbrCn3JbrDl8JbrGboJbrIZoJbrJnvJbrMnvJbrQb4Jb8RZrJeAbAnJgJnFbJgScAnJgrATrJgvHZ8JgvMn4JlJlFbJlLiQXJlLjOnJlRbOlJlvNXoJlvRl3Jl4AcrJl8AUoJl8MnrJnFnMlJnHgGbJnoDT8JnoFV8JnoGgvJnoIT8JnoQToJnoRg3JnrCZ3JnrGgrJnrHTvJnrLf8JnrOX8JnvAT3JnvFZoJnvGT8JnvJl4JnvMT8JnvMX8JnvOXrJnvPX6JnvSX3JnvSZrJn3MT8Jn3MX8Jn3RTrLTATKnLTJnLTLTMXKnLTRTQlLToGb8LTrAZ8LTrCZ8LTrDb8LTrHT8LT3PX6LT4FZoLT$CTvLT$GgrLUvHX3LVoATrLVoAgoLVoJboLVoMX3LVoRg3LV8CZ3LV8FZoLV8GTvLXrDXoLXrFbrLXvAgvLXvFlrLXvLl3LXvRn6LX4Mb8LX8GT8LYCXMnLYrMnrLZoSTvLZrAZvLZrAloLZrFToLZrJXvLZrJboLZrJl4LZrLnrLZrMT8LZrOgvLZrRnvLZrST4LZvMX8LZvSlvLZ8AgoLZ8CT3LZ8JT8LZ8LV8LZ8LZoLZ8Lg8LZ8SV8LZ8SbrLZ$HT8LZ$Mn4La6CTvLbFbMnLbRYFTLbSnFZLboJT8LbrAT9LbrGb3LbrQb8LcrJX8LcrMXrLerHTvLerJbrLerNboLgrDb8LgrGZ8LgrHTrLgrMXrLgrSU8LgvJTrLgvLl3Lg6Ll3LhrLnrLhrMT8LhvAl4LiLnQXLkoAgrLkoJT8LkoJn4LlrSU8Ll3FZoLl3HTrLl3JX8Ll3JnoLl3LToLmLeFbLnDUFbLnLVAnLnrATrLnrAZoLnrAb8LnrAlrLnrGgvLnrJU8LnrLZrLnrLhrLnrMb8LnrOXrLnrSZ8LnvAb4LnvDTrLnvDl8LnvHTrLnvHbrLnvJT8LnvJU8LnvJbrLnvLhvLnvMX8LnvMb8LnvNnoLnvSU8Ln3Al3Ln4FZoLn4GT6Ln4JgvLn4LhrLn4MT8Ln4SToMToCZrMToJX8MToLX4MToLf8MToRg3MTrEloMTvGb6MT3BTrMT3Lb6MT8AcrMT8AgrMT8GZrMT8JnoMT8LnrMT8MX3MUOUAnMXAbFnMXoAloMXoJX8MXoLf8MXoLl8MXrAb8MXrDTvMXrGT8MXrGgrMXrHTrMXrLf8MXrMU8MXrOXvMXrQb8MXvGT8MXvHTrMXvLVoMX3AX3MX3Jn3MX3LhrMX3MX3MX4AlrMX4OboMX8GTvMX8GZrMX8GgrMX8JT8MX8JX8MX8LhrMX8MT8MYDUFbMYMgDbMbGnFfMbvLX4MbvLl3Mb8Mb8Mb8ST4MgGXCnMg8ATrMg8AgoMg8CZrMg8DTrMg8DboMg8HTrMg8JgrMg8LT8MloJXoMl8AhrMl8JT8MnLgAUMnoJXrMnoLX4MnoLhrMnoMT8MnrAl4MnrDb8MnrOTvMnrOgvMnrQb8MnrSU8MnvGgrMnvHZ8Mn3MToMn4DTrMn4LTrMn4Mg8NnBXAnOTFTFnOToAToOTrGgvOTrJX8OT3JXoOT6MTrOT8GgrOT8HTpOT8MToOUoHT8OUoJT8OUoLn3OXrAgoOXrDg8OXrMT8OXvSToOX6CTvOX8CZrOX8OgrOb6HgvOb8AToOb8MT8OcvLZ8OgvAlrOgvHTvOgvJTrOgvJnrOgvLZrOgvLn4OgvMT8OgvRTrOg8AZoOg8DbvOnrOXoOnvJn4OnvLhvOnvRTrOn3GgoOn3JnvOn6JbvOn8OTrPTGYFTPbBnFnPbGnDnPgDYQTPlrAnvPlrETvPlrLnvPlrMXvPlvFX4QTMTAnQTrJU8QYCnJlQYJlQlQbGTQbQb8JnrQb8LZoQb8LnvQb8MT8Qb8Ml8Qb8ST4QloAl4QloHZvQloJX8QloMn8QnJZOlRTrAZvRTrDTrRTvJn4RTvLhvRT4Jb8RZrAZrRZ8AkrRZ8JU8RZ8LV8RZ8LnvRbJlQXRg3GboRg3MnvRg8AZ8Rg8JboRg8Jl4RnLTCbRnvFl3RnvQb8SToAl4SToCZrSToFZoSToHXrSToJU8SToJgvSToJl4SToLhrSToMX3STrAlvSTrCT9STrCgrSTrGgrSTrHXrSTrHboSTrJnoSTrNboSTvLnrST4AZoST8Ab8ST8JT8SUoJn3SU6HZ#SU6JTvSU8Db8SU8HboSU8LgrSV8JT8SZrAcrSZrAl3SZrJT8SZrJnvSZrMT8SZvLUoSZ4FZoSZ8JnoSZ8RZrScoLnrScoMT8ScoMX8ScrAT4ScrAZ8ScrLZ8ScrLkvScvDb8ScvLf8ScvNToSgrFZrShvKnrSloHUoSloLnrSlrMXoSl8HgrSmrJUoSn3BX6","ATFlOn3ATLgrDYAT4MTAnAT8LTMnAYJnRTrAbGgJnrAbLV8LnAbvNTAnAeFbLg3AgOYMXoAlQbFboAnDboAfAnJgoJTBToDgAnBUJbAl3BboDUAnCTDlvLnCTFTrSnCYoQTLnDTwAbAnDUDTrSnDUHgHgrDX8LXFnDbJXAcrETvLTLnGTFTQbrGTMnGToGT3DUFbGUJlPX3GbQg8LnGboJbFnGb3GgAYGgAg8ScGgMbAXrGgvAbAnGnJTLnvGnvATFgHTDT6ATHTrDlJnHYLnMn8HZrSbJTHZ8LTFnHbFTJUoHgSeMT8HgrLjAnHgvAbAnHlFUrDlHnDgvAnHnHTFT3HnQTGnrJTAaMXvJTGbCn3JTOgrAnJXvAXMnJbMg8SnJbMnRg3Jb8LTMnJnAl3OnJnGYrQlJnJlQY3LTDlCn3LTJjLg3LTLgvFXLTMg3GTLV8HUOgLXFZLg3LXNXrMnLX8QXFnLX9AlMYLYLXPXrLZAbJU8LZDUJU8LZMXrSnLZ$AgFnLaPXrDULbFYrMnLbMn8LXLboJgJgLeFbLg3LgLZrSnLgOYAgoLhrRnJlLkCTrSnLkOnLhrLnFX%AYLnFZoJXLnHTvJbLnLloAbMTATLf8MTHgJn3MTMXrAXMT3MTFnMUITvFnMXFX%AYMXMXvFbMXrFTDbMYAcMX3MbLf8SnMb8JbFnMgMXrMTMgvAXFnMgvGgCmMnAloSnMnFnJTrOXvMXSnOX8HTMnObJT8ScObLZFl3ObMXCZoPTLgrQXPUFnoQXPU3RXJlPX3RkQXPbrJXQlPlrJbFnQUAhrDbQXGnCXvQYLnHlvQbLfLnvRTOgvJbRXJYrQlRYLnrQlRbLnrQlRlFT8JlRlFnrQXSTClCn3STHTrAnSTLZQlrSTMnGTrSToHgGbSTrGTDnSTvGXCnST3HgFbSU3HXAXSbAnJn3SbFT8LnScLfLnv","AT3JgJX8AT8FZoSnAT8JgFV8AT8LhrDbAZ8JT8DbAb8GgLhrAb8SkLnvAe8MT8SnAlMYJXLVAl3GYDTvAl3LfLnvBUDTvLl3CTOn3HTrCT3DUGgrCU8MT8AbCbFTrJUoCgrDb8MTDTLV8JX8DTLnLXQlDT8LZrSnDUQb8FZ8DUST4JnvDb8ScOUoDj6GbJl4GTLfCYMlGToAXvFnGboAXvLnGgAcrJn3GgvFnSToGnLf8JnvGn#HTDToHTLnFXJlHTvATFToHTvHTDToHTvMTAgoHT3STClvHT4AlFl6HT8HTDToHUoDgJTrHUoScMX3HbRZrMXoHboJg8LTHgDb8JTrHgMToLf8HgvLnLnoHnHn3HT4Hn6MgvAnJTJU8ScvJT3AaQT8JT8HTrAnJXrRg8AnJbAloMXoJbrATFToJbvMnoSnJgDb6GgvJgDb8MXoJgSX3JU8JguATFToJlPYLnQlJlQkDnLbJlQlFYJlJl8Lf8OTJnCTFnLbJnLTHXMnJnLXGXCnJnoFfRg3JnrMYRg3Jn3HgFl3KT8Dg8LnLTRlFnPTLTvPbLbvLVoSbrCZLXMY6HT3LXNU7DlrLXNXDTATLX8DX8LnLZDb8JU8LZMnoLhrLZSToJU8LZrLaLnrLZvJn3SnLZ8LhrSnLaJnoMT8LbFlrHTvLbrFTLnrLbvATLlvLb6OTFn3LcLnJZOlLeAT6Mn4LeJT3ObrLg6LXFlrLhrJg8LnLhvDlPX4LhvLfLnvLj6JTFT3LnFbrMXoLnQluCTvLnrQXCY6LnvLfLnvLnvMgLnvLnvSeLf8MTMbrJn3MT3JgST3MT8AnATrMT8LULnrMUMToCZrMUScvLf8MXoDT8SnMX6ATFToMX8AXMT8MX8FkMT8MX8HTrDUMX8ScoSnMYJT6CTvMgAcrMXoMg8SToAfMlvAXLg3MnFl3AnvOT3AnFl3OUoATHT8OU3RnLXrOXrOXrSnObPbvFn6Og8HgrSnOg8OX8DbPTvAgoJgPU3RYLnrPXrDnJZrPb8CTGgvPlrLTDlvPlvFUJnoQUvFXrQlQeMnoAl3QlrQlrSnRTFTrJUoSTDlLiLXSTFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo","AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg","HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb","AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl"],v6e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";function w6e(t){return t>=40?t=t+168-40:t>=19&&(t=t+97-19),on([225,(t>>6)+132,(t&63)+128])}let Zu=null;function xT(t){if(Zu==null&&(Zu=[],y6e.forEach((e,r)=>{r+=4;for(let n=0;n<e.length;n+=r){let i="";for(let s=0;s<r;s++)i+=w6e(v6e.indexOf(e[n+s]));Zu.push(i)}}),Zu.sort(),Br.check(t)!=="0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a"))throw Zu=null,new Error("BIP39 Wordlist for ko (Korean) FAILED")}class E6e extends Br{constructor(){super("ko")}getWord(e){return xT(this),Zu[e]}getWordIndex(e){return xT(this),Zu.indexOf(e)}}const ND=new E6e;Br.register(ND);const A6e="AbacoAbbaglioAbbinatoAbeteAbissoAbolireAbrasivoAbrogatoAccadereAccennoAccusatoAcetoneAchilleAcidoAcquaAcreAcrilicoAcrobataAcutoAdagioAddebitoAddomeAdeguatoAderireAdipeAdottareAdulareAffabileAffettoAffissoAffrantoAforismaAfosoAfricanoAgaveAgenteAgevoleAggancioAgireAgitareAgonismoAgricoloAgrumetoAguzzoAlabardaAlatoAlbatroAlberatoAlboAlbumeAlceAlcolicoAlettoneAlfaAlgebraAlianteAlibiAlimentoAllagatoAllegroAllievoAllodolaAllusivoAlmenoAlogenoAlpacaAlpestreAltalenaAlternoAlticcioAltroveAlunnoAlveoloAlzareAmalgamaAmanitaAmarenaAmbitoAmbratoAmebaAmericaAmetistaAmicoAmmassoAmmendaAmmirareAmmonitoAmoreAmpioAmpliareAmuletoAnacardoAnagrafeAnalistaAnarchiaAn
408atraAncaAncellaAncoraAndareAndreaAnelloAngeloAngolareAngustoAnimaAnnegareAnnidatoAnnoAnnuncioAnonimoAnticipoAnziApaticoAperturaApodeApparireAppetitoAppoggioApprodoAppuntoAprileArabicaArachideAragostaAraldicaArancioAraturaArazzoArbitroArchivioArditoArenileArgentoArgineArgutoAriaArmoniaArneseArredatoArringaArrostoArsenicoArsoArteficeArzilloAsciuttoAscoltoAsepsiAsetticoAsfaltoAsinoAsolaAspiratoAsproAssaggioAsseAssolutoAssurdoAstaAstenutoAsticeAstrattoAtavicoAteismoAtomicoAtonoAttesaAttivareAttornoAttritoAttualeAusilioAustriaAutistaAutonomoAutunnoAvanzatoAvereAvvenireAvvisoAvvolgereAzioneAzotoAzzimoAzzurroBabeleBaccanoBacinoBacoBadessaBadilataBagnatoBaitaBalconeBaldoBalenaBallataBalzanoBambinoBandireBaraondaBarbaroBarcaBaritonoBarlumeBaroccoBasilicoBassoBatostaBattutoBauleBavaBavosaBeccoBeffaBelgioBelvaBendaBenevoleBenignoBenzinaBereBerlinaBetaBibitaBiciBidoneBifidoBigaBilanciaBimboBinocoloBiologoBipedeBipolareBirbanteBirraBiscottoBisestoBisnonnoBisonteBisturiBizzarroBlandoBlattaBollitoBonificoBordoBoscoBotanicoBottinoBozzoloBraccioBradipoBramaBrancaBravuraBretellaBrevettoBrezzaBrigliaBrillanteBrindareBroccoloBrodoBronzinaBrulloBrunoBubboneBucaBudinoBuffoneBuioBulboBuonoBurloneBurrascaBussolaBustaCadettoCaducoCalamaroCalcoloCalesseCalibroCalmoCaloriaCambusaCamerataCamiciaCamminoCamolaCampaleCanapaCandelaCaneCaninoCanottoCantinaCapaceCapelloCapitoloCapogiroCapperoCapraCapsulaCarapaceCarcassaCardoCarismaCarovanaCarrettoCartolinaCasaccioCascataCasermaCasoCassoneCastelloCasualeCatastaCatenaCatrameCautoCavilloCedibileCedrataCefaloCelebreCellulareCenaCenoneCentesimoCeramicaCercareCertoCerumeCervelloCesoiaCe
408spoCetoChelaChiaroChiccaChiedereChimeraChinaChirurgoChitarraCiaoCiclismoCifrareCignoCilindroCiottoloCircaCirrosiCitricoCittadinoCiuffoCivettaCivileClassicoClinicaCloroCoccoCodardoCodiceCoerenteCognomeCollareColmatoColoreColposoColtivatoColzaComaCometaCommandoComodoComputerComuneConcisoCondurreConfermaCongelareConiugeConnessoConoscereConsumoContinuoConvegnoCopertoCopioneCoppiaCopricapoCorazzaCordataCoricatoCorniceCorollaCorpoCorredoCorsiaCorteseCosmicoCostanteCotturaCovatoCratereCravattaCreatoCredereCremosoCrescitaCretaCricetoCrinaleCrisiCriticoCroceCronacaCrostataCrucialeCruscaCucireCuculoCuginoCullatoCupolaCuratoreCursoreCurvoCuscinoCustodeDadoDainoDalmataDamerinoDanielaDannosoDanzareDatatoDavantiDavveroDebuttoDecennioDecisoDeclinoDecolloDecretoDedicatoDefinitoDeformeDegnoDelegareDelfinoDelirioDeltaDemenzaDenotatoDentroDepositoDerapataDerivareDerogaDescrittoDesertoDesiderioDesumereDetersivoDevotoDiametroDicembreDiedroDifesoDiffusoDigerireDigitaleDiluvioDinamicoDinnanziDipintoDiplomaDipoloDiradareDireDirottoDirupoDisagioDiscretoDisfareDisgeloDispostoDistanzaDisumanoDitoDivanoDiveltoDividereDivoratoDobloneDocenteDoganaleDogmaDolceDomatoDomenicaDominareDondoloDonoDormireDoteDottoreDovutoDozzinaDragoDruidoDubbioDubitareDucaleDunaDuomoDupliceDuraturoEbanoEccessoEccoEclissiEconomiaEderaEdicolaEdileEditoriaEducareEgemoniaEgliEgoismoEgregioElaboratoElargireEleganteElencatoElettoElevareElficoElicaElmoElsaElusoEmanatoEmblemaEmessoEmiroEmotivoEmozioneEmpiricoEmuloEndemicoEnduroEnergiaEnfasiEnotecaEntrareEnzimaEpatiteEpilogoEpisodioEpocaleEppureEquatoreErarioErbaErbosoEredeEremitaErigereErmeticoEroeErosivoErranteEsagonoEsameEsanimeEsaudireEscaEsempioEsercitoEsibitoEsigenteEsistereEsitoEsofagoEsortatoEsosoEspansoEspressoEssenzaEssoEstesoEstimareEstoniaEstrosoEsultareEtilicoEtnicoEtruscoEttoEuclideoEuropaEvasoEvidenzaEvitatoEvolutoEvvivaFabbricaFaccendaFachiroFalcoFamigliaFanaleFanfaraFangoFantasmaFareFarfallaFarinosoFarmacoFasciaFastosoFasulloFaticareFatoFavolosoFebbreFecolaFedeFegatoFelpaFeltroFemminaFendereFenomenoFermentoFerroFertileFessuraFestivoFettaFeudoFiabaFiduciaFifaFiguratoFiloFinanzaFinestraFinireFioreFiscaleFisicoFiumeFlaconeFlamencoFleboFlemmaFloridoFluenteFluoroFobicoFocacciaFocosoFoderatoFoglioFolataFolcloreFolgoreFondenteFoneticoFoniaFontanaForbitoForchettaForestaFormicaFornaioForoFortezzaF
408orzareFosfatoFossoFracassoFranaFrassinoFratelloFreccettaFrenataFrescoFrigoFrollinoFrondeFrugaleFruttaFucilataFucsiaFuggenteFulmineFulvoFumanteFumettoFumosoFuneFunzioneFuocoFurboFurgoneFuroreFusoFutileGabbianoGaffeGalateoGallinaGaloppoGamberoGammaGaranziaGarboGarofanoGarzoneGasdottoGasolioGastricoGattoGaudioGazeboGazzellaGecoGelatinaGelsoGemelloGemmatoGeneGenitoreGennaioGenotipoGergoGhepardoGhiaccioGhisaGialloGildaGineproGiocareGioielloGiornoGioveGiratoGironeGittataGiudizioGiuratoGiustoGlobuloGlutineGnomoGobbaGolfGomitoGommoneGonfioGonnaGovernoGracileGradoGraficoGrammoGrandeGrattareGravosoGraziaGrecaGreggeGrifoneGrigioGrinzaGrottaGruppoGuadagnoGuaioGuantoGuardareGufoGuidareIbernatoIconaIdenticoIdillioIdoloIdraIdricoIdrogenoIgieneIgnaroIgnoratoIlareIllesoIllogicoIlludereImballoImbevutoImboccoImbutoImmaneImmersoImmolatoImpaccoImpetoImpiegoImportoImprontaInalareInarcareInattivoIncantoIncendioInchinoIncisivoInclusoIncontroIncrocioIncuboIndagineIndiaIndoleIneditoInfattiInfilareInflittoIngaggioIngegnoIngleseIngordoIngrossoInnescoInodoreInoltrareInondatoInsanoInsettoInsiemeInsonniaInsulinaIntasatoInteroIntonacoIntuitoInumidireInvalidoInveceInvitoIperboleIpnoticoIpotesiIppicaIrideIrlandaIronicoIrrigatoIrrorareIsolatoIsotopoIstericoIstitutoIstriceItaliaIterareLabbroLabirintoLaccaLaceratoLacrimaLacunaLaddoveLagoLampoLancettaLanternaLardosoLargaLaringeLastraLatenzaLatinoLattugaLavagnaLavoroLegaleLeggeroLemboLentezzaLenzaLeoneLepreLesivoLessatoLestoLetteraleLevaLevigatoLiberoLidoLievitoLillaLimaturaLimitareLimpidoLineareLinguaLiquidoLiraLiricaLiscaLiteLitigioLivreaLocandaLodeLogicaLombareLondraLongevoLoquaceLorenzoLotoLotteriaLuceLucidatoLumacaLuminosoLungoLupoLuppoloLusingaLussoLuttoMacabroMacchinaMaceroMacinatoMadamaMagicoMagliaMagneteMagroMaiolicaMalafedeMalgradoMalintesoMalsanoMaltoMalumoreManaManciaMandorlaMangiareManifestoMannaroManovraMansardaMantideManubrioMappaMaratonaMarcireMarettaMarmoMarsupioMascheraMassaiaMastinoMaterassoMatricolaMattoneMaturoMazurcaMeandroMeccanicoMecenateMedesimoMeditareMegaMelassaMelisMelodiaMeningeMenoMensolaMercurioMerendaMerloMeschinoMeseMessereMestoloMetalloMetodoMettereMiagolareMicaMicelioMicheleMicroboMidolloMieleMiglioreMilanoMiliteMimosaMineraleMiniMinoreMirinoMirtilloMiscelaMissivaMistoMisurareMitezzaMitigareMitraMittenteMnemonicoModelloModificaModuloMoganoMogioMoleMolossoMonasteroMoncoMondinaMonetarioMonileMonotonoMonsoneMontatoMonvisoMoraMordereMorsicatoMostroMotivatoMotosegaMottoMovenzaMovimentoMozzoMuccaMucosaMuffaMughettoMugnaioMulattoMulinelloMultiploMummiaMuntoMuovereMuraleMusaMuscoloMusicaMutevoleMutoNababboNaftaNanometroNarcisoNariceNarratoNascereNastrareNaturaleNauticaNaviglioNebulosaNecrosiNegativoNegozioNemmenoNeofitaNerettoNervoNessunoNettunoNeutraleNeveNevroticoNicchiaNinfaNitidoNobileNocivoNodoNomeNominaNordicoNormaleNorvegeseNostranoNotareNotiziaNotturnoNovellaNucleoNullaNumeroNuovoNutrireNuvolaNuzialeOasiObbedireObbligoObeliscoOblioOboloObsoletoOccasioneOcchioOccidenteOccorrereOccultareOcraOculatoOdiernoOdorareOffertaOffrireOffuscatoOggettoOggiOgnunoOlandeseOlfattoOliatoOlivaOlogrammaOltreOmaggioOmbelicoOmbraOmegaOmissioneOndosoOnereOniceOnnivoroOnorevoleOntaOperatoOpinioneOppostoOracoloOrafoOrdineOrecchinoOreficeOrfanoOrganicoOrigineOrizzonteOrmaOrmeggioOrnativoOrologioOrrendoOrribileOrtensiaOrticaOrzataOrzoOsareOscurareOsmosiOspedaleOspiteOssaOssidareOstacoloOsteOtiteOtreOttagonoOttimoOttobreOvaleOvestOvinoOviparoOvocitoOvunqueOvviareOzioPacchettoPacePacificoPadellaPadronePaesePagaPaginaPalazzinaPalesarePallidoPaloPaludePandoroPannelloPaoloPaonazzoPapricaParabolaParcellaParerePargoloPariParlatoParolaPartireParvenzaParzialePassivoPasticcaPataccaPatologiaPattumePavonePeccatoPedalarePedonalePeggioPelosoPenarePendicePenisolaPennutoPenombraPensarePentolaPepePepitaPerbenePercorsoPerdonatoPerforarePergamenaPeriodoPermessoPernoPerplessoPersuasoPertugioPervasoPesatorePesistaPesoPestiferoPetaloPettinePetulantePezzoPiacerePiantaPiattinoPiccinoPicozzaPiegaPietraPifferoPigiamaPigolioPigroPilaPiliferoPillolaPilotaPimpantePinetaPinnaPinoloPioggiaPiomboPiramidePireticoPiritePirolisiPitoneP
408izzicoPlaceboPlanarePlasmaPlatanoPlenarioPochezzaPoderosoPodismoPoesiaPoggiarePolentaPoligonoPollicePolmonitePolpettaPolsoPoltronaPolverePomicePomodoroPontePopolosoPorfidoPorosoPorporaPorrePortataPosaPositivoPossessoPostulatoPotassioPoterePranzoPrassiPraticaPreclusoPredicaPrefissoPregiatoPrelievoPremerePrenotarePreparatoPresenzaPretestoPrevalsoPrimaPrincipePrivatoProblemaProcuraProdurreProfumoProgettoProlungaPromessaPronomePropostaProrogaProtesoProvaPrudentePrugnaPruritoPsichePubblicoPudicaPugilatoPugnoPulcePulitoPulsantePuntarePupazzoPupillaPuroQuadroQualcosaQuasiQuerelaQuotaRaccoltoRaddoppioRadicaleRadunatoRafficaRagazzoRagioneRagnoRamarroRamingoRamoRandagioRantolareRapatoRapinaRappresoRasaturaRaschiatoRasenteRassegnaRastrelloRataRavvedutoRealeRecepireRecintoReclutaReconditoRecuperoRedditoRedimereRegalatoRegistroRegolaRegressoRelazioneRemareRemotoRennaReplicaReprimereReputareResaResidenteResponsoRestauroReteRetinaRetoricaRettificaRevocatoRiassuntoRibadireRibelleRibrezzoRicaricaRiccoRicevereRiciclatoRicordoRicredutoRidicoloRidurreRifasareRiflessoRiformaRifugioRigareRigettatoRighelloRilassatoRilevatoRimanereRimbalzoRimedioRimorchioRinascitaRincaroRinforzoRinnovoRinomatoRinsavitoRintoccoRinunciaRinvenireRiparatoRipetutoRipienoRiportareRipresaRipulireRisataRischioRiservaRisibileRisoRispettoRistoroRisultatoRisvoltoRitardoRitegnoRitmicoRitrovoRiunioneRivaRiversoRivincitaRivoltoRizomaRobaRoboticoRobustoRocciaRocoRodaggioRodereRoditoreRogitoRollioRomanticoRompereRonzioRosolareRospoRotanteRotondoRotulaRovescioRubizzoRubricaRugaRullinoRumineRumorosoRuoloRupeRussareRusticoSabatoSabbiareSabotatoSagomaSalassoSaldaturaSalgemmaSalivareSalmoneSaloneSaltareSalutoSalvoSapereSapidoSaporitoSaracenoSarcasmoSartoSassosoSatelliteSatiraSatolloSaturnoSavanaSavioSaziatoSbadiglioSbalzoSbancatoSbarraSbattereSbavareSbendareSbirciareSbloccatoSbocciatoSbrinareSbruffoneSbuffareScabrosoScadenzaScalaScambiareScandaloScapolaScarsoScatenareScavatoSceltoScenicoScettroSchedaSchienaSciarpaScienzaScindereScippoSciroppoScivoloSclerareScodellaScolpitoScompartoSconfortoScoprireScortaScossoneScozzeseScribaScrollareScrutinioScuderiaScultoreScuolaScuroScusareSdebitareSdoganareSeccaturaSecondoSedanoSeggiolaSegnalatoSegregatoSeguitoSelciatoSelettivoSellaSelvaggioSemaforoSembrareSemeSeminatoSempreSensoSentireSepoltoSequenzaSerataSerbatoSerenoSerioSerpenteSerraglioServireSestinaSetolaSettimanaSfaceloSfaldareSfamatoSfarzosoSfaticatoSferaSfidaSfilatoSfingeSfocatoSfoderareSfogoSfoltireSforzatoSfrattoSfruttatoSfuggitoSfumareSfusoSgabelloSgarbatoSgonfiareSgorbioSgrassatoSguardoSibiloSiccomeSierraSiglaSignoreSilenzioSillabaSimboloSimpaticoSimulatoSinfoniaSingoloSinistroSinoSintesiSinusoideSiparioSismaSistoleSituatoSlittaSlogaturaSlovenoSmarritoSmemoratoSmentitoSmeraldoSmilzoSmontareSmottatoSmussatoSnellireSnervatoSnodoSobbalzoSobrioSoccorsoSocialeSodaleSoffittoSognoSoldatoSolenneSolidoSollazzoSoloSolubileSolventeSomaticoSommaSondaSonettoSonniferoSopireSoppesoSopraSorgereSorpassoSorrisoSorsoSorteggioSorvolatoSospiroSostaSottileSpadaSpallaSpargereSpatolaSpaventoSpazzolaSpecieSpedireSpegnereSpelaturaSperanzaSpessoreSpettraleSpezzatoSpiaSpigolosoSpillatoSpinosoSpiraleSplendidoSportivoSposoSprangaSprecareSpronatoSpruzzoSpuntinoSquilloSradicareSrotolatoStabileStaccoStaffaStagnareStampatoStantioStarnutoStaseraStatutoSteloSteppaSterzoStilettoStimaStirpeStivaleStizzosoStonatoStoricoStrappoStregatoStriduloStrozzareStruttoStuccareStufoStupendoSubentroSuccosoSudoreSuggeritoSugoSultanoSuonareSuperboSupportoSurgelatoSurrogatoSussurroSuturaSvagareSvedeseSveglioSvelareSvenutoSveziaSviluppoSvistaSvizzeraSvoltaSvuotareTabaccoTabulatoTacciareTaciturnoTaleTalismanoTamponeTanninoTaraTardivoTargatoTariffaTarpareTartarugaTastoTatticoTavernaTavolataTazzaTecaTecnicoTelefonoTemerarioTempoTemutoTendoneTeneroTensioneTentacoloTeoremaTermeTerrazzoTerzettoTesiTesseratoTestatoTetroTettoiaTifareTigellaTimbroTintoTipicoTipografoTiraggioTiroTitanioTitoloTitubanteTizioTizzoneToccareTollerareToltoTombolaTomoTonfoTonsillaTopazioTopologiaToppaTorbaTornareTorroneTortoraToscanoTossireTostaturaTotanoTraboccoTracheaTrafilaTragediaTralcioTramontoTransitoTrapanoTrarreTraslocoTrattatoTraveTrecciaTremolioTrespoloTributoTrichecoTrifoglioTrilloTrinceaTrioTristezzaTrituratoTrivellaTrombaTronoTroppoTrottolaTrovareTruccatoTubaturaTuffatoTulipanoTumultoTunisiaTurbareTurchinoTutaTutelaUbicatoUccelloUccisoreUdireUditivoUffaUfficioUgualeUlisseUltimatoUmanoUmileUmorismoUncinettoUngereUnghereseUnicornoUnificatoUnisonoUnitarioUnteUovoUpupaUraganoUrgenzaUrloUsanzaUsatoUscitoUsignoloUsuraioUtensileUtilizzoUtopiaVacanteVaccinatoVagabondoVagliatoValangaValgoValicoVallettaValorosoValutareValvolaVampataVangareVanitosoVanoVantaggioVanveraVaporeVaranoVarcatoVarianteVascaVedettaVedovaVedutoVegetaleVeicoloVelcroVelinaVellutoVeloceVenatoVendemmiaVentoVeraceVerbaleVergognaVerificaVeroVerrucaVerticaleVescicaVessilloVestaleVeteranoVetrinaVetustoViandanteVibranteVicendaVichingoVicinanzaVidimareVigiliaVignetoVigoreVileVillanoViminiVincitoreViolaViperaVirgolaVirologoVirulentoViscosoVisioneVispoVissutoVisuraVitaVitelloVittimaVivandaVividoViziareVoceVogaVolatileVolereVolpeVoragineVulcanoZampognaZannaZappatoZatteraZavorraZefiroZelanteZeloZenzeroZerbinoZibettoZincoZirconeZittoZollaZoticoZuccheroZufoloZuluZupp
408a";let lp=null;function RT(t){if(lp==null&&(lp=A6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Br.check(t)!=="0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"))throw lp=null,new Error("BIP39 Wordlist for it (Italian) FAILED")}class _6e extends Br{constructor(){super("it")}getWord(e){return RT(this),lp[e]}getWordIndex(e){return RT(this),lp.indexOf(e)}}const ID=new _6e;Br.register(ID);const $w=
vendor: 6,146 bytes, line 408
408"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN<di,AM=W5%QO&ka&ua,hM^tm=zV=JA=wR&+X]7P&NB#4J#5L|/b[dA}tJ<Do&6m&u2[U1&Kb.HM&mC=w0&MW<rY,Hq#6M}QG,13&wP}Jp]Ow%ue&Kg<HP<D9~4k~9T&I2_c6$9T#9/[C5~7O~4a=cs&O7=KK=An&l9$6U$8A&uD&QI|/Y&bg}Ux&F2#6b}E2&JN&kW&kp=U/&bb=Xl<Cj}k+~5J#6L&5z&9i}b4&Fo,ho(X0_g3~4O$Fz&QE<HN=Ww]6/%GF-Vw=tj&/D&PN#9g=YO}cL&Of&PI~5I&Ip=vU=IW#9G;0o-wU}ss&QR<BT&R9=tk$PY_dh&Pq-yh]7T,nj.Xu=EP&76=cI&Fs*Xg}z7$Gb&+I=DF,AF=cA}rL#7j=Dz&3y<Aa$52=PQ}b0(iY$Fa}oL&xV#6U=ec=WZ,xh%RY<dp#9N&Fl&44=WH*A7=sh&TB&8P=07;u+&PK}uh}J5#72)V/=xC,AB$k0&f6;1E|+5=1B,3v]6n&wR%b+&xx]7f=Ol}fl;+D^wG]7E;nB;uh^Ir&l5=JL,nS=cf=g5;u6|/Q$Gc=MH%Hg#5d%M6^86=U+$Gz,l/,ir^5y&Ba&/F-IY&FI&be%IZ#77&PW_Nu$kE(Yf&NX]7Z,Jy&FJ(Xo&Nz#/d=y7&MX<Ag}Z+;nE]Dt(iG#4D=13&Pj~4c%v8&Zo%OL&/X#4W<HR&ie~6J_1O(Y2=y5=Ad*cv_eB#6k&PX:BU#7A;uk&Ft&Fx_dD=U2;vB=U5=4F}+O&GN.HH:9s=b0%NV(jO&IH=JT}Z9=VZ<Af,Kx^4m&uJ%c6,6r;9m#+L}cf%Kh&F3~4H=vP}bu,Hz|++,1w]nv}k6;uu$jw*Kl*WX&uM[x7&Fr[m7$NO&QN]hu=JN}nR^8g#/h(ps|KC;vd}xz=V0}p6&FD$G1#7K<bG_4p~8g&cf;u4=tl}+k%5/}fz;uw<cA=u1}gU}VM=LJ=eX&+L&Pr#4U}p2:nC,2K]7H:jF&9x}uX#9O=MB<fz~8X~5m&4D&kN&u5%E/(h7(ZF&VG<de(qM|/e-Wt=3x(a+,/R]f/&ND$Ro&nU}0g=KA%kH&NK$Ke<dS}cB&IX~5g$TN]6m=Uv,Is&Py=Ef%Kz#+/%bi&+A<F4$OG&4C&FL#9V<Zk=2I_eE&6c]nw&kq$HG}y+&A8$P3}OH=XP]70%IS(AJ_gH%GZ&tY&AZ=vb~6y&/r=VI=Wv<Zi=fl=xf&eL}c8}OL=MJ=g8$F7=YT}9u=0+^xC}JH&nL^N0~4T]K2,Cy%OC#6s;vG(AC^xe^cG&MF}Br#9P;wD-7h$O/&xA}Fn^PC]6i]7G&8V$Qs;vl(TB~73~4l<mW&6V=2y&uY&+3)aP}XF;LP&kx$wU=t7;uy<FN&lz)7E=Oo*Y+;wI}9q}le;J6&Ri&4t&Qr#8B=cb&vG=J5|Ql(h5<Yy~4+}QD,Lx=wn%K/&RK=dO&Pw,Q9=co%4u;9u}g0@6a^4I%b0=zo|/c&tX=dQ=OS#+b=yz_AB&wB&Pm=W9$HP_gR=62=AO=ti=hI,oA&jr&dH=tm&b6$P2(x8=zi;nG~7F;05]0n[Ix&3m}rg=Xp=cd&uz]7t;97=cN;vV<jf&FF&F1=6Q&Ik*Kk&P4,2z=fQ]7D&3u,H0=d/}Uw<ZN<7R}Kv;0f$H7,MD]7n$F0#88~9Z%da=by;+T#/u=VF&fO&kr^kf<AB]sU,I5$Ng&Pz;0i&QD&vM=Yl:BM;nJ_xJ]U7&Kf&30,3f|Z9*dC)je_jA&Q4&Kp$NH(Yz#6S&Id%Ib=KX,AD=KV%dP}tW&Pk^+E_Ni=cq,3R}VZ(Si=b+}rv;0j}rZ]uA,/w(Sx&Jv$w9&4d&wE,NJ$Gy=J/]Ls#7k<ZQ<Y/&uj]Ov$PM;v3,2F&+u:up=On&3e,Jv;90=J+&Qm]6q}bK#+d~8Y(h2]hA;99&AS=I/}qB&dQ}yJ-VM}Vl&ui,iB&G3|Dc]7d=eQ%dX%JC_1L~4d^NP;vJ&/1)ZI#7N]9X[bQ&PL=0L(UZ,Lm&kc&IR}n7(iR<AQ<dg=33=vN}ft}au]7I,Ba=x9=dR~6R&Tq=Xi,3d$Nr&Bc}DI&ku&vf]Dn,/F&iD,Ll&Nw=0y&I7=Ls=/A&tU=Qe}Ua&uk&+F=g4=gh=Vj#+1&Qn}Uy*44#5F,Pc&Rz*Xn=oh=5W;0n_Nf(iE<Y7=vr=Zu]oz#5Z%mI=kN=Bv_Jp(T2;vt_Ml<FS&uI=L/&6P]64$M7}86<bo%QX(SI%IY&VK=Al&Ux;vv;ut*E/%uh<ZE|O3,M2(yc]yu=Wk&tp:Ex}hr,Cl&WE)+Z=8U}I2_4Q,hA_si=iw=OM=tM=yZ%Ia=U7;wT}b+;uo=Za}yS!5x}HD}fb#5O_dA;Nv%uB(yB;01(Sf}Fk;v7}Pt#8v<mZ#7L,/r&Pl~4w&f5=Ph$Fw_LF&8m,bL=yJ&BH}p/*Jn}tU~5Q;wB(h6]Df]8p^+B;E4&Wc=d+;Ea&bw$8C&FN,DM=Yf}mP~5w=fT#6V=mC=Fi=AV}jB&AN}lW}aH#/D)dZ;hl;vE}/7,CJ;31&w8,hj%u9_Js=jJ&4M~8k=TN&eC}nL&uc-wi&lX}dj=Mv=e2#6u=cr$uq$6G]8W}Jb:nm=Yg<b3(UA;vX&6n&xF=KT,jC,De&R8&oY=Zv&oB]7/=Z2&Oa}bf,hh(4h^tZ&72&Nx;D2&xL~5h~40)ZG)h+=OJ&RA]Bv$yB=Oq=df,AQ%Jn}OJ;11,3z&Tl&tj;v+^Hv,Dh(id=s+]7N&N3)9Q~8f,S4=uW=w4&uX,LX&3d]CJ&yp&8x<b2_do&lP=y/<cy_dG=Oi=7R(VH(lt_1T,Iq_AA;12^6T%k6#8K[B1{oO<AU[Bt;1b$9S&Ps<8T=St{bY,jB(Zp&63&Uv$9V,PM]6v&Af}zW[bW_oq}sm}nB&Kq&gC&ff_eq_2m&5F&TI}rf}Gf;Zr_z9;ER&jk}iz_sn<BN~+n&vo=Vi%97|ZR=Wc,WE&6t]6z%85(ly#84=KY)6m_5/=aX,N3}Tm&he&6K]tR_B2-I3;u/&hU&lH<AP=iB&IA=XL;/5&Nh=wv<BH#79=vS=zl<AA=0X_RG}Bw&9p$NW,AX&kP_Lp&/Z(Tc]Mu}hs#6I}5B&cI<bq&H9#6m=K9}vH(Y1(Y0#4B&w6,/9&gG<bE,/O=zb}I4_l8<B/;wL%Qo<HO[Mq=XX}0v&BP&F4(mG}0i}nm,EC=9u{I3,xG&/9=JY*DK&hR)BX=EI=cx=b/{6k}yX%A+&wa}Xb=la;wi^lL;0t}jo&Qb=xg=XB}iO<qo{bR=NV&8f=a0&Jy;0v=uK)HK;vN#6h&jB(h/%ud&NI%wY.X7=Pt}Cu-uL&Gs_hl%mH,tm]78=Lb^Q0#7Y=1u<Bt&+Q=Co_RH,w3;1e}ux<aU;ui}U3&Q5%bt]63&UQ|0l&uL}O7&3o,AV&dm|Nj(Xt*5+(Uu&Hh(p7(UF=VR=Bp^Jl&Hd[ix)9/=Iq]C8<67]66}mB%6f}bb}JI]8T$HA}db=YM&pa=2J}tS&Y0=PS&y4=cX$6E,hX,XP&nR;04,FQ&l0&Vm_Dv#5Y~8Z=Bi%MA]6x=JO:+p,Az&9q,Hj~6/}SD=K1:EJ}nA;Qo#/E]9R,Ie&6X%W3]61&v4=xX_MC=0q;06(Xq=fs}IG}Dv=0l}o7$iZ;9v&LH&DP-7a&OY,SZ,Kz,Cv&dh=fx|Nh,F/~7q=XF&w+;9n&Gw;0h}Z7<7O&JK(S7&LS<AD<ac=wo<Dt&zw%4B=4v#8P;9o~6p*vV=Tm,Or&I6=1q}nY=P0=gq&Bl&Uu,Ch%yb}UY=zh}dh}rl(T4_xk(YA#8R*xH,IN}Jn]7V}C4&Ty}j3]7p=cL=3h&wW%Qv<Z3=f0&RI&+S(ic_zq}oN&/Y=z1;Td=LW=0e=OI(Vc,+b^ju(UL;0r:Za%8v=Rp=zw&58&73&wK}qX]6y&8E)a2}WR=wP^ur&nQ<cH}Re=Aq&wk}Q0&+q=PP,Gc|/d^k5,Fw]8Y}Pg]p3=ju=ed}r5_yf&Cs]7z$/G<Cm&Jp&54_1G_gP_Ll}JZ;0u]k8_7k(Sg]65{9i=LN&Sx&WK,iW&fD&Lk{9a}Em-9c#8N&io=sy]8d&nT&IK(lx#7/$lW(Td<s8~49,3o<7Y=MW(T+_Jr&Wd,iL}Ct=xh&5V;v4&8n%Kx=iF&l2_0B{B+,If(J0,Lv;u8=Kx-vB=HC&vS=Z6&fU&vE^xK;3D=4h=MR#45:Jw;0d}iw=LU}I5=I0]gB*im,K9}GU,1k_4U&Tt=Vs(iX&lU(TF#7y,ZO}oA&m5#5P}PN}Uz=hM<B1&FB<aG,e6~7T<tP(UQ_ZT=wu&F8)aQ]iN,1r_Lo&/g:CD}84{J1_Ki&Na&3n$jz&FE=dc;uv;va}in}ll=fv(h1&3h}fp=Cy}BM(+E~8m}lo%v7=hC(T6$cj=BQ=Bw(DR,2j=Ks,NS|F+;00=fU=70}Mb(YU;+G&m7&hr=Sk%Co]t+(X5_Jw}0r}gC(AS-IP&QK<Z2#8Q$WC]WX}T2&pG_Ka,HC=R4&/N;Z+;ch(C7,D4$3p_Mk&B2$8D=n9%Ky#5z(CT&QJ#7B]DC]gW}nf~5M;Iw#80}Tc_1F#4Z-aC}Hl=ph=fz,/3=aW}JM}nn;DG;vm}wn,4P}T3;wx&RG$u+}zK=0b;+J_Ek{re<aZ=AS}yY#5D]7q,Cp}xN=VP*2C}GZ}aG~+m_Cs=OY#6r]6g<GS}LC(UB=3A=Bo}Jy<c4}Is;1P<AG}Op<Z1}ld}nS=1Z,yM&95&98=CJ(4t:2L$Hk=Zo}Vc;+I}np&N1}9y=iv}CO*7p=jL)px]tb^zh&GS&Vl%v/;vR=14=zJ&49|/f]hF}WG;03=8P}o/&Gg&rp;DB,Kv}Ji&Pb;aA^ll(4j%yt}+K$Ht#4y&hY]7Y<F1,eN}bG(Uh%6Z]t5%G7;+F_RE;it}tL=LS&Da=Xx(S+(4f=8G=yI}cJ}WP=37=jS}pX}hd)fp<A8=Jt~+o$HJ=M6}iX=g9}CS=dv=Cj(mP%Kd,xq|+9&LD(4/=Xm&QP=Lc}LX&fL;+K=Op(lu=Qs.qC:+e&L+=Jj#8w;SL]7S(b+#4I=c1&nG_Lf&uH;+R)ZV<bV%B/,TE&0H&Jq&Ah%OF&Ss(p2,Wv&I3=Wl}Vq;1L&lJ#9b_1H=8r=b8=JH(SZ=hD=J2#7U,/U#/X~6P,FU<eL=jx,mG=hG=CE&PU=Se(qX&LY=X6=y4&tk&QQ&tf=4g&xI}W+&mZ=Dc#7w}Lg;DA;wQ_Kb(cJ=hR%yX&Yb,hw{bX_4X;EP;1W_2M}Uc=b5(YF,CM&Tp^OJ{DD]6s=vF=Yo~8q}XH}Fu%P5(SJ=Qt;MO]s8<F3&B3&8T(Ul-BS*dw&dR<87}/8]62$PZ]Lx<Au}9Q]7c=ja=KR,Go,Us&v6(qk}pG&G2=ev^GM%w4&H4]7F&dv]J6}Ew:9w=sj-ZL}Ym$+h(Ut(Um~4n=Xs(U7%eE=Qc_JR<CA#6t<Fv|/I,IS,EG<F2(Xy$/n<Fa(h9}+9_2o&N4#7X<Zq|+f_Dp=dt&na,Ca=NJ)jY=8C=YG=s6&Q+<DO}D3=xB&R1(lw;Qn<bF(Cu|/B}HV=SS&n7,10&u0]Dm%A6^4Q=WR(TD=Xo<GH,Rj(l8)bP&n/=LM&CF,F5&ml=PJ;0k=LG=tq,Rh,D6@4i=1p&+9=YC%er_Mh;nI;0q=Fw]80=xq=FM$Gv;v6&nc;wK%H2&Kj;vs,AA=YP,66}bI(qR~5U=6q~4b$Ni=K5.X3$So&Iu(p+]8G=Cf=RY(TS_O3(iH&57=fE=Dg_Do#9z#7H;FK{qd_2k%JR}en&gh_z8;Rx}9p<cN_Ne,DO;LN_7o~/p=NF=5Y}gN<ce<C1,QE]Wv=3u<BC}GK]yq}DY&u/_hj=II(pz&rC,jV&+Z}ut=NQ;Cg-SR_ZS,+o=u/;Oy_RK_QF(Fx&xP}Wr&TA,Uh&g1=yr{ax[VF$Pg(YB;Ox=Vy;+W(Sp}XV%dd&33(l/]l4#4Y}OE=6c=bw(A7&9t%wd&N/&mo,JH&Qe)fm=Ao}fu=tH"
408,C6e="FAZDC6BALcLZCA+GBARCW8wNCcDDZ8LVFBOqqDUiou+M42TFAyERXFb7EjhP+vmBFpFrUpfDV2F7eB+eCltCHJFWLFCED+pWTojEIHFXc3aFn4F68zqjEuKidS1QBVPDEhE7NA4mhMF7oThD49ot3FgtzHFCK0acW1x8DH1EmLoIlrWFBLE+y5+NA3Cx65wJHTaEZVaK1mWAmPGxgYCdxwOjTDIt/faOEhTl1vqNsKtJCOhJWuio2g07KLZEQsFBUpNtwEByBgxFslFheFbiEPvi61msDvApxCzB6rBCzox7joYA5UdDc+Cb4FSgIabpXFAj3bjkmFAxCZE+mD/SFf/0ELecYCt3nLoxC6WEZf2tKDB4oZvrEmqFkKk7BwILA7gtYBpsTq//D4jD0F0wEB9pyQ1BD5Ba0oYHDI+sbDFhvrHXdDHfgFEIJLi5r8qercNFBgFLC4bo5ERJtamWBDFy73KCEb6M8VpmEt330ygCTK58EIIFkYgF84gtGA9Uyh3m68iVrFbWFbcbqiCYHZ9J1jeRPbL8yswhMiDbhEhdNoSwFbZrLT740ABEqgCkO8J1BLd1VhKKR4sD1yUo0z+FF59Mvg71CFbyEhbHSFBKEIKyoQNgQppq9T0KAqePu0ZFGrXOHdKJqkoTFhYvpDNyuuznrN84thJbsCoO6Cu6Xlvntvy0QYuAExQEYtTUBf3CoCqwgGFZ4u1HJFzDVwEy3cjcpV4QvsPaBC3rCGyCF23o4K3pp2gberGgFEJEHo4nHICtyKH2ZqyxhN05KBBJIQlKh/Oujv/DH32VrlqFdIFC7Fz9Ct4kaqFME0UETLprnN9kfy+kFmtQBB0+5CFu0N9Ij8l/VvJDh2oq3hT6EzjTHKFN7ZjZwoTsAZ4Exsko6Fpa6WC+sduz8jyrLpegTv2h1EBeYpLpm2czQW0KoCcS0bCVXCmuWJDBjN1nQNLdF58SFJ0h7i3pC3oEOKy/FjBklL70XvBEEIWp2yZ04xObzAWDDJG7f+DbqBEA7LyiR95j7MDVdDViz2RE5vWlBMv5e4+VfhP3aXNPhvLSynb9O2x4uFBV+3jqu6d5pCG28/sETByvmu/+IJ0L3wb4rj9DNOLBF6XPIODr4L19U9RRofAG6Nxydi8Bki8BhGJbBAJKzbJxkZSlF9Q2Cu8oKqggB9hBArwLLqEBWEtFowy8XK8bEyw9snT+BeyFk1ZCSrdmgfEwFePTgCjELBEnIbjaDDPJm36rG9pztcEzT8dGk23SBhXBB1H4z+OWze0ooFzz8pDBYFvp9j9tvFByf9y4EFdVnz026CGR5qMr7fxMHN8UUdlyJAzlTBDRC28k+L4FB8078ljyD91tUj1ocnTs8vdEf7znbzm+GIjEZnoZE5rnLL700Xc7yHfz05nWxy03vBB9YGHYOWxgMQGBCR24CVYNE1hpfKxN0zKnfJDmmMgMmBWqNbjfSyFCBWSCGCgR8yFXiHyEj+VtD1FB3FpC1zI0kFbzifiKTLm9yq5zFmur+q8FHqjoOBWsBPiDbnCC2ErunV6cJ6TygXFYHYp7MKN9RUlSIS8/xBAGYLzeqUnBF4QbsTuUkUqGs6CaiDWKWjQK9EJkjpkTmNCPYXL",$d={zh_cn:null,zh_tw:null},S6e={zh_cn:"0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1",zh_tw:"0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d"},Lw="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T6e="~!@#$%^&*_-=[]{}|;:,.()<>?";function PT(t){if($d[t.locale]!==null)return;$d[t.locale]=[];let e=0;for(let r=0;r<2048;r++){const n=T6e.indexOf($w[r*3]),i=[228+(n>>2),128+Lw.indexOf($w[r*3+1]),128+Lw.indexOf($w[r*3+2])];if(t.locale==="zh_tw"){const s=n%4;for(let o=s;o<3;o++)i[o]=Lw.indexOf(C6e[e++])+(o==0?228:128)}$d[t.locale].push(on(i))}if(Br.check(t)!==S6e[t.locale])throw $d[t.locale]=null,new Error("BIP39 Wordlist for "+t.locale+" (Chinese) FAILED")}class xD extends Br{constructor(e){super("zh_"+e)}getWord(e){return PT(this),$d[this.locale][e]}getWordIndex(e){return PT(this),$d[this.locale].indexOf(e)}split(e){return e=e.replace(/(?:\u3000| )+/g,""),e.split("")}}const ey=new xD("cn");Br.register(ey);Br.register(ey,"zh");const RD=new xD("tw");Br.register(RD);const Y6={cz:yD,en:vD,es:AD,fr:SD,it:ID,ja:TD,ko:ND,zh:ey,zh_cn:ey,zh_tw:RD},N6e="hdnode/5.2.0",ih=new re(N6e),I6e=Ie.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),x6e=ln("Bitcoin seed"),Rd=2147483648;function PD(t){return(1<<t)-1<<8-t}function R6e(t){return(1<<t)-1}function am(t){return cn(Ne(t),32)}function kT(t){return ug.encode(tn([t,ms(Yc(Yc(t)),0,4)]))}function g8(t){if(t==null)return Y6.en;if(typeof t=="string"){const e=Y6[t];return e==null&&ih.throwArgumentError("unknown locale","wordlist",t),e}return t}const Ad={},Dh="m/44'/60'/0'/0/0";class is{constructor(e,r,n,i,s,o,a,c){if(ih.checkNew(new.target,is),e!==Ad)throw new Error("HDNode constructor cannot be called directly");if(r){const l=new vf(r);ae(this,"privateKey",l.privateKey),ae(this,"publicKey",l.compressedPublicKey)}else ae(this,"privateKey",null),ae(this,"publicKey",Ne(n));ae(this,"parentFingerprint",i),ae(this,"fingerprint",ms(bD(Yc(this.publicKey)),0,4)),ae(this,"address",Ql(this.publicKey)),ae(this,"chainCode",s),ae(this,"index",o),ae(this,"depth",a),c==null?(ae(this,"mnemonic",null),ae(this,"path",null)):typeof c=="string"?(ae(this,"mnemonic",null),ae(this,"path",c)):(ae(this,"mnemonic",c),ae(this,"path",c.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return kT(tn([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Ne(this.depth),this.parentFingerprint,cn(Ne(this.index),4),this.chainCode,this.privateKey!=null?tn(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new is(Ad,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Rd));const n=new Uint8Array(37);if(e&Rd){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(ve(this.privateKey),1),r&&(r+="'")}else n.set(ve(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=ve(A1(Mh.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=am(Ie.from(s).add(this.privateKey).mod(I6e)):c=new vf(Ne(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new is(Ad,a,c,this.fingerprint,am(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i<r.length;i++){const s=r[i];if(s.match(/^[0-9]+'$/)){const o=parseInt(s.substring(0,s.length-1));if(o>=Rd)throw new Error("invalid path index - "+s);n=n._derive(Rd+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=Rd)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=ve(e);
408if(n.length<16||n.length>64)throw new Error("invalid seed");const i=ve(A1(Mh.sha512,x6e,n));return new is(Ad,am(i.slice(0,32)),null,"0x00000000",am(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=g8(n),e=d2(f2(e,n),n),is._fromSeed(kD(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return is._fromSeed(e,null)}static fromExtendedKey(e){const r=ug.decode(e);(r.length!==82||kT(r.slice(0,78))!==e)&&ih.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=Ne(r.slice(5,9)),s=parseInt(Ne(r.slice(9,13)).substring(2),16),o=Ne(r.slice(13,45)),a=r.slice(45,78);switch(Ne(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new is(Ad,null,Ne(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new is(Ad,Ne(a.slice(1)),null,i,o,s,n,null)}return ih.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function kD(t,e){e||(e="");const r=ln("mnemonic"+e,Wa.NFKD);return p8(ln(t,Wa.NFKD),r,2048,64,"sha512")}function f2(t,e){e=g8(e),ih.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=ve(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l<r.length;l++){let u=e.getWordIndex(r[l].normalize("NFKD"));if(u===-1)throw new Error("invalid mnemonic");for(let f=0;f<11;f++)u&1<<10-f&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=PD(o);if((ve(Yc(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return Ne(n.slice(0,s/8))}function d2(t,e){if(e=g8(e),t=ve(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o<t.length;o++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&R6e(8-n)),n+=3);const i=t.length/4,s=ve(Yc(t))[0]&PD(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function P6e(t,e){try{return f2(t,e),!0}catch{}return!1}function k6e(t){return(typeof t!="number"||t<0||t>=Rd||t%1)&&ih.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const O6e="random/5.2.0",Q6=new re(O6e);let Yu=null;try{if(Yu=window,Yu==null)throw new Error("try next")}catch{try{if(Yu=global,Yu==null)throw new Error("try next")}catch{Yu={}}}let jm=Yu.crypto||Yu.msCrypto;(!jm||!jm.getRandomValues)&&(Q6.warn("WARNING: Missing strong random number source"),jm={getRandomValues:function(t){return Q6.throwError("no secure random source avaialble",re.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Ld(t){(t<=0||t>1024||t%1)&&Q6.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return jm.getRandomValues(e),ve(e)}function OD(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}var Ia=ed(function(t,e){(function(r){function n(C){return parseInt(C)===C}function i(C){if(!n(C.length))return!1;for(var S=0;S<C.length;S++)if(!n(C[S])||C[S]<0||C[S]>255)return!1;return!0}function s(C,S){if(C.buffer&&ArrayBuffer.isView(C)&&C.name==="Uint8Array")return S&&(C.slice?C=C.slice():C=Array.prototype.slice.call(C)),C;if(Array.isArray(C)){if(!i(C))throw new Error("Array contains invalid value: "+C);return new Uint8Array(C)}if(n(C.length)&&i(C))return new Uint8Array(C);throw new Error("unsupported array-like object")}function o(C){return new Uint8Array(C)}function a(C,S,B,$,P){($!=null||P!=null)&&(C.slice?C=C.slice($,P):C=Array.prototype.slice.call(C,$,P)),S.set(C,B)}var c=function(){function C(B){var $=[],P=0;for(B=encodeURI(B);P<B.length;
408){var q=B.charCodeAt(P++);q===37?($.push(parseInt(B.substr(P,2),16)),P+=2):$.push(q)}return s($)}function S(B){for(var $=[],P=0;P<B.length;){var q=B[P];q<128?($.push(String.fromCharCode(q)),P++):q>191&&q<224?($.push(String.fromCharCode((q&31)<<6|B[P+1]&63)),P+=2):($.push(String.fromCharCode((q&15)<<12|(B[P+1]&63)<<6|B[P+2]&63)),P+=3)}return $.join("")}return{toBytes:C,fromBytes:S}}(),l=function(){function C($){for(var P=[],q=0;q<$.length;q+=2)P.push(parseInt($.substr(q,2),16));return P}var S="0123456789abcdef";function B($){for(var P=[],q=0;q<$.length;q++){var V=$[q];P.push(S[(V&240)>>4]+S[V&15])}return P.join("")}return{toBytes:C,fromBytes:B}}(),u={16:10,24:12,32:14},f=[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],d=[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],h=[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],g=[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,16733
40813503,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],b=[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],w=[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,389
408623319,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],x=[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],k=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,
408632953703,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],R=[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],D=[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,12974
40803050,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],O=[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,60
4087398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],M=[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],F=[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,12
40801765386,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],H=[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],U=[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,4002861
408748,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 G(C){for(var S=[],B=0;B<C.length;B+=4)S.push(C[B]<<24|C[B+1]<<16|C[B+2]<<8|C[B+3]);return S}var N=function(C){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:s(C,!0)}),this._prepare()};N.prototype._prepare=function(){var C=u[this.key.length];if(C==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var S=0;S<=C;S++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var B=(C+1)*4,$=this.key.length/4,P=G(this.key),q,S=0;S<$;S++)q=S>>2,this._Ke[q][S%4]=P[S],this._Kd[C-q][S%4]=P[S];for(var V=0,X=$,Z;X<B;){if(Z=P[$-1],P[0]^=d[Z>>16&255]<<24^d[Z>>8&255]<<16^d[Z&255]<<8^d[Z>>24&255]^f[V]<<24,V+=1,$!=8)for(var S=1;S<$;S++)P[S]^=P[S-1];else{for(var S=1;S<$/2;S++)P[S]^=P[S-1];Z=P[$/2-1],P[$/2]^=d[Z&255]^d[Z>>8&255]<<8^d[Z>>16&255]<<16^d[Z>>24&255]<<24;for(var S=$/2+1;S<$;S++)P[S]^=P[S-1]}for(var S=0,ie,ce;S<$&&X<B;)ie=X>>2,ce=X%4,this._Ke[ie][ce]=P[S],this._Kd[C-ie][ce]=P[S++],X++}for(var ie=1;ie<C;ie++)for(var ce=0;ce<4;ce++)Z=this._Kd[ie][ce],this._Kd[ie][ce]=M[Z>>24&255]^F[Z>>16&255]^H[Z>>8&255]^U[Z&255]},N.prototype.encrypt=function(C){if(C.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var S=this._Ke.length-1,B=[0,0,0,0],$=G(C),P=0;P<4;P++)$[P]^=this._Ke[0][P];for(var q=1;q<S;q++){for(var P=0;P<4;P++)B[P]=g[$[P]>>24&255]^b[$[(P+1)%4]>>16&255]^w[$[(P+2)%4]>>8&255]^x[$[(P+3)%4]&255]^this._Ke[q][P];$=B.slice()}for(var V=o(16),X,P=0;P<4;P++)X=this._Ke[S][P],V[4*P]=(d[$[P]>>24&255]^X>>24)&255,V[4*P+1]=(d[$[(P+1)%4]>>16&255]^X>>16)&255,V[4*P+2]=(d[$[(P+2)%4]>>8&255]^X>>8)&255,V[4*P+3]=(d[$[(P+3)%4]&255]^X)&255;return V},N.prototype.decrypt=function(C){if(C.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var S=this._Kd.length-1,B=[0,0,0,0],$=G(C),P=0;P<4;P++)$[P]^=this._Kd[0][P];for(var q=1;q<S;q++){for(var P=0;P<4;P++)B[P]=k[$[P]>>24&255]^R[$[(P+3)%4]>>16&255]^D[$[(P+2)%4]>>8&255]^O[$[(P+1)%4]&255]^this._Kd[q][P];$=B.slice()}for(var V=o(16),X,P=0;P<4;P++)X=this._Kd[S][P],V[4*P]=(h[$[P]>>24&255]^X>>24)&255,V[4*P+1]=(h[$[(P+3)%4]>>16&255]^X>>16)&255,V[4*P+2]=(h[$[(P+2)%4]>>8&255]^X>>8)&255,V[4*P+3]=(h[$[(P+1)%4]&255]^X)&255;return V};var A=function(C){if(!(this instanceof A))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new N(C)};A.prototype.encrypt=function(C){if(C=s(C),C.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var S=o(C.length),B=o(16),$=0;$<C.length;
408$+=16)a(C,B,0,$,$+16),B=this._aes.encrypt(B),a(B,S,$);return S},A.prototype.decrypt=function(C){if(C=s(C),C.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var S=o(C.length),B=o(16),$=0;$<C.length;$+=16)a(C,B,0,$,$+16),B=this._aes.decrypt(B),a(B,S,$);return S};var v=function(C,S){if(!(this instanceof v))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!S)S=o(16);else if(S.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=s(S,!0),this._aes=new N(C)};v.prototype.encrypt=function(C){if(C=s(C),C.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var S=o(C.length),B=o(16),$=0;$<C.length;$+=16){a(C,B,0,$,$+16);for(var P=0;P<16;P++)B[P]^=this._lastCipherblock[P];this._lastCipherblock=this._aes.encrypt(B),a(this._lastCipherblock,S,$)}return S},v.prototype.decrypt=function(C){if(C=s(C),C.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var S=o(C.length),B=o(16),$=0;$<C.length;$+=16){a(C,B,0,$,$+16),B=this._aes.decrypt(B);for(var P=0;P<16;P++)S[$+P]=B[P]^this._lastCipherblock[P];a(C,this._lastCipherblock,0,$,$+16)}return S};var p=function(C,S,B){if(!(this instanceof p))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!S)S=o(16);else if(S.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");B||(B=1),this.segmentSize=B,this._shiftRegister=s(S,!0),this._aes=new N(C)};p.prototype.encrypt=function(C){if(C.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var S=s(C,!0),B,$=0;$<S.length;$+=this.segmentSize){B=this._aes.encrypt(this._shiftRegister);for(var P=0;P<this.segmentSize;P++)S[$+P]^=B[P];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(S,this._shiftRegister,16-this.segmentSize,$,$+this.segmentSize)}return S},p.prototype.decrypt=function(C){if(C.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var S=s(C,!0),B,$=0;$<S.length;$+=this.segmentSize){B=this._aes.encrypt(this._shiftRegister);for(var P=0;P<this.segmentSize;P++)S[$+P]^=B[P];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(C,this._shiftRegister,16-this.segmentSize,$,$+this.segmentSize)}return S};var m=function(C,S){if(!(this instanceof m))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!S)S=o(16);else if(S.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=s(S,!0),this._lastPrecipherIndex=16,this._aes=new N(C)};m.prototype.encrypt=function(C){for(var S=s(C,!0),B=0;B<S.length;B++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),S[B]^=this._lastPrecipher[this._lastPrecipherIndex++];return S},m.prototype.decrypt=m.prototype.encrypt;var y=function(C){if(!(this instanceof y))throw Error("Counter must be instanitated with `new`");C!==0&&!C&&(C=1),typeof C=="number"?(this._counter=o(16),this.setValue(C)):this.setBytes(C)};y.prototype.setValue=function(C){if(typeof C!="number"||parseInt(C)!=C)throw new Error("invalid counter value (must be an integer)");for(var S=15;S>=0;--S)this._counter[S]=C%256,C=C>>8},y.prototype.setBytes=function(C){if(C=s(C,!0),C.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=C},y.prototype.increment=function(){for(var C=15;C>=0;C--)if(this._counter[C]===255)this._counter[C]=0;else{this._counter[C]++;break}};var T=function(C,S){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",S instanceof y||(S=new y(S)),this._counter=S,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new N(C)};T.prototype.encrypt=function(C){for(var S=s(C,!0),B=0;B<S.length;B++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt
408(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),S[B]^=this._remainingCounter[this._remainingCounterIndex++];return S},T.prototype.decrypt=T.prototype.encrypt;function I(C){C=s(C,!0);var S=16-C.length%16,B=o(C.length+S);a(C,B);for(var $=C.length;$<B.length;$++)B[$]=S;return B}function _(C){if(C=s(C,!0),C.length<16)throw new Error("PKCS#7 invalid length");var S=C[C.length-1];if(S>16)throw new Error("PKCS#7 padding byte out of range");for(var B=C.length-S,$=0;$<S;$++)if(C[B+$]!==S)throw new Error("PKCS#7 invalid padding byte");var P=o(B);return a(C,P,0,0,B),P}var E={AES:N,Counter:y,ModeOfOperation:{ecb:A,cbc:v,cfb:p,ofb:m,ctr:T},utils:{hex:l,utf8:c},padding:{pkcs7:{pad:I,strip:_}},_arrayTest:{coerceArray:s,createArray:o,copyArray:a}};t.exports=E})()});const MD="json-wallets/5.2.0";function wf(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),ve(t)}function x0(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function m8(t){return typeof t=="string"?ln(t,Wa.NFKC):ve(t)}function An(t,e){let r=t;const n=e.toLowerCase().split("/");for(let i=0;i<n.length;i++){let s=null;for(const o in r)if(o.toLowerCase()===n[i]){s=r[o];break}if(s===null)return null;r=s}return r}function M6e(t){const e=ve(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;const r=Ne(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const D6e=new re(MD);class B6e extends Xh{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}}function DD(t,e){const r=JSON.parse(t);e=m8(e);const n=Jr(An(r,"ethaddr")),i=wf(An(r,"encseed"));(!i||i.length%16!==0)&&D6e.throwArgumentError("invalid encseed","json",t);const s=ve(p8(e,e,2e3,32,"sha256")).slice(0,16),o=i.slice(0,16),a=i.slice(16),c=new Ia.ModeOfOperation.cbc(s,o),l=Ia.padding.pkcs7.strip(ve(c.decrypt(a)));let u="";for(let h=0;h<l.length;h++)u+=String.fromCharCode(l[h]);const f=ln(u),d=Wr(f);return new B6e({_isCrowdsaleAccount:!0,address:n,privateKey:d})}function b8(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function y8(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}function F6e(t){if(b8(t))try{return Jr(JSON.parse(t).ethaddr)}catch{return null}if(y8(t))try{return Jr(JSON.parse(t).address)}catch{return null}return null}var v8=ed(function(t,e){(function(r){function i(b){const w=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]);let x=1779033703,k=3144134277,R=1013904242,D=2773480762,O=1359893119,M=2600822924,F=528734635,H=1541459225;const U=new Uint32Array(64);function G(T){let I=0,_=T.length;for(;_>=64;){let E=x,C=k,S=R,B=D,$=O,P=M,q=F,V=H,X,Z,ie,ce,se;for(Z=0;Z<16;Z++)ie=I+Z*4,U[Z]=(T[ie]&255)<<24|(T[ie+1]&255)<<16|(T[ie+2]&255)<<8|T[ie+3]&255;for(Z=16;Z<64;Z++)X=U[Z-2],ce=(X>>>17|X<<32-17)^(X>>>19|X<<32-19)^X>>>10,X=U[Z-15],se=(X>>>7|X<<32-7)^(X>>>18|X<<32-18)^X>>>3,U[Z]=(ce+U[Z-7]|0)+(se+U[Z-16]|0)|0;for(Z=0;Z<64;Z++)ce=((($>>>6|$<<32-6)^($>>>11|$<<32-11)^($>>>25|$<<32-25))+($&P^~$&q)|0)+(V+(w[Z]+U[Z]|0)|0)|0,se=((E>>>2|E<<32-2)^(E>>>13|E<<32-13)^(E>>>22|E<<32-22))+(E&C^E&S^C&S)|0,V=q,q=P,P=$,$=B+ce|0,B=S,S=C,C=E,E=ce+se|0;x=x+E|0,k=k+C|0,R=R+S|0,D=D+B|0,O=O+$|0,M=M+P|0,F=F+q|0,H=H+V|0,I+=64,_-=64}}G(b);let N,A=b.length%64,v=b.length/536870912|0,p=b.length<<3,m=A<56?56:120,y=b.slice(b.length-A,b.length);for(y.push(128),N=A+1;N<m;N++)y.push(0);return y.push(v>>>24&255),y.push(v>>>16&255),y.push(v>>>8&255),y.push(v>>>0&255),y.push(p>>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),G(y),[x>>>24&255,x>>>16&255,x>>>8&255,x>>>0&255,k>>>24&255,k>>>16&255,k>>>8&255,k>>>0&255,R>>>24&255,R>>>16&255,R>>>8&255,R>>>0&255,D>>>24&255,D>>>16&255,D>>>8&255,D>>>0&255,O>>>24&255,O>>>16&255,O>>>8&255,O>>>0&255,M>>>24&255,M>>>16&255,M>>>8&255,M>>>0&255,F>>>24&255,F>>>16&255,F>>>8&255,F>>>0&255,H>
408>>24&255,H>>>16&255,H>>>8&255,H>>>0&255]}function s(b,w,x){b=b.length<=64?b:i(b);const k=64+w.length+4,R=new Array(k),D=new Array(64);let O,M=[];for(O=0;O<64;O++)R[O]=54;for(O=0;O<b.length;O++)R[O]^=b[O];for(O=0;O<w.length;O++)R[64+O]=w[O];for(O=k-4;O<k;O++)R[O]=0;for(O=0;O<64;O++)D[O]=92;for(O=0;O<b.length;O++)D[O]^=b[O];function F(){for(let H=k-1;H>=k-4;H--){if(R[H]++,R[H]<=255)return;R[H]=0}}for(;x>=32;)F(),M=M.concat(i(D.concat(i(R)))),x-=32;return x>0&&(F(),M=M.concat(i(D.concat(i(R))).slice(0,x))),M}function o(b,w,x,k,R){let D;for(u(b,(2*x-1)*16,R,0,16),D=0;D<2*x;D++)l(b,D*16,R,16),c(R,k),u(R,0,b,w+D*16,16);for(D=0;D<x;D++)u(b,w+D*2*16,b,D*16,16);for(D=0;D<x;D++)u(b,w+(D*2+1)*16,b,(D+x)*16,16)}function a(b,w){return b<<w|b>>>32-w}function c(b,w){u(b,0,w,0,16);for(let x=8;x>0;x-=2)w[4]^=a(w[0]+w[12],7),w[8]^=a(w[4]+w[0],9),w[12]^=a(w[8]+w[4],13),w[0]^=a(w[12]+w[8],18),w[9]^=a(w[5]+w[1],7),w[13]^=a(w[9]+w[5],9),w[1]^=a(w[13]+w[9],13),w[5]^=a(w[1]+w[13],18),w[14]^=a(w[10]+w[6],7),w[2]^=a(w[14]+w[10],9),w[6]^=a(w[2]+w[14],13),w[10]^=a(w[6]+w[2],18),w[3]^=a(w[15]+w[11],7),w[7]^=a(w[3]+w[15],9),w[11]^=a(w[7]+w[3],13),w[15]^=a(w[11]+w[7],18),w[1]^=a(w[0]+w[3],7),w[2]^=a(w[1]+w[0],9),w[3]^=a(w[2]+w[1],13),w[0]^=a(w[3]+w[2],18),w[6]^=a(w[5]+w[4],7),w[7]^=a(w[6]+w[5],9),w[4]^=a(w[7]+w[6],13),w[5]^=a(w[4]+w[7],18),w[11]^=a(w[10]+w[9],7),w[8]^=a(w[11]+w[10],9),w[9]^=a(w[8]+w[11],13),w[10]^=a(w[9]+w[8],18),w[12]^=a(w[15]+w[14],7),w[13]^=a(w[12]+w[15],9),w[14]^=a(w[13]+w[12],13),w[15]^=a(w[14]+w[13],18);for(let x=0;x<16;++x)b[x]+=w[x]}function l(b,w,x,k){for(let R=0;R<k;R++)x[R]^=b[w+R]}function u(b,w,x,k,R){for(;R--;)x[k++]=b[w++]}function f(b){if(!b||typeof b.length!="number")return!1;for(let w=0;w<b.length;w++){const x=b[w];if(typeof x!="number"||x%1||x<0||x>=256)return!1}return!0}function d(b,w){if(typeof b!="number"||b%1)throw new Error("invalid "+w);return b}function h(b,w,x,k,R,D,O){if(x=d(x,"N"),k=d(k,"r"),R=d(R,"p"),D=d(D,"dkLen"),x===0||x&x-1)throw new Error("N must be power of 2");if(x>2147483647/128/k)throw new Error("N too large");if(k>2147483647/128/R)throw new Error("r too large");if(!f(b))throw new Error("password must be an array or buffer");if(b=Array.prototype.slice.call(b),!f(w))throw new Error("salt must be an array or buffer");w=Array.prototype.slice.call(w);let M=s(b,w,R*128*k);const F=new Uint32Array(R*32*k);for(let $=0;$<F.length;$++){const P=$*4;F[$]=(M[P+3]&255)<<24|(M[P+2]&255)<<16|(M[P+1]&255)<<8|(M[P+0]&255)<<0}const H=new Uint32Array(64*k),U=new Uint32Array(32*k*x),G=32*k,N=new Uint32Array(16),A=new Uint32Array(16),v=R*x*2;let p=0,m=null,y=!1,T=0,I=0,_,E;const C=O?parseInt(1e3/k):4294967295,S=typeof setImmediate<"u"?setImmediate:setTimeout,B=function(){if(y)return O(new Error("cancelled"),p/v);let $;switch(T){case 0:E=I*32*k,u(F,E,H,0,G),T=1,_=0;case 1:$=x-_,$>C&&($=C);for(let q=0;q<$;q++)u(H,0,U,(_+q)*G,G),o(H,G,k,N,A);if(_+=$,p+=$,O){const q=parseInt(1e3*p/v);if(q!==m){if(y=O(null,p/v),y)break;m=q}}if(_<x)break;_=0,T=2;case 2:$=x-_,$>C&&($=C);for(let q=0;q<$;q++){const V=(2*k-1)*16,X=H[V]&x-1;l(U,X*G,H,G),o(H,G,k,N,A)}if(_+=$,p+=$,O){const q=parseInt(1e3*p/v);if(q!==m){if(y=O(null,p/v),y)break;m=q}}if(_<x)break;if(u(H,0,F,E,G),I++,I<R){T=0;break}M=[];for(let q=0;q<F.length;q++)M.push(F[q]>>0&255),M.push(F[q]>>8&255),M.push(F[q]>>16&255),M.push(F[q]>>24&255);const P=s(b,M,D);return O&&O(null,1,P),P}O&&S(B)};if(!O)for(;;){const $=B();if($!=null)return $}B()}const g={scrypt:function(b,w,x,k,R,D,O){return new Promise(function(M,F){let H=0;O&&O(0),h(b,w,x,k,R,D,function(U,G,N){if(U)F(U);else if(N)O&&H!==1&&O(1),M(new Uint8Array(N));else if(O&&G!==H)return H=G,O(G)})})},syncScrypt:function(b,w,x,k,R,D){return new Uint8Array(h(b,w,x,k,R,D))}};t.exports=g})()}),$6e=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const e5=new re(MD);function OT(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class L6e extends Xh{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function U6e(t,e,r){if(An(t,"crypto/cipher")==="aes-128-ctr"){const i=wf(An(t,"crypto/cipherparams/iv")),s=new Ia.Counter(i),o=new Ia.ModeOfOperation.ctr(e,s);return ve(o.decrypt(r))}return null}function BD(t,e){const r=wf(An(t,"crypto/ciphertext"));if(Ne(Wr(tn([e.slice(16,32),r]))).substring(2)!==An(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=U6e(t,e.slice(0,16),r);i||e5.throwError("unsupported cipher",re.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=Ql(i);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),Jr(c)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:Ne(i)};if(An(t,"x-ethers/version")==="0.1"){const c=wf(An(t,"x-ethers/mnemonicCiphertext")),l=wf(An(t,"x-ethers/mnemonicCounter")),u=new Ia.Counter(l),f=new Ia.ModeOfOperation.ctr(s,u),d=An(t,"x-ethers/path")||Dh,h=An(t,"x-ethers/locale")||"en",g=ve(f.decrypt(c));try{const b=d2(g,h),w=is.fromMnemonic(b,null,h).derivePath(d);if(w.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=w.mnemonic}catch(b){if(b.code!==re.errors.INVALID_ARGUMENT||b.argument!=="wordlist")throw b}}return new L6e(a)}function FD(t,e,r,n,i){return ve(p8(t,e,r,n,i))}function H6e(t,e,r,n,i){return Promise.resolve(FD(t,e,r,n,i))}function $D(t,e,r,n,i){const s=m8(e),o=An(t,"crypto/kdf");
408if(o&&typeof o=="string"){const a=function(c,l){return e5.throwArgumentError("invalid key-derivation function parameters",c,l)};if(o.toLowerCase()==="scrypt"){const c=wf(An(t,"crypto/kdfparams/salt")),l=parseInt(An(t,"crypto/kdfparams/n")),u=parseInt(An(t,"crypto/kdfparams/r")),f=parseInt(An(t,"crypto/kdfparams/p"));(!l||!u||!f)&&a("kdf",o),l&l-1&&a("N",l);const d=parseInt(An(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,c,l,u,f,64,i)}else if(o.toLowerCase()==="pbkdf2"){const c=wf(An(t,"crypto/kdfparams/salt"));let l=null;const u=An(t,"crypto/kdfparams/prf");u==="hmac-sha256"?l="sha256":u==="hmac-sha512"?l="sha512":a("prf",u);const f=parseInt(An(t,"crypto/kdfparams/c")),d=parseInt(An(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,c,f,d,l)}}return e5.throwArgumentError("unsupported key-derivation function","kdf",o)}function j6e(t,e){const r=JSON.parse(t),n=$D(r,e,FD,v8.syncScrypt);return BD(r,n)}function z6e(t,e,r){return $6e(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield $D(n,e,H6e,v8.scrypt,r);return BD(n,i)})}function J6e(t,e,r,n){try{if(Jr(t.address)!==Ql(t.privateKey))throw new Error("address/privateKey mismatch");if(OT(t)){const w=t.mnemonic;if(is.fromMnemonic(w.phrase,null,w.locale).derivePath(w.path||Dh).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(w){return Promise.reject(w)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=ve(t.privateKey),s=m8(e);let o=null,a=null,c=null;if(OT(t)){const w=t.mnemonic;o=ve(f2(w.phrase,w.locale||"en")),a=w.path||Dh,c=w.locale||"en"}let l=r.client;l||(l="ethers.js");let u=null;r.salt?u=ve(r.salt):u=Ld(32);let f=null;if(r.iv){if(f=ve(r.iv),f.length!==16)throw new Error("invalid iv")}else f=Ld(16);let d=null;if(r.uuid){if(d=ve(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=Ld(16);let h=1<<17,g=8,b=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(g=r.scrypt.r),r.scrypt.p&&(b=r.scrypt.p)),v8.scrypt(s,u,h,g,b,64,n).then(w=>{w=ve(w);const x=w.slice(0,16),k=w.slice(16,32),R=w.slice(32,64),D=new Ia.Counter(f),O=new Ia.ModeOfOperation.ctr(x,D),M=ve(O.encrypt(i)),F=Wr(tn([k,M])),H={address:t.address.substring(2).toLowerCase(),id:M6e(d),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ne(f).substring(2)},ciphertext:Ne(M).substring(2),kdf:"scrypt",kdfparams:{salt:Ne(u).substring(2),n:h,dklen:32,p:b,r:g},mac:F.substring(2)}};if(o){const U=Ld(16),G=new Ia.Counter(U),N=new Ia.ModeOfOperation.ctr(R,G),A=ve(N.encrypt
408(o)),v=new Date,p=v.getUTCFullYear()+"-"+x0(v.getUTCMonth()+1,2)+"-"+x0(v.getUTCDate(),2)+"T"+x0(v.getUTCHours(),2)+"-"+x0(v.getUTCMinutes(),2)+"-"+x0(v.getUTCSeconds(),2)+".0Z";H["x-ethers"]={client:l,gethFilename:"UTC--"+p+"--"+H.address,mnemonicCounter:Ne(U).substring(2),mnemonicCiphertext:Ne(A).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(H)})}function q6e(t,e,r){if(b8(t)){r&&r(0);const n=DD(t,e);return r&&r(1),Promise.resolve(n)}return y8(t)?z6e(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function G6e(t,e){if(b8(t))return DD(t,e);if(y8(t))return j6e(t,e);throw new Error("invalid JSON wallet")}const V6e="wallet/5.2.0";var MT=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const ju=new re(V6e);function W6e(t){return t!=null&&_t(t.privateKey,32)&&t.address!=null}function K6e(t){const e=t.mnemonic;return e&&e.phrase}class Rl extends vu{constructor(e,r){if(ju.checkNew(new.target,Rl),super(),W6e(e)){const n=new vf(e.privateKey);if(ae(this,"_signingKey",()=>n),ae(this,"address",Ql(this.publicKey)),this.address!==Jr(e.address)&&ju.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),K6e(e)){const i=e.mnemonic;ae(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||Dh,locale:i.locale||"en"}));const s=this.mnemonic,o=is.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);Ql(o.privateKey)!==this.address&&ju.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ae(this,"_mnemonic",()=>null)}else{if(vf.isSigningKey(e))e.curve!=="secp256k1"&&ju.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ae(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new vf(e);ae(this,"_signingKey",()=>n)}ae(this,"_mnemonic",()=>null),ae(this,"address",Ql(this.publicKey))}r&&!uu.isProvider(r)&&ju.throwArgumentError("invalid provider","provider",r),ae(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Rl(this,e)}signTransaction(e){return En(e).then(r=>{r.from!=null&&(Jr(r.from)!==this.address&&ju.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Wr(Z6(r)));return Z6(r,n)})}signMessage(e){return MT(this,void 0,void 0,function*(){return G6(this._signingKey().signDigest(a8(e)))})}_signTypedData(e,r,n){return MT(this,void 0,void 0,function*(){const i=yield ui.resolveNames(e,r,n,s=>(this.provider==null&&ju.throwError("cannot resolve ENS names without a provider",re.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return G6(this._signingKey().signDigest(ui.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),J6e(this,e,r,n)}static createRandom(e){let r=Ld(16);e||(e={}),e.extraEntropy&&(r=ve(ms(Wr(tn([r,e.extraEntropy])),0,16)));const n=d2(r,e.locale);return Rl.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return q6e(e,r,n).then(i=>new Rl(i))}static fromEncryptedJsonSync(e,r){return new Rl(G6e(e,r))}static fromMnemonic(e,r,n){return r||(r=Dh),new Rl(is.fromMnemonic(e,null,n).derivePath(r))}}function X6e(t,e){return lg(a8(t),e)}function Z6e(t,e,r,n){return lg(ui.hash(t,e,r),n)}const Y6e="networks/5.2.0",DT=new re(Y6e);function Q6e(t){return t&&typeof t.renetwork=="function"}function sh(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider)try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider)try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}
408if(r.AlchemyProvider)try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.CloudflareProvider)try{i.push(new r.CloudflareProvider(t))}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return sh(r)},e}function ty(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return ty(t,n)},r}const BT={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:sh("homestead")},FT={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:sh("ropsten")},$T={chainId:63,name:"classicMordor",_defaultProvider:ty("https://www.ethercluster.com/mordor","classicMordor")},cm={unspecified:{chainId:0,name:"unspecified"},homestead:BT,mainnet:BT,morden:{chainId:2,name:"morden"},ropsten:FT,testnet:FT,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:sh("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:sh("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:sh("goerli")},classic:{chainId:61,name:"classic",_defaultProvider:ty("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:$T,classicTestnet:$T,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ty("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function w8(t){if(t==null)return null;if(typeof t=="number"){for(const n in cm){const i=cm[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=cm[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=cm[t.name];if(!e)return typeof t.chainId!="number"&&DT.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&DT.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(Q6e(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}function e5e(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return ve(e)}function LD(t){t=ve(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}var t5e=Object.freeze({__proto__:null,decode:e5e,encode:LD});const r5e="web/5.2.0";var n5e=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function i5e(t,e){return n5e(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0,mode:"cors",cache:"no-cache",credentials:"same-origin",redirect:"follow",referrer:"client"},n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:ve(new Uint8Array(i))}})}var s5e=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const ca=new re(r5e);function LT(t){return new Promise(e=>{setTimeout(e,t)})}function zu(t,e){if(t==null)return null;if(typeof t=="string")return t;if(ig(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return on(t)}catch{}return Ne(t)}return t}function UD(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;ca.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;ca.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o={};let a=null;const c={method:"GET"};let l=!1,u=2*60*1e3;if(typeof t=="string")a=t;else if(typeof t=="object"){if((t==null||t.url==null)&&ca.throwArgumentError("missing URL","connection.url",t),a=t.url,typeof t.timeout=="number"&&t.timeout>0&&(u=t.timeout),t.headers)for(const g in t.headers)o[g.toLowerCase()]={key:g,value:String(t.headers[g])},["if-none-match","if-modified-since"].indexOf(g.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){a.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&ca.throwError("basic authentication requires a secure https url",re.errors.INVALID_ARGUMENT,{argument:"url",url:a,user:t.user,password:"[REDACTED]"});const g=t.user+":"+t.password;o.authorization={key:"Authorization",value:"Basic "+LD(ln(g))}}}e&&(c.method="POST",c.body=e,o["content-type"]==null&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),o["content-length"]==null&&(o["content-length"]={key:"Content-Length",value:String(e.length)}));const f={};
408Object.keys(o).forEach(g=>{const b=o[g];f[b.key]=b.value}),c.headers=f;const d=function(){let g=null;return{promise:new Promise(function(x,k){u&&(g=setTimeout(()=>{g!=null&&(g=null,k(ca.makeError("timeout",re.errors.TIMEOUT,{requestBody:zu(c.body,f["content-type"]),requestMethod:c.method,timeout:u,url:a})))},u))}),cancel:function(){g!=null&&(clearTimeout(g),g=null)}}}(),h=function(){return s5e(this,void 0,void 0,function*(){for(let g=0;g<n;g++){let b=null;try{if(b=yield i5e(a,c),b.statusCode===429&&g<n){let x=!0;if(i&&(x=yield i(g,a)),x){let k=0;const R=b.headers["retry-after"];typeof R=="string"&&R.match(/^[1-9][0-9]*$/)?k=parseInt(R)*1e3:k=s*parseInt(String(Math.random()*Math.pow(2,g))),yield LT(k);continue}}}catch(x){b=x.response,b==null&&(d.cancel(),ca.throwError("missing response",re.errors.SERVER_ERROR,{requestBody:zu(c.body,f["content-type"]),requestMethod:c.method,serverError:x,url:a}))}let w=b.body;if(l&&b.statusCode===304?w=null:(b.statusCode<200||b.statusCode>=300)&&(d.cancel(),ca.throwError("bad response",re.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:zu(w,b.headers?b.headers["content-type"]:null),requestBody:zu(c.body,f["content-type"]),requestMethod:c.method,url:a})),r)try{const x=yield r(w,b);return d.cancel(),x}catch(x){if(x.throttleRetry&&g<n){let k=!0;if(i&&(k=yield i(g,a)),k){const R=s*parseInt(String(Math.random()*Math.pow(2,g)));yield LT(R);continue}}d.cancel(),ca.throwError("processing response error",re.errors.SERVER_ERROR,{body:zu(w,b.headers?b.headers["content-type"]:null),error:x,requestBody:zu(c.body,f["content-type"]),requestMethod:c.method,url:a})}return d.cancel(),w}return ca.throwError("failed response",re.errors.SERVER_ERROR,{requestBody:zu(c.body,f["content-type"]),requestMethod:c.method,url:a})})}();return Promise.race([d.promise,h])}function h2(t,e,r){let n=(s,o)=>{let a=null;if(s!=null)try{a=JSON.parse(on(s))}catch(c){ca.throwError("invalid JSON",re.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=ln(e);const s=typeof t=="string"?{url:t}:wn(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=wn(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return UD(t,i,n)}function hf(t,e){return e||(e={}),e=wn(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));f<e.floor&&(f=e.floor),f>e.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}var ry="qpzry9x8gf2tvdw0s3jn54khce6mua7l",t5={};for(var lm=0;lm<ry.length;lm++){var Uw=ry.charAt(lm);if(t5[Uw]!==void 0)throw new TypeError(Uw+" is ambiguous");t5[Uw]=lm}function oh(t){var e=t>>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function HD(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=oh(e)^n>>5}for(e=oh(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=oh(e)^i&31}return e}function o5e(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=HD(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s<e.length;++s){var o=e[s];if(o>>5)throw new Error("Non 5-bit word");n=oh(n)^o,i+=ry.charAt(o)}for(s=0;s<6;++s)n=oh(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=ry.charAt(a)}return i}function jD(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=HD(s);
408if(typeof a=="string")return a;for(var c=[],l=0;l<o.length;++l){var u=o.charAt(l),f=t5[u];if(f===void 0)return"Unknown character "+u;a=oh(a)^f,!(l+6>=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function a5e(){var t=jD.apply(null,arguments);if(typeof t=="object")return t}function c5e(t){var e=jD.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function p2(t,e,r,n){for(var i=0,s=0,o=(1<<r)-1,a=[],c=0;c<t.length;++c)for(i=i<<e|t[c],s+=e;s>=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<<r-s&o);else{if(s>=e)return"Excess padding";if(i<<r-s&o)return"Non-zero padding"}return a}function l5e(t){var e=p2(t,8,5,!0);if(Array.isArray(e))return e}function u5e(t){var e=p2(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)}function f5e(t){var e=p2(t,5,8,!1);if(Array.isArray(e))return e}function d5e(t){var e=p2(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}var UT={decodeUnsafe:a5e,decode:c5e,encode:o5e,toWordsUnsafe:l5e,toWords:u5e,fromWordsUnsafe:f5e,fromWords:d5e};const Vi="providers/5.2.0",_d=new re(Vi);class je{constructor(){_d.checkNew(new.target,je),this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),s=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),c=this.number.bind(this),l=u=>this.data(u,!0);return e.transaction={hash:o,type:je.allowNull(c,null),accessList:je.allowNull(this.accessList.bind(this),null),blockHash:je.allowNull(o,null),blockNumber:je.allowNull(c,null),transactionIndex:je.allowNull(c,null),confirmations:je.allowNull(c,null),from:r,gasPrice:n,gasLimit:n,to:je.allowNull(r,null),value:n,nonce:c,data:s,r:je.allowNull(this.uint256),s:je.allowNull(this.uint256),v:je.allowNull(c),creates:je.allowNull(r,null),raw:je.allowNull(s)},e.transactionRequest={from:je.allowNull(r),nonce:je.allowNull(c),gasLimit:je.allowNull(n),gasPrice:je.allowNull(n),to:je.allowNull(r),value:je.allowNull(n),data:je.allowNull(l),type:je.allowNull(c),accessList:je.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:je.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:je.allowNull(this.address,null),from:je.allowNull(this.address,null),contractAddress:je.allowNull(r,null),transactionIndex:c,root:je.allowNull(a),gasUsed:n,logsBloom:je.allowNull(s),blockHash:o,transactionHash:o,logs:je.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:je.allowNull(c,null),cumulativeGasUsed:n,status:je.allowNull(c)},e.block={hash:o,parentHash:o,number:c,timestamp:c,nonce:je.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:r,extraData:s,transactions:je.allowNull(je.arrayOf(o))},e.blockWithTransactions=wn(e.block),e.blockWithTransactions.transactions=je.allowNull(je.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:je.allowNull(i,void 0),toBlock:je.allowNull(i,void 0),blockHash:je.allowNull(o,void 0),address:je.allowNull(r,void 0),topics:je.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:je.allowNull(c),blockHash:je.allowNull(o),transactionIndex:c,removed:je.allowNull(this.boolean.bind(this)),address:r,data:je.allowFalsish(s,"0x"),topics:je.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return nd(e||[])}number(e){return e==="0x"?0:Ie.from(e).toNumber()}bigNumber(e){return Ie.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),_t(e))?e.toLowerCase():_d.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Jr(e)}callAddress(e){if(!_t(e,32))return null;const r=Jr(ms(e,12));return r===RM?null:r}contractAddress(e){return i2(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";if(e==="latest"||e==="pending")return e;if(typeof e=="number"||_t(e))return sg(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return lu(n)!==32?_d.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=Ie.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!_t(e))throw new Error("invalid uint256");return cn(e,32)}_block(e,r){return e.author!=null&&e.miner==null&&(e.miner=e.author),je.check(r,e)}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return je.check(this.formats.transactionRequest,e)}
408transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&Ie.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),e.type===1&&e.accessList==null&&(e.accessList=[]);const r=je.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;_t(n)&&(n=Ie.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),_t(n)&&(n=Ie.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return dD(e)}receiptLog(e){return je.check(this.formats.receiptLog,e)}receipt(e){const r=je.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=Ie.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&_d.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):_d.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&_d.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return je.check(this.formats.filter,e)}filterLog(e){return je.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function zD(t){return t&&typeof t.isCommunityResource=="function"}function r5(t){return zD(t)&&t.isCommunityResource()}let HT=!1;function g2(){HT||(HT=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (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.io/api-keys/"),console.log("=========================="))}var Pt=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const kr=new re(Vi);function jT(t){return t==null?"null":(lu(t)!==32&&kr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function zT(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[jT(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return jT(e)}).join("&")}function h5e(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Cd(t){if(typeof t=="string"){if(t=t.toLowerCase(),lu(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+zT(t);if(Eve.isForkEvent(t))throw kr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+zT(t.topics||[])}throw new Error("invalid event - "+t)}function R0(){return new Date().getTime()}function JT(t){return new Promise(e=>{setTimeout(e,t)})}const p5e=["block","network","pending","poll"];let g5e=class{constructor(e,r,n){ae(this,"tag",e),ae(this,"listener",r),ae(this,"once",n
408)}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=h5e(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||p5e.indexOf(this.tag)>=0}};const m5e={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Hw(t){return cn(Ie.from(t).toHexString(),32)}function qT(t){return ug.encode(tn([t,ms(Yc(Yc(t)),0,4)]))}class JD{constructor(e,r,n){ae(this,"provider",e),ae(this,"name",n),ae(this,"address",e.formatter.address(r))}_fetchBytes(e,r){return Pt(this,void 0,void 0,function*(){const n={to:this.address,data:Yl([e,y1(this.name),r||"0x"])},i=yield this.provider.call(n);if(i==="0x")return null;const s=Ie.from(ms(i,0,32)).toNumber(),o=Ie.from(ms(i,s,s+32)).toNumber();return ms(i,s+32,s+32+o)})}_getAddress(e,r){const n=m5e[String(e)];if(n==null&&kr.throwError(`unsupported coin type: ${e}`,re.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=ve(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return qT(tn([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return qT(tn([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=UT.toWords(i.slice(2));return a.unshift(o),UT.encode(n.prefix,a)}}return null}getAddress(e){return Pt(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60){const i={to:this.address,data:"0x3b3b57de"+y1(this.name).substring(2)},s=yield this.provider.call(i);return s==="0x"||s===r8?null:this.provider.formatter.callAddress(s)}const r=yield this._fetchBytes("0xf1cb7e06",Hw(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&kr.throwError("invalid or unsupported coin data",re.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getContentHash(){return Pt(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const i=parseInt(r[3],16);if(r[4].length===i*2)return"ipfs://"+ug.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);return n&&n[1].length===32*2?"bzz://"+n[1]:kr.throwError("invalid or unsupported content hash data",re.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Pt(this,void 0,void 0,function*(){let r=ln(e);r=tn([Hw(64),Hw(r.length),r]),r.length%32!==0&&(r=tn([r,cn("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Ne(r));return n==null||n==="0x"?null:on(n)})}}let jw=null,b5e=1;class m2 extends uu{constructor(e){if(kr.checkNew(new.target,uu),super(),this._events=[],this._emitted={block:-2},this.formatter=new.target.getFormatter(),ae(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Yn(new.target,"getNetwork")(e);r?(ae(this,"_network",r),this.emit("network",r,null)):kr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Pt(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||kr.throwError("no network detected",re.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ae(this,"_network",e),this.emit
408("network",e,null))}return this._network})}get ready(){return hf(()=>this._ready().then(e=>e,e=>{if(!(e.code===re.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return jw==null&&(jw=new je),jw}static getNetwork(e){return w8(e??"homestead")}_getInternalBlockNumber(e){return Pt(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(R0()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=R0(),n=En({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=R0();return i=Ie.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:r,respTime:o}});return this._internalBlockNumber=n,n.catch(i=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Pt(this,void 0,void 0,function*(){const e=b5e++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)kr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",kr.makeError("network block skew detected",re.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{const s=i.filter;s.fromBlock=this._lastBlockNumber+1,s.toBlock=n;const o=this.getLogs(s).then(a=>{a.length!==0&&a.forEach(c=>{this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit(s,c)})}).catch(a=>{this.emit("error",a)});r.push(o);break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Pt(this,void 0,void 0,function*(){return kr.throwError("provider does not support network detection",re.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Pt(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield JT(0),this._network;const n=kr.makeError("underlying network changed",re.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=R0();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&e<this._fastBlockNumber||(this._fastQueryDate=R0(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Pt(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Pt(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;
408const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations<r||u()||o(d)};if(this.on(e,f),c.push(()=>{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const g=b=>Pt(this,void 0,void 0,function*(){l||(yield JT(1e3),this.getTransactionCount(i.from).then(w=>Pt(this,void 0,void 0,function*(){if(!l){if(w<=i.nonce)d=b;else{{const x=yield this.getTransaction(e);if(x&&x.blockNumber!=null)return}for(h==null&&(h=d-3,h<i.startBlock&&(h=i.startBlock));h<=b;){if(l)return;const x=yield this.getBlockWithTransactions(h);for(let k=0;k<x.transactions.length;k++){const R=x.transactions[k];if(R.hash===e)return;if(R.from===i.from&&R.nonce===i.nonce){if(l)return;const D=yield this.waitForTransaction(R.hash,r);if(u())return;let O="replaced";R.data===i.data&&R.to===i.to&&R.value.eq(i.value)?O="repriced":R.data==="0x"&&R.from===R.to&&R.value.isZero()&&(O="cancelled"),a(kr.makeError("transaction was replaced",re.errors.TRANSACTION_REPLACED,{cancelled:O==="replaced"||O==="cancelled",reason:O,replacement:this._wrapTransaction(R),hash:e,receipt:D}));return}}h++}}l||this.once("block",g)}}),w=>{l||this.once("block",g)}))});if(l)return;this.once("block",g),c.push(()=>{this.removeListener("block",g)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(kr.makeError("timeout exceeded",re.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return Pt(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Ie.from(e)}catch(r){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield En({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return Ie.from(i)}catch(s){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield En({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return Ie.from(i).toNumber()}catch(s){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield En({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Ne(i)}catch(s){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield En({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>sg(o))}),s=yield this.perform("getStorageAt",i);try{return Ne(s)}catch(o){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&lu(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&kr.throwError("Transaction hash mismatch from Provider.sendTransaction.",re.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Pt(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&kr.throwError("transaction failed",re.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>Ne(s)),n=this.formatter.transaction(e),i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Pt(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>
408{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Ie.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Ne(s):null))}),this.formatter.transactionRequest(yield En(n))})}_getFilter(e){return Pt(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield En(r))})}call(e,r){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield En({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("call",n);try{return Ne(i)}catch(s){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"call",params:n,result:i,error:s})}})}estimateGas(e){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield En({transaction:this._getTransactionRequest(e)}),n=yield this.perform("estimateGas",r);try{return Ie.from(n)}catch(i){return kr.throwError("bad result from backend",re.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:i})}})}_getAddress(e){return Pt(this,void 0,void 0,function*(){const r=yield this.resolveName(e);return r==null&&kr.throwError("ENS name not configured",re.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return Pt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let n=-128;const i={includeTransactions:!!r};if(_t(e,32))i.blockHash=e;else try{i.blockTag=this.formatter.blockTag(yield this._getBlockTag(e)),_t(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16))}catch{kr.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return hf(()=>Pt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let a=0;a<s.transactions.length;a++){const c=s.transactions[a];if(c.blockNumber==null)c.confirmations=0;else if(c.confirmations==null){o==null&&(o=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let l=o-c.blockNumber+1;l<=0&&(l=1),c.confirmations=l}}return this.formatter.blockWithTransactions(s)}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Pt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return hf(()=>Pt(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Pt(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return hf(()=>Pt(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Pt(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield En({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);
408return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),je.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Pt(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Pt(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&kr.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Pt(this,void 0,void 0,function*(){const r=yield this._getResolver(e);return r==null?null:new JD(this,r,e)})}_getResolver(e){return Pt(this,void 0,void 0,function*(){const r=yield this.getNetwork();r.ensAddress||kr.throwError("network does not support ENS",re.errors.UNSUPPORTED_OPERATION,{operation:"ENS",network:r.name});const n={to:r.ensAddress,data:"0x0178b8bf"+y1(e).substring(2)};return this.formatter.callAddress(yield this.call(n))})}resolveName(e){return Pt(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(_t(e))throw n}typeof e!="string"&&kr.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Pt(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r);if(!n)return null;let i=ve(yield this.call({to:n,data:"0x691f3431"+y1(r).substring(2)}));if(i.length<32||!Ie.from(i.slice(0,32)).eq(32)||(i=i.slice(32),i.length<32))return null;const s=Ie.from(i.slice(0,32)).toNumber();if(i=i.slice(32),s>i.length)return null;const o=on(i.slice(0,s));return(yield this.resolveName(o))!=e?null:o})}perform(e,r){return kr.throwError(e+" not implemented",re.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new g5e(Cd(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Cd(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)}
408,0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Cd(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Cd(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Cd(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Cd(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var up=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const $i=new re(Vi),y5e=["call","estimateGas"];function qD(t,e,r){if(t==="call"&&e.code===re.errors.SERVER_ERROR){const s=e.error;if(s&&s.message.match("reverted")&&_t(s.data))return s.data}let n=e.message;e.code===re.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText),n=(n||"").toLowerCase();const i=r.transaction||r.signedTransaction;throw n.match(/insufficient funds/)&&$i.throwError("insufficient funds for intrinsic transaction cost",re.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:i}),n.match(/nonce too low/)&&$i.throwError("nonce has already been used",re.errors.NONCE_EXPIRED,{error:e,method:t,transaction:i}),n.match(/replacement transaction underpriced/)&&$i.throwError("replacement fee too low",re.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:i}),n.match(/only replay-protected/)&&$i.throwError("legacy pre-eip-155 transactions not supported",re.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:i}),y5e.indexOf(t)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&$i.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",re.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:i}),e}function GT(t){return new Promise(function(e){setTimeout(e,t)})}function v5e(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function P0(t){return t&&t.toLowerCase()}const n5={};class fg extends vu{constructor(e,r,n){if($i.checkNew(new.target,fg),super(),e!==n5)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ae(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ae(this,"_address",this.provider.formatter.address(n)),ae(this,"_index",null)):typeof n=="number"?(ae(this,"_index",n),ae(this,"_address",null)):$i.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return $i.throwError("cannot alter JSON-RPC Signer connection",re.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new w5e(n5,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&$i.throwError("unknown account #"+this._index,re.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=wn(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=wn(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return En({tx:En(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&$i.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>qD("sendTransaction",o,s))})}signTransaction(e){return $i.throwError("signing transactions is unsupported",re.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>hf(()=>this.provider.getTransaction(r).then(n=>{if(n!==null)return this.provider._wrapTransaction(n,r)}),{oncePoll:this.provider}).catch(n=>{throw n.transactionHash=r,n}
408))}signMessage(e){return up(this,void 0,void 0,function*(){const r=typeof e=="string"?ln(e):e,n=yield this.getAddress();return yield this.provider.send("eth_sign",[n.toLowerCase(),Ne(r)])})}_signTypedData(e,r,n){return up(this,void 0,void 0,function*(){const i=yield ui.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(ui.getPayload(i.domain,r,i.value))])})}unlock(e){return up(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class w5e extends fg{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const E5e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0};class Qc extends m2{constructor(e,r){$i.checkNew(new.target,Qc);let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Yn(this.constructor,"defaultUrl")()),typeof e=="string"?ae(this,"connection",Object.freeze({url:e})):ae(this,"connection",Object.freeze(wn(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return up(this,void 0,void 0,function*(){yield GT(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Yn(this.constructor,"getNetwork");try{return r(Ie.from(e).toNumber())}catch(n){return $i.throwError("could not detect network",re.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return $i.throwError("could not detect network",re.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new fg(n5,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ji(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=h2(this.connection,JSON.stringify(n),v5e).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[P0(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[P0(r.address),r.blockTag]];case"getCode":return["eth_getCode",[P0(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[P0(r.address),r.position,r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Yn(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Yn(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=P0(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return up(this,void 0,void 0,function*(){const n=this.prepareRequest(e,r);n==null&&$i.throwError(e+" not implemented",re.errors.NOT_IMPLEMENT
408ED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return qD(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return GT(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=wn(E5e);if(r)for(const s in r)r[s]&&(n[s]=!0);ZE(e,n);const i={};return["gasLimit","gasPrice","type","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=sg(e[s]);s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=Ne(e[s]))}),e.accessList&&(i.accessList=nd(e.accessList)),i}}let fp=null;try{if(fp=WebSocket,fp==null)throw new Error("inject please")}catch{const e=new re(Vi);fp=function(){e.throwError("WebSockets not supported in this environment",re.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var zw=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const um=new re(Vi);let A5e=1;class b2 extends Qc{constructor(e,r){r==="any"&&um.throwError("WebSocketProvider does not support 'any' network yet",re.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super(e,r),this._pollingInterval=-1,this._wsReady=!1,ae(this,"_websocket",new fp(this.connection.url)),ae(this,"_requests",{}),ae(this,"_subs",{}),ae(this,"_subIds",{}),ae(this,"_detectNetwork",super.detectNetwork()),this._websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(i=>{this._websocket.send(this._requests[i].payload)})},this._websocket.onmessage=i=>{const s=i.data,o=JSON.parse(s);if(o.id!=null){const a=String(o.id),c=this._requests[a];if(delete this._requests[a],o.result!==void 0)c.callback(null,o.result),this.emit("debug",{action:"response",request:JSON.parse(c.payload),response:o.result,provider:this});else{let l=null;o.error?(l=new Error(o.error.message||"unknown error"),ae(l,"code",o.error.code||null),ae(l,"response",s)):l=new Error("unknown error"),c.callback(l,void 0),this.emit("debug",{action:"response",error:l,request:JSON.parse(c.payload),provider:this})}}else if(o.method==="eth_subscription"){const a=this._subs[o.params.subscription];a&&a.processFunc(o.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){um.throwError("cannot reset events block on WebSocketProvider",re.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){um.throwError("cannot set polling interval on WebSocketProvider",re.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return zw(this,void 0,void 0,function*(){return null})}set polling(e){e&&um.throwError("cannot set polling on WebSocketProvider",re.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,r){const n=A5e++;return new Promise((i,s)=>{function o(c,l){return c?s(c):i(l)}const a=JSON.stringify({method:e,params:r,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(n)]={callback:o,payload:a},this._wsReady&&this._websocket.send(a)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,r,n){return zw(this,void 0,void 0,function*(){let i=this._subIds[e];
408i==null&&(i=Promise.all(r).then(o=>this.send("eth_subscribe",o)),this._subIds[e]=i);const s=yield i;this._subs[s]={tag:e,processFunc:n}})}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],r=>{const n=Ie.from(r.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(e.filter,this.formatter.filterLog(r))});break;case"tx":{const r=n=>{const i=n.hash;this.getTransactionReceipt(i).then(s=>{s&&this.emit(i,s)})};r(e),this._subscribe("tx",["newHeads"],n=>{this._events.filter(i=>i.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e);break}}_stopEvent(e){let r=e.tag;if(e.type==="tx"){if(this._events.filter(i=>i.type==="tx").length)return;r="tx"}else if(this.listenerCount(e.event))return;const n=this._subIds[r];n&&(delete this._subIds[r],n.then(i=>{this._subs[i]&&(delete this._subs[i],this.send("eth_unsubscribe",[i]))}))}destroy(){return zw(this,void 0,void 0,function*(){this._websocket.readyState===fp.CONNECTING&&(yield new Promise(e=>{this._websocket.onopen=function(){e(!0)},this._websocket.onerror=function(){e(!1)}})),this._websocket.close(1e3)})}}var _5e=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const z0=new re(Vi);class GD extends Qc{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return _5e(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||z0.throwError("no network detected",re.errors.UNKNOWN_ERROR,{}),this._network==null&&(ae(this,"_network",r),this.emit("network",r,null))),r})}}class Eu extends GD{constructor(e,r){z0.checkAbstract(new.target,Eu),e=Yn(new.target,"getNetwork")(e),r=Yn(new.target,"getApiKey")(r);const n=Yn(new.target,"getUrl")(e,r);super(n,e),typeof r=="string"?ae(this,"apiKey",r):r!=null&&Object.keys(r).forEach(i=>{ae(this,i,r[i])})}_startPending(){z0.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return z0.throwError("API provider does not support signing",re.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,r){return z0.throwError("not implemented; sub-classes must override getUrl",re.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const VT=new re(Vi),zm="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class VD extends b2{constructor(e,r){const n=new E8(e,r),i=n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(i,n.network),ae(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===zm}}class E8 extends Eu{static getWebSocketProvider(e,r){return new VD(e,r)}static getApiKey(e){return e==null?zm:(e&&typeof e!="string"&&VT.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":n="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":n="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.alchemyapi.io/v2/";break;case"kovan":n="eth-kovan.alchemyapi.io/v2/";break;default:VT.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+r,throttleCallback:(i,s)=>(r===zm&&g2(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===zm}}var C5e=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const WT=new re(Vi);
408class WD extends Eu{static getApiKey(e){return e!=null&&WT.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,r){let n=null;switch(e.name){case"homestead":n="https://cloudflare-eth.com/";break;default:WT.throwArgumentError("unsupported network","network",arguments[0])}return n}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return C5e(this,void 0,void 0,function*(){return e==="getBlockNumber"?(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number:n.perform.call(this,e,r)})}}var fm=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const zl=new re(Vi);function KT(t){const e={};for(let r in t){if(t[r]==null)continue;let n=t[r];({type:!0,gasLimit:!0,gasPrice:!0,nonce:!0,value:!0})[r]?n=sg(Ne(n)):r==="accessList"?n="["+nd(n).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]":n=Ne(n),e[r]=n}return e}function S5e(t){if(t.status==0&&(t.message==="No records found"||t.message==="No transactions found"))return t.result;if(t.status!=1||t.message!="OK"){const e=new Error("invalid response");throw e.result=JSON.stringify(t),(t.result||"").toLowerCase().indexOf("rate limit")>=0&&(e.throttleRetry=!0),e}return t.result}function XT(t){if(t&&t.status==0&&t.message=="NOTOK"&&(t.result||"").toLowerCase().indexOf("rate limit")>=0){const e=new Error("throttled response");throw e.result=JSON.stringify(t),e.throttleRetry=!0,e}if(t.jsonrpc!="2.0"){const e=new Error("invalid response");throw e.result=JSON.stringify(t),e}if(t.error){const e=new Error(t.error.message||"unknown error");throw t.error.code&&(e.code=t.error.code),t.error.data&&(e.data=t.error.data),e}return t.result}function ZT(t){if(t==="pending")throw new Error("pending not supported");return t==="latest"?t:parseInt(t.substring(2),16)}const YT="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function Jw(t,e,r){if(t==="call"&&e.code===re.errors.SERVER_ERROR){const i=e.error;if(i&&i.message.match("reverted")&&_t(i.data))return i.data}let n=e.message;throw e.code===re.errors.SERVER_ERROR&&(e.error&&typeof e.error.message=="string"?n=e.error.message:typeof e.body=="string"?n=e.body:typeof e.responseText=="string"&&(n=e.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&zl.throwError("insufficient funds for intrinsic transaction cost",re.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low/)&&zl.throwError("nonce has already been used",re.errors.NONCE_EXPIRED,{error:e,method:t,transaction:r}),n.match(/another transaction with same nonce/)&&zl.throwError("replacement fee too low",re.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:r}),n.match(/execution failed due to an exception/)&&zl.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",re.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:r}),e}class y2 extends m2{constructor(e,r){zl.checkNew(new.target,y2),super(e),ae(this,"baseUrl",this.getBaseUrl()),ae(this,"apiKey",r||YT)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return zl.throwArgumentError("unsupported network","network",name)}getUrl(e,r){const n=Object.keys(r).reduce((s,o)=>{const a=r[o];return a!=null&&(s+=`&${o}=${a}`),s},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${n}${i}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,r){return r.module=e,r.apikey=this.apiKey,r}fetch(e,r,n){return fm(this,void 0,void 0,function*(){const i=n?this.getPostUrl():this.getUrl(e,r),s=n?this.getPostData(e,r):null,o=e==="proxy"?XT:S5e;
408this.emit("debug",{action:"request",request:i,provider:this});const a={url:i,throttleSlotInterval:1e3,throttleCallback:(u,f)=>(this.isCommunityResource()&&g2(),Promise.resolve(!0))};let c=null;s&&(a.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(s).map(u=>`${u}=${s[u]}`).join("&"));const l=yield h2(a,c,o||XT);return this.emit("debug",{action:"response",request:i,response:Ji(l),provider:this}),l})}detectNetwork(){return fm(this,void 0,void 0,function*(){return this.network})}perform(e,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return fm(this,void 0,void 0,function*(){switch(e){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:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(i=>Jw("sendTransaction",i,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const i=KT(r.transaction);i.module="proxy",i.action="eth_call";try{return yield this.fetch("proxy",i,!0)}catch(s){return Jw("call",s,r.transaction)}}case"estimateGas":{const i=KT(r.transaction);i.module="proxy",i.action="eth_estimateGas";try{return yield this.fetch("proxy",i,!0)}catch(s){return Jw("estimateGas",s,r.transaction)}}case"getLogs":{const i={action:"getLogs"};if(r.filter.fromBlock&&(i.fromBlock=ZT(r.filter.fromBlock)),r.filter.toBlock&&(i.toBlock=ZT(r.filter.toBlock)),r.filter.address&&(i.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&zl.throwError("unsupported topic count",re.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){const a=r.filter.topics[0];(typeof a!="string"||a.length!==66)&&zl.throwError("unsupported topic format",re.errors.UNSUPPORTED_OPERATION,{topic0:a}),i.topic0=a}const s=yield this.fetch("logs",i);let o={};for(let a=0;a<s.length;a++){const c=s[a];if(c.blockHash==null){if(o[c.blockNumber]==null){const l=yield this.getBlock(c.blockNumber);l&&(o[c.blockNumber]=l.hash)}c.blockHash=o[c.blockNumber]}}return s}case"getEtherPrice":return this.network.name!=="homestead"?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return n.perform.call(this,e,r)})}getHistory(e,r,n){return fm(this,void 0,void 0,function*(){const i={action:"txlist",address:yield this.resolveName(e),startblock:r??0,endblock:n??99999999,sort:"asc"};return(yield this.fetch("account",i)).map(o=>{["contractAddress","to"].forEach(function(c){o[c]==""&&delete o[c]}),o.creates==null&&o.contractAddress!=null&&(o.creates=o.contractAddress);const a=this.formatter.transactionResponse(o);return o.timeStamp&&(a.timestamp=parseInt(o.timeStamp)),a})})}isCommunityResource(){return this.apiKey===YT}}var ny=window&&window.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Pl=new re(Vi);function dm(){return new Date().getTime()}function QT(t){let e=null;for(let r=0;r<t.length;r++){const n=t[r];
408if(n==null)return null;e?e.name===n.name&&e.chainId===n.chainId&&(e.ensAddress===n.ensAddress||e.ensAddress==null&&n.ensAddress==null)||Pl.throwArgumentError("provider mismatch","networks",t):e=n}return e}function e7(t,e){t=t.slice().sort();const r=Math.floor(t.length/2);if(t.length%2)return t[r];const n=t[r-1],i=t[r];return e!=null&&Math.abs(n-i)>e?null:(n+i)/2}function Ud(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(Ie.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>Ud(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=Ud(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let T5e=1;function t7(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const N5e=[re.errors.CALL_EXCEPTION,re.errors.INSUFFICIENT_FUNDS,re.errors.NONCE_EXPIRED,re.errors.REPLACEMENT_UNDERPRICED,re.errors.UNPREDICTABLE_GAS_LIMIT],I5e=["address","args","errorArgs","errorSignature","method","transaction"];function hm(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function x5e(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s<i.length;s++){const o=n[i[s]];if(o.count>=e)return o.result}}}function R5e(t,e,r){let n=Ud;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=e7(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return e7(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=wn(i),i.confirmations=-1,Ud(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=wn(i),i.transactions=i.transactions.map(s=>(s=wn(s),s.confirmations=-1,s)),Ud(i))}:n=function(i){return i==null?null:Ud(i)};break;default:throw new Error("unknown method: "+e)}return x5e(n,t.quorum)}function k0(t,e){return ny(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:hf(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function P5e(t,e,r,n){return ny(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&_t(n.blockTag)&&(i=yield k0(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&_t(n.blockTag)&&(i=yield k0(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&_t(n.blockTag)&&(i=yield k0(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&_t(n.blockTag)&&(i=yield k0(t,e)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&_t(s.fromBlock)||s.toBlock&&_t(s.toBlock))&&(i=yield k0(t,e)),i.getLogs(s)}}return Pl.throwError("unknown method error",re.errors.UNKNOWN_ERROR,{method:r,params:n})})}class v2 extends m2{constructor(e,r){Pl.checkNew(new.target,v2),e.length===0&&Pl.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>
408{if(uu.isProvider(o)){const u=r5(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=wn(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=r5(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&Pl.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&Pl.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=QT(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),ae(this,"providerConfigs",Object.freeze(n)),ae(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return ny(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return QT(e)})}perform(e,r){return ny(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;l<c.length;l++){const u=c[l];if(typeof u=="string")return u}throw c[0]}this._highestBlockNumber===-1&&e!=="getBlockNumber"&&(yield this.getBlockNumber());const n=R5e(this,e,r),i=OD(this.providerConfigs.map(wn));i.sort((c,l)=>c.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=dm();let l=i.filter(h=>h.runner&&c-h.start<h.stallTimeout).reduce((h,g)=>h+g.weight,0);for(;l<this.quorum&&o<i.length;){const h=i[o++],g=T5e++;h.start=dm(),h.staller=t7(h.stallTimeout),h.staller.wait(()=>{h.staller=null}),h.runner=P5e(h,s,e,r).then(b=>{h.done=!0,h.result=b,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:g,backend:hm(h,dm()),request:{method:e,params:Ji(r)},provider:this})},b=>{h.done=!0,h.error=b,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:g,backend:hm(h,dm()),request:{method:e,params:Ji(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:g,backend:hm(h,null),request:{method:e,params:Ji(r)},provider:this}),l+=h.weight}const u=[];i.forEach(h=>{h.done||!h.runner||(u.push(h.runner),h.staller&&u.push(h.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(g=>{g.staller&&g.staller.cancel(),g.cancelled=!0}),h;a||(yield t7(100).getPromise()),a=!1}const d=i.reduce((h,g)=>{if(!g.done||g.error==null)return h;const b=g.error.code;return N5e.indexOf(b)>=0&&(h[b]||(h[b]={error:g.error,weight:0}),h[b].weight+=g.weight),h},{});if(Object.keys(d).forEach(h=>{const g=d[h];if(g.weight<this.quorum)return;i.forEach(x=>{x.staller&&x.staller.cancel(),x.cancelled=!0});const b=g.error,w={};I5e.forEach(x=>{b[x]!=null&&(w[x]=b[x])}),Pl.throwError(b.reason||b.message,h,w)}),i.filter(h=>!h.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),Pl.throwError("failed to meet quorum",re.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>hm(c)),provider:this})})}}const KD=null,Jm=new re(Vi),J0="84842078b09946638c03157f83405213";class XD extends b2{constructor(e,r){const n=new A8(e,r),i=n.connection;i.password&&Jm.throwError("INFURA WebSocket project secrets unsupported",re.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const s=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(s,e),ae(this,"apiKey",n.projectId),ae(this,"projectId",n.projectId),ae(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===J0}}class A8 extends Eu{static getWebSocketProvider(e,r){return new XD(e,r)}static getApiKey(e){const r={apiKey:J0,projectId:J0,projectSecret:null};return e==null||(typeof e=="string"?r.projectId=e:e.projectSecret!=null?(Jm.assertArgument(typeof e.projectId=="string","projectSecret requires a projectId","projectId",e.projectId),Jm.assertArgument(typeof e.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=e.projectId,r.projectSecret=e.projectSecret):e.projectId&&(r.projectId=e.projectId),r.apiKey=r.projectId),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"ropsten":n="ropsten.infura.io";break;case"rinkeby":n="rinkeby.infura.io";break;case"kovan":n="kovan.infura.io";break;case"goerli":n="goerli.infura.io";break;default:Jm.throwError("unsupported network",re.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const i={allowGzip:!0,url:"https://"+n+"/v3/"+r.projectId,throttleCallback:(s,o)=>(r.projectId===J0&&g2(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}isCommunityResource(){return this.projectId===J0}}class k5e extends Qc{send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};
408this._pendingBatch==null&&(this._pendingBatch=[]);const i={request:n,resolve:null,reject:null},s=new Promise((o,a)=>{i.resolve=o,i.reject=a});return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{const o=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const a=o.map(c=>c.request);return this.emit("debug",{action:"requestBatch",request:Ji(a),provider:this}),h2(this.connection,JSON.stringify(a)).then(c=>{this.emit("debug",{action:"response",request:a,response:c,provider:this}),o.forEach((l,u)=>{const f=c[u];if(f.error){const d=new Error(f.error.message);d.code=f.error.code,d.data=f.error.data,l.reject(d)}else l.resolve(f.result)})},c=>{this.emit("debug",{action:"response",error:c,request:a,provider:this}),o.forEach(l=>{l.reject(c)})})},10)),s}}const qw=new re(Vi),O5e="ETHERS_JS_SHARED";class ZD extends Eu{static getApiKey(e){return e&&typeof e!="string"&&qw.throwArgumentError("invalid apiKey","apiKey",e),e||O5e}static getUrl(e,r){qw.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(e.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:qw.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+r}}const Ju=new re(Vi),r7={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};
408class YD extends Eu{constructor(e,r){if(r==null){const n=Yn(new.target,"getNetwork")(e);if(n){const i=r7[n.name];i&&(r={applicationId:i,loadBalancer:!0})}r==null&&Ju.throwError("unsupported network",re.errors.INVALID_ARGUMENT,{argument:"network",value:e})}super(e,r)}static getApiKey(e){e==null&&Ju.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",e);const r={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return typeof e=="string"?r.applicationId=e:e.applicationSecretKey!=null?(Ju.assertArgument(typeof e.applicationId=="string","applicationSecretKey requires an applicationId","applicationId",e.applicationId),Ju.assertArgument(typeof e.applicationSecretKey=="string","invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),r.applicationId=e.applicationId,r.applicationSecretKey=e.applicationSecretKey,r.loadBalancer=!!e.loadBalancer):e.applicationId?(Ju.assertArgument(typeof e.applicationId=="string","apiKey.applicationId must be a string","apiKey.applicationId",e.applicationId),r.applicationId=e.applicationId,r.loadBalancer=!!e.loadBalancer):Ju.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),r}static getUrl(e,r){let n=null;switch(e?e.name:"unknown"){case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"goerli":n="eth-goerli.gateway.pokt.network";break;default:Ju.throwError("unsupported network",re.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let i=null;r.loadBalancer?i=`https://${n}/v1/lb/${r.applicationId}`:i=`https://${n}/v1/${r.applicationId}`;const s={url:i};return s.headers={},r.applicationSecretKey!=null&&(s.user="",s.password=r.applicationSecretKey),s}isCommunityResource(){return this.applicationId===r7[this.network.name]}}const Gw=new re(Vi);let M5e=1;function n7(t,e){const r="Web3LegacyFetcher";return function(n,i){n=="eth_sign"&&(t.isMetaMask||t.isStatus)&&(n="personal_sign",i=[i[1],i[0]]);const s={method:n,params:i,id:M5e++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:Ji(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function D5e(t){return function(e,r){r==null&&(r=[]),e=="eth_sign"&&(t.isMetaMask||t.isStatus)&&(e="personal_sign",r=[r[1],r[0]]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Ji(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class w2 extends Qc{constructor(e,r){Gw.checkNew(new.target,w2),e==null&&Gw.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=D5e(e)):e.sendAsync?i=n7(e,e.sendAsync.bind(e)):e.send?i=n7(e,e.send.bind(e)):Gw.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),ae(this,"jsonRpcFetchFunc",i),ae(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const i7=new re(Vi);function QD(t,e){if(t==null&&(t="homestead"),typeof t=="string"){const n=t.match(/^(ws|http)s?:/i);if(n)switch(n[1]){case"http":return new Qc(t);case"ws":return new b2(t);default:i7.throwArgumentError("unsupported URL scheme","network",t)}}const r=w8(t);return(!r||!r._defaultProvider)&&i7.throwError("unsupported getDefaultProvider network",re.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:t}),r._defaultProvider({FallbackProvider:v2,AlchemyProvider:E8,CloudflareProvider:WD,EtherscanProvider:y2,InfuraProvider:A8,JsonRpcProvider:Qc,NodesmithProvider:ZD,PocketProvider:YD,Web3Provider:w2,IpcProvider:KD},e)}var B5e=Object.freeze({__proto__:null,Provider:uu,BaseProvider:m2,Resolver:JD,UrlJsonRpcProvider:Eu,FallbackProvider:v2,AlchemyProvi
408der:E8,AlchemyWebSocketProvider:VD,CloudflareProvider:WD,EtherscanProvider:y2,InfuraProvider:A8,InfuraWebSocketProvider:XD,JsonRpcProvider:Qc,JsonRpcBatchProvider:k5e,NodesmithProvider:ZD,PocketProvider:YD,StaticJsonRpcProvider:GD,Web3Provider:w2,WebSocketProvider:b2,IpcProvider:KD,JsonRpcSigner:fg,getDefaultProvider:QD,getNetwork:w8,isCommunityResource:r5,isCommunityResourcable:zD,showThrottleMessage:g2,Formatter:je});const F5e=new RegExp("^bytes([0-9]+)$"),$5e=new RegExp("^(u?int)([0-9]*)$"),L5e=new RegExp("^(.*)\\[([0-9]*)\\]$"),U5e="0000000000000000000000000000000000000000000000000000000000000000";function eB(t,e,r){switch(t){case"address":return r?np(e,32):ve(e);case"string":return ln(e);case"bytes":return ve(e);case"bool":return e=e?"0x01":"0x00",r?np(e,32):ve(e)}let n=t.match($5e);if(n){let i=parseInt(n[2]||"256");if(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)throw new Error("invalid number type - "+t);return r&&(i=256),e=Ie.from(e).toTwos(i),np(e,i/8)}if(n=t.match(F5e),n){const i=parseInt(n[1]);if(String(i)!==n[1]||i===0||i>32)throw new Error("invalid bytes type - "+t);if(ve(e).byteLength!==i)throw new Error("invalid value for "+t);return r?ve((e+U5e).substring(0,66)):e}if(n=t.match(L5e),n&&Array.isArray(e)){const i=n[1];if(parseInt(n[2]||String(e.length))!=e.length)throw new Error("invalid value for "+t);const o=[];return e.forEach(function(a){o.push(eB(i,a,!0))}),tn(o)}throw new Error("invalid type - "+t)}function _8(t,e){if(t.length!=e.length)throw new Error("type/value count mismatch");const r=[];return t.forEach(function(n,i){r.push(eB(n,e[i]))}),Ne(tn(r))}function H5e(t,e){return Wr(_8(t,e))}function j5e(t,e){return Yc(_8(t,e))}const z5e="units/5.2.0",tB=new re(z5e),rB=["wei","kwei","mwei","gwei","szabo","finney","ether"];function J5e(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&tB.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function nB(t,e){if(typeof e=="string"){const r=rB.indexOf(e);r!==-1&&(e=3*r)}return $m(t,e??18)}function iB(t,e){if(typeof t!="string"&&tB.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=rB.indexOf(e);r!==-1&&(e=3*r)}return aa(t,e??18)}function q5e(t){return nB(t,18)}function G5e(t){return iB(t,18)}var V5e=Object.freeze({__proto__:null,AbiCoder:s2,defaultAbiCoder:$M,Fragment:Na,ErrorFragment:Rc,EventFragment:Ea,FunctionFragment:Fo,ParamType:Jn,FormatTypes:yr,checkResultErrors:_M,Logger:re,RLP:E2e,_fetchData:UD,fetchJson:h2,poll:hf,checkProperties:ZE,deepCopy:Ji,defineReadOnly:ae,getStatic:Yn,resolveProperties:En,shallowCopy:wn,arrayify:ve,concat:tn,stripZeros:Zl,zeroPad:np,isBytes:yu,isBytesLike:ig,defaultPath:Dh,HDNode:is,SigningKey:vf,Interface:v1,LogDescription:JM,TransactionDescription:qM,base58:ug,base64:t5e,hexlify:Ne,isHexString:_t,hexConcat:Yl,hexStripZeros:pM,hexValue:sg,hexZeroPad:cn,hexDataLength:lu,hexDataSlice:ms,nameprep:o8,_toEscapedUtf8String:z2e,toUtf8Bytes:ln,toUtf8CodePoints:K6,toUtf8String:on,Utf8ErrorFuncs:BM,formatBytes32String:J2e,parseBytes32String:q2e,hashMessage:a8,namehash:y1,isValidName:lve,id:jl,_TypedDataEncoder:ui,getAddress:Jr,getIcapAddress:T2e,getContractAddress:i2,getCreate2Address:N2e,isAddress:S2e,formatEther:q5e,parseEther:G5e,formatUnits:nB,parseUnits:iB,commify:J5e,computeHmac:A1,keccak256:Wr,ripemd160:bD,sha256:Yc,sha512:t6e,randomBytes:Ld,shuffled:OD,solidityPack:_8,solidityKeccak256:H5e,soliditySha256:j5e,splitSignature:Kh,joinSignature:G6,accessListify:nd,parseTransaction:dD,serializeTransaction:Z6,getJsonWalletAddress:F6e,computeAddress:Ql,recoverAddress:lg,computePublicKey:h8,recoverPublicKey:lD,verifyMessage:X6e,verifyTypedData:Z6e,getAccountPath:k6e,mnemonicToEntropy:f2,entro
408pyToMnemonic:d2,isValidMnemonic:P6e,mnemonicToSeed:kD,get SupportedAlgorithm(){return Mh},get UnicodeNormalizationForm(){return Wa},get Utf8ErrorReason(){return cs},Indexed:Kb});const sB="ethers/5.2.0",W5e=new re(sB);var K5e=Object.freeze({__proto__:null,Signer:vu,Wallet:Rl,VoidSigner:w1,getDefaultProvider:QD,providers:B5e,BaseContract:gD,Contract:Qb,ContractFactory:Y3e,BigNumber:Ie,FixedNumber:Un,constants:$2e,get errors(){return Gb},logger:W5e,utils:V5e,wordlists:Y6,version:sB,Wordlist:Br});try{const t=window;t._ethers==null&&(t._ethers=K5e)}catch{}function s7(t,e,r){const n=t.slice();return n[13]=e[r],n}function X5e(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k=(t[0]?t[0].account:"0x0000....0000")+"",R,D,O,M,F,H,U,G,N,A,v,p,m,y,T,I,_,E,C,S;g=new qb({props:{value:"_ens"}}),O=new qb({props:{value:t[0]?t[0].account:null}});let B=t[5]&&o7();return T=new un({props:{outline:!0,on_click:t[11],$$slots:{default:[Y5e]},$$scope:{ctx:t}}}),_=new un({props:{disabled:t[3].length<5||t[3].substr(-4)!=".art",on_click:t[8],$$slots:{default:[Q5e]},$$scope:{ctx:t}}}),{c(){e=J("div"),e.textContent="Add domains",r=Y(),n=J("div"),n.textContent="Create TXT record for domain in your domain manager.",i=Y(),s=J("br"),o=Y(),a=J("div"),c=J("div"),c.textContent="Host",l=Y(),u=J("div"),u.textContent="Value",f=Y(),d=J("div"),h=pe(`_ens 409 `),he(g.$$.fragment),b=Y(),w=J("div"),x=J("div"),R=pe(k),D=Y(),he(O.$$.fragment),M=Y(),F=J("br"),H=Y(),U=J("input"),G=Y(),N=J("br"),A=Y(),v=J("br"),p=Y(),B&&B.c(),m=Y(),y=J("div"),he(T.$$.fragment),I=Y(),he(_.$$.fragment),W(e,"class","title svelte-1wnanmc"),W(d,"class","field svelte-1wnanmc"),On(x,"position","absolute"),On(x,"width","90%"),On(x,"overflow","hidden"),W(w,"class","field svelte-1wnanmc"),W(a,"class","txt-record svelte-1wnanmc"),W(U,"type","text"),W(U,"placeholder","Your domain"),W(U,"class","svelte-1wnanmc"),W(y,"class","btns svelte-1wnanmc")},m($,P){ee($,e,P),ee($,r,P),ee($,n,P),ee($,i,P),ee($,s,P),ee($,o,P),ee($,a,P),L(a,c),L(a,l),L(a,u),L(a,f),L(a,d),L(d,h),fe(g,d,null),L(a,b),L(a,w),L(w,x),L(x,R),L(w,D),fe(O,w,null),ee($,M,P),ee($,F,P),ee($,H,P),ee($,U,P),Ir(U,t[3]),ee($,G,P),ee($,N,P),ee($,A,P),ee($,v,P),ee($,p,P),B&&B.m($,P),ee($,m,P),ee($,y,P),fe(T,y,null),L(y,I),fe(_,y,null),E=!0,C||(S=Tr(U,"input",t[10]),C=!0)},p($,P){(!E||P&1)&&k!==(k=($[0]?$[0].account:"0x0000....0000")+"")&<(R,k);const q={};P&1&&(q.value=$[0]?$[0].account:null),O.$set(q),P&8&&U.value!==$[3]&&Ir(U,$[3]),$[5]?B||(B=o7(),B.c(),B.m(m.parentNode,m)):B&&(B.d(1),B=null);const V={};P&2&&(V.on_click=$[11]),P&65536&&(V.$$scope={dirty:P,ctx:$}),T.$set(V);const X={};P&8&&(X.disabled=$[3].length<5||$[3].substr(-4)!=".art"),P&65536&&(X.$$scope={dirty:P,ctx:$}),_.$set(X)},i($){E||(te(g.$$.fragment,$),te(O.$$.fragment,$),te(T.$$.fragment,$),te(_.$$.fragment,$),E=!0)},o($){ne(g.$$.fragment,$),ne(O.$$.fragment,$),ne(T.$$.fragment,$),ne(_.$$.fragment,$),E=!1},d($){$&&Q(e),$&&Q(r),$&&Q(n),$&&Q(i),$&&Q(s),$&&Q(o),$&&Q(a),de(g),de(O),$&&Q(M),$&&Q(F),$&&Q(H),$&&Q(U),$&&Q(G),$&&Q(N),$&&Q(A),$&&Q(v),$&&Q(p),B&&B.d($),$&&Q(m),$&&Q(y),de(T),de(_),C=!1,S()}}}function Z5e(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k=t[2]&&a7(t);return d=new un({props:{href:"https://search.art.art",$$slots:{default:[rEe]},$$scope:{ctx:t}}}),g=new un({props:{outline:!0,on_click:t[9],$$slots:{default:[nEe]},$$scope:{ctx:t}}}),{c(){e=J("div"),e.textContent="Your domains",r=Y(),n=J("div"),n.textContent="Verify your DNS .ART domains to receive more tokens in the airdrop. Your ENS .ART names are added automatically.",i=Y(),s=J("br"),o=Y(),a=J("div"),k&&k.c(),c=Y(),l=J("br"),u=Y(),f=J("div"),he(d.$$.fragment),h=Y(),he(g.$$.fragment),b=Y(),w=J("br"),W(e,"class","title svelte-1wnanmc"),W(a,"class","list svelte-1wnanmc"),W(f,"class","btns svelte-1wnanmc")},m(R,D){ee(R,e,D),ee(R,r,D),ee(R,n,D),ee(R,i,D),ee(R,s,D),ee(R,o,D),ee(R,a,D),k&&k.m(a,null),ee(R,c,D),ee(R,l,D),ee(R,u,D),ee(R,f,D),fe(d,f,null),L(f,h),fe(g,f,null),ee(R,b,D),ee(R,w,D),x=!0},p(R,D){R[2]?k?k.p(R,D):(k=a7(R),k.c(),k.m(a,null)):k&&(k.d(1),k=null);const O={};D&65536&&(O.$$scope={dirty:D,ctx:R}),d.$set(O);const M={};D&2&&(M.on_click=R[9]),D&65536&&(M.$$scope={dirty:D,ctx:R}),g.$set(M)},i(R){x||(te(d.$$.fragment,R),te(g.$$.fragment,R),x=!0)},o(R){ne(d.$$.fragment,R),ne(g.$$.fragment,R),x=!1},d(R){R&&Q(e),R&&Q(r),R&&Q(n),R&&Q(i),R&&Q(s),R&&Q(o),R&&Q(a),k&&k.d(),R&&Q(c),R&&Q(l),R&&Q(u),R&&Q(f),de(d),de(g),R&&Q(b),R&&Q(w)}}}function o7(t){let e;return{c(){e=J("div"),e.textContent="Check TXT record",W(e,"align","center"),On(e,"color","red")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Y5e(t){let e;return{c(){e=pe("Back")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function Q5e(t){let e;return{c(){e=pe("Add .art domain")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function a7(t){let e;function r(s,o){return s[2].length>0?tEe:eEe}let n=r(t),i=n(t);return{c(){i.c(),e=ti()},m(s,o){i.m(s,o),ee(s,e,o)},p(s,o){n===(n=r(s))&&i?i.p(s,o):(i.d(1),i=n(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){i.d(s),s&&Q(e)}}}function eEe(t){let e;return{c(){e=J("div"),e.textContent="No results",W(e,"class","t2")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function tEe(t){let e,r=t[2],n=[];for(let i=0;i<r.length;i+=1)n[i]=c7(s7(t,r,i));return{c(){for(let i=0;i<n.length;i+=1)n[i].c();e=ti()},m(i,s){for(let o=0;o<n.length;o+=1)n[o]&&n[o].m(i,s);ee(i,e,s)},p(i,s){if(s&196){r=i[2];let o;for(o=0;o<r.length;o+=1){const a=s7(i,r,o);n[o]?n[o].p(a,s):(n[o]=c7(a),n[o].c(),n[o].m(e.parentNode,e))}for(;o<n.length;o+=1)n[o].d(1);n.length=r.length}},d(i){hu(n,i),i&&Q(e)}}}function c7(t){let e,r,n=t[13].Domain+"",i,s,o,a,c=t[13].Tier+1+"",l,u,f,d,h=t[6][t[13].Tier]+"",g,b,w;return{c(){e=J("div"),r=J("div"),i=pe(n),s=Y(),o=J("div"),a=pe("Tier "),l=pe(c),u=Y(),f=J("div"),d=pe("Airdrop "),g=pe(h),b=Y(),W(e,"class","item svelte-1wnanmc"),W(e,"style",w="background:"+t[7][t[13].Tier])},m(x,k){ee(x,e,k),L(e,r),L(r,i),L(e,s),L(e,o),L(o,a),L(o,l),L(e,u),L(e,f),L(f,d),L(f,g),L(e,b)},p(x,k){k&4&&n!==(n=x[13].Domain+"")&<(i,n),k&4&&c!==(c=x[13].Tier+1+"")&<(l,c),k&4&&h!==(h=x[6][x[13].Tier]+"")&<(g,h),k&4&&w!==(w="background:"+x[7][x[13].Tier])&&W(e,"style",w)},d(x){x&&Q(e)}}}function rEe(t){let e;return{c(){e=pe("Buy .art domain")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function nEe(t){let e;return{c(){e=pe("Add .art domain")},m(r,n){ee(r,e,n)},d(r){r&&Q(e)}}}function iEe(t){let e,r,n,i,s,o,a,c,l,u,f,d;const h=[Z5e,X5e],g=[];function b(w,x){return w[1]==0?0:w[1]==1?1:-1}return~(u=b(t))&&(f=g[u]=h[u](t)),{c(){e=J("div"),r=J("div"),n=pe("Airdrop "),i=pe(t[4]),s=pe(" tokens"),o=Y(),a=J("br"),c=Y(),l=J("div"),f&&f.c(),W(r,"class","t1"),W(l,"class","block main svelte-1wnanmc"),W(l,"align","left"),W(e,"align","center")},m(w,x){ee(w,e,x),L(e,r),L(r,n),L(r,i),L(r,s),L(e,o),L(e,a),L(e,c),L(e,l),~u&&g[u].m(l,null),d=!0}
409,p(w,[x]){(!d||x&16)&<(i,w[4]);let k=u;u=b(w),u===k?~u&&g[u].p(w,x):(f&&(_r(),ne(g[k],1,1,()=>{g[k]=null}),Cr()),~u?(f=g[u],f?f.p(w,x):(f=g[u]=h[u](w),f.c()),te(f,1),f.m(l,null)):f=null)},i(w){d||(te(f),d=!0)},o(w){ne(f),d=!1},d(w){w&&Q(e),~u&&g[u].d()}}}function sEe(t,e,r){let{client:n}=e,i=0,s,o="",a=0,c=!1;async function l(){try{console.log(n);let w=await fetch(zi("domains",{account:n.account}));w.status==200&&(r(2,s=await w.json()),r(4,a=0),s.forEach(x=>{r(4,a+=u[x.Tier])}))}catch(w){console.log(w)}}l();let u={0:20,1:140,2:220,3:280,4:320,5:560,6:820,7:1820,8:1e4,9:2e4},f=["#FFD4CF","#FCC0BE","#F7BDCE","#F5BED3","#F1BCE5","#EFBAEE","#DABCF3","#CBC4FA","#C5C6FE","linear-gradient(to right, #F5BED3,#C5C6FE)"];async function d(){try{r(5,c=!1),(await fetch(zi("add-domain",{account:n.account,domain:o}))).status==200?(r(1,i=0),r(3,o=""),l()):r(5,c=!0)}catch(w){r(5,c=!0),console.log(w)}}const h=()=>r(1,i=1);function g(){o=this.value,r(3,o)}const b=()=>r(1,i=0);return t.$$set=w=>{"client"in w&&r(0,n=w.client)},t.$$.update=()=>{t.$$.dirty&1&&l()},[n,i,s,o,a,c,u,f,d,h,g,b]}class oEe extends Rt{constructor(e){super(),xt(this,e,sEe,iEe,Ct,{client:0})}}function l7(t,e,r){const n=t.slice();return n[4]=e[r],n}function u7(t){let e,r;return e=new ah({props:{to:"/name/"+t[4]+".art",$$slots:{default:[aEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&129&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function aEe(t){let e,r=t[4]+"",n;return{c(){e=J("div"),n=pe(r),W(e,"class","item svelte-shyior"),an(e,"not-available",t[0][t[4]].Owner!="0x0000000000000000000000000000000000000000")},m(i,s){ee(i,e,s),L(e,n)},p(i,s){s&1&&an(e,"not-available",i[0][i[4]].Owner!="0x0000000000000000000000000000000000000000")},d(i){i&&Q(e)}}}function f7(t){let e,r,n=t[0][t[4]]&&u7(t);return{c(){n&&n.c(),e=ti()},m(i,s){n&&n.m(i,s),ee(i,e,s),r=!0},p(i,s){i[0][i[4]]?n?(n.p(i,s),s&1&&te(n,1)):(n=u7(i),n.c(),te(n,1),n.m(e.parentNode,e)):n&&(_r(),ne(n,1,1,()=>{n=null}),Cr())},i(i){r||(te(n),r=!0)},o(i){ne(n),r=!1},d(i){n&&n.d(i),i&&Q(e)}}}function cEe(t){let e,r,n=Jb,i=[];for(let o=0;o<n.length;o+=1)i[o]=f7(l7(t,n,o));const s=o=>ne(i[o],1,1,()=>{i[o]=null});return{c(){e=J("div");for(let o=0;o<i.length;o+=1)i[o].c();W(e,"class","main svelte-shyior")},m(o,a){ee(o,e,a);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(e,null);r=!0},p(o,[a]){if(a&1){n=Jb;let c;for(c=0;c<n.length;c+=1){const l=l7(o,n,c);i[c]?(i[c].p(l,a),te(i[c],1)):(i[c]=f7(l),i[c].c(),te(i[c],1),i[c].m(e,null))}for(_r(),c=n.length;c<i.length;c+=1)s(c);Cr()}},i(o){if(!r){for(let a=0;a<n.length;a+=1)te(i[a]);r=!0}}
409,o(o){i=i.filter(Boolean);for(let a=0;a<i.length;a+=1)ne(i[a]);r=!1},d(o){o&&Q(e),hu(i,o)}}}function lEe(t,e,r){let n={};async function i(){let o=await(await fetch(zi("art-tokens/premium"))).json();o.forEach(a=>{a.Name.length<2&&a.Owner!="0x0000000000000000000000000000000000000000"}),o.forEach(a=>{a.Name.length<2}),o.forEach(a=>{r(0,n[a.Name]=a,n)})}return i(),[n]}class uEe extends Rt{constructor(e){super(),xt(this,e,lEe,cEe,Ct,{})}}function fEe(t){let e,r,n;function i(o){t[5](o)}let s={};return t[3]!==void 0&&(s.hidesearch=t[3]),e=new zme({props:s}),Mr.push(()=>Vr(e,"hidesearch",i)),{c(){he(e.$$.fragment)},m(o,a){fe(e,o,a),n=!0},p(o,a){const c={};!r&&a&8&&(r=!0,c.hidesearch=o[3],Gr(()=>r=!1)),e.$set(c)},i(o){n||(te(e.$$.fragment,o),n=!0)},o(o){ne(e.$$.fragment,o),n=!1},d(o){de(e,o)}}}function dEe(t){let e,r;return e=new bu({props:{$$slots:{default:[fEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&520&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function hEe(t){let e,r;return e=new Xye({props:{client:t[1],name:t[8].name}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),i&256&&(s.name=n[8].name),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function pEe(t){let e,r;return e=new bu({props:{$$slots:{default:[hEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&770&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function gEe(t){let e,r;return e=new Vye({props:{client:t[1],name:t[8].name}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),i&256&&(s.name=n[8].name),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function mEe(t){let e,r;return e=new bu({props:{$$slots:{default:[gEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&770&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function bEe(t){let e,r;return e=new Fye({props:{client:t[1],account:t[8].account}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),i&256&&(s.account=n[8].account),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function yEe(t){let e,r;return e=new bu({props:{$$slots:{default:[bEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&770&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function vEe(t){let e,r;return e=new t2e({props:{client:t[1],name:t[8].name}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),i&256&&(s.name=n[8].name),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function wEe(t){let e,r;return e=new bu({props:{$$slots:{default:[vEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&770&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function EEe(t){let e,r;return e=new oEe({props:{client:t[1]}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function AEe(t){let e,r;return e=new bu({props:{$$slots:{default:[EEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&514&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function _Ee(t){let e,r;return e=new uEe({props:{client:t[1]}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&2&&(s.client=n[1]),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function CEe(t){let e,r;return e=new bu({props:{$$slots:{default:[_Ee]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&514&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function SEe(t){let e;return{c(){e=J("div"),e.textContent="404",W(e,"class","t1")},m(r,n){ee(r,e,n)},p:$e,d(r){r&&Q(e)}}}function TEe(t){let e,r;return e=new bu({props:{$$slots:{default:[SEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment)},m(n,i){fe(e,n,i),r=!0},p(n,i){const s={};i&512&&(s.$$scope={dirty:i,ctx:n}),e.$set(s)},i(n){r||(te(e.$$.fragment,n),r=!0)},o(n){ne(e.$$.fragment,n),r=!1},d(n){de(e,n)}}}function NEe(t){let e,r,n,i,s,o,a,c,l,u,f,d,h,g,b,w,x,k,R;function D(M){t[4](M)}let O={search:!t[3]};return t[1]!==void 0&&(O.client=t[1]),e=new Dme({props:O}),Mr.push(()=>Vr(e,"client",D)),i=new nl({props:{path:"/",$$slots:{default:[dEe]},$$scope:{ctx:t}}}),o=new nl({props:{path:"/name/:name",$$slots:{default:[pEe,({params:M})=>({8:M}),({params:M})=>M?256:0]},$$scope:{ctx:t}}}),c=new nl({props:{path:"/renew/:name",$$slots:{default:[mEe,({params:M})=>({8:M}),({params:M})=>M?256:0]},$$scope:{ctx:t}}}),u=new nl({props:{path:"/account/:account",$$slots:{default:[yEe,({params:M})=>({8:M}),({params:M})=>M?256:0]},$$scope:{ctx:t}}}),d=new nl({props:{path:"/registered/:name",$$slots:{default:[wEe,({params:M})=>({8:M}),({params:M})=>M?256:0]},$$scope:{ctx:t}}}),g=new nl({props:{path:"/airdrop",$$slots:{default:[AEe,({params:M})=>({8:M}),({params:M})=>M?256:0]},$$scope:{ctx:t}}}),w=new nl({props:{path:"/premium",$$slots:{default:[CEe,({params:M})=>({8:M}),({params:M})=>M?256:0]},$$scope:{ctx:t}}}),k=new nl({props:{$$slots:{default:[TEe]},$$scope:{ctx:t}}}),{c(){he(e.$$.fragment),n=Y(),he(i.$$.fragment),s=Y(),he(o.$$.fragment),a=Y(),he(c.$$.fragment),l=Y(),he(u.$$.fragment),f=Y(),he(d.$$.fragment),h=Y(),he(g.$$.fragment),b=Y(),he(w.$$.fragment),x=Y(),he(k.$$.fragment)},m(M,F){fe(e,M,F),ee(M,n,F),fe(i,M,F),ee(M,s,F),fe(o,M,F),ee(M,a,F),fe(c,M,F),ee(M,l,F),fe(u,M,F),ee(M,f,F),fe(d,M,F),ee(M,h,F),fe(g,M,F),ee(M,b,F),fe(w,M,F),ee(M,x,F),fe(k,M,F),R=!0},p(M,F){const H={};
409F&8&&(H.search=!M[3]),!r&&F&2&&(r=!0,H.client=M[1],Gr(()=>r=!1)),e.$set(H);const U={};F&520&&(U.$$scope={dirty:F,ctx:M}),i.$set(U);const G={};F&770&&(G.$$scope={dirty:F,ctx:M}),o.$set(G);const N={};F&770&&(N.$$scope={dirty:F,ctx:M}),c.$set(N);const A={};F&770&&(A.$$scope={dirty:F,ctx:M}),u.$set(A);const v={};F&770&&(v.$$scope={dirty:F,ctx:M}),d.$set(v);const p={};F&514&&(p.$$scope={dirty:F,ctx:M}),g.$set(p);const m={};F&514&&(m.$$scope={dirty:F,ctx:M}),w.$set(m);const y={};F&512&&(y.$$scope={dirty:F,ctx:M}),k.$set(y)},i(M){R||(te(e.$$.fragment,M),te(i.$$.fragment,M),te(o.$$.fragment,M),te(c.$$.fragment,M),te(u.$$.fragment,M),te(d.$$.fragment,M),te(g.$$.fragment,M),te(w.$$.fragment,M),te(k.$$.fragment,M),R=!0)},o(M){ne(e.$$.fragment,M),ne(i.$$.fragment,M),ne(o.$$.fragment,M),ne(c.$$.fragment,M),ne(u.$$.fragment,M),ne(d.$$.fragment,M),ne(g.$$.fragment,M),ne(w.$$.fragment,M),ne(k.$$.fragment,M),R=!1},d(M){de(e,M),M&&Q(n),de(i,M),M&&Q(s),de(o,M),M&&Q(a),de(c,M),M&&Q(l),de(u,M),M&&Q(f),de(d,M),M&&Q(h),de(g,M),M&&Q(b),de(w,M),M&&Q(x),de(k,M)}}}function IEe(t){let e,r,n,i,s,o,a,c;function l(d){t[6](d)}function u(d){t[7](d)}let f={$$slots:{default:[NEe]},$$scope:{ctx:t}};return t[0]!==void 0&&(f.url=t[0]),t[2]!==void 0&&(f.basepath=t[2]),r=new VB({props:f}),Mr.push(()=>Vr(r,"url",l)),Mr.push(()=>Vr(r,"basepath",u)),o=new yye({}),{c(){e=J("main"),he(r.$$.fragment),s=Y(),he(o.$$.fragment),a=Y(),document.title="ART Ethereum Name Service"},m(d,h){ee(d,e,h),fe(r,e,null),L(e,s),fe(o,e,null),ee(d,a,h),c=!0},p(d,[h]){const g={};h&522&&(g.$$scope={dirty:h,ctx:d}),!n&&h&1&&(n=!0,g.url=d[0],Gr(()=>n=!1)),!i&&h&4&&(i=!0,g.basepath=d[2],Gr(()=>i=!1)),r.$set(g)},i(d){c||(te(r.$$.fragment,d),te(o.$$.fragment,d),c=!0)},o(d){ne(r.$$.fragment,d),ne(o.$$.fragment,d),c=!1},d(d){d&&Q(e),de(r),de(o),d&&Q(a)}}}function xEe(t,e,r){let n,i,s,o=!1;function a(f){i=f,r(1,i)}function c(f){o=f,r(3,o)}function l(f){n=f,r(0,n)}function u(f){s=f,r(2,s)}return[n,i,s,o,a,c,l,u]}class REe extends Rt{constructor(e){super(),xt(this,e,xEe,IEe,Ct,{})}}new REe({target:document.getElementById("app")});export{Cy as $,Xn as A,it as B,z as C,bn as D,gt as E,Ee as F,Li as G,wp as H,Le as I,kc as J,Fe as K,Pe as L,ue as M,RN as N,oe as O,$1 as P,$s as Q,P5 as R,_a as S,VG as T,HK as U,VV as V,Tn as W,Py as X,nK as Y,z5 as Z,Vc as _,Qn as a,j4e as a$,G0 as a0,qc as a1,wx as a2,T4 as a3,Px as a4,a4 as a5,P8e as a6,Hn as a7,R8e as a8,RK as a9,qI as aA,JV as aB,S8e as aC,Vl as aD,Gc as aE,vp as aF,le as aG,Dt as aH,Ms as aI,Ay as aJ,ou as aK,SG as aL,E8e as aM,n8e as aN,pI as aO,h8e as aP,C5 as aQ,Pf as aR,lb as aS,gh as aT,z4e as aU,$4e as aV,YV as aW,F4e as aX,B4e as aY,cb as aZ,q4e as a_,bb as aa,rs as ab,F6 as ac,BO as ad,xh as ae,R_e as af,qa as ag,kf as ah,_V as ai,ub as aj,fb as ak,jV as al,qn as am,su as an,mh as ao,k4e as ap,UV as aq,O4e as ar,I8e as as,qV as at,k1 as au,k5 as av,Bt as aw,ei as ax,JI as ay,LV as az,Dx as b,ZEe as b$,M4e as b0,tW as b1,QV as b2,H4e as b3,L4e as b4,nx as b5,J4e as b6,H5 as b7,D4e as b8,rx as b9,Tt as bA,ep as bB,U3 as bC,Ps as bD,Mf as bE,Do as bF,ro as bG,Am as bH,ks as bI,DCe as bJ,Bx as bK,_4e as bL,Iy as bM,Rf as bN,A4e as bO,P_e as bP,IK as bQ,M8e as bR,kn as bS,mH as bT,jr as bU,j1 as bV,Mc as bW,D_e as bX,oq as bY,yq as bZ,XN as b_,G4e as ba,g8e as bb,b8e as bc,j5 as bd,U4e as be,DV as bf,_7 as bg,po as bh,zf as bi,Or as bj,PJ as bk,sn as bl,$Ce as bm,_n as bn,rf as bo,dge as bp,d8e as bq,Ga as br,f1 as bs,$K as bt,Wl as bu,mb as bv,xl as bw,r2 as bx,Ep as by,Ln as bz,kt as c,we as c$,Bo as c0,xf as c1,XEe as c2,QEe as c3,zh as c4,Gp as c5,Yp as c6,_x as c7,ZI as c8,so as c9,Y4e as cA,t_e as cB,yW as cC,fx as cD,dx as cE,l_e as cF,TW as cG,u_e as cH,Ah as cI,n0 as cJ,v_e as cK,h_e as cL,SW as cM,OJ as cN,Vo as cO,pV as cP,DW as cQ,db as cR,yx as cS,nV as cT,$q as cU,__e as cV,iV as cW,C_e as cX,x_e as cY,z_ as cZ,TR as c_,eK as ca,CG as cb,vx as cc,hb as cd,Ax as ce,Ar as cf,Qp as cg,FI as ch,bG as ci,W4e as cj,_h as ck,BV as cl,g_e as cm,Ch as cn,r_e as co,d_e as cp,ki as cq,c_e as cr,a_e as cs,Tc as ct,ax as cu,cx as cv,K4e as cw,Z4e as cx,e_e as cy,Q4e as cz,CCe as d,L1 as d$,Ff as d0,sE as d1,rge as d2,ete as d3,SR as d4,X3 as d5,Qie as d6,Bf as d7,Wf as d8,YX as d9,J5 as dA,S4e as dB,F5 as dC,$I as dD,L5 as dE,Cx as dF,Tx as dG,M1 as dH,r8e as dI,Ja as dJ,S5 as dK,x1 as dL,MG as dM,QI as dN,MI as dO,KV as dP,H1 as dQ,ZW as dR,g4 as dS,WA as dT,Rq as dU,XW as dV,KW as dW,bh as dX,Ry as dY,Ix as dZ,U1 as d_,MZ as da,OE as db,rue as dc,kE as dd,Zy as de,a1 as df,Kf as dg,Z5 as dh,Mo as di,g_ as dj,CR as dk,qee as dl,Df as dm,Ul as dn,Xy as dp,fa as dq,to as dr,ua as ds,bO as dt,jh as du,tI as dv,F1 as dw,hs as dx,sV as dy,E3 as dz,SCe as e,GA as e$,Ty as e0,$W as e1,Cq as e2,fI as e3,w8e as e4,i8e as e5,R1 as e6,TV as e7,kx as e8,A5 as e9,N4 as eA,Ig as eB,LCe as eC,Kx as eD,V4 as eE,yZ as eF,bZ as eG,YEe as eH,gb as eI,l8e as eJ,x5 as eK,_y as eL,GI as eM,p8e as eN,D1 as eO,T8e as eP,N8e as eQ,Gl as eR,OK as eS,WG as eT,KG as eU,P1 as eV,YW as eW,YI as eX,av as eY,FK as eZ,Eq as e_,OI as ea,RW as eb,jI as ec,O5 as ed,Sy as ee,OW as ef,Eh as eg,x8e as eh,_K as ei,CK as ej,aK as ek,EK as el,AK as em,wK as en,D5 as eo,C4e as ep,GV as eq,fv as er,$5 as es,QW as et,DK as eu,MK as ev,BK as ew,KO as ex,wne as ey,VW as ez,NCe as f,t4e as f$,$V as f0,O_e as f1,nq as f2,eq as f3,QJ as f4,YJ as f5,XJ as f6,iq as f7,Hh as f8,rq as f9,X8e as fA,Z8e as fB,Y8e as fC,Q8e as fD,eAe as fE,tAe as fF,rAe as fG,nAe as fH,iAe as fI,sAe as fJ,oAe as fK,aAe as fL,cAe as fM,lAe as fN,uAe as fO,fAe as fP,dAe as fQ,qAe as fR,GAe as fS,VAe as fT,WAe as fU,KAe as fV,XAe as fW,ZAe as fX,YAe as fY,QAe as fZ,e4e as f_,ZJ as fa,tq as fb,WJ as fc,
409k_e as fd,LK as fe,Cg as ff,S_e as fg,N_e as fh,T_e as fi,I_e as fj,MW as fk,D8e as fl,B8e as fm,F8e as fn,$8e as fo,L8e as fp,U8e as fq,H8e as fr,j8e as fs,z8e as ft,J8e as fu,q8e as fv,G8e as fw,V8e as fx,W8e as fy,K8e as fz,ICe as g,oI as g$,r4e as g0,n4e as g1,i4e as g2,s4e as g3,o4e as g4,a4e as g5,c4e as g6,l4e as g7,u4e as g8,f4e as g9,xAe as gA,RAe as gB,PAe as gC,kAe as gD,OAe as gE,MAe as gF,DAe as gG,BAe as gH,FAe as gI,$Ae as gJ,LAe as gK,UAe as gL,HAe as gM,jAe as gN,zAe as gO,JAe as gP,_8e as gQ,t8e as gR,iI as gS,Aq as gT,_q as gU,Sq as gV,VA as gW,sI as gX,Tq as gY,Nq as gZ,ph as g_,d4e as ga,h4e as gb,p4e as gc,g4e as gd,m4e as ge,b4e as gf,y4e as gg,v4e as gh,w4e as gi,E4e as gj,hAe as gk,pAe as gl,gAe as gm,mAe as gn,bAe as go,yAe as gp,vAe as gq,wAe as gr,EAe as gs,AAe as gt,_Ae as gu,CAe as gv,SAe as gw,TAe as gx,NAe as gy,IAe as gz,Ce as h,tV as h$,Iq as h0,kq as h1,Pq as h2,aI as h3,Oq as h4,e8e as h5,UI as h6,O3 as h7,BW as h8,FW as h9,qp as hA,Wp as hB,Of as hC,Lp as hD,Fp as hE,Hp as hF,vh as hG,$p as hH,nf as hI,Bp as hJ,Jp as hK,Es as hL,Up as hM,ws as hN,yh as hO,jp as hP,Kp as hQ,cV as hR,Vp as hS,zp as hT,XG as hU,ZG as hV,C8e as hW,QG as hX,eV as hY,PI as hZ,kI as h_,bx as ha,oV as hb,lI as hc,cI as hd,_5 as he,Dq as hf,Bq as hg,Fq as hh,s0 as hi,lK as hj,G5 as hk,yV as hl,LI as hm,M5 as hn,CV as ho,sf as hp,A3 as hq,T3 as hr,N3 as hs,I3 as ht,S3 as hu,_3 as hv,C3 as hw,x3 as hx,Zp as hy,Xp as hz,TCe as i,kK as i0,tK as i1,C4 as i2,rK as i3,DG as i4,zV as i5,M_e as i6,_G as i7,Mq as i8,_I as i9,Bi as iA,yb as iB,Ll as iC,wa as iD,XK as iE,hX as iF,P4e as iG,R4e as iH,X4e as iI,V4e as iJ,hx as iK,p_e as iL,CW as iM,f_e as iN,NI as ia,II as ib,Oa as ic,xI as id,A8e as ie,uI as ig,jq as ih,zq as ii,gf as ij,k8e as ik,O8e as il,oK as im,D3 as io,HI as ip,wV as iq,FV as ir,wI as is,EG as it,O1 as iu,hV as iv,R5 as iw,B1 as ix,Qo as iy,Oo as iz,W5 as j,MCe as k,FCe as l,Om as m,PCe as n,Bl as o,Qr as p,ho as q,BCe as r,di as s,be as t,K as u,Y1e as v,kCe as w,ze as x,fX as y,K5 as z};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.