1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ccip-MDYI2LLu.js","assets/vendor-DKHnZcSZ.js","assets/ethers-C5owhtiq.js","assets/math-BiFTc_yH.js","assets/core-Cxhdc57_.js","assets/index-CbqKx0Y3.js","assets/browser-ponyfill-Gs_wi8WC.js"])))=>i.map(i=>d[i]); 2var Gre=Object.defineProperty;var AI=t=>{throw TypeError(t)};var Kre=(t,e,r)=>e in t?Gre(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Gt=(t,e,r)=>Kre(t,typeof e!="symbol"?e+"":e,r),Q5=(t,e,r)=>e.has(t)||AI("Cannot "+r);var ze=(t,e,r)=>(Q5(t,e,"read from private field"),r?r.call(t):e.get(t)),Ir=(t,e,r)=>e.has(t)?AI("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),sr=(t,e,r,n)=>(Q5(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Ni=(t,e,r)=>(Q5(t,e,"access private method"),r);var p2=(t,e,r,n)=>({set _(i){sr(t,e,i,r)},get _(){return ze(t,e,n)}});import{r as Qre,a as Rl,b as _C,d as fB,e as nv,f as hB,A as Yre,h as Zre,l as Xre,i as Jre,j as vb,k as C,s as iv,u as ene,m as g0,n as Gf,o as bl,g as m0,c as Yn,Q as sv,_ as xc,p as ke,q as Xn,t as oa,v as lu,w as uu,x as CC,y as pB,z as p,B as tne,R as rne,C as qh,D as nne,E as ine,F as gB,G as mB,H as y0,I as SC,J as yB,K as Rt,L as oe,M as ns,N as iy,O as sne,P as sc,S as ane,T as one,U as s_,$ as cne,V as lne,W as une,X as dne,Y as fne,Z as hne,a0 as pne,a1 as gne,a2 as mne}from"./vendor-DKHnZcSZ.js";import{A as yne,f as bne,L as tt,p as vne,J as wne,B as Ene,I as Mp,h as Ho,a as Sn,C as TI,W as xne,d as At,t as jp,s as ji,e as bB,b as _ne,i as Cne,c as sy,g as Zn,j as ar,k as jw,l as Ef,m as ca,n as jr,o as vB,q as Lp,r as Lw,u as zt,v as nl,w as AC,x as Fp,Z as Sne,y as ks,z as ia,D as Ane,E as wB,F as TC,P as EB,G as Wh,H as si,K as wb,M as Tne,N as Zg,O as II,Q as Ine,R as kne,S as ay,T as kI,U as $ne,V as Nne,X as xB,Y as Ro,_ as Xg,$ as Pne}from"./ethers-C5owhtiq.js";import{B as _B,a as dn}from"./math-BiFTc_yH.js";function One(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(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 a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).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)}})();var g2={},$I;function Rne(){if($I)return g2;$I=1;var t=Qre();return g2.createRoot=t.createRoot,g2.hydrateRoot=t.hydrateRoot,g2}var Dne=Rne();const Mne=Rl(Dne);function Mi(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(i){return"'"+i+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ua(t){return!!t&&!!t[cn]}function vo(t){var e;return!!t&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===zne})(t)||Array.isArray(t)||!!t[m1]||!!(!((e=t.constructor)===null||e===void 0)&&e[m1])||Fw(t)||Uw(t))}function jne(t){return ua(t)||Mi(23,t),t[cn].t}function qu(t,e,r){r===void 0&&(r=!1),Wu(t)===0?(r?Object.keys:op)(t).forEach((function(n){r&&typeof n=="symbol"||e(n,t[n],t)})):t.forEach((function(n,i){return e(i,n,t)}))}function Wu(t){var e=t[cn];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Fw(t)?2:Uw(t)?3:0}function Ou(t,e){return Wu(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Eb(t,e){return Wu(t)===2?t.get(e):t[e]}function CB(t,e,r){var n=Wu(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function SB(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Fw(t){return qne&&t instanceof Map}function Uw(t){return Wne&&t instanceof Set}function Md(t){return t.o||t.t}function IC(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=TB(t);delete e[cn];for(var r=op(e),n=0;n<r.length;n++){var i=r[n],s=e[i];
2s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Bw(t,e){return e===void 0&&(e=!1),kC(t)||ua(t)||!vo(t)||(Wu(t)>1&&(t.set=t.add=t.clear=t.delete=Lne),Object.freeze(t),e&&qu(t,(function(r,n){return Bw(n,!0)}),!0)),t}function Lne(){Mi(2)}function kC(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ac(t){var e=l_[t];return e||Mi(18,t),e}function AB(t,e){l_[t]||(l_[t]=e)}function a_(){return F1}function Y5(t,e){e&&(ac("Patches"),t.u=[],t.s=[],t.v=e)}function av(t){o_(t),t.p.forEach(Fne),t.p=null}function o_(t){t===F1&&(F1=t.l)}function NI(t){return F1={p:[],l:F1,h:t,m:!0,_:0}}function Fne(t){var e=t[cn];e.i===0||e.i===1?e.j():e.g=!0}function Z5(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||ac("ES5").S(e,t,n),n?(r[cn].P&&(av(e),Mi(4)),vo(t)&&(t=ov(e,t),e.l||cv(e,t)),e.u&&ac("Patches").M(r[cn].t,t,e.u,e.s)):t=ov(e,r,[]),av(e),e.u&&e.v(e.u,e.s),t!==PC?t:void 0}function ov(t,e,r){if(kC(e))return e;var n=e[cn];if(!n)return qu(e,(function(o,c){return PI(t,n,e,o,c,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return cv(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=IC(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),qu(s,(function(o,c){return PI(t,n,i,o,c,r,a)})),cv(t,i,!1),r&&t.u&&ac("Patches").N(n,r,t.u,t.s)}return n.o}function PI(t,e,r,n,i,s,a){if(ua(i)){var o=ov(t,i,s&&e&&e.i!==3&&!Ou(e.R,n)?s.concat(n):void 0);if(CB(r,n,o),!ua(o))return;t.m=!1}else a&&r.add(i);if(vo(i)&&!kC(i)){if(!t.h.D&&t._<1)return;ov(t,i),e&&e.A.l||cv(t,i)}}function cv(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Bw(e,r)}function X5(t,e){var r=t[cn];return(r?Md(r):t)[e]}function OI(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function yu(t){t.P||(t.P=!0,t.l&&yu(t.l))}function J5(t){t.o||(t.o=IC(t.t))}function c_(t,e,r){var n=Fw(e)?ac("MapSet").F(e,r):Uw(e)?ac("MapSet").T(e,r):t.O?(function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:a_(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},c=o,l=U1;a&&(c=[o],l=Jg);var u=Proxy.revocable(c,l),d=u.revoke,f=u.proxy;return o.k=f,o.j=d,f})(e,r):ac("ES5").J(e,r);return(r?r.A:a_()).p.push(n),n}function $C(t){return ua(t)||Mi(22,t),(function e(r){if(!vo(r))return r;var n,i=r[cn],s=Wu(r);if(i){if(!i.P&&(i.i<4||!ac("ES5").K(i)))return i.t;i.I=!0,n=RI(r,s),i.I=!1}else n=RI(r,s);return qu(n,(function(a,o){i&&Eb(i.t,a)===o||CB(n,a,e(o))})),s===3?new Set(n):n})(t)}function RI(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return IC(t)}function Une(){function t(s,a){var o=i[s];return o?o.enumerable=a:i[s]=o={configurable:!0,enumerable:a,get:function(){var c=this[cn];return U1.get(c,s)},set:function(c){var l=this[cn];U1.set(l,s,c)}},o}function e(s){for(var a=s.length-1;a>=0;a--){var o=s[a][cn];if(!o.P)switch(o.i){case 5:n(o)&&yu(o);break;case 4:r(o)&&yu(o)}}}function r(s){for(var a=s.t,o=s.k,c=op(o),l=c.length-1;l>=0;l--){var u=c[l];if(u!==cn){var d=a[u];if(d===void 0&&!Ou(a,u))return!0;var f=o[u],h=f&&f[cn];if(h?h.t!==d:!SB(f,d))return!0}}var g=!!a[cn];return c.length!==op(a).length+(g?0:1)}function n(s){var a=s.k;if(a.length!==s.t.length)return!0;var o=Object.getOwnPropertyDescriptor(a,a.length-1);if(o&&!o.get)return!0;for(var c=0;c<a.length;c++)if(!a.hasOwnProperty(c))return!0;return!1}var i={};AB("ES5",{J:function(s,a){var o=Array.isArray(s),c=(function(u,d){if(u){for(var f=Array(d.length),h=0;h<d.length;h++)Object.defineProperty(f,""+h,t(h,!0));return f}var g=TB(d);delete g[cn];for(var m=op(g),y=0;y<m.length;y++){var b=m[y];g[b]=t(b,u||!!g[b].enumerable)}return Object.create(Object.getPrototypeOf(d),g)})(o,s),l={i:o?5:4,A:a?a.A:a_(),P:!1,I:!1,R:{},l:a,t:s,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,cn,{value:l,writable:!0}),c},S:function(s,a,o){o?ua(a)&&a[cn].A===s&&e(s.p):(s.u&&(function c(l){if(l&&typeof l=="object"){var u=l[cn];if(u){var d=u.t,f=u.k,h=u.R,g=u.i;if(g===4)qu(f,(function(v){v!==cn&&(d[v]!==void 0||Ou(d,v)?h[v]||c(f[v]):(h[v]=!0,yu(u)))})),qu(d,(function(v){f[v]!==void 0||Ou(f,v)||(h[v]=!1,yu(u))}));else if(g===5){if(n(u)&&(yu(u),h.length=!0),f.length<d.length)for(var m=f.length;m<d.length;m++)h[m]=!1;else for(var y=d.length;y<f.length;y++)h[y]=!0;for(var b=Math.min(f.length,d.length),E=0;E<b;E++)f.hasOwnProperty(E)||(h[E]=!0),h[E]===void 0&&c(f[E])}}}})(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}function Bne(){function t(n){if(!vo(n))return n;if(Array.isArray(n))return n.map(t);if(Fw(n))return new Map(Array.from(n.entries()).map((function(a){return[a[0],t(a[1])]})));if(Uw(n))return new Set(Array.from(n).map(t));var i=Object.create(Object.getPrototypeOf(n));for(var s in n)i[s]=t(n[s]);return Ou(n,m1)&&(i[m1]=n[m1]),i}function e(n){return ua(n)?t(n):n}var r="add";
2AB("Patches",{$:function(n,i){return i.forEach((function(s){for(var a=s.path,o=s.op,c=n,l=0;l<a.length-1;l++){var u=Wu(c),d=a[l];typeof d!="string"&&typeof d!="number"&&(d=""+d),u!==0&&u!==1||d!=="__proto__"&&d!=="constructor"||Mi(24),typeof c=="function"&&d==="prototype"&&Mi(24),typeof(c=Eb(c,d))!="object"&&Mi(15,a.join("/"))}var f=Wu(c),h=t(s.value),g=a[a.length-1];switch(o){case"replace":switch(f){case 2:return c.set(g,h);case 3:Mi(16);default:return c[g]=h}case r:switch(f){case 1:return g==="-"?c.push(h):c.splice(g,0,h);case 2:return c.set(g,h);case 3:return c.add(h);default:return c[g]=h}case"remove":switch(f){case 1:return c.splice(g,1);case 2:return c.delete(g);case 3:return c.delete(s.value);default:return delete c[g]}default:Mi(17,o)}})),n},N:function(n,i,s,a){switch(n.i){case 0:case 4:case 2:return(function(o,c,l,u){var d=o.t,f=o.o;qu(o.R,(function(h,g){var m=Eb(d,h),y=Eb(f,h),b=g?Ou(d,h)?"replace":r:"remove";if(m!==y||b!=="replace"){var E=c.concat(h);l.push(b==="remove"?{op:b,path:E}:{op:b,path:E,value:y}),u.push(b===r?{op:"remove",path:E}:b==="remove"?{op:r,path:E,value:e(m)}:{op:"replace",path:E,value:e(m)})}}))})(n,i,s,a);case 5:case 1:return(function(o,c,l,u){var d=o.t,f=o.R,h=o.o;if(h.length<d.length){var g=[h,d];d=g[0],h=g[1];var m=[u,l];l=m[0],u=m[1]}for(var y=0;y<d.length;y++)if(f[y]&&h[y]!==d[y]){var b=c.concat([y]);l.push({op:"replace",path:b,value:e(h[y])}),u.push({op:"replace",path:b,value:e(d[y])})}for(var E=d.length;E<h.length;E++){var v=c.concat([E]);l.push({op:r,path:v,value:e(h[E])})}d.length<h.length&&u.push({op:"replace",path:c.concat(["length"]),value:d.length})})(n,i,s,a);case 3:return(function(o,c,l,u){var d=o.t,f=o.o,h=0;d.forEach((function(g){if(!f.has(g)){var m=c.concat([h]);l.push({op:"remove",path:m,value:g}),u.unshift({op:r,path:m,value:g})}h++})),h=0,f.forEach((function(g){if(!d.has(g)){var m=c.concat([h]);l.push({op:r,path:m,value:g}),u.unshift({op:"remove",path:m,value:g})}h++}))})(n,i,s,a)}},M:function(n,i,s,a){s.push({op:"replace",path:[],value:i===PC?void 0:i}),a.push({op:"replace",path:[],value:n})}})}var DI,F1,NC=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",qne=typeof Map<"u",Wne=typeof Set<"u",MI=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",PC=NC?Symbol.for("immer-nothing"):((DI={})["immer-nothing"]=!0,DI),m1=NC?Symbol.for("immer-draftable"):"__$immer_draftable",cn=NC?Symbol.for("immer-state"):"__$immer_state",zne=""+Object.prototype.constructor,op=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,TB=Object.getOwnPropertyDescriptors||function(t){var e={};return op(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},l_={},U1={get:function(t,e){if(e===cn)return t;var r=Md(t);if(!Ou(r,e))return(function(i,s,a){var o,c=OI(s,a);return c?"value"in c?c.value:(o=c.get)===null||o===void 0?void 0:o.call(i.k):void 0})(t,r,e);var n=r[e];return t.I||!vo(n)?n:n===X5(t.t,e)?(J5(t),t.o[e]=c_(t.A.h,n,t)):n},has:function(t,e){return e in Md(t)},ownKeys:function(t){return Reflect.ownKeys(Md(t))},set:function(t,e,r){var n=OI(Md(t),e);if(n!=null&&n.set)return n.set.call(t.k,r),!0;if(!t.P){var i=X5(Md(t),e),s=i==null?void 0:i[cn];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(SB(r,i)&&(r!==void 0||Ou(t.t,e)))return!0;J5(t),yu(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return X5(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,J5(t),yu(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=Md(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){Mi(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Mi(12)}},Jg={};qu(U1,(function(t,e){Jg[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Jg.deleteProperty=function(t,e){return Jg.set.call(this,t,e,void 0)},Jg.set=function(t,e,r){return U1.set.call(this,t[0],e,r,t[0])};var Vne=(function(){function t(r){var n=this;this.O=MI,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;
2s=i;var c=n;return function(m){var y=this;m===void 0&&(m=o);for(var b=arguments.length,E=Array(b>1?b-1:0),v=1;v<b;v++)E[v-1]=arguments[v];return c.produce(m,(function(w){var x;return(x=s).call.apply(x,[y,w].concat(E))}))}}var l;if(typeof s!="function"&&Mi(6),a!==void 0&&typeof a!="function"&&Mi(7),vo(i)){var u=NI(n),d=c_(n,i,void 0),f=!0;try{l=s(d),f=!1}finally{f?av(u):o_(u)}return typeof Promise<"u"&&l instanceof Promise?l.then((function(m){return Y5(u,a),Z5(m,u)}),(function(m){throw av(u),m})):(Y5(u,a),Z5(l,u))}if(!i||typeof i!="object"){if((l=s(i))===void 0&&(l=i),l===PC&&(l=void 0),n.D&&Bw(l,!0),a){var h=[],g=[];ac("Patches").M(i,l,h,g),a(h,g)}return l}Mi(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(l){for(var u=arguments.length,d=Array(u>1?u-1:0),f=1;f<u;f++)d[f-1]=arguments[f];return n.produceWithPatches(l,(function(h){return i.apply(void 0,[h].concat(d))}))};var a,o,c=n.produce(i,s,(function(l,u){a=l,o=u}));return typeof Promise<"u"&&c instanceof Promise?c.then((function(l){return[l,a,o]})):[c,a,o]},typeof(r==null?void 0:r.useProxies)=="boolean"&&this.setUseProxies(r.useProxies),typeof(r==null?void 0:r.autoFreeze)=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){vo(r)||Mi(8),ua(r)&&(r=$C(r));var n=NI(this),i=c_(this,r,void 0);return i[cn].C=!0,o_(n),i},e.finishDraft=function(r,n){var i=r&&r[cn],s=i.A;return Y5(s,n),Z5(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!MI&&Mi(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var a=ac("Patches").$;return ua(r)?a(r,n):this.produce(r,(function(o){return a(o,n)}))},t})(),da=new Vne,Kf=da.produce,IB=da.produceWithPatches.bind(da);da.setAutoFreeze.bind(da);da.setUseProxies.bind(da);var jI=da.applyPatches.bind(da);da.createDraft.bind(da);da.finishDraft.bind(da);var lv="NOT_FOUND";function Hne(t){var e;return{get:function(n){return e&&t(e.key,n)?e.value:lv},put:function(n,i){e={key:n,value:i}},getEntries:function(){return e?[e]:[]},clear:function(){e=void 0}}}function Gne(t,e){var r=[];function n(o){var c=r.findIndex(function(u){return e(o,u.key)});if(c>-1){var l=r[c];return c>0&&(r.splice(c,1),r.unshift(l)),l.value}return lv}function i(o,c){n(o)===lv&&(r.unshift({key:o,value:c}),r.length>t&&r.pop())}function s(){return r}function a(){r=[]}return{get:n,put:i,getEntries:s,clear:a}}var kB=function(e,r){return e===r};function Kne(t){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;for(var i=r.length,s=0;s<i;s++)if(!t(r[s],n[s]))return!1;return!0}}function uv(t,e){var r=typeof e=="object"?e:{equalityCheck:e},n=r.equalityCheck,i=n===void 0?kB:n,s=r.maxSize,a=s===void 0?1:s,o=r.resultEqualityCheck,c=Kne(i),l=a===1?Hne(c):Gne(a,c);function u(){var d=l.get(arguments);if(d===lv){if(d=t.apply(null,arguments),o){var f=l.getEntries(),h=f.find(function(g){return o(g.value,d)});h&&(d=h.value)}l.put(arguments,d)}return d}return u.clearCache=function(){return l.clear()},u}function Qne(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every(function(n){return typeof n=="function"})){var r=e.map(function(n){return typeof n=="function"?"function "+(n.name||"unnamed")+"()":typeof n}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+r+"]")}return e}function $B(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var i=function(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];var l=0,u,d={memoizeOptions:void 0},f=o.pop();if(typeof f=="object"&&(d=f,f=o.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var h=d,g=h.memoizeOptions,m=g===void 0?r:g,y=Array.isArray(m)?m:[m],b=Qne(o),E=t.apply(void 0,[function(){return l++,f.apply(null,arguments)}].concat(y)),v=t(function(){for(var x=[],_=b.length,S=0;S<_;S++)x.push(b[S].apply(null,arguments));return u=E.apply(null,x),u});return Object.assign(v,{resultFunc:f,memoizedResultFunc:E,dependencies:b,lastResult:function(){return u},recomputations:function(){return l},resetRecomputations:function(){return l=0}}),v};return i}var ll=$B(uv),Yne=function(e,r){if(r===void 0&&(r=ll),typeof e!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof e));var n=Object.keys(e),i=r(n.map(function(s){return e[s]}),function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return a.reduce(function(c,l,u){return c[n[u]]=l,c},{})});return i};const Zne=Object.freeze(Object.defineProperty({__proto__:null,createSelector:ll,createSelectorCreator:$B,createStructuredSelector:Yne,defaultEqualityCheck:kB,defaultMemoize:uv},Symbol.toStringTag,{value:"Module"}));function NB(t){var e=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,t):a(o)}}};return e}var u_=NB();u_.withExtraArgument=NB;var Xne=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}
2e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),oy=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(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}}},Up=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},Jne=Object.defineProperty,eie=Object.defineProperties,tie=Object.getOwnPropertyDescriptors,LI=Object.getOwnPropertySymbols,rie=Object.prototype.hasOwnProperty,nie=Object.prototype.propertyIsEnumerable,FI=function(t,e,r){return e in t?Jne(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Os=function(t,e){for(var r in e||(e={}))rie.call(e,r)&&FI(t,r,e[r]);if(LI)for(var n=0,i=LI(e);n<i.length;n++){var r=i[n];nie.call(e,r)&&FI(t,r,e[r])}return t},e6=function(t,e){return eie(t,tie(e))},cy=function(t,e,r){return new Promise(function(n,i){var s=function(c){try{o(r.next(c))}catch(l){i(l)}},a=function(c){try{o(r.throw(c))}catch(l){i(l)}},o=function(c){return c.done?n(c.value):Promise.resolve(c.value).then(s,a)};o((r=r.apply(t,e)).next())})},qc=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=ll.apply(void 0,t),n=function(i){for(var s=[],a=1;a<arguments.length;a++)s[a-1]=arguments[a];return r.apply(void 0,Up([ua(i)?$C(i):i],s))};return n},iie=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?nv:nv.apply(null,arguments)};function vl(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var PB=(function(t){Xne(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Up([void 0],r[0].concat(this)))):new(e.bind.apply(e,Up([void 0],r.concat(this))))},e})(Array);function d_(t){return vo(t)?Kf(t,function(){}):t}function sie(t){return typeof t!="object"||t==null||Object.isFrozen(t)}function aie(t){return function(){return function(e){return function(r){return e(r)}}}}function OB(t){var e=typeof t;return t==null||e==="string"||e==="boolean"||e==="number"||Array.isArray(t)||vl(t)}function RB(t,e,r,n,i,s){e===void 0&&(e=""),r===void 0&&(r=OB),i===void 0&&(i=[]);var a;if(!r(t))return{keyPath:e||"<root>",value:t};if(typeof t!="object"||t===null||s!=null&&s.has(t))return!1;for(var o=n!=null?n(t):Object.entries(t),c=i.length>0,l=function(y,b){var E=e?e+"."+y:y;if(c){var v=i.some(function(w){return w instanceof RegExp?w.test(E):E===w});if(v)return"continue"}if(!r(b))return{value:{keyPath:E,value:b}};if(typeof b=="object"&&(a=RB(b,E,r,n,i,s),a))return{value:a}},u=0,d=o;u<d.length;u++){var f=d[u],h=f[0],g=f[1],m=l(h,g);if(typeof m=="object")return m.value}return s&&DB(t)&&s.add(t),!1}function DB(t){if(!Object.isFrozen(t))return!1;for(var e=0,r=Object.values(t);e<r.length;e++){var n=r[e];if(!(typeof n!="object"||n===null)&&!DB(n))return!1}return!0}function oie(t){return function(){return function(e){return function(r){return e(r)}}}}function cie(t){return typeof t=="boolean"}function lie(){return function(e){return MB(e)}}function MB(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e;t.immutableCheck,t.serializableCheck;var n=new PB;return r&&(cie(r)?n.push(u_):n.push(u_.withExtraArgument(r.extraArgument))),n}function jB(t){var e=lie(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?e():s,o=r.devTools,c=o===void 0?!0:o,l=r.preloadedState,u=l===void 0?void 0:l,d=r.enhancers,f=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if(vl(i))h=_C(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=a;typeof g=="function"&&(g=g(e));var m=fB.apply(void 0,g),y=nv;
vendor: 4,652 bytes, line 2
2c&&(y=iie(Os({trace:!1},typeof c=="object"&&c)));var b=[m];Array.isArray(f)?b=Up([m],f):typeof f=="function"&&(b=f(b));var E=y.apply(void 0,b);return hB(h,u,E)}function Pr(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Os(Os({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function uie(t){return vl(t)&&typeof t.type=="string"&&Object.keys(t).every(die)}function die(t){return["type","payload","error","meta"].indexOf(t)>-1}function fie(t){return""+t}function LB(t){var e={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(o in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return t(i),[e,r,n]}function hie(t){return typeof t=="function"}function qw(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?LB(e):[e,r,n],s=i[0],a=i[1],o=i[2],c;if(hie(t))c=function(){return d_(t())};else{var l=d_(t);c=function(){return l}}function u(d,f){d===void 0&&(d=c());var h=Up([s[f.type]],a.filter(function(g){var m=g.matcher;return m(f)}).map(function(g){var m=g.reducer;return m}));return h.filter(function(g){return!!g}).length===0&&(h=[o]),h.reduce(function(g,m){if(m)if(ua(g)){var y=g,b=m(y,f);return b===void 0?g:b}else{if(vo(g))return Kf(g,function(E){return m(E,f)});var b=m(g,f);if(b===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}return g},d)}return u.getInitialState=c,u}function pie(t,e){return t+"/"+e}function os(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var r=typeof t.initialState=="function"?t.initialState:d_(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(u){var d=n[u],f=pie(e,u),h,g;"reducer"in d?(h=d.reducer,g=d.prepare):h=d,s[u]=h,a[f]=h,o[u]=g?Pr(f,g):Pr(f)});function c(){var u=typeof t.extraReducers=="function"?LB(t.extraReducers):[t.extraReducers],d=u[0],f=d===void 0?{}:d,h=u[1],g=h===void 0?[]:h,m=u[2],y=m===void 0?void 0:m,b=Os(Os({},f),a);return qw(r,function(E){for(var v in b)E.addCase(v,b[v]);for(var w=0,x=g;w<x.length;w++){var _=x[w];E.addMatcher(_.matcher,_.reducer)}y&&E.addDefaultCase(y)})}var l;return{name:e,reducer:function(u,d){return l||(l=c()),l(u,d)},actions:o,caseReducers:s,getInitialState:function(){return l||(l=c()),l.getInitialState()}}}function gie(){return{ids:[],entities:{}}}function mie(){function t(e){return e===void 0&&(e={}),Object.assign(gie(),e)}return{getInitialState:t}}function yie(){function t(e){var r=function(l){return l.ids},n=function(l){return l.entities},i=qc(r,n,function(l,u){return l.map(function(d){return u[d]})}),s=function(l,u){return u},a=function(l,u){return l[u]},o=qc(r,function(l){return l.length});if(!e)return{selectIds:r,selectEntities:n,selectAll:i,selectTotal:o,selectById:qc(n,s,a)};var c=qc(e,n);return{selectIds:qc(e,r),selectEntities:c,selectAll:qc(e,i),selectTotal:qc(e,o),selectById:qc(c,s,a)}}return{getSelectors:t}}function bie(t){var e=Un(function(r,n){return t(n)});return function(n){return e(n,void 0)}}function Un(t){return function(r,n){function i(a){return uie(a)}var s=function(a){i(n)?t(n.payload,a):t(n,a)};return ua(r)?(s(r),r):Kf(r,s)}}function y1(t,e){var r=e(t);return r}function df(t){return Array.isArray(t)||(t=Object.values(t)),t}function FB(t,e,r){t=df(t);for(var n=[],i=[],s=0,a=t;s<a.length;s++){var o=a[s],c=y1(o,e);c in r.entities?i.push({id:c,changes:o}):n.push(o)}return[n,i]}function UB(t){function e(g,m){var y=y1(g,t);y in m.entities||(m.ids.push(y),m.entities[y]=g)}function r(g,m){g=df(g);for(var y=0,b=g;y<b.length;y++){var E=b[y];e(E,m)}}function n(g,m){var y=y1(g,t);y in m.entities||m.ids.push(y),m.entities[y]=g}function i(g,m){g=df(g);for(var y=0,b=g;y<b.length;y++){var E=b[y];n(E,m)}}function s(g,m){g=df(g),m.ids=[],m.entities={},r(g,m)}function a(g,m){return o([g],m)}function o(g,m){var y=!1;g.forEach(function(b){b in m.entities&&(delete m.entities[b],y=!0)}),y&&(m.ids=m.ids.filter(function(b){return b in m.entities}))}function c(g){Object.assign(g,{ids:[],entities:{}})}function l(g,m,y){var b=y.entities[m.id],E=Object.assign({},b,m.changes),v=y1(E,t),w=v!==m.id;return w&&(g[m.id]=v,delete y.entities[m.id]),y.entities[v]=E,w}function u(g,m){return d([g],m)}function d(g,m){var y={},b={};
2g.forEach(function(w){w.id in m.entities&&(b[w.id]={id:w.id,changes:Os(Os({},b[w.id]?b[w.id].changes:null),w.changes)})}),g=Object.values(b);var E=g.length>0;if(E){var v=g.filter(function(w){return l(y,w,m)}).length>0;v&&(m.ids=Object.keys(m.entities))}}function f(g,m){return h([g],m)}function h(g,m){var y=FB(g,t,m),b=y[0],E=y[1];d(E,m),r(b,m)}return{removeAll:bie(c),addOne:Un(e),addMany:Un(r),setOne:Un(n),setMany:Un(i),setAll:Un(s),updateOne:Un(u),updateMany:Un(d),upsertOne:Un(f),upsertMany:Un(h),removeOne:Un(a),removeMany:Un(o)}}function vie(t,e){var r=UB(t),n=r.removeOne,i=r.removeMany,s=r.removeAll;function a(E,v){return o([E],v)}function o(E,v){E=df(E);var w=E.filter(function(x){return!(y1(x,t)in v.entities)});w.length!==0&&y(w,v)}function c(E,v){return l([E],v)}function l(E,v){E=df(E),E.length!==0&&y(E,v)}function u(E,v){E=df(E),v.entities={},v.ids=[],o(E,v)}function d(E,v){return f([E],v)}function f(E,v){for(var w=!1,x=0,_=E;x<_.length;x++){var S=_[x],A=v.entities[S.id];if(A){w=!0,Object.assign(A,S.changes);var I=t(A);S.id!==I&&(delete v.entities[S.id],v.entities[I]=A)}}w&&b(v)}function h(E,v){return g([E],v)}function g(E,v){var w=FB(E,t,v),x=w[0],_=w[1];f(_,v),o(x,v)}function m(E,v){if(E.length!==v.length)return!1;for(var w=0;w<E.length&&w<v.length;w++)if(E[w]!==v[w])return!1;return!0}function y(E,v){E.forEach(function(w){v.entities[t(w)]=w}),b(v)}function b(E){var v=Object.values(E.entities);v.sort(e);var w=v.map(t),x=E.ids;m(x,w)||(E.ids=w)}return{removeOne:n,removeMany:i,removeAll:s,addOne:Un(a),updateOne:Un(d),upsertOne:Un(h),setOne:Un(c),setMany:Un(l),setAll:Un(u),addMany:Un(o),updateMany:Un(f),upsertMany:Un(g)}}function wie(t){t===void 0&&(t={});var e=Os({sortComparer:!1,selectId:function(o){return o.id}},t),r=e.selectId,n=e.sortComparer,i=mie(),s=yie(),a=n?vie(r,n):UB(r);return Os(Os(Os({selectId:r,sortComparer:n},i),s),a)}var Eie="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ww=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Eie[Math.random()*64|0];return e},xie=["name","message","stack","code"],t6=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),UI=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),BB=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=xie;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},pn=(function(){function t(e,r,n){var i=Pr(e+"/fulfilled",function(l,u,d,f){return{payload:l,meta:e6(Os({},f||{}),{arg:d,requestId:u,requestStatus:"fulfilled"})}}),s=Pr(e+"/pending",function(l,u,d){return{payload:void 0,meta:e6(Os({},d||{}),{arg:u,requestId:l,requestStatus:"pending"})}}),a=Pr(e+"/rejected",function(l,u,d,f,h){return{payload:f,error:(n&&n.serializeError||BB)(l||"Rejected"),meta:e6(Os({},h||{}),{arg:d,requestId:u,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"})}}),o=typeof AbortController<"u"?AbortController:(function(){function l(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return l.prototype.abort=function(){},l})();function c(l){return function(u,d,f){var h=n!=null&&n.idGenerator?n.idGenerator(l):Ww(),g=new o,m;function y(E){m=E,g.abort()}var b=(function(){return cy(this,null,function(){var E,v,w,x,_,S,A;return oy(this,function(I){switch(I.label){case 0:return I.trys.push([0,4,,5]),x=(E=n==null?void 0:n.condition)==null?void 0:E.call(n,l,{getState:d,extra:f}),_ie(x)?[4,x]:[3,2];case 1:x=I.sent(),I.label=2;case 2:if(x===!1||g.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return _=new Promise(function($,P){return g.signal.addEventListener("abort",function(){return P({name:"AbortError",message:m||"Aborted"})})}),u(s(h,l,(v=n==null?void 0:n.getPendingMeta)==null?void 0:v.call(n,{requestId:h,arg:l},{getState:d,extra:f}))),[4,Promise.race([_,Promise.resolve(r(l,{dispatch:u,getState:d,extra:f,requestId:h,signal:g.signal,abort:y,rejectWithValue:function($,P){return new t6($,P)},fulfillWithValue:function($,P){return new UI($,P)}})).then(function($){if($ instanceof t6)throw $;return $ instanceof UI?i($.payload,h,l,$.meta):i($,h,l)})])];case 3:return w=I.sent(),[3,5];case 4:return S=I.sent(),w=S instanceof t6?a(null,h,l,S.payload,S.meta):a(S,h,l),[3,5];case 5:return A=n&&!n.dispatchConditionRejection&&a.match(w)&&w.meta.condition,A||u(w),[2,w]}})})})();return Object.assign(b,{abort:y,requestId:h,arg:l,unwrap:function(){return b.then(qB)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t})();function qB(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function _ie(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Cie=function(t){return t&&typeof t.match=="function"},WB=function(t,e){return Cie(t)?t.match(e):t(e)};function Qf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return t.some(function(n){return WB(n,r)})}}function cp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return t.every(function(n){return WB(n,r)})}}function zw(t,e){if(!t||!t.meta)return!1;var r=typeof t.meta.requestId=="string",n=e.indexOf(t.meta.requestStatus)>-1;return r&&n}function ly(t){return typeof t[0]=="function"&&"pending"in t[0]&&"fulfilled"in t[0]&&"rejected"in t[0]}function Vw(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];
2return t.length===0?function(r){return zw(r,["pending"])}:ly(t)?function(r){var n=t.map(function(s){return s.pending}),i=Qf.apply(void 0,n);return i(r)}:Vw()(t[0])}function Bp(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===0?function(r){return zw(r,["rejected"])}:ly(t)?function(r){var n=t.map(function(s){return s.rejected}),i=Qf.apply(void 0,n);return i(r)}:Bp()(t[0])}function uy(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=function(n){return n&&n.meta&&n.meta.rejectedWithValue};return t.length===0?function(n){var i=cp(Bp.apply(void 0,t),r);return i(n)}:ly(t)?function(n){var i=cp(Bp.apply(void 0,t),r);return i(n)}:uy()(t[0])}function id(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===0?function(r){return zw(r,["fulfilled"])}:ly(t)?function(r){var n=t.map(function(s){return s.fulfilled}),i=Qf.apply(void 0,n);return i(r)}:id()(t[0])}function dv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===0?function(r){return zw(r,["pending","fulfilled","rejected"])}:ly(t)?function(r){for(var n=[],i=0,s=t;i<s.length;i++){var a=s[i];n.push(a.pending,a.rejected,a.fulfilled)}var o=Qf.apply(void 0,n);return o(r)}:dv()(t[0])}var OC=function(t,e){if(typeof t!="function")throw new TypeError(e+" is not a function")},f_=function(){},zB=function(t,e){return e===void 0&&(e=f_),t.catch(e),t},VB=function(t,e){return t.addEventListener("abort",e,{once:!0}),function(){return t.removeEventListener("abort",e)}},lp=function(t,e){var r=t.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:e,configurable:!0,writable:!0}),t.abort(e))},Sie="task",HB="listener",GB="completed",RC="cancelled",Aie="task-"+RC,Tie="task-"+GB,KB=HB+"-"+RC,Iie=HB+"-"+GB,dy=(function(){function t(e){this.code=e,this.name="TaskAbortError",this.message=Sie+" "+RC+" (reason: "+e+")"}return t})(),up=function(t){if(t.aborted)throw new dy(t.reason)};function QB(t,e){var r=f_;return new Promise(function(n,i){var s=function(){return i(new dy(t.reason))};if(t.aborted){s();return}r=VB(t,s),e.finally(function(){return r()}).then(n,i)}).finally(function(){r=f_})}var kie=function(t,e){return cy(void 0,null,function(){var r,n;return oy(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return i.sent(),[4,t()];case 2:return r=i.sent(),[2,{status:"ok",value:r}];case 3:return n=i.sent(),[2,{status:n instanceof dy?"cancelled":"rejected",error:n}];case 4:return e==null||e(),[7];case 5:return[2]}})})},fv=function(t){return function(e){return zB(QB(t,e).then(function(r){return up(t),r}))}},YB=function(t){var e=fv(t);return function(r){return e(new Promise(function(n){return setTimeout(n,r)}))}},$ie=Object.assign,BI={},fy="listenerMiddleware",Nie=function(t){var e=function(r){return VB(t,function(){return lp(r,t.reason)})};return function(r){OC(r,"taskExecutor");var n=new AbortController;e(n);var i=kie(function(){return cy(void 0,null,function(){var s;return oy(this,function(a){switch(a.label){case 0:return up(t),up(n.signal),[4,r({pause:fv(n.signal),delay:YB(n.signal),signal:n.signal})];case 1:return s=a.sent(),up(n.signal),[2,s]}})})},function(){return lp(n,Tie)});return{result:fv(t)(i),cancel:function(){lp(n,Aie)}}}},Pie=function(t,e){var r=function(n,i){return cy(void 0,null,function(){var s,a,o,c;return oy(this,function(l){switch(l.label){case 0:up(e),s=function(){},a=new Promise(function(u,d){var f=t({predicate:n,effect:function(h,g){g.unsubscribe(),u([h,g.getState(),g.getOriginalState()])}});s=function(){f(),d()}}),o=[a],i!=null&&o.push(new Promise(function(u){return setTimeout(u,i,null)})),l.label=1;case 1:return l.trys.push([1,,3,4]),[4,QB(e,Promise.race(o))];case 2:return c=l.sent(),up(e),[2,c];case 3:return s(),[7];case 4:return[2]}})})};return function(n,i){return zB(r(n,i))}},ZB=function(t){var e=t.type,r=t.actionCreator,n=t.matcher,i=t.predicate,s=t.effect;if(e)i=Pr(e).match;else if(r)e=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return OC(s,"options.listener"),{predicate:i,type:e,effect:s}},Oie=function(t){var e=ZB(t),r=e.type,n=e.predicate,i=e.effect,s=Ww(),a={id:s,effect:i,type:r,predicate:n,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return a}
2,h_=function(t){t.pending.forEach(function(e){lp(e,KB)})},Rie=function(t){return function(){t.forEach(h_),t.clear()}},qI=function(t,e,r){try{t(e,r)}catch(n){setTimeout(function(){throw n},0)}},XB=Pr(fy+"/add"),JB=Pr(fy+"/removeAll"),eq=Pr(fy+"/remove"),Die=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,Up([fy+"/error"],t))};function Mie(t){var e=this;t===void 0&&(t={});var r=new Map,n=t.extra,i=t.onError,s=i===void 0?Die:i;OC(s,"onError");var a=function(h){return h.unsubscribe=function(){return r.delete(h.id)},r.set(h.id,h),function(g){h.unsubscribe(),g!=null&&g.cancelActive&&h_(h)}},o=function(h){for(var g=0,m=Array.from(r.values());g<m.length;g++){var y=m[g];if(h(y))return y}},c=function(h){var g=o(function(m){return m.effect===h.effect});return g||(g=Oie(h)),a(g)},l=function(h){var g=ZB(h),m=g.type,y=g.effect,b=g.predicate,E=o(function(v){var w=typeof m=="string"?v.type===m:v.predicate===b;return w&&v.effect===y});return E&&(E.unsubscribe(),h.cancelActive&&h_(E)),!!E},u=function(h,g,m,y){return cy(e,null,function(){var b,E,v;return oy(this,function(w){switch(w.label){case 0:b=new AbortController,E=Pie(c,b.signal),w.label=1;case 1:return w.trys.push([1,3,4,5]),h.pending.add(b),[4,Promise.resolve(h.effect(g,$ie({},m,{getOriginalState:y,condition:function(x,_){return E(x,_).then(Boolean)},take:E,delay:YB(b.signal),pause:fv(b.signal),extra:n,signal:b.signal,fork:Nie(b.signal),unsubscribe:h.unsubscribe,subscribe:function(){r.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(x,_,S){x!==b&&(lp(x,KB),S.delete(x))})}})))];case 2:return w.sent(),[3,5];case 3:return v=w.sent(),v instanceof dy||qI(s,v,{raisedBy:"effect"}),[3,5];case 4:return lp(b,Iie),h.pending.delete(b),[7];case 5:return[2]}})})},d=Rie(r),f=function(h){return function(g){return function(m){if(XB.match(m))return c(m.payload);if(JB.match(m)){d();return}if(eq.match(m))return l(m.payload);var y=h.getState(),b=function(){if(y===BI)throw new Error(fy+": getOriginalState can only be called synchronously");return y},E;try{if(E=g(m),r.size>0)for(var v=h.getState(),w=Array.from(r.values()),x=0,_=w;x<_.length;x++){var S=_[x],A=!1;try{A=S.predicate(m,v,y)}catch(I){A=!1,qI(s,I,{raisedBy:"predicate"})}A&&u(S,m,h,b)}}finally{y=BI}return E}}};return{middleware:f,startListening:c,stopListening:l,clearListeners:d}}var Hd="RTK_autoBatch",p_=function(){return function(t){var e;return{payload:t,meta:(e={},e[Hd]=!0,e)}}},WI,jie=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(WI||(WI=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},tq=function(t){return function(e){setTimeout(e,t)}},Lie=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tq(10),Fie=function(t){return t===void 0&&(t={type:"raf"}),function(e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(void 0,r),s=!0,a=!1,o=!1,c=new Set,l=t.type==="tick"?jie:t.type==="raf"?Lie:t.type==="callback"?t.queueNotification:tq(t.timeout),u=function(){o=!1,a&&(a=!1,c.forEach(function(d){return d()}))};return Object.assign({},i,{subscribe:function(d){var f=function(){return s&&d()},h=i.subscribe(f);return c.add(d),function(){h(),c.delete(d)}},dispatch:function(d){var f;try{return s=!((f=d==null?void 0:d.meta)!=null&&f[Hd]),a=!s,a&&(o||(o=!0,l(u))),i.dispatch(d)}finally{s=!0}}})}}};Une();const Uie=Object.freeze(Object.defineProperty({__proto__:null,MiddlewareArray:PB,SHOULD_AUTOBATCH:Hd,TaskAbortError:dy,__DO_NOT_USE__ActionTypes:Yre,addListener:XB,applyMiddleware:fB,autoBatchEnhancer:Fie,bindActionCreators:Zre,clearAllListeners:JB,combineReducers:_C,compose:nv,configureStore:jB,createAction:Pr,createAsyncThunk:pn,createDraftSafeSelector:qc,createEntityAdapter:wie,createImmutableStateInvariantMiddleware:aie,createListenerMiddleware:Mie,createNextState:Kf,createReducer:qw,createSelector:ll,createSerializableStateInvariantMiddleware:oie,createSlice:os,createStore:hB,current:$C,findNonSerializableValue:RB,freeze:Bw,getDefaultMiddleware:MB,getType:fie,isAllOf:cp,isAnyOf:Qf,isAsyncThunkAction:dv,isDraft:ua,isFulfilled:id,isImmutableDefault:sie,isPending:Vw,isPlain:OB,isPlainObject:vl,isRejected:Bp,isRejectedWithValue:uy,legacy_createStore:Xre,miniSerializeError:BB,nanoid:Ww,original:jne,prepareAutoBatched:p_,removeListener:eq,unwrapResult:qB},Symbol.toStringTag,{value:"Module"}));var zI=Jre();const qp="accessToken",zh="user",VI="wallets",Gd="user_passcode";var Bie={VITE_APP_DEFAUL_CHAIN_ID:"42161"},st=(t=>(t[t.MAINNET=1]="MAINNET",t[t.ARBITRUM_ONE=42161]="ARBITRUM_ONE",t[t.ARB_TESTNET=4002]="ARB_TESTNET",t))(st||{});const sd=parseInt(Bie.VITE_APP_DEFAUL_CHAIN_ID),qie={[st.MAINNET]:"https://endpoints.omniatech.io/v1/arbitrum/one/public",56:"https://bsc-mainnet.public.blastapi.io",[st.ARBITRUM_ONE]:"https://site2.moralis-nodes.com/arbitrum/883e46cbafd740869963c7092550d163",[st.ARB_TESTNET]:"https://rpc.testnet.fantom.network"};var wl=(t=>(t[t.ETHEREUM=0]="ETHEREUM",t[t.ARBITRUM=1]="ARBITRUM",t))(wl||{});const rq={chainId:st.MAINNET,id:0,route:"",name:"Ethereum",bgColor:"#fc077d",primaryColor:"#fc077d",secondaryColor:"#2172E5"};st.MAINNET;var Wie={VITE_APP_URL_API:"https://api.godex.ai/api"};const nq=Wie.VITE_APP_URL_API;st.MAINNET+"",st.ARBITRUM_ONE+"",st.ARB_TESTNET+"";
2const zie=yne,Vie="0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",Hie="0x82af49447d8a07e3bd95bd0d56f35241523fbab1",iq=[Vie,Hie],Gie={[wl.ETHEREUM]:14292820,[wl.ARBITRUM]:175};class Kie{constructor(){Gt(this,"instance");Gt(this,"interceptor",null);const e=vb.create({baseURL:nq}),r=e.interceptors.response.use(n=>n.data,n=>(n.response&&n.response.status===401&&(localStorage.removeItem(qp),localStorage.removeItem(zh)),Promise.reject(n.response)));e.interceptors.request.use(n=>{const i=localStorage.getItem(qp);return i&&n.headers&&(n.headers.Authorization=`Bearer ${i}`),n},n=>Promise.reject(n.response)),this.interceptor=r,this.instance=e}get Instance(){return this.instance}useInterceptor(){if(this.interceptor===null){const e=this.instance.interceptors.response.use(r=>r.data,r=>Promise.reject(r.response));this.interceptor=e}}ejectInterceptor(){this.interceptor!==null&&(this.instance.interceptors.response.eject(this.interceptor),this.interceptor=null)}post(e,r,n){return this.useInterceptor(),this.Instance.post(e,r,n)}get(e,r){return this.useInterceptor(),this.Instance.get(e,r)}put(e,r,n){return this.useInterceptor(),this.Instance.put(e,r,n)}delete(e,r){return this.useInterceptor(),this.Instance.delete(e,r)}pull(e,r,n){return this.ejectInterceptor(),this.Instance.post(e,r,n)}}const Xe=new Kie,Qie={createNews:async({title:t,content:e,image:r,link:n,status:i})=>await Xe.post("/news/create",{title:t,content:e,image:r,link:n,status:i}),getNews:async()=>await Xe.get("/news"),getNewsById:async t=>await Xe.get(`/news/${t}`),updateNews:async({title:t,content:e,image:r,link:n,status:i,id:s})=>await Xe.put(`/news/update/${s}`,{title:t,content:e,image:r,link:n,status:i}),deleteNews:async t=>await Xe.delete(`/news/${t}`)};Pr("application/updateBlockNumber");const Yie=Pr("application/updateSubgraphStatus"),Zie=pn("application/news",async()=>{try{return Qie.getNews()}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),Xie=pn("application/level-criteria",async()=>{try{const t=await Xe.get("/partnership/level-criteria"),e=t.criteria.sort((r,n)=>r.level-n.level);return t.criteria=e,t}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}});Pr("application/setPrevUser");Pr("application/changeTab");Pr("application/updateViewDetail");Pr("application/changeIsHistory");const Jie={prevUser:null,blockNumber:{},subgraphStatus:{available:null,syncedBlock:void 0,headBlock:void 0},news:[],levelCriteria:null,tab:0,viewDetail:null,isHistory:!1},sq=os({name:"application",initialState:Jie,reducers:{updateBlockNumber(t,e){const{chainId:r,blockNumber:n}=e.payload;typeof t.blockNumber[r]!="number"?t.blockNumber[r]=n:t.blockNumber[r]=Math.max(n,t.blockNumber[r])},setPrevUser(t,e){const{address:r}=e.payload;t.prevUser=r},changeTab(t,e){const{render:r}=e.payload;t.tab=r},updateSubgraphStatus(t,e){const{available:r,syncedBlock:n,headBlock:i}=e.payload;t.subgraphStatus={available:r,syncedBlock:n,headBlock:i}},updateViewDetail(t,e){const{data:r}=e.payload;t.viewDetail=r},changeIsHistory(t,e){const{isHistory:r}=e.payload;t.isHistory=r}},extraReducers:t=>{t.addCase(Zie.fulfilled,(e,r)=>{const n=r.payload;e.news=n}),t.addCase(Xie.fulfilled,(e,r)=>{const n=r.payload;e.levelCriteria=n})}}),{updateBlockNumber:ese}=sq.actions,tse=sq.reducer,rse=/^0x[a-fA-F0-9]{40}$/,nse=/^0x[a-f0-9]*$/;function Vh(t){if(!rse.test(t.address))throw new Error(`Invalid address: ${t.address}`);if(!nse.test(t.callData))throw new Error(`Invalid hex: ${t.callData}`);return`${t.address}-${t.callData}`}function aq(t){const e=t.split("-");if(e.length!==2)throw new Error(`Invalid call key: ${t}`);return{address:e[0],callData:e[1]}}const oq=Pr("multicall/addMulticallListeners"),cq=Pr("multicall/removeMulticallListeners"),lq=Pr("multicall/fetchingMulticallResults"),uq=Pr("multicall/errorFetchingMulticallResults"),dq=Pr("multicall/updateMulticallResults"),ise={callResults:{}},sse=qw(ise,t=>t.addCase(oq,(e,{payload:{calls:r,chainId:n,options:{blocksPerFetch:i=1}={}}})=>{const s=e.callListeners?e.callListeners:e.callListeners={};s[n]=s[n]??{},r.forEach(a=>{const o=Vh(a);s[n][o]=s[n][o]??{},s[n][o][i]=(s[n][o][i]??0)+1})}).addCase(cq,(e,{payload:{chainId:r,calls:n,options:{blocksPerFetch:i=1}={}}})=>{const s=e.callListeners?e.callListeners:e.callListeners={};
2s[r]&&n.forEach(a=>{const o=Vh(a);s[r][o]&&s[r][o][i]&&(s[r][o][i]===1?delete s[r][o][i]:s[r][o][i]--)})}).addCase(lq,(e,{payload:{chainId:r,fetchingBlockNumber:n,calls:i}})=>{e.callResults[r]=e.callResults[r]??{},i.forEach(s=>{const a=Vh(s),o=e.callResults[r][a];if(!o)e.callResults[r][a]={fetchingBlockNumber:n};else{if((o.fetchingBlockNumber??0)>=n)return;e.callResults[r][a].fetchingBlockNumber=n}})}).addCase(uq,(e,{payload:{fetchingBlockNumber:r,chainId:n,calls:i}})=>{e.callResults[n]=e.callResults[n]??{},i.forEach(s=>{const a=Vh(s),o=e.callResults[n][a];o&&o.fetchingBlockNumber===r&&(delete o.fetchingBlockNumber,o.data=null,o.blockNumber=r)})}).addCase(dq,(e,{payload:{chainId:r,results:n,blockNumber:i}})=>{e.callResults[r]=e.callResults[r]??{},Object.keys(n).forEach(s=>{const a=e.callResults[r][s];((a==null?void 0:a.blockNumber)??0)>i||(e.callResults[r][s]={data:n[s],blockNumber:i})})})),ase={getVaultCopied:async()=>await Xe.get("/partnership/vault-copied"),getVaultCopiedById:async({id:t})=>await Xe.get(`partnership/vault-copied/${t}`),copyVault:async t=>Xe.post("/partnership/create-copy-vault",t),listFollower:async t=>Xe.get(`/partnership/subscriber/${t}`),getFollowerOfTheLeader:async t=>Xe.get(`/partnership/follower-of-the-leader${t?`?vault=${t}`:""}`),getFollowerOfTheVault:async t=>Xe.get(`/partnership/follower-of-the-vault/${t}`),vaultCopiedOverview:async t=>Xe.get(`/partnership/vault-copied-overview/${t}`),leadOverview:async()=>await Xe.get("/partnership/leader-overview"),statisticsData:async(t,e)=>Xe.post(`/partnership/orders/vault-copied/${e}`,{interval:t}),statisticsDataAccount:async(t,e)=>Xe.post(`/partnership/orders/account/${e}`,{interval:t}),profitByVaultCopied:async t=>Xe.get(`/partnership/profit/vault-copied/${t}`),followedCount:async()=>Xe.get("/partnership/followed-count")},fq={createVault:async({profitShare:t,minBalance:e,name:r,whales:n,stopLoss:i,takeProfit:s})=>(await Xe.post("/admin/create-vault",{profitShare:t,minBalance:e,name:r,whales:n,stopLoss:i,takeProfit:s})).whale,list:async()=>await Xe.get("/vault"),delete:async t=>{await Xe.delete(`/admin/whale/${t}`)},chartData:async(t,e)=>await Xe.post(`/vault/chart/${t}`,{time:e}),findVault:async({whaleId:t})=>await Xe.get(`/vault/${t}`),findVaultTrade:async({whaleId:t})=>await Xe.get(`/vault/trade/${t}`),getWhale:async t=>{const{whales:e}=await Xe.post("/admin/list-whale",t);return e},getVault:async()=>await Xe.get("/admin/list-vault"),getVaultById:async t=>await Xe.get(`/admin/vault/${t}`),createWhale:async t=>await Xe.post("admin/create-whale",t),editVault:async({profitShare:t,minBalance:e,name:r,whales:n,stopLoss:i,takeProfit:s},a)=>await Xe.put(`/admin/vault/${a}`,{profitShare:t,minBalance:e,name:r,whales:n,stopLoss:i,takeProfit:s})},ose=pn("vault/followerOfTheVault",async t=>{try{const{data:e,pnl7Days:r}=await ase.getFollowerOfTheVault(t);return{follower:e,vaultId:t,pnl7Days:r}}catch(e){throw Error((e==null?void 0:e.message)||"Redux: something error")}}),cse=pn("vault/router-address",async()=>{try{return await Xe.get("/partnership/router-address")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: getRouters something error")}}),lse=pn("vault/subscribers",async()=>{try{return await Xe.get("/partnership/count-subscribers")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),use=pn("vault/listVaultCopied",async()=>{try{return await Xe.get("/partnership/vault-copied")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),dse=pn("vault/fetchListFollowed",async()=>{try{return await Xe.get("/partnership/list-followed")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),g_=pn("vault/fetchVaultHistory",async()=>{try{return await fq.findVaultTrade({whaleId:"661f51d5aaeae9d2f951e562"})}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),fse={followOfTheVault:{},listFollowed:[],routers:[],vaultPnl:[],listVaultCopied:[],listHistory:[],countSubscribers:{}},hq=os({name:"vault",initialState:fse,reducers:{addRouterAddress(t,e){const r=e.payload;t.routers.includes(r)||(t.routers=[...t.routers,r])},vaultPnl(t,e){const r=e.payload;t.vaultPnl=[...t.vaultPnl,r]}},extraReducers:t=>{t.addCase(ose.fulfilled,(e,r)=>{const{follower:n,vaultId:i,pnl7Days:s}=r.payload,a=n.sort((o,c)=>(c.amountIn||0)-(o.amountIn||0));e.followOfTheVault[i]={follow:a,pnl7Days:s}}),t.addCase(cse.fulfilled,(e,r)=>{const n=r.payload;e.routers=n}),t.addCase(dse.fulfilled,(e,r)=>{const n=r.payload;e.listFollowed=n}),t.addCase(use.fulfilled,(e,r)=>{const n=r.payload;e.listVaultCopied=n}),t.addCase(lse.fulfilled,(e,r)=>{const n=r.payload;e.countSubscribers=n}),t.addCase(g_.fulfilled,(e,r)=>{const n=r.payload;e.listHistory=n})}}),{addRouterAddress:$tt}=hq.actions,hse=hq.reducer;var pq=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(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}}},hv=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},pse=Object.defineProperty,gse=Object.defineProperties,mse=Object.getOwnPropertyDescriptors,HI=Object.getOwnPropertySymbols,yse=Object.prototype.hasOwnProperty,bse=Object.prototype.propertyIsEnumerable,GI=function(t,e,r){return e in t?pse(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},wi=function(t,e){for(var r in e||(e={}))yse.call(e,r)&&GI(t,r,e[r]);if(HI)for(var n=0,i=HI(e);n<i.length;n++){var r=i[n];bse.call(e,r)&&GI(t,r,e[r])}return t},sl=function(t,e){return gse(t,mse(e))},gq=function(t,e,r){return new Promise(function(n,i){var s=function(c){try{o(r.next(c))}catch(l){i(l)}},a=function(c){try{o(r.throw(c))}catch(l){i(l)}},o=function(c){return c.done?n(c.value):Promise.resolve(c.value).then(s,a)};o((r=r.apply(t,e)).next())})},yn;(function(t){t.uninitialized="uninitialized",t.pending="pending",t.fulfilled="fulfilled",t.rejected="rejected"})(yn||(yn={}));function vse(t){return{status:t,isUninitialized:t===yn.uninitialized,isLoading:t===yn.pending,isSuccess:t===yn.fulfilled,isError:t===yn.rejected}}var KI=function(t){return[].concat.apply([],t)};function wse(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function Ese(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var QI=vl;function mq(t,e){if(t===e||!(QI(t)&&QI(e)||Array.isArray(t)&&Array.isArray(e)))return e;for(var r=Object.keys(e),n=Object.keys(t),i=r.length===n.length,s=Array.isArray(e)?[]:{},a=0,o=r;a<o.length;a++){var c=o[a];s[c]=mq(t[c],e[c]),i&&(i=t[c]===s[c])}return i?t:s}var YI=(function(){function t(e,r){r===void 0&&(r=void 0),this.value=e,this.meta=r}return t})(),DC=Pr("__rtkq/focused"),yq=Pr("__rtkq/unfocused"),MC=Pr("__rtkq/online"),bq=Pr("__rtkq/offline"),mc;(function(t){t.query="query",t.mutation="mutation"})(mc||(mc={}));function vq(t){return t.type===mc.query}function xse(t){return t.type===mc.mutation}function wq(t,e,r,n,i,s){return _se(t)?t(e,r,n,i).map(m_).map(s):Array.isArray(t)?t.map(m_).map(s):[]}function _se(t){return typeof t=="function"}function m_(t){return typeof t=="string"?{type:t}:t}function r6(t){return t!=null}var B1=Symbol("forceQueryFn"),y_=function(t){return typeof t[B1]=="function"};function Cse(t){var e=t.serializeQueryArgs,r=t.queryThunk,n=t.mutationThunk,i=t.api,s=t.context,a=new Map,o=new Map,c=i.internalActions,l=c.unsubscribeQueryResult,u=c.removeMutationResult,d=c.updateSubscriptionOptions;return{buildInitiateQuery:E,buildInitiateMutation:v,getRunningQueryThunk:g,getRunningMutationThunk:m,getRunningQueriesThunk:y,getRunningMutationsThunk:b,getRunningOperationPromises:h,removalWarning:f};function f(){throw new Error(`This method had to be removed due to a conceptual bug in RTK. 3 Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details. 4 See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function h(){{var w=function(x){return Array.from(x.values()).flatMap(function(_){return _?Object.values(_):[]})};return hv(hv([],w(a)),w(o)).filter(r6)}}function g(w,x){return function(_){var S,A=s.endpointDefinitions[w],I=e({queryArgs:x,endpointDefinition:A,endpointName:w});return(S=a.get(_))==null?void 0:S[I]}}function m(w,x){return function(_){var S;return(S=o.get(_))==null?void 0:S[x]}}function y(){return function(w){return Object.values(a.get(w)||{}).filter(r6)}}function b(){return function(w){return Object.values(o.get(w)||{}).filter(r6)}}function E(w,x){var _=function(S,A){var I=A===void 0?{}:A,$=I.subscribe,P=$===void 0?!0:$,j=I.forceRefetch,L=I.subscriptionOptions,B=B1,k=I[B];return function(D,q){var U,W,V=e({queryArgs:S,endpointDefinition:x,endpointName:w}),Y=r((U={type:"query",subscribe:P,forceRefetch:j,subscriptionOptions:L,endpointName:w,originalArgs:S,queryCacheKey:V},U[B1]=k,U)),K=i.endpoints[w].select(S),ge=D(Y),ae=K(q()),ce=ge.requestId,Q=ge.abort,se=ae.requestId!==ce,me=(W=a.get(D))==null?void 0:W[V],_e=function(){return K(q())},z=Object.assign(k?ge.then(_e):se&&!me?Promise.resolve(ae):Promise.all([me,ge]).then(_e),{arg:S,requestId:ce,subscriptionOptions:L,queryCacheKey:V,abort:Q,unwrap:function(){return gq(this,null,function(){var M;return pq(this,function(ee){switch(ee.label){case 0:return[4,z];case 1:if(M=ee.sent(),M.isError)throw M.error;return[2,M.data]}})})},refetch:function(){return D(_(S,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){P&&D(l({queryCacheKey:V,requestId:ce}))},updateSubscriptionOptions:function(M){z.subscriptionOptions=M,D(d({endpointName:w,requestId:ce,queryCacheKey:V,options:M}))}});if(!me&&!se&&!k){var R=a.get(D)||{};R[V]=z,a.set(D,R),z.then(function(){delete R[V],Object.keys(R).length||a.delete(D)})}return z}};return _}function v(w){return function(x,_){var S=_===void 0?{}:_,A=S.track,I=A===void 0?!0:A,$=S.fixedCacheKey;return function(P,j){var L=n({type:"mutation",endpointName:w,originalArgs:x,track:I,fixedCacheKey:$}),B=P(L),k=B.requestId,D=B.abort,q=B.unwrap,U=B.unwrap().then(function(K){return{data:K}}).catch(function(K){return{error:K}
4}),W=function(){P(u({requestId:k,fixedCacheKey:$}))},V=Object.assign(U,{arg:B.arg,requestId:k,abort:D,unwrap:q,unsubscribe:W,reset:W}),Y=o.get(P)||{};return o.set(P,Y),Y[k]=V,V.then(function(){delete Y[k],Object.keys(Y).length||o.delete(P)}),$&&(Y[$]=V,V.then(function(){Y[$]===V&&(delete Y[$],Object.keys(Y).length||o.delete(P))})),V}}}}function ZI(t){return t}function Sse(t){var e=this,r=t.reducerPath,n=t.baseQuery,i=t.context.endpointDefinitions,s=t.serializeQueryArgs,a=t.api,o=function(v,w,x){return function(_){var S=i[v];_(a.internalActions.queryResultPatched({queryCacheKey:s({queryArgs:w,endpointDefinition:S,endpointName:v}),patches:x}))}},c=function(v,w,x){return function(_,S){var A,I,$=a.endpoints[v].select(w)(S()),P={patches:[],inversePatches:[],undo:function(){return _(a.util.patchQueryData(v,w,P.inversePatches))}};if($.status===yn.uninitialized)return P;if("data"in $)if(vo($.data)){var j=IB($.data,x),L=j[1],B=j[2];(A=P.patches).push.apply(A,L),(I=P.inversePatches).push.apply(I,B)}else{var k=x($.data);P.patches.push({op:"replace",path:[],value:k}),P.inversePatches.push({op:"replace",path:[],value:$.data})}return _(a.util.patchQueryData(v,w,P.patches)),P}},l=function(v,w,x){return function(_){var S;return _(a.endpoints[v].initiate(w,(S={subscribe:!1,forceRefetch:!0},S[B1]=function(){return{data:x}},S)))}},u=function(v,w){return gq(e,[v,w],function(x,_){var S,A,I,$,P,j,L,B,k,D,q,U,W,V=_.signal,Y=_.abort,K=_.rejectWithValue,ge=_.fulfillWithValue,ae=_.dispatch,ce=_.getState,Q=_.extra;return pq(this,function(se){switch(se.label){case 0:S=i[x.endpointName],se.label=1;case 1:return se.trys.push([1,8,,13]),A=ZI,I=void 0,$={signal:V,abort:Y,dispatch:ae,getState:ce,extra:Q,endpoint:x.endpointName,type:x.type,forced:x.type==="query"?d(x,ce()):void 0},P=x.type==="query"?x[B1]:void 0,P?(I=P(),[3,6]):[3,2];case 2:return S.query?[4,n(S.query(x.originalArgs),$,S.extraOptions)]:[3,4];case 3:return I=se.sent(),S.transformResponse&&(A=S.transformResponse),[3,6];case 4:return[4,S.queryFn(x.originalArgs,$,S.extraOptions,function(me){return n(me,$,S.extraOptions)})];case 5:I=se.sent(),se.label=6;case 6:if(I.error)throw new YI(I.error,I.meta);return j=ge,[4,A(I.data,I.meta,x.originalArgs)];case 7:return[2,j.apply(void 0,[se.sent(),(U={fulfilledTimeStamp:Date.now(),baseQueryMeta:I.meta},U[Hd]=!0,U)])];case 8:if(L=se.sent(),B=L,!(B instanceof YI))return[3,12];k=ZI,S.query&&S.transformErrorResponse&&(k=S.transformErrorResponse),se.label=9;case 9:return se.trys.push([9,11,,12]),D=K,[4,k(B.value,B.meta,x.originalArgs)];case 10:return[2,D.apply(void 0,[se.sent(),(W={baseQueryMeta:B.meta},W[Hd]=!0,W)])];case 11:return q=se.sent(),B=q,[3,12];case 12:throw console.error(B),B;case 13:return[2]}})})};function d(v,w){var x,_,S,A,I=(_=(x=w[r])==null?void 0:x.queries)==null?void 0:_[v.queryCacheKey],$=(S=w[r])==null?void 0:S.config.refetchOnMountOrArgChange,P=I==null?void 0:I.fulfilledTimeStamp,j=(A=v.forceRefetch)!=null?A:v.subscribe&&$;return j?j===!0||(Number(new Date)-Number(P))/1e3>=j:!1}var f=pn(r+"/executeQuery",u,{getPendingMeta:function(){var v;return v={startedTimeStamp:Date.now()},v[Hd]=!0,v},condition:function(v,w){var x=w.getState,_,S,A,I=x(),$=(S=(_=I[r])==null?void 0:_.queries)==null?void 0:S[v.queryCacheKey],P=$==null?void 0:$.fulfilledTimeStamp,j=v.originalArgs,L=$==null?void 0:$.originalArgs,B=i[v.endpointName];return y_(v)?!0:($==null?void 0:$.status)==="pending"?!1:d(v,I)||vq(B)&&((A=B==null?void 0:B.forceRefetch)!=null&&A.call(B,{currentArg:j,previousArg:L,endpointState:$,state:I}))?!0:!P},dispatchConditionRejection:!0}),h=pn(r+"/executeMutation",u,{getPendingMeta:function(){var v;return v={startedTimeStamp:Date.now()},v[Hd]=!0,v}}),g=function(v){return"force"in v},m=function(v){return"ifOlderThan"in v},y=function(v,w,x){return function(_,S){var A=g(x)&&x.force,I=m(x)&&x.ifOlderThan,$=function(B){return B===void 0&&(B=!0),a.endpoints[v].initiate(w,{forceRefetch:B})},P=a.endpoints[v].select(w)(S());if(A)_($());else if(I){var j=P==null?void 0:P.fulfilledTimeStamp;if(!j){_($());return}var L=(Number(new Date)-Number(new Date(j)))/1e3>=I;L&&_($())}else _($(!1))}};function b(v){return function(w){var x,_;return((_=(x=w==null?void 0:w.meta)==null?void 0:x.arg)==null?void 0:_.endpointName)===v}}function E(v,w){return{matchPending:cp(Vw(v),b(w)),matchFulfilled:cp(id(v),b(w)),matchRejected:cp(Bp(v),b(w))}}return{queryThunk:f,mutationThunk:h,prefetch:y,updateQueryData:c,upsertQueryData:l,patchQueryData:o,buildMatchThunkActions:E}}function Eq(t,e,r,n){return wq(r[t.meta.arg.endpointName][e],id(t)?t.payload:void 0,uy(t)?t.payload:void 0,t.meta.arg.originalArgs,"baseQueryMeta"in t.meta?t.meta.baseQueryMeta:void 0,n)}function m2(t,e,r){var n=t[e];n&&r(n)}function q1(t){var e;return(e="arg"in t?t.arg.fixedCacheKey:t.fixedCacheKey)!=null?e:t.requestId}function XI(t,e,r){var n=t[q1(e)];n&&r(n)}var Z0={};function Ase(t){var e=t.reducerPath,r=t.queryThunk,n=t.mutationThunk,i=t.context,s=i.endpointDefinitions,a=i.apiUid,o=i.extractRehydrationInfo,c=i.hasRehydrationInfo,l=t.assertTagType,u=t.config,d=Pr(e+"/resetApiState"),f=os({name:e+"/queries",initialState:Z0,reducers:{removeQueryResult:{reducer:function(x,_){var S=_.payload.queryCacheKey;delete x[S]},prepare:p_()},queryResultPatched:function(x,_){var S=_.payload,A=S.queryCacheKey,I=S.patches;m2(x,A,function($){$.data=jI($.data,I.concat())})}},extraReducers:function(x){x.addCase(r.pending,function(_,S){var A=S.meta,I=S.meta.arg,$,P,j=y_(I);(I.subscribe||j)&&((P=_[$=I.queryCacheKey])!=null||(_[$]={status:yn.uninitialized,endpointName:I.endpointName})),m2(_,I.queryCacheKey,function(L){L.status=yn.pending,L.requestId=j&&L.requestId?L.requestId:A.requestId,I.originalArgs!==void 0&&(L.originalArgs=I.originalArgs),L.startedTimeStamp=A.startedTimeStamp})}).addCase(r.fulfilled,function(_,S){var A=S.meta,I=S.payload;m2(_,A.arg.queryCacheKey,function($){var P;if(!($.requestId!==A.requestId&&!y_(A.arg))){var j=s[A.arg.endpointName].merge;if($.status=yn.fulfilled,j)if($.data!==void 0){var L=A.fulfilledTimeStamp,B=A.arg,k=A.baseQueryMeta,D=A.requestId,q=Kf($.data,function(U){return j(U,I,{arg:B.originalArgs,baseQueryMeta:k,fulfilledTimeStamp:L,requestId:D})});$.data=q}else $.data=I;else $.data=(P=s[A.arg.endpointName].structuralSharing)==null||P?mq($.data,I):I;delete $.error,$.fulfilledTimeStamp=A.fulfilledTimeStamp}})}).addCase(r.rejected,function(_,S){var A=S.meta,I=A.condition,$=A.arg,P=A.requestId,j=S.error,L=S.payload;m2(_,$.queryCacheKey,function(B){if(!I){if(B.requestId!==P)return;B.status=yn.rejected,B.error=L??j}})}).addMatcher(c,function(_,S){for(var A=o(S).queries,I=0,$=Object.entries(A);I<$.length;I++){var P=$[I],j=P[0],L=P[1];((L==null?void 0:L.status)===yn.fulfilled||(L==null?void 0:L.status)===yn.rejected)&&(_[j]=L)}})}}),h=os({name:e+"/mutations",initialState:Z0,reducers:{removeMutationResult:{reducer:function(x,_){var S=_.payload,A=q1(S);A in x&&delete x[A]},prepare:p_()}},extraReducers:function(x){x.addCase(n.pending,function(_,S){var A=S.meta,I=S.meta,$=I.requestId,P=I.arg,j=I.startedTimeStamp;P.track&&(_[q1(A)]={requestId:$,status:yn.pending,endpointName:P.endpointName,startedTimeStamp:j})}).addCase(n.fulfilled,function(_,S){var A=S.payload,I=S.meta;I.arg.track&&XI(_,I,function($){$.requestId===I.requestId&&($.status=yn.fulfilled,$.data=A,$.fulfilledTimeStamp=I.fulfilledTimeStamp)})}).addCase(n.rejected,function(_,S){var A=S.payload,I=S.error,$=S.meta;$.arg.track&&XI(_,$,function(P){P.requestId===$.requestId&&(P.status=yn.rejected,P.error=A??I)})}).addMatcher(c,function(_,S){for(var A=o(S).mutations,I=0,$=Object.entries(A);I<$.length;I++){var P=$[I],j=P[0],L=P[1];((L==null?void 0:L.status)===yn.fulfilled||(L==null?void 0:L.status)===yn.rejected)&&j!==(L==null?void 0:L.requestId)&&(_[j]=L)}})}}),g=os({name:e+"/invalidation",initialState:Z0,reducers:{},extraReducers:function(x){x.addCase(f.actions.removeQueryResult,function(_,S){for(var A=S.payload.queryCacheKey,I=0,$=Object.values(_);I<$.length;I++)for(var P=$[I],j=0,L=Object.values(P);j<L.length;j++){var B=L[j],k=B.indexOf(A);k!==-1&&B.splice(k,1)}}).addMatcher(c,function(_,S){for(var A,I,$,P,j=o(S).provided,L=0,B=Object.entries(j);L<B.length;L++)for(var k=B[L],D=k[0],q=k[1],U=0,W=Object.entries(q);U<W.length;U++)for(var V=W[U],Y=V[0],K=V[1],ge=(P=(I=(A=_[D])!=null?A:_[D]={})[$=Y||"__internal_without_id"])!=null?P:I[$]=[],ae=0,ce=K;ae<ce.length;ae++){var Q=ce[ae],se=ge.includes(Q);se||ge.push(Q)}}).addMatcher(Qf(id(r),uy(r)),function(_,S){for(var A,I,$,P,j=Eq(S,"providesTags",s,l),L=S.meta.arg.queryCacheKey,B=0,k=Object.values(_);B<k.length;B++)for(var D=k[B],q=0,U=Object.values(D);q<U.length;q++){var W=U[q],V=W.indexOf(L);V!==-1&&W.splice(V,1)}for(var Y=0,K=j;Y<K.length;Y++){var ge=K[Y],ae=ge.type,ce=ge.id,Q=(P=(I=(A=_[ae])!=null?A:_[ae]={})[$=ce||"__internal_without_id"])!=null?P:I[$]=[],se=Q.includes(L);se||Q.push(L)}})}}),m=os({name:e+"/subscriptions",initialState:Z0,reducers:{updateSubscriptionOptions:function(x,_){},unsubscribeQueryResult:function(x,_){},internal_probeSubscription:function(x,_){}}}),y=os({name:e+"/internalSubscriptions",initialState:Z0,reducers:{subscriptionsUpdated:function(x,_){return jI(x,_.payload)}}}),b=os({name:e+"/config",initialState:wi({online:wse(),focused:Ese(),middlewareRegistered:!1},u),reducers:{middlewareRegistered:function(x,_){var S=_.payload;x.middlewareRegistered=x.middlewareRegistered==="conflict"||a!==S?"conflict":!0}},extraReducers:function(x){x.addCase(MC,function(_){_.online=!0}).addCase(bq,function(_){_.online=!1}).addCase(DC,function(_){_.focused=!0}).addCase(yq,function(_){_.focused=!1}).addMatcher(c,function(_){return wi({},_)})}}),E=_C({queries:f.reducer,mutations:h.reducer,provided:g.reducer,subscriptions:y.reducer,config:b.reducer}),v=function(x,_){return E(d.match(_)?void 0:x,_)},w=sl(wi(wi(wi(wi(wi({},b.actions),f.actions),m.actions),y.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:v,actions:w}}var Kd=Symbol.for("RTKQ/skipToken"),xq={status:yn.uninitialized},JI=Kf(xq,function(){}),ek=Kf(xq,function(){});function Tse(t){var e=t.serializeQueryArgs,r=t.reducerPath,n=function(u){return JI},i=function(u){return ek};return{buildQuerySelector:o,buildMutationSelector:c,selectInvalidatedBy:l};function s(u){return wi(wi({},u),vse(u.status))}function a(u){var d=u[r];return d}function o(u,d){return function(f){var h=e({queryArgs:f,endpointDefinition:d,endpointName:u}),g=function(y){var b,E,v;return(v=(E=(b=a(y))==null?void 0:b.queries)==null?void 0:E[h])!=null?v:JI},m=f===Kd?n:g;return ll(m,s)}}function c(){return function(u){var d,f;typeof u=="object"?f=(d=q1(u))!=null?d:Kd:f=u;var h=function(m){var y,b,E;return(E=(b=(y=a(m))==null?void 0:y.mutations)==null?void 0:b[f])!=null?E:ek},g=f===Kd?i:h;return ll(g,s)}}function l(u,d){for(var f,h=u[r],g=new Set,m=0,y=d.map(m_);m<y.length;m++){var b=y[m],E=h.provided[b.type];if(E)for(var v=(f=b.id!==void 0?E[b.id]:KI(Object.values(E)))!=null?f:[],w=0,x=v;w<x.length;w++){var _=x[w];g.add(_)}}return KI(Array.from(g.values()).map(function(S){var A=h.queries[S];return A?[{queryCacheKey:S,endpointName:A.endpointName,originalArgs:A.originalArgs}]:[]}))}}var y2=WeakMap?new WeakMap:void 0,tk=function(t){var e=t.endpointName,r=t.queryArgs,n="",i=y2==null?void 0:y2.get(r);if(typeof i=="string")n=i;else{var s=JSON.stringify(r,function(a,o){return vl(o)?Object.keys(o).sort().reduce(function(c,l){return c[l]=o[l],c},{}):o});vl(r)&&(y2==null||y2.set(r,s)),n=s}return e+"("+n+")"};function Ise(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){var i=uv(function(u){var d,f;return(f=n.extractRehydrationInfo)==null?void 0:f.call(n,u,{reducerPath:(d=n.reducerPath)!=null?d:"api"})}
4),s=sl(wi({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},n),{extractRehydrationInfo:i,serializeQueryArgs:function(u){var d=tk;if("serializeQueryArgs"in u.endpointDefinition){var f=u.endpointDefinition.serializeQueryArgs;d=function(h){var g=f(h);return typeof g=="string"?g:tk(sl(wi({},h),{queryArgs:g}))}}else n.serializeQueryArgs&&(d=n.serializeQueryArgs);return d(u)},tagTypes:hv([],n.tagTypes||[])}),a={endpointDefinitions:{},batch:function(u){u()},apiUid:Ww(),extractRehydrationInfo:i,hasRehydrationInfo:uv(function(u){return i(u)!=null})},o={injectEndpoints:l,enhanceEndpoints:function(u){var d=u.addTagTypes,f=u.endpoints;if(d)for(var h=0,g=d;h<g.length;h++){var m=g[h];s.tagTypes.includes(m)||s.tagTypes.push(m)}if(f)for(var y=0,b=Object.entries(f);y<b.length;y++){var E=b[y],v=E[0],w=E[1];typeof w=="function"?w(a.endpointDefinitions[v]):Object.assign(a.endpointDefinitions[v]||{},w)}return o}},c=t.map(function(u){return u.init(o,s,a)});function l(u){for(var d=u.endpoints({query:function(w){return sl(wi({},w),{type:mc.query})},mutation:function(w){return sl(wi({},w),{type:mc.mutation})}}),f=0,h=Object.entries(d);f<h.length;f++){var g=h[f],m=g[0],y=g[1];if(!(!u.overrideExisting&&m in a.endpointDefinitions)){a.endpointDefinitions[m]=y;for(var b=0,E=c;b<E.length;b++){var v=E[b];v.injectEndpoint(m,y)}}}return o}return o.injectEndpoints({endpoints:n.endpoints})}}function kse(t){for(var e in t)return!1;return!0}var $se=2147483647/1e3-1,Nse=function(t){var e=t.reducerPath,r=t.api,n=t.context,i=t.internalState,s=r.internalActions,a=s.removeQueryResult,o=s.unsubscribeQueryResult;function c(f){var h=i.currentSubscriptions[f];return!!h&&!kse(h)}var l={},u=function(f,h,g){var m;if(o.match(f)){var y=h.getState()[e],b=f.payload.queryCacheKey;d(b,(m=y.queries[b])==null?void 0:m.endpointName,h,y.config)}if(r.util.resetApiState.match(f))for(var E=0,v=Object.entries(l);E<v.length;E++){var w=v[E],x=w[0],_=w[1];_&&clearTimeout(_),delete l[x]}if(n.hasRehydrationInfo(f))for(var y=h.getState()[e],S=n.extractRehydrationInfo(f).queries,A=0,I=Object.entries(S);A<I.length;A++){var $=I[A],b=$[0],P=$[1];d(b,P==null?void 0:P.endpointName,h,y.config)}};function d(f,h,g,m){var y,b=n.endpointDefinitions[h],E=(y=b==null?void 0:b.keepUnusedDataFor)!=null?y:m.keepUnusedDataFor;if(E!==1/0){var v=Math.max(0,Math.min(E,$se));if(!c(f)){var w=l[f];w&&clearTimeout(w),l[f]=setTimeout(function(){c(f)||g.dispatch(a({queryCacheKey:f})),delete l[f]},v*1e3)}}}return u},Pse=function(t){var e=t.reducerPath,r=t.context,n=t.context.endpointDefinitions,i=t.mutationThunk,s=t.api,a=t.assertTagType,o=t.refetchQuery,c=s.internalActions.removeQueryResult,l=Qf(id(i),uy(i)),u=function(f,h){l(f)&&d(Eq(f,"invalidatesTags",n,a),h),s.util.invalidateTags.match(f)&&d(wq(f.payload,void 0,void 0,void 0,void 0,a),h)};function d(f,h){var g=h.getState(),m=g[e],y=s.util.selectInvalidatedBy(g,f);r.batch(function(){for(var b,E=Array.from(y.values()),v=0,w=E;v<w.length;v++){var x=w[v].queryCacheKey,_=m.queries[x],S=(b=m.subscriptions[x])!=null?b:{};_&&(Object.keys(S).length===0?h.dispatch(c({queryCacheKey:x})):_.status!==yn.uninitialized&&h.dispatch(o(_,x)))}})}return u},Ose=function(t){var e=t.reducerPath,r=t.queryThunk,n=t.api,i=t.refetchQuery,s=t.internalState,a={},o=function(h,g){(n.internalActions.updateSubscriptionOptions.match(h)||n.internalActions.unsubscribeQueryResult.match(h))&&l(h.payload,g),(r.pending.match(h)||r.rejected.match(h)&&h.meta.condition)&&l(h.meta.arg,g),(r.fulfilled.match(h)||r.rejected.match(h)&&!h.meta.condition)&&c(h.meta.arg,g),n.util.resetApiState.match(h)&&d()};function c(h,g){var m=h.queryCacheKey,y=g.getState()[e],b=y.queries[m],E=s.currentSubscriptions[m];if(!(!b||b.status===yn.uninitialized)){var v=f(E);if(Number.isFinite(v)){var w=a[m];w!=null&&w.timeout&&(clearTimeout(w.timeout),w.timeout=void 0);var x=Date.now()+v,_=a[m]={nextPollTimestamp:x,pollingInterval:v,timeout:setTimeout(function(){_.timeout=void 0,g.dispatch(i(b,m))},v)}}}}function l(h,g){var m=h.queryCacheKey,y=g.getState()[e],b=y.queries[m],E=s.currentSubscriptions[m];if(!(!b||b.status===yn.uninitialized)){var v=f(E);if(!Number.isFinite(v)){u(m);return}var w=a[m],x=Date.now()+v;(!w||x<w.nextPollTimestamp)&&c({queryCacheKey:m},g)}}function u(h){var g=a[h];g!=null&&g.timeout&&clearTimeout(g.timeout),delete a[h]}function d(){for(var h=0,g=Object.keys(a);h<g.length;h++){var m=g[h];u(m)}}function f(h){h===void 0&&(h={});var g=Number.POSITIVE_INFINITY;for(var m in h)h[m].pollingInterval&&(g=Math.min(h[m].pollingInterval,g));return g}return o},Rse=function(t){var e=t.reducerPath,r=t.context,n=t.api,i=t.refetchQuery,s=t.internalState,a=n.internalActions.removeQueryResult,o=function(l,u){DC.match(l)&&c(u,"refetchOnFocus"),MC.match(l)&&c(u,"refetchOnReconnect")};function c(l,u){var d=l.getState()[e],f=d.queries,h=s.currentSubscriptions;r.batch(function(){for(var g=0,m=Object.keys(h);g<m.length;g++){var y=m[g],b=f[y],E=h[y];if(!(!E||!b)){var v=Object.values(E).some(function(w){return w[u]===!0})||Object.values(E).every(function(w){return w[u]===void 0})&&d.config[u];v&&(Object.keys(E).length===0?l.dispatch(a({queryCacheKey:y})):b.status!==yn.uninitialized&&l.dispatch(i(b,y)))}}})}return o},rk=new Error("Promise never resolved before cacheEntryRemoved."),Dse=function(t){var e=t.api,r=t.reducerPath,n=t.context,i=t.queryThunk,s=t.mutationThunk;t.internalState;var a=dv(i),o=dv(s),c=id(i,s),l={},u=function(h,g,m){var y=d(h);if(i.pending.match(h)){var b=m[r].queries[y],E=g.getState()[r].queries[y];!b&&E&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,y,g,h.meta.requestId)}else if(s.pending.match(h)){var E=g.getState()[r].mutations[y];E&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,y,g,h.meta.requestId)}else if(c(h)){var v=l[y];v!=null&&v.valueResolved&&(v.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete v.valueResolved)}else if(e.internalActions.removeQueryResult.match(h)||e.internalActions.removeMutationResult.match(h)){var v=l[y];v&&(delete l[y],v.cacheEntryRemoved())}else if(e.util.resetApiState.match(h))for(var w=0,x=Object.entries(l);w<x.length;w++){var _=x[w],S=_[0],v=_[1];delete l[S],v.cacheEntryRemoved()}};function d(h){return a(h)?h.meta.arg.queryCacheKey:o(h)?h.meta.requestId:e.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:e.internalActions.removeMutationResult.match(h)?q1(h.payload):""}function f(h,g,m,y,b){var E=n.endpointDefinitions[h],v=E==null?void 0:E.onCacheEntryAdded;if(v){var w={},x=new Promise(function(P){w.cacheEntryRemoved=P}),_=Promise.race([new Promise(function(P){w.valueResolved=P}),x.then(function(){throw rk})]);_.catch(function(){}),l[m]=w;var S=e.endpoints[h].select(E.type===mc.query?g:m),A=y.dispatch(function(P,j,L){return L}),I=sl(wi({},y),{getCacheEntry:function(){return S(y.getState())}
4,requestId:b,extra:A,updateCachedData:E.type===mc.query?function(P){return y.dispatch(e.util.updateQueryData(h,g,P))}:void 0,cacheDataLoaded:_,cacheEntryRemoved:x}),$=v(g,I);Promise.resolve($).catch(function(P){if(P!==rk)throw P})}}return u},Mse=function(t){var e=t.api,r=t.context,n=t.queryThunk,i=t.mutationThunk,s=Vw(n,i),a=Bp(n,i),o=id(n,i),c={},l=function(u,d){var f,h,g;if(s(u)){var m=u.meta,y=m.requestId,b=m.arg,E=b.endpointName,v=b.originalArgs,w=r.endpointDefinitions[E],x=w==null?void 0:w.onQueryStarted;if(x){var _={},S=new Promise(function(k,D){_.resolve=k,_.reject=D});S.catch(function(){}),c[y]=_;var A=e.endpoints[E].select(w.type===mc.query?v:y),I=d.dispatch(function(k,D,q){return q}),$=sl(wi({},d),{getCacheEntry:function(){return A(d.getState())},requestId:y,extra:I,updateCachedData:w.type===mc.query?function(k){return d.dispatch(e.util.updateQueryData(E,v,k))}:void 0,queryFulfilled:S});x(v,$)}}else if(o(u)){var P=u.meta,y=P.requestId,j=P.baseQueryMeta;(f=c[y])==null||f.resolve({data:u.payload,meta:j}),delete c[y]}else if(a(u)){var L=u.meta,y=L.requestId,B=L.rejectedWithValue,j=L.baseQueryMeta;(g=c[y])==null||g.reject({error:(h=u.payload)!=null?h:u.error,isUnhandledError:!B,meta:j}),delete c[y]}};return l},jse=function(t){var e=t.api,r=t.context.apiUid;return t.reducerPath,function(n,i){e.util.resetApiState.match(n)&&i.dispatch(e.internalActions.middlewareRegistered(r))}},nk,Lse=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(nk||(nk=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Fse=function(t){var e=t.api,r=t.queryThunk,n=t.internalState,i=e.reducerPath+"/subscriptions",s=null,a=!1,o=e.internalActions,c=o.updateSubscriptionOptions,l=o.unsubscribeQueryResult,u=function(d,f){var h,g,m,y,b,E,v,w,x;if(c.match(f)){var _=f.payload,S=_.queryCacheKey,A=_.requestId,I=_.options;return(h=d==null?void 0:d[S])!=null&&h[A]&&(d[S][A]=I),!0}if(l.match(f)){var $=f.payload,S=$.queryCacheKey,A=$.requestId;return d[S]&&delete d[S][A],!0}if(e.internalActions.removeQueryResult.match(f))return delete d[f.payload.queryCacheKey],!0;if(r.pending.match(f)){var P=f.meta,j=P.arg,A=P.requestId;if(j.subscribe){var L=(m=d[g=j.queryCacheKey])!=null?m:d[g]={};return L[A]=(b=(y=j.subscriptionOptions)!=null?y:L[A])!=null?b:{},!0}}if(r.rejected.match(f)){var B=f.meta,k=B.condition,j=B.arg,A=B.requestId;if(k&&j.subscribe){var L=(v=d[E=j.queryCacheKey])!=null?v:d[E]={};return L[A]=(x=(w=j.subscriptionOptions)!=null?w:L[A])!=null?x:{},!0}}return!1};return function(d,f){var h,g;if(s||(s=JSON.parse(JSON.stringify(n.currentSubscriptions))),e.internalActions.internal_probeSubscription.match(d)){var m=d.payload,y=m.queryCacheKey,b=m.requestId,E=!!((h=n.currentSubscriptions[y])!=null&&h[b]);return[!1,E]}var v=u(n.currentSubscriptions,d);if(v){a||(Lse(function(){var S=JSON.parse(JSON.stringify(n.currentSubscriptions)),A=IB(s,function(){return S}),I=A[1];f.next(e.internalActions.subscriptionsUpdated(I)),s=S,a=!1}),a=!0);var w=!!((g=d.type)!=null&&g.startsWith(i)),x=r.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,_=!w&&!x;return[_,!1]}return[!0,!1]}};function Use(t){var e=t.reducerPath,r=t.queryThunk,n=t.api,i=t.context,s=i.apiUid,a={invalidateTags:Pr(e+"/invalidateTags")},o=function(d){return!!d&&typeof d.type=="string"&&d.type.startsWith(e+"/")},c=[jse,Nse,Pse,Ose,Dse,Mse],l=function(d){var f=!1,h={currentSubscriptions:{}},g=sl(wi({},t),{internalState:h,refetchQuery:u}),m=c.map(function(E){return E(g)}),y=Fse(g),b=Rse(g);return function(E){return function(v){f||(f=!0,d.dispatch(n.internalActions.middlewareRegistered(s)));var w=sl(wi({},d),{next:E}),x=d.getState(),_=y(v,w,x),S=_[0],A=_[1],I;if(S?I=E(v):I=A,d.getState()[e]&&(b(v,w,x),o(v)||i.hasRehydrationInfo(v)))for(var $=0,P=m;$<P.length;$++){var j=P[$];j(v,w,x)}return I}}};return{middleware:l,actions:a};function u(d,f,h){return h===void 0&&(h={}),r(wi({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f},h))}}function Gl(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];Object.assign.apply(Object,hv([t],e))}var ik=Symbol(),Bse=function(){return{name:ik,init:function(t,e,r){var n=e.baseQuery;e.tagTypes;
4var i=e.reducerPath,s=e.serializeQueryArgs,a=e.keepUnusedDataFor,o=e.refetchOnMountOrArgChange,c=e.refetchOnFocus,l=e.refetchOnReconnect;Bne();var u=function(K){return K};Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:MC,onOffline:bq,onFocus:DC,onFocusLost:yq},util:{}});var d=Sse({baseQuery:n,reducerPath:i,context:r,api:t,serializeQueryArgs:s}),f=d.queryThunk,h=d.mutationThunk,g=d.patchQueryData,m=d.updateQueryData,y=d.upsertQueryData,b=d.prefetch,E=d.buildMatchThunkActions,v=Ase({context:r,queryThunk:f,mutationThunk:h,reducerPath:i,assertTagType:u,config:{refetchOnFocus:c,refetchOnReconnect:l,refetchOnMountOrArgChange:o,keepUnusedDataFor:a,reducerPath:i}}),w=v.reducer,x=v.actions;Gl(t.util,{patchQueryData:g,updateQueryData:m,upsertQueryData:y,prefetch:b,resetApiState:x.resetApiState}),Gl(t.internalActions,x);var _=Use({reducerPath:i,context:r,queryThunk:f,mutationThunk:h,api:t,assertTagType:u}),S=_.middleware,A=_.actions;Gl(t.util,A),Gl(t,{reducer:w,middleware:S});var I=Tse({serializeQueryArgs:s,reducerPath:i}),$=I.buildQuerySelector,P=I.buildMutationSelector,j=I.selectInvalidatedBy;Gl(t.util,{selectInvalidatedBy:j});var L=Cse({queryThunk:f,mutationThunk:h,api:t,serializeQueryArgs:s,context:r}),B=L.buildInitiateQuery,k=L.buildInitiateMutation,D=L.getRunningMutationThunk,q=L.getRunningMutationsThunk,U=L.getRunningQueriesThunk,W=L.getRunningQueryThunk,V=L.getRunningOperationPromises,Y=L.removalWarning;return Gl(t.util,{getRunningOperationPromises:V,getRunningOperationPromise:Y,getRunningMutationThunk:D,getRunningMutationsThunk:q,getRunningQueryThunk:W,getRunningQueriesThunk:U}),{name:ik,injectEndpoint:function(K,ge){var ae,ce,Q=t;(ce=(ae=Q.endpoints)[K])!=null||(ae[K]={}),vq(ge)?Gl(Q.endpoints[K],{name:K,select:$(K,ge),initiate:B(K,ge)},E(f,K)):xse(ge)&&Gl(Q.endpoints[K],{name:K,select:P(),initiate:k(K)},E(h,K))}}}}},qse=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},Wse=Object.defineProperty,zse=Object.defineProperties,Vse=Object.getOwnPropertyDescriptors,sk=Object.getOwnPropertySymbols,Hse=Object.prototype.hasOwnProperty,Gse=Object.prototype.propertyIsEnumerable,ak=function(t,e,r){return e in t?Wse(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},Wc=function(t,e){for(var r in e||(e={}))Hse.call(e,r)&&ak(t,r,e[r]);if(sk)for(var n=0,i=sk(e);n<i.length;n++){var r=i[n];Gse.call(e,r)&&ak(t,r,e[r])}return t},xb=function(t,e){return zse(t,Vse(e))};function ok(t,e,r,n){var i=C.useMemo(function(){return{queryArgs:t,serialized:typeof t=="object"?e({queryArgs:t,endpointDefinition:r,endpointName:n}):t}},[t,e,r,n]),s=C.useRef(i);return C.useEffect(function(){s.current.serialized!==i.serialized&&(s.current=i)},[i]),s.current.serialized===i.serialized?s.current.queryArgs:t}var n6=Symbol();function i6(t){var e=C.useRef(t);return C.useEffect(function(){iv(e.current,t)||(e.current=t)},[t]),iv(e.current,t)?e.current:t}var b2=WeakMap?new WeakMap:void 0,Kse=function(t){var e=t.endpointName,r=t.queryArgs,n="",i=b2==null?void 0:b2.get(r);if(typeof i=="string")n=i;else{var s=JSON.stringify(r,function(a,o){return vl(o)?Object.keys(o).sort().reduce(function(c,l){return c[l]=o[l],c},{}):o});vl(r)&&(b2==null||b2.set(r,s)),n=s}return e+"("+n+")"},Qse=typeof window<"u"&&window.document&&window.document.createElement?C.useLayoutEffect:C.useEffect,Yse=function(t){return t},Zse=function(t){return t.isUninitialized?xb(Wc({},t),{isUninitialized:!1,isFetching:!0,isLoading:t.data===void 0,status:yn.pending}):t};function Xse(t){var e=t.api,r=t.moduleOptions,n=r.batch,i=r.useDispatch,s=r.useSelector,a=r.useStore,o=r.unstable__sideEffectsInRender,c=t.serializeQueryArgs,l=t.context,u=o?function(m){return m()}:C.useEffect;return{buildQueryHooks:h,buildMutationHook:g,usePrefetch:f};function d(m,y,b){if(y!=null&&y.endpointName&&m.isUninitialized){var E=y.endpointName,v=l.endpointDefinitions[E];c({queryArgs:y.originalArgs,endpointDefinition:v,endpointName:E})===c({queryArgs:b,endpointDefinition:v,endpointName:E})&&(y=void 0)}var w=m.isSuccess?m.data:y==null?void 0:y.data;w===void 0&&(w=m.data);var x=w!==void 0,_=m.isLoading,S=!x&&_,A=m.isSuccess||_&&x;return xb(Wc({},m),{data:w,currentData:m.data,isFetching:_,isLoading:S,isSuccess:A})}function f(m,y){var b=i(),E=i6(y);return C.useCallback(function(v,w){return b(e.util.prefetch(m,v,Wc(Wc({},E),w)))},[m,b,E])}function h(m){var y=function(v,w){var x=w===void 0?{}:w,_=x.refetchOnReconnect,S=x.refetchOnFocus,A=x.refetchOnMountOrArgChange,I=x.skip,$=I===void 0?!1:I,P=x.pollingInterval,j=P===void 0?0:P,L=e.endpoints[m].initiate,B=i(),k=ok($?Kd:v,Kse,l.endpointDefinitions[m],m),D=i6({refetchOnReconnect:_,refetchOnFocus:S,pollingInterval:j}),q=C.useRef(!1),U=C.useRef(),W=U.current||{},V=W.queryCacheKey,Y=W.requestId,K=!1;if(V&&Y){var ge=B(e.internalActions.internal_probeSubscription({queryCacheKey:V,requestId:Y}));K=!!ge}var ae=!K&&q.current;return u(function(){q.current=K}),u(function(){ae&&(U.current=void 0)},[ae]),u(function(){var ce,Q=U.current;if(k===Kd){Q==null||Q.unsubscribe(),U.current=void 0;return}var se=(ce=U.current)==null?void 0:ce.subscriptionOptions;if(!Q||Q.arg!==k){Q==null||Q.unsubscribe();var me=B(L(k,{subscriptionOptions:D,forceRefetch:A}));U.current=me}else D!==se&&Q.updateSubscriptionOptions(D)},[B,L,A,k,D,ae]),C.useEffect(function(){return function(){var ce;(ce=U.current)==null||ce.unsubscribe(),U.current=void 0}},[]),C.useMemo(function(){return{refetch:function(){var ce;if(!U.current)throw new Error("Cannot refetch a query that has not been started yet.");return(ce=U.current)==null?void 0:ce.refetch()}}},[])},b=function(v){var w=v===void 0?{}:v,x=w.refetchOnReconnect,_=w.refetchOnFocus,S=w.pollingInterval,A=S===void 0?0:S,I=e.endpoints[m].initiate,$=i(),P=C.useState(n6),j=P[0],L=P[1],B=C.useRef(),k=i6({refetchOnReconnect:x,refetchOnFocus:_,pollingInterval:A});u(function(){var U,W,V=(U=B.current)==null?void 0:U.subscriptionOptions;k!==V&&((W=B.current)==null||W.updateSubscriptionOptions(k))},[k]);var D=C.useRef(k);u(function(){D.current=k},[k]);var q=C.useCallback(function(U,W){W===void 0&&(W=!1);var V;return n(function(){var Y;(Y=B.current)==null||Y.unsubscribe(),B.current=V=$(I(U,{subscriptionOptions:D.current,forceRefetch:!W})),L(U)}),V},[$,I]);return C.useEffect(function(){return function(){var U;(U=B==null?void 0:B.current)==null||U.unsubscribe()}},[]),C.useEffect(function(){j!==n6&&!B.current&&q(j,!0)},[j,q]),C.useMemo(function(){return[q,j]},[q,j])},E=function(v,w){var x=w===void 0?{}:w,_=x.skip,S=_===void 0?!1:_,A=x.selectFromResult,I=e.endpoints[m].select,$=ok(S?Kd:v,c,l.endpointDefinitions[m],m),P=C.useRef(),j=C.useMemo(function(){return ll([I($),function(q,U){return U},function(q){return $}],d)},[I,$]),L=C.useMemo(function(){return A?ll([j],A):j},[j,A]),B=s(function(q){return L(q,P.current)},iv),k=a(),D=j(k.getState(),P.current);return Qse(function(){P.current=D},[D]),B};return{useQueryState:E,useQuerySubscription:y,useLazyQuerySubscription:b,useLazyQuery:function(v){var w=b(v),x=w[0],_=w[1],S=E(_,xb(Wc({},v),{skip:_===n6})),A=C.useMemo(function(){return{lastArg:_}},[_]);return C.useMemo(function(){return[x,S,A]},[x,S,A])},useQuery:function(v,w){var x=y(v,w),_=E(v,Wc({selectFromResult:v===Kd||w!=null&&w.skip?void 0:Zse},w)),S=_.data,A=_.status,I=_.isLoading,$=_.isSuccess,P=_.isError,j=_.error;return C.useDebugValue({data:S,status:A,isLoading:I,isSuccess:$,isError:P,error:j}),C.useMemo(function(){return Wc(Wc({},_),x)},[_,x])}}}function g(m){return function(y){var b=y===void 0?{}:y,E=b.selectFromResult,v=E===void 0?Yse:E,w=b.fixedCacheKey,x=e.endpoints[m],_=x.select,S=x.initiate,A=i(),I=C.useState(),$=I[0],P=I[1];C.useEffect(function(){return function(){$!=null&&$.arg.fixedCacheKey||$==null||$.reset()}},[$]);var j=C.useCallback(function(Q){var se=A(S(Q,{fixedCacheKey:w}));return P(se),se},[A,S,w]),L=($||{}).requestId,B=C.useMemo(function(){return ll([_({fixedCacheKey:w,requestId:$==null?void 0:$.requestId})],v)},[_,$,v,w]),k=s(B,iv),D=w==null?$==null?void 0:$.arg.originalArgs:void 0,q=C.useCallback(function(){n(function(){$&&P(void 0),w&&A(e.internalActions.removeMutationResult({requestId:L,fixedCacheKey:w}))})}
4,[A,w,$,L]),U=k.endpointName,W=k.data,V=k.status,Y=k.isLoading,K=k.isSuccess,ge=k.isError,ae=k.error;C.useDebugValue({endpointName:U,data:W,status:V,isLoading:Y,isSuccess:K,isError:ge,error:ae});var ce=C.useMemo(function(){return xb(Wc({},k),{originalArgs:D,reset:q})},[k,D,q]);return C.useMemo(function(){return[j,ce]},[j,ce])}}}var pv;(function(t){t.query="query",t.mutation="mutation"})(pv||(pv={}));function Jse(t){return t.type===pv.query}function eae(t){return t.type===pv.mutation}function s6(t){return t.replace(t[0],t[0].toUpperCase())}function v2(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];Object.assign.apply(Object,qse([t],e))}var tae=Symbol(),rae=function(t){var e={},r=e.batch,n=r===void 0?bl.unstable_batchedUpdates:r,i=e.useDispatch,s=i===void 0?Gf:i,a=e.useSelector,o=a===void 0?g0:a,c=e.useStore,l=c===void 0?ene:c,u=e.unstable__sideEffectsInRender,d=u===void 0?!1:u;return{name:tae,init:function(f,h,g){var m=h.serializeQueryArgs,y=f,b=Xse({api:f,moduleOptions:{batch:n,useDispatch:s,useSelector:o,useStore:l,unstable__sideEffectsInRender:d},serializeQueryArgs:m,context:g}),E=b.buildQueryHooks,v=b.buildMutationHook,w=b.usePrefetch;return v2(y,{usePrefetch:w}),v2(g,{batch:n}),{injectEndpoint:function(x,_){if(Jse(_)){var S=E(x),A=S.useQuery,I=S.useLazyQuery,$=S.useLazyQuerySubscription,P=S.useQueryState,j=S.useQuerySubscription;v2(y.endpoints[x],{useQuery:A,useLazyQuery:I,useLazyQuerySubscription:$,useQueryState:P,useQuerySubscription:j}),f["use"+s6(x)+"Query"]=A,f["useLazy"+s6(x)+"Query"]=I}else if(eae(_)){var L=v(x);v2(y.endpoints[x],{useMutation:L}),f["use"+s6(x)+"Mutation"]=L}}}}}},nae=Ise(Bse(),rae());const _b=t=>Object.entries(t).filter(([,e])=>e!==""&&e!==void 0&&e!==null).map(([e,r])=>`${encodeURIComponent(e)}=${encodeURIComponent(r===!1?"false":r===""?null:r)}`).join("&");var a6={exports:{}},wd={};const Ys=m0(Uie);var o6={exports:{}},an={},ck;function iae(){if(ck)return an;ck=1;function t(O){for(var T=arguments.length,N=Array(T>1?T-1:0),G=1;G<T;G++)N[G-1]=arguments[G];throw Error("[Immer] minified error nr: "+O+(N.length?" "+N.map((function(te){return"'"+te+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function e(O){return!!O&&!!O[z]}function r(O){var T;return!!O&&((function(N){if(!N||typeof N!="object")return!1;var G=Object.getPrototypeOf(N);if(G===null)return!0;var te=Object.hasOwnProperty.call(G,"constructor")&&G.constructor;return te===Object||typeof te=="function"&&Function.toString.call(te)===M})(O)||Array.isArray(O)||!!O[_e]||!!(!((T=O.constructor)===null||T===void 0)&&T[_e])||l(O)||u(O))}function n(O,T,N){N===void 0&&(N=!1),i(O)===0?(N?Object.keys:ee)(O).forEach((function(G){N&&typeof G=="symbol"||T(G,O[G],O)})):O.forEach((function(G,te){return T(te,G,O)}))}function i(O){var T=O[z];return T?T.t>3?T.t-4:T.t:Array.isArray(O)?1:l(O)?2:u(O)?3:0}function s(O,T){return i(O)===2?O.has(T):Object.prototype.hasOwnProperty.call(O,T)}function a(O,T){return i(O)===2?O.get(T):O[T]}function o(O,T,N){var G=i(O);G===2?O.set(T,N):G===3?O.add(N):O[T]=N}function c(O,T){return O===T?O!==0||1/O==1/T:O!=O&&T!=T}function l(O){return ce&&O instanceof Map}function u(O){return Q&&O instanceof Set}function d(O){return O.i||O.u}function f(O){if(Array.isArray(O))return Array.prototype.slice.call(O);var T=ie(O);delete T[z];for(var N=ee(T),G=0;G<N.length;G++){var te=N[G],ue=T[te];ue.writable===!1&&(ue.writable=!0,ue.configurable=!0),(ue.get||ue.set)&&(T[te]={configurable:!0,writable:!0,enumerable:ue.enumerable,value:O[te]})}return Object.create(Object.getPrototypeOf(O),T)}function h(O,T){return T===void 0&&(T=!1),m(O)||e(O)||!r(O)||(i(O)>1&&(O.set=O.add=O.clear=O.delete=g),Object.freeze(O),T&&n(O,(function(N,G){return h(G,!0)}),!0)),O}function g(){t(2)}function m(O){return O==null||typeof O!="object"||Object.isFrozen(O)}function y(O){var T=le[O];return T||t(18,O),T}function b(O,T){le[O]||(le[O]=T)}function E(){return ge}function v(O,T){T&&(y("Patches"),O.o=[],O.v=[],O.s=T)}function w(O){x(O),O.p.forEach(S),O.p=null}function x(O){O===ge&&(ge=O.l)}function _(O){return ge={p:[],l:ge,h:O,_:!0,m:0}}function S(O){var T=O[z];T.t===0||T.t===1?T.j():T.O=!0}function A(O,T){T.m=T.p.length;var N=T.p[0],G=O!==void 0&&O!==N;return T.h.S||y("ES5").P(T,O,G),G?(N[z].g&&(w(T),t(4)),r(O)&&(O=I(T,O),T.l||P(T,O)),T.o&&y("Patches").M(N[z].u,O,T.o,T.v)):O=I(T,N,[]),w(T),T.o&&T.s(T.o,T.v),O!==me?O:void 0}function I(O,T,N){if(m(T))return T;var G=T[z];if(!G)return n(T,(function(Ie,je){return $(O,G,T,Ie,je,N)}),!0),T;if(G.A!==O)return T;if(!G.g)return P(O,G.u,!0),G.u;if(!G.R){G.R=!0,G.A.m--;var te=G.t===4||G.t===5?G.i=f(G.k):G.i,ue=te,pe=!1;G.t===3&&(ue=new Set(te),te.clear(),pe=!0),n(ue,(function(Ie,je){return $(O,G,te,Ie,je,N,pe)})),P(O,te,!1),N&&O.o&&y("Patches").F(G,N,O.o,O.v)}return G.i}function $(O,T,N,G,te,ue,pe){if(e(te)){var Ie=I(O,te,ue&&T&&T.t!==3&&!s(T.N,G)?ue.concat(G):void 0);if(o(N,G,Ie),!e(Ie))return;O._=!1}else pe&&N.add(te);
4if(r(te)&&!m(te)){if(!O.h.D&&O.m<1)return;I(O,te),T&&T.A.l||P(O,te)}}function P(O,T,N){N===void 0&&(N=!1),!O.l&&O.h.D&&O._&&h(T,N)}function j(O,T){var N=O[z];return(N?d(N):O)[T]}function L(O,T){if(T in O)for(var N=Object.getPrototypeOf(O);N;){var G=Object.getOwnPropertyDescriptor(N,T);if(G)return G;N=Object.getPrototypeOf(N)}}function B(O){O.g||(O.g=!0,O.l&&B(O.l))}function k(O){O.i||(O.i=f(O.u))}function D(O,T,N){var G=l(T)?y("MapSet").K(T,N):u(T)?y("MapSet").$(T,N):O.S?(function(te,ue){var pe=Array.isArray(te),Ie={t:pe?1:0,A:ue?ue.A:E(),g:!1,R:!1,N:{},l:ue,u:te,k:null,i:null,j:null,C:!1},je=Ie,Te=ye;pe&&(je=[Ie],Te=fe);var ve=Proxy.revocable(je,Te),Oe=ve.revoke,at=ve.proxy;return Ie.k=at,Ie.j=Oe,at})(T,N):y("ES5").I(T,N);return(N?N.A:E()).p.push(G),G}function q(O){return e(O)||t(22,O),(function T(N){if(!r(N))return N;var G,te=N[z],ue=i(N);if(te){if(!te.g&&(te.t<4||!y("ES5").J(te)))return te.u;te.R=!0,G=U(N,ue),te.R=!1}else G=U(N,ue);return n(G,(function(pe,Ie){te&&a(te.u,pe)===Ie||o(G,pe,T(Ie))})),ue===3?new Set(G):G})(O)}function U(O,T){switch(T){case 2:return new Map(O);case 3:return Array.from(O)}return f(O)}function W(){function O(ue,pe){var Ie=te[ue];return Ie?Ie.enumerable=pe:te[ue]=Ie={configurable:!0,enumerable:pe,get:function(){return ye.get(this[z],ue)},set:function(je){ye.set(this[z],ue,je)}},Ie}function T(ue){for(var pe=ue.length-1;pe>=0;pe--){var Ie=ue[pe][z];if(!Ie.g)switch(Ie.t){case 5:G(Ie)&&B(Ie);break;case 4:N(Ie)&&B(Ie)}}}function N(ue){for(var pe=ue.u,Ie=ue.k,je=ee(Ie),Te=je.length-1;Te>=0;Te--){var ve=je[Te];if(ve!==z){var Oe=pe[ve];if(Oe===void 0&&!s(pe,ve))return!0;var at=Ie[ve],gt=at&&at[z];if(gt?gt.u!==Oe:!c(at,Oe))return!0}}var $t=!!pe[z];return je.length!==ee(pe).length+($t?0:1)}function G(ue){var pe=ue.k;if(pe.length!==ue.u.length)return!0;var Ie=Object.getOwnPropertyDescriptor(pe,pe.length-1);if(Ie&&!Ie.get)return!0;for(var je=0;je<pe.length;je++)if(!pe.hasOwnProperty(je))return!0;return!1}var te={};b("ES5",{I:function(ue,pe){var Ie=Array.isArray(ue),je=(function(ve,Oe){if(ve){for(var at=Array(Oe.length),gt=0;gt<Oe.length;gt++)Object.defineProperty(at,""+gt,O(gt,!0));return at}var $t=ie(Oe);delete $t[z];for(var ir=ee($t),_r=0;_r<ir.length;_r++){var Ar=ir[_r];$t[Ar]=O(Ar,ve||!!$t[Ar].enumerable)}return Object.create(Object.getPrototypeOf(Oe),$t)})(Ie,ue),Te={t:Ie?5:4,A:pe?pe.A:E(),g:!1,R:!1,N:{},l:pe,u:ue,k:je,i:null,O:!1,C:!1};return Object.defineProperty(je,z,{value:Te,writable:!0}),je},P:function(ue,pe,Ie){Ie?e(pe)&&pe[z].A===ue&&T(ue.p):(ue.o&&(function je(Te){if(Te&&typeof Te=="object"){var ve=Te[z];if(ve){var Oe=ve.u,at=ve.k,gt=ve.N,$t=ve.t;if($t===4)n(at,(function(dr){dr!==z&&(Oe[dr]!==void 0||s(Oe,dr)?gt[dr]||je(at[dr]):(gt[dr]=!0,B(ve)))})),n(Oe,(function(dr){at[dr]!==void 0||s(at,dr)||(gt[dr]=!1,B(ve))}));else if($t===5){if(G(ve)&&(B(ve),gt.length=!0),at.length<Oe.length)for(var ir=at.length;ir<Oe.length;ir++)gt[ir]=!1;else for(var _r=Oe.length;_r<at.length;_r++)gt[_r]=!0;for(var Ar=Math.min(at.length,Oe.length),Zt=0;Zt<Ar;Zt++)at.hasOwnProperty(Zt)||(gt[Zt]=!0),gt[Zt]===void 0&&je(at[Zt])}}}})(ue.p[0]),T(ue.p))},J:function(ue){return ue.t===4?N(ue):G(ue)}})}function V(){function O(G){if(!r(G))return G;if(Array.isArray(G))return G.map(O);if(l(G))return new Map(Array.from(G.entries()).map((function(pe){return[pe[0],O(pe[1])]})));if(u(G))return new Set(Array.from(G).map(O));var te=Object.create(Object.getPrototypeOf(G));for(var ue in G)te[ue]=O(G[ue]);return s(G,_e)&&(te[_e]=G[_e]),te}function T(G){return e(G)?O(G):G}var N="add";b("Patches",{W:function(G,te){return te.forEach((function(ue){for(var pe=ue.path,Ie=ue.op,je=G,Te=0;Te<pe.length-1;Te++){var ve=i(je),Oe=pe[Te];typeof Oe!="string"&&typeof Oe!="number"&&(Oe=""+Oe),ve!==0&&ve!==1||Oe!=="__proto__"&&Oe!=="constructor"||t(24),typeof je=="function"&&Oe==="prototype"&&t(24),typeof(je=a(je,Oe))!="object"&&t(15,pe.join("/"))}var at=i(je),gt=O(ue.value),$t=pe[pe.length-1];switch(Ie){case"replace":switch(at){case 2:return je.set($t,gt);case 3:t(16);default:return je[$t]=gt}case N:switch(at){case 1:return $t==="-"?je.push(gt):je.splice($t,0,gt);case 2:return je.set($t,gt);case 3:return je.add(gt);default:return je[$t]=gt}case"remove":switch(at){case 1:return je.splice($t,1);case 2:return je.delete($t);case 3:return je.delete(ue.value);default:return delete je[$t]}default:t(17,Ie)}})),G},F:function(G,te,ue,pe){switch(G.t){case 0:case 4:case 2:return(function(Ie,je,Te,ve){var Oe=Ie.u,at=Ie.i;n(Ie.N,(function(gt,$t){var ir=a(Oe,gt),_r=a(at,gt),Ar=$t?s(Oe,gt)?"replace":N:"remove";if(ir!==_r||Ar!=="replace"){var Zt=je.concat(gt);Te.push(Ar==="remove"?{op:Ar,path:Zt}:{op:Ar,path:Zt,value:_r}),ve.push(Ar===N?{op:"remove",path:Zt}:Ar==="remove"?{op:N,path:Zt,value:T(ir)}:{op:"replace",path:Zt,value:T(ir)})}}))})(G,te,ue,pe);case 5:case 1:return(function(Ie,je,Te,ve){var Oe=Ie.u,at=Ie.N,gt=Ie.i;if(gt.length<Oe.length){var $t=[gt,Oe];Oe=$t[0],gt=$t[1];var ir=[ve,Te];Te=ir[0],ve=ir[1]}for(var _r=0;_r<Oe.length;_r++)if(at[_r]&>[_r]!==Oe[_r]){var Ar=je.concat([_r]);Te.push({op:"replace",path:Ar,value:T(gt[_r])}),ve.push({op:"replace",path:Ar,value:T(Oe[_r])})}for(var Zt=Oe.length;Zt<gt.length;Zt++){var dr=je.concat([Zt]);Te.push({op:N,path:dr,value:T(gt[Zt])})}Oe.length<gt.length&&ve.push({op:"replace",path:je.concat(["length"]),value:Oe.length})})(G,te,ue,pe);case 3:return(function(Ie,je,Te,ve){var Oe=Ie.u,at=Ie.i,gt=0;Oe.forEach((function($t){if(!at.has($t)){var ir=je.concat([gt]);Te.push({op:"remove",path:ir,value:$t}),ve.unshift({op:N,path:ir,value:$t})}gt++})),gt=0,at.forEach((function($t){if(!Oe.has($t)){var ir=je.concat([gt]);Te.push({op:N,path:ir,value:$t}),ve.unshift({op:"remove",path:ir,value:$t})}gt++}))})(G,te,ue,pe)}},M:function(G,te,ue,pe){ue.push({op:"replace",path:[],value:te===me?void 0:te}),pe.push({op:"replace",path:[],value:G})}})}function Y(){function O(Ie,je){function Te(){this.constructor=Ie}te(Ie,je),Ie.prototype=(Te.prototype=je.prototype,new Te)}function T(Ie){Ie.i||(Ie.N=new Map,Ie.i=new Map(Ie.u))}function N(Ie){Ie.i||(Ie.i=new Set,Ie.u.forEach((function(je){if(r(je)){var Te=D(Ie.A.h,je,Ie);Ie.p.set(je,Te),Ie.i.add(Te)}else Ie.i.add(je)})))}function G(Ie){Ie.O&&t(3,JSON.stringify(d(Ie)))}var te=function(Ie,je){return(te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Te,ve){Te.__proto__=ve}||function(Te,ve){for(var Oe in ve)ve.hasOwnProperty(Oe)&&(Te[Oe]=ve[Oe])})(Ie,je)},ue=(function(){function Ie(Te,ve){return this[z]={t:2,l:ve,A:ve?ve.A:E(),g:!1,R:!1,i:void 0,N:void 0,u:Te,k:this,C:!1,O:!1},this}O(Ie,Map);var je=Ie.prototype;return Object.defineProperty(je,"size",{get:function(){return d(this[z]).size}}
vendor: 1,215 bytes, line 4
4),je.has=function(Te){return d(this[z]).has(Te)},je.set=function(Te,ve){var Oe=this[z];return G(Oe),d(Oe).has(Te)&&d(Oe).get(Te)===ve||(T(Oe),B(Oe),Oe.N.set(Te,!0),Oe.i.set(Te,ve),Oe.N.set(Te,!0)),this},je.delete=function(Te){if(!this.has(Te))return!1;var ve=this[z];return G(ve),T(ve),B(ve),ve.u.has(Te)?ve.N.set(Te,!1):ve.N.delete(Te),ve.i.delete(Te),!0},je.clear=function(){var Te=this[z];G(Te),d(Te).size&&(T(Te),B(Te),Te.N=new Map,n(Te.u,(function(ve){Te.N.set(ve,!1)})),Te.i.clear())},je.forEach=function(Te,ve){var Oe=this;d(this[z]).forEach((function(at,gt){Te.call(ve,Oe.get(gt),gt,Oe)}))},je.get=function(Te){var ve=this[z];G(ve);var Oe=d(ve).get(Te);if(ve.R||!r(Oe)||Oe!==ve.u.get(Te))return Oe;var at=D(ve.A.h,Oe,ve);return T(ve),ve.i.set(Te,at),at},je.keys=function(){return d(this[z]).keys()},je.values=function(){var Te,ve=this,Oe=this.keys();return(Te={})[R]=function(){return ve.values()},Te.next=function(){var at=Oe.next();return at.done?at:{done:!1,value:ve.get(at.value)}},Te},je.entries=function(){var Te,ve=this,Oe=this.keys();return(Te={})[R]=function(){return ve.entries()},Te.next=function(){var at=Oe.next();if(at.done)return at;var gt=ve.get(at.value);return{done:!1,value:[at.value,gt]}
4},Te},je[R]=function(){return this.entries()},Ie})(),pe=(function(){function Ie(Te,ve){return this[z]={t:3,l:ve,A:ve?ve.A:E(),g:!1,R:!1,i:void 0,u:Te,k:this,p:new Map,O:!1,C:!1},this}O(Ie,Set);var je=Ie.prototype;return Object.defineProperty(je,"size",{get:function(){return d(this[z]).size}}),je.has=function(Te){var ve=this[z];return G(ve),ve.i?!!ve.i.has(Te)||!(!ve.p.has(Te)||!ve.i.has(ve.p.get(Te))):ve.u.has(Te)},je.add=function(Te){var ve=this[z];return G(ve),this.has(Te)||(N(ve),B(ve),ve.i.add(Te)),this},je.delete=function(Te){if(!this.has(Te))return!1;var ve=this[z];return G(ve),N(ve),B(ve),ve.i.delete(Te)||!!ve.p.has(Te)&&ve.i.delete(ve.p.get(Te))},je.clear=function(){var Te=this[z];G(Te),d(Te).size&&(N(Te),B(Te),Te.i.clear())},je.values=function(){var Te=this[z];return G(Te),N(Te),Te.i.values()},je.entries=function(){var Te=this[z];return G(Te),N(Te),Te.i.entries()},je.keys=function(){return this.values()},je[R]=function(){return this.values()},je.forEach=function(Te,ve){for(var Oe=this.values(),at=Oe.next();!at.done;)Te.call(ve,at.value,at.value,this),at=Oe.next()},Ie})();b("MapSet",{K:function(Ie,je){return new ue(Ie,je)},$:function(Ie,je){return new pe(Ie,je)}})}var K;Object.defineProperty(an,"__esModule",{value:!0});var ge,ae=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ce=typeof Map<"u",Q=typeof Set<"u",se=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",me=ae?Symbol.for("immer-nothing"):((K={})["immer-nothing"]=!0,K),_e=ae?Symbol.for("immer-draftable"):"__$immer_draftable",z=ae?Symbol.for("immer-state"):"__$immer_state",R=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",M=""+Object.prototype.constructor,ee=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:Object.getOwnPropertyNames,ie=Object.getOwnPropertyDescriptors||function(O){var T={};return ee(O).forEach((function(N){T[N]=Object.getOwnPropertyDescriptor(O,N)})),T},le={},ye={get:function(O,T){if(T===z)return O;var N=d(O);if(!s(N,T))return(function(te,ue,pe){var Ie,je=L(ue,pe);return je?"value"in je?je.value:(Ie=je.get)===null||Ie===void 0?void 0:Ie.call(te.k):void 0})(O,N,T);var G=N[T];return O.R||!r(G)?G:G===j(O.u,T)?(k(O),O.i[T]=D(O.A.h,G,O)):G},has:function(O,T){return T in d(O)},ownKeys:function(O){return Reflect.ownKeys(d(O))},set:function(O,T,N){var G=L(d(O),T);if(G!=null&&G.set)return G.set.call(O.k,N),!0;if(!O.g){var te=j(d(O),T),ue=te==null?void 0:te[z];if(ue&&ue.u===N)return O.i[T]=N,O.N[T]=!1,!0;if(c(N,te)&&(N!==void 0||s(O.u,T)))return!0;k(O),B(O)}return O.i[T]===N&&(N!==void 0||T in O.i)||Number.isNaN(N)&&Number.isNaN(O.i[T])||(O.i[T]=N,O.N[T]=!0),!0},deleteProperty:function(O,T){return j(O.u,T)!==void 0||T in O.u?(O.N[T]=!1,k(O),B(O)):delete O.N[T],O.i&&delete O.i[T],!0},getOwnPropertyDescriptor:function(O,T){var N=d(O),G=Reflect.getOwnPropertyDescriptor(N,T);return G&&{writable:!0,configurable:O.t!==1||T!=="length",enumerable:G.enumerable,value:N[T]}},defineProperty:function(){t(11)},getPrototypeOf:function(O){return Object.getPrototypeOf(O.u)},setPrototypeOf:function(){t(12)}},fe={};n(ye,(function(O,T){fe[O]=function(){return arguments[0]=arguments[0][0],T.apply(this,arguments)}})),fe.deleteProperty=function(O,T){return fe.set.call(this,O,T,void 0)},fe.set=function(O,T,N){return ye.set.call(this,O[0],T,N,O[0])};var we=(function(){function O(N){var G=this;this.S=se,this.D=!0,this.produce=function(te,ue,pe){if(typeof te=="function"&&typeof ue!="function"){var Ie=ue;ue=te;var je=G;return function(ir){var _r=this;ir===void 0&&(ir=Ie);for(var Ar=arguments.length,Zt=Array(Ar>1?Ar-1:0),dr=1;dr<Ar;dr++)Zt[dr-1]=arguments[dr];return je.produce(ir,(function(gn){var Ti;return(Ti=ue).call.apply(Ti,[_r,gn].concat(Zt))}))}}var Te;if(typeof ue!="function"&&t(6),pe!==void 0&&typeof pe!="function"&&t(7),r(te)){var ve=_(G),Oe=D(G,te,void 0),at=!0;try{Te=ue(Oe),at=!1}finally{at?w(ve):x(ve)}return typeof Promise<"u"&&Te instanceof Promise?Te.then((function(ir){return v(ve,pe),A(ir,ve)}),(function(ir){throw w(ve),ir})):(v(ve,pe),A(Te,ve))}if(!te||typeof te!="object"){if((Te=ue(te))===void 0&&(Te=te),Te===me&&(Te=void 0),G.D&&h(Te,!0),pe){var gt=[],$t=[];y("Patches").M(te,Te,gt,$t),pe(gt,$t)}return Te}t(21,te)},this.produceWithPatches=function(te,ue){if(typeof te=="function")return function(Te){for(var ve=arguments.length,Oe=Array(ve>1?ve-1:0),at=1;at<ve;at++)Oe[at-1]=arguments[at];return G.produceWithPatches(Te,(function(gt){return te.apply(void 0,[gt].concat(Oe))}))};var pe,Ie,je=G.produce(te,ue,(function(Te,ve){pe=Te,Ie=ve}));return typeof Promise<"u"&&je instanceof Promise?je.then((function(Te){return[Te,pe,Ie]})):[je,pe,Ie]},typeof(N==null?void 0:N.useProxies)=="boolean"&&this.setUseProxies(N.useProxies),typeof(N==null?void 0:N.autoFreeze)=="boolean"&&this.setAutoFreeze(N.autoFreeze)}
4var T=O.prototype;return T.createDraft=function(N){r(N)||t(8),e(N)&&(N=q(N));var G=_(this),te=D(this,N,void 0);return te[z].C=!0,x(G),te},T.finishDraft=function(N,G){var te=(N&&N[z]).A;return v(te,G),A(void 0,te)},T.setAutoFreeze=function(N){this.D=N},T.setUseProxies=function(N){N&&!se&&t(20),this.S=N},T.applyPatches=function(N,G){var te;for(te=G.length-1;te>=0;te--){var ue=G[te];if(ue.path.length===0&&ue.op==="replace"){N=ue.value;break}}te>-1&&(G=G.slice(te+1));var pe=y("Patches").W;return e(N)?pe(N,G):this.produce(N,(function(Ie){return pe(Ie,G)}))},O})(),Ce=new we,ne=Ce.produce,Re=Ce.produceWithPatches.bind(Ce),Pe=Ce.setAutoFreeze.bind(Ce),Ae=Ce.setUseProxies.bind(Ce),Ue=Ce.applyPatches.bind(Ce),He=Ce.createDraft.bind(Ce),Qe=Ce.finishDraft.bind(Ce);return an.Immer=we,an.applyPatches=Ue,an.castDraft=function(O){return O},an.castImmutable=function(O){return O},an.createDraft=He,an.current=q,an.default=ne,an.enableAllPlugins=function(){W(),Y(),V()},an.enableES5=W,an.enableMapSet=Y,an.enablePatches=V,an.finishDraft=Qe,an.freeze=h,an.immerable=_e,an.isDraft=e,an.isDraftable=r,an.nothing=me,an.original=function(O){return e(O)||t(23,O),O[z].u},an.produce=ne,an.produceWithPatches=Re,an.setAutoFreeze=Pe,an.setUseProxies=Ae,an}var lk;function w2(){return lk||(lk=1,o6.exports=iae()),o6.exports}const sae=m0(Zne);var uk;function aae(){return uk||(uk=1,(function(t){var e,r,n=wd&&wd.__generator||function($e,We){var Ke,rt,Ze,_t,Et={label:0,sent:function(){if(1&Ze[0])throw Ze[1];return Ze[1]},trys:[],ops:[]};return _t={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(_t[Symbol.iterator]=function(){return this}),_t;function F(H){return function(J){return(function(Z){if(Ke)throw new TypeError("Generator is already executing.");for(;Et;)try{if(Ke=1,rt&&(Ze=2&Z[0]?rt.return:Z[0]?rt.throw||((Ze=rt.return)&&Ze.call(rt),0):rt.next)&&!(Ze=Ze.call(rt,Z[1])).done)return Ze;switch(rt=0,Ze&&(Z=[2&Z[0],Ze.value]),Z[0]){case 0:case 1:Ze=Z;break;case 4:return Et.label++,{value:Z[1],done:!1};case 5:Et.label++,rt=Z[1],Z=[0];continue;case 7:Z=Et.ops.pop(),Et.trys.pop();continue;default:if(!((Ze=(Ze=Et.trys).length>0&&Ze[Ze.length-1])||Z[0]!==6&&Z[0]!==2)){Et=0;continue}if(Z[0]===3&&(!Ze||Z[1]>Ze[0]&&Z[1]<Ze[3])){Et.label=Z[1];break}if(Z[0]===6&&Et.label<Ze[1]){Et.label=Ze[1],Ze=Z;break}if(Ze&&Et.label<Ze[2]){Et.label=Ze[2],Et.ops.push(Z);break}Ze[2]&&Et.ops.pop(),Et.trys.pop();continue}Z=We.call($e,Et)}catch(X){Z=[6,X],rt=0}finally{Ke=Ze=0}if(5&Z[0])throw Z[1];return{value:Z[0]?Z[1]:void 0,done:!0}})([H,J])}}},i=wd&&wd.__spreadArray||function($e,We){for(var Ke=0,rt=We.length,Ze=$e.length;Ke<rt;Ke++,Ze++)$e[Ze]=We[Ke];return $e},s=Object.create,a=Object.defineProperty,o=Object.defineProperties,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=function($e,We,Ke){return We in $e?a($e,We,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):$e[We]=Ke},y=function($e,We){for(var Ke in We||(We={}))h.call(We,Ke)&&m($e,Ke,We[Ke]);if(d)for(var rt=0,Ze=d(We);rt<Ze.length;rt++)g.call(We,Ke=Ze[rt])&&m($e,Ke,We[Ke]);return $e},b=function($e,We){return o($e,l(We))},E=function($e){return a($e,"__esModule",{value:!0})},v=function($e,We){var Ke={};for(var rt in $e)h.call($e,rt)&&We.indexOf(rt)<0&&(Ke[rt]=$e[rt]);if($e!=null&&d)for(var Ze=0,_t=d($e);Ze<_t.length;Ze++)We.indexOf(rt=_t[Ze])<0&&g.call($e,rt)&&(Ke[rt]=$e[rt]);return Ke},w=function($e){return(function(We,Ke,rt){if(Ke&&typeof Ke=="object"||typeof Ke=="function")for(var Ze=function(F){h.call(We,F)||F==="default"||a(We,F,{get:function(){return Ke[F]},enumerable:!(rt=c(Ke,F))||rt.enumerable})},_t=0,Et=u(Ke);_t<Et.length;_t++)Ze(Et[_t]);return We})(E(a($e!=null?s(f($e)):{}
4,"default",$e&&$e.__esModule&&"default"in $e?{get:function(){return $e.default},enumerable:!0}:{value:$e,enumerable:!0})),$e)},x=function($e,We,Ke){return new Promise((function(rt,Ze){var _t=function(H){try{F(Ke.next(H))}catch(J){Ze(J)}},Et=function(H){try{F(Ke.throw(H))}catch(J){Ze(J)}},F=function(H){return H.done?rt(H.value):Promise.resolve(H.value).then(_t,Et)};F((Ke=Ke.apply($e,We)).next())}))};E(t),(function($e,We){for(var Ke in We)a($e,Ke,{get:We[Ke],enumerable:!0})})(t,{QueryStatus:function(){return e},buildCreateApi:function(){return Te},copyWithStructuralSharing:function(){return A},coreModule:function(){return jt},createApi:function(){return Wa},defaultSerializeQueryArgs:function(){return pe},fakeBaseQuery:function(){return ve},fetchBaseQuery:function(){return B},retry:function(){return U},setupListeners:function(){return ce},skipSelector:function(){return O},skipToken:function(){return Qe}}),(r=e||(e={})).uninitialized="uninitialized",r.pending="pending",r.fulfilled="fulfilled",r.rejected="rejected";var _=function($e){return[].concat.apply([],$e)},S=w(Ys).isPlainObject;function A($e,We){if($e===We||!(S($e)&&S(We)||Array.isArray($e)&&Array.isArray(We)))return We;for(var Ke=Object.keys(We),rt=Object.keys($e),Ze=Ke.length===rt.length,_t=Array.isArray(We)?[]:{},Et=0,F=Ke;Et<F.length;Et++){var H=F[Et];_t[H]=A($e[H],We[H]),Ze&&(Ze=$e[H]===_t[H])}return Ze?$e:_t}var I=w(Ys),$=function(){for(var $e=[],We=0;We<arguments.length;We++)$e[We]=arguments[We];return fetch.apply(void 0,$e)},P=function($e){return $e.status>=200&&$e.status<=299},j=function($e){return/ion\/(vnd\.api\+)?json/.test($e.get("content-type")||"")};function L($e){if(!(0,I.isPlainObject)($e))return $e;for(var We=y({},$e),Ke=0,rt=Object.entries(We);Ke<rt.length;Ke++){var Ze=rt[Ke];Ze[1]===void 0&&delete We[Ze[0]]}return We}function B($e){var We=this;$e===void 0&&($e={});var Ke=$e.baseUrl,rt=$e.prepareHeaders,Ze=rt===void 0?function(nt){return nt}:rt,_t=$e.fetchFn,Et=_t===void 0?$:_t,F=$e.paramsSerializer,H=$e.isJsonContentType,J=H===void 0?j:H,Z=$e.jsonContentType,X=Z===void 0?"application/json":Z,Ee=$e.jsonReplacer,Me=$e.timeout,De=$e.validateStatus,Be=v($e,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","validateStatus"]);return typeof fetch>"u"&&Et===$&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(nt,et){return x(We,null,(function(){var Ct,Nt,nr,gr,Fr,kn,Wr,Kr,en,wa,zi,er,Or,tn,Ln,Fn,Ii,Qr,Er,Mr,Cr,$n,Ur,mt,Yt,Lt,St,Pt,fr,qt,vt,it,wt,ct,ft,xt;return n(this,(function(Bt){switch(Bt.label){case 0:return Ct=et.signal,Nt=et.getState,nr=et.extra,gr=et.endpoint,Fr=et.forced,kn=et.type,en=(Kr=typeof nt=="string"?{url:nt}:nt).url,zi=(wa=Kr.headers)===void 0?new Headers(Be.headers):wa,Or=(er=Kr.params)===void 0?void 0:er,Ln=(tn=Kr.responseHandler)===void 0?"json":tn,Ii=(Fn=Kr.validateStatus)===void 0?De??P:Fn,Er=(Qr=Kr.timeout)===void 0?Me:Qr,Mr=v(Kr,["url","headers","params","responseHandler","validateStatus","timeout"]),Cr=y(b(y({},Be),{signal:Ct}),Mr),zi=new Headers(L(zi)),$n=Cr,[4,Ze(zi,{getState:Nt,extra:nr,endpoint:gr,forced:Fr,type:kn})];case 1:$n.headers=Bt.sent()||zi,Ur=function(Ft){return typeof Ft=="object"&&((0,I.isPlainObject)(Ft)||Array.isArray(Ft)||typeof Ft.toJSON=="function")},!Cr.headers.has("content-type")&&Ur(Cr.body)&&Cr.headers.set("content-type",X),Ur(Cr.body)&&J(Cr.headers)&&(Cr.body=JSON.stringify(Cr.body,Ee)),Or&&(mt=~en.indexOf("?")?"&":"?",Yt=F?F(Or):new URLSearchParams(L(Or)),en+=mt+Yt),en=(function(Ft,Qt){if(!Ft)return Qt;if(!Qt)return Ft;if((function(xr){return new RegExp("(^|:)//").test(xr)})(Qt))return Qt;var Tr=Ft.endsWith("/")||!Qt.startsWith("?")?"/":"";return Ft=(function(xr){return xr.replace(/\/$/,"")})(Ft),""+Ft+Tr+(function(xr){return xr.replace(/^\//,"")})(Qt)})(Ke,en),Lt=new Request(en,Cr),St=Lt.clone(),Wr={request:St},fr=!1,qt=Er&&setTimeout((function(){fr=!0,et.abort()}),Er),Bt.label=2;case 2:return Bt.trys.push([2,4,5,6]),[4,Et(Lt)];case 3:return Pt=Bt.sent(),[3,6];case 4:return vt=Bt.sent(),[2,{error:{status:fr?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(vt)},meta:Wr}];case 5:return qt&&clearTimeout(qt),[7];case 6:it=Pt.clone(),Wr.response=it,ct="",Bt.label=7;case 7:return Bt.trys.push([7,9,,10]),[4,Promise.all([Je(Pt,Ln).then((function(Ft){return wt=Ft}),(function(Ft){return ft=Ft})),it.text().then((function(Ft){return ct=Ft}),(function(){}))])];case 8:if(Bt.sent(),ft)throw ft;return[3,10];case 9:return xt=Bt.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:Pt.status,data:ct,error:String(xt)}
4,meta:Wr}];case 10:return[2,Ii(Pt,wt)?{data:wt,meta:Wr}:{error:{status:Pt.status,data:wt},meta:Wr}]}}))}))};function Je(nt,et){return x(this,null,(function(){var Ct;return n(this,(function(Nt){switch(Nt.label){case 0:return typeof et=="function"?[2,et(nt)]:(et==="content-type"&&(et=J(nt.headers)?"json":"text"),et!=="json"?[3,2]:[4,nt.text()]);case 1:return[2,(Ct=Nt.sent()).length?JSON.parse(Ct):null];case 2:return[2,nt.text()]}}))}))}}var k=function($e,We){We===void 0&&(We=void 0),this.value=$e,this.meta=We};function D($e,We){return $e===void 0&&($e=0),We===void 0&&(We=5),x(this,null,(function(){var Ke,rt;return n(this,(function(Ze){switch(Ze.label){case 0:return Ke=Math.min($e,We),rt=~~((Math.random()+.4)*(300<<Ke)),[4,new Promise((function(_t){return setTimeout((function(Et){return _t(Et)}),rt)}))];case 1:return Ze.sent(),[2]}}))}))}var q={},U=Object.assign((function($e,We){return function(Ke,rt,Ze){return x(void 0,null,(function(){var _t,Et,F,H,J,Z,X;return n(this,(function(Ee){switch(Ee.label){case 0:_t=[5,(We||q).maxRetries,(Ze||q).maxRetries].filter((function(Me){return Me!==void 0})),Et=_t.slice(-1)[0],F=function(Me,De,Be){return Be.attempt<=Et},H=y(y({maxRetries:Et,backoff:D,retryCondition:F},We),Ze),J=0,Ee.label=1;case 1:Ee.label=2;case 2:return Ee.trys.push([2,4,,6]),[4,$e(Ke,rt,Ze)];case 3:if((Z=Ee.sent()).error)throw new k(Z);return[2,Z];case 4:if(X=Ee.sent(),J++,X.throwImmediately){if(X instanceof k)return[2,X.value];throw X}return X instanceof k&&!H.retryCondition(X.value.error,Ke,{attempt:J,baseQueryApi:rt,extraOptions:Ze})?[2,X.value]:[4,H.backoff(J,H.maxRetries)];case 5:return Ee.sent(),[3,6];case 6:return[3,1];case 7:return[2]}}
4))}))}}),{fail:function($e){throw Object.assign(new k({error:$e}),{throwImmediately:!0})}}),W=w(Ys),V=(0,W.createAction)("__rtkq/focused"),Y=(0,W.createAction)("__rtkq/unfocused"),K=(0,W.createAction)("__rtkq/online"),ge=(0,W.createAction)("__rtkq/offline"),ae=!1;function ce($e,We){return We?We($e,{onFocus:V,onFocusLost:Y,onOffline:ge,onOnline:K}):(Ke=function(){return $e(V())},rt=function(){return $e(K())},Ze=function(){return $e(ge())},_t=function(){window.document.visibilityState==="visible"?Ke():$e(Y())},ae||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",_t,!1),window.addEventListener("focus",Ke,!1),window.addEventListener("online",rt,!1),window.addEventListener("offline",Ze,!1),ae=!0),function(){window.removeEventListener("focus",Ke),window.removeEventListener("visibilitychange",_t),window.removeEventListener("online",rt),window.removeEventListener("offline",Ze),ae=!1});var Ke,rt,Ze,_t}var Q,se,me=w(Ys);function _e($e){return $e.type===Q.query}function z($e,We,Ke,rt,Ze,_t){return typeof $e=="function"?$e(We,Ke,rt,Ze).map(R).map(_t):Array.isArray($e)?$e.map(R).map(_t):[]}function R($e){return typeof $e=="string"?{type:$e}:$e}(se=Q||(Q={})).query="query",se.mutation="mutation";var M=w(Ys);function ee($e){return $e!=null}var ie=Symbol("forceQueryFn"),le=function($e){return typeof $e[ie]=="function"},ye=w(Ys),fe=w(w2()),we=w(Ys);function Ce($e){return $e}function ne($e,We,Ke,rt){return z(Ke[$e.meta.arg.endpointName][We],(0,ye.isFulfilled)($e)?$e.payload:void 0,(0,ye.isRejectedWithValue)($e)?$e.payload:void 0,$e.meta.arg.originalArgs,"baseQueryMeta"in $e.meta?$e.meta.baseQueryMeta:void 0,rt)}var Re=w(w2());function Pe($e,We,Ke){var rt=$e[We];rt&&Ke(rt)}function Ae($e){var We;return(We="arg"in $e?$e.arg.fixedCacheKey:$e.fixedCacheKey)!=null?We:$e.requestId}function Ue($e,We,Ke){var rt=$e[Ae(We)];rt&&Ke(rt)}var He={},Qe=Symbol.for("RTKQ/skipToken"),O=Qe,T={status:e.uninitialized},N=(0,me.createNextState)(T,(function(){})),G=(0,me.createNextState)(T,(function(){})),te=w(Ys),ue=WeakMap?new WeakMap:void 0,pe=function($e){var We=$e.endpointName,Ke=$e.queryArgs,rt="",Ze=ue==null?void 0:ue.get(Ke);if(typeof Ze=="string")rt=Ze;else{var _t=JSON.stringify(Ke,(function(Et,F){return(0,te.isPlainObject)(F)?Object.keys(F).sort().reduce((function(H,J){return H[J]=F[J],H}),{}):F}));(0,te.isPlainObject)(Ke)&&(ue==null||ue.set(Ke,_t)),rt=_t}return We+"("+rt+")"},Ie=w(Ys),je=w(sae);function Te(){for(var $e=[],We=0;We<arguments.length;We++)$e[We]=arguments[We];return function(Ke){var rt=(0,je.defaultMemoize)((function(H){var J,Z;return(Z=Ke.extractRehydrationInfo)==null?void 0:Z.call(Ke,H,{reducerPath:(J=Ke.reducerPath)!=null?J:"api"})})),Ze=b(y({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},Ke),{extractRehydrationInfo:rt,serializeQueryArgs:function(H){var J=pe;
4if("serializeQueryArgs"in H.endpointDefinition){var Z=H.endpointDefinition.serializeQueryArgs;J=function(X){var Ee=Z(X);return typeof Ee=="string"?Ee:pe(b(y({},X),{queryArgs:Ee}))}}else Ke.serializeQueryArgs&&(J=Ke.serializeQueryArgs);return J(H)},tagTypes:i([],Ke.tagTypes||[])}),_t={endpointDefinitions:{},batch:function(H){H()},apiUid:(0,Ie.nanoid)(),extractRehydrationInfo:rt,hasRehydrationInfo:(0,je.defaultMemoize)((function(H){return rt(H)!=null}))},Et={injectEndpoints:function(H){for(var J=H.endpoints({query:function(nt){return b(y({},nt),{type:Q.query})},mutation:function(nt){return b(y({},nt),{type:Q.mutation})}}),Z=0,X=Object.entries(J);Z<X.length;Z++){var Ee=X[Z],Me=Ee[0],De=Ee[1];if(H.overrideExisting||!(Me in _t.endpointDefinitions)){_t.endpointDefinitions[Me]=De;for(var Be=0,Je=F;Be<Je.length;Be++)Je[Be].injectEndpoint(Me,De)}}return Et},enhanceEndpoints:function(H){var J=H.addTagTypes,Z=H.endpoints;if(J)for(var X=0,Ee=J;X<Ee.length;X++){var Me=Ee[X];Ze.tagTypes.includes(Me)||Ze.tagTypes.push(Me)}if(Z)for(var De=0,Be=Object.entries(Z);De<Be.length;De++){var Je=Be[De],nt=Je[0],et=Je[1];typeof et=="function"?et(_t.endpointDefinitions[nt]):Object.assign(_t.endpointDefinitions[nt]||{},et)}return Et}},F=$e.map((function(H){return H.init(Et,Ze,_t)}));return Et.injectEndpoints({endpoints:Ke.endpoints})}}function ve(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Oe,at=w(Ys),gt=function($e){var We=$e.reducerPath,Ke=$e.api,rt=$e.context,Ze=$e.internalState,_t=Ke.internalActions,Et=_t.removeQueryResult,F=_t.unsubscribeQueryResult;function H(X){var Ee=Ze.currentSubscriptions[X];return!!Ee&&!(function(Me){for(var De in Me)return!1;return!0})(Ee)}var J={};function Z(X,Ee,Me,De){var Be,Je=rt.endpointDefinitions[Ee],nt=(Be=Je==null?void 0:Je.keepUnusedDataFor)!=null?Be:De.keepUnusedDataFor;if(nt!==1/0){var et=Math.max(0,Math.min(nt,2147482647e-3));if(!H(X)){var Ct=J[X];Ct&&clearTimeout(Ct),J[X]=setTimeout((function(){H(X)||Me.dispatch(Et({queryCacheKey:X})),delete J[X]}),1e3*et)}}}return function(X,Ee,Me){var De;if(F.match(X)){var Be=Ee.getState()[We];Z(kn=X.payload.queryCacheKey,(De=Be.queries[kn])==null?void 0:De.endpointName,Ee,Be.config)}if(Ke.util.resetApiState.match(X))for(var Je=0,nt=Object.entries(J);Je<nt.length;Je++){var et=nt[Je],Ct=et[0],Nt=et[1];Nt&&clearTimeout(Nt),delete J[Ct]}if(rt.hasRehydrationInfo(X)){Be=Ee.getState()[We];for(var nr=rt.extractRehydrationInfo(X).queries,gr=0,Fr=Object.entries(nr);gr<Fr.length;gr++){var kn,Wr=Fr[gr],Kr=Wr[1];Z(kn=Wr[0],Kr==null?void 0:Kr.endpointName,Ee,Be.config)}}}},$t=w(Ys),ir=function($e){var We=$e.reducerPath,Ke=$e.context,rt=$e.context.endpointDefinitions,Ze=$e.mutationThunk,_t=$e.api,Et=$e.assertTagType,F=$e.refetchQuery,H=_t.internalActions.removeQueryResult,J=(0,$t.isAnyOf)((0,$t.isFulfilled)(Ze),(0,$t.isRejectedWithValue)(Ze));function Z(X,Ee){var Me=Ee.getState(),De=Me[We],Be=_t.util.selectInvalidatedBy(Me,X);Ke.batch((function(){for(var Je,nt=0,et=Array.from(Be.values());nt<et.length;nt++){var Ct=et[nt].queryCacheKey,Nt=De.queries[Ct],nr=(Je=De.subscriptions[Ct])!=null?Je:{};Nt&&(Object.keys(nr).length===0?Ee.dispatch(H({queryCacheKey:Ct})):Nt.status!==e.uninitialized&&Ee.dispatch(F(Nt,Ct)))}}))}return function(X,Ee){J(X)&&Z(ne(X,"invalidatesTags",rt,Et),Ee),_t.util.invalidateTags.match(X)&&Z(z(X.payload,void 0,void 0,void 0,void 0,Et),Ee)}},_r=function($e){var We=$e.reducerPath,Ke=$e.queryThunk,rt=$e.api,Ze=$e.refetchQuery,_t=$e.internalState,Et={};function F(X,Ee){var Me=X.queryCacheKey,De=Ee.getState()[We].queries[Me];if(De&&De.status!==e.uninitialized){var Be=Z(_t.currentSubscriptions[Me]);if(Number.isFinite(Be)){var Je=Et[Me];Je!=null&&Je.timeout&&(clearTimeout(Je.timeout),Je.timeout=void 0);var nt=Date.now()+Be,et=Et[Me]={nextPollTimestamp:nt,pollingInterval:Be,timeout:setTimeout((function(){et.timeout=void 0,Ee.dispatch(Ze(De,Me))}),Be)}}}}function H(X,Ee){var Me=X.queryCacheKey,De=Ee.getState()[We].queries[Me];if(De&&De.status!==e.uninitialized){var Be=Z(_t.currentSubscriptions[Me]);if(Number.isFinite(Be)){var Je=Et[Me],nt=Date.now()+Be;(!Je||nt<Je.nextPollTimestamp)&&F({queryCacheKey:Me},Ee)}else J(Me)}}function J(X){var Ee=Et[X];Ee!=null&&Ee.timeout&&clearTimeout(Ee.timeout),delete Et[X]}function Z(X){X===void 0&&(X={});var Ee=Number.POSITIVE_INFINITY;for(var Me in X)X[Me].pollingInterval&&(Ee=Math.min(X[Me].pollingInterval,Ee));return Ee}return function(X,Ee){(rt.internalActions.updateSubscriptionOptions.match(X)||rt.internalActions.unsubscribeQueryResult.match(X))&&H(X.payload,Ee),(Ke.pending.match(X)||Ke.rejected.match(X)&&X.meta.condition)&&H(X.meta.arg,Ee),(Ke.fulfilled.match(X)||Ke.rejected.match(X)&&!X.meta.condition)&&F(X.meta.arg,Ee),rt.util.resetApiState.match(X)&&(function(){for(var Me=0,De=Object.keys(Et);Me<De.length;Me++)J(De[Me])})()}}
4,Ar=w(Ys),Zt=new Error("Promise never resolved before cacheEntryRemoved."),dr=function($e){var We=$e.api,Ke=$e.reducerPath,rt=$e.context,Ze=$e.queryThunk,_t=$e.mutationThunk,Et=(0,Ar.isAsyncThunkAction)(Ze),F=(0,Ar.isAsyncThunkAction)(_t),H=(0,Ar.isFulfilled)(Ze,_t),J={};function Z(X,Ee,Me,De,Be){var Je=rt.endpointDefinitions[X],nt=Je==null?void 0:Je.onCacheEntryAdded;if(nt){var et={},Ct=new Promise((function(Wr){et.cacheEntryRemoved=Wr})),Nt=Promise.race([new Promise((function(Wr){et.valueResolved=Wr})),Ct.then((function(){throw Zt}))]);Nt.catch((function(){})),J[Me]=et;var nr=We.endpoints[X].select(Je.type===Q.query?Ee:Me),gr=De.dispatch((function(Wr,Kr,en){return en})),Fr=b(y({},De),{getCacheEntry:function(){return nr(De.getState())},requestId:Be,extra:gr,updateCachedData:Je.type===Q.query?function(Wr){return De.dispatch(We.util.updateQueryData(X,Ee,Wr))}:void 0,cacheDataLoaded:Nt,cacheEntryRemoved:Ct}),kn=nt(Ee,Fr);Promise.resolve(kn).catch((function(Wr){if(Wr!==Zt)throw Wr}))}}return function(X,Ee,Me){var De=(function(nr){return Et(nr)?nr.meta.arg.queryCacheKey:F(nr)?nr.meta.requestId:We.internalActions.removeQueryResult.match(nr)?nr.payload.queryCacheKey:We.internalActions.removeMutationResult.match(nr)?Ae(nr.payload):""})(X);if(Ze.pending.match(X)){var Be=Me[Ke].queries[De],Je=Ee.getState()[Ke].queries[De];!Be&&Je&&Z(X.meta.arg.endpointName,X.meta.arg.originalArgs,De,Ee,X.meta.requestId)}else if(_t.pending.match(X))(Je=Ee.getState()[Ke].mutations[De])&&Z(X.meta.arg.endpointName,X.meta.arg.originalArgs,De,Ee,X.meta.requestId);else if(H(X))(Nt=J[De])!=null&&Nt.valueResolved&&(Nt.valueResolved({data:X.payload,meta:X.meta.baseQueryMeta}),delete Nt.valueResolved);else if(We.internalActions.removeQueryResult.match(X)||We.internalActions.removeMutationResult.match(X))(Nt=J[De])&&(delete J[De],Nt.cacheEntryRemoved());else if(We.util.resetApiState.match(X))for(var nt=0,et=Object.entries(J);nt<et.length;nt++){var Ct=et[nt],Nt=Ct[1];delete J[Ct[0]],Nt.cacheEntryRemoved()}}},gn=w(Ys),Ti=function($e){var We=$e.api,Ke=$e.context,rt=$e.queryThunk,Ze=$e.mutationThunk,_t=(0,gn.isPending)(rt,Ze),Et=(0,gn.isRejected)(rt,Ze),F=(0,gn.isFulfilled)(rt,Ze),H={};return function(J,Z){var X,Ee,Me;if(_t(J)){var De=J.meta,Be=De.requestId,Je=De.arg,nt=Je.endpointName,et=Je.originalArgs,Ct=Ke.endpointDefinitions[nt],Nt=Ct==null?void 0:Ct.onQueryStarted;if(Nt){var nr={},gr=new Promise((function(zi,er){nr.resolve=zi,nr.reject=er}));gr.catch((function(){})),H[Be]=nr;var Fr=We.endpoints[nt].select(Ct.type===Q.query?et:Be),kn=Z.dispatch((function(zi,er,Or){return Or})),Wr=b(y({},Z),{getCacheEntry:function(){return Fr(Z.getState())},requestId:Be,extra:kn,updateCachedData:Ct.type===Q.query?function(zi){return Z.dispatch(We.util.updateQueryData(nt,et,zi))}:void 0,queryFulfilled:gr});Nt(et,Wr)}}else if(F(J)){var Kr=J.meta,en=Kr.baseQueryMeta;(X=H[Be=Kr.requestId])==null||X.resolve({data:J.payload,meta:en}),delete H[Be]}else if(Et(J)){var wa=J.meta;en=wa.baseQueryMeta,(Me=H[Be=wa.requestId])==null||Me.reject({error:(Ee=J.payload)!=null?Ee:J.error,isUnhandledError:!wa.rejectedWithValue,meta:en}),delete H[Be]}}},Ks=function($e){var We=$e.api,Ke=$e.context.apiUid;return function(rt,Ze){We.util.resetApiState.match(rt)&&Ze.dispatch(We.internalActions.middlewareRegistered(Ke))}},ti=w(w2()),xn=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof Yn<"u"?Yn:globalThis):function($e){return(Oe||(Oe=Promise.resolve())).then($e).catch((function(We){return setTimeout((function(){throw We}),0)}))};function Jr($e){for(var We=[],Ke=1;Ke<arguments.length;Ke++)We[Ke-1]=arguments[Ke];Object.assign.apply(Object,i([$e],We))}var Qs=w(w2()),Wi=Symbol(),jt=function(){return{name:Wi,init:function($e,We,Ke){var rt=We.baseQuery,Ze=We.reducerPath,_t=We.serializeQueryArgs,Et=We.keepUnusedDataFor,F=We.refetchOnMountOrArgChange,H=We.refetchOnFocus,J=We.refetchOnReconnect;(0,Qs.enablePatches)();var Z=function(er){return er};Object.assign($e,{reducerPath:Ze,endpoints:{},internalActions:{onOnline:K,onOffline:ge,onFocus:V,onFocusLost:Y},util:{}});var X=(function(er){var Or=this,tn=er.reducerPath,Ln=er.baseQuery,Fn=er.context.endpointDefinitions,Ii=er.serializeQueryArgs,Qr=er.api,Er=function(mt,Yt){return x(Or,[mt,Yt],(function(Lt,St){var Pt,fr,qt,vt,it,wt,ct,ft,xt,Bt,Ft,Qt,Tr,xr=St.signal,Ne=St.abort,he=St.rejectWithValue,be=St.fulfillWithValue,Le=St.dispatch,Ve=St.getState,Xt=St.extra;return n(this,(function(or){switch(or.label){case 0:Pt=Fn[Lt.endpointName],or.label=1;case 1:return or.trys.push([1,8,,13]),fr=Ce,qt=void 0,vt={signal:xr,abort:Ne,dispatch:Le,getState:Ve,extra:Xt,endpoint:Lt.endpointName,type:Lt.type,forced:Lt.type==="query"?Mr(Lt,Ve()):void 0},(it=Lt.type==="query"?Lt[ie]:void 0)?(qt=it(),[3,6]):[3,2];case 2:return Pt.query?[4,Ln(Pt.query(Lt.originalArgs),vt,Pt.extraOptions)]:[3,4];case 3:return qt=or.sent(),Pt.transformResponse&&(fr=Pt.transformResponse),[3,6];case 4:return[4,Pt.queryFn(Lt.originalArgs,vt,Pt.extraOptions,(function(Rr){return Ln(Rr,vt,Pt.extraOptions)}))];case 5:qt=or.sent(),or.label=6;case 6:if(qt.error)throw new k(qt.error,qt.meta);return wt=be,[4,fr(qt.data,qt.meta,Lt.originalArgs)];case 7:return[2,wt.apply(void 0,[or.sent(),(Qt={fulfilledTimeStamp:Date.now(),baseQueryMeta:qt.meta},Qt[we.SHOULD_AUTOBATCH]=!0,Qt)])];case 8:if(ct=or.sent(),!((ft=ct)instanceof k))return[3,12];xt=Ce,Pt.query&&Pt.transformErrorResponse&&(xt=Pt.transformErrorResponse),or.label=9;case 9:return or.trys.push([9,11,,12]),Bt=he,[4,xt(ft.value,ft.meta,Lt.originalArgs)];case 10:return[2,Bt.apply(void 0,[or.sent(),(Tr={baseQueryMeta:ft.meta},Tr[we.SHOULD_AUTOBATCH]=!0,Tr)])];case 11:return Ft=or.sent(),ft=Ft,[3,12];case 12:throw console.error(ft),ft;case 13:return[2]}}
4))}))};function Mr(mt,Yt){var Lt,St,Pt,fr,qt=(St=(Lt=Yt[tn])==null?void 0:Lt.queries)==null?void 0:St[mt.queryCacheKey],vt=(Pt=Yt[tn])==null?void 0:Pt.config.refetchOnMountOrArgChange,it=qt==null?void 0:qt.fulfilledTimeStamp,wt=(fr=mt.forceRefetch)!=null?fr:mt.subscribe&&vt;return!!wt&&(wt===!0||(Number(new Date)-Number(it))/1e3>=wt)}var Cr=(0,we.createAsyncThunk)(tn+"/executeQuery",Er,{getPendingMeta:function(){var mt;return(mt={startedTimeStamp:Date.now()})[we.SHOULD_AUTOBATCH]=!0,mt},condition:function(mt,Yt){var Lt,St,Pt,fr=(0,Yt.getState)(),qt=(St=(Lt=fr[tn])==null?void 0:Lt.queries)==null?void 0:St[mt.queryCacheKey],vt=qt==null?void 0:qt.fulfilledTimeStamp,it=mt.originalArgs,wt=qt==null?void 0:qt.originalArgs,ct=Fn[mt.endpointName];return!(!le(mt)&&((qt==null?void 0:qt.status)==="pending"||!Mr(mt,fr)&&(!_e(ct)||!((Pt=ct==null?void 0:ct.forceRefetch)!=null&&Pt.call(ct,{currentArg:it,previousArg:wt,endpointState:qt,state:fr})))&&vt))},dispatchConditionRejection:!0}),$n=(0,we.createAsyncThunk)(tn+"/executeMutation",Er,{getPendingMeta:function(){var mt;return(mt={startedTimeStamp:Date.now()})[we.SHOULD_AUTOBATCH]=!0,mt}});function Ur(mt){return function(Yt){var Lt,St;return((St=(Lt=Yt==null?void 0:Yt.meta)==null?void 0:Lt.arg)==null?void 0:St.endpointName)===mt}}return{queryThunk:Cr,mutationThunk:$n,prefetch:function(mt,Yt,Lt){return function(St,Pt){var fr=(function(ct){return"force"in ct})(Lt)&&Lt.force,qt=(function(ct){return"ifOlderThan"in ct})(Lt)&&Lt.ifOlderThan,vt=function(ct){return ct===void 0&&(ct=!0),Qr.endpoints[mt].initiate(Yt,{forceRefetch:ct})},it=Qr.endpoints[mt].select(Yt)(Pt());if(fr)St(vt());else if(qt){var wt=it==null?void 0:it.fulfilledTimeStamp;if(!wt)return void St(vt());(Number(new Date)-Number(new Date(wt)))/1e3>=qt&&St(vt())}else St(vt(!1))}},updateQueryData:function(mt,Yt,Lt){return function(St,Pt){var fr,qt,vt=Qr.endpoints[mt].select(Yt)(Pt()),it={patches:[],inversePatches:[],undo:function(){return St(Qr.util.patchQueryData(mt,Yt,it.inversePatches))}};if(vt.status===e.uninitialized)return it;if("data"in vt)if((0,fe.isDraftable)(vt.data)){var wt=(0,fe.produceWithPatches)(vt.data,Lt),ct=wt[2];(fr=it.patches).push.apply(fr,wt[1]),(qt=it.inversePatches).push.apply(qt,ct)}else{var ft=Lt(vt.data);it.patches.push({op:"replace",path:[],value:ft}),it.inversePatches.push({op:"replace",path:[],value:vt.data})}return St(Qr.util.patchQueryData(mt,Yt,it.patches)),it}},upsertQueryData:function(mt,Yt,Lt){return function(St){var Pt;return St(Qr.endpoints[mt].initiate(Yt,((Pt={subscribe:!1,forceRefetch:!0})[ie]=function(){return{data:Lt}},Pt)))}},patchQueryData:function(mt,Yt,Lt){return function(St){St(Qr.internalActions.queryResultPatched({queryCacheKey:Ii({queryArgs:Yt,endpointDefinition:Fn[mt],endpointName:mt}),patches:Lt}))}},buildMatchThunkActions:function(mt,Yt){return{matchPending:(0,ye.isAllOf)((0,ye.isPending)(mt),Ur(Yt)),matchFulfilled:(0,ye.isAllOf)((0,ye.isFulfilled)(mt),Ur(Yt)),matchRejected:(0,ye.isAllOf)((0,ye.isRejected)(mt),Ur(Yt))}}}})({baseQuery:rt,reducerPath:Ze,context:Ke,api:$e,serializeQueryArgs:_t}),Ee=X.queryThunk,Me=X.mutationThunk,De=X.patchQueryData,Be=X.updateQueryData,Je=X.upsertQueryData,nt=X.prefetch,et=X.buildMatchThunkActions,Ct=(function(er){var Or=er.reducerPath,tn=er.queryThunk,Ln=er.mutationThunk,Fn=er.context,Ii=Fn.endpointDefinitions,Qr=Fn.apiUid,Er=Fn.extractRehydrationInfo,Mr=Fn.hasRehydrationInfo,Cr=er.assertTagType,$n=er.config,Ur=(0,M.createAction)(Or+"/resetApiState"),mt=(0,M.createSlice)({name:Or+"/queries",initialState:He,reducers:{removeQueryResult:{reducer:function(vt,it){delete vt[it.payload.queryCacheKey]},prepare:(0,M.prepareAutoBatched)()},queryResultPatched:function(vt,it){var wt=it.payload,ct=wt.patches;Pe(vt,wt.queryCacheKey,(function(ft){ft.data=(0,Re.applyPatches)(ft.data,ct.concat())}))}},extraReducers:function(vt){vt.addCase(tn.pending,(function(it,wt){var ct,ft=wt.meta,xt=wt.meta.arg,Bt=le(xt);(xt.subscribe||Bt)&&(it[ct=xt.queryCacheKey]!=null||(it[ct]={status:e.uninitialized,endpointName:xt.endpointName})),Pe(it,xt.queryCacheKey,(function(Ft){Ft.status=e.pending,Ft.requestId=Bt&&Ft.requestId?Ft.requestId:ft.requestId,xt.originalArgs!==void 0&&(Ft.originalArgs=xt.originalArgs),Ft.startedTimeStamp=ft.startedTimeStamp}))}
4)).addCase(tn.fulfilled,(function(it,wt){var ct=wt.meta,ft=wt.payload;Pe(it,ct.arg.queryCacheKey,(function(xt){var Bt;if(xt.requestId===ct.requestId||le(ct.arg)){var Ft=Ii[ct.arg.endpointName].merge;if(xt.status=e.fulfilled,Ft)if(xt.data!==void 0){var Qt=ct.fulfilledTimeStamp,Tr=ct.arg,xr=ct.baseQueryMeta,Ne=ct.requestId,he=(0,M.createNextState)(xt.data,(function(be){return Ft(be,ft,{arg:Tr.originalArgs,baseQueryMeta:xr,fulfilledTimeStamp:Qt,requestId:Ne})}));xt.data=he}else xt.data=ft;else xt.data=(Bt=Ii[ct.arg.endpointName].structuralSharing)==null||Bt?A(xt.data,ft):ft;delete xt.error,xt.fulfilledTimeStamp=ct.fulfilledTimeStamp}}))})).addCase(tn.rejected,(function(it,wt){var ct=wt.meta,ft=ct.condition,xt=ct.requestId,Bt=wt.error,Ft=wt.payload;Pe(it,ct.arg.queryCacheKey,(function(Qt){if(!ft){if(Qt.requestId!==xt)return;Qt.status=e.rejected,Qt.error=Ft??Bt}}))})).addMatcher(Mr,(function(it,wt){for(var ct=Er(wt).queries,ft=0,xt=Object.entries(ct);ft<xt.length;ft++){var Bt=xt[ft],Ft=Bt[1];(Ft==null?void 0:Ft.status)!==e.fulfilled&&(Ft==null?void 0:Ft.status)!==e.rejected||(it[Bt[0]]=Ft)}}))}}),Yt=(0,M.createSlice)({name:Or+"/mutations",initialState:He,reducers:{removeMutationResult:{reducer:function(vt,it){var wt=Ae(it.payload);wt in vt&&delete vt[wt]},prepare:(0,M.prepareAutoBatched)()}},extraReducers:function(vt){vt.addCase(Ln.pending,(function(it,wt){var ct=wt.meta,ft=ct.requestId,xt=ct.arg,Bt=ct.startedTimeStamp;xt.track&&(it[Ae(wt.meta)]={requestId:ft,status:e.pending,endpointName:xt.endpointName,startedTimeStamp:Bt})})).addCase(Ln.fulfilled,(function(it,wt){var ct=wt.payload,ft=wt.meta;ft.arg.track&&Ue(it,ft,(function(xt){xt.requestId===ft.requestId&&(xt.status=e.fulfilled,xt.data=ct,xt.fulfilledTimeStamp=ft.fulfilledTimeStamp)}))})).addCase(Ln.rejected,(function(it,wt){var ct=wt.payload,ft=wt.error,xt=wt.meta;xt.arg.track&&Ue(it,xt,(function(Bt){Bt.requestId===xt.requestId&&(Bt.status=e.rejected,Bt.error=ct??ft)}))})).addMatcher(Mr,(function(it,wt){for(var ct=Er(wt).mutations,ft=0,xt=Object.entries(ct);ft<xt.length;ft++){var Bt=xt[ft],Ft=Bt[0],Qt=Bt[1];(Qt==null?void 0:Qt.status)!==e.fulfilled&&(Qt==null?void 0:Qt.status)!==e.rejected||Ft===(Qt==null?void 0:Qt.requestId)||(it[Ft]=Qt)}}))}}),Lt=(0,M.createSlice)({name:Or+"/invalidation",initialState:He,reducers:{},extraReducers:function(vt){vt.addCase(mt.actions.removeQueryResult,(function(it,wt){for(var ct=wt.payload.queryCacheKey,ft=0,xt=Object.values(it);ft<xt.length;ft++)for(var Bt=0,Ft=Object.values(xt[ft]);Bt<Ft.length;Bt++){var Qt=Ft[Bt],Tr=Qt.indexOf(ct);Tr!==-1&&Qt.splice(Tr,1)}})).addMatcher(Mr,(function(it,wt){for(var ct,ft,xt,Bt,Ft=Er(wt).provided,Qt=0,Tr=Object.entries(Ft);Qt<Tr.length;Qt++)for(var xr=Tr[Qt],Ne=xr[0],he=0,be=Object.entries(xr[1]);he<be.length;he++)for(var Le=be[he],Ve=Le[0],Xt=Le[1],or=(Bt=(ft=(ct=it[Ne])!=null?ct:it[Ne]={})[xt=Ve||"__internal_without_id"])!=null?Bt:ft[xt]=[],Rr=0,ki=Xt;Rr<ki.length;Rr++){var $i=ki[Rr];or.includes($i)||or.push($i)}})).addMatcher((0,M.isAnyOf)((0,M.isFulfilled)(tn),(0,M.isRejectedWithValue)(tn)),(function(it,wt){for(var ct,ft,xt,Bt,Ft=ne(wt,"providesTags",Ii,Cr),Qt=wt.meta.arg.queryCacheKey,Tr=0,xr=Object.values(it);Tr<xr.length;Tr++)for(var Ne=0,he=Object.values(xr[Tr]);Ne<he.length;Ne++){var be=he[Ne],Le=be.indexOf(Qt);Le!==-1&&be.splice(Le,1)}for(var Ve=0,Xt=Ft;Ve<Xt.length;Ve++){var or=Xt[Ve],Rr=or.type,ki=or.id,$i=(Bt=(ft=(ct=it[Rr])!=null?ct:it[Rr]={})[xt=ki||"__internal_without_id"])!=null?Bt:ft[xt]=[];$i.includes(Qt)||$i.push(Qt)}}))}}),St=(0,M.createSlice)({name:Or+"/subscriptions",initialState:He,reducers:{updateSubscriptionOptions:function(vt,it){},unsubscribeQueryResult:function(vt,it){},internal_probeSubscription:function(vt,it){}}}),Pt=(0,M.createSlice)({name:Or+"/internalSubscriptions",initialState:He,reducers:{subscriptionsUpdated:function(vt,it){return(0,Re.applyPatches)(vt,it.payload)}}}),fr=(0,M.createSlice)({name:Or+"/config",initialState:y({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},$n),reducers:{middlewareRegistered:function(vt,it){vt.middlewareRegistered=vt.middlewareRegistered!=="conflict"&&Qr===it.payload||"conflict"}},extraReducers:function(vt){vt.addCase(K,(function(it){it.online=!0})).addCase(ge,(function(it){it.online=!1})).addCase(V,(function(it){it.focused=!0})).addCase(Y,(function(it){it.focused=!1})).addMatcher(Mr,(function(it){return y({},it)}))}}),qt=(0,M.combineReducers)({queries:mt.reducer,mutations:Yt.reducer,provided:Lt.reducer,subscriptions:Pt.reducer,config:fr.reducer});return{reducer:function(vt,it){return qt(Ur.match(it)?void 0:vt,it)},actions:b(y(y(y(y(y({},fr.actions),mt.actions),St.actions),Pt.actions),Yt.actions),{unsubscribeMutationResult:Yt.actions.removeMutationResult,resetApiState:Ur})}})({context:Ke,queryThunk:Ee,mutationThunk:Me,reducerPath:Ze,assertTagType:Z,config:{refetchOnFocus:H,refetchOnReconnect:J,refetchOnMountOrArgChange:F,keepUnusedData
4For:Et,reducerPath:Ze}}),Nt=Ct.reducer,nr=Ct.actions;Jr($e.util,{patchQueryData:De,updateQueryData:Be,upsertQueryData:Je,prefetch:nt,resetApiState:nr.resetApiState}),Jr($e.internalActions,nr);var gr=(function(er){var Or=er.reducerPath,tn=er.queryThunk,Ln=er.api,Fn=er.context,Ii=Fn.apiUid,Qr={invalidateTags:(0,at.createAction)(Or+"/invalidateTags")},Er=[Ks,gt,ir,_r,dr,Ti];return{middleware:function(Cr){var $n=!1,Ur=b(y({},er),{internalState:{currentSubscriptions:{}},refetchQuery:Mr}),mt=Er.map((function(St){return St(Ur)})),Yt=(function(St){var Pt=St.api,fr=St.queryThunk,qt=St.internalState,vt=Pt.reducerPath+"/subscriptions",it=null,wt=!1,ct=Pt.internalActions,ft=ct.updateSubscriptionOptions,xt=ct.unsubscribeQueryResult;return function(Bt,Ft){var Qt,Tr;if(it||(it=JSON.parse(JSON.stringify(qt.currentSubscriptions))),Pt.internalActions.internal_probeSubscription.match(Bt)){var xr=Bt.payload;return[!1,!!((Qt=qt.currentSubscriptions[xr.queryCacheKey])!=null&&Qt[xr.requestId])]}var Ne=(function(Le,Ve){var Xt,or,Rr,ki,$i,vd,K0,Q0,Y0;if(ft.match(Ve)){var bh=Ve.payload,f2=bh.queryCacheKey,jo=bh.requestId;return(Xt=Le==null?void 0:Le[f2])!=null&&Xt[jo]&&(Le[f2][jo]=bh.options),!0}if(xt.match(Ve)){var CI=Ve.payload;return jo=CI.requestId,Le[f2=CI.queryCacheKey]&&delete Le[f2][jo],!0}if(Pt.internalActions.removeQueryResult.match(Ve))return delete Le[Ve.payload.queryCacheKey],!0;if(fr.pending.match(Ve)){var SI=Ve.meta;if(jo=SI.requestId,(vh=SI.arg).subscribe)return(h2=(Rr=Le[or=vh.queryCacheKey])!=null?Rr:Le[or]={})[jo]=($i=(ki=vh.subscriptionOptions)!=null?ki:h2[jo])!=null?$i:{},!0}if(fr.rejected.match(Ve)){var h2,K5=Ve.meta,vh=K5.arg;if(jo=K5.requestId,K5.condition&&vh.subscribe)return(h2=(K0=Le[vd=vh.queryCacheKey])!=null?K0:Le[vd]={})[jo]=(Y0=(Q0=vh.subscriptionOptions)!=null?Q0:h2[jo])!=null?Y0:{},!0}return!1})(qt.currentSubscriptions,Bt);if(Ne){wt||(xn((function(){var Le=JSON.parse(JSON.stringify(qt.currentSubscriptions)),Ve=(0,ti.produceWithPatches)(it,(function(){return Le}));Ft.next(Pt.internalActions.subscriptionsUpdated(Ve[1])),it=Le,wt=!1})),wt=!0);var he=!!((Tr=Bt.type)!=null&&Tr.startsWith(vt)),be=fr.rejected.match(Bt)&&Bt.meta.condition&&!!Bt.meta.arg.subscribe;return[!he&&!be,!1]}return[!0,!1]}})(Ur),Lt=(function(St){var Pt=St.reducerPath,fr=St.context,qt=St.refetchQuery,vt=St.internalState,it=St.api.internalActions.removeQueryResult;function wt(ct,ft){var xt=ct.getState()[Pt],Bt=xt.queries,Ft=vt.currentSubscriptions;fr.batch((function(){for(var Qt=0,Tr=Object.keys(Ft);Qt<Tr.length;Qt++){var xr=Tr[Qt],Ne=Bt[xr],he=Ft[xr];he&&Ne&&(Object.values(he).some((function(be){return be[ft]===!0}))||Object.values(he).every((function(be){return be[ft]===void 0}))&&xt.config[ft])&&(Object.keys(he).length===0?ct.dispatch(it({queryCacheKey:xr})):Ne.status!==e.uninitialized&&ct.dispatch(qt(Ne,xr)))}}))}return function(ct,ft){V.match(ct)&&wt(ft,"refetchOnFocus"),K.match(ct)&&wt(ft,"refetchOnReconnect")}})(Ur);return function(St){return function(Pt){$n||($n=!0,Cr.dispatch(Ln.internalActions.middlewareRegistered(Ii)));var fr,qt=b(y({},Cr),{next:St}),vt=Cr.getState(),it=Yt(Pt,qt,vt),wt=it[1];if(fr=it[0]?St(Pt):wt,Cr.getState()[Or]&&(Lt(Pt,qt,vt),(function(xt){return!!xt&&typeof xt.type=="string"&&xt.type.startsWith(Or+"/")})(Pt)||Fn.hasRehydrationInfo(Pt)))for(var ct=0,ft=mt;ct<ft.length;ct++)(0,ft[ct])(Pt,qt,vt);return fr}}},actions:Qr};function Mr(Cr,$n,Ur){return Ur===void 0&&(Ur={}),tn(y({type:"query",endpointName:Cr.endpointName,originalArgs:Cr.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:$n},Ur))}})({reducerPath:Ze,context:Ke,queryThunk:Ee,mutationThunk:Me,api:$e,assertTagType:Z}),Fr=gr.middleware;Jr($e.util,gr.actions),Jr($e,{reducer:Nt,middleware:Fr});var kn=(function(er){var Or=er.serializeQueryArgs,tn=er.reducerPath,Ln=function(Er){return N},Fn=function(Er){return G};return{buildQuerySelector:function(Er,Mr){return function(Cr){var $n=Or({queryArgs:Cr,endpointDefinition:Mr,endpointName:Er});return(0,me.createSelector)(Cr===Qe?Ln:function(Ur){var mt,Yt,Lt;return(Lt=(Yt=(mt=Qr(Ur))==null?void 0:mt.queries)==null?void 0:Yt[$n])!=null?Lt:N},Ii)}},buildMutationSelector:function(){return function(Er){var Mr,Cr;return Cr=typeof Er=="object"?(Mr=Ae(Er))!=null?Mr:Qe:Er,(0,me.createSelector)(Cr===Qe?Fn:function($n){var Ur,mt,Yt;return(Yt=(mt=(Ur=Qr($n))==null?void 0:Ur.mutations)==null?void 0:mt[Cr])!=null?Yt:G},Ii)}},selectInvalidatedBy:function(Er,Mr){for(var Cr,$n=Er[tn],Ur=new Set,mt=0,Yt=Mr.map(R);mt<Yt.length;mt++){var Lt=Yt[mt],St=$n.provided[Lt.type];if(St)for(var Pt=0,fr=(Cr=Lt.id!==void 0?St[Lt.id]:_(Object.values(St)))!=null?Cr:[];Pt<fr.length;Pt++)Ur.add(fr[Pt])}return _(Array.from(Ur.values()).map((function(qt){var vt=$n.queries[qt];return vt?[{queryCacheKey:qt,endpointName:vt.endpointName,originalArgs:vt.originalArgs}]:[]})))}};function Ii(Er){return y(y({},Er),{status:Mr=Er.status,isUninitialized:Mr===e.uninitialized,isLoading:Mr===e.pending,isSuccess:Mr===e.fulfilled,isError:Mr===e.rejected});var Mr}function Qr(Er){return Er[tn]}})({serializeQueryArgs:_t,reducerPath:Ze}),Wr=kn.buildQuerySelector,Kr=kn.buildMutationSelector;Jr($e.util,{selectInvalidatedBy:kn.selectInvalidatedBy});var en=(function(er){var Or=er.serializeQueryArgs,tn=er.queryThunk,Ln=er.mutationThunk,Fn=er.api,Ii=er.context,Qr=new Map,Er=new Map,Mr=Fn.internalActions,Cr=Mr.unsubscribeQueryResult,$n=Mr.removeMutationResult,Ur=Mr.updateSubscriptionOptions;return{buildInitiateQuery:function(mt,Yt){var Lt=function(St,Pt){var fr=Pt===void 0?{}:Pt,qt=fr.subscribe,vt=qt===void 0||qt,it=fr.forceRefetch,wt=fr.subscriptionOptions,ct=fr[ie];return function(ft,xt){var Bt,Ft,Qt=Or({queryArgs:St,endpointDefinition:Yt,endpointName:mt}
4),Tr=tn(((Bt={type:"query",subscribe:vt,forceRefetch:it,subscriptionOptions:wt,endpointName:mt,originalArgs:St,queryCacheKey:Qt})[ie]=ct,Bt)),xr=Fn.endpoints[mt].select(St),Ne=ft(Tr),he=xr(xt()),be=Ne.requestId,Le=Ne.abort,Ve=he.requestId!==be,Xt=(Ft=Qr.get(ft))==null?void 0:Ft[Qt],or=function(){return xr(xt())},Rr=Object.assign(ct?Ne.then(or):Ve&&!Xt?Promise.resolve(he):Promise.all([Xt,Ne]).then(or),{arg:St,requestId:be,subscriptionOptions:wt,queryCacheKey:Qt,abort:Le,unwrap:function(){return x(this,null,(function(){var $i;return n(this,(function(vd){switch(vd.label){case 0:return[4,Rr];case 1:if(($i=vd.sent()).isError)throw $i.error;return[2,$i.data]}}))}))},refetch:function(){return ft(Lt(St,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){vt&&ft(Cr({queryCacheKey:Qt,requestId:be}))},updateSubscriptionOptions:function($i){Rr.subscriptionOptions=$i,ft(Ur({endpointName:mt,requestId:be,queryCacheKey:Qt,options:$i}))}});if(!Xt&&!Ve&&!ct){var ki=Qr.get(ft)||{};ki[Qt]=Rr,Qr.set(ft,ki),Rr.then((function(){delete ki[Qt],Object.keys(ki).length||Qr.delete(ft)}))}return Rr}};return Lt},buildInitiateMutation:function(mt){return function(Yt,Lt){var St=Lt===void 0?{}:Lt,Pt=St.track,fr=Pt===void 0||Pt,qt=St.fixedCacheKey;return function(vt,it){var wt=Ln({type:"mutation",endpointName:mt,originalArgs:Yt,track:fr,fixedCacheKey:qt}),ct=vt(wt),ft=ct.requestId,xt=ct.abort,Bt=ct.unwrap,Ft=ct.unwrap().then((function(Ne){return{data:Ne}})).catch((function(Ne){return{error:Ne}})),Qt=function(){vt($n({requestId:ft,fixedCacheKey:qt}))},Tr=Object.assign(Ft,{arg:ct.arg,requestId:ft,abort:xt,unwrap:Bt,unsubscribe:Qt,reset:Qt}),xr=Er.get(vt)||{};return Er.set(vt,xr),xr[ft]=Tr,Tr.then((function(){delete xr[ft],Object.keys(xr).length||Er.delete(vt)})),qt&&(xr[qt]=Tr,Tr.then((function(){xr[qt]===Tr&&(delete xr[qt],Object.keys(xr).length||Er.delete(vt))}))),Tr}}},getRunningQueryThunk:function(mt,Yt){return function(Lt){var St,Pt=Or({queryArgs:Yt,endpointDefinition:Ii.endpointDefinitions[mt],endpointName:mt});return(St=Qr.get(Lt))==null?void 0:St[Pt]}},getRunningMutationThunk:function(mt,Yt){return function(Lt){var St;return(St=Er.get(Lt))==null?void 0:St[Yt]}},getRunningQueriesThunk:function(){return function(mt){return Object.values(Qr.get(mt)||{}).filter(ee)}},getRunningMutationsThunk:function(){return function(mt){return Object.values(Er.get(mt)||{}).filter(ee)}},getRunningOperationPromises:function(){var mt=function(Yt){return Array.from(Yt.values()).flatMap((function(Lt){return Lt?Object.values(Lt):[]}))};return i(i([],mt(Qr)),mt(Er)).filter(ee)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK. 5 Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details. 6 See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}})({queryThunk:Ee,mutationThunk:Me,api:$e,serializeQueryArgs:_t,context:Ke}),wa=en.buildInitiateQuery,zi=en.buildInitiateMutation;return Jr($e.util,{getRunningOperationPromises:en.getRunningOperationPromises,getRunningOperationPromise:en.removalWarning,getRunningMutationThunk:en.getRunningMutationThunk,getRunningMutationsThunk:en.getRunningMutationsThunk,getRunningQueryThunk:en.getRunningQueryThunk,getRunningQueriesThunk:en.getRunningQueriesThunk}),{name:Wi,injectEndpoint:function(er,Or){var tn,Ln=$e;(tn=Ln.endpoints)[er]!=null||(tn[er]={}),_e(Or)?Jr(Ln.endpoints[er],{name:er,select:Wr(er,Or),initiate:wa(er,Or)},et(Ee,er)):Or.type===Q.mutation&&Jr(Ln.endpoints[er],{name:er,select:Kr(),initiate:zi(er)},et(Me,er))}}}}},Wa=Te(jt())})(wd)),wd}var dk;
6function oae(){return dk||(dk=1,a6.exports=aae()),a6.exports}var cae=oae();const lae=new Error("request for lock canceled");var uae=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};class dae{constructor(e,r=lae){this._value=e,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,i)=>{const s={resolve:n,reject:i,weight:e,priority:r},a=_q(this._queue,o=>r<=o.priority);a===-1&&e<=this._value?this._dispatchItem(s):this._queue.splice(a+1,0,s)})}runExclusive(e){return uae(this,arguments,void 0,function*(r,n=1,i=0){const[s,a]=yield this.acquire(n,i);try{return yield r(s)}finally{a()}})}waitForUnlock(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),fae(this._weightedWaiters[e-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const r=this._value;this._value-=e.weight,e.resolve([r,this._newReleaser(e.weight)])}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const r=this._weightedWaiters[e-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const i=n.findIndex(s=>s.priority<=e);(i===-1?n:n.splice(0,i)).forEach((s=>s.resolve()))}}}_couldLockImmediately(e,r){return(this._queue.length===0||this._queue[0].priority<r)&&e<=this._value}}function fae(t,e){const r=_q(t,n=>e.priority<=n.priority);t.splice(r+1,0,e)}function _q(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}var hae=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};class pae{constructor(e){this._semaphore=new dae(1,e)}acquire(){return hae(this,arguments,void 0,function*(e=0){const[,r]=yield this._semaphore.acquire(1,e);return r})}runExclusive(e,r=0){return this._semaphore.runExclusive(()=>e(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const E2=new pae,fk=cae.fetchBaseQuery({baseUrl:nq,prepareHeaders:t=>{const e=localStorage.getItem(qp);return e&&t.set("Authorization",`Bearer ${e}`),t}}),gae=async(t,e,r)=>{await E2.waitForUnlock();let n=await fk(t,e,r);if(n.error&&n.error.status)switch(n.error.status){case 401:if(E2.isLocked())await E2.waitForUnlock(),n=await fk(t,e,r);else{const i=await E2.acquire();localStorage.removeItem(qp),localStorage.removeItem(zh),i()}break}return n},dp={getChatToken:async()=>await Xe.get("/p2p/token-chat"),getAllAds:async t=>await Xe.get(`/p2p/random-ads?${_b(t)}`),getAllOrders:async t=>await Xe.get(`/p2p/orders?${_b(t)}`),getAdminOrders:async()=>await Xe.get("/p2p-admin/orders"),getAdminAds:async()=>await Xe.get("/p2p-admin/ads"),getAdsByIdForAdmin:async t=>await Xe.get(`/p2p-admin/ads/${t}`),updateAdminAds:async(t,e)=>await Xe.put(`/p2p-admin/ads/${t}`,e),getDisputeOrders:async()=>await Xe.get("/p2p-admin/dispute"),disputeReason:async t=>await Xe.get(`/p2p-admin/dispute/${t}`),detailOrderForAdmin:async t=>await Xe.get(`/p2p-admin/orders/${t}`),acceptBusiness:async t=>await Xe.get(`/p2p-admin/approve-business/${t}`),rejectBusiness:async t=>await Xe.get(`/p2p-admin/reject-business/${t}`),getOrderById:async t=>await Xe.get(`/p2p/order-by-id/${t}`),createSellOrder:async t=>await Xe.post("/p2p/create-sell-order",t),createBuyOrder:async t=>await Xe.post("/p2p/create-buy-order",t),createPayment:async t=>await Xe.post("p2p/create-payment",t),updatePayment:async t=>await Xe.post("p2p/update-payment",t),deletePayment:async t=>await Xe.delete(`/p2p/delete-payment/${t}`),getPaymentMenthod:async()=>await Xe.get("p2p/payment-methods"),getProfileP2P:async t=>await Xe.post("/p2p/user-profile",{userId:t}),confirmPayment:async(t,e)=>await Xe.post(`p2p/confirm-payment/${t}`,e),cancelPayment:async(t,e)=>await Xe.post(`p2p/cancel-order/${t}`,{cancelReason:e}),unlockOrder:async t=>await Xe.post(`p2p/unlock-order/${t}`),unlockOrderForAdmin:async t=>await Xe.post(`p2p-admin/unlock-dispute/${t}`),refundOrderForAdmin:async t=>await Xe.post(`p2p-admin/refund-dispute/${t}`),getQuickReply:async()=>await Xe.get("p2p/quick-reply"),createQuickReply:async t=>await Xe.post("p2p/quick-reply",{message:t}),deleteQuickReply:async t=>await Xe.delete(`p2p/quick-reply/${t}
6`),updateQuickReply:async(t,e)=>await Xe.put(`p2p/quick-reply/${t}`,{message:e}),rateOrder:async(t,e,r)=>await Xe.post("p2p/rate-order",{isLiked:e,orderId:t,review:r}),getReview:async t=>await Xe.get(`p2p/reviews/${t}`),getToken:async()=>await Xe.get("p2p/token-chat"),getUserChat:async()=>await Xe.get("p2p/user-chat"),getPendingMessage:async()=>await Xe.get("p2p/pending-message"),createDispute:async t=>await Xe.post("p2p/dispute",t),adminGetTransaction:async t=>await Xe.get(`/p2p-admin/funding-history?${_b(t)}`),businessDeposit:async t=>await Xe.post("p2p/business-deposit",t),applyBusiness:async t=>await Xe.post("/p2p/apply-business",t)},ff=nae({reducerPath:"adsApi",baseQuery:gae,endpoints:t=>({getAllUserAds:t.query({query:e=>({url:`/p2p/user-ads?${_b(e)}`,method:"GET"})}),deleteUserAd:t.mutation({query:e=>({url:`/p2p/delete-ads/${e}`,method:"DELETE"})}),getUserAdDetail:t.query({query:e=>({url:`/p2p/ads/${e}`,method:"GET"})}),createNewAd:t.mutation({query:e=>({url:"/p2p/create-ads",method:"POST",body:e})}),updateCurrentAd:t.mutation({query:e=>({url:"/p2p/update-ads",method:"POST",body:e})}),getUSDVNDexchange:t.query({query:()=>({url:"/p2p/exchange-rate",method:"GET"})})})}),{useGetAllUserAdsQuery:Ntt,useDeleteUserAdMutation:Ptt,useCreateNewAdMutation:Ott,useUpdateCurrentAdMutation:Rtt,useGetUSDVNDexchangeQuery:Dtt,useGetUserAdDetailQuery:Mtt}=ff,mae=pn("p2p/exchangeRate",async()=>{try{return await Xe.get("/p2p/exchange-rate")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),yae=pn("p2p/fetchPaymentMethod",async()=>{try{return await Xe.get("/p2p/payment-methods")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),bae=pn("p2p/fetchP2PConfig",async()=>{try{return await Xe.get("/admin/p2p-config")}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),vae=pn("p2p/fetchAllOrder",async t=>{try{return await dp.getAllOrders(t)}catch(e){throw Error((e==null?void 0:e.message)||"Redux: something error")}}),wae=pn("p2p/fetchOrderById",async t=>{var e,r;try{return await dp.getOrderById(t)}catch(n){throw sv.error((e=n==null?void 0:n.data)==null?void 0:e.message),Error(((r=n==null?void 0:n.data)==null?void 0:r.message)||"Redux: something error")}}),Eae={selectedAds:null,userOnline:[{id:"",online:!1}],totalUnreadCount:0,exchangeRate:0,pendingOrders:0,paymentMethods:[],p2pConfig:{},p2pOrder:{},p2pDetailOrder:{},p2pMyOrders:[]},Cq=os({name:"p2p",initialState:Eae,reducers:{selectedAds(t,e){const r=e.payload;t.selectedAds=r},userOnline(t,e){const r=e.payload;t.userOnline=Array.from(r.map(n=>({id:n.id,online:n.online})))},totalUnreadCount(t,e){t.totalUnreadCount=e.payload},pendingOrders(t,e){t.pendingOrders=e.payload},newPendingP2POrder(t,e){t.p2pOrder=e.payload},p2pOrderPaid(t,e){t.p2pOrder=e.payload},p2pOrderReleased(t){t.p2pOrder={}},clearP2POrder(t){t.p2pMyOrders=[]}},extraReducers:t=>{t.addCase(mae.fulfilled,(e,r)=>{const n=r.payload;e.exchangeRate=n}).addCase(yae.fulfilled,(e,r)=>{const n=r.payload;e.paymentMethods=n}).addCase(bae.fulfilled,(e,r)=>{const n=r.payload;e.p2pConfig=n}).addCase(vae.fulfilled,(e,r)=>{const n=r.payload;e.p2pMyOrders=n.data}).addCase(wae.fulfilled,(e,r)=>{const n=r.payload;e.p2pDetailOrder=n})}}),{selectedAds:jtt,userOnline:xae,totalUnreadCount:hk,pendingOrders:Ltt,newPendingP2POrder:Ftt,p2pOrderPaid:Utt,p2pOrderReleased:Btt,clearP2POrder:qtt}=Cq.actions,_ae=Cq.reducer,jC={getWalletToken:async t=>Xe.get(`/moralis/wallet-tokens${t?`?chainId=${t}`:""}`),getWalletHistory:async()=>Xe.get("/moralis/wallet-history"),getTokenTransfers:async t=>Xe.get(`/moralis/erc20-token-transfers/${t}`),getNativeTokenTransfers:async()=>Xe.get("/moralis/native-token-transfers"),getErc20TokenPrice:async()=>Xe.get("/moralis/erc20-token-price")},Cae=async()=>Xe.get("/p2p/funding-balance"),Sae=async()=>(await Xe.get("/p2p/funding-history")).tnx,Aae=async({page:t,size:e,type:r,status:n,limit:i})=>await Xe.post("/gobank/transactions",{page:t,size:e,type:r,status:n,limit:i}),Tae=pn("user/fetch-funding-balance",async()=>{try{return await Cae()}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),Iae=pn("user/fetch-history",async()=>{try{return await Sae()}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),kae=pn("user/wallet-history",async()=>
6{try{const t=["token swap","receive","token receive","token send"];return(await jC.getWalletHistory()).result.filter(n=>t.includes(n.category))}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),$ae=pn("user/gobank-history",async()=>{try{return await Aae({type:"",status:""})}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),Nae={funding:"0",history:[],walletHistory:[],gobankHistory:[],searchToken:""},Sq=os({name:"user",initialState:Nae,reducers:{setSearchToken:(t,e)=>{t.searchToken=e.payload}},extraReducers:t=>{t.addCase(Tae.fulfilled,(e,r)=>{const n=r.payload;e.funding=n}),t.addCase(Iae.fulfilled,(e,r)=>{const n=r.payload;e.history=n}),t.addCase(kae.fulfilled,(e,r)=>{const n=r.payload;e.walletHistory=n}),t.addCase($ae.fulfilled,(e,r)=>{const n=r.payload.data;e.gobankHistory=n})}}),{setSearchToken:Wtt}=Sq.actions,Pae=Sq.reducer,Oae="units/5.8.0",Rae=new tt(Oae),Aq=["wei","kwei","mwei","gwei","szabo","finney","ether"];function LC(t,e){if(typeof e=="string"){const r=Aq.indexOf(e);r!==-1&&(e=3*r)}return bne(t,e??18)}function pk(t,e){if(typeof t!="string"&&Rae.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=Aq.indexOf(e);r!==-1&&(e=3*r)}return vne(t,e??18)}function Tq(t){return LC(t,18)}const Wp=new wne(qie[sd]),Iq=Pr("tokens/updateTokenData"),Dae=Pr("tokens/addTokenKeys"),Mae=Pr("tokens/addPoolAddresses"),jae=Pr("tokens/updateChartData"),Lae=Pr("tokens/updateTransactions"),Fae=Pr("tokens/updatePriceData"),gk=pn("tokens/fetchPrices",async()=>{try{const[t,e]=await Promise.all([jC.getErc20TokenPrice(),Wp.getFeeData()]),r=e.gasPrice||Ene.from(0),n=LC(r,"gwei");return{prices:t,gasPriceInGwei:n}}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),Uae=()=>new Date().getTime(),Bae={byAddress:{[wl.ETHEREUM]:{},[wl.ARBITRUM]:{}},prices:{btc:null,eth:null,gas:null}},qae=qw(Bae,t=>t.addCase(Iq,(e,{payload:{tokens:r,networkId:n}})=>{r.map(i=>e.byAddress[n][i.address]={...e.byAddress[n][i.address],data:i,lastUpdated:Uae()})}).addCase(Dae,(e,{payload:{tokenAddresses:r,networkId:n}})=>{r.map(i=>{e.byAddress[n][i]||(e.byAddress[n][i]={poolAddresses:void 0,data:void 0,chartData:void 0,priceData:{},transactions:void 0,lastUpdated:void 0})})}).addCase(Mae,(e,{payload:{tokenAddress:r,poolAddresses:n,networkId:i}})=>{e.byAddress[i][r]={...e.byAddress[i][r],poolAddresses:n}}).addCase(jae,(e,{payload:{tokenAddress:r,chartData:n,networkId:i}})=>{e.byAddress[i][r]={...e.byAddress[i][r],chartData:n}}).addCase(Lae,(e,{payload:{tokenAddress:r,transactions:n,networkId:i}})=>{e.byAddress[i][r]={...e.byAddress[i][r],transactions:n}}).addCase(Fae,(e,{payload:{tokenAddress:r,secondsInterval:n,priceData:i,oldestFetchedTimestamp:s,networkId:a}})=>{e.byAddress[a][r]={...e.byAddress[a][r],priceData:{...e.byAddress[a][r].priceData,[n]:i,oldestFetchedTimestamp:s}}}).addCase(gk.fulfilled,(e,r)=>{const{prices:n,gasPriceInGwei:i}=r.payload,s=n.reduce((a,o)=>(o.tokenSymbol==="WETH"?a.eth=o.usdPriceFormatted:o.tokenSymbol==="WBTC"&&(a.btc=o.usdPriceFormatted),a),{eth:"0",btc:"0",gas:i});e.prices=s}).addCase(gk.rejected,e=>{e.prices={eth:"0",btc:"0",gas:"0"}})),Wae=pn("admin/dispute",async()=>{try{return await dp.getDisputeOrders()}catch(t){throw Error((t==null?void 0:t.message)||"Redux: something error")}}),zae={dispute:[]},Vae=os({name:"admin",initialState:zae,reducers:{},extraReducers:t=>{t.addCase(Wae.fulfilled,(e,r)=>{const n=r.payload;e.dispute=n})}}),Hae=Vae.reducer;var kq=(t=>(t.Fixed="Fixed",t.Float="Float",t))(kq||{}),$q=(t=>(t.USDT="USDT",t.BTC="BTC",t))($q||{}),Nq=(t=>(t.VND="VND",t.USD="USD",t))(Nq||{});const cr=t=>typeof t=="string",X0=()=>{let t,e;const r=new Promise((n,i)=>{t=n,e=i});return r.resolve=t,r.reject=e,r},mk=t=>t==null?"":""+t,Gae=(t,e,r)=>{t.forEach(n=>{e[n]&&(r[n]=e[n])})},Kae=/###/g,yk=t=>t&&t.indexOf("###")>-1?t.replace(Kae,"."):t,bk=t=>!t||cr(t),b1=(t,e,r)=>{const n=cr(e)?e.split("."):e;let i=0;for(;i<n.length-1;){if(bk(t))return{};const s=yk(n[i]);!t[s]&&r&&(t[s]=new r),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return bk(t)?{}:{obj:t,k:yk(n[i])}},vk=(t,e,r)=>{const{obj:n,k:i}=b1(t,e,Object);if(n!==void 0||e.length===1){n[i]=r;return}let s=e[e.length-1],a=e.slice(0,e.length-1),o=b1(t,a,Object);for(;o.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),o=b1(t,a,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${s}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${s}`]=r},Qae=(t,e,r,n)=>{const{obj:i,k:s}=b1(t,e,Object);i[s]=i[s]||[],i[s].push(r)},gv=(t,e)=>{const{obj:r,k:n}=b1(t,e);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Yae=(t,e,r)=>{const n=gv(t,r);return n!==void 0?n:gv(e,r)},Pq=(t,e,r)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?cr(t[n])||t[n]instanceof String||cr(e[
vendor: 4,512 bytes, line 6
6n])||e[n]instanceof String?r&&(t[n]=e[n]):Pq(t[n],e[n],r):t[n]=e[n]);return t},wh=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Zae={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Xae=t=>cr(t)?t.replace(/[&<>"'\/]/g,e=>Zae[e]):t;class Jae{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const r=this.regExpMap.get(e);if(r!==void 0)return r;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const eoe=[" ",",","?","!",";"],toe=new Jae(20),roe=(t,e,r)=>{e=e||"",r=r||"";const n=eoe.filter(a=>e.indexOf(a)<0&&r.indexOf(a)<0);if(n.length===0)return!0;const i=toe.getRegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!i.test(t);if(!s){const a=t.indexOf(r);a>0&&!i.test(t.substring(0,a))&&(s=!0)}return s},b_=function(t,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const n=e.split(r);let i=t;for(let s=0;s<n.length;){if(!i||typeof i!="object")return;let a,o="";for(let c=s;c<n.length;++c)if(c!==s&&(o+=r),o+=n[c],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&c<n.length-1)continue;s+=c-s+1;break}i=a}return i},mv=t=>t==null?void 0:t.replace("_","-"),noe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var r,n;(n=(r=console==null?void 0:console[t])==null?void 0:r.apply)==null||n.call(r,console,e)}};class yv{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,r)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=e||noe,this.options=r,this.debug=r.debug}log(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(e,r,n,i){return i&&!this.debug?null:(cr(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[r](e))}create(e){return new yv(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new yv(this.logger,e)}}var tc=new yv;let Hw=class{constructor(){this.observers={}}on(e,r){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const i=this.observers[n].get(r)||0;this.observers[n].set(r,i+1)}),this}off(e,r){if(this.observers[e]){if(!r){delete this.observers[e];return}this.observers[e].delete(r)}}emit(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(a=>{let[o,c]=a;for(let l=0;l<c;l++)o(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(a=>{let[o,c]=a;for(let l=0;l<c;l++)o.apply(o,[e,...n])})}};class wk extends Hw{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const r=this.options.ns.indexOf(e);r>-1&&this.options.ns.splice(r,1)}getResource(e,r,n){var l,u;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,r],n&&(Array.isArray(n)?o.push(...n):cr(n)&&s?o.push(...n.split(s)):o.push(n)));const c=gv(this.data,o);return!c&&!r&&!n&&e.indexOf(".")>-1&&(e=o[0],r=o[1],n=o.slice(2).join(".")),c||!a||!cr(n)?c:b_((u=(l=this.data)==null?void 0:l[e])==null?void 0:u[r],n,s)}addResource(e,r,n,i){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let o=[e,r];
vendor: 1,643 bytes, line 6
6n&&(o=o.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(o=e.split("."),i=r,r=o[1]),this.addNamespaces(r),vk(this.data,o,i),s.silent||this.emit("added",e,r,n,i)}addResources(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in n)(cr(n[s])||Array.isArray(n[s]))&&this.addResource(e,r,s,n[s],{silent:!0});i.silent||this.emit("added",e,r,n)}addResourceBundle(e,r,n,i,s){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,r];e.indexOf(".")>-1&&(o=e.split("."),i=n,n=r,r=o[1]),this.addNamespaces(r);let c=gv(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Pq(c,n,s):c={...c,...n},vk(this.data,o,c),a.silent||this.emit("added",e,r,n)}removeResourceBundle(e,r){this.hasResourceBundle(e,r)&&delete this.data[e][r],this.removeNamespaces(r),this.emit("removed",e,r)}hasResourceBundle(e,r){return this.getResource(e,r)!==void 0}getResourceBundle(e,r){return r||(r=this.options.defaultNS),this.getResource(e,r)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const r=this.getDataByLanguage(e);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var Oq={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,r,n,i){return t.forEach(s=>{var a;e=((a=this.processors[s])==null?void 0:a.process(e,r,n,i))??e}),e}};const Ek={},xk=t=>!cr(t)&&typeof t!="boolean"&&typeof t!="number";class bv extends Hw{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Gae(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
6i18nFormat","utils"],e,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=tc.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,r);return(n==null?void 0:n.res)!==void 0}extractFromKey(e,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let s=r.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!roe(e,n,i);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:cr(s)?[s]:s};const l=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(l[0])>-1)&&(s=l.shift()),e=l.join(i)}return{key:e,namespaces:cr(s)?[s]:s}}translate(e,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],r),c=o[o.length-1],l=r.lng||this.language,u=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((l==null?void 0:l.toLowerCase())==="cimode"){if(u){const P=r.nsSeparator||this.options.nsSeparator;return i?{res:`${c}${P}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${P}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:a}const d=this.resolve(e,r);let f=d==null?void 0:d.res;const h=(d==null?void 0:d.usedKey)||a,g=(d==null?void 0:d.exactUsedKey)||a,m=["[object Number]","[object Function]","[object RegExp]"],y=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,E=r.count!==void 0&&!cr(r.count),v=bv.hasDefaultValue(r),w=E?this.pluralResolver.getSuffix(l,r.count,r):"",x=r.ordinal&&E?this.pluralResolver.getSuffix(l,r.count,{ordinal:!1}):"",_=E&&!r.ordinal&&r.count===0,S=_&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue;let A=f;b&&!f&&v&&(A=S);const I=xk(A),$=Object.prototype.toString.apply(A);if(b&&A&&I&&m.indexOf($)<0&&!(cr(y)&&Array.isArray(A))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,A,{...r,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=P,d.usedParams=this.getUsedParamsDetails(r),d):P}if(s){const P=Array.isArray(A),j=P?[]:{},L=P?g:h;for(const B in A)if(Object.prototype.hasOwnProperty.call(A,B)){const k=`${L}${s}${B}`;v&&!f?j[B]=this.translate(k,{...r,defaultValue:xk(S)?S[B]:void 0,joinArrays:!1,ns:o}):j[B]=this.translate(k,{...r,joinArrays:!1,ns:o}),j[B]===k&&(j[B]=A[B])}f=j}}else if(b&&cr(y)&&Array.isArray(f))f=f.join(y),f&&(f=this.extendTranslation(f,e,r,n));else{let P=!1,j=!1;!this.isValidLookup(f)&&v&&(P=!0,f=S),this.isValidLookup(f)||(j=!0,f=a);const B=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:f,k=v&&S!==f&&this.options.updateMissing;if(j||P||k){if(this.logger.log(k?"updateKey":"missingKey",l,c,a,k?S:f),s){const W=this.resolve(a,{...r,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let D=[];const q=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&q&&q[0])for(let W=0;W<q.length;W++)D.push(q[W]);else this.options.saveMissingTo==="all"?D=this.languageUtils.toResolveHierarchy(r.lng||this.language):D.push(r.lng||this.language);const U=(W,V,Y)=>{var ge;const K=v&&Y!==f?Y:B;this.options.missingKeyHandler?this.options.missingKeyHandler(W,c,V,K,k,r):(ge=this.backendConnector)!=null&&ge.saveMissing&&this.backendConnector.saveMissing(W,c,V,K,k,r),this.emit
vendor: 17,506 bytes, line 6
6("missingKey",W,c,V,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?D.forEach(W=>{const V=this.pluralResolver.getSuffixes(W,r);_&&r[`defaultValue${this.options.pluralSeparator}zero`]&&V.indexOf(`${this.options.pluralSeparator}zero`)<0&&V.push(`${this.options.pluralSeparator}zero`),V.forEach(Y=>{U([W],a+Y,r[`defaultValue${Y}`]||S)})}):U(D,a,S))}f=this.extendTranslation(f,e,r,d,n),j&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${c}:${a}`),(j||P)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,P?f:void 0))}return i?(d.res=f,d.usedParams=this.getUsedParamsDetails(r),d):f}extendTranslation(e,r,n,i,s){var l,u;var a=this;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const d=cr(e)&&(((u=n==null?void 0:n.interpolation)==null?void 0:u.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const g=e.match(this.interpolator.nestingRegexp);f=g&&g.length}let h=n.replace&&!cr(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,n.lng||this.language||i.usedLng,n),d){const g=e.match(this.interpolator.nestingRegexp),m=g&&g.length;f<m&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var g=arguments.length,m=new Array(g),y=0;y<g;y++)m[y]=arguments[y];return(s==null?void 0:s[0])===m[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${r[0]}`),null):a.translate(...m,r)},n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,c=cr(o)?[o]:o;return e!=null&&(c!=null&&c.length)&&n.applyPostProcessor!==!1&&(e=Oq.handle(c,e,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,s,a,o;return cr(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,r),u=l.key;i=u;let d=l.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=r.count!==void 0&&!cr(r.count),h=f&&!r.ordinal&&r.count===0,g=r.context!==void 0&&(cr(r.context)||typeof r.context=="number")&&r.context!=="",m=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);d.forEach(y=>{var b,E;this.isValidLookup(n)||(o=y,!Ek[`${m[0]}-${y}`]&&((b=this.utils)!=null&&b.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Ek[`${m[0]}-${y}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(v=>{var _;if(this.isValidLookup(n))return;a=v;const w=[u];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(w,u,v,y,r);else{let S;f&&(S=this.pluralResolver.getSuffix(v,r.count,r));const A=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(w.push(u+S),r.ordinal&&S.indexOf(I)===0&&w.push(u+S.replace(I,this.options.pluralSeparator)),h&&w.push(u+A)),g){const $=`${u}${this.options.contextSeparator}${r.context}`;w.push($),f&&(w.push($+S),r.ordinal&&S.indexOf(I)===0&&w.push($+S.replace(I,this.options.pluralSeparator)),h&&w.push($+A))}}let x;for(;x=w.pop();)this.isValidLookup(n)||(s=x,n=this.getResource(v,y,x,r))}))})}),{res:n,usedKey:i,exactUsedKey:s,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,r,n){var s;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,r,n,i):this.resourceStore.getResource(e,r,n,i)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!cr(e.replace);let i=n?e.replace:e;if(n&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const s of r)delete i[s]}return i}static hasDefaultValue(e){const r="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&r===n.substring(0,r.length)&&e[n]!==void 0)return!0;return!1}}class _k{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=tc.create("languageUtils")}getScriptPartFromCode(e){if(e=mv(e),!e||e.indexOf("-")<0)return null;const r=e.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(e){if(e=mv(e),!e||e.indexOf("-")<0)return e;const r=e.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(e){if(cr(e)&&e.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(e)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let r;return e.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&e.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(e,r){if(!e)return[];if(typeof e=="function"&&(e=e(r)),cr(e)&&(e=[e]),Array.isArray(e))return e;if(!r)return e.default||[];let n=e[r];return n||(n=e[this.getScriptPartFromCode(r)]),n||(n=e[this.formatLanguageCode(r)]),n||(n=e[this.getLanguagePartFromCode(r)]),n||(n=e.default),n||[]}toResolveHierarchy(e,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],e),i=[],s=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return cr(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):cr(e)&&s(this.formatLanguageCode(e)),n.forEach(a=>{i.indexOf(a)<0&&s(this.formatLanguageCode(a))}),i}}const Ck={zero:0,one:1,two:2,few:3,many:4,other:5},Sk={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ioe{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=r,this.logger=tc.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,r){this.rules[e]=r}clearCache(){this.pluralRulesCache={}}getRule(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=mv(e==="dev"?"en":e),i=r.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:n,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(n,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Sk;if(!e.match(/-|_/))return Sk;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,r)}return this.pluralRulesCache[s]=a,a}needsPlural(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(i=>`${r}${i}`)}getSuffixes(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((i,s)=>Ck[i]-Ck[s]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",r,n))}}const Ak=function(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=Yae(t,e,r);return!s&&i&&cr(r)&&(s=b_(t,r,n),s===void 0&&(s=b_(e,r,n))),s},c6=t=>t.replace(/\$/g,"$$$$");class soe{constructor(){var r;let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=tc.create("interpolator"),this.options=e,this.format=((r=e==null?void 0:e.interpolation)==null?void 0:r.format)||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:i,prefix:s,prefixEscaped:a,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:f,nestingPrefixEscaped:h,nestingSuffix:g,nestingSuffixEscaped:m,nestingOptionsSeparator:y,maxReplaces:b,alwaysFormat:E}=e.interpolation;this.escape=r!==void 0?r:Xae,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?wh(s):a||"{{",this.suffix=o?wh(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=f?wh(f):h||wh("$t("),this.nestingSuffix=g?wh(g):m||wh(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=b||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,r,n,i){var h;let s,a,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=g=>{if(g.indexOf(this.formatSeparator)<0){const E=Ak(r,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...i,...r,interpolationkey:g}):E}const m=g.split(this.formatSeparator),y=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(Ak(r,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,n,{...i,...r,interpolationkey:y})};this.resetRegExp();const u=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((h=i==null?void 0:i.interpolation)==null?void 0:h.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c6(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c6(this.escape(g)):c6(g)}].forEach(g=>{for(o=0;s=g.regex.exec(e);){const m=s[1].trim();if(a=l(m),a===void 0)if(typeof u=="function"){const b=u(e,s,i);a=cr(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(d){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),a="";else!cr(a)&&!this.useRawValueToEscape&&(a=mk(a));const y=g.safeValue(a);if(e=e.replace(s[0],y),d?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,s,a;const o=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const d=c.split(new RegExp(`${u}[ ]*{`));let f=`{${d[1]}`;c=d[0],f=this.interpolate(f,a);const h=f.match(/'/g),g=f.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),l&&(a={...l,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,m),`${c}${u}${f}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;i=this.nestingRegexp.exec(e);){let c=[];a={...n},a=a.replace&&!cr(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let l=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const u=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=u.shift(),c=u,l=!0}if(s=r(o.call(this,i[1].trim(),a),a),s&&i[0]===e&&!cr(s))return s;cr(s)||(s=mk(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),l&&(s=c.reduce((u,d)=>this.format(u,d,n.lng,{...n,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const aoe=t=>{let e=t.toLowerCase().trim();const r={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);e==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(a=>{if(a){const[o,...c]=a.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();r[u]||(r[u]=l),l==="false"&&(r[u]=!1),l==="true"&&(r[u]=!0),isNaN(l)||(r[u]=parseInt(l,10))}})}return{formatName:e,formatOptions:r}},Eh=t=>{const e={};return(r,n,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const a=n+JSON.stringify(s);let o=e[a];return o||(o=t(mv(n),i),e[a]=o),o(r)}};let ooe=class{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=tc.create("formatter"),this.options=e,this.formats={number:Eh((r,n)=>{const i=new Intl.NumberFormat(r,{...n});return s=>i.format(s)}),currency:Eh((r,n)=>{const i=new Intl.NumberFormat(r,{...n,style:"currency"});return s=>i.format(s)}),datetime:Eh((r,n)=>{const i=new Intl.DateTimeFormat(r,{...n});return s=>i.format(s)}),relativetime:Eh((r,n)=>{const i=new Intl.RelativeTimeFormat(r,{...n});return s=>i.format(s,n.range||"day")}),list:Eh((r,n)=>{const i=new Intl.ListFormat(r,{...n});return s=>i.format(s)})},this.init(e)}init(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(e,r){this.formats[e.toLowerCase().trim()]=r}addCached(e,r){this.formats[e.toLowerCase().trim()]=Eh(r)}format(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=r.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(o=>o.indexOf(")")>-1)){const o=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,o)].join(this.formatSeparator)}return s.reduce((o,c)=>{var d;const{formatName:l,formatOptions:u}=aoe(c);if(this.formats[l]){let f=o;try{const h=((d=i==null?void 0:i.formatParams)==null?void 0:d[i.interpolationkey])||{},g=h.locale||h.lng||i.locale||i.lng||n;f=this.formats[l](o,g,{...u,...i,...h})}catch(h){this.logger.warn(h)}return f}else this.logger.warn(`there was no format function for ${l}`);return o},e)}};const coe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class loe extends Hw{constructor(e,r,n){var s,a;let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=tc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(a=(s=this.backend)==null?void 0:s.init)==null||a.call(s,n,i.backend,i)}queueLoad(e,r,n,i){const s={},a={},o={},c={};return e.forEach(l=>{let u=!0;r.forEach(d=>{const f=`${l}|${d}`;!n.reload&&this.store.hasResourceBundle(l,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,u=!1,a[f]===void 0&&(a[f]=!0),s[f]===void 0&&(s[f]=!0),c[d]===void 0&&(c[d]=!0)))}),u||(o[l]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,r,n){const i=e.split("|"),s=i[0],a=i[1];
vendor: 4,428 bytes, line 6
6r&&this.emit("failedLoading",s,a,r),!r&&n&&this.store.addResourceBundle(s,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=r?-1:2,r&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{Qae(c.loaded,[s],a),coe(c,e),r&&c.errors.push(r),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const u=c.loaded[l];u.length&&u.forEach(d=>{o[l][d]===void 0&&(o[l][d]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:r,fcName:n,tried:i,wait:s,callback:a});return}this.readingCalls++;const o=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(l&&u&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,r,n,i+1,s*2,a)},s);return}a(l,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,r);l&&typeof l.then=="function"?l.then(u=>o(null,u)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,r,o)}prepareLoading(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();cr(e)&&(e=this.languageUtils.toResolveHierarchy(e)),cr(r)&&(r=[r]);const s=this.queueLoad(e,r,n,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(e,r,n){this.prepareLoading(e,r,{},n)}reload(e,r,n){this.prepareLoading(e,r,{reload:!0},n)}loadOne(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),i=n[0],s=n[1];this.read(i,s,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${r}loading namespace ${s} for language ${i} failed`,a),!a&&o&&this.logger.log(`${r}loaded namespace ${s} for language ${i}`,o),this.loaded(e,a,o)})}saveMissing(e,r,n,i,s){var c,l,u,d,f;let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((d=(u=this.services)==null?void 0:u.utils)!=null&&d.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const h={...a,isUpdate:s},g=this.backend.create.bind(this.backend);if(g.length<6)try{let m;g.length===5?m=g(e,r,n,i,h):m=g(e,r,n,i),m&&typeof m.then=="function"?m.then(y=>o(null,y)).catch(o):o(null,m)}catch(m){o(m)}else g(e,r,n,i,o,h)}!e||!e[0]||this.store.addResource(e[0],r,n,i)}}}const Tk=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),cr(t[1])&&(e.defaultValue=t[1]),cr(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(n=>{e[n]=r[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),Ik=t=>{var e,r;return cr(t.ns)&&(t.ns=[t.ns]),cr(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),cr(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((r=(e=t.supp
vendor: 4,144 bytes, line 6
6ortedLngs)==null?void 0:e.indexOf)==null?void 0:r.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},x2=()=>{},uoe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(r=>{typeof t[r]=="function"&&(t[r]=t[r].bind(t))})};class W1 extends Hw{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=Ik(e),this.services={},this.logger=tc,this.modules={external:[]},uoe(this),r&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,r),this;setTimeout(()=>{this.init(e,r)},0)}}init(){var e=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof r=="function"&&(n=r,r={}),r.defaultNS==null&&r.ns&&(cr(r.ns)?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=Tk();this.options={...i,...this.options,...Ik(r)},this.options.interpolation={...i.interpolation,...this.options.interpolation},r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);const s=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?tc.init(s(this.modules.logger),this.options):tc.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=ooe;const d=new _k(this.options);this.store=new wk(this.options.resources,this.options);const f=this.services;f.logger=tc,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new ioe(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=s(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new soe(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new loe(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var g=arguments.length,m=new Array(g>1?g-1:0),y=1;y<g;y++)m[y-1]=arguments[y];e.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new bv(this.services,this.options),this.translator.on("*",function(h){for(var g=arguments.length,m=new Array(g>1?g-1:0),y=1;y<g;y++)m[y-1]=arguments[y];e.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=x2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return e.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return e.store[u](...arguments),e}});const c=X0(),l=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),n(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),c}loadResources(e){var s,a;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x2;
vendor: 4,181 bytes, line 6
6const i=cr(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&o.indexOf(d)<0&&o.push(d)})};i?c(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(a=(s=this.options.preload)==null?void 0:s.forEach)==null||a.call(s,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,r,n){const i=X0();return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=void 0),e||(e=this.languages),r||(r=this.options.ns),n||(n=x2),this.services.backendConnector.reload(e,r,s=>{i.resolve(),n(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Oq.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,r){var n=this;this.isLanguageChangingTo=e;const i=X0();this.emit("languageChanging",e);const s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,l)=>{l?(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(c,function(){return n.t(...arguments)})},o=c=>{var u,d;!e&&!c&&this.services.languageDetector&&(c=[]);const l=cr(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(d=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||d.call(u,l)),this.loadResources(l,f=>{a(f,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),i}getFixedT(e,r,n){var i=this;const s=function(a,o){let c;if(typeof o!="object"){for(var l=arguments.length,u=new Array(l>2?l-2:0),d=2;d<l;d++)u[d-2]=arguments[d];c=i.options.overloadTranslationOptionHandler([a,o].concat(u))}else c={...o};c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const f=i.options.keySeparator||".";let h;return c.keyPrefix&&Array.isArray(a)?h=a.map(g=>`${c.keyPrefix}${f}${g}`):h=c.keyPrefix?`${c.keyPrefix}${f}${a}`:a,i.t(h,c)};return cr(e)?s.lng=e:s.lngs=e,s.ns=r,s.keyPrefix=n,s}t(){var i;for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(i=this.translator)==null?void 0:i.translate(...r)}exists(){var i;for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(i=this.translator)==null?void 0:i.exists(...r)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
6if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(r.precheck){const o=r.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!i||a(s,e)))}loadNamespaces(e,r){const n=X0();return this.options.ns?(cr(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(e,r){const n=X0();cr(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=i.concat(s),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}dir(e){var i,s;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((s=this.services)==null?void 0:s.languageUtils)||new _k(Tk());return r.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new W1(e,r)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:x2;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new W1(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(o=>{s[o]=this[o]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},Object.keys(c[l]).reduce((u,d)=>(u[d]={...c[l][d]},u),{})),{});s.store=new wk(o,i),s.services.resourceStore=s.store}return s.translator=new bv(s.services,i),s.translator.on("*",function(o){for(var c=arguments.length,l=new Array(c>1?c-1:0),u=1;u<c;u++)l[u-1]=arguments[u];s.emit(o,...l)}),s.init(i,r),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Si=W1.createInstance();Si.createInstance=W1.createInstance;Si.createInstance;Si.dir;Si.init;Si.loadResources;Si.reloadResources;Si.use;Si.changeLanguage;Si.getFixedT;Si.t;Si.exists;Si.setDefaultNamespace;Si.hasLoadedNamespace;Si.loadNamespaces;Si.loadLanguages;const doe={modifyAdStep:0,paymentMethod:[],priceType:kq.Fixed,quantity:0,totalAmount:0,unitPrice:0,type:"Buy",sellingAsset:$q.USDT,currencyToPay:Nq.VND,lowerLimit:0,upperLimit:0,message:"",tradingTerm:"",approvedTimestamp:10},Rq=os({name:"ads",initialState:doe,reducers:{stepProceed(t,{payload:e}){t.modifyAdStep=e},setPriceType(t,{payload:e}){t.priceType=e},setQuantity(t,{payload:e}){t.quantity=e},setUnitPrice(t,{payload:e}){t.unitPrice=e},setSellingAsset(t,{payload:e}){t.sellingAsset=e},setCurrencyToPay(t,{payload:e}){t.currencyToPay=e},setLowerLimit(t,{payload:e}){t.lowerLimit=e},setUpperLimit(t,{payload:e}){t.upperLimit=e},setPaymentMethod(t,{payload:e}){t.paymentMethod=e==null?void 0:e.paymentMethod},setMessage(t,{payload:e}){t.message=e},setTradingTerm(t,{payload:e}){t.tradingTerm=e},setApprovedTimeStamp(t,{payload:e}){t.approvedTimestamp=e},setAdPrice(t,{payload:e}){const r=Object.keys(e)[0];t[r]=e[r]}},extraReducers:t=>{t.addMatcher(ff.endpoints.createNewAd.matchFulfilled,e=>{e.quantity=0,e.unitPrice=0,e.paymentMethod=[],e.tradingTerm="",e.message="",e.approvedTimestamp=10,e.type="Buy",sv.success(Si.t("toast.yourAdCreated"))}).addMatcher(ff.endpoints.createNewAd.matchRejected,e=>{}).addMatcher(ff.endpoints.deleteUserAd.matchFulfilled,()=>{sv.success(Si.t("toast.yourAdDelete"))}).addDefaultCase(e=>{e.totalAmount=e.quantity*e.unitPrice})}}),{stepProceed:Htt,setPriceType:Gtt,setQuantity:Ktt,setUnitPrice:Qtt,setSellingAsset:Ytt,setCurrencyToPay:Ztt,setAdPrice:Xtt,setLowerLimit:Jtt,setUpperLimit:ert,setPaymentMethod:trt,setMessage:rrt,setTradingTerm:nrt,setApprovedTimeStamp:irt}=Rq.actions,foe=Rq.reducer,hoe=(t,e)=>{const r="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee".toLowerCase();if(t.toLowerCase()===r)switch(e){case st.MAINNET:return"0xc02aaa39b223fe8d0a0e5c4f27ead9083
6c756cc2";case st.ARBITRUM_ONE:return"0x82af49447d8a07e3bd95bd0d56f35241523fbab1";case st.ARB_TESTNET:return"0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83";default:throw new Error(`Unsupported chainId: ${e}`)}return t};var kk={NVM_INC:"/Users/geralt.dao/.nvm/versions/node/v18.17.1/include/node",TERM_PROGRAM:"vscode",VSCODE_GIT_IPC_AUTH_TOKEN:"bcb4b3bf72c7ae72f3903d1f04be54e95b548a98128534518bd9701ab75054bf",NODE:"/opt/homebrew/Cellar/node/24.8.0/bin/node",NVM_CD_FLAGS:"-q",ANDROID_HOME:"/Users/geralt.dao/Library/Android/sdk",GEMINI_CLI_IDE_WORKSPACE_PATH:"/Users/geralt.dao/hola-tech/botdex-interface",INIT_CWD:"/Users/geralt.dao/hola-tech/botdex-interface",SHELL:"/bin/zsh",TERM:"xterm-256color",TMPDIR:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",TERM_PROGRAM_VERSION:"2.6.19",npm_config_npm_globalconfig:"/opt/homebrew/Cellar/node/24.8.0/etc/npmrc",MallocNanoZone:"0",CURSOR_TRACE_ID:"c7e1f3f6815a4d849e5f973acf0a80f4",ZDOTDIR:"/Users/geralt.dao",npm_config_registry:"https://registry.npmjs.org/",ZSH:"/Users/geralt.dao/.oh-my-zsh",ENABLE_IDE_INTEGRATION:"true",USER:"geralt.dao",NVM_DIR:"/Users/geralt.dao/.nvm",LS_COLORS:"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/Users/geralt.dao/Library/Preferences/pnpm/rc",PNPM_SCRIPT_SRC_DIR:"/Users/geralt.dao/hola-tech/botdex-interface",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.mwgQRp7Nkf/Listeners",CLAUDE_CODE_SSE_PORT:"56099",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",VSCODE_PROFILE_INITIALIZED:"1",npm_execpath:"/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/bin/pnpm.cjs",PAGER:"less",LSCOLORS:"Gxfxcxdxbxegedabagacad",npm_config_frozen_lockfile:"",npm_config_verify_deps_before_run:"false",PATH:"/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.bin:/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/dist/node-gyp-bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/[email protected]/bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/postgresql@15/bin:/Users/geralt.dao/.amplify/bin:/Users/geralt.dao/.bun/bin:/opt/homebrew/bin:/Users/geralt.dao/.codeium/windsurf/bin:/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/postgresql@15/bin:/Users/geralt.dao/.amplify/bin:/Users/geralt.dao/.local/bin:/Users/geralt.dao/.bun/bin:/Users/geralt.dao/.codeium/windsurf/bin:/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/geralt.dao/go/bin:/Users/geralt.dao/Library/Android/sdk/emulator:/Users/geralt.dao/Library/Android/sdk/platform-tools:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/geralt.dao/go/bin:/Users/geralt.dao/Library/Android/sdk/emulator:/Users/geralt.dao/Library/Android/sdk/platform-tools",LaunchInstanceID:"B31E047D-3F24-4B63-AFE7-D9CC50F0BC74",npm_package_json:"/Users/geralt.dao/hola-tech/botdex-interface/package.json",__CFBundleIdentifier:"com.todesktop.230313mzl4w4u92",USER_ZDOTDIR:"/Users/geralt.dao",PWD:"/Users/geralt.dao/hola-tech/botdex-interface",npm_command:"run-script",JAVA_HOME:"/Users/geralt.dao/Library/Java/JavaVirtualMachines/openjdk-21.0.1/Contents/Home",npm_config__jsr_registry:"https://npm.jsr.io/",npm_lifecycle_event:"build",LANG:"C.UTF-8",npm_package_name:"universe",NODE_PATH:"/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/bin/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/node_modules",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",GEMINI_CLI_IDE_AUTH_TOKEN:"ffcaa9c2-67ff-44aa-8784-f1f830770ce9",npm_config_node_gyp:"/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",XPC_SERVICE_NAME:"0",pnpm_config_verify_deps_before_run:"false",VSCODE_INJECTION:"1",HOME:"/Users/geralt.dao",SHLVL:"2",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Cursor.a
6pp/Contents/Resources/app/extensions/git/dist/askpass-main.js",HOMEBREW_PREFIX:"/opt/homebrew",GK_GL_ADDR:"http://127.0.0.1:55023",LOGNAME:"geralt.dao",LESS:"-R",npm_lifecycle_script:"vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/vscode-git-106008ff40.sock",GK_GL_PATH:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/gitkraken/gitlens/gitlens-ipc-server-1774-55023.json",NVM_BIN:"/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin",BUN_INSTALL:"/Users/geralt.dao/.bun",GEMINI_CLI_IDE_SERVER_PORT:"55024",npm_config_user_agent:"pnpm/10.26.2 npm/? node/v24.8.0 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Cursor.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Cursor.app/Contents/Frameworks/Cursor Helper (Plugin).app/Contents/MacOS/Cursor Helper (Plugin)",OSLogRateLimit:"64",SECURITYSESSIONID:"186af",COLORTERM:"truecolor",npm_node_execpath:"/opt/homebrew/Cellar/node/24.8.0/bin/node",NODE_ENV:"production",VITE_APP_URL_API:"https://api.godex.ai/api",VITE_APP_SOCKET:"https://api.godex.ai",VITE_APP_DEFAUL_CHAIN_ID:"42161",VITE_APP_PRIVY_APP_ID:"clxlnrvzy073ll6yvy1b6lcko",VITE_APP_BLOCKPASS_CLIENT_ID:"godexai_24fd5",VITE_APP_BOT_NAME:"godex_ai_bot",VITE_APP_GET_STREAM_API_KEY:"twfjd2y6asta",VITE_APP_LEDGER_ADDRESS:"0x34EC5aC5B0074e9385d8d4d4A43a478c0FBA1f5d",VITE_APP_SECRET_KEY:"http://localhost:3456/api",VITE_APP_AWS_API_ENDPOINT:"https://gateway-arbitrum.network.thegraph.com/api/d762176fa97a19cbfec853f321540d1f/subgraphs/id/35AYsvtJ7SjD93JZcjHK7KTSFyC8h74YHkg2hTxRsRer",VITE_APP_AWS_REALTIME_ENDPOINT:"wss://beta.realtime.gateway.uniswap.org/graphql",VITE_APP_AWS_REALTIME_TOKEN:"realtime-3DDE0DA0-3408-4FD0-9DC3-5E285D70D29C",VITE_APP_GODEX_SUBGRAPH:"https://api.studio.thegraph.com/query/69483/godex-trading/version/latest",VITE_APP_SUBGRAPH_API_KEY:"0bdfb5369a3f673c2f4d7b07fdc47356 6d1aad6c2bd525626fe78c662c0b99b1 f2182b8d85650307efdc7ee5f5e928d5 d762176fa97a19cbfec853f321540d1f 4d180b6f0318804bca6bad7a412df4e3",VITE_APP_IS_UNISWAP_INTERFACE:"true",VITE_APP_VAPID_KEY:"BEaejLMlaWDuAcFbg_J0Lxj3-32rU8dl9MiGmE58mW1DmNxZrIwPwUQSS6vMYdpjG1x7DUBNI83Y5Rz2pO4SulU",VITE_FIREBASE_APIKEY:"AIzaSyBg8UnAtHTYw0EI1F6L_6awN5c7tkekWE4",VITE_FIREBASE_AUTH_DOMAIN:"notifi-e7ddc.firebaseapp.com",VITE_FIREBASE_PJ_ID:"notifi-e7ddc",VITE_FIREBASE_STORAGE_BUCKET:"notifi-e7ddc.appspot.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"595100990974",VITE_FIREBASE_APP_ID:"1:595100990974:web:8de8a14f57642af6c154af",VITE_APP_INTERGRATOR_ID:"btcw.tech-fd0e21e7-dc58-45ef-aabc-3141ed135e65",VITE_COINGECKO_API_KEY:"CG-C457Em1XmWjRS2d2gXUBBJ5V"};const v_={getTokenPrice:async(t,e,r,n)=>{const{from:i,to:s}=r,a=hoe(e,t);try{return(await vb.get(`https://pro-api.coingecko.com/api/v3/coins/${n}/contract/${a}/market_chart/range?x_cg_pro_api_key=${kk.VITE_COINGECKO_API_KEY}&vs_currency=usd&from=${i}&to=${s}`)).data}catch(o){console.log(o.data.message)}},getTokenById:async(t,e)=>{const{from:r,to:n}=e;try{return(await vb.get(`https://pro-api.coingecko.com/api/v3/coins/${t}/market_chart/range?x_cg_pro_api_key=CG-C457Em1XmWjRS2d2gXUBBJ5V`,{params:{vs_currency:"usd",from:r,to:n},headers:{x_cg_pro_api_key:kk.VITE_COINGECKO_API_KEY||""}})).data}catch(i){throw console.error("Error fetching token price:",i),i}},getPricePercentChange:async()=>{try{return(await vb.get("https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&price_change_percentage=1h,24h")).data}catch(t){console.log(t.data.message)}}},poe=pn("favorites/listTokenCoinGecko",async()=>await v_.getPricePercentChange()),goe=pn("favorites/fetchTokenPricesCoinGecko",async({chainId:t,srcToken:e,destToken:r,timeCompareCoingecko:n,chainIdCoigecko:i},{rejectWithValue:s})=>{try{const[a,o]=await Promise.all([v_.getTokenPrice(t,e.address||"",n,i),v_.getTokenPrice(t,r.address||"",n,i)]);return{mainTokenPriceRes:a,subTokenPriceRes:o}}catch(a){return s(a)}}),moe={selectedIds:[],listTokenCoingecko:[],mainTokenPriceRes:null,subTokenPriceRes:null},Dq=os({name:"favorites",initialState:moe,reducers:{addFavorite:(t,e)=>{const r=e.payload;t.selectedIds=[...t.selectedIds,r]},removeFavorite:(t,e)=>{const r=e.payload,n=t.selectedIds.indexOf(r);n!==-1&&t.selectedIds.splice(n,1)}},extraReducers:t=>{t.addCase(poe.fulfilled,(e,r)=>{const n=r.payload;e.listTokenCoingecko=n}),t.addCase(goe.fulfilled,(e,r)=>{const{mainTokenPriceRes:n,subTokenPriceRes:i}=r.payload;e.mainTokenPriceRes=n,e.subTokenPriceRes=i}
6)}}),{addFavorite:srt,removeFavorite:art}=Dq.actions,yoe=Dq.reducer,boe={getPackages:async()=>await Xe.get("/fixed-time-pool"),claimProfitMetadata:async(t,e)=>await Xe.post("/fixed-time-pool/request-payout",{index:t,token:e}),metadataRequestPayout:async(t,e)=>await Xe.post("/fixed-time-pool/metadata-request-payout",{index:t,token:e}),checkTxnSupplyOrder:async t=>await Xe.get(`/fixed-time-pool/${t}`),adminApprovePayout:async(t,e)=>await Xe.post("/fixed-time-pool/approve-payout ",{address:t,index:e})},voe=pn("fixedTimePool/supplyPackage",async()=>await boe.getPackages()),woe={fixedTimePool:[]},Eoe=os({name:"supplyPackage",initialState:woe,reducers:{},extraReducers:t=>{t.addCase(voe.fulfilled,(e,r)=>{const n=r.payload;e.fixedTimePool=n})}}),xoe=Eoe.reducer,$k=["application","tokens","p2p","admin","favorites"],_oe=jB({reducer:{favorites:yoe,application:tse,multicall:sse,user:Pae,p2p:_ae,vault:hse,tokens:qae,admin:Hae,[ff.reducerPath]:ff.reducer,ads:foe,fixedPool:xoe},middleware:t=>t({thunk:!0}).concat(zI.save({states:$k}),ff.middleware),preloadedState:zI.load({states:$k})}),Mq=()=>Gf();function jq(t,e){const[r,n]=C.useState(t);return C.useEffect(()=>{const i=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(i)}},[t,e]),r}var l6="Invariant Violation",Nk=Object.setPrototypeOf,Coe=Nk===void 0?function(t,e){return t.__proto__=e,t}:Nk,Lq=(function(t){xc(e,t);function e(r){r===void 0&&(r=l6);var n=t.call(this,typeof r=="number"?l6+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=l6,Coe(n,e.prototype),n}return e})(Error);function Bd(t,e){if(!t)throw new Lq(e)}var Fq=["debug","log","warn","error","silent"],Soe=Fq.indexOf("log");function _2(t){return function(){if(Fq.indexOf(t)>=Soe){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=_2("debug"),t.log=_2("log"),t.warn=_2("warn"),t.error=_2("error")})(Bd||(Bd={}));var FC="3.14.1";function lo(t){try{return t()}catch{}}const vv=lo(function(){return globalThis})||lo(function(){return window})||lo(function(){return self})||lo(function(){return global})||lo(function(){return lo.constructor("return this")()});var Pk=new Map;function w_(t){var e=Pk.get(t)||1;return Pk.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Uq(t,e){e===void 0&&(e=0);var r=w_("stringifyForDisplay");return JSON.stringify(t,function(n,i){return i===void 0?r:i},e).split(JSON.stringify(r)).join("<undefined>")}function C2(t){return function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof e=="number"){var i=e;e=UC(i),e||(e=BC(i,r),r=[])}t.apply(void 0,[e].concat(r))}}var dt=Object.assign(function(e,r){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];e||Bd(e,UC(r,n)||BC(r,n))},{debug:C2(Bd.debug),log:C2(Bd.log),warn:C2(Bd.warn),error:C2(Bd.error)});function bs(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new Lq(UC(t,e)||BC(t,e))}var Ok=Symbol.for("ApolloErrorMessageHandler_"+FC);function Bq(t){if(typeof t=="string")return t;try{return Uq(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function UC(t,e){if(e===void 0&&(e=[]),!!t)return vv[Ok]&&vv[Ok](t,e.map(Bq))}function BC(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:FC,message:t,args:e.map(Bq)})))}function Cb(t,e){if(!!!t)throw new Error(e)}function Aoe(t){return typeof t=="object"&&t!==null}function Toe(t,e){if(!!!t)throw new Error("Unexpected invariant triggered.")}const Ioe=/\r\n|[\n\r]/g;function E_(t,e){let r=0,n=1;for(const i of t.body.matchAll(Ioe)){if(typeof i.index=="number"||Toe(!1),i.index>=e)break;r=i.index+i[0].length,n+=1}return{line:n,column:e+1-r}}function koe(t){return qq(t.source,E_(t.source,t.start))}function qq(t,e){const r=t.locationOffset.column-1,n="".padStart(r)+t.body,i=e.line-1,s=t.locationOffset.line-1,a=e.line+s,o=e.line===1?r:0,c=e.column+o,l=`${t.name}:${a}:${c} 7`,u=n.split(/\r\n|[\n\r]/g),d=u[i];if(d.length>120){const f=Math.floor(c/80),h=c%80,g=[];for(let m=0;m<d.length;m+=80)g.push(d.slice(m,m+80));return l+Rk([[`${a} |`,g[0]],...g.slice(1,f+1).map(m=>["|",m]),["|","^".padStart(h)],["|",g[f+1]]])}return l+Rk([[`${a-1} |`,u[i-1]],[`${a} |`,d],["|","^".padStart(c)],[`${a+1} |`,u[i+1]]])}function Rk(t){const e=t.filter(([n,i])=>i!==void 0),r=Math.max(...e.map(([n])=>n.length));return e.map(([n,i])=>n.padStart(r)+(i?" "+i:"")).join(` 8`)}function $oe(t){const e=t[0];return e==null||"kind"in e||"length"in e?{nodes:e,source:t[1],positions:t[2],path:t[3],originalError:t[4],extensions:t[5]}:e}
vendor: 11,028 bytes, lines 8-14
8class qC extends Error{constructor(e,...r){var n,i,s;const{nodes:a,source:o,positions:c,path:l,originalError:u,extensions:d}=$oe(r);super(e),this.name="GraphQLError",this.path=l??void 0,this.originalError=u??void 0,this.nodes=Dk(Array.isArray(a)?a:a?[a]:void 0);const f=Dk((n=this.nodes)===null||n===void 0?void 0:n.map(g=>g.loc).filter(g=>g!=null));this.source=o??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=c??(f==null?void 0:f.map(g=>g.start)),this.locations=c&&o?c.map(g=>E_(o,g)):f==null?void 0:f.map(g=>E_(g.source,g.start));const h=Aoe(u==null?void 0:u.extensions)?u==null?void 0:u.extensions:void 0;this.extensions=(s=d??h)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?Object.defineProperty(this,"stack",{value:u.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,qC):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(e+=` 9 10`+koe(r.loc));else if(this.source&&this.locations)for(const r of this.locations)e+=` 11 12`+qq(this.source,r);return e}toJSON(){const e={message:this.message};return this.locations!=null&&(e.locations=this.locations),this.path!=null&&(e.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function Dk(t){return t===void 0||t.length===0?void 0:t}function ai(t,e,r){return new qC(`Syntax Error: ${r}`,{source:t,positions:[e]})}class Noe{constructor(e,r,n){this.start=e.start,this.end=r.end,this.startToken=e,this.endToken=r,this.source=n}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Wq{constructor(e,r,n,i,s,a){this.kind=e,this.start=r,this.end=n,this.line=i,this.column=s,this.value=a,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const zq={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},Poe=new Set(Object.keys(zq));function Mk(t){const e=t==null?void 0:t.kind;return typeof e=="string"&&Poe.has(e)}var Hh;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(Hh||(Hh={}));var x_;(function(t){t.QUERY="QUERY",t.MUTATION="MUTATION",t.SUBSCRIPTION="SUBSCRIPTION",t.FIELD="FIELD",t.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",t.FRAGMENT_SPREAD="FRAGMENT_SPREAD",t.INLINE_FRAGMENT="INLINE_FRAGMENT",t.VARIABLE_DEFINITION="VARIABLE_DEFINITION",t.SCHEMA="SCHEMA",t.SCALAR="SCALAR",t.OBJECT="OBJECT",t.FIELD_DEFINITION="FIELD_DEFINITION",t.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",t.INTERFACE="INTERFACE",t.UNION="UNION",t.ENUM="ENUM",t.ENUM_VALUE="ENUM_VALUE",t.INPUT_OBJECT="INPUT_OBJECT",t.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(x_||(x_={}));var pt;(function(t){t.NAME="Name",t.DOCUMENT="Document",t.OPERATION_DEFINITION="OperationDefinition",t.VARIABLE_DEFINITION="VariableDefinition",t.SELECTION_SET="SelectionSet",t.FIELD="Field",t.ARGUMENT="Argument",t.FRAGMENT_SPREAD="FragmentSpread",t.INLINE_FRAGMENT="InlineFragment",t.FRAGMENT_DEFINITION="FragmentDefinition",t.VARIABLE="Variable",t.INT="IntValue",t.FLOAT="FloatValue",t.STRING="StringValue",t.BOOLEAN="BooleanValue",t.NULL="NullValue",t.ENUM="EnumValue",t.LIST="ListValue",t.OBJECT="ObjectValue",t.OBJECT_FIELD="ObjectField",t.DIRECTIVE="Directive",t.NAMED_TYPE="NamedType",t.LIST_TYPE="ListType",t.NON_NULL_TYPE="NonNullType",t.SCHEMA_DEFINITION="SchemaDefinition",t.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",t.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",t.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",t.FIELD_DEFINITION="FieldDefinition",t.INPUT_VALUE_DEFINITION="InputValueDefinition",t.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",t.UNION_TYPE_DEFINITION="UnionTypeDefinition",t.ENUM_TYPE_DEFINITION="EnumTypeDefinition",t.ENUM_VALUE_DEFINITION="EnumValueDefinition",t.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",t.DIRECTIVE_DEFINITION="DirectiveDefinition",t.SCHEMA_EXTENSION="SchemaExtension",t.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",t.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",t.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",t.UNION_TYPE_EXTENSION="UnionTypeExtension",t.ENUM_TYPE_EXTENSION="EnumTypeExtension",t.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",t.TYPE_COORDINATE="TypeCoordinate",t.MEMBER_COORDINATE="MemberCoordinate",t.ARGUMENT_COORDINATE="ArgumentCoordinate",t.DIRECTIVE_COORDINATE="DirectiveCoordinate",t.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(pt||(pt={}));function __(t){return t===9||t===32}function z1(t){return t>=48&&t<=57}function Vq(t){return t>=97&&t<=122||t>=65&&t<=90}function Hq(t){return Vq(t)||t===95}function Ooe(t){return Vq(t)||z1(t)||t===95}function Roe(t){var e;let r=Number.MAX_SAFE_INTEGER,n=null,i=-1;for(let a=0;a<t.length;++a){var s;const o=t[a],c=Doe(o);c!==o.length&&(n=(s=n)!==null&&s!==void 0?s:a,i=a,a!==0&&c<r&&(r=c))}return t.map((a,o)=>o===0?a:a.slice(r)).slice((e=n)!==null&&e!==void 0?e:0,i+1)}function Doe(t){let e=0;for(;e<t.length&&__(t.charCodeAt(e));)++e;return e}function Moe(t,e){const r=t.replace(/"""/g,'\\"""'),n=r.split(/\r\n|[\n\r]/g),i=n.length===1,s=n.length>1&&n.slice(1).every(h=>h.length===0||__(h.charCodeAt(0))),a=r.endsWith('\\"""'),o=t.endsWith('"')&&!a,c=t.endsWith("\\"),l=o||c,u=!i||t.length>70||l||s||a;let d="";const f=i&&__(t.charCodeAt(0));return(u&&!f||s)&&(d+=` 13`),d+=r,(u||l)&&(d+=` 14`),'"""'+d+'"""'}var Ge;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.DOT=".",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(Ge||(Ge={}));class joe{constructor(e){const r=new Wq(Ge.SOF,0,0,0,0);this.source=e,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==Ge.EOF)do if(e.next)e=e.next;else{const r=Foe(this,e.end);e.next=r,r.prev=e,e=r}while(e.kind===Ge.COMMENT);return e}}function Loe(t){return t===Ge.BANG||t===Ge.DOLLAR||t===Ge.AMP||t===Ge.PAREN_L||t===Ge.PAREN_R||t===Ge.DOT||t===Ge.SPREAD||t===Ge.COLON||t===Ge.EQUALS||t===Ge.AT||t===Ge.BRACKET_L||t===Ge.BRACKET_R||t===Ge.BRACE_L||t===Ge.PIPE||t===Ge.BRACE_R}function b0(t){return t>=0&&t<=55295||t>=57344&&t<=1114111}function Gw(t,e){return Gq(t.charCodeAt(e))&&Kq(t.charCodeAt(e+1))}function Gq(t){return t>=55296&&t<=56319}function Kq(t){return t>=56320&&t<=57343}function xf(t,e){const r=t.source.body.codePointAt(e);if(r===void 0)return Ge.EOF;if(r>=32&&r<=126){const n=String.fromCodePoint(r);return n==='"'?`'"'`:`"${n}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function Vn(t,e,r,n,i){const s=t.line,a=1+r-t.lineStart;return new Wq(e,r,n,s,a,i)}function Foe(t,e){const r=t.source.body,n=r.length;let i=e;for(;i<n;){const s=r.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++t.line,t.lineStart=i;continue;case 13:r.charCodeAt(i+1)===10?i+=2:++i,++t.line,t.lineStart=i;continue;case 35:return Uoe(t,i);case 33:return Vn(t,Ge.BANG,i,i+1);case 36:return Vn(t,Ge.DOLLAR,i,i+1);case 38:return Vn(t,Ge.AMP,i,i+1);case 40:return Vn(t,Ge.PAREN_L,i,i+1);case 41:return Vn(t,Ge.PAREN_R,i,i+1);case 46:if(r.charCodeAt(i+1)===46&&r.charCodeAt(i+2)===46)return Vn(t,Ge.SPREAD,i,i+3);break;case 58:return Vn(t,Ge.COLON,i,i+1);case 61:return Vn(t,Ge.EQUALS,i,i+1);case 64:return Vn(t,Ge.AT,i,i+1);case 91:return Vn(t,Ge.BRACKET_L,i,i+1);case 93:return Vn(t,Ge.BRACKET_R,i,i+1);case 123:return Vn(t,Ge.BRACE_L,i,i+1);case 124:return Vn(t,Ge.PIPE,i,i+1);case 125:return Vn(t,Ge.BRACE_R,i,i+1);case 34:return r.charCodeAt(i+1)===34&&r.charCodeAt(i+2)===34?Hoe(t,i):qoe(t,i)}if(z1(s)||s===45)return Boe(t,i,s);if(Hq(s))return Goe(t,i);throw ai(t.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:b0(s)||Gw(r,i)?`Unexpected character: ${xf(t,i)}.`:`Invalid character: ${xf(t,i)}.`)}return Vn(t,Ge.EOF,n,n)}function Uoe(t,e){const r=t.source.body,n=r.length;let i=e+1;for(;i<n;){const s=r.charCodeAt(i);if(s===10||s===13)break;if(b0(s))++i;else if(Gw(r,i))i+=2;else break}return Vn(t,Ge.COMMENT,e,i,r.slice(e+1,i))}function Boe(t,e,r){const n=t.source.body;let i=e,s=r,a=!1;if(s===45&&(s=n.charCodeAt(++i)),s===48){if(s=n.charCodeAt(++i),z1(s))throw ai(t.source,i,`Invalid number, unexpected digit after 0: ${xf(t,i)}.`)}else i=u6(t,i,s),s=n.charCodeAt(i);
vendor: 4,302 bytes, lines 14-16
14if(s===46&&(a=!0,s=n.charCodeAt(++i),i=u6(t,i,s),s=n.charCodeAt(i)),(s===69||s===101)&&(a=!0,s=n.charCodeAt(++i),(s===43||s===45)&&(s=n.charCodeAt(++i)),i=u6(t,i,s),s=n.charCodeAt(i)),s===46||Hq(s))throw ai(t.source,i,`Invalid number, expected digit but got: ${xf(t,i)}.`);return Vn(t,a?Ge.FLOAT:Ge.INT,e,i,n.slice(e,i))}function u6(t,e,r){if(!z1(r))throw ai(t.source,e,`Invalid number, expected digit but got: ${xf(t,e)}.`);const n=t.source.body;let i=e+1;for(;z1(n.charCodeAt(i));)++i;return i}function qoe(t,e){const r=t.source.body,n=r.length;let i=e+1,s=i,a="";for(;i<n;){const o=r.charCodeAt(i);if(o===34)return a+=r.slice(s,i),Vn(t,Ge.STRING,e,i+1,a);if(o===92){a+=r.slice(s,i);const c=r.charCodeAt(i+1)===117?r.charCodeAt(i+2)===123?Woe(t,i):zoe(t,i):Voe(t,i);a+=c.value,i+=c.size,s=i;continue}if(o===10||o===13)break;if(b0(o))++i;else if(Gw(r,i))i+=2;else throw ai(t.source,i,`Invalid character within String: ${xf(t,i)}.`)}throw ai(t.source,i,"Unterminated string.")}function Woe(t,e){const r=t.source.body;let n=0,i=3;for(;i<12;){const s=r.charCodeAt(e+i++);if(s===125){if(i<5||!b0(n))break;return{value:String.fromCodePoint(n),size:i}}if(n=n<<4|e1(s),n<0)break}throw ai(t.source,e,`Invalid Unicode escape sequence: "${r.slice(e,e+i)}".`)}function zoe(t,e){const r=t.source.body,n=jk(r,e+2);if(b0(n))return{value:String.fromCodePoint(n),size:6};if(Gq(n)&&r.charCodeAt(e+6)===92&&r.charCodeAt(e+7)===117){const i=jk(r,e+8);if(Kq(i))return{value:String.fromCodePoint(n,i),size:12}}throw ai(t.source,e,`Invalid Unicode escape sequence: "${r.slice(e,e+6)}".`)}function jk(t,e){return e1(t.charCodeAt(e))<<12|e1(t.charCodeAt(e+1))<<8|e1(t.charCodeAt(e+2))<<4|e1(t.charCodeAt(e+3))}function e1(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Voe(t,e){const r=t.source.body;switch(r.charCodeAt(e+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:` 15`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ai(t.source,e,`Invalid character escape sequence: "${r.slice(e,e+2)}".`)}function Hoe(t,e){const r=t.source.body,n=r.length;let i=t.lineStart,s=e+3,a=s,o="";const c=[];for(;s<n;){const l=r.charCodeAt(s);if(l===34&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34){o+=r.slice(a,s),c.push(o);const u=Vn(t,Ge.BLOCK_STRING,e,s+3,Roe(c).join(` 16`));return t.line+=c.length-1,t.lineStart=i,u}if(l===92&&r.charCodeAt(s+1)===34&&r.charCodeAt(s+2)===34&&r.charCodeAt(s+3)===34){o+=r.slice(a,s),a=s+1,s+=4;continue}if(l===10||l===13){o+=r.slice(a,s),c.push(o),l===13&&r.charCodeAt(s+1)===10?s+=2:++s,o="",a=s,i=s;continue}if(b0(l))++s;else if(Gw(r,s))s+=2;else throw ai(t.source,s,`Invalid character within String: ${xf(t,s)}.`)}throw ai(t.source,s,"Unterminated string.")}function Goe(t,e){const r=t.source.body,n=r.length;let i=e+1;for(;i<n;){const s=r.charCodeAt(i);if(Ooe(s))++i;else break}return Vn(t,Ge.NAME,e,i,r.slice(e,i))}const Koe=10,Qq=2;function WC(t){return Kw(t,[])}function Kw(t,e){switch(typeof t){case"string":return JSON.stringify(t);case"function":return t.name?`[function ${t.name}]`:"[function]";case"object":return Qoe(t,e);default:return String(t)}}function Qoe(t,e){if(t===null)return"null";if(e.includes(t))return"[Circular]";const r=[...e,t];if(Yoe(t)){const n=t.toJSON();if(n!==t)return typeof n=="string"?n:Kw(n,r)}else if(Array.isArray(t))return Xoe(t,r);return Zoe(t,r)}function Yoe(t){return typeof t.toJSON=="function"}function Zoe(t,e){const r=Object.entries(t);return r.length===0?"{}":e.length>Qq?"["+Joe(t)+"]":"{ "+r.map(([i,s])=>i+": "+Kw(s,e)).join(", ")+" }"}function Xoe(t,e){if(t.length===0)return"[]";if(e.length>Qq)return"[Array]";const r=Math.min(Koe,t.length),n=t.length-r,i=[];for(let s=0;s<r;++s)i.push(Kw(t[s],e));return n===1?i.push("... 1 more item"):n>1&&i.push(`... ${n} more items`),"["+i.join(", ")+"]"}function Joe(t){const e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof t.constructor=="function"){const r=t.constructor.name;if(typeof r=="string"&&r!=="")return r}return e}const ece=globalThis.process&&!0,tce=ece?function(e,r){return e instanceof r}:function(e,r){if(e instanceof r)return!0;
vendor: 21,099 bytes, lines 16-27
16if(typeof e=="object"&&e!==null){var n;const i=r.prototype[Symbol.toStringTag],s=Symbol.toStringTag in e?e[Symbol.toStringTag]:(n=e.constructor)===null||n===void 0?void 0:n.name;if(i===s){const a=WC(e);throw new Error(`Cannot use ${i} "${a}" from another module or realm. 17 18Ensure that there is only one instance of "graphql" in the node_modules 19directory. If different versions of "graphql" are the dependencies of other 20relied on modules, use "resolutions" to ensure only one version is installed. 21 22https://yarnpkg.com/en/docs/selective-version-resolutions 23 24Duplicate "graphql" modules cannot be used at the same time since different 25versions may have different capabilities and behavior. The data from one 26version used in the function from another could produce confusing and 27spurious results.`)}}return!1};class Yq{constructor(e,r="GraphQL request",n={line:1,column:1}){typeof e=="string"||Cb(!1,`Body must be a string. Received: ${WC(e)}.`),this.body=e,this.name=r,this.locationOffset=n,this.locationOffset.line>0||Cb(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||Cb(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function rce(t){return tce(t,Yq)}function nce(t,e){const r=new ice(t,e),n=r.parseDocument();return Object.defineProperty(n,"tokenCount",{enumerable:!1,value:r.tokenCount}),n}class ice{constructor(e,r={}){const{lexer:n,...i}=r;if(n)this._lexer=n;else{const s=rce(e)?e:new Yq(e);this._lexer=new joe(s)}this._options=i,this._tokenCounter=0}get tokenCount(){return this._tokenCounter}parseName(){const e=this.expectToken(Ge.NAME);return this.node(e,{kind:pt.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:pt.DOCUMENT,definitions:this.many(Ge.SOF,this.parseDefinition,Ge.EOF)})}parseDefinition(){if(this.peek(Ge.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),r=e?this._lexer.lookahead():this._lexer.token;if(e&&r.kind===Ge.BRACE_L)throw ai(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are not supported on shorthand queries.");if(r.kind===Ge.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition()}if(e)throw ai(this._lexer.source,this._lexer.token.start,"Unexpected description, only GraphQL definitions support descriptions.");switch(r.value){case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(Ge.BRACE_L))return this.node(e,{kind:pt.OPERATION_DEFINITION,operation:Hh.QUERY,description:void 0,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseDescription(),n=this.parseOperationType();let i;return this.peek(Ge.NAME)&&(i=this.parseName()),this.node(e,{kind:pt.OPERATION_DEFINITION,operation:n,description:r,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(Ge.NAME);switch(e.value){case"query":return Hh.QUERY;case"mutation":return Hh.MUTATION;case"subscription":return Hh.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(Ge.PAREN_L,this.parseVariableDefinition,Ge.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:pt.VARIABLE_DEFINITION,description:this.parseDescription(),variable:this.parseVariable(),type:(this.expectToken(Ge.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(Ge.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(Ge.DOLLAR),this.node(e,{kind:pt.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:pt.SELECTION_SET,selections:this.many(Ge.BRACE_L,this.parseSelection,Ge.BRACE_R)})}parseSelection(){return this.peek(Ge.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,r=this.parseName();let n,i;return this.expectOptionalToken(Ge.COLON)?(n=r,i=this.parseName()):i=r,this.node(e,{kind:pt.FIELD,alias:n,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(Ge.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const r=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(Ge.PAREN_L,r,Ge.PAREN_R)}parseArgument(e=!1){const r=this._lexer.token,n=this.parseName();return this.expectToken(Ge.COLON),this.node(r,{kind:pt.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(Ge.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(Ge.NAME)?this.node(e,{kind:pt.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:pt.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token,r=this.parseDescription();return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(e,{kind:pt.FRAGMENT_DEFINITION,description:r,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:pt.FRAGMENT_DEFINITION,description:r,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(e){const r=this._lexer.token;switch(r.kind){case Ge.BRACKET_L:return this.parseList(e);case Ge.BRACE_L:return this.parseObject(e);case Ge.INT:return this.advanceLexer(),this.node(r,{kind:pt.INT,value:r.value});case Ge.FLOAT:return this.advanceLexer(),this.node(r,{kind:pt.FLOAT,value:r.value});case Ge.STRING:case Ge.BLOCK_STRING:return this.parseStringLiteral();case Ge.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:pt.BOOLEAN,value:!0});case"false":return this.node(r,{kind:pt.BOOLEAN,value:!1});case"null":return this.node(r,{kind:pt.NULL});default:return this.node(r,{kind:pt.ENUM,value:r.value})}case Ge.DOLLAR:if(e)if(this.expectToken(Ge.DOLLAR),this._lexer.token.kind===Ge.NAME){const n=this._lexer.token.value;throw ai(this._lexer.source,r.start,`Unexpected variable "$${n}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:pt.STRING,value:e.value,block:e.kind===Ge.BLOCK_STRING})}parseList(e){const r=()=>this.parseValueLiteral(e);return this.node(this._lexer.token,{kind:pt.LIST,values:this.any(Ge.BRACKET_L,r,Ge.BRACKET_R)})}parseObject(e){const r=()=>this.parseObjectField(e);return this.node(this._lexer.token,{kind:pt.OBJECT,fields:this.any(Ge.BRACE_L,r,Ge.BRACE_R)})}parseObjectField(e){const r=this._lexer.token,n=this.parseName();return this.expectToken(Ge.COLON),this.node(r,{kind:pt.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const r=[];for(;this.peek(Ge.AT);)r.push(this.parseDirective(e));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const r=this._lexer.token;return this.expectToken(Ge.AT),this.node(r,{kind:pt.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let r;if(this.expectOptionalToken(Ge.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(Ge.BRACKET_R),r=this.node(e,{kind:pt.LIST_TYPE,type:n})}else r=this.parseNamedType();return this.expectOptionalToken(Ge.BANG)?this.node(e,{kind:pt.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:pt.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(Ge.STRING)||this.peek(Ge.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.many(Ge.BRACE_L,this.parseOperationTypeDefinition,Ge.BRACE_R);return this.node(e,{kind:pt.SCHEMA_DEFINITION,description:r,directives:n,operationTypes:i})}parseOperationTypeDefinition(){const e=this._lexer.token,r=this.parseOperationType();this.expectToken(Ge.COLON);const n=this.parseNamedType();return this.node(e,{kind:pt.OPERATION_TYPE_DEFINITION,operation:r,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();return this.node(e,{kind:pt.SCALAR_TYPE_DEFINITION,description:r,name:n,directives:i})}parseObjectTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:pt.OBJECT_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(Ge.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(Ge.BRACE_L,this.parseFieldDefinition,Ge.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,r=this.parseDescription(),n=this.parseName(),i=this.parseArgumentDefs();this.expectToken(Ge.COLON);const s=this.parseTypeReference(),a=this.parseConstDirectives();return this.node(e,{kind:pt.FIELD_DEFINITION,description:r,name:n,arguments:i,type:s,directives:a})}parseArgumentDefs(){return this.optionalMany(Ge.PAREN_L,this.parseInputValueDef,Ge.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,r=this.parseDescription(),n=this.parseName();this.expectToken(Ge.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(Ge.EQUALS)&&(s=this.parseConstValueLiteral());const a=this.parseConstDirectives();return this.node(e,{kind:pt.INPUT_VALUE_DEFINITION,description:r,name:n,type:i,defaultValue:s,directives:a})}parseInterfaceTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),a=this.parseFieldsDefinition();return this.node(e,{kind:pt.INTERFACE_TYPE_DEFINITION,description:r,name:n,interfaces:i,directives:s,fields:a})}parseUnionTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(e,{kind:pt.UNION_TYPE_DEFINITION,description:r,name:n,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(Ge.EQUALS)?this.delimitedMany(Ge.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(e,{kind:pt.ENUM_TYPE_DEFINITION,description:r,name:n,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(Ge.BRACE_L,this.parseEnumValueDefinition,Ge.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,r=this.parseDescription(),n=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(e,{kind:pt.ENUM_VALUE_DEFINITION,description:r,name:n,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ai(this._lexer.source,this._lexer.token.start,`${S2(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(e,{kind:pt.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:n,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(Ge.BRACE_L,this.parseInputValueDef,Ge.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===Ge.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),n=this.optionalMany(Ge.BRACE_L,this.parseOperationTypeDefinition,Ge.BRACE_R);if(r.length===0&&n.length===0)throw this.unexpected();return this.node(e,{kind:pt.SCHEMA_EXTENSION,directives:r,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),n=this.parseConstDirectives();if(n.length===0)throw this.unexpected();return this.node(e,{kind:pt.SCALAR_TYPE_EXTENSION,name:r,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:pt.OBJECT_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(n.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(e,{kind:pt.INTERFACE_TYPE_EXTENSION,name:r,interfaces:n,directives:i,fields:s})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:pt.UNION_TYPE_EXTENSION,name:r,directives:n,types:i})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:pt.ENUM_TYPE_EXTENSION,name:r,directives:n,values:i})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),n=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(n.length===0&&i.length===0)throw this.unexpected();return this.node(e,{kind:pt.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:n,fields:i})}parseDirectiveDefinition(){const e=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(Ge.AT);const n=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const a=this.parseDirectiveLocations();return this.node(e,{kind:pt.DIRECTIVE_DEFINITION,description:r,name:n,arguments:i,repeatable:s,locations:a})}parseDirectiveLocations(){return this.delimitedMany(Ge.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(x_,r.value))return r;throw this.unexpected(e)}parseSchemaCoordinate(){const e=this._lexer.token,r=this.expectOptionalToken(Ge.AT),n=this.parseName();let i;!r&&this.expectOptionalToken(Ge.DOT)&&(i=this.parseName());let s;return(r||i)&&this.expectOptionalToken(Ge.PAREN_L)&&(s=this.parseName(),this.expectToken(Ge.COLON),this.expectToken(Ge.PAREN_R)),r?s?this.node(e,{kind:pt.DIRECTIVE_ARGUMENT_COORDINATE,name:n,argumentName:s}):this.node(e,{kind:pt.DIRECTIVE_COORDINATE,name:n}):i?s?this.node(e,{kind:pt.ARGUMENT_COORDINATE,name:n,fieldName:i,argumentName:s}):this.node(e,{kind:pt.MEMBER_COORDINATE,name:n,memberName:i}):this.node(e,{kind:pt.TYPE_COORDINATE,name:n})}node(e,r){return this._options.noLocation!==!0&&(r.loc=new Noe(e,this._lexer.lastToken,this._lexer.source)),r}peek(e){return this._lexer.token.kind===e}expectToken(e){const r=this._lexer.token;if(r.kind===e)return this.advanceLexer(),r;throw ai(this._lexer.source,r.start,`Expected ${Zq(e)}, found ${S2(r)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e?(this.advanceLexer(),!0):!1}expectKeyword(e){const r=this._lexer.token;if(r.kind===Ge.NAME&&r.value===e)this.advanceLexer();else throw ai(this._lexer.source,r.start,`Expected "${e}", found ${S2(r)}.`)}expectOptionalKeyword(e){const r=this._lexer.token;return r.kind===Ge.NAME&&r.value===e?(this.advanceLexer(),!0):!1}unexpected(e){const r=e??this._lexer.token;return ai(this._lexer.source,r.start,`Unexpected ${S2(r)}.`)}any(e,r,n){this.expectToken(e);const i=[];for(;!this.expectOptionalToken(n);)i.push(r.call(this));return i}optionalMany(e,r,n){if(this.expectOptionalToken(e)){const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}return[]}many(e,r,n){this.expectToken(e);const i=[];do i.push(r.call(this));while(!this.expectOptionalToken(n));return i}delimitedMany(e,r){this.expectOptionalToken(e);const n=[];do n.push(r.call(this));while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,r=this._lexer.advance();if(r.kind!==Ge.EOF&&(++this._tokenCounter,e!==void 0&&this._tokenCounter>e))throw ai(this._lexer.source,r.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function S2(t){const e=t.value;return Zq(t.kind)+(e!=null?` "${e}"`:"")}function Zq(t){return Loe(t)?`"${t}"`:t}function sce(t){return`"${t.replace(ace,oce)}"`}const ace=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function oce(t){return cce[t.charCodeAt(0)]}const cce=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Qw=Object.freeze({});function wo(t,e,r=zq){const n=new Map;for(const b of Object.values(pt))n.set(b,lce(e,b));let i,s=Array.isArray(t),a=[t],o=-1,c=[],l=t,u,d;const f=[],h=[];do{o++;const b=o===a.length,E=b&&c.length!==0;if(b){if(u=h.length===0?void 0:f[f.length-1],l=d,d=h.pop(),E)if(s){l=l.slice();let w=0;for(const[x,_]of c){const S=x-w;_===null?(l.splice(S,1),w++):l[S]=_}}else{l={...l};for(const[w,x]of c)l[w]=x}o=i.index,a=i.keys,c=i.edits,s=i.inArray,i=i.prev}else if(d){if(u=s?o:a[o],l=d[u],l==null)continue;f.push(u)}let v;if(!Array.isArray(l)){var g,m;Mk(l)||Cb(!1,`Invalid AST Node: ${WC(l)}.`);const w=b?(g=n.get(l.kind))===null||g===void 0?void 0:g.leave:(m=n.get(l.kind))===null||m===void 0?void 0:m.enter;if(v=w==null?void 0:w.call(e,l,u,d,f,h),v===Qw)break;if(v===!1){if(!b){f.pop();continue}}else if(v!==void 0&&(c.push([u,v]),!b))if(Mk(v))l=v;else{f.pop();continue}}if(v===void 0&&E&&c.push([u,l]),b)f.pop();else{var y;i={inArray:s,index:o,keys:a,edits:c,prev:i},s=Array.isArray(l),a=s?l:(y=r[l.kind])!==null&&y!==void 0?y:[],o=-1,c=[],d&&h.push(d),d=l}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:t}function lce(t,e){const r=t[e];
27return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:t.enter,leave:t.leave}}function uce(t){return wo(t,fce)}const dce=80,fce={Name:{leave:t=>t.value},Variable:{leave:t=>"$"+t.name},Document:{leave:t=>kt(t.definitions,` 28 29`)},OperationDefinition:{leave(t){const e=d6(t.variableDefinitions)?lr(`( 30`,kt(t.variableDefinitions,` 31`),` 32)`):lr("(",kt(t.variableDefinitions,", "),")"),r=lr("",t.description,` 33`)+kt([t.operation,kt([t.name,e]),kt(t.directives," ")]," ");return(r==="query"?"":r+" ")+t.selectionSet}},VariableDefinition:{leave:({variable:t,type:e,defaultValue:r,directives:n,description:i})=>lr("",i,` 34`)+t+": "+e+lr(" = ",r)+lr(" ",kt(n," "))},SelectionSet:{leave:({selections:t})=>za(t)},Field:{leave({alias:t,name:e,arguments:r,directives:n,selectionSet:i}){const s=lr("",t,": ")+e;let a=s+lr("(",kt(r,", "),")");return a.length>dce&&(a=s+lr(`( 35`,Sb(kt(r,` 36`)),` 37)`)),kt([a,kt(n," "),i]," ")}},Argument:{leave:({name:t,value:e})=>t+": "+e},FragmentSpread:{leave:({name:t,directives:e})=>"..."+t+lr(" ",kt(e," "))},InlineFragment:{leave:({typeCondition:t,directives:e,selectionSet:r})=>kt(["...",lr("on ",t),kt(e," "),r]," ")},FragmentDefinition:{leave:({name:t,typeCondition:e,variableDefinitions:r,directives:n,selectionSet:i,description:s})=>lr("",s,` 38`)+`fragment ${t}${lr("(",kt(r,", "),")")} on ${e} ${lr("",kt(n," ")," ")}`+i},IntValue:{leave:({value:t})=>t},FloatValue:{leave:({value:t})=>t},StringValue:{leave:({value:t,block:e})=>e?Moe(t):sce(t)},BooleanValue:{leave:({value:t})=>t?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:t})=>t},ListValue:{leave:({values:t})=>"["+kt(t,", ")+"]"},ObjectValue:{leave:({fields:t})=>"{"+kt(t,", ")+"}"},ObjectField:{leave:({name:t,value:e})=>t+": "+e},Directive:{leave:({name:t,arguments:e})=>"@"+t+lr("(",kt(e,", "),")")},NamedType:{leave:({name:t})=>t},ListType:{leave:({type:t})=>"["+t+"]"},NonNullType:{leave:({type:t})=>t+"!"},SchemaDefinition:{leave:({description:t,directives:e,operationTypes:r})=>lr("",t,` 39`)+kt(["schema",kt(e," "),za(r)]," ")},OperationTypeDefinition:{leave:({operation:t,type:e})=>t+": "+e},ScalarTypeDefinition:{leave:({description:t,name:e,directives:r})=>lr("",t,` 40`)+kt(["scalar",e,kt(r," ")]," ")},ObjectTypeDefinition:{leave:({description:t,name:e,interfaces:r,directives:n,fields:i})=>lr("",t,` 41`)+kt(["type",e,lr("implements ",kt(r," & ")),kt(n," "),za(i)]," ")},FieldDefinition:{leave:({description:t,name:e,arguments:r,type:n,directives:i})=>lr("",t,` 42`)+e+(d6(r)?lr(`( 43`,Sb(kt(r,` 44`)),` 45)`):lr("(",kt(r,", "),")"))+": "+n+lr(" ",kt(i," "))},InputValueDefinition:{leave:({description:t,name:e,type:r,defaultValue:n,directives:i})=>lr("",t,` 46`)+kt([e+": "+r,lr("= ",n),kt(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:t,name:e,interfaces:r,directives:n,fields:i})=>lr("",t,` 47`)+kt(["interface",e,lr("implements ",kt(r," & ")),kt(n," "),za(i)]," ")},UnionTypeDefinition:{leave:({description:t,name:e,directives:r,types:n})=>lr("",t,` 48`)+kt(["union",e,kt(r," "),lr("= ",kt(n," | "))]," ")},EnumTypeDefinition:{leave:({description:t,name:e,directives:r,values:n})=>lr("",t,` 49`)+kt(["enum",e,kt(r," "),za(n)]," ")},EnumValueDefinition:{leave:({description:t,name:e,directives:r})=>lr("",t,` 50`)+kt([e,kt(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:t,name:e,directives:r,fields:n})=>lr("",t,` 51`)+kt(["input",e,kt(r," "),za(n)]," ")},DirectiveDefinition:{leave:({description:t,name:e,arguments:r,repeatable:n,locations:i})=>lr("",t,` 52`)+"directive @"+e+(d6(r)?lr(`( 53`,Sb(kt(r,` 54`)),` 55)`):lr("(",kt(r,", "),")"))+(n?" repeatable":"")+" on "+kt(i," | ")},SchemaExtension:{leave:({directives:t,operationTypes:e})=>kt(["extend schema",kt(t," "),za(e)]," ")},ScalarTypeExtension:{leave:({name:t,directives:e})=>kt(["extend scalar",t,kt(e," ")]," ")},ObjectTypeExtension:{leave:({name:t,interfaces:e,directives:r,fields:n})=>kt(["extend type",t,lr("implements ",kt(e," & ")),kt(r," "),za(n)]," ")},InterfaceTypeExtension:{leave:({name:t,interfaces:e,directives:r,fields:n})=>kt(["extend interface",t,lr("implements ",kt(e," & ")),kt(r," "),za(n)]," ")},UnionTypeExtension:{leave:({name:t,directives:e,types:r})=>kt(["extend union",t,kt(e," "),lr("= ",kt(r," | "))]," ")},EnumTypeExtension:{leave:({name:t,directives:e,values:r})=>kt(["extend enum",t,kt(e," "),za(r)]," ")},InputObjectTypeExtension:{leave:({name:t,directives:e,fields:r})=>kt(["extend input",t,kt(e," "),za(r)]," ")},TypeCoordinate:{leave:({name:t})=>t},MemberCoordinate:{leave:({name:t,memberName:e})=>kt([t,lr(".",e)])},ArgumentCoordinate:{leave:({name:t,fieldName:e,argumentName:r})=>kt([t,lr(".",e),lr("(",r,":)")])},DirectiveCoordinate:{leave:({name:t})=>kt(["@",t])},DirectiveArgumentCoordinate:{leave:({name:t,argumentName:e})=>kt(["@",t,lr("(",e,":)")])}};function kt(t,e=""){var r;return(r=t==null?void 0:t.filter(n=>n).join(e))!==null&&r!==void 0?r:""}function za(t){return lr(`{ 56`,Sb(kt(t,` 57`)),` 58}`)}function lr(t,e,r=""){return e!=null&&e!==""?t+e+r:""}function Sb(t){return lr(" ",t.replace(/\n/g,` 59 `))}function d6(t){var e;return(e=t==null?void 0:t.some(r=>r.includes(` 60`)))!==null&&e!==void 0?e:!1}function Lk(t){return t.kind===pt.FIELD||t.kind===pt.FRAGMENT_SPREAD||t.kind===pt.INLINE_FRAGMENT}function hy(t,e){var r=t.directives;return!r||!r.length?!0:gce(r).every(function(n){var i=n.directive,s=n.ifArgument,a=!1;return s.value.kind==="Variable"?(a=e&&e[s.value.name.value],dt(a!==void 0,105,i.name.value)):a=s.value.value,i.name.value==="skip"?!a:a})}function V1(t,e,r){var n=new Set(t),i=n.size;return wo(e,{Directive:function(s){if(n.delete(s.name.value)&&(!r||!n.size))return Qw}}),r?!n.size:n.size<i}function hce(t){return t&&V1(["client","export"],t,!0)}function pce(t){var e=t.name.value;return e==="skip"||e==="include"}function gce(t){var e=[];return t&&t.length&&t.forEach(function(r){if(pce(r)){var n=r.arguments,i=r.name.value;dt(n&&n.length===1,106,i);var s=n[0];dt(s.name&&s.name.value==="if",107,i);var a=s.value;dt(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),108,i),e.push({directive:r,ifArgument:s})}}),e}function mce(t){var e,r,n=(e=t.directives)===null||e===void 0?void 0:e.find(function(s){var a=s.name;return a.value==="unmask"});if(!n)return"mask";var i=(r=n.arguments)===null||r===void 0?void 0:r.find(function(s){var a=s.name;return a.value==="mode"});return globalThis.__DEV__!==!1&&i&&(i.value.kind===pt.VARIABLE?globalThis.__DEV__!==!1&&dt.warn(109):i.value.kind!==pt.STRING?globalThis.__DEV__!==!1&&dt.warn(110):i.value.value!=="migrate"&&globalThis.__DEV__!==!1&&dt.warn(111,i.value.value)),i&&"value"in i.value&&i.value.value==="migrate"?"migrate":"unmask"}const yce=()=>
60Object.create(null),{forEach:bce,slice:Fk}=Array.prototype,{hasOwnProperty:vce}=Object.prototype;class Dl{constructor(e=!0,r=yce){this.weakness=e,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(e){let r=this;return bce.call(e,n=>r=r.getChildTrie(n)),vce.call(r,"data")?r.data:r.data=this.makeData(Fk.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let r=this;for(let n=0,i=e.length;r&&n<i;++n){const s=r.mapFor(e[n],!1);r=s&&s.get(e[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(e){let r;if(e.length){const n=e[0],i=this.mapFor(n,!1),s=i&&i.get(n);s&&(r=s.removeArray(Fk.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(e){const r=this.mapFor(e,!0);let n=r.get(e);return n||r.set(e,n=new Dl(this.weakness,this.makeData)),n}mapFor(e,r){return this.weakness&&wce(e)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}}function wce(t){switch(typeof t){case"object":if(t===null)break;case"function":return!0}return!1}var Xq=lo(function(){return navigator.product})=="ReactNative",Yf=typeof WeakMap=="function"&&!(Xq&&!global.HermesInternal),zC=typeof WeakSet=="function",VC=typeof Symbol=="function"&&typeof Symbol.for=="function",Yw=VC&&Symbol.asyncIterator,Ece=typeof lo(function(){return window.document.createElement})=="function",xce=lo(function(){return navigator.userAgent.indexOf("jsdom")>=0})||!1,_ce=(Ece||Xq)&&!xce;function Dn(t){return t!==null&&typeof t=="object"}function Cce(t,e){var r=e,n=[];t.definitions.forEach(function(s){if(s.kind==="OperationDefinition")throw bs(112,s.operation,s.name?" named '".concat(s.name.value,"'"):"");s.kind==="FragmentDefinition"&&n.push(s)}),typeof r>"u"&&(dt(n.length===1,113,n.length),r=n[0].name.value);var i=ke(ke({},t),{definitions:Xn([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],t.definitions,!0)});return i}function v0(t){t===void 0&&(t=[]);var e={};return t.forEach(function(r){e[r.name.value]=r}),e}function Zw(t,e){switch(t.kind){case"InlineFragment":return t;case"FragmentSpread":{var r=t.name.value;if(typeof e=="function")return e(r);var n=e&&e[r];return dt(n,114,r),n||null}default:return null}}function Sce(t){var e=!0;return wo(t,{FragmentSpread:function(r){if(e=!!r.directives&&r.directives.some(function(n){return n.name.value==="unmask"}),!e)return Qw}}),e}function Ace(){}class C_{constructor(e=1/0,r=Ace){this.max=e,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const r=this.getNode(e);return r&&r.value}get size(){return this.map.size}getNode(e){const r=this.map.get(e);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(e,r){let n=this.getNode(e);return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const r=this.map.get(e);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(e),this.dispose(r.value,e),!0):!1}}function S_(){}const Tce=S_,Ice=typeof WeakRef<"u"?WeakRef:function(t){return{deref:()=>t}},kce=typeof WeakMap<"u"?WeakMap:Map,$ce=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:S_,unregister:S_}},Nce=10024;class wv{constructor(e=1/0,r=Tce){this.max=e,this.dispose=r,this.map=new kce,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<Nce;i++){const s=n.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const a=s.key;delete s.key,s.keyRef=new Ice(a),this.registry.register(a,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new $ce(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const r=this.getNode(e);return r&&r.value}getNode(e){const r=this.map.get(e);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(e,r){let n=this.getNode(e);
60return n?n.value=r:(n={key:e,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(e,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const r=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,r),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),r&&this.map.delete(r)}delete(e){const r=this.map.get(e);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var f6=new WeakSet;function Jq(t){t.size<=(t.max||-1)||f6.has(t)||(f6.add(t),setTimeout(function(){t.clean(),f6.delete(t)},100))}var HC=function(t,e){var r=new wv(t,e);return r.set=function(n,i){var s=wv.prototype.set.call(this,n,i);return Jq(this),s},r},Pce=function(t,e){var r=new C_(t,e);return r.set=function(n,i){var s=C_.prototype.set.call(this,n,i);return Jq(this),s},r},Oce=Symbol.for("apollo.cacheSize"),yc=ke({},vv[Oce]),jd={};function GC(t,e){jd[t]=e}var Rce=globalThis.__DEV__!==!1?Lce:void 0,Dce=globalThis.__DEV__!==!1?Fce:void 0,Mce=globalThis.__DEV__!==!1?eW:void 0;function jce(){var t={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(t).map(function(e){var r=e[0],n=e[1];return[r,yc[r]||n]}))}function Lce(){var t,e,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:jce(),sizes:ke({print:(t=jd.print)===null||t===void 0?void 0:t.call(jd),parser:(e=jd.parser)===null||e===void 0?void 0:e.call(jd),canonicalStringify:(r=jd.canonicalStringify)===null||r===void 0?void 0:r.call(jd),links:T_(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:rW(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function eW(){return{cache:{fragmentQueryDocuments:du(this.getFragmentDoc)}}}function Fce(){var t=this.config.fragments;return ke(ke({},eW.apply(this)),{addTypenameDocumentTransform:rW(this.addTypenameTransform),inMemoryCache:{executeSelectionSet:du(this.storeReader.executeSelectionSet),executeSubSelectedArray:du(this.storeReader.executeSubSelectedArray),maybeBroadcastWatch:du(this.maybeBroadcastWatch)},fragmentRegistry:{findFragmentSpreads:du(t==null?void 0:t.findFragmentSpreads),lookup:du(t==null?void 0:t.lookup),transform:du(t==null?void 0:t.transform)}})}function Uce(t){return!!t&&"dirtyKey"in t}function du(t){return Uce(t)?t.size:void 0}function tW(t){return t!=null}function rW(t){return A_(t).map(function(e){return{cache:e}})}function A_(t){return t?Xn(Xn([du(t==null?void 0:t.performWork)],A_(t==null?void 0:t.left),!0),A_(t==null?void 0:t.right),!0).filter(tW):[]}function T_(t){var e;return t?Xn(Xn([(e=t==null?void 0:t.getMemoryInternals)===null||e===void 0?void 0:e.call(t)],T_(t==null?void 0:t.left),!0),T_(t==null?void 0:t.right),!0).filter(tW):[]}var Ru=Object.assign(function(e){return JSON.stringify(e,Bce)},{reset:function(){Gh=new Pce(yc.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&GC("canonicalStringify",function(){return Gh.size});var Gh;Ru.reset();function Bce(t,e){if(e&&typeof e=="object"){var r=Object.getPrototypeOf(e);if(r===Object.prototype||r===null){var n=Object.keys(e);if(n.every(qce))return e;var i=JSON.stringify(n),s=Gh.get(i);if(!s){n.sort();var a=JSON.stringify(n);s=Gh.get(a)||n,Gh.set(i,s),Gh.set(a,s)}var o=Object.create(r);
60return s.forEach(function(c){o[c]=e[c]}),o}}return e}function qce(t,e,r){return e===0||r[e-1]<=t}function fp(t){return{__ref:String(t)}}function Br(t){return!!(t&&typeof t=="object"&&typeof t.__ref=="string")}function Wce(t){return Dn(t)&&t.kind==="Document"&&Array.isArray(t.definitions)}function zce(t){return t.kind==="StringValue"}function Vce(t){return t.kind==="BooleanValue"}function Hce(t){return t.kind==="IntValue"}function Gce(t){return t.kind==="FloatValue"}function Kce(t){return t.kind==="Variable"}function Qce(t){return t.kind==="ObjectValue"}function Yce(t){return t.kind==="ListValue"}function Zce(t){return t.kind==="EnumValue"}function Xce(t){return t.kind==="NullValue"}function zp(t,e,r,n){if(Hce(r)||Gce(r))t[e.value]=Number(r.value);else if(Vce(r)||zce(r))t[e.value]=r.value;else if(Qce(r)){var i={};r.fields.map(function(a){return zp(i,a.name,a.value,n)}),t[e.value]=i}else if(Kce(r)){var s=(n||{})[r.name.value];t[e.value]=s}else if(Yce(r))t[e.value]=r.values.map(function(a){var o={};return zp(o,e,a,n),o[e.value]});else if(Zce(r))t[e.value]=r.value;else if(Xce(r))t[e.value]=null;else throw bs(123,e.value,r.kind)}function Jce(t,e){var r=null;t.directives&&(r={},t.directives.forEach(function(i){r[i.name.value]={},i.arguments&&i.arguments.forEach(function(s){var a=s.name,o=s.value;return zp(r[i.name.value],a,o,e)})}));var n=null;return t.arguments&&t.arguments.length&&(n={},t.arguments.forEach(function(i){var s=i.name,a=i.value;return zp(n,s,a,e)})),nW(t.name.value,n,r)}var ele=["connection","include","skip","client","rest","export","nonreactive"],J0=Ru,nW=Object.assign(function(t,e,r){if(e&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(o){i[o]=e[o]}),"".concat(r.connection.key,"(").concat(J0(i),")")}else return r.connection.key;var s=t;if(e){var a=J0(e);s+="(".concat(a,")")}return r&&Object.keys(r).forEach(function(o){ele.indexOf(o)===-1&&(r[o]&&Object.keys(r[o]).length?s+="@".concat(o,"(").concat(J0(r[o]),")"):s+="@".concat(o))}),s},{setStringify:function(t){var e=J0;return J0=t,e}});function Xw(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach(function(n){var i=n.name,s=n.value;return zp(r,i,s,e)}),r}return null}function El(t){return t.alias?t.alias.value:t.name.value}function I_(t,e,r){for(var n,i=0,s=e.selections;i<s.length;i++){var a=s[i];if(zu(a)){if(a.name.value==="__typename")return t[El(a)]}else n?n.push(a):n=[a]}if(typeof t.__typename=="string")return t.__typename;if(n)for(var o=0,c=n;o<c.length;o++){var a=c[o],l=I_(t,Zw(a,r).selectionSet,r);if(typeof l=="string")return l}}function zu(t){return t.kind==="Field"}function tle(t){return t.kind==="InlineFragment"}function w0(t){dt(t&&t.kind==="Document",115);var e=t.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw bs(116,r.kind);return r});return dt(e.length<=1,117,e.length),t}function _f(t){return w0(t),t.definitions.filter(function(e){return e.kind==="OperationDefinition"})[0]}function t1(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}function E0(t){return t.definitions.filter(function(e){return e.kind==="FragmentDefinition"})}function iW(t){var e=_f(t);return dt(e&&e.operation==="query",118),e}function sW(t){dt(t.kind==="Document",119),dt(t.definitions.length<=1,120);var e=t.definitions[0];return dt(e.kind==="FragmentDefinition",121),e}function py(t){w0(t);for(var e,r=0,n=t.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var s=i.operation;if(s==="query"||s==="mutation"||s==="subscription")return i}i.kind==="FragmentDefinition"&&!e&&(e=i)}if(e)return e;throw bs(122)}function KC(t){var e=Object.create(null),r=t&&t.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&zp(e,n.variable.name,n.defaultValue)}),e}let Pi=null;const Uk={};let rle=1;const nle=()=>class{constructor(){this.id=["slot",rle++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Pi;e;e=e.parent)if(this.id in e.slots){const r=e.slots[this.id];if(r===Uk)break;return e!==Pi&&(Pi.slots[this.id]=r),!0}return Pi&&(Pi.slots[this.id]=Uk),!1}getValue(){if(this.hasValue())return Pi.slots[this.id]}withValue(e,r,n,i){const s={__proto__:null,[this.id]:e},a=Pi;Pi={parent:a,slots:s};try{return r.apply(i,n)}finally{Pi=a}}static bind(e){const r=Pi;return function(){const n=Pi;try{return Pi=r,e.apply(this,arguments)}finally{Pi=n}}}static noContext(e,r,n){if(Pi){const i=Pi;try{return Pi=null,e.apply(n,r)}finally{Pi=i}}else return e.apply(n,r)}};function Bk(t){try{return t()}catch{}}const h6="@wry/context:Slot",ile=Bk(()=>globalThis)||Bk(()=>global)||Object.create(null),qk=ile,x0=qk[h6]||Array[h6]||(function(t){try{Object.defineProperty(qk,h6,{value:t,enumerable:!1,writable:!1,
60configurable:!0})}finally{return t}})(nle()),{bind:crt,noContext:lrt}=x0,Jw=new x0,{hasOwnProperty:sle}=Object.prototype,QC=Array.from||function(t){const e=[];return t.forEach(r=>e.push(r)),e};function YC(t){const{unsubscribe:e}=t;typeof e=="function"&&(t.unsubscribe=void 0,e())}const H1=[],ale=100;function Vp(t,e){if(!t)throw new Error(e||"assertion failure")}function aW(t,e){const r=t.length;return r>0&&r===e.length&&t[r-1]===e[r-1]}function oW(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}function cW(t){return t.slice(0)}class e3{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e3.count}peek(){if(this.value.length===1&&!Vu(this))return Wk(this),this.value[0]}recompute(e){return Vp(!this.recomputing,"already recomputing"),Wk(this),Vu(this)?ole(this,e):oW(this.value)}setDirty(){this.dirty||(this.dirty=!0,lW(this),YC(this))}dispose(){this.setDirty(),pW(this),ZC(this,(e,r)=>{e.setDirty(),gW(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=H1.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(QC(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),H1.push(this.deps),this.deps=null)}}e3.count=0;function Wk(t){const e=Jw.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),Vu(t)?dW(e,t):fW(e,t),e}function ole(t,e){return pW(t),Jw.withValue(t,cle,[t,e]),ule(t,e)&&lle(t),oW(t.value)}function cle(t,e){t.recomputing=!0;const{normalizeResult:r}=t;let n;r&&t.value.length===1&&(n=cW(t.value)),t.value.length=0;try{if(t.value[0]=t.fn.apply(null,e),r&&n&&!aW(n,t.value))try{t.value[0]=r(t.value[0],n[0])}catch{}}catch(i){t.value[1]=i}t.recomputing=!1}function Vu(t){return t.dirty||!!(t.dirtyChildren&&t.dirtyChildren.size)}function lle(t){t.dirty=!1,!Vu(t)&&uW(t)}function lW(t){ZC(t,dW)}function uW(t){ZC(t,fW)}function ZC(t,e){const r=t.parents.size;if(r){const n=QC(t.parents);for(let i=0;i<r;++i)e(n[i],t)}}function dW(t,e){Vp(t.childValues.has(e)),Vp(Vu(e));const r=!Vu(t);if(!t.dirtyChildren)t.dirtyChildren=H1.pop()||new Set;else if(t.dirtyChildren.has(e))return;t.dirtyChildren.add(e),r&&lW(t)}function fW(t,e){Vp(t.childValues.has(e)),Vp(!Vu(e));const r=t.childValues.get(e);r.length===0?t.childValues.set(e,cW(e.value)):aW(r,e.value)||t.setDirty(),hW(t,e),!Vu(t)&&uW(t)}function hW(t,e){const r=t.dirtyChildren;r&&(r.delete(e),r.size===0&&(H1.length<ale&&H1.push(r),t.dirtyChildren=null))}function pW(t){t.childValues.size>0&&t.childValues.forEach((e,r)=>{gW(t,r)}),t.forgetDeps(),Vp(t.dirtyChildren===null)}function gW(t,e){e.parents.delete(t),t.childValues.delete(e),hW(t,e)}function ule(t,e){if(typeof t.subscribe=="function")try{YC(t),t.unsubscribe=t.subscribe.apply(null,e)}catch{return t.setDirty(),!1}return!0}const dle={setDirty:!0,dispose:!0,forget:!0};function mW(t){const e=new Map;function r(n){const i=Jw.getValue();if(i){let s=e.get(n);s||e.set(n,s=new Set),i.dependOn(s)}}return r.dirty=function(i,s){const a=e.get(i);if(a){const o=s&&sle.call(dle,s)?s:"setDirty";QC(a).forEach(c=>c[o]()),e.delete(i),YC(a)}},r}let zk;function fle(...t){return(zk||(zk=new Dl(typeof WeakMap=="function"))).lookupArray(t)}const p6=new Set;function G1(t,{max:e=Math.pow(2,16),keyArgs:r,makeCacheKey:n=fle,normalizeResult:i,subscribe:s,cache:a=C_}=Object.create(null)){const o=typeof a=="function"?new a(e,f=>f.dispose()):a,c=function(){const f=n.apply(null,r?r.apply(null,arguments):arguments);if(f===void 0)return t.apply(null,arguments);let h=o.get(f);h||(o.set(f,h=new e3(t)),h.normalizeResult=i,h.subscribe=s,h.forget=()=>o.delete(f));const g=h.recompute(Array.prototype.slice.call(arguments));return o.set(f,h),p6.add(o),Jw.hasValue()||(p6.forEach(m=>m.clean()),p6.clear()),g};Object.defineProperty(c,"size",{get:()=>o.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:e,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:s,cache:o});function l(f){const h=f&&o.get(f);h&&h.setDirty()}c.dirtyKey=l,c.dirty=function(){l(n.apply(null,arguments))};function u(f){const h=f&&o.get(f);if(h)return h.peek()}c.peekKey=u,c.peek=function(){return u(n.apply(null,arguments))};function d(f){return f?o.delete(f):!1}return c.forgetKey=d,c.forget=function(){return d(n.apply(null,arguments))},c.makeCacheKey=n,c.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(c)}function hle(t){return t}var yW=(function(){function t(e,r){r===void 0&&(r=Object.create(null)),this.resultCache=zC?new WeakSet:new Set,this.transform=e,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return t.prototype.getCacheKey=function(e){return[e]},t.identity=function(){return new t(hle,{cache:!1})},t.split=function(e,r,n){return n===void 0&&(n=t.identity()),Object.assign(new t(function(i){var s=e(i)?r:n;return s.transformDocument(i)},{cache:!1}),{left:r,right:n})},t.prototype.resetCache=function(){var e=this;if(this.cached){var r=new Dl(Yf);this.performWork=G1(t.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=e.getCacheKey(n);if(i)return dt(Array.isArray(i),104),r.lookupArray(i)},max:yc["documentTransform.cache"],cache:wv})}},t.prototype.performWork=function(e){return w0(e),this.transform(e)},t.prototype.transformDocument=function(e){if(this.resultCache.has(e))return e;var r=this.performWork(e);return this.resultCache.add(r),r},t.prototype.concat=function(e){var r=this;return Object.assign(new t(function(n){return e.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:e})},t})(),v1,Qd=Object.assign(function(t){var e=v1.get(t);return e||(e=uce(t),v1.set(t,e)),e},{reset:function(){v1=new HC(yc.print||2e3)}});Qd.reset();globalThis.__DEV__!==!1&&GC("print",function(){return v1?v1.size:0});var Mn=Array.isArray;function Ma(t){return Array.isArray(t)&&t.length>0}var Vk={kind:pt.FIELD,name:{kind:pt.NAME,value:"__typename"}};function bW(t,e){return!t||t.selectionSet.selections.every(function(r){return r.kind===pt.FRAGMENT_SPREAD&&bW(e[r.name.value],e)})}function ple(t){return bW(_f(t)||sW(t),v0(E0(t)))?null:t}function gle(t){var e=new Map,r=new Map;return t.forEach(function(n){n&&(n.name?e.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=e.get(n.name.value);return!i&&r.size&&r.forEach(function(s,a){a(n)&&(i=s)}),i}}function Hk(t){var e=new Map;return function(n){n===void 0&&(n=t);var i=e.get(n);return i||e.set(n,i={variables:new Set,fragmentSpreads:new Set}),i}}function vW(t,e){w0(e);for(var r=Hk(""),n=Hk(""),i=function(b){for(var E=0,v=void 0;E<b.length&&(v=b[E]);++E)if(!Mn(v)){if(v.kind===pt.OPERATION_DEFINITION)return r(v.name&&v.name.value);if(v.kind===pt.FRAGMENT_DEFINITION)return n(v.name.value)}return globalThis.__DEV__!==!1&&dt.error(124),null},s=0,a=e.definitions.length-1;a>=0;--a)e.definitions[a].kind===pt.OPERATION_DEFINITION&&++s;var o=gle(t),c=function(b){return Ma(b)&&b.map(o).some(function(E){return E&&E.remove})},l=new Map,u=!1,d={enter:function(b){if(c(b.directives))return u=!0,null}},f=wo(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(b,E,v,w,x){var _=i(x);_&&_.variables.add(b.name.value)}},FragmentSpread:{enter:function(b,E,v,w,x){if(c(b.directives))return u=!0,null;var _=i(x);_&&_.fragmentSpreads.add(b.name.value)}},FragmentDefinition:{enter:function(b,E,v,w){l.set(JSON.stringify(w),b)},leave:function(b,E,v,w){var x=l.get(JSON.stringify(w));if(b===x)return b;if(s>0&&b.selectionSet.selections.every(function(_){return _.kind===pt.FIELD&&_.name.value==="__typename"}))return n(b.name.value).removed=!0,u=!0,null}},Directive:{leave:function(b){if(o(b))return u=!0,null}}});if(!u)return e;var h=function(b){return b.transitiveVars||(b.transitiveVars=new Set(b.variables),b.removed||b.fragmentSpreads.forEach(function(E){h(n(E)).transitiveVars.forEac
60h(function(v){b.transitiveVars.add(v)})})),b},g=new Set;f.definitions.forEach(function(b){b.kind===pt.OPERATION_DEFINITION?h(r(b.name&&b.name.value)).fragmentSpreads.forEach(function(E){g.add(E)}):b.kind===pt.FRAGMENT_DEFINITION&&s===0&&!n(b.name.value).removed&&g.add(b.name.value)}),g.forEach(function(b){h(n(b)).fragmentSpreads.forEach(function(E){g.add(E)})});var m=function(b){return!!(!g.has(b)||n(b).removed)},y={enter:function(b){if(m(b.name.value))return null}};return ple(wo(f,{FragmentSpread:y,FragmentDefinition:y,OperationDefinition:{leave:function(b){if(b.variableDefinitions){var E=h(r(b.name&&b.name.value)).transitiveVars;if(E.size<b.variableDefinitions.length)return ke(ke({},b),{variableDefinitions:b.variableDefinitions.filter(function(v){return E.has(v.variable.name.value)})})}}}}))}var XC=Object.assign(function(t){return wo(t,{SelectionSet:{enter:function(e,r,n){if(!(n&&n.kind===pt.OPERATION_DEFINITION)){var i=e.selections;if(i){var s=i.some(function(o){return zu(o)&&(o.name.value==="__typename"||o.name.value.lastIndexOf("__",0)===0)});if(!s){var a=n;if(!(zu(a)&&a.directives&&a.directives.some(function(o){return o.name.value==="export"})))return ke(ke({},e),{selections:Xn(Xn([],i,!0),[Vk],!1)})}}}}}})},{added:function(t){return t===Vk}});function mle(t){var e=py(t),r=e.operation;if(r==="query")return t;var n=wo(t,{OperationDefinition:{enter:function(i){return ke(ke({},i),{operation:"query"})}}});return n}function wW(t){w0(t);var e=vW([{test:function(r){return r.name.value==="client"},remove:!0}],t);return e}function yle(t){return w0(t),wo(t,{FragmentSpread:function(e){var r;if(!(!((r=e.directives)===null||r===void 0)&&r.some(function(n){return n.name.value==="unmask"})))return ke(ke({},e),{directives:Xn(Xn([],e.directives||[],!0),[{kind:pt.DIRECTIVE,name:{kind:pt.NAME,value:"nonreactive"}}
60],!1)})}})}var ble=Object.prototype.hasOwnProperty;function Ev(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t3(t)}function t3(t){var e=t[0]||{},r=t.length;if(r>1)for(var n=new Hu,i=1;i<r;++i)e=n.merge(e,t[i]);return e}var vle=function(t,e,r){return this.merge(t[r],e[r])},Hu=(function(){function t(e){e===void 0&&(e=vle),this.reconciler=e,this.isObject=Dn,this.pastCopies=new Set}return t.prototype.merge=function(e,r){for(var n=this,i=[],s=2;s<arguments.length;s++)i[s-2]=arguments[s];return Dn(r)&&Dn(e)?(Object.keys(r).forEach(function(a){if(ble.call(e,a)){var o=e[a];if(r[a]!==o){var c=n.reconciler.apply(n,Xn([e,r,a],i,!1));c!==o&&(e=n.shallowCopyForMerge(e),e[a]=c)}}else e=n.shallowCopyForMerge(e),e[a]=r[a]}),e):r},t.prototype.shallowCopyForMerge=function(e){return Dn(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e=ke({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e))),e},t})();function wle(t){return t===void 0&&(t=!1),{keyArgs:t,read:function(e,r){var n=r.canRead,i=r.readField;if(!e)return e;var s=[],a="",o="";
60e.edges.forEach(function(d){n(i("node",d))&&(s.push(d),d.cursor&&(a=a||d.cursor||"",o=d.cursor||o))}),s.length>1&&a===o&&(a="");var c=e.pageInfo||{},l=c.startCursor,u=c.endCursor;return ke(ke({},g6(e)),{edges:s,pageInfo:ke(ke({},e.pageInfo),{startCursor:l||a,endCursor:u||o})})},merge:function(e,r,n){var i=n.args,s=n.isReference,a=n.readField;if(e||(e=xle()),!r)return e;var o=r.edges?r.edges.map(function(A){return s(A=ke({},A))&&(A.cursor=a("cursor",A)),A}):[];if(r.pageInfo){var c=r.pageInfo,l=c.startCursor,u=c.endCursor,d=o[0],f=o[o.length-1];d&&l&&(d.cursor=l),f&&u&&(f.cursor=u);var h=d&&d.cursor;h&&!l&&(r=Ev(r,{pageInfo:{startCursor:h}}));var g=f&&f.cursor;g&&!u&&(r=Ev(r,{pageInfo:{endCursor:g}}))}var m=e.edges,y=[];if(i&&i.after){var b=m.findIndex(function(A){return A.cursor===i.after});b>=0&&(m=m.slice(0,b+1))}else if(i&&i.before){var b=m.findIndex(function(I){return I.cursor===i.before});y=b<0?m:m.slice(b),m=[]}else r.edges&&(m=[]);var E=Xn(Xn(Xn([],m,!0),o,!0),y,!0),v=ke(ke({},r.pageInfo),e.pageInfo);if(r.pageInfo){var w=r.pageInfo,x=w.hasPreviousPage,_=w.hasNextPage,l=w.startCursor,u=w.endCursor,S=oa(w,["hasPreviousPage","hasNextPage","startCursor","endCursor"]);Object.assign(v,S),m.length||(x!==void 0&&(v.hasPreviousPage=x),l!==void 0&&(v.startCursor=l)),y.length||(_!==void 0&&(v.hasNextPage=_),u!==void 0&&(v.endCursor=u))}return ke(ke(ke({},g6(e)),g6(r)),{edges:E,pageInfo:v})}}}var g6=function(t){return oa(t,Ele)},Ele=["edges","pageInfo"];function xle(){return{edges:[],pageInfo:{hasPreviousPage:!1,hasNextPage:!0,startCursor:"",endCursor:""}}}function _le(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Cle(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 61In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cle(t,e){if(t){if(typeof t=="string")return Gk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gk(t,e)}}function Gk(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Kk(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function JC(t,e,r){return e&&Kk(t.prototype,e),r&&Kk(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var eS=function(){return typeof Symbol=="function"},tS=function(t){return eS()&&!!Symbol[t]},rS=function(t){return tS(t)?Symbol[t]:"@@"+t};eS()&&!tS("observable")&&(Symbol.observable=Symbol("observable"));var Sle=rS("iterator"),k_=rS("observable"),EW=rS("species");function xv(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function eg(t){var e=t.constructor;return e!==void 0&&(e=e[EW],e===null&&(e=void 0)),e!==void 0?e:nn}function Ale(t){return t instanceof nn}function Hp(t){Hp.log?Hp.log(t):setTimeout(function(){throw t})}function Ab(t){Promise.resolve().then(function(){try{t()}catch(e){Hp(e)}})}function xW(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=xv(e,"unsubscribe");r&&r.call(e)}}catch(n){Hp(n)}}function $_(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function Tle(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(_W(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function _W(t,e,r){t._state="running";var n=t._observer;try{var i=xv(n,e);switch(e){case"next":i&&i.call(n,r);break;case"error":if($_(t),i)i.call(n,r);else throw r;break;case"complete":$_(t),i&&i.call(n);break}}catch(s){Hp(s)}t._state==="closed"?xW(t):t._state==="running"&&(t._state="ready")}function m6(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],Ab(function(){return Tle(t)}
61);return}_W(t,e,r)}}var Ile=(function(){function t(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new kle(this);try{this._cleanup=n.call(void 0,i)}catch(s){i.error(s)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&($_(this),xW(this))},JC(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t})(),kle=(function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(n){m6(this._subscription,"next",n)},e.error=function(n){m6(this._subscription,"error",n)},e.complete=function(){m6(this._subscription,"complete")},JC(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t})(),nn=(function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new Ile(n,this._subscriber)},e.forEach=function(n){var i=this;return new Promise(function(s,a){if(typeof n!="function"){a(new TypeError(n+" is not a function"));return}function o(){c.unsubscribe(),s()}var c=i.subscribe({next:function(l){try{n(l,o)}catch(u){a(u),c.unsubscribe()}},error:a,complete:s})})},e.map=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=eg(this);return new s(function(a){return i.subscribe({next:function(o){try{o=n(o)}catch(c){return a.error(c)}a.next(o)},error:function(o){a.error(o)},complete:function(){a.complete()}})})},e.filter=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=eg(this);return new s(function(a){return i.subscribe({next:function(o){try{if(!n(o))return}catch(c){return a.error(c)}a.next(o)},error:function(o){a.error(o)},complete:function(){a.complete()}})})},e.reduce=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=eg(this),a=arguments.length>1,o=!1,c=arguments[1],l=c;return new s(function(u){return i.subscribe({next:function(d){var f=!o;if(o=!0,!f||a)try{l=n(l,d)}catch(h){return u.error(h)}else l=d},error:function(d){u.error(d)},complete:function(){if(!o&&!a)return u.error(new TypeError("Cannot reduce an empty sequence"));u.next(l),u.complete()}})})},e.concat=function(){for(var n=this,i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];var o=eg(this);return new o(function(c){var l,u=0;function d(f){l=f.subscribe({next:function(h){c.next(h)},error:function(h){c.error(h)},complete:function(){u===s.length?(l=void 0,c.complete()):d(o.from(s[u++]))}})}return d(n),function(){l&&(l.unsubscribe(),l=void 0)}})},e.flatMap=function(n){var i=this;if(typeof n!="function")throw new TypeError(n+" is not a function");var s=eg(this);return new s(function(a){var o=[],c=i.subscribe({next:function(u){if(n)try{u=n(u)}catch(f){return a.error(f)}var d=s.from(u).subscribe({next:function(f){a.next(f)},error:function(f){a.error(f)},complete:function(){var f=o.indexOf(d);f>=0&&o.splice(f,1),l()}});o.push(d)},error:function(u){a.error(u)},complete:function(){l()}});function l(){c.closed&&o.length===0&&a.complete()}return function(){o.forEach(function(u){return u.unsubscribe()}),c.unsubscribe()}})},e[k_]=function(){return this},t.from=function(n){var i=typeof this=="function"?this:t;if(n==null)throw new TypeError(n+" is not an object");var s=xv(n,k_);if(s){var a=s.call(n);if(Object(a)!==a)throw new TypeError(a+" is not an object");return Ale(a)&&a.constructor===i?a:new i(function(o){return a.subscribe(o)})}if(tS("iterator")&&(s=xv(n,Sle),s))return new i(function(o){Ab(function(){if(!o.closed){for(var c=_le(s.call(n)),l;!(l=c()).done;){var u=l.value;if(o.next(u),o.closed)return}o.complete()}})});if(Array.isArray(n))return new i(function(o){Ab(function(){if(!o.closed){for(var c=0;c<n.length;++c)if(o.next(n[c]),o.closed)return;o.complete()}})});throw new TypeError(n+" is not observable")},t.of=function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];var a=typeof this=="function"?this:t;return new a(function(o){Ab(function(){if(!o.closed){for(var c=0;c<i.length;++c)if(o.next(i[c]),o.closed)return;o.complete()}})})},JC(t,null,[{key:EW,get:function(){return this}}]),t})();eS()&&Object.defineProperty(nn,Symbol("extensions"),{value:{symbol:k_,hostReportError:Hp},configurable:!0});function $le(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var Mh;typeof self<"u"?Mh=self:typeof window<"u"?Mh=window:typeof global<"u"?Mh=global:typeof module<"u"?Mh=module:Mh=Function("return this")();$le(Mh);var Qk=nn.prototype,Yk="@@observable";Qk[Yk]||(Qk[Yk]=function(){return this});function Nle(t){return t.catch(function(){}),t}var Ple=Object.prototype.toString;function CW(t){return N_(t)}function N_(t,e){switch(Ple.call(t)){case"[object Array]":{if(e=e||new Map,e.has(t))return e.get(t);var r=t.slice(0);return e.set(t,r),r.forEach(function(i,s){r[s]=N_(i,e)}),r}case"[object Object]":{if(e=e||new Map,e.has(t))return e.get(t);var n=Object.create(Object.getPrototypeOf(t));return e.set(t,n),Object.keys(t).forEach(function(i){n[i]=N_(t[i],e)}),n}default:return t}}function Ole(t){var e=new Set([t]);return e.forEach(function(r){Dn(r)&&Rle(r)===r&&Object.getOwnPropertyNames(r).forEach(function(n){Dn(r[n])&&e.add(r[n])})}),t}function Rle(t){if(globalThis.__DEV__!==!1&&!Object.isFrozen(t))try{Object.freeze(t)}catch(e){if(e instanceof TypeError)return null;throw e}return t}function Gp(t){return globalThis.__DEV__!==!1&&Ole(t),t}function w1(t,e,r){var n=[];t.forEach(function(i){return i[e]&&n.push(i)}
61),n.forEach(function(i){return i[e](r)})}function y6(t,e,r){return new nn(function(n){var i={then:function(c){return new Promise(function(l){return l(c())})}};function s(c,l){return function(u){if(c){var d=function(){return n.closed?0:c(u)};i=i.then(d,d).then(function(f){return n.next(f)},function(f){return n.error(f)})}else n[l](u)}}var a={next:s(e,"next"),error:s(r,"error"),complete:function(){i.then(function(){return n.complete()})}},o=t.subscribe(a);return function(){return o.unsubscribe()}})}function SW(t){function e(r){Object.defineProperty(t,r,{value:nn})}return VC&&Symbol.species&&e(Symbol.species),e("@@species"),t}function Zk(t){return t&&typeof t.then=="function"}var jh=(function(t){xc(e,t);function e(r){var n=t.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,s){n.resolve=i,n.reject=s}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),w1(n.observers,"next",i))},error:function(i){var s=n.sub;s!==null&&(s&&setTimeout(function(){return s.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),w1(n.observers,"error",i))},complete:function(){var i=n,s=i.sub,a=i.sources,o=a===void 0?[]:a;if(s!==null){var c=o.shift();c?Zk(c)?c.then(function(l){return n.sub=l.subscribe(n.handlers)},n.handlers.error):n.sub=c.subscribe(n.handlers):(s&&setTimeout(function(){return s.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),w1(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.error(i)},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new nn(r)]),Zk(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return e.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},e.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},e.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},e.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},e.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(s){return s(r,n)}))},e.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,s){n||(n=!0,r(i,s))})},e})(nn);SW(jh);function hp(t){return"incremental"in t}function Dle(t){return"hasNext"in t&&"data"in t}function Mle(t){return hp(t)||Dle(t)}function jle(t){return Dn(t)&&"payload"in t}function AW(t,e){var r=t,n=new Hu;return hp(e)&&Ma(e.incremental)&&e.incremental.forEach(function(i){for(var s=i.data,a=i.path,o=a.length-1;o>=0;--o){var c=a[o],l=!isNaN(+c),u=l?[]:{};u[c]=s,s=u}r=n.merge(r,s)}),r}function Tb(t){var e=P_(t);return Ma(e)}function P_(t){var e=Ma(t.errors)?t.errors.slice(0):[];return hp(t)&&Ma(t.incremental)&&t.incremental.forEach(function(r){r.errors&&e.push.apply(e,r.errors)}),e}function Cf(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach(function(n){n&&Object.keys(n).forEach(function(i){var s=n[i];s!==void 0&&(r[i]=s)})}),r}function Ib(t,e){return Cf(t,e,e.variables&&{variables:Cf(ke(ke({},t&&t.variables),e.variables))})}var b6,Lle=Symbol.for("apollo.deprecations"),Xk=Symbol.for("apollo.deprecations.slot"),O_=vv,R_=(b6=O_[Xk])!==null&&b6!==void 0?b6:O_[Xk]=new x0;function Fle(t){return O_[Lle]||(R_.getValue()||[]).includes(t)}function Ei(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return R_.withValue.apply(R_,Xn([Array.isArray(t)?t:[t]],e,!1))}function Rn(t,e,r,n){n===void 0&&(n="Please remove this option."),bu(e,function(){e in t&&globalThis.__DEV__!==!1&&dt.warn(103,r,e,n)})}function bu(t,e){Fle(t)||e()}function v6(t){return new nn(function(e){e.error(t)})}var TW=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n};function Ule(t){for(var e=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(t);r<n.length;r++){var i=n[r];if(e.indexOf(i)<0)throw bs(58,i)}return t}function Ble(t,e){var r=ke({},t),n=function(s){typeof s=="function"?r=ke(ke({},r),s(r)):r=ke(ke({},r),s)},i=function(){return ke({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:n}),Object.defineProperty(e,"getContext",{enumerable:!1,value:i}),e}function qle(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?t1(e.query)||void 0:""),e}function Wle(t,e){var r=ke({},t),n=new Set(Object.keys(t));return wo(e,{Variable:function(i,s,a){a&&a.kind!=="VariableDefinition"&&n.delete(i.name.value)}}
61),n.forEach(function(i){delete r[i]}),r}function Jk(t,e){return e?e(t):nn.of()}function tg(t){return typeof t=="function"?new gy(t):t}function A2(t){return t.request.length<=1}var gy=(function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return nn.of()})},t.from=function(e){return e.length===0?t.empty():e.map(tg).reduce(function(r,n){return r.concat(n)})},t.split=function(e,r,n){var i=tg(r),s=tg(n||new t(Jk)),a;return A2(i)&&A2(s)?a=new t(function(o){return e(o)?i.request(o)||nn.of():s.request(o)||nn.of()}):a=new t(function(o,c){return e(o)?i.request(o,c)||nn.of():s.request(o,c)||nn.of()}),Object.assign(a,{left:i,right:s})},t.execute=function(e,r){return e.request(Ble(r.context,qle(Ule(r))))||nn.of()},t.concat=function(e,r){var n=tg(e);if(A2(n))return globalThis.__DEV__!==!1&&dt.warn(47,n),n;var i=tg(r),s;return A2(i)?s=new t(function(a){return n.request(a,function(o){return i.request(o)||nn.of()})||nn.of()}):s=new t(function(a,o){return n.request(a,function(c){return i.request(c,o)||nn.of()})||nn.of()}),Object.assign(s,{left:n,right:i})},t.prototype.split=function(e,r,n){return this.concat(t.split(e,r,n||new t(Jk)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw bs(48)},t.prototype.onError=function(e,r){if(globalThis.__DEV__!==!1&&bu("onError",function(){globalThis.__DEV__!==!1&&dt.warn(49)}),r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&dt.warn(50),this.onError=e,this},t})(),D_=gy.execute;function zle(t){var e,r=t[Symbol.asyncIterator]();return e={next:function(){return r.next()}},e[Symbol.asyncIterator]=function(){return this},e}function Vle(t){var e=null,r=null,n=!1,i=[],s=[];function a(d){if(!r){if(s.length){var f=s.shift();if(Array.isArray(f)&&f[0])return f[0]({value:d,done:!1})}i.push(d)}}function o(d){r=d;var f=s.slice();f.forEach(function(h){h[1](d)}),!e||e()}function c(){n=!0;var d=s.slice();d.forEach(function(f){f[0]({value:void 0,done:!0})}),!e||e()}e=function(){e=null,t.removeListener("data",a),t.removeListener("error",o),t.removeListener("end",c),t.removeListener("finish",c),t.removeListener("close",c)},t.on("data",a),t.on("error",o),t.on("end",c),t.on("finish",c),t.on("close",c);function l(){return new Promise(function(d,f){if(r)return f(r);if(i.length)return d({value:i.shift(),done:!1});if(n)return d({value:void 0,done:!0});s.push([d,f])})}var u={next:function(){return l()}};return Yw&&(u[Symbol.asyncIterator]=function(){return this}),u}function Hle(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise(function(n,i){t.then(function(s){n({value:s,done:!1})}).catch(i)}))}};return Yw&&(r[Symbol.asyncIterator]=function(){return this}),r}function e$(t){var e={next:function(){return t.read()}};return Yw&&(e[Symbol.asyncIterator]=function(){return this}),e}function Gle(t){return!!t.body}function Kle(t){return!!t.getReader}function Qle(t){return!!(Yw&&t[Symbol.asyncIterator])}function Yle(t){return!!t.stream}function Zle(t){return!!t.arrayBuffer}function Xle(t){return!!t.pipe}function Jle(t){var e=t;if(Gle(t)&&(e=t.body),Qle(e))return zle(e);if(Kle(e))return e$(e.getReader());if(Yle(e))return e$(e.stream().getReader());if(Zle(e))return Hle(e.arrayBuffer());if(Xle(e))return Vle(e);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var nS=Symbol();function eue(t){return t.extensions?Array.isArray(t.extensions[nS]):!1}function IW(t){return t.hasOwnProperty("graphQLErrors")}var tue=function(t){var e=Xn(Xn(Xn([],t.graphQLErrors,!0),t.clientErrors,!0),t.protocolErrors,!0);return t.networkError&&e.push(t.networkError),e.map(function(r){return Dn(r)&&r.message||"Error message not found."}).join(` 62`)},Zc=(function(t){xc(e,t);function e(r){var n=r.graphQLErrors,i=r.protocolErrors,s=r.clientErrors,a=r.networkError,o=r.errorMessage,c=r.extraInfo,l=t.call(this,o)||this;return l.name="ApolloError",l.graphQLErrors=n||[],l.protocolErrors=i||[],l.clientErrors=s||[],l.networkError=a||null,l.message=o||tue(l),l.extraInfo=c,l.cause=Xn(Xn(Xn([a],n||[],!0),i||[],!0),s||[],!0).find(function(u){return!!u})||null,l.__proto__=e.prototype,l}return e}
62)(Error),t$=Object.prototype.hasOwnProperty;function rue(t,e){return lu(this,void 0,void 0,function(){var r,n,i,s,a,o,c,l,u,d,f,h,g,m,y,b,E,v,w,x,_,S,A,I;return uu(this,function($){switch($.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");r=new TextDecoder("utf-8"),n=(I=t.headers)===null||I===void 0?void 0:I.get("content-type"),i="boundary=",s=n!=null&&n.includes(i)?n==null?void 0:n.substring((n==null?void 0:n.indexOf(i))+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",a=`\r 63--`.concat(s),o="",c=Jle(t),l=!0,$.label=1;case 1:return l?[4,c.next()]:[3,3];case 2:for(u=$.sent(),d=u.value,f=u.done,h=typeof d=="string"?d:r.decode(d),g=o.length-a.length+1,l=!f,o+=h,m=o.indexOf(a,g);m>-1;){if(y=void 0,S=[o.slice(0,m),o.slice(m+a.length)],y=S[0],o=S[1],b=y.indexOf(`\r 64\r 65`),E=nue(y.slice(0,b)),v=E["content-type"],v&&v.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(w=y.slice(b),w){if(x=kW(t,w),Object.keys(x).length>1||"data"in x||"incremental"in x||"errors"in x||"payload"in x)if(jle(x)){if(_={},"payload"in x){if(Object.keys(x).length===1&&x.payload===null)return[2];_=ke({},x.payload)}"errors"in x&&(_=ke(ke({},_),{extensions:ke(ke({},"extensions"in _?_.extensions:null),(A={},A[nS]=x.errors,A))})),e(_)}else e(x);else if(Object.keys(x).length===1&&"hasNext"in x&&!x.hasNext)return[2]}m=o.indexOf(a)}return[3,1];case 3:return[2]}})})}function nue(t){var e={};return t.split(` 66`).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),s=r.slice(n+1).trim();e[i]=s}}),e}function kW(t,e){if(t.status>=300){var r=function(){try{return JSON.parse(e)}catch{return e}};TW(t,r(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=t,n.statusCode=t.status,n.bodyText=e,n}}function iue(t,e){t.result&&t.result.errors&&t.result.data&&e.next(t.result),e.error(t)}function sue(t){return function(e){return e.text().then(function(r){return kW(e,r)}).then(function(r){return!Array.isArray(r)&&!t$.call(r,"data")&&!t$.call(r,"errors")&&TW(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map(function(n){return n.operationName}):t.operationName,"'.")),r})}}var M_=function(t,e){var r;try{r=JSON.stringify(t)}catch(i){var n=bs(54,e,i.message);throw n.parseError=i,n}return r},aue={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},oue={accept:"*/*","content-type":"application/json"},cue={method:"POST"},lue={http:aue,headers:oue,options:cue},uue=function(t,e){return e(t)};function due(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},s={};r.forEach(function(d){i=ke(ke(ke({},i),d.options),{headers:ke(ke({},i.headers),d.headers)}),d.credentials&&(i.credentials=d.credentials),s=ke(ke({},s),d.http)}),i.headers&&(i.headers=fue(i.headers,s.preserveHeaderCase));var a=t.operationName,o=t.extensions,c=t.variables,l=t.query,u={operationName:a,variables:c};return s.includeExtensions&&(u.extensions=o),s.includeQuery&&(u.query=e(l,Qd)),{options:i,body:u}}function fue(t,e){if(!e){var r={};return Object.keys(Object(t)).forEach(function(s){r[s.toLowerCase()]=t[s]}),r}var n={};Object.keys(Object(t)).forEach(function(s){n[s.toLowerCase()]={originalName:s,value:t[s]}});var i={};return Object.keys(n).forEach(function(s){i[n[s].originalName]=n[s].value}),i}var hue=function(t){if(!t&&typeof fetch>"u")throw bs(51)},pue=function(t,e){var r=t.getContext(),n=r.uri;return n||(typeof e=="function"?e(t):e||"/graphql")};function gue(t,e){var r=[],n=function(d,f){r.push("".concat(d,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=M_(e.variables,"Variables map")}catch(d){return{parseError:d}}n("variables",i)}if(e.extensions){var s=void 0;try{s=M_(e.extensions,"Extensions map")}catch(d){return{parseError:d}}n("extensions",s)}var a="",o=t,c=t.indexOf("#");c!==-1&&(a=t.substr(c),o=t.substr(0,c));var l=o.indexOf("?")===-1?"?":"&",u=o+l+r.join("&")+a;return{newURI:u}}var r$=lo(function(){return fetch}),mue=function(t){t===void 0&&(t={});var e=t.uri,r=e===void 0?"/graphql":e,n=t.fetch,i=t.print,s=i===void 0?uue:i,a=t.includeExtensions,o=t.preserveHeaderCase,c=t.useGETForQueries,l=t.includeUnusedVariables,u=l===void 0?!1:l,d=oa(t,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&hue(n||r$);var f={http:{includeExtensions:a,preserveHeaderCase:o},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new gy(function(h){var g=pue(h,r),m=h.getContext(),y={};if(m.clientAwareness){var b=m.clientAwareness,E=b.name,v=b.version;E&&(y["apollographql-client-name"]=E),v&&(y["apollographql-client-version"]=v)}var w=ke(ke({},y),m.headers),x={http:m.http,options:m.fetchOptions,credentials:m.credentials,headers:w};if(V1(["client"],h.query)){globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&dt.warn(52);var _=wW(h.query);if(!_)return v6(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));h.query=_}var S=due(h,s,lue,f,x),A=S.options,I=S.body;I.variables&&!u&&(I.variables=Wle(I.variables,h.query));var $;!A.signal&&typeof AbortController<"u"&&($=new AbortController,A.signal=$.signal);var P=function(W){return W.kind==="OperationDefinition"&&W.operation==="mutation"},j=function(W){return W.kind==="OperationDefinition"&&W.operation==="subscription"}
66,L=j(py(h.query)),B=V1(["defer"],h.query);if(c&&!h.query.definitions.some(P)&&(A.method="GET"),B||L){A.headers=A.headers||{};var k="multipart/mixed;";L&&B&&globalThis.__DEV__!==!1&&dt.warn(53),L?k+="boundary=graphql;subscriptionSpec=1.0,application/json":B&&(k+="deferSpec=20220824,application/json"),A.headers.accept=k}if(A.method==="GET"){var D=gue(g,I),q=D.newURI,U=D.parseError;if(U)return v6(U);g=q}else try{A.body=M_(I,"Payload")}catch(W){return v6(W)}return new nn(function(W){var V=n||lo(function(){return fetch})||r$,Y=W.next.bind(W);return V(g,A).then(function(K){var ge;h.setContext({response:K});var ae=(ge=K.headers)===null||ge===void 0?void 0:ge.get("content-type");return ae!==null&&/^multipart\/mixed/i.test(ae)?rue(K,Y):sue(h)(K).then(Y)}).then(function(){$=void 0,W.complete()}).catch(function(K){$=void 0,iue(K,W)}),function(){$&&$.abort()}})})},$W=(function(t){xc(e,t);function e(r){r===void 0&&(r={});var n=t.call(this,mue(r).request)||this;return n.options=r,n}return e})(gy);const{toString:n$,hasOwnProperty:yue}=Object.prototype,i$=Function.prototype.toString,j_=new Map;function Vr(t,e){try{return L_(t,e)}finally{j_.clear()}}function L_(t,e){if(t===e)return!0;const r=n$.call(t),n=n$.call(e);if(r!==n)return!1;switch(r){case"[object Array]":if(t.length!==e.length)return!1;case"[object Object]":{if(a$(t,e))return!0;const i=s$(t),s=s$(e),a=i.length;if(a!==s.length)return!1;for(let o=0;o<a;++o)if(!yue.call(e,i[o]))return!1;for(let o=0;o<a;++o){const c=i[o];if(!L_(t[c],e[c]))return!1}return!0}case"[object Error]":return t.name===e.name&&t.message===e.message;case"[object Number]":if(t!==t)return e!==e;case"[object Boolean]":case"[object Date]":return+t==+e;case"[object RegExp]":case"[object String]":return t==`${e}`;case"[object Map]":case"[object Set]":{if(t.size!==e.size)return!1;if(a$(t,e))return!0;const i=t.entries(),s=r==="[object Map]";for(;;){const a=i.next();if(a.done)break;const[o,c]=a.value;if(!e.has(o)||s&&!L_(c,e.get(o)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":t=new Uint8Array(t),e=new Uint8Array(e);case"[object DataView]":{let i=t.byteLength;if(i===e.byteLength)for(;i--&&t[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=i$.call(t);return i!==i$.call(e)?!1:!wue(i,vue)}}return!1}function s$(t){return Object.keys(t).filter(bue,t)}function bue(t){return this[t]!==void 0}const vue="{ [native code] }";function wue(t,e){const r=t.length-e.length;return r>=0&&t.indexOf(e,r)===r}function a$(t,e){let r=j_.get(t);if(r){if(r.has(e))return!0}else j_.set(t,r=new Set);return r.add(e),!1}function NW(t,e,r,n){var i=e.data,s=oa(e,["data"]),a=r.data,o=oa(r,["data"]);return Vr(s,o)&&kb(py(t).selectionSet,i,a,{fragmentMap:v0(E0(t)),variables:n})}function kb(t,e,r,n){if(e===r)return!0;var i=new Set;return t.selections.every(function(s){if(i.has(s)||(i.add(s),!hy(s,n.variables))||o$(s))return!0;if(zu(s)){var a=El(s),o=e&&e[a],c=r&&r[a],l=s.selectionSet;if(!l)return Vr(o,c);var u=Array.isArray(o),d=Array.isArray(c);if(u!==d)return!1;if(u&&d){var f=o.length;if(c.length!==f)return!1;for(var h=0;h<f;++h)if(!kb(l,o[h],c[h],n))return!1;return!0}return kb(l,o,c,n)}else{var g=Zw(s,n.fragmentMap);if(g)return o$(g)?!0:kb(g.selectionSet,e,r,n)}})}function o$(t){return!!t.directives&&t.directives.some(Eue)}function Eue(t){return t.name.value==="nonreactive"}var PW=Yf?WeakMap:Map,OW=zC?WeakSet:Set,iS=new x0,c$=!1;function RW(){c$||(c$=!0,globalThis.__DEV__!==!1&&dt.warn(64))}function DW(t,e,r){return iS.withValue(!0,function(){var n=r1(t,e,r,!1);return Object.isFrozen(t)&&Gp(n),n})}function xue(t,e){if(e.has(t))return e.get(t);var r=Array.isArray(t)?[]:Object.create(null);return e.set(t,r),r}function r1(t,e,r,n,i){var s,a=r.knownChanged,o=xue(t,r.mutableTargets);if(Array.isArray(t)){for(var c=0,l=Array.from(t.entries());c<l.length;c++){var u=l[c],d=u[0],f=u[1];if(f===null){o[d]=null;continue}var h=r1(f,e,r,n,globalThis.__DEV__!==!1?"".concat(i||"","[").concat(d,"]"):void 0);a.has(h)&&a.add(o),o[d]=h}return a.has(o)?o:t}for(var g=0,m=e.selections;g<m.length;g++){var y=m[g],b=void 0;if(n&&a.add(o),y.kind===pt.FIELD){var E=El(y),v=y.selectionSet;if(b=o[E]||t[E],b===void 0)continue;if(v&&b!==null){var h=r1(t[E],v,r,n,globalThis.__DEV__!==!1?"".concat(i||"",".").concat(E):void 0);a.has(h)&&(b=h)}globalThis.__DEV__===!1&&(o[E]=b),globalThis.__DEV__!==!1&&(n&&E!=="__typename"&&!(!((s=Object.getOwnPropertyDescriptor(o,E))===null||s===void 0)&&s.value)?Object.defineProperty(o,E,_ue(E,b,i||"",r.operationName,r.operationType)):(delete o[E],o[E]=b))}if(y.kind===pt.INLINE_FRAGMENT&&(!y.typeCondition||r.cache.fragmentMatches(y,t.__typename))&&(b=r1(t,y.selectionSet,r,n,i)
66),y.kind===pt.FRAGMENT_SPREAD){var w=y.name.value,x=r.fragmentMap[w]||(r.fragmentMap[w]=r.cache.lookupFragment(w));dt(x,59,w);var _=mce(y);_!=="mask"&&(b=r1(t,x.selectionSet,r,_==="migrate",i))}a.has(b)&&a.add(o)}return"__typename"in t&&!("__typename"in o)&&(o.__typename=t.__typename),Object.keys(o).length!==Object.keys(t).length&&a.add(o),a.has(o)?o:t}function _ue(t,e,r,n,i){var s=function(){return iS.getValue()||(globalThis.__DEV__!==!1&&dt.warn(60,n?"".concat(i," '").concat(n,"'"):"anonymous ".concat(i),"".concat(r,".").concat(t).replace(/^\./,"")),s=function(){return e}),e};return{get:function(){return s()},set:function(a){s=function(){return a}},enumerable:!0,configurable:!0}}function MW(t,e,r,n){if(!r.fragmentMatches)return globalThis.__DEV__!==!1&&RW(),t;var i=e.definitions.filter(function(a){return a.kind===pt.FRAGMENT_DEFINITION});typeof n>"u"&&(dt(i.length===1,61,i.length),n=i[0].name.value);var s=i.find(function(a){return a.name.value===n});return dt(!!s,62,n),t==null||Vr(t,{})?t:DW(t,s.selectionSet,{operationType:"fragment",operationName:s.name.value,fragmentMap:v0(E0(e)),cache:r,mutableTargets:new PW,knownChanged:new OW})}function Cue(t,e,r){var n;if(!r.fragmentMatches)return globalThis.__DEV__!==!1&&RW(),t;var i=_f(e);return dt(i,63),t==null?t:DW(t,i.selectionSet,{operationType:i.operation,operationName:(n=i.name)===null||n===void 0?void 0:n.value,fragmentMap:v0(E0(e)),cache:r,mutableTargets:new PW,knownChanged:new OW})}var jW=(function(){function t(){this.assumeImmutableResults=!1,this.getFragmentDoc=G1(Cce,{max:yc["cache.fragmentQueryDocuments"]||1e3,cache:wv})}return t.prototype.lookupFragment=function(e){return null},t.prototype.batch=function(e){var r=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(r)},n),i},t.prototype.recordOptimisticTransaction=function(e,r){this.performTransaction(e,r)},t.prototype.transformDocument=function(e){return e},t.prototype.transformForLink=function(e){return e},t.prototype.identify=function(e){},t.prototype.gc=function(){return[]},t.prototype.modify=function(e){return!1},t.prototype.readQuery=function(e,r){var n=this;return r===void 0&&(r=!!e.optimistic),globalThis.__DEV__!==!1&&Rn(e,"canonizeResults","cache.readQuery"),Ei("canonizeResults",function(){return n.read(ke(ke({},e),{rootId:e.id||"ROOT_QUERY",optimistic:r}))})},t.prototype.watchFragment=function(e){var r=this,n=e.fragment,i=e.fragmentName,s=e.from,a=e.optimistic,o=a===void 0?!0:a,c=oa(e,["fragment","fragmentName","from","optimistic"]),l=this.getFragmentDoc(n,i),u=typeof s>"u"||typeof s=="string"?s:this.identify(s),d=!!e[Symbol.for("apollo.dataMasking")];if(globalThis.__DEV__!==!1){var f=i||sW(n).name.value;u||globalThis.__DEV__!==!1&&dt.warn(1,f)}var h=ke(ke({},c),{returnPartialData:!0,id:u,query:l,optimistic:o}),g;return new nn(function(m){return r.watch(ke(ke({},h),{immediate:!0,callback:function(y){var b=d?MW(y.result,n,r,i):y.result;if(!(g&&NW(l,{data:g.result},{data:b},e.variables))){var E={data:b,complete:!!y.complete};y.missing&&(E.missing=t3(y.missing.map(function(v){return v.missing}))),g=ke(ke({},y),{result:b}),m.next(E)}}}))})},t.prototype.readFragment=function(e,r){var n=this;return r===void 0&&(r=!!e.optimistic),globalThis.__DEV__!==!1&&Rn(e,"canonizeResults","cache.readFragment"),Ei("canonizeResults",function(){return n.read(ke(ke({},e),{query:n.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:r}))})},t.prototype.writeQuery=function(e){var r=e.id,n=e.data,i=oa(e,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},t.prototype.writeFragment=function(e){var r=e.id,n=e.data,i=e.fragment,s=e.fragmentName,a=oa(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(a,{query:this.getFragmentDoc(i,s),dataId:r,result:n}))},t.prototype.updateQuery=function(e,r){return globalThis.__DEV__!==!1&&Rn(e,"canonizeResults","cache.updateQuery"),this.batch({update:function(n){var i=Ei("canonizeResults",function(){return n.readQuery(e)}),s=r(i);return s==null?i:(n.writeQuery(ke(ke({},e),{data:s})),s)}})},t.prototype.updateFragment=function(e,r){return globalThis.__DEV__!==!1&&Rn(e,"canonizeResults","cache.updateFragment"),this.batch({update:function(n){var i=Ei("canonizeResults",function(){return n.readFragment(e)}),s=r(i);return s==null?i:(n.writeFragment(ke(ke({},e),{data:s})),s)}})},t})();globalThis.__DEV__!==!1&&(jW.prototype.getMemoryInternals=Mce);var LW=(function(t){xc(e,t);function e(r,n,i,s){var a,o=t.call(this,r)||this;if(o.message=r,o.path=n,o.query=i,o.variables=s,Array.isArray(o.path)){o.missing=o.message;for(var c=o.path.length-1;c>=0;--c)o.missing=(a={},a[o.path[c]]=o.missing,a)}else o.missing=o.path;return o.__proto__=e.prototype,o}return e})(Error),bi=Object.prototype.hasOwnProperty;function rg(t){return t==null}function FW(t,e){var r=t.__typename,n=t.id,i=t._id;if(typeof r=="string"&&(e&&(e.keyObject=rg(n)?rg(i)?void 0:{_id:i}:{id:n}),rg(n)&&!rg(i)&&(n=i),!rg(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var UW={dataIdFromObject:FW,addTypename:!0,resultCaching:!0,canonizeResults:!1};function Sue(t){return Cf(UW,t)}function BW(t){var e=t.canonizeResults;return e===void 0?UW.canonizeResults:e}function Aue(t,e){return Br(e)?t.get(e.__ref,"__typename"):e&&e.__typename}var qW=/^[_a-z][_0-9a-z]*/i;function Gu(t){var e=t.match(qW);return e?e[0]:t}function F_(t,e,r){return Dn(e)?Mn(e)?e.every(function(n){return F_(t,n,r)}):t.selections.every(function(n){if(zu(n)&&hy(n,r)){var i=El(n);return bi.call(e,i)&&(!n.selectionSet||F_(n.selectionSet,e[i],r))}return!0}):!1}function Kh(t){return Dn(t)&&!Br(t)&&!Mn(t)}function Tue(){return new Hu}function WW(t,e){var r=v0(E0(t));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var $b=Object.create(null),w6=function(){return $b},l$=Object.create(null),K1=(function(){function t(e,r){var n=this;this.policies=e,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,s){return Gp(Br(i)?n.get(i.__ref,s):i&&i[s])},this.canRead=function(i){return Br(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,s){if(typeof i=="string")return fp(i);if(Br(i))return i;var a=n.policies.identify(i)[0];if(a){var o=fp(a);return s&&n.merge(a,i),o}}}return t.prototype.toObject=function(){return ke({},this.data)},t.prototype.has=function(e){return this.lookup(e,!0)!==void 0},t.prototype.get=function(e,r){if(this.group.depend(e,r),bi.call(this.data,e)){var n=this.data[e];if(n&&bi.call(n,r))return n[r]}if(r==="__typename"&&bi.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ou)return this.parent.get(e,r)},t.prototype.lookup=function(e,r){if(r&&this.group.depend(e,"__exists"),bi.call(this.data,e))return this.data[e];if(this instanceof ou)return this.parent.lookup(e,r);if(this.policies.rootTypenamesById[e])return Object.create(null)},t.prototype.merge=function(e,r){var n=this,i;Br(e)&&(e=e.__ref),Br(r)&&(r=r.__ref);var s=typeof e=="string"?this.lookup(i=e):e,a=typeof r=="string"?this.lookup(i=r):r;if(a){dt(typeof i=="string",2);var o=new Hu(kue).merge(s,a);if(this.data[i]=o,o!==s&&(delete this.refs[i],this.group.caching)){var c=Object.create(null);
66s||(c.__exists=1),Object.keys(a).forEach(function(l){if(!s||s[l]!==o[l]){c[l]=1;var u=Gu(l);u!==l&&!n.policies.hasKeyArgs(o.__typename,u)&&(c[u]=1),o[l]===void 0&&!(n instanceof ou)&&delete o[l]}}),c.__typename&&!(s&&s.__typename)&&this.policies.rootTypenamesById[i]===o.__typename&&delete c.__typename,Object.keys(c).forEach(function(l){return n.group.dirty(i,l)})}}},t.prototype.modify=function(e,r){var n=this,i=this.lookup(e);if(i){var s=Object.create(null),a=!1,o=!0,c={DELETE:$b,INVALIDATE:l$,isReference:Br,toReference:this.toReference,canRead:this.canRead,readField:function(l,u){return n.policies.readField(typeof l=="string"?{fieldName:l,from:u||fp(e)}:l,{store:n})}};if(Object.keys(i).forEach(function(l){var u=Gu(l),d=i[l];if(d!==void 0){var f=typeof r=="function"?r:r[l]||r[u];if(f){var h=f===w6?$b:f(Gp(d),ke(ke({},c),{fieldName:u,storeFieldName:l,storage:n.getStorage(e,l)}));if(h===l$)n.group.dirty(e,l);else if(h===$b&&(h=void 0),h!==d&&(s[l]=h,a=!0,d=h,globalThis.__DEV__!==!1)){var g=function(x){if(n.lookup(x.__ref)===void 0)return globalThis.__DEV__!==!1&&dt.warn(3,x),!0};if(Br(h))g(h);else if(Array.isArray(h))for(var m=!1,y=void 0,b=0,E=h;b<E.length;b++){var v=E[b];if(Br(v)){if(m=!0,g(v))break}else if(typeof v=="object"&&v){var w=n.policies.identify(v)[0];w&&(y=v)}if(m&&y!==void 0){globalThis.__DEV__!==!1&&dt.warn(4,y);break}}}}d!==void 0&&(o=!1)}}),a)return this.merge(e,s),o&&(this instanceof ou?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},t.prototype.delete=function(e,r,n){var i,s=this.lookup(e);if(s){var a=this.getFieldValue(s,"__typename"),o=r&&n?this.policies.getStoreFieldName({typename:a,fieldName:r,args:n}):r;return this.modify(e,o?(i={},i[o]=w6,i):w6)}return!1},t.prototype.evict=function(e,r){var n=!1;return e.id&&(bi.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof ou&&this!==r&&(n=this.parent.evict(e,r)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var e=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){bi.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},t.prototype.replace=function(e){var r=this;if(Object.keys(this.data).forEach(function(s){e&&bi.call(e,s)||r.delete(s)}),e){var n=e.__META,i=oa(e,["__META"]);
66Object.keys(i).forEach(function(s){r.merge(s,i[s])}),n&&n.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},t.prototype.release=function(e){if(this.rootIds[e]>0){var r=--this.rootIds[e];return r||delete this.rootIds[e],r}return 0},t.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ou?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},t.prototype.gc=function(){var e=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(a){bi.call(n,a)&&(Object.keys(e.findChildRefIds(a)).forEach(r.add,r),delete n[a])});var i=Object.keys(n);if(i.length){for(var s=this;s instanceof ou;)s=s.parent;i.forEach(function(a){return s.delete(a)})}return i},t.prototype.findChildRefIds=function(e){if(!bi.call(this.refs,e)){var r=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return r;var i=new Set([n]);i.forEach(function(s){Br(s)&&(r[s.__ref]=!0),Dn(s)&&Object.keys(s).forEach(function(a){var o=s[a];Dn(o)&&i.add(o)})})}return this.refs[e]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t})(),zW=(function(){function t(e,r){r===void 0&&(r=null),this.caching=e,this.parent=r,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?mW():null,this.keyMaker=new Dl(Yf)}
66,t.prototype.depend=function(e,r){if(this.d){this.d(E6(e,r));var n=Gu(r);n!==r&&this.d(E6(e,n)),this.parent&&this.parent.depend(e,r)}},t.prototype.dirty=function(e,r){this.d&&this.d.dirty(E6(e,r),r==="__exists"?"forget":"setDirty")},t})();function E6(t,e){return e+"#"+t}function u$(t,e){E1(t)&&t.group.depend(e,"__exists")}(function(t){var e=(function(r){xc(n,r);function n(i){var s=i.policies,a=i.resultCaching,o=a===void 0?!0:a,c=i.seed,l=r.call(this,s,new zW(o))||this;return l.stump=new Iue(l),l.storageTrie=new Dl(Yf),c&&l.replace(c),l}return n.prototype.addLayer=function(i,s){return this.stump.addLayer(i,s)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n})(t);t.Root=e})(K1||(K1={}));var ou=(function(t){xc(e,t);function e(r,n,i,s){var a=t.call(this,n.policies,s)||this;return a.id=r,a.parent=n,a.replay=i,a.group=s,i(a),a}return e.prototype.addLayer=function(r,n){return new e(r,this,n,this.group)},e.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(s){var a=n.data[s],o=i.lookup(s);o?a?a!==o&&Object.keys(a).forEach(function(c){Vr(a[c],o[c])||n.group.dirty(s,c)}):(n.group.dirty(s,"__exists"),Object.keys(o).forEach(function(c){n.group.dirty(s,c)})):n.delete(s)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return ke(ke({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return bi.call(this.data,r)?ke(ke({},n),t.prototype.findChildRefIds.call(this,r)):n},e.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},e})(K1),Iue=(function(t){xc(e,t);function e(r){return t.call(this,"EntityStore.Stump",r,function(){},new zW(r.group.caching,r.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(r,n){return this.parent.merge(r,n)},e})(ou);function kue(t,e,r){var n=t[r],i=e[r];return Vr(n,i)?n:i}function E1(t){return!!(t instanceof K1&&t.group.caching)}function $ue(t){return Dn(t)?Mn(t)?t.slice(0):ke({__proto__:Object.getPrototypeOf(t)},t):t}var d$=(function(){function t(){this.known=new(zC?WeakSet:Set),this.pool=new Dl(Yf),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return t.prototype.isKnown=function(e){return Dn(e)&&this.known.has(e)},t.prototype.pass=function(e){if(Dn(e)){var r=$ue(e);return this.passes.set(r,e),r}return e},t.prototype.admit=function(e){var r=this;if(Dn(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var s=e.map(this.admit,this),a=this.pool.lookupArray(s);return a.array||(this.known.add(a.array=s),globalThis.__DEV__!==!1&&Object.freeze(s)),a.array}case null:case Object.prototype:{if(this.known.has(e))return e;var o=Object.getPrototypeOf(e),c=[o],l=this.sortedKeys(e);c.push(l.json);var u=c.length;l.sorted.forEach(function(h){c.push(r.admit(e[h]))});var a=this.pool.lookupArray(c);if(!a.object){var d=a.object=Object.create(o);this.known.add(d),l.sorted.forEach(function(h,g){d[h]=c[u+g]}),globalThis.__DEV__!==!1&&Object.freeze(d)}return a.object}}}return e},t.prototype.sortedKeys=function(e){var r=Object.keys(e),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},t})();function f$(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var Nue=(function(){function t(e){var r=this;this.knownResults=new(Yf?WeakMap:Map),this.config=Cf(e,{addTypename:e.addTypename!==!1,canonizeResults:BW(e)}),this.canon=e.canon||new d$,this.executeSelectionSet=G1(function(n){var i,s=n.context.canonizeResults,a=f$(n);a[3]=!s;var o=(i=r.executeSelectionSet).peek.apply(i,a);return o?s?ke(ke({},o),{result:r.canon.admit(o.result)}):o:(u$(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||yc["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:f$,makeCacheKey:function(n,i,s,a){if(E1(s.store))return s.store.makeCacheKey(n,Br(i)?i.__ref:i,s.varString,a)}}),this.executeSubSelectedArray=G1(function(n){return u$(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||yc["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,s=n.array,a=n.context;if(E1(a.store))return a.store.makeCacheKey(i,s,a.varString)}})}return t.prototype.resetCanon=function(){this.canon=new d$},t.prototype.diffQueryAgainstStore=function(e){var r=e.store,n=e.query,i=e.rootId,s=i===void 0?"ROOT_QUERY":i,a=e.variables,o=e.returnPartialData,c=o===void 0?!0:o,l=e.canonizeResults,u=l===void 0?this.config.canonizeResults:l,d=this.config.cache.policies;a=ke(ke({},KC(iW(n))),a);var f=fp(s),h=this.executeSelectionSet({selectionSet:py(n).selectionSet,objectOrReference:f,enclosingRef:f,context:ke({store:r,query:n,policies:d,variables:a,varString:Ru(a),canonizeResults:u},WW(n,this.config.fragments))}),g;if(h.missing&&(g=[new LW(Pue(h.missing),h.missing,n,a)],!c))throw g[0];return{result:h.result,complete:!g,missing:g}},t.prototype.isFresh=function(e,r,n,i){if(E1(i.store)&&this.knownResults.get(e)===n){var s=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(e));if(s&&e===s.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(e){var r=this,n=e.selectionSet,i=e.objectOrReference,s=e.enclosingRef,a=e.context;
66if(Br(i)&&!a.policies.rootTypenamesById[i.__ref]&&!a.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var o=a.variables,c=a.policies,l=a.store,u=l.getFieldValue(i,"__typename"),d=[],f,h=new Hu;this.config.addTypename&&typeof u=="string"&&!c.rootIdsByTypename[u]&&d.push({__typename:u});function g(v,w){var x;return v.missing&&(f=h.merge(f,(x={},x[w]=v.missing,x))),v.result}var m=new Set(n.selections);m.forEach(function(v){var w,x;if(hy(v,o))if(zu(v)){var _=c.readField({fieldName:v.name.value,field:v,variables:a.variables,from:i},a),S=El(v);_===void 0?XC.added(v)||(f=h.merge(f,(w={},w[S]="Can't find field '".concat(v.name.value,"' on ").concat(Br(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),w))):Mn(_)?_.length>0&&(_=g(r.executeSubSelectedArray({field:v,array:_,enclosingRef:s,context:a}),S)):v.selectionSet?_!=null&&(_=g(r.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:_,enclosingRef:Br(_)?_:s,context:a}),S)):a.canonizeResults&&(_=r.canon.pass(_)),_!==void 0&&d.push((x={},x[S]=_,x))}else{var A=Zw(v,a.lookupFragment);if(!A&&v.kind===pt.FRAGMENT_SPREAD)throw bs(10,v.name.value);A&&c.fragmentMatches(A,u)&&A.selectionSet.selections.forEach(m.add,m)}});var y=t3(d),b={result:y,missing:f},E=a.canonizeResults?this.canon.admit(b):Gp(b);return E.result&&this.knownResults.set(E.result,n),E},t.prototype.execSubSelectedArrayImpl=function(e){var r=this,n=e.field,i=e.array,s=e.enclosingRef,a=e.context,o,c=new Hu;function l(u,d){var f;return u.missing&&(o=c.merge(o,(f={},f[d]=u.missing,f))),u.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map(function(u,d){return u===null?null:Mn(u)?l(r.executeSubSelectedArray({field:n,array:u,enclosingRef:s,context:a}),d):n.selectionSet?l(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:u,enclosingRef:Br(u)?u:s,context:a}),d):(globalThis.__DEV__!==!1&&Oue(a.store,n,u),u)}),{result:a.canonizeResults?this.canon.admit(i):i,missing:o}},t})();function Pue(t){try{JSON.stringify(t,function(e,r){if(typeof r=="string")throw r;return r})}catch(e){return e}}function Oue(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach(function(i){Dn(i)&&(dt(!Br(i),11,Aue(t,i),e.name.value),Object.values(i).forEach(n.add,n))})}}var sS=new x0,h$=new WeakMap;function x1(t){var e=h$.get(t);return e||h$.set(t,e={vars:new Set,dep:mW()}),e}function p$(t){x1(t).vars.forEach(function(e){return e.forgetCache(t)})}function Rue(t){x1(t).vars.forEach(function(e){return e.attachCache(t)})}function Due(t){var e=new Set,r=new Set,n=function(s){if(arguments.length>0){if(t!==s){t=s,e.forEach(function(c){x1(c).dep.dirty(n),Mue(c)});var a=Array.from(r);r.clear(),a.forEach(function(c){return c(t)})}}else{var o=sS.getValue();o&&(i(o),x1(o).dep(n))}return t};n.onNextChange=function(s){return r.add(s),function(){r.delete(s)}};var i=n.attachCache=function(s){return e.add(s),x1(s).vars.add(n),n};return n.forgetCache=function(s){return e.delete(s)},n}function Mue(t){t.broadcastWatches&&t.broadcastWatches()}var g$=Object.create(null);function aS(t){var e=JSON.stringify(t);return g$[e]||(g$[e]=Object.create(null))}function m$(t){var e=aS(t);return e.keyFieldsFn||(e.keyFieldsFn=function(r,n){var i=function(a,o){return n.readField(o,a)},s=n.keyObject=oS(t,function(a){var o=pp(n.storeObject,a,i);return o===void 0&&r!==n.storeObject&&bi.call(r,a[0])&&(o=pp(r,a,HW)),dt(o!==void 0,5,a.join("."),r),o});return"".concat(n.typename,":").concat(JSON.stringify(s))})}function y$(t){var e=aS(t);return e.keyArgsFn||(e.keyArgsFn=function(r,n){var i=n.field,s=n.variables,a=n.fieldName,o=oS(t,function(l){var u=l[0],d=u.charAt(0);if(d==="@"){if(i&&Ma(i.directives)){var f=u.slice(1),h=i.directives.find(function(b){return b.name.value===f}),g=h&&Xw(h,s);return g&&pp(g,l.slice(1))}return}if(d==="$"){var m=u.slice(1);if(s&&bi.call(s,m)){var y=l.slice(0);return y[0]=m,pp(s,y)}return}if(r)return pp(r,l)}),c=JSON.stringify(o);return(r||c!=="{}")&&(a+=":"+c),a})}function oS(t,e){var r=new Hu;return VW(t).reduce(function(n,i){var s,a=e(i);if(a!==void 0){for(var o=i.length-1;o>=0;--o)a=(s={},s[i[o]]=a,s);n=r.merge(n,a)}return n},Object.create(null))}function VW(t){var e=aS(t);if(!e.paths){var r=e.paths=[],n=[];
66t.forEach(function(i,s){Mn(i)?(VW(i).forEach(function(a){return r.push(n.concat(a))}),n.length=0):(n.push(i),Mn(t[s+1])||(r.push(n.slice(0)),n.length=0))})}return e.paths}function HW(t,e){return t[e]}function pp(t,e,r){return r=r||HW,GW(e.reduce(function n(i,s){return Mn(i)?i.map(function(a){return n(a,s)}):i&&r(i,s)},t))}function GW(t){return Dn(t)?Mn(t)?t.map(GW):oS(Object.keys(t).sort(),function(e){return pp(t,e)}):t}function U_(t){return t.args!==void 0?t.args:t.field?Xw(t.field,t.variables):null}var jue=function(){},b$=function(t,e){return e.fieldName},v$=function(t,e,r){var n=r.mergeObjects;return n(t,e)},w$=function(t,e){return e},Lue=(function(){function t(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=ke({dataIdFromObject:FW},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return t.prototype.identify=function(e,r){var n,i=this,s=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(s===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var a=r&&r.storeObject||e,o=ke(ke({},r),{typename:s,storeObject:a,readField:r&&r.readField||function(){var d=cS(arguments,a);return i.readField(d,{store:i.cache.data,variables:d.variables})}}),c,l=s&&this.getTypePolicy(s),u=l&&l.keyFn||this.config.dataIdFromObject;return iS.withValue(!0,function(){for(;u;){var d=u(ke(ke({},e),a),o);if(Mn(d))u=m$(d);else{c=d;break}}}),c=c?String(c):void 0,o.keyObject?[c,o.keyObject]:[c]},t.prototype.addTypePolicies=function(e){var r=this;Object.keys(e).forEach(function(n){var i=e[n],s=i.queryType,a=i.mutationType,o=i.subscriptionType,c=oa(i,["queryType","mutationType","subscriptionType"]);s&&r.setRootTypename("Query",n),a&&r.setRootTypename("Mutation",n),o&&r.setRootTypename("Subscription",n),bi.call(r.toBeAdded,n)?r.toBeAdded[n].push(c):r.toBeAdded[n]=[c]})},t.prototype.updateTypePolicy=function(e,r,n){var i=this.getTypePolicy(e),s=r.keyFields,a=r.fields;function o(c,l){c.merge=typeof l=="function"?l:l===!0?v$:l===!1?w$:c.merge}o(i,r.merge),i.keyFn=s===!1?jue:Mn(s)?m$(s):typeof s=="function"?s:i.keyFn,a&&Object.keys(a).forEach(function(c){var l=n[c];(!l||(l==null?void 0:l.typename)!==e)&&(l=n[c]={typename:e});var u=a[c];if(typeof u=="function")l.read=u;else{var d=u.keyArgs,f=u.read,h=u.merge;l.keyFn=d===!1?b$:Mn(d)?y$(d):typeof d=="function"?d:l.keyFn,typeof f=="function"&&(l.read=f),o(l,h)}l.read&&l.merge&&(l.keyFn=l.keyFn||b$)})},t.prototype.setRootTypename=function(e,r){r===void 0&&(r=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(dt(!i||i===e,6,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},t.prototype.addPossibleTypes=function(e){var r=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){r.getSupertypeSet(n,!0),e[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var s=i.match(qW);(!s||s[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},t.prototype.getTypePolicy=function(e){var r=this;if(!bi.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(a,o){if(a.test(e)){var c=r.supertypeMap.get(o);c&&c.forEach(function(l){return i.add(l)})}})),i&&i.size&&i.forEach(function(a){var o=r.getTypePolicy(a),c=o.fields,l=oa(o,["fields"]);Object.assign(n,l),Object.assign(n.fields,c)})}var s=this.toBeAdded[e];return s&&s.length&&s.splice(0).forEach(function(a){r.updateTypePolicy(e,a,r.typePolicies[e].fields)}),this.typePolicies[e]},t.prototype.getFieldPolicy=function(e,r){if(e)return this.getTypePolicy(e).fields[r]},t.prototype.getSupertypeSet=function(e,r){var n=this.supertypeMap.get(e);return!n&&r&&this.supertypeMap.set(e,n=new Set),n},t.prototype.fragmentMatches=function(e,r,n,i){var s=this;if(!e.typeCondition)return!0;
66if(!r)return!1;var a=e.typeCondition.name.value;if(r===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(r,!0),c=[o],l=function(g){var m=s.getSupertypeSet(g,!1);m&&m.size&&c.indexOf(m)<0&&c.push(m)},u=!!(n&&this.fuzzySubtypes.size),d=!1,f=0;f<c.length;++f){var h=c[f];if(h.has(a))return o.has(a)||(d&&globalThis.__DEV__!==!1&&dt.warn(7,r,a),o.add(a)),!0;h.forEach(l),u&&f===c.length-1&&F_(e.selectionSet,n,i)&&(u=!1,d=!0,this.fuzzySubtypes.forEach(function(g,m){var y=r.match(g);y&&y[0]===r&&l(m)}))}return!1},t.prototype.hasKeyArgs=function(e,r){var n=this.getFieldPolicy(e,r);return!!(n&&n.keyFn)},t.prototype.getStoreFieldName=function(e){var r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n),s,a=i&&i.keyFn;if(a&&r)for(var o={typename:r,fieldName:n,field:e.field||null,variables:e.variables},c=U_(e);a;){var l=a(c,o);if(Mn(l))a=y$(l);else{s=l||n;break}}return s===void 0&&(s=e.field?Jce(e.field,e.variables):nW(n,U_(e))),s===!1?n:n===Gu(s)?s:n+":"+s},t.prototype.readField=function(e,r){var n=e.from;if(n){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var s=r.store.getFieldValue(n,"__typename");s&&(e.typename=s)}var a=this.getStoreFieldName(e),o=Gu(a),c=r.store.getFieldValue(n,a),l=this.getFieldPolicy(e.typename,o),u=l&&l.read;if(u){var d=E$(this,n,e,r,r.store.getStorage(Br(n)?n.__ref:n,a));return sS.withValue(this.cache,u,[c,d])}return c}}},t.prototype.getReadFunction=function(e,r){var n=this.getFieldPolicy(e,r);return n&&n.read},t.prototype.getMergeFunction=function(e,r,n){var i=this.getFieldPolicy(e,r),s=i&&i.merge;return!s&&n&&(i=this.getTypePolicy(n),s=i&&i.merge),s},t.prototype.runMergeFunction=function(e,r,n,i,s){var a=n.field,o=n.typename,c=n.merge;return c===v$?KW(i.store)(e,r):c===w$?r:(i.overwrite&&(e=void 0),c(e,r,E$(this,void 0,{typename:o,fieldName:a.name.value,field:a,variables:i.variables},i,s||Object.create(null))))},t})();function E$(t,e,r,n,i){var s=t.getStoreFieldName(r),a=Gu(s),o=r.variables||n.variables,c=n.store,l=c.toReference,u=c.canRead;return{args:U_(r),field:r.field||null,fieldName:a,storeFieldName:s,variables:o,isReference:Br,toReference:l,storage:i,cache:t.cache,canRead:u,readField:function(){return t.readField(cS(arguments,e,o),n)},mergeObjects:KW(n.store)}}function cS(t,e,r){var n=t[0],i=t[1],s=t.length,a;return typeof n=="string"?a={fieldName:n,from:s>1?i:e}:(a=ke({},n),bi.call(a,"from")||(a.from=e)),globalThis.__DEV__!==!1&&a.from===void 0&&globalThis.__DEV__!==!1&&dt.warn(8,Uq(Array.from(t))),a.variables===void 0&&(a.variables=r),a}function KW(t){return function(r,n){if(Mn(r)||Mn(n))throw bs(9);
66if(Dn(r)&&Dn(n)){var i=t.getFieldValue(r,"__typename"),s=t.getFieldValue(n,"__typename"),a=i&&s&&i!==s;if(a)return n;if(Br(r)&&Kh(n))return t.merge(r.__ref,n),r;if(Kh(r)&&Br(n))return t.merge(r,n.__ref),n;if(Kh(r)&&Kh(n))return ke(ke({},r),n)}return n}}function x6(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:ke(ke({},t),{clientOnly:e,deferred:r})),i}var Fue=(function(){function t(e,r,n){this.cache=e,this.reader=r,this.fragments=n}return t.prototype.writeToStore=function(e,r){var n=this,i=r.query,s=r.result,a=r.dataId,o=r.variables,c=r.overwrite,l=_f(i),u=Tue();o=ke(ke({},KC(l)),o);var d=ke(ke({store:e,written:Object.create(null),merge:function(h,g){return u.merge(h,g)},variables:o,varString:Ru(o)},WW(i,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:s||Object.create(null),dataId:a,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:d});if(!Br(f))throw bs(12,s);return d.incomingById.forEach(function(h,g){var m=h.storeObject,y=h.mergeTree,b=h.fieldNodeSet,E=fp(g);if(y&&y.map.size){var v=n.applyMerges(y,E,m,d);if(Br(v))return;m=v}if(globalThis.__DEV__!==!1&&!d.overwrite){var w=Object.create(null);b.forEach(function(S){S.selectionSet&&(w[S.name.value]=!0)});var x=function(S){return w[Gu(S)]===!0},_=function(S){var A=y&&y.map.get(S);return!!(A&&A.info&&A.info.merge)};Object.keys(m).forEach(function(S){x(S)&&!_(S)&&Uue(E,m,S,d.store)})}e.merge(g,m)}),e.retain(f.__ref),f},t.prototype.processSelectionSet=function(e){var r=this,n=e.dataId,i=e.result,s=e.selectionSet,a=e.context,o=e.mergeTree,c=this.cache.policies,l=Object.create(null),u=n&&c.rootTypenamesById[n]||I_(i,s,a.fragmentMap)||n&&a.store.get(n,"__typename");typeof u=="string"&&(l.__typename=u);var d=function(){var v=cS(arguments,l,a.variables);if(Br(v.from)){var w=a.incomingById.get(v.from.__ref);if(w){var x=c.readField(ke(ke({},v),{from:w.storeObject}),a);if(x!==void 0)return x}}return c.readField(v,a)},f=new Set;this.flattenFields(s,i,a,u).forEach(function(v,w){var x,_=El(w),S=i[_];if(f.add(w),S!==void 0){var A=c.getStoreFieldName({typename:u,fieldName:w.name.value,field:w,variables:v.variables}),I=x$(o,A),$=r.processFieldValue(S,w,w.selectionSet?x6(v,!1,!1):v,I),P=void 0;w.selectionSet&&(Br($)||Kh($))&&(P=d("__typename",$));var j=c.getMergeFunction(u,w.name.value,P);j?I.info={field:w,typename:u,merge:j}:_$(o,A),l=v.merge(l,(x={},x[A]=$,x))}else globalThis.__DEV__!==!1&&!v.clientOnly&&!v.deferred&&!XC.added(w)&&!c.getReadFunction(u,w.name.value)&&globalThis.__DEV__!==!1&&dt.error(13,El(w),i)});try{var h=c.identify(i,{typename:u,selectionSet:s,fragmentMap:a.fragmentMap,storeObject:l,readField:d}),g=h[0],m=h[1];n=n||g,m&&(l=a.merge(l,m))}catch(v){if(!n)throw v}if(typeof n=="string"){var y=fp(n),b=a.written[n]||(a.written[n]=[]);if(b.indexOf(s)>=0||(b.push(s),this.reader&&this.reader.isFresh(i,y,s,a)))return y;var E=a.incomingById.get(n);return E?(E.storeObject=a.merge(E.storeObject,l),E.mergeTree=B_(E.mergeTree,o),f.forEach(function(v){return E.fieldNodeSet.add(v)})):a.incomingById.set(n,{storeObject:l,mergeTree:_v(o)?void 0:o,fieldNodeSet:f}),y}return l},t.prototype.processFieldValue=function(e,r,n,i){var s=this;return!r.selectionSet||e===null?globalThis.__DEV__!==!1?CW(e):e:Mn(e)?e.map(function(a,o){var c=s.processFieldValue(a,r,n,x$(i,o));return _$(i,o),c}):this.processSelectionSet({result:e,selectionSet:r.selectionSet,context:n,mergeTree:i})},t.prototype.flattenFields=function(e,r,n,i){i===void 0&&(i=I_(r,e,n.fragmentMap));var s=new Map,a=this.cache.policies,o=new Dl(!1);return(function c(l,u){var d=o.lookup(l,u.clientOnly,u.deferred);d.visited||(d.visited=!0,l.selections.forEach(function(f){if(hy(f,n.variables)){var h=u.clientOnly,g=u.deferred;if(!(h&&g)&&Ma(f.directives)&&f.directives.forEach(function(b){var E=b.name.value;if(E==="client"&&(h=!0),E==="defer"){var v=Xw(b,n.variables);(!v||v.if!==!1)&&(g=!0)}}),zu(f)){var m=s.get(f);m&&(h=h&&m.clientOnly,g=g&&m.deferred),s.set(f,x6(n,h,g))}else{var y=Zw(f,n.lookupFragment);if(!y&&f.kind===pt.FRAGMENT_SPREAD)throw bs(14,f.name.value);y&&a.fragmentMatches(y,i,r,n.variables)&&c(y.selectionSet,x6(n,h,g))}}}))})(e,n),s},t.prototype.applyMerges=function(e,r,n,i,s){var a,o=this;if(e.map.size&&!Br(n)){var c=!Mn(n)&&(Br(r)||Kh(r))?r:void 0,l=n;c&&!s&&(s=[Br(c)?c.__ref:c]);var u,d=function(f,h){return Mn(f)?typeof h=="number"?f[h]:void 0:i.store.getFieldValue(f,String(h))};
66e.map.forEach(function(f,h){var g=d(c,h),m=d(l,h);if(m!==void 0){s&&s.push(h);var y=o.applyMerges(f,g,m,i,s);y!==m&&(u=u||new Map,u.set(h,y)),s&&dt(s.pop()===h)}}),u&&(n=Mn(l)?l.slice(0):ke({},l),u.forEach(function(f,h){n[h]=f}))}return e.info?this.cache.policies.runMergeFunction(r,n,e.info,i,s&&(a=i.store).getStorage.apply(a,s)):n},t})(),QW=[];function x$(t,e){var r=t.map;return r.has(e)||r.set(e,QW.pop()||{map:new Map}),r.get(e)}function B_(t,e){if(t===e||!e||_v(e))return t;if(!t||_v(t))return e;var r=t.info&&e.info?ke(ke({},t.info),e.info):t.info||e.info,n=t.map.size&&e.map.size,i=n?new Map:t.map.size?t.map:e.map,s={info:r,map:i};if(n){var a=new Set(e.map.keys());t.map.forEach(function(o,c){s.map.set(c,B_(o,e.map.get(c))),a.delete(c)}),a.forEach(function(o){s.map.set(o,B_(e.map.get(o),t.map.get(o)))})}return s}function _v(t){return!t||!(t.info||t.map.size)}function _$(t,e){var r=t.map,n=r.get(e);n&&_v(n)&&(QW.push(n),r.delete(e))}var C$=new Set;function Uue(t,e,r,n){var i=function(d){var f=n.getFieldValue(d,r);return typeof f=="object"&&f},s=i(t);if(s){var a=i(e);if(a&&!Br(s)&&!Vr(s,a)&&!Object.keys(s).every(function(d){return n.getFieldValue(a,d)!==void 0})){var o=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),c=Gu(r),l="".concat(o,".").concat(c);if(!C$.has(l)){C$.add(l);var u=[];!Mn(s)&&!Mn(a)&&[s,a].forEach(function(d){var f=n.getFieldValue(d,"__typename");typeof f=="string"&&!u.includes(f)&&u.push(f)}),globalThis.__DEV__!==!1&&dt.warn(15,c,o,u.length?"either ensure all objects of type "+u.join(" and ")+" have an ID or a custom merge function, or ":"",l,ke({},s),ke({},a))}}}}var ad=(function(t){xc(e,t);function e(r){r===void 0&&(r={});var n=t.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new yW(XC),n.assumeImmutableResults=!0,n.makeVar=Due,n.txCount=0,globalThis.__DEV__!==!1&&(Rn(r,"addTypename","InMemoryCache","Please remove the `addTypename` option when initializing `InMemoryCache`."),Rn(r,"canonizeResults","InMemoryCache","Please remove the `canonizeResults` option when initializing `InMemoryCache`.")),n.config=Sue(r),n.addTypename=!!n.config.addTypename,n.policies=new Lue({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var r=this.data=new K1.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},e.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,s=this.config.fragments;this.addTypenameTransform.resetCache(),s==null||s.resetCaches(),this.storeWriter=new Fue(this,this.storeReader=new Nue({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:BW(this.config),canon:r?void 0:i&&i.canon,fragments:s}),s),this.maybeBroadcastWatch=G1(function(a,o){return n.broadcastWatch(a,o)},{max:this.config.resultCacheMaxSize||yc["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(a){var o=a.optimistic?n.optimisticData:n.data;if(E1(o)){var c=a.optimistic,l=a.id,u=a.variables;return o.makeCacheKey(a.query,a.callback,Ru({optimistic:c,id:l,variables:u}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(a){return a.resetCaching()})},e.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},e.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},e.prototype.read=function(r){globalThis.__DEV__!==!1&&Rn(r,"canonizeResults","cache.read");var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(ke(ke({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(s){if(s instanceof LW)return null;throw s}},e.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(r){if(bi.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(r){return globalThis.__DEV__!==!1&&Rn(r,"canonizeResults","cache.diff"),this.storeReader.diffQueryAgainstStore(ke(ke({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(r){var n=this;return this.watches.size||Rue(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&p$(n),n.maybeBroadcastWatch.forget(r)}},e.prototype.gc=function(r){globalThis.__DEV__!==!1&&Rn(r||{},"resetResultIdentities","cache.gc","First ensure all usages of `canonizeResults` are removed, then remove this option."),Ru.reset(),Qd.reset();var n=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},e.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},e.prototype.identify=function(r){if(Br(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&dt.warn(n)}},e.prototype.evict=function(r){if(!r.id){if(bi.call(r,"id"))return!1;r=ke(ke({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(r){var n=this;return this.init(),Ru.reset(),r&&r.discardWatches?(this.watches.forEac
66h(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),p$(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(r){var n=this,i=r.update,s=r.optimistic,a=s===void 0?!0:s,o=r.removeOptimistic,c=r.onWatchUpdated,l,u=function(f){var h=n,g=h.data,m=h.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return l=i(n)}finally{--n.txCount,n.data=g,n.optimisticData=m}},d=new Set;return c&&!this.txCount&&this.broadcastWatches(ke(ke({},r),{onWatchUpdated:function(f){return d.add(f),!1}})),typeof a=="string"?this.optimisticData=this.optimisticData.addLayer(a,u):a===!1?u(this.data):u(),typeof o=="string"&&(this.optimisticData=this.optimisticData.removeLayer(o)),c&&d.size?(this.broadcastWatches(ke(ke({},r),{onWatchUpdated:function(f,h){var g=c.call(this,f,h);return g!==!1&&d.delete(f),g}})),d.size&&d.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(r),l},e.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},e.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},e.prototype.fragmentMatches=function(r,n){return this.policies.fragmentMatches(r,n)},e.prototype.lookupFragment=function(r){var n;return((n=this.config.fragments)===null||n===void 0?void 0:n.lookup(r))||null},e.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},e.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},e.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},e.prototype.broadcastWatch=function(r,n){var i=this,s=r.lastDiff,a=Ei("canonizeResults",function(){return i.diff(r)});n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,s)===!1)||(!s||!Vr(s.result,a.result))&&r.callback(r.lastDiff=a,s)},e})(jW);globalThis.__DEV__!==!1&&(ad.prototype.getMemoryInternals=Dce);var kr;(function(t){t[t.loading=1]="loading",t[t.setVariables=2]="setVariables",t[t.fetchMore=3]="fetchMore",t[t.refetch=4]="refetch",t[t.poll=6]="poll",t[t.ready=7]="ready",t[t.error=8]="error"})(kr||(kr={}));function Qh(t){return t?t<7:!1}var S$=Object.assign,Bue=Object.hasOwnProperty,_1=(function(t){xc(e,t);function e(r){var n=r.queryManager,i=r.queryInfo,s=r.options,a=this,o=e.inactiveOnCreation.getValue();a=t.call(this,function(b){a._getOrCreateQuery();try{var E=b._subscription._observer;E&&!E.error&&(E.error=que)}catch{}var v=!a.observers.size;a.observers.add(b);var w=a.last;return w&&w.error?b.error&&b.error(w.error):w&&w.result&&b.next&&b.next(a.maskResult(w.result)),v&&a.reobserve().catch(function(){}),function(){a.observers.delete(b)&&!a.observers.size&&a.tearDownQuery()}})||this,a.observers=new Set,a.subscriptions=new Set,a.dirty=!1,a._getOrCreateQuery=function(){return o&&(n.queries.set(a.queryId,i),o=!1),a.queryManager.getOrCreateQuery(a.queryId)},a.queryInfo=i,a.queryManager=n,a.waitForOwnResult=_6(s.fetchPolicy),a.isTornDown=!1,a.subscribeToMore=a.subscribeToMore.bind(a),a.maskResult=a.maskResult.bind(a);var c=n.defaultOptions.watchQuery,l=c===void 0?{}:c,u=l.fetchPolicy,d=u===void 0?"cache-first":u,f=s.fetchPolicy,h=f===void 0?d:f,g=s.initialFetchPolicy,m=g===void 0?h==="standby"?d:h:g;a.options=ke(ke({},s),{initialFetchPolicy:m,fetchPolicy:h}),a.queryId=i.queryId||n.generateQueryId();var y=_f(a.query);return a.queryName=y&&y.name&&y.name.value,a}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var r=this;return globalThis.__DEV__!==!1&&bu("observableQuery.result",function(){globalThis.__DEV__!==!1&&dt.warn(23)}),new Promise(function(n,i){var s={next:function(o){n(o),r.observers.delete(s),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){a.unsubscribe()},0)},error:i},a=r.subscribe(s)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentFullResult=function(r){var n=this;r===void 0&&(r=!0);var i=Ei("getLastResult",function(){return n.getLastResult(!0)}),s=this.queryInfo.networkStatus||i&&i.networkStatus||kr.ready,a=ke(ke({},i),{loading:Qh(s),networkStatus:s}),o=this.options.fetchPolicy,c=o===void 0?"cache-first":o;if(!(_6(c)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var l=this.queryInfo.getDiff();(l.complete||this.options.returnPartialData)&&(a.data=l.result),Vr(a.data,{})&&(a.data=void 0),l.complete?(delete a.partial,l.complete&&a.networkStatus===kr.loading&&(c==="cache-first"||c==="cache-only")&&(a.networkStatus=kr.ready,a.loading=!1)):a.partial=!0,a.networkStatus===kr.ready&&(a.error||a.errors)&&(a.networkStatus=kr.error),globalThis.__DEV__!==!1&&!l.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&YW(l.missing)}return r&&this.updateLastResult(a),a},e.prototype.getCurrentResult=function(r){return r===void 0&&(r=!0),this.maskResult(this.getCurrentFullResult(r))},e.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),s=this.queryManager.dataMasking,a=s?i.nonReactiveQuery:this.query,o=s||i.hasNonreactiveDirective?!NW(a,this.last.result,r,this.variables):!Vr(this.last.result,r);return o||n&&!Vr(this.last.variables,n)},e.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||Vr(i.variables,this.variables)))return i[r]},e.prototype.getLastResult=function(r){return globalThis.__DEV__!==!1&&bu("getLastResult",function(){globalThis.__DEV__!==!1&&dt.warn(24)}),this.getLast("result",r)},e.prototype.getLastError=function(r){return globalThis.__DEV__!==!1&&bu("getLastError",function(){globalThis.__DEV__!==!1&&dt.warn(25)}),this.getLast("error",r)},e.prototype.resetLastResults=function(){globalThis.__DEV__!==!1&&bu("resetLastResults",function(){globalThis.__DEV__!==!1&&dt.warn(26)}),delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&dt.warn(27),this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(r){var n,i={pollInterval:0},s=this.options.fetchPolicy;if(s==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&Bue.call(r,"variables")){var a=iW(this.query),o=a.variableDefinitions;(!o||!o.some(function(c){return c.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&dt.warn(28,r,((n=a.name)===null||n===void 0?void 0:n.value)||a)}return r&&!Vr(this.options.variables,r)&&(i.variables=this.options.variables=ke(ke({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,kr.refetch)},e.prototype.fetchMore=function(r){var n=this,i=ke(ke({},r.query?r:ke(ke(ke(ke({},this.options),{query:this.options.query}),r),{variables:ke(ke({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var s=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var a=this.queryInfo,o=a.networkStatus;a.networkStatus=kr.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var c=new Set,l=r==null?void 0:r.updateQuery,u=this.options.fetchPolicy!=="no-cache";return u||dt(l,29),this.queryManager.fetchQuery(s,i,kr.fetchMore).then(function(d){if(n.queryManager.removeQuery(s),a.networkStatus===kr.fetchMore&&(a.networkStatus=o),u)n.queryManager.cache.batch({update:function(g){var m=r.updateQuery;m?g.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(y){return m(y,{fetchMoreResult:d.data,variables:i.variables})}):g.writeQuery({query:i.query,variables:i.variables,data:d.data})},onWatchUpdated:function(g){c.add(g.query)}});else{var f=n.getLast("result"),h=l(f.data,{fetchMoreResult:d.data,variables:i.variables});n.reportResult(ke(ke({},f),{networkStatus:o,loading:Qh(o),data:h}),n.variables)}return n.maskResult(d)}).finally(function(){u&&!c.has(n.query)&&n.reobserveCacheFirst()})},e.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(s){var a=r.updateQuery;a&&n.updateQuery(function(o,c){return a(o,ke({subscriptionData:s},c))})},error:function(s){if(r.onError){r.onError(s);return}globalThis.__DEV__!==!1&&dt.error(30,s)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(r){return globalThis.__DEV__!==!1&&(Rn(r,"canonizeResults","setOptions"),bu("setOptions",function(){globalThis.__DEV__!==!1&&dt.warn(31)})),this.reobserve(r)},e.prototype.silentSetOptions=function(r){var n=Cf(this.options,r||{});S$(this.options,n)},e.prototype.setVariables=function(r){var n=this;return Vr(this.variables,r)?this.observers.size?Ei("observableQuery.result",function(){return n.result()}):Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},kr.setVariables):Promise.resolve())},e.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),s=i.result,a=i.complete,o=r(s,{variables:this.variables,complete:!!a,previousData:s});o&&(n.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,s=i===void 0?"cache-first":i,a=n.initialFetchPolicy,o=a===void 0?s:a;s==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(s,{reason:r,options:n,observable:this,initialFetchPolicy:o}):r==="variables-changed"?n.fetchPolicy=o:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(r,n,i){var s=this._getOrCreateQuery();return s.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(s,r,n,i)},e.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,s=n.options.pollInterval;if(!s||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===s)){dt(s,32);var a=i||(this.pollingInfo={});a.interval=s;var o=function(){var l,u;r.pollingInfo&&(!Qh(r.queryInfo.networkStatus)&&!(!((u=(l=r.options).skipPollAttempt)===null||u===void 0)&&u.call(l))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},kr.poll).then(c,c):c())},c=function(){var l=r.pollingInfo;l&&(clearTimeout(l.timeout),l.timeout=setTimeout(o,l.interval))};c()}}},e.prototype.updateLastResult=function(r,n){var i=this;n===void 0&&(n=this.variables);var s=Ei("getLastError",function(){return i.getLastError()});return s&&this.last&&!Vr(n,this.last.variables)&&(s=void 0),this.last=ke({result:this.queryManager.assumeImmutableResults?r:CW(r),variables:n},s?{error:s}:null)},e.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var s=n===kr.refetch||n===kr.fetchMore||n===kr.poll,a=this.options.variables,o=this.options.fetchPolicy,c=Cf(this.options,r||{}),l=s?c:S$(this.options,c),u=this.transformDocument(l.query);this.lastQuery=u,s||(this.updatePolling(),r&&r.variables&&!Vr(r.variables,a)&&l.fetchPolicy!=="standby"&&(l.fetchPolicy===o||typeof l.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",l),n===void 0&&(n=kr.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=_6(l.fetchPolicy));var d=function(){i.concast===g&&(i.waitForOwnResult=!1)},f=l.variables&&ke({},l.variables),h=this.fetch(l,n,u),g=h.concast,m=h.fromLink,y={next:function(b){Vr(i.variables,f)&&(d(),i.reportResult(b,f))},error:function(b){Vr(i.variables,f)&&(IW(b)||(b=new Zc({networkError:b})),d(),i.reportError(b,f))}};return!s&&(m||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=g,this.observer=y),g.addObserver(y),g},e.prototype.reobserve=function(r,n){return Nle(this.reobserveAsConcast(r,n).promise.then(this.maskResult))},e.prototype.resubscribeAfterError=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=this.last;Ei("resetLastResults",function(){return r.resetLastResults()});var a=this.subscribe.apply(this,n);return this.last=s,a},e.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},e.prototype.reportResult=function(r,n){var i=this,s=Ei("getLastError",function(){return i.getLastError()}),a=this.isDifferentFromLastResult(r,n);(s||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(s||a)&&w1(this.observers,"next",this.maskResult(r))},e.prototype.reportError=function(r,n){var i=this,s=ke(ke({},Ei("getLastResult",function(){return i.getLastResult()})),{error:r,errors:r.graphQLErrors,networkStatus:kr.error,loading:!1});this.updateLastResult(s,n),w1(this.observers,"error",this.last.error=r)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(r){return this.queryManager.transform(r)},e.prototype.maskResult=function(r){return r&&"data"in r?ke(ke({},r),{data:this.queryManager.maskOperation({document:this.query,data:r.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):r},e.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},e.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},e.prototype.scheduleNotify=function(){var r=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0)))},e.prototype.notify=function(){if(this.cancelNotifyTimeout(),this.dirty&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!Qh(this.queryInfo.networkStatus))){var r=this.queryInfo.getDiff();r.fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()}this.dirty=!1},e.prototype.reobserveCacheFirst=function(){var r=this.options,n=r.fetchPolicy,i=r.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(s,a){return this.nextFetchPolicy=i,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(s,a):n}}):this.reobserve()},e.inactiveOnCreation=new x0,e})(nn);SW(_1);function que(t){globalThis.__DEV__!==!1&&dt.error(33,t.message,t.stack)}function YW(t){globalThis.__DEV__!==!1&&t&&globalThis.__DEV__!==!1&&dt.debug(34,t)}function _6(t){return t==="network-only"||t==="no-cache"||t==="standby"}var Yh=new(Yf?WeakMap:Map);function C6(t,e){var r=t[e];typeof r=="function"&&(t[e]=function(){return Yh.set(t,(Yh.get(t)+1)%1e15),r.apply(this,arguments)})}var S6=(function(){function t(e,r){r===void 0&&(r=e.generateQueryId()),this.queryId=r,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var n=this.cache=e.cache;Yh.has(n)||(Yh.set(n,0),C6(n,"evict"),C6(n,"modify"),C6(n,"reset"))}return t.prototype.init=function(e){var r=e.networkStatus||kr.loading;return this.variables&&this.networkStatus!==kr.loading&&!Vr(this.variables,e.variables)&&(r=kr.setVariables),Vr(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.va
66riables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},t.prototype.resetDiff=function(){this.lastDiff=void 0},t.prototype.getDiff=function(){var e=this,r=this.getDiffOptions();if(this.lastDiff&&Vr(r,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=Ei("canonizeResults",function(){return e.cache.diff(r)});return this.updateLastDiff(i,r),i},t.prototype.updateLastDiff=function(e,r){this.lastDiff=e?{diff:e,options:r||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(e){var r;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},t.prototype.setDiff=function(e){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&Ei("getLastError",function(){var s;return(s=r.observableQuery)===null||s===void 0?void 0:s.getLastError()})||(this.updateLastDiff(e),Vr(i&&i.result,e&&e.result)||(n=this.observableQuery)===null||n===void 0||n.scheduleNotify())},t.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},t.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,(e=this.observableQuery)===null||e===void 0||e.resetNotifications(),this.cancel();var r=this.observableQuery;r&&r.stopPolling()}},t.prototype.cancel=function(){var e;(e=this.cancelWatch)===null||e===void 0||e.call(this),this.cancelWatch=void 0},t.prototype.updateWatch=function(e){var r=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=ke(ke({},this.getDiffOptions(e)),{watcher:this,callback:function(s){return r.setDiff(s)}});(!this.lastWatch||!Vr(i,this.lastWatch))&&(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=i))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(e,r){var n=this.lastWrite;return!(n&&n.dmCount===Yh.get(this.cache)&&Vr(r,n.variables)&&Vr(e.data,n.result.data))},t.prototype.markResult=function(e,r,n,i){var s=this,a,o=new Hu,c=Ma(e.errors)?e.errors.slice(0):[];if((a=this.observableQuery)===null||a===void 0||a.resetNotifications(),"incremental"in e&&Ma(e.incremental)){var l=AW(this.getDiff().result,e);e.data=l}else if("hasNext"in e&&e.hasNext){var u=this.getDiff();e.data=o.merge(u.result,e.data)}this.graphQLErrors=c,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(q_(e,n.errorPolicy)?this.cache.performTransaction(function(d){if(s.shouldWrite(e,n.variables))d.writeQuery({query:r,data:e.data,variables:n.variables,overwrite:i===1}),s.lastWrite={result:e,variables:n.variables,dmCount:Yh.get(s.cache)};else if(s.lastDiff&&s.lastDiff.diff.complete){e.data=s.lastDiff.diff.result;return}var f=s.getDiffOptions(n.variables),h=Ei("canonizeResults",function(){return d.diff(f)});!s.stopped&&Vr(s.variables,n.variables)&&s.updateWatch(n.variables),s.updateLastDiff(h,f),h.complete&&(e.data=h.result)}):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=kr.ready},t.prototype.markError=function(e){var r;return this.networkStatus=kr.error,this.lastWrite=void 0,(r=this.observableQuery)===null||r===void 0||r.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},t})();function q_(t,e){e===void 0&&(e="none");var r=e==="ignore"||e==="all",n=!Tb(t);return!n&&r&&t.data&&(n=!0),n}var Wue=Object.prototype.hasOwnProperty,A$=Object.create(null),zue=(function(){function t(e){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new HC(yc["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Dl(!1),this.noCacheWarningsByQueryId=new Set;var n=new yW(function(s){return r.cache.transformDocument(s)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var i=e.documentTransform;
66this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var e=this;this.queries.forEach(function(r,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(bs(35))},t.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(r){return r(e)}),this.fetchCancelFns.clear()},t.prototype.mutate=function(e){return lu(this,arguments,void 0,function(r){var n,i,s,a,o,c,l,u=r.mutation,d=r.variables,f=r.optimisticResponse,h=r.updateQueries,g=r.refetchQueries,m=g===void 0?[]:g,y=r.awaitRefetchQueries,b=y===void 0?!1:y,E=r.update,v=r.onQueryUpdated,w=r.fetchPolicy,x=w===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.fetchPolicy)||"network-only":w,_=r.errorPolicy,S=_===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.errorPolicy)||"none":_,A=r.keepRootFields,I=r.context;return uu(this,function($){switch($.label){case 0:return dt(u,36),dt(x==="network-only"||x==="no-cache",37),n=this.generateMutationId(),u=this.cache.transformForLink(this.transform(u)),i=this.getDocumentInfo(u).hasClientExports,d=this.getVariables(u,d),i?[4,this.localState.addExportedVariables(u,d,I)]:[3,2];case 1:d=$.sent(),$.label=2;case 2:return s=this.mutationStore&&(this.mutationStore[n]={mutation:u,variables:d,loading:!0,error:null}),a=f&&this.markMutationOptimistic(f,{mutationId:n,document:u,variables:d,fetchPolicy:x,errorPolicy:S,context:I,updateQueries:h,update:E,keepRootFields:A}),this.broadcastQueries(),o=this,[2,new Promise(function(P,j){return y6(o.getObservableFromLink(u,ke(ke({},I),{optimisticResponse:a?f:void 0}),d,{},!1),function(L){if(Tb(L)&&S==="none")throw new Zc({graphQLErrors:P_(L)});s&&(s.loading=!1,s.error=null);var B=ke({},L);return typeof m=="function"&&(m=m(B)),S==="ignore"&&Tb(B)&&delete B.errors,o.markMutationResult({mutationId:n,result:B,document:u,variables:d,fetchPolicy:x,errorPolicy:S,context:I,update:E,updateQueries:h,awaitRefetchQueries:b,refetchQueries:m,removeOptimistic:a?n:void 0,onQueryUpdated:v,keepRootFields:A})}).subscribe({next:function(L){o.broadcastQueries(),(!("hasNext"in L)||L.hasNext===!1)&&P(ke(ke({},L),{data:o.maskOperation({document:u,data:L.data,fetchPolicy:x,id:n})}))},error:function(L){s&&(s.loading=!1,s.error=L),a&&o.cache.removeOptimistic(n),o.broadcastQueries(),j(L instanceof Zc?L:new Zc({networkError:L}))}})})]}})})},t.prototype.markMutationResult=function(e,r){var n=this;r===void 0&&(r=this.cache);var i=e.result,s=[],a=e.fetchPolicy==="no-cache";if(!a&&q_(i,e.errorPolicy)){if(hp(i)||s.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),hp(i)&&Ma(i.incremental)){var o=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),c=void 0;o.result&&(c=AW(o.result,i)),typeof c<"u"&&(i.data=c,s.push({result:c,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var l=e.updateQueries;l&&this.queries.forEach(function(d,f){var h=d.observableQuery,g=h&&h.queryName;if(!(!g||!Wue.call(l,g))){var m=l[g],y=n.queries.get(f),b=y.document,E=y.variables,v=r.diff({query:b,variables:E,returnPartialData:!0,optimistic:!1}),w=v.result,x=v.complete;if(x&&w){var _=m(w,{mutationResult:i,queryName:b&&t1(b)||void 0,queryVariables:E});_&&s.push({result:_,dataId:"ROOT_QUERY",query:b,variables:E})}}})}if(s.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var u=[];if(this.refetchQueries({updateCache:function(d){a||s.forEach(function(m){return d.write(m)});var f=e.update,h=!Mle(i)||hp(i)&&!i.hasNext;if(f){if(!a){var g=d.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});g.complete&&(i=ke(ke({},i),{data:g.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}h&&f(d,i,{context:e.context,variables:e.variables})}!a&&!e.keepRootFields&&h&&d.modify({id:"ROOT_MUTATION",fields:function(m,y){var b=y.fieldName,E=y.DELETE;return b==="__typename"?m:E}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}
66).forEach(function(d){return u.push(d)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(u).then(function(){return i})}return Promise.resolve(i)},t.prototype.markMutationOptimistic=function(e,r){var n=this,i=typeof e=="function"?e(r.variables,{IGNORE:A$}):e;return i===A$?!1:(this.cache.recordOptimisticTransaction(function(s){try{n.markMutationResult(ke(ke({},r),{result:{data:i}}),s)}catch(a){globalThis.__DEV__!==!1&&dt.error(a)}},r.mutationId),!0)},t.prototype.fetchQuery=function(e,r,n){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),r,n).concast.promise},t.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(r,n){e[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),e},t.prototype.resetErrors=function(e){var r=this.queries.get(e);r&&(r.networkError=void 0,r.graphQLErrors=[])},t.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},t.prototype.getDocumentInfo=function(e){var r=this.transformCache;if(!r.has(e)){var n={hasClientExports:hce(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:V1(["nonreactive"],e),nonReactiveQuery:yle(e),clientQuery:this.localState.clientQuery(e),serverQuery:vW([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:KC(_f(e)),asQuery:ke(ke({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?ke(ke({},i),{operation:"query"}):i})})};r.set(e,n)}return r.get(e)},t.prototype.getVariables=function(e,r){return ke(ke({},this.getDocumentInfo(e).defaultVars),r)},t.prototype.watchQuery=function(e){var r=this.transform(e.query);e=ke(ke({},e),{variables:this.getVariables(r,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var n=new S6(this),i=new _1({queryManager:this,queryInfo:n,options:e});return i.lastQuery=r,_1.inactiveOnCreation.getValue()||this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},t.prototype.query=function(e,r){var n=this;r===void 0&&(r=this.generateQueryId()),dt(e.query,38),dt(e.query.kind==="Document",39),dt(!e.returnPartialData,40),dt(!e.pollInterval,41);var i=this.transform(e.query);return this.fetchQuery(r,ke(ke({},e),{query:i})).then(function(s){return s&&ke(ke({},s),{data:n.maskOperation({document:i,data:s.data,fetchPolicy:e.fetchPolicy,id:r})})}).finally(function(){return n.stopQuery(r)})},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(e){var r=this.queries.get(e);r&&r.stop()},t.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(bs(42)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=kr.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},t.prototype.getObservableQueries=function(e){var r=this;e===void 0&&(e="active");var n=new Map,i=new Map,s=new Map,a=new Set;return Array.isArray(e)&&e.forEach(function(o){if(typeof o=="string")i.set(o,o),s.set(o,!1);else if(Wce(o)){var c=Qd(r.transform(o));i.set(c,t1(o)),s.set(c,!1)}else Dn(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,c){var l=o.observableQuery,u=o.document;if(l){if(e==="all"){n.set(c,l);return}var d=l.queryName,f=l.options.fetchPolicy;if(f==="standby"||e==="active"&&!l.hasObservers())return;(e==="active"||d&&s.has(d)||u&&s.has(Qd(u)))&&(n.set(c,l),d&&s.set(d,!0),u&&s.set(Qd(u),!0))}}),a.size&&a.forEach(function(o){var c=w_("legacyOneTimeQuery"),l=r.getOrCreateQuery(c).init({document:o.query,variables:o.variables}),u=new _1({queryManager:r,queryInfo:l,options:ke(ke({},o),{fetchPolicy:"network-only"})});dt(u.queryId===c),l.setObservableQuery(u),n.set(c,u)}
66),globalThis.__DEV__!==!1&&s.size&&s.forEach(function(o,c){if(!o){var l=i.get(c);l?globalThis.__DEV__!==!1&&dt.warn(43,l):globalThis.__DEV__!==!1&&dt.warn(44)}}),n},t.prototype.reFetchObservableQueries=function(e){var r=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,s){var a=i.options.fetchPolicy;Ei("resetLastResults",function(){return i.resetLastResults()}),(e||a!=="standby"&&a!=="cache-only")&&n.push(i.refetch()),(r.queries.get(s)||i.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},t.prototype.startGraphQLSubscription=function(e){var r=this,n=e.query,i=e.variables,s=e.fetchPolicy,a=e.errorPolicy,o=a===void 0?"none":a,c=e.context,l=c===void 0?{}:c,u=e.extensions,d=u===void 0?{}:u;n=this.transform(n),i=this.getVariables(n,i);var f=function(g){return r.getObservableFromLink(n,l,g,d).map(function(m){s!=="no-cache"&&(q_(m,o)&&r.cache.write({query:n,result:m.data,dataId:"ROOT_SUBSCRIPTION",variables:g}),r.broadcastQueries());var y=Tb(m),b=eue(m);if(y||b){var E={};if(y&&(E.graphQLErrors=m.errors),b&&(E.protocolErrors=m.extensions[nS]),o==="none"||b)throw new Zc(E)}return o==="ignore"&&delete m.errors,m})};if(this.getDocumentInfo(n).hasClientExports){var h=this.localState.addExportedVariables(n,i,l).then(f);return new nn(function(g){var m=null;return h.then(function(y){return m=y.subscribe(g)},g.error),function(){return m&&m.unsubscribe()}})}return f(i)},t.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},t.prototype.removeQuery=function(e){var r;this.fetchCancelFns.delete(e),this.queries.has(e)&&((r=this.queries.get(e))===null||r===void 0||r.stop(),this.queries.delete(e))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var r;return(r=e.observableQuery)===null||r===void 0?void 0:r.notify()})},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(e,r,n,i,s){var a=this,o;s===void 0&&(s=(o=r==null?void 0:r.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var c,l=this.getDocumentInfo(e),u=l.serverQuery,d=l.clientQuery;if(u){var f=this,h=f.inFlightLinkObservables,g=f.link,m={query:u,variables:n,operationName:t1(u)||void 0,context:this.prepareContext(ke(ke({},r),{forceFetch:!s})),extensions:i};if(r=m.context,s){var y=Qd(u),b=Ru(n),E=h.lookup(y,b);
66if(c=E.observable,!c){var v=new jh([D_(g,m)]);c=E.observable=v,v.beforeNext(function w(x,_){x==="next"&&"hasNext"in _&&_.hasNext?v.beforeNext(w):h.remove(y,b)})}}else c=new jh([D_(g,m)])}else c=new jh([nn.of({data:{}})]),r=this.prepareContext(r);return d&&(c=y6(c,function(w){return a.localState.runResolvers({document:d,remoteResult:w,context:r,variables:n})})),c},t.prototype.getResultsFromLink=function(e,r,n){var i=e.lastRequestId=this.generateRequestId(),s=this.cache.transformForLink(n.query);return y6(this.getObservableFromLink(s,n.context,n.variables),function(a){var o=P_(a),c=o.length>0,l=n.errorPolicy;if(i>=e.lastRequestId){if(c&&l==="none")throw e.markError(new Zc({graphQLErrors:o}));e.markResult(a,s,n,r),e.markReady()}var u={data:a.data,loading:!1,networkStatus:kr.ready};return c&&l==="none"&&(u.data=void 0),c&&l!=="ignore"&&(u.errors=o,u.networkStatus=kr.error),u},function(a){var o=IW(a)?a:new Zc({networkError:a});throw i>=e.lastRequestId&&e.markError(o),o})},t.prototype.fetchConcastWithInfo=function(e,r,n,i){var s=this;n===void 0&&(n=kr.loading),i===void 0&&(i=r.query);var a=this.getVariables(i,r.variables),o=this.defaultOptions.watchQuery,c=r.fetchPolicy,l=c===void 0?o&&o.fetchPolicy||"cache-first":c,u=r.errorPolicy,d=u===void 0?o&&o.errorPolicy||"none":u,f=r.returnPartialData,h=f===void 0?!1:f,g=r.notifyOnNetworkStatusChange,m=g===void 0?!1:g,y=r.context,b=y===void 0?{}:y,E=Object.assign({},r,{query:i,variables:a,fetchPolicy:l,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:m,context:b}),v=function(A){E.variables=A;var I=s.fetchQueryByPolicy(e,E,n);return E.fetchPolicy!=="standby"&&I.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",r),I},w=function(){return s.fetchCancelFns.delete(e.queryId)};this.fetchCancelFns.set(e.queryId,function(A){w(),setTimeout(function(){return x.cancel(A)})});var x,_;if(this.getDocumentInfo(E.query).hasClientExports)x=new jh(this.localState.addExportedVariables(E.query,E.variables,E.context).then(v).then(function(A){return A.sources})),_=!0;else{var S=v(E.variables);_=S.fromLink,x=new jh(S.sources)}return x.promise.then(w,w),{concast:x,fromLink:_}},t.prototype.refetchQueries=function(e){var r=this,n=e.updateCache,i=e.include,s=e.optimistic,a=s===void 0?!1:s,o=e.removeOptimistic,c=o===void 0?a?w_("refetchQueries"):void 0:o,l=e.onQueryUpdated,u=new Map;i&&this.getObservableQueries(i).forEach(function(f,h){u.set(h,{oq:f,lastDiff:(r.queries.get(h)||f.queryInfo).getDiff()})});var d=new Map;return n&&this.cache.batch({update:n,optimistic:a&&c||!1,removeOptimistic:c,onWatchUpdated:function(f,h,g){var m=f.watcher instanceof S6&&f.watcher.observableQuery;if(m){if(l){u.delete(m.queryId);var y=l(m,h,g);return y===!0&&(y=m.refetch()),y!==!1&&d.set(m,y),y}l!==null&&u.set(m.queryId,{oq:m,lastDiff:g,diff:h})}}}),u.size&&u.forEach(function(f,h){var g=f.oq,m=f.lastDiff,y=f.diff,b;l&&(y||(y=Ei("canonizeResults",function(){return r.cache.diff(g.queryInfo.getDiffOptions())})),b=l(g,y,m)),(!l||b===!0)&&(b=g.refetch()),b!==!1&&d.set(g,b),h.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(h)}),c&&this.cache.removeOptimistic(c),d},t.prototype.maskOperation=function(e){var r,n,i,s=e.document,a=e.data;if(globalThis.__DEV__!==!1){var o=e.fetchPolicy,c=e.id,l=(r=_f(s))===null||r===void 0?void 0:r.operation,u=((n=l==null?void 0:l[0])!==null&&n!==void 0?n:"o")+c;this.dataMasking&&o==="no-cache"&&!Sce(s)&&!this.noCacheWarningsByQueryId.has(u)&&(this.noCacheWarningsByQueryId.add(u),globalThis.__DEV__!==!1&&dt.warn(45,(i=t1(s))!==null&&i!==void 0?i:"Unnamed ".concat(l??"operation")))}return this.dataMasking?Cue(a,s,this.cache):a},t.prototype.maskFragment=function(e){var r=e.data,n=e.fragment,i=e.fragmentName;return this.dataMasking?MW(r,n,this.cache,i):r},t.prototype.fetchQueryByPolicy=function(e,r,n){var i=this,s=r.query,a=r.variables,o=r.fetchPolicy,c=r.refetchWritePolicy,l=r.errorPolicy,u=r.returnPartialData,d=r.context,f=r.notifyOnNetworkStatusChange,h=e.networkStatus;e.init({document:s,variables:a,networkStatus:n});var g=function(){return e.getDiff()},m=function(w,x){x===void 0&&(x=e.networkStatus||kr.loading);var _=w.result;globalThis.__DEV__!==!1&&!u&&!Vr(_,{})&&YW(w.missing);var S=function(A){return nn.of(ke({data:A,loading:Qh(x),networkStatus:x},w.complete?null:{partial:!0}))};return _&&i.getDocumentInfo(s).hasForcedResolvers?i.localState.runResolvers({document:s,remoteResult:{data:_},context:d,variables:a,onlyRunForcedResolvers:!0}).then(function(A){return S(A.data||void 0)}):l==="none"&&x===kr.refetch&&Array.isArray(w.missing)?S(void 0):S(_)},y=o==="no-cache"?0:n===kr.refetch&&c!=="merge"?1:2,b=function(){return i.getResultsFromLink(e,y,{query:s,variables:a,context:d,fetchPolicy:o,errorPolicy:l})},E=f&&typeof h=="number"&&h!==n&&Qh(n);switch(o){default:case"cache-first":{var v=g();return v.complete?{fromLink:!1,sources:[m(v,e.markReady())]}:u||E?{fromLink:!0,sources:[m(v),b()]}:{fromLink:!0,sources:[b()]}}case"cache-and-network":{var v=g();return v.complete||u||E?{fromLink:!0,sources:[m(v),b()]}:{fromLink:!0,sources:[b()]}}case"cache-only":return{fromLink:!1,sources:[m(g(),e.markReady())]};case"network-only":return E?{fromLink:!0,sources:[m(g()),b()]}:{fromLink:!0,sources:[b()]};case"no-cache":return E?{fromLink:!0,sources:[m(e.getDiff()),b()]}:{fromLink:!0,sources:[b()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new S6(this,e)),this.queries.get(e)},t.prototype.prepareContext=function(e){e===void 0&&(e={});var r=this.localState.prepareContext(e);return ke(ke(ke({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},t}
vendor: 4,102 bytes, line 66
66)(),Vue=(function(){function t(e){var r=e.cache,n=e.client,i=e.resolvers,s=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),s&&this.setFragmentMatcher(s)}return t.prototype.addResolvers=function(e){var r=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){r.resolvers=Ev(r.resolvers,n)}):this.resolvers=Ev(this.resolvers,e)},t.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(e){return lu(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,s=r.context,a=r.variables,o=r.onlyRunForcedResolvers,c=o===void 0?!1:o;return uu(this,function(l){return n?[2,this.resolveDocument(n,i.data,s,a,this.fragmentMatcher,c).then(function(u){return ke(ke({},i),{data:u.result})})]:[2,i]})})},t.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(e){return V1(["client"],e)&&this.resolvers?e:null},t.prototype.serverQuery=function(e){return wW(e)},t.prototype.prepareContext=function(e){var r=this.cache;return ke(ke({},e),{cache:r,getCacheKey:function(n){return r.identify(n)}})},t.prototype.addExportedVariables=function(e){return lu(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),uu(this,function(s){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(a){return ke(ke({},n),a.exportedVariables)})]:[2,ke({},n)]})})},t.prototype.shouldForceResolvers=function(e){var r=!1;return wo(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return Qw}}}),r},t.prototype.buildRootValueFromCache=function(e,r){return this.cache.diff({query:mle(e),variables:r,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(e,r){return lu(this,arguments,void 0,function(n,i,s,a,o,c){var l,u,d,f,h,g,m,y,b,E,v;return s===void 0&&(s={}),a===void 0&&(a={}),o===void 0&&(o=function(){return!0}),c===void 0&&(c=!1),uu(this,function(w){return l=py(n),u=E0(n),d=v0(u),f=this.collectSelectionsToResolve(l,d),h=l.operation,g=h?h.charAt(0).toUpperCase()+h.slice(1):"Query",m=this,y=m.cache,b=m.client,E={fragmentMap:d,context:ke(ke({},s),{cache:y,client:b}),variables:a,fragmentMatcher:o,defaultOperationType:g,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:c},v=!1,[2,this.resolveSelectionSet(l.selectionSet,v,i,E).then(function(x){return{result:x,exportedVariables:E.exportedVariables}})]})})},t.prototype.resolveSelectionSet=function(e,r,n,i){return lu(this,void 0,void 0,function(){var s,a,o,c,l,u=this;return uu(this,function(d){return s=i.fragmentMap,a=i.context,o=i.variables,c=[n],l=function(f){return lu(u,void 0,void 0,function(){var h,g;return uu(this,function(m){return!r&&!i.selectionsToResolve.has(f)?[2]:hy(f,o)?zu(f)?[2,this.resolveField(f,r,n,i).then(function(y){var b;typeof y<"u"&&c.push((b={},b[El(f)]=y,b))})]:(tle(f)?h=f:(h=s[f.name.value],dt(h,21,f.name.value)),h&&h.typeCondition&&(g=h.typeCondition.name.value,i.fragmentMatcher(n,g,a))?[2,this.resolveSelectionSet(h.selectionSet,r,n,i).then(function(y){c.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(l)).then(function(){return t3(c)})]})})},t.prototype.resolveField=function(e,r,n,i){return lu(this,void 0,void 0,function(){var s,a,o,c,l,u,d,f,h,g=this;return uu(this,function(m){return n?(s=i.variables,a=e.name.value,o=El(e),c=a!==o,l=n[o]||n[a],u=Promise.resolve(l),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(d=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[d],f&&(h=f[c?a:o],h&&(u=Promise.resolve(sS.withValue(this.cache,h,[n,Xw(e,s),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,u.then(function(y){var b,E;if(y===void 0&&(y=l),e.directives&&e.directives.forEach(function(w){
66w.name.value==="export"&&w.arguments&&w.arguments.forEach(function(x){x.name.value==="as"&&x.value.kind==="StringValue"&&(i.exportedVariables[x.value.value]=y)})}),!e.selectionSet||y==null)return y;var v=(E=(b=e.directives)===null||b===void 0?void 0:b.some(function(w){return w.name.value==="client"}))!==null&&E!==void 0?E:!1;if(Array.isArray(y))return g.resolveSubSelectedArray(e,r||v,y,i);if(e.selectionSet)return g.resolveSelectionSet(e.selectionSet,r||v,y,i)})]):[2,null]})})},t.prototype.resolveSubSelectedArray=function(e,r,n,i){var s=this;return Promise.all(n.map(function(a){if(a===null)return null;if(Array.isArray(a))return s.resolveSubSelectedArray(e,r,a,i);if(e.selectionSet)return s.resolveSelectionSet(e.selectionSet,r,a,i)}))},t.prototype.collectSelectionsToResolve=function(e,r){var n=function(a){return!Array.isArray(a)},i=this.selectionsToResolveCache;function s(a){if(!i.has(a)){var o=new Set;i.set(a,o),wo(a,{Directive:function(c,l,u,d,f){c.name.value==="client"&&f.forEach(function(h){n(h)&&Lk(h)&&o.add(h)})},FragmentSpread:function(c,l,u,d,f){var h=r[c.name.value];dt(h,22,c.name.value);var g=s(h);g.size>0&&(f.forEach(function(m){n(m)&&Lk(m)&&o.add(m)}),o.add(c),g.forEach(function(m){o.add(m)}))}})}return i.get(a)}return s(e)},t})(),T$=!1,od=(function(){function t(e){var r=this,n,i,s;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw bs(16);var a=e.uri,o=e.credentials,c=e.headers,l=e.cache,u=e.documentTransform,d=e.ssrMode,f=d===void 0?!1:d,h=e.ssrForceFetchDelay,g=h===void 0?0:h,m=e.connectToDevTools,y=e.queryDeduplication,b=y===void 0?!0:y,E=e.defaultOptions,v=e.defaultContext,w=e.assumeImmutableResults,x=w===void 0?l.assumeImmutableResults:w,_=e.resolvers,S=e.typeDefs,A=e.fragmentMatcher,I=e.clientAwareness,$=e.name,P=e.version,j=e.devtools,L=e.dataMasking;globalThis.__DEV__!==!1&&(Rn(e,"connectToDevTools","ApolloClient","Please use `devtools.enabled` instead."),Rn(e,"uri","ApolloClient","Please initialize an instance of `HttpLink` with `uri` instead."),Rn(e,"credentials","ApolloClient","Please initialize an instance of `HttpLink` with `credentials` instead."),Rn(e,"headers","ApolloClient","Please initialize an instance of `HttpLink` with `headers` instead."),Rn(e,"name","ApolloClient","Please use the `clientAwareness.name` option instead."),Rn(e,"version","ApolloClient","Please use the `clientAwareness.version` option instead."),Rn(e,"typeDefs","ApolloClient"),e.link||globalThis.__DEV__!==!1&&dt.warn(17));var B=e.link;B||(B=a?new $W({uri:a,credentials:o,headers:c}):gy.empty()),this.link=B,this.cache=l,this.disableNetworkFetches=f||g>0,this.queryDeduplication=b,this.defaultOptions=E||Object.create(null),this.typeDefs=S,this.devtoolsConfig=ke(ke({},j),{enabled:(n=j==null?void 0:j.enabled)!==null&&n!==void 0?n:m}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),g&&setTimeout(function(){return r.disableNetworkFetches=!1},g),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=FC,this.localState=new Vue({cache:l,client:this,resolvers:_,fragmentMatcher:A}),this.queryManager=new zue({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:v,documentTransform:u,queryDeduplication:b,ssrMode:f,dataMasking:!!L,clientAwareness:{name:(i=I==null?void 0:I.name)!==null&&i!==void 0?i:$,version:(s=I==null?void 0:I.version)!==null&&s!==void 0?s:P},localState:this.localState,assumeImmutableResults:x,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return Object.defineProperty(t.prototype,"prioritizeCacheValues",{get:function(){return this.disableNetworkFetches},set:function(e){this.disableNetworkFetches=e}
66,enumerable:!1,configurable:!0}),t.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,r=Symbol.for("apollo.devtools");(e[r]=e[r]||[]).push(this),e.__APOLLO_CLIENT__=this,!T$&&globalThis.__DEV__!==!1&&(T$=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.userAgent,s=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?s="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(s="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),s&&globalThis.__DEV__!==!1&&dt.log("Download the Apollo DevTools for a better development experience: %s",s)}},1e4))}},Object.defineProperty(t.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Ib(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=ke(ke({},e),{fetchPolicy:"cache-first"})),globalThis.__DEV__!==!1&&(Rn(e,"canonizeResults","client.watchQuery"),Rn(e,"partialRefetch","client.watchQuery")),this.queryManager.watchQuery(e)},t.prototype.query=function(e){return this.defaultOptions.query&&(e=Ib(this.defaultOptions.query,e)),dt(e.fetchPolicy!=="cache-and-network",18),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=ke(ke({},e),{fetchPolicy:"cache-first"})),globalThis.__DEV__!==!1&&(Rn(e,"canonizeResults","client.query"),Rn(e,"notifyOnNetworkStatusChange","client.query","This option does not affect `client.query` and can be safely removed."),e.fetchPolicy==="standby"&&globalThis.__DEV__!==!1&&dt.warn(19)),this.queryManager.query(e)},t.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Ib(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},t.prototype.subscribe=function(e){var r=this,n=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(i){return ke(ke({},i),{data:r.queryManager.maskOperation({document:e.query,data:i.data,fetchPolicy:e.fetchPolicy,id:n})})})},t.prototype.readQuery=function(e,r){return r===void 0&&(r=!1),this.cache.readQuery(e,r)},t.prototype.watchFragment=function(e){var r;return this.cache.watchFragment(ke(ke({},e),(r={},r[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,r)))},t.prototype.readFragment=function(e,r){return r===void 0&&(r=!1),this.cache.readFragment(e,r)},t.prototype.writeQuery=function(e){var r=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.writeFragment=function(e){var r=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),r},t.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},t.prototype.__requestRaw=function(e){return D_(this.link,e)},t.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return e.reFetchObservableQueries()})},t.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(r){return r()}))})},t.prototype.onResetStore=function(e){var r=this;return this.resetStoreCallbacks.push(e),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.onClearStore=function(e){var r=this;return this.clearStoreCallbacks.push(e),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==e})}},t.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},t.prototype.refetchQueries=function(e){var r=this.queryManager.refetchQueries(e),n=[],i=[];r.forEach(function(a,o){n.push(o),i.push(a)});var s=Promise.all(i);return s.queries=n,s.results=i,s.catch(function(a){globalThis.__DEV__!==!1&&dt.debug(20,a)}),s},t.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},t.prototype.extract=function(e){return this.cache.extract(e)},t.prototype.restore=function(e){return this.cache.restore(e)},t.prototype.addResolvers=function(e){this.localState.addResolvers(e)},t.prototype.setResolvers=function(e){this.localState.setResolvers(e)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},t.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(t.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext}
66,enumerable:!1,configurable:!0}),t})();globalThis.__DEV__!==!1&&(od.prototype.getMemoryInternals=Rce);var Nb=new Map,W_=new Map,ZW=!0,Cv=!1;function XW(t){return t.replace(/[\s,]+/g," ").trim()}function Hue(t){return XW(t.source.body.substring(t.start,t.end))}function Gue(t){var e=new Set,r=[];return t.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,s=Hue(n.loc),a=W_.get(i);a&&!a.has(s)?ZW&&console.warn("Warning: fragment with name "+i+` already exists. 67graphql-tag enforces all fragment names across your application to be unique; read more about 68this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a||W_.set(i,a=new Set),a.add(s),e.has(s)||(e.add(s),r.push(n))}else r.push(n)}),ke(ke({},t),{definitions:r})}function Kue(t){var e=new Set(t.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var s=n[i];s&&typeof s=="object"&&e.add(s)})});var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}function Que(t){var e=XW(t);if(!Nb.has(e)){var r=nce(t,{experimentalFragmentVariables:Cv,allowLegacyFragmentVariables:Cv});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");Nb.set(e,Kue(Gue(r)))}return Nb.get(e)}function fa(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];typeof t=="string"&&(t=[t]);var n=t[0];return e.forEach(function(i,s){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=t[s+1]}),Que(n)}function Yue(){Nb.clear(),W_.clear()}function Zue(){ZW=!1}function Xue(){Cv=!0}function Jue(){Cv=!1}var ng={gql:fa,resetCaches:Yue,disableFragmentWarnings:Zue,enableExperimentalFragmentVariables:Xue,disableExperimentalFragmentVariables:Jue};(function(t){t.gql=ng.gql,t.resetCaches=ng.resetCaches,t.disableFragmentWarnings=ng.disableFragmentWarnings,t.enableExperimentalFragmentVariables=ng.enableExperimentalFragmentVariables,t.disableExperimentalFragmentVariables=ng.disableExperimentalFragmentVariables})(fa||(fa={}));fa.default=fa;var A6={exports:{}},I$;function ede(){return I$||(I$=1,(function(t){t.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=void 0,t.exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,t.exports.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=void 0,Object.assign(t.exports,CC())})(A6)),A6.exports}var zn=ede();const tde=Rl(zn),JW=One({__proto__:null,default:tde},[zn]);var k$=VC?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__";function lS(){dt("createContext"in JW,69);var t=zn.createContext[k$];return t||(Object.defineProperty(zn.createContext,k$,{value:t=zn.createContext({}),enumerable:!1,writable:!1,configurable:!0}),t.displayName="ApolloContext"),t}var rde=function(t){var e=t.client,r=t.children,n=lS(),i=zn.useContext(n),s=zn.useMemo(function(){return ke(ke({},i),{client:e||i.client})},[i,e]);return dt(s.client,71),zn.createElement(n.Provider,{value:s},r)};function ez(t){var e=zn.useContext(lS()),r=t||e.client;return dt(!!r,78),r}var $$=!1,nde="useSyncExternalStore",ide=JW[nde],sde=ide||(function(t,e,r){var n=e();globalThis.__DEV__!==!1&&!$$&&n!==e()&&($$=!0,globalThis.__DEV__!==!1&&dt.error(91));var i=zn.useState({inst:{value:n,getSnapshot:e}}),s=i[0].inst,a=i[1];return _ce?zn.useLayoutEffect(function(){Object.assign(s,{value:n,getSnapshot:e}),T6(s)&&a({inst:s})},[t,n,e]):Object.assign(s,{value:n,getSnapshot:e}),zn.useEffect(function(){return T6(s)&&a({inst:s}),t(function(){T6(s)&&a({inst:s})})},[t]),n});function T6(t){var e=t.value,r=t.getSnapshot;try{return e!==r()}catch{return!0}}var ul;(function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"})(ul||(ul={}));var Yd;function N$(t){var e;switch(t){case ul.Query:e="Query";break;case ul.Mutation:e="Mutation";break;case ul.Subscription:e="Subscription";break}return e}function tz(t){bu("parser",function(){globalThis.__DEV__!==!1&&dt.warn(93)}),Yd||(Yd=new HC(yc.parser||1e3));var e=Yd.get(t);if(e)return e;var r,n,i;dt(!!t&&!!t.kind,94,t);for(var s=[],a=[],o=[],c=[],l=0,u=t.definitions;l<u.length;l++){var d=u[l];if(d.kind==="FragmentDefinition"){s.push(d);continue}if(d.kind==="OperationDefinition")switch(d.operation){case"query":a.push(d);break;case"mutation":o.push(d);break;case"subscription":c.push(d);break}}dt(!s.length||a.length||o.length||c.length,95),dt(a.length+o.length+c.length<=1,96,t,a.length,c.length,o.length),n=a.length?ul.Query:ul.Mutation,!a.length&&!o.length&&(n=ul.Subscription);var f=a.length?a:o.length?o:c;dt(f.length===1,97,t,f.length);var h=f[0];r=h.variableDefinitions||[],h.name&&h.name.kind==="Name"?i=h.name.value:i="data";var g={name:i,type:n,variables:r};return Yd.set(t,g),g}tz.resetCache=function(){Yd=void 0};globalThis.__DEV__!==!1&&GC("parser",function(){return Yd?Yd.size:0});function ade(t,e){var r=Ei("parser",tz,[t]),n=N$(e),i=N$(r.type);dt(r.type===e,98,n,n,i)}function ig(t,e,r,n){"use no memo";n===void 0&&(n="Please remove this option.");var i=zn.useRef(!1);globalThis.__DEV__!==!1&&e in t&&!i.current&&(Rn(t,e,r,n),i.current=!0)}var ode=Symbol.for("apollo.hook.wrappers");function cde(t,e,r){var n=r.queryManager,i=n&&n[ode],s=i&&i[t];return s?s(e):e}var lde=Object.prototype.hasOwnProperty;function P$(){}var Pb=Symbol();function Lh(t,e){return e===void 0&&(e=Object.create(null)),cde("useQuery",ude,ez(e&&e.client))(t,e)}function ude(t,e){globalThis.__DEV__!==!1&&(ig(e,"canonizeResults","useQuery"),ig(e,"partialRefetch","useQuery"),ig(e,"defaultOptions","useQuery","Pass the options directly to the hook instead."),ig(e,"onCompleted","useQuery","If your `onCompleted` callback sets local state, switch to use derived state using `data` returned from the hook instead. Use `useEffect` to perform side-effects as a result of updates to `data`."),ig(e,"onError","useQuery","If your `onError` callback sets local state, switch to use derived state using `data`, `error` or `errors` returned from the hook instead. Use `useEffect` if you need to perform side-effects as a result of updates to `data`, `error` or `errors`."));var r=fde(t,e),n=r.result,i=r.obsQueryFields;return zn.useMemo(function(){return ke(ke({},n),i)},[n,i])}function dde(t,e,r,n,i){function s(d){var f;ade(e,ul.Query);var h={client:t,query:e,observable:n&&n.getSSRObservable(i())||_1.inactiveOnCreation.withValue(!n,function(){return Ei(["canonizeResults","partialRefetch"],function(){return t.watchQuery(rz(void 0,t,r,i()))})}),resultData:{previousData:(f=d==null?void 0:d.resultData.current)===null||f===void 0?void 0:f.data}};return h}var a=zn.useState(s),o=a[0],c=a[1];function l(d){var f,h;Object.assign(o.observable,(f={},f[Pb]=d,f));var g=o.resultData;c(ke(ke({},o),{query:d.query,resultData:Object.assign(g,{previousData:((h=g.current)===null||h===void 0?void 0:h.data)||g.previousData,current:void 0})}))}if(t!==o.client||e!==o.query){var u=s(o);return c(u),[u,l]}return[o,l]}function fde(t,e){var r=ez(e.client),n=zn.useContext(lS()).renderPromises,i=!!n,s=r.disableNetworkFetches,a=e.ssr!==!1&&!e.skip,o=e.partialRefetch,c=mde(r,t,e,i),l=dde(r,t,e,n,c),u=l[0],d=u.observable,f=u.resultData,h=l[1],g=c(d);gde(f,d,r,e,g);
68var m=zn.useMemo(function(){return wde(d)},[d]);pde(d,n,a);var y=hde(f,d,r,e,g,s,o,i,{onCompleted:e.onCompleted||P$,onError:e.onError||P$});return{result:y,obsQueryFields:m,observable:d,resultData:f,client:r,onQueryExecuted:h}}function hde(t,e,r,n,i,s,a,o,c){var l=zn.useRef(c);zn.useEffect(function(){l.current=c});var u=(o||s)&&n.ssr===!1&&!n.skip?iz:n.skip||i.fetchPolicy==="standby"?sz:void 0,d=t.previousData,f=zn.useMemo(function(){return u&&nz(u,d,e,r)},[r,e,u,d]);return sde(zn.useCallback(function(h){if(o)return function(){};var g=function(){var b=t.current,E=e.getCurrentResult();b&&b.loading===E.loading&&b.networkStatus===E.networkStatus&&Vr(b.data,E.data)||z_(E,t,e,r,a,h,l.current)},m=function(b){if(y.current.unsubscribe(),y.current=e.resubscribeAfterError(g,m),!lde.call(b,"graphQLErrors"))throw b;var E=t.current;(!E||E&&E.loading||!Vr(b,E.error))&&z_({data:E&&E.data,error:b,loading:!1,networkStatus:kr.error},t,e,r,a,h,l.current)},y={current:e.subscribe(g,m)};return function(){setTimeout(function(){return y.current.unsubscribe()})}},[s,o,e,t,a,r]),function(){return f||O$(t,e,l.current,a,r)},function(){return f||O$(t,e,l.current,a,r)})}function pde(t,e,r){e&&r&&(e.registerSSRObservable(t),t.getCurrentResult().loading&&e.addObservableQueryPromise(t))}function gde(t,e,r,n,i){var s;e[Pb]&&!Vr(e[Pb],i)&&(e.reobserve(rz(e,r,n,i)),t.previousData=((s=t.current)===null||s===void 0?void 0:s.data)||t.previousData,t.current=void 0),e[Pb]=i}function mde(t,e,r,n){r===void 0&&(r={});var i=r.skip;r.ssr,r.onCompleted,r.onError;var s=r.defaultOptions,a=oa(r,["skip","ssr","onCompleted","onError","defaultOptions"]);return function(o){var c=Object.assign(a,{query:e});return n&&(c.fetchPolicy==="network-only"||c.fetchPolicy==="cache-and-network")&&(c.fetchPolicy="cache-first"),c.variables||(c.variables={}),i?(c.initialFetchPolicy=c.initialFetchPolicy||c.fetchPolicy||R$(s,t.defaultOptions),c.fetchPolicy="standby"):c.fetchPolicy||(c.fetchPolicy=(o==null?void 0:o.options.initialFetchPolicy)||R$(s,t.defaultOptions)),c}}function rz(t,e,r,n){var i=[],s=e.defaultOptions.watchQuery;return s&&i.push(s),r.defaultOptions&&i.push(r.defaultOptions),i.push(Cf(t&&t.options,n)),i.reduce(Ib)}function z_(t,e,r,n,i,s,a){var o=e.current;o&&o.data&&(e.previousData=o.data),!t.error&&Ma(t.errors)&&(t.error=new Zc({graphQLErrors:t.errors})),e.current=nz(vde(t,r,i),e.previousData,r,n),s(),yde(t,o==null?void 0:o.networkStatus,a)}function yde(t,e,r){if(!t.loading){var n=bde(t);Promise.resolve().then(function(){n?r.onError(n):t.data&&e!==t.networkStatus&&t.networkStatus===kr.ready&&r.onCompleted(t.data)}).catch(function(i){globalThis.__DEV__!==!1&&dt.warn(i)})}}function O$(t,e,r,n,i){return t.current||z_(e.getCurrentResult(),t,e,i,n,function(){},r),t.current}function R$(t,e){var r;return(t==null?void 0:t.fetchPolicy)||((r=e==null?void 0:e.watchQuery)===null||r===void 0?void 0:r.fetchPolicy)||"cache-first"}function bde(t){return Ma(t.errors)?new Zc({graphQLErrors:t.errors}):t.error}function nz(t,e,r,n){var i=t.data;t.partial;var s=oa(t,["data","partial"]),a=ke(ke({data:i},s),{client:n,observable:r,variables:r.variables,called:t!==iz&&t!==sz,previousData:e});return a}function vde(t,e,r){return t.partial&&r&&!t.loading&&(!t.data||Object.keys(t.data).length===0)&&e.options.fetchPolicy!=="cache-only"?(e.refetch(),ke(ke({},t),{loading:!0,networkStatus:kr.refetch})):t}var iz=Gp({loading:!0,data:void 0,error:void 0,networkStatus:kr.loading}),sz=Gp({loading:!1,data:void 0,error:void 0,networkStatus:kr.ready});function wde(t){return{refetch:t.refetch.bind(t),reobserve:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&dt.warn(83),t.reobserve.apply(t,e)},fetchMore:t.fetchMore.bind(t),updateQuery:t.updateQuery.bind(t),startPolling:t.startPolling.bind(t),stopPolling:t.stopPolling.bind(t),subscribeToMore:t.subscribeToMore.bind(t)}}var Ede={VITE_APP_SUBGRAPH_API_KEY:"0bdfb5369a3f673c2f4d7b07fdc47356 6d1aad6c2bd525626fe78c662c0b99b1 f2182b8d85650307efdc7ee5f5e928d5 d762176fa97a19cbfec853f321540d1f 4d180b6f0318804bca6bad7a412df4e3"};const xde="https://query.godex.ai/subgraphs/name/graphprotocol/botdex-subgraph-arbitrum";function _de(t,e){return Math.floor(Math.random()*(e-t+1)+t)}const uS=()=>{const t=Ede.VITE_APP_SUBGRAPH_API_KEY.split(" "),e=(t==null?void 0:t.length)||3,r=_de(0,e-1);return t[r]};`${uS()}`;const Cde=new od({uri:"https://api.thegraph.com/index-node/graphql",cache:new ad}),D$=new od({uri:`https://gateway-arbitrum.network.thegraph.com/api/${uS()}/subgraphs/id/9A6bkprqEG2XsZUYJ5B2XXp6ymz9fNcn4tVPxMWDztYC`,cache:new ad,queryDeduplication:!0,defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}}),M$=new od({uri:`https://gateway-arbitrum.network.thegraph.com/api/${uS()}/subgraphs/id/5zvR82QoaXYFyDEKLZ9t6v9adgnptxYpKpSbxtgVENFV`,cache:new ad({typePolicies:{Token:{keyFields:!1},Pool:{keyFields:!1}}}),queryDeduplication:!0,defaultOptions:{watchQuery:{fetchPolicy:"no-cache"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}}),Sde=new od({uri:"https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-arbitrum-one?source=uniswap",cache:new ad({typePolicies:{Token:{keyFields:!1},Pool:{keyFields:!1}}}),queryDeduplication:!0,defaultOptions:{watchQuery:{fetchPolicy:"cache-first"},query:{fetchPolicy:"cache-first",errorPolicy:"all"}}}),Ade=new od({uri:"https://api.thegraph.com/subgraphs/name/ianlapham/arbitrum-one-blocks",cache:new ad,queryDeduplication:!0,defaultOptions:{watchQuery:{fetchPolicy:"cache-first"},query:{fetchPolicy:"cache-first",errorPolicy:"all"}}});new od({uri:xde,cache:new ad,queryDeduplication:!0,defaultOptions:{watchQuery:{fetchPolicy:"cache-first"},query:{fetchPolicy:"cache-first",errorPolicy:"all"}}});function az(){return g0(t=>t.application.blockNumber[sd??-1])}function Tde(){const t=Gf(),e=g0(n=>n.application.subgraphStatus),r=C.useCallback((n,i,s)=>{t(Yie({available:n,syncedBlock:i,headBlock:s}))},[t]);return[e,r]}function Zf(){return[rq]}function Ide(){const[t]=Zf();switch(t.id){case wl.ETHEREUM:return M$;case wl.ARBITRUM:return Sde;default:return M$}}function kde(){const[t]=Zf();switch(t.id){case wl.ETHEREUM:return D$;case wl.ARBITRUM:return Ade;default:return D$}}function dS(){const t=Ide(),e=kde();return{dataClient:t,blockClient:e}}const $de=fa` 69 query health($name: Bytes) { 70 indexingStatusForCurrentVersion(subgraphName: $name, subgraphError: allow) { 71 synced 72 health 73 chains { 74 chainHeadBlock { 75 number 76 } 77 latestBlock { 78 number 79 } 80 } 81 } 82 } 83`;function Nde(){const[t]=Zf(),{loading:e,error:r,data:n}=Lh($de,{client:Cde,fetchPolicy:"network-only",variables:{name:t===rq?"uniswap/uniswap-v3":"ianlapham/uniswap-arbitrum-one"}}),i=n==null?void 0:n.indexingStatusForCurrentVersion;if(e)return{available:null,syncedBlock:void 0,headBlock:void 0};if(!e&&!i||r)return{available:!1,syncedBlock:void 0,headBlock:void 0};const s=i==null?void 0:i.chains[0].latestBlock.number,a=i==null?void 0:i.chains[0].chainHeadBlock.number;return{available:!0,syncedBlock:s?parseFloat(s):void 0,headBlock:a?parseFloat(a):void 0}}function Pde(){const t=sd,e=Wp,r=Gf(),[n,i]=C.useState({chainId:t,blockNumber:null}),s=C.useCallback(h=>{i(g=>t===g.chainId?typeof g.blockNumber!="number"?{chainId:t,blockNumber:h}:{chainId:t,blockNumber:Math.max(h,g.blockNumber)}:g)},[t,i]);C.useEffect(()=>{if(!(!e||!t))return i({chainId:t,blockNumber:null}),e.getBlockNumber().then(s).catch(h=>console.error(`Failed to get block number for chainId: ${t}`,h)),e.on("block",s),()=>{e.removeListener("block",s)}},[r,t,e,s]);const a=jq(n,1500);C.useEffect(()=>{!a.chainId||!a.blockNumber||r(ese({chainId:a.chainId,blockNumber:a.blockNumber}))},[r,a.blockNumber,a.chainId]);const[o,c]=Tde(),{available:l,syncedBlock:u,headBlock:d}=Nde(),f=o.syncedBlock;return C.useEffect(()=>{o.available===null&&l!==null&&c(l,f,d),(!o.syncedBlock||o.syncedBlock!==u&&f)&&c(o.available,u,d)},[l,d,u,o.available,o.syncedBlock,f,c]),null}var Ode="0x794a61358D6845594F94dc1DB02A252b5b4814aD";const fS={MultiCall:{[st.MAINNET]:"0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696",[st.ARBITRUM_ONE]:"0x842eC2c7D803033Edf55E478F461FC547Bc54EB2",[st.ARB_TESTNET]:"0x19E78826cd602c8EF8E9EA323e3C1Efdf31a6AFe"},GDRouter:{[st.MAINNET]:"0xb2c6b65B24D7F33b1E13991FFB9C501fFa5A5489",[st.ARBITRUM_ONE]:"0x2CF0a497b743472934470DaE958E81e629E92762",[st.ARB_TESTNET]:"0x1738fefEDD4E9b15933F02b80a84494aC98c26b5"},GDVault:{[st.MAINNET]:"0xb2c6b65B24D7F33b1E13991FFB9C501fFa5A5489",[st.ARBITRUM_ONE]:"0xb17A5FF294dF267BBb482e31a792Ccc7Ce8CC208",[
83st.ARB_TESTNET]:"0xD72B4f9e0e33397638E63ce81593A90Aa0D6fdaD"},FactoryAddress:{[st.MAINNET]:"0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",[st.ARBITRUM_ONE]:"0x9fb7587ABC30f31Ad333dEc9Fa9a1B6095B6D9AE",[st.ARB_TESTNET]:"0xcF026B21917deD5b135fa9aA609826114D0A6C45"},Lens:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0x81328d84C0665B3794B6b82CC2F85d8699601a2C",[st.ARB_TESTNET]:"0x9024b75BabC7F18AB7723D119E722936dc959559"},GDProxyFactory:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0xbeEBE28dc9a416d909332b5F2eD2bB5955C9E657",[st.ARB_TESTNET]:"0xd060Ed920C7Fa9162c965bB0127D3534715e49f8"},GDImplementation:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0xfe635f550Ba81b331b519707057D9c2189F4f586",[st.ARB_TESTNET]:"0x723079592a70B6ebBf15ef0fc1863B5460AA5cDd"},GDFactory:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0xCf21DAE8e0dD6b37ccB87d06C6BcDBEB51990d0d",[st.ARB_TESTNET]:"0xFa1E7BDA46cFA76b1667A04b1dd4bdbaA116DDd1"},GDBank:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0x34EC5aC5B0074e9385d8d4d4A43a478c0FBA1f5d",[st.ARB_TESTNET]:"0xFa1E7BDA46cFA76b1667A04b1dd4bdbaA116DDd1"},AavePool:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:Ode,[st.ARB_TESTNET]:"0xFa1E7BDA46cFA76b1667A04b1dd4bdbaA116DDd1"},GDPool:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0x0228b30dD67437ABD05Be7703Acf14efdAfeC249",[st.ARB_TESTNET]:""},WalletImplementation2:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0x65970C176AF7e995deBb2EdC4B088A6B2cdB8396",[st.ARB_TESTNET]:""},GDPoolVault:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0x3e9B9415f78BcA5475E43136C51AFCc732913F89",[st.ARB_TESTNET]:"0xf046b4689914dB6EAc0f4021174e048910dA8639"}};fS.GDRouter[sd].toLowerCase();const oz=(t,e=sd)=>t[e],Rde=()=>oz(fS.MultiCall),Dde=()=>oz(fS.Lens),Mde=[{inputs:[{internalType:"string",name:"_name",type:"string"},{internalType:"string",name:"_symbol",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",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:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],jde=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"}],Lde=JSON.parse('[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"CreateOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"StopOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"path","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"Update","type":"event"}
83,{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesired","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"add","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"}],"name":"createOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"createOrder1","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"createOrder2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"reserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getAccountOrderByIndex","outputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountInStart","type":"uint256"},{"internalType":"uint256","name":"amountOutStart","type":"uint256"},{"internalType":"uint256","name":"amountInStop","type":"uint256"},{"internalType":"uint256","name":"amountOutStop","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"stopBlock","type":"uint256"},{"internalType":"enum GDRouter.OrderStatus","name":"status","type":"uint8"}],"internalType":"struct GDRouter.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getAccountOrders","outputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountInStart","type":"uint256"},{"internalType":"uint256","name":"amountOutStart","type":"uint256"},{"internalType":"uint256","name":"amountInStop","type":"uint256"},{"internalType":"uint256","name":"amountOutStop","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"stopBlock","type":"uint256"},{"internalType":"enum GDRouter.OrderStatus","name":"status","type":"uint8"}],"internalType":"struct GDRouter.Order[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountOrdersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}
83,{"inputs":[{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getAccounts","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAccountsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"reserveIn","type":"uint256"},{"internalType":"uint256","name":"reserveOut","type":"uint256"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsIn","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_USDT","type":"address"},{"internalType":"address","name":"_TUSDT","type":"address"},{"internalType":"address","name":"_tradingAddr","type":"address"},{"internalType":"address","name":"_developmentAddr","type":"address"},{"internalType":"address","name":"_marketingAddr","type":"address"},{"internalType":"address","name":"_vaultAddr","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"name":"quote","outputs":[{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"remove","outputs":[{"internalType":"uint256","name":"amountA","type":"uint256"},{"internalType":"uint256","name":"amountB","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_developmentAddr","type":"address"},{"internalType":"address","name":"_marketingAddr","type":"address"},{"internalType":"address","name":"_vaultAddr","type":"address"}],"name":"setAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"stopOrder","outputs":[],"stateMutability":"nonpayable","type":"function"}
83,{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"}]'),Fde=JSON.parse('[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"CreateOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"}],"name":"StopOrder","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Subscribe","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Unsubscribe","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accountToMiniVault","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"accountToSubscription","outputs":[{"internalType":"uint256","name":"total","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"copyToAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"copyToOrder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"}],"internalType":"struct GDCopyImplementation.CreateOrderParam[]","name":"params","type":"tuple[]"}],"name":"createOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"gdFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gdRouter","outputs":[{"internalType":"contract IGDRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getAccountOrderByIndex","outputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountInStart","type":"uint256"},{"internalType":"uint256","name":"amountOutStart","type":"uint256"},{"internalType":"uint256","name":"amountInStop","type":"uint256"},{"internalType":"uint256","name":"amountOutStop","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"stopBlock","type":"uint256"},{"internalType":"uint8","name":"status","type":"uint8"}],"internalType":"struct GDCopyImplementation.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"}
83,{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getAccountOrders","outputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountInStart","type":"uint256"},{"internalType":"uint256","name":"amountOutStart","type":"uint256"},{"internalType":"uint256","name":"amountInStop","type":"uint256"},{"internalType":"uint256","name":"amountOutStop","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"stopBlock","type":"uint256"},{"internalType":"uint8","name":"status","type":"uint8"}],"internalType":"struct GDCopyImplementation.Order[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountOrdersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"page","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"getAccounts","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAccountsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getOrderCopies","outputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"sl","type":"uint256"},{"internalType":"uint256","name":"tp","type":"uint256"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountInStart","type":"uint256"},{"internalType":"uint256","name":"amountOutStart","type":"uint256"},{"internalType":"uint256","name":"amountInStop","type":"uint256"},{"internalType":"uint256","name":"amountOutStop","type":"uint256"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"startBlock","type":"uint256"},{"internalType":"uint256","name":"stopBlock","type":"uint256"},{"internalType":"uint8","name":"status","type":"uint8"}],"internalType":"struct GDCopyImplementation.Order[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256[2]","name":"_shares","type":"uint256[2]"},{"internalType":"address","name":"_gdRouter","type":"address"},{"internalType":"address","name":"_USDT","type":"address"},{"internalType":"address","name":"_TUSDT","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"internalType":"struct GDCopyImplementation.StopOrderParam[]","name":"params","type":"tuple[]"}],"name":"stopOders","outputs":[],"stateMutability":"nonpayable","type":"function"}
83,{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"stopOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"subscribe","outputs":[{"internalType":"address","name":"miniVault","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unsubscribe","outputs":[],"stateMutability":"nonpayable","type":"function"}]');new Mp(Mde);new Mp(jde);new Mp(Lde);new Mp(Fde);const Ude=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint8",name:"version",type:"uint8"}],name:"Initialized",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"page",type:"uint256"},{internalType:"uint256",name:"limit",type:"uint256"}],name:"getAccountOrders",outputs:[{components:[{internalType:"address",name:"router",type:"address"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"sl",type:"uint256"},{internalType:"uint256",name:"tp",type:"uint256"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"amountInStart",type:"uint256"},{internalType:"uint256",name:"amountOutStart",type:"uint256"},{internalType:"uint256",name:"amountInStop",type:"uint256"},{internalType:"uint256",name:"amountOutStop",type:"uint256"},{internalType:"uint256",name:"amountIn",type:"uint256"},{internalType:"uint256",name:"amountOut",type:"uint256"},{internalType:"uint256",name:"startBlock",type:"uint256"},{internalType:"uint256",name:"stopBlock",type:"uint256"},{internalType:"uint8",name:"status",type:"uint8"}],internalType:"struct GDLens.Order[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_router",type:"address"},{internalType:"address",name:"_router2",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"router",outputs:[{internalType:"contract IGDRouter",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"router2",outputs:[{internalType:"contract IGDRouter2",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}],Bde=[{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"aggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes[]",name:"returnData",type:"bytes[]"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"blockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall2.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],name:"getBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getBlockNumber",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockCoinbase",outputs:[{internalType:"address",name:"coinbase",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockDifficulty",outputs:[{internalType:"uint256",name:"difficulty",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockGasLimit",outputs:[{internalType:"uint256",name:"gaslimit",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"addr",type:"address"}],name:"getEthBalance",outputs:[{internalType:"uint256",name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastBlockHash",outputs:[{internalType:"bytes32",name:"blockHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"tryAggregate",outputs:[{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall2.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bool",name:"requireSuccess",type:"bool"},{components:[{internalType:"address",name:"target",type:"address"},{internalType:"bytes",name:"callData",type:"bytes"}],internalType:"struct Multicall2.Call[]",name:"calls",type:"tuple[]"}],name:"tryBlockAndAggregate",outputs:[{internalType:"uint256",name:"blockNumber",type:"uint256"},{internalType:"bytes32",name:"blockHash",type:"bytes32"},{components:[{internalType:"bool",name:"success",type:"bool"},{internalType:"bytes",name:"returnData",type:"bytes"}],internalType:"struct Multicall2.Result[]",name:"returnData",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"}],cz="visibilityState"in document;function j$(){return cz?document.visibilityState==="visible":!0}function hS(){const[t,e]=C.useState(j$());return C.useEffect(()=>{if(!cz)return;const r=()=>{e(j$())};return document.addEventListener("visibilitychange",r),()=>{document.removeEventListener("visibilitychange",r)}},[e]),t}const qde={createWallet:async()=>await Xe.post("/auth/create-wallet"),me:async()=>await Xe.get("/auth/me"),updateProfile:async t=>await Xe.put("/auth/me",t),confirmPrivateKey:async({key:t,userId:e})=>await Xe.post("/auth/confirm-private-key",{key:t,userId:e}),importPrivateKey:async({key:t})=>await Xe.post("/auth/import-private-key",{key:t}),importSeedPhrase:async({seedPhrase:t})=>await Xe.post("/auth/import-seed-phrase",{seedPhrase:t}),twoFA:async()=>await Xe.get("/auth/2fa"),confirm2FA:async({code:t})=>await Xe.post("/auth/verify-2fa",{code:t}),affiliateWallet:async()=>await Xe.get("/wallet/affiliate"),partnership:async()=>await Xe.get("/wallet/partnership"),importCode:async({code:t})=>await Xe.get(`/auth/import/${t}`),importWithoutCode:async()=>await Xe.get("/auth/without-code"),privyAuth:async t=>await Xe.post("/auth/privy-user",t),privyVerify:async t=>await Xe.post("/auth/privy-verify",t),generateOtp:async()=>await Xe.post("/tele-bot/generate-otp"),teleLogin:async(t,e)=>await Xe.post("/auth/login-tele",{userId:t,otp:e}),checkBusinessRequirement:async()=>await Xe.get("/p2p/business-requirement")};var zc=(t=>(t.Approved="approved",t.Pending="pending",t.Rejected="rejected",t.Incomplete="incomplete",t.Waiting="waiting",t.InReview="inreview",t.Unverified="unverified",t))(zc||{}),V_=(t=>(t.Pending="Pending",t.Accepted="Accepted",t.Rejected="Rejected",t.LevelUpPending="LevelUpPending",t.LevelUpAccepted="LevelUpAccepted",t.LevelUpRejected="LevelUpRejected",t))(V_||{});const I6="data:image/svg+xml,%3csvg%20width='42'%20height='42'%20viewBox='0%200%2042%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group'%3e%3cpath%20id='Vector'%20d='M21%2042C32.598%2042%2042%2032.598%2042%2021C42%209.40202%2032.598%200%2021%200C9.40202%200%200%209.40202%200%2021C0%2032.598%209.40202%2042%2021%2042Z'%20fill='%23627EEA'/%3e%3cg%20id='Group_2'%3e%3cpath%20id='Vector_2'%20d='M21.6538%205.25V16.8919L31.4936%2021.2887L21.6538%205.25Z'%20fill='white'%20fill-opacity='0.602'/%3e%3cpath%20id='Vector_3'%20d='M21.6536%205.25L11.8125%2021.2887L21.6536%2016.8919V5.25Z'%20fill='white'/%3e%3cpath%20id='Vector_4'%20d='M21.6538%2028.833V36.7434L31.5002%2023.121L21.6538%2028.833Z'%20fill='white'%20fill-opacity='0.602'/%3e%3cpath%20id='Vector_5'%20d='M21.6536%2036.7434V28.8317L11.8125%2023.121L21.6536%2036.7434Z'%2
830fill='white'/%3e%3cpath%20id='Vector_6'%20d='M21.6538%2027.0021L31.4936%2021.2887L21.6538%2016.8945V27.0021Z'%20fill='white'%20fill-opacity='0.2'/%3e%3cpath%20id='Vector_7'%20d='M11.8125%2021.2887L21.6536%2027.0021V16.8945L11.8125%2021.2887Z'%20fill='white'%20fill-opacity='0.602'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Wde="data:image/svg+xml,%3csvg%20width='141'%20height='20'%20viewBox='0%200%20141%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Group%201171275280'%3e%3cg%20id='Group%201171275247'%3e%3cg%20id='Group%2020959'%3e%3cpath%20id='Vector'%20d='M79.8745%2015.7118V19.9968H63.0771V0H79.8745V4.28504H67.6479V7.99873H78.4461V11.9981H67.6479V15.7118H79.8745Z'%20fill='black'/%3e%3cpath%20id='Vector_2'%20d='M51.2585%2019.9968H42.6885V0H51.2585C58.4574%200%2061.5426%202.99953%2061.5426%209.99842C61.5426%2016.9973%2058.4574%2019.9968%2051.2585%2019.9968ZM47.2592%204.28504V15.7118H51.1157C55.2293%2015.7118%2056.9719%2013.9978%2056.9719%209.99842C56.9719%205.99905%2055.2293%204.28504%2051.1157%204.28504H47.2592Z'%20fill='black'/%3e%3cpath%20id='Vector_3'%20d='M23.4139%202.36074C24.997%200.777655%2027.5244%200%2031.0238%200C34.5233%200%2037.0784%200.777655%2038.6615%202.36074C40.2446%203.94382%2041.0222%206.49897%2041.0222%209.99842C41.0222%2013.4979%2040.2446%2016.0252%2038.6615%2017.6083C37.0784%2019.1914%2034.5233%2019.9968%2031.0238%2019.9968C27.5244%2019.9968%2024.997%2019.1914%2023.4139%2017.6083C21.8308%2016.0252%2021.0254%2013.4979%2021.0254%209.99842C21.0254%206.49897%2021.8308%203.94382%2023.4139%202.36074ZM26.8023%205.55468C25.9135%206.4712%2025.4691%207.97096%2025.4691%209.99842C25.4691%2012.0259%2025.9135%2013.5256%2026.8023%2014.4422C27.6632%2015.3587%2029.0797%2015.8308%2031.0238%2015.8308C32.9679%2015.8308%2034.3844%2015.3587%2035.2731%2014.4422C36.1341%2013.5256%2036.5785%2012.0259%2036.5785%209.99842C36.5785%207.97096%2036.1341%206.4712%2035.2731%205.55468C34.3844%204.63816%2032.9679%204.16601%2031.0238%204.16601C29.0797%204.16601%2027.6632%204.63816%2026.8023%205.55468Z'%20fill='black'/%3e%3cpath%20id='Vector_4'%20d='M0%209.99842C0%202.99952%202.99952%200%209.99841%200C15.9697%200%2018.997%202.1941%2019.8024%207.08221H15.1365C14.4422%205.13808%2012.7202%204.16601%209.99841%204.16601C6.11014%204.16601%204.44374%205.91573%204.44374%209.99842C4.44374%2014.1089%206.13792%2015.8308%2010.5539%2015.8308C13.8867%2015.8308%2015.3031%2014.9421%2015.3031%2012.8591V12.6369H9.77623V8.74862H19.7469V12.8591C19.7469%2017.8583%2016.9695%2019.9968%2010.4983%2019.9968C6.7767%2019.9968%204.11046%2019.2192%202.47183%2017.6361C0.833201%2016.053%200%2013.5256%200%209.99842Z'%20fill='black'/%3e%3cg%20id='Group%201171275233'%3e%3cpath%20id='Vector_5'%20d='M80.9175%2019.9968H87.0144L91.7729%2013.7286L96.5314%2019.9968H102.628L94.8957%209.92151L102.48%200H96.4199L91.7729%206.11442L80.9175%2019.9968Z'%20fill='black'/%3e%3cpath%20id='Vector_6'%20d='M80.9175%2019.9968H87.0144L91.7729%2013.7286L94.8957%209.92151L102.48%200H96.4199L91.7729%206.11442L80.9175%2019.9968Z'%20fill='black'/%3e%3cpath%20id='Vector_7'%20d='M87.1311%200H80.9175L87.9261%209.2386L91.2016%205.17092L87.1311%200Z'%20fill='%2324EE9F'/%3e%3c/g%3e%3c/g%3e%3cg%20id='.Ai'%3e%3cpath%20id='Vector_8'%20d='M140.343%2019.7183H135.836V0H140.343V19.7183Z'%20fill='black'/%3e%3cpath%20id='Vector_9'%20d='M118.445%2016.4225L117.008%2019.7183H112.22L120.952%200H125.994L134.727%2019.7183H129.938L128.501%2016.4225H118.445ZM126.699%2012.1972L123.487%204.78873L120.276%2012.1972H126.699Z'%20fill='black'/%3e%3cpath%20id='Vector_10'%20d='M106.442%2019.3239C105.991%2018.8732%20105.766%2018.169%20105.766%2017.183C105.766%2016.1971%20105.991%2015.4929%20106.442%2015.0422C106.893%2014.5915%20107.597%2014.3661%20108.583%2014.3661C109.569%2014.3661%20110.273%2014.5915%20110.724%2015.0422C111.175%2015.4929%20111.4%2016.1971%20111.4%2017.183C111.4%2018.169%20111.175%2018.8732%20110.724%2019.3239C110.273%2019.7746%20109.569%2019.9999%20108.583%2019.9999C107.597%2019.9999%20106.893%2019.7746%20106.442%2019.3239Z'%20fill='black'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",k6="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='Icon'%3e%3cpath%20id='Vector'%20d='M12%2
8300C18.6271%200%2024%205.37288%2024%2012C24%2018.6271%2018.6269%2024%2012%2024C5.37312%2024%200%2018.6286%200%2012C0%205.37144%205.37216%200%2012%200Z'%20fill='%2353AE94'/%3e%3cpath%20id='Vector_2'%20d='M13.4806%2010.4012V8.61604H17.5628V5.89612H6.44696V8.61604H10.5296V10.3997C7.2116%2010.5521%204.7168%2011.2092%204.7168%2011.9964C4.7168%2012.7836%207.2128%2013.4408%2010.5296%2013.5941V19.3121H13.4816V13.5936C16.7936%2013.4408%2019.2834%2012.7841%2019.2834%2011.9976C19.2834%2011.2112%2016.7936%2010.5545%2013.4816%2010.4016M13.4816%2013.1093V13.1079C13.3983%2013.1132%2012.9704%2013.1388%2012.0176%2013.1388C11.2558%2013.1388%2010.7199%2013.1172%2010.531%2013.1074V13.1098C7.59968%2012.98%205.4116%2012.4695%205.4116%2011.8587C5.4116%2011.2479%207.59992%2010.7381%2010.531%2010.608V12.6012C10.723%2012.6144%2011.2722%2012.6468%2012.0301%2012.6468C12.9404%2012.6468%2013.3981%2012.6089%2013.4821%2012.6012V10.608C16.4077%2010.7384%2018.5907%2011.2493%2018.5907%2011.858C18.5907%2012.4666%2016.4067%2012.9778%2013.4821%2013.1081'%20fill='white'/%3e%3c/g%3e%3c/svg%3e",zde="/assets/wintermute-DKcC4GFR.svg",Vde="/assets/PassCode_Desktop-0pWdtM2t.svg",Hde="data:image/svg+xml,%3csvg%20width='41'%20height='40'%20viewBox='0%200%2041%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M30.5%2017.9173C29.8167%2017.9173%2029.25%2017.3507%2029.25%2016.6673V13.334C29.25%208.08398%2027.7667%204.58398%2020.5%204.58398C13.2333%204.58398%2011.75%208.08398%2011.75%2013.334V16.6673C11.75%2017.3507%2011.1833%2017.9173%2010.5%2017.9173C9.81667%2017.9173%209.25%2017.3507%209.25%2016.6673V13.334C9.25%208.50065%2010.4167%202.08398%2020.5%202.08398C30.5833%202.08398%2031.75%208.50065%2031.75%2013.334V16.6673C31.75%2017.3507%2031.1833%2017.9173%2030.5%2017.9173Z'%20fill='%2319FB9B'/%3e%3cpath%20d='M28.834%2037.916H12.1673C4.81732%2037.916%202.58398%2035.6827%202.58398%2028.3327V24.9993C2.58398%2017.6493%204.81732%2015.416%2012.1673%2015.416H28.834C36.184%2015.416%2038.4173%2017.6493%2038.4173%2024.9993V28.3327C38.4173%2035.6827%2036.184%2037.916%2028.834%2037.916ZM12.1673%2017.916C6.20065%2017.916%205.08398%2019.0493%205.08398%2024.9993V28.3327C5.08398%2034.2827%206.20065%2035.416%2012.1673%2035.416H28.834C34.8007%2035.416%2035.9173%2034.2827%2035.9173%2028.3327V24.9993C35.9173%2019.0493%2034.8007%2017.916%2028.834%2017.916H12.1673Z'%20fill='%2319FB9B'/%3e%3cpath%20d='M13.8327%2028.3334C13.616%2028.3334%2013.3993%2028.2835%2013.1993%2028.2001C12.9827%2028.1168%2012.816%2028.0001%2012.6494%2027.8501C12.3494%2027.5334%2012.166%2027.1168%2012.166%2026.6668C12.166%2026.4501%2012.216%2026.2334%2012.2993%2026.0334C12.3827%2025.8168%2012.4994%2025.6501%2012.6494%2025.4835C12.816%2025.3335%2012.9827%2025.2168%2013.1993%2025.1334C13.7993%2024.8668%2014.5493%2025.0168%2015.016%2025.4835C15.166%2025.6501%2015.2827%2025.8334%2015.366%2026.0334C15.4494%2026.2334%2015.4993%2026.4501%2015.4993%2026.6668C15.4993%2027.1001%2015.316%2027.5334%2015.016%2027.8501C14.6993%2028.1501%2014.266%2028.3334%2013.8327%2028.3334Z'%20fill='%2319FB9B'/%3e%3cpath%20d='M20.5007%2028.3329C20.0673%2028.3329%2019.634%2028.1495%2019.3173%2027.8495C19.0173%2027.5328%2018.834%2027.1162%2018.834%2026.6662C18.834%2026.4495%2018.8673%2026.2329%2018.9673%2026.0329C19.0506%2025.8329%2019.1673%2025.6495%2019.3173%2025.4829C19.7007%2025.0995%2020.284%2024.9162%2020.8173%2025.0328C20.934%2025.0495%2021.034%2025.0828%2021.134%2025.1328C21.234%2025.1662%2021.334%2025.2162%2021.434%2025.2829C21.5173%2025.3329%2021.6006%2025.4162%2021.684%2025.4829C21.834%2025.6495%2021.9507%2025.8329%2022.034%2026.0329C22.1173%2026.2329%2022.1673%2026.4495%2022.1673%2026.6662C22.1673%2027.1162%2021.984%2027.5328%2021.684%2027.8495C21.6006%2027.9162%2021.5173%2027.9828%2021.434%2028.0495C21.334%2028.1162%2021.234%2028.1662%2021.134%2028.1996C21.034%2028.2496%2020.934%2028.2829%2020.8173%2028.2995C20.7173%2028.3162%2020.6007%2028.3329%2020.5007%2028.3329Z'%20fill='%2319FB9B'/%3e%3cpath%20d='M27.1667%2028.3329C26.7167%2028.3329%2026.3%2028.1495%2025.9833%2027.8495C25.8333%2027.6828%2025.7166%2027.4995%2025.6333%2027.2995C25.55%2027.0995%2025.5%2026.8829%2025.5%2026.6662C25.5%2026.2329%2025.6833%2025.7995%2025.9833%2
83025.4829C26.0667%2025.4162%2026.15%2025.3496%2026.2333%2025.2829C26.3333%2025.2162%2026.4333%2025.1662%2026.5333%2025.1328C26.6333%2025.0828%2026.7333%2025.0495%2026.8333%2025.0328C27.3833%2024.9162%2027.95%2025.0995%2028.35%2025.4829C28.65%2025.7995%2028.8333%2026.2162%2028.8333%2026.6662C28.8333%2026.8829%2028.7834%2027.0995%2028.7%2027.2995C28.6167%2027.5162%2028.5%2027.6828%2028.35%2027.8495C28.0333%2028.1495%2027.6%2028.3329%2027.1667%2028.3329Z'%20fill='%2319FB9B'/%3e%3c/svg%3e",Gde="data:image/svg+xml,%3csvg%20id='Layer_1'%20data-name='Layer%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20510.29%20510.29'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:%235a5564;}.cls-2{fill:%23f09242;}.cls-3{fill:%23282138;}%3c/style%3e%3c/defs%3e%3ctitle%3ewrapped-bitcoin-wbtc%3c/title%3e%3cg%20id='Layer_2'%20data-name='Layer%202'%3e%3cg%20id='Layer_1-2'%20data-name='Layer%201-2'%3e%3cg%20id='Page-1'%3e%3cg%20id='wbtc_colour'%20data-name='wbtc%20colour'%3e%3cpath%20id='Shape'%20class='cls-1'%20d='M416.09,107.09l-14,14a198.37,198.37,0,0,1,0,267.71l14,14a218.4,218.4,0,0,0,0-296Z'/%3e%3cpath%20id='Shape-2'%20class='cls-1'%20d='M121.43,108.31a198.35,198.35,0,0,1,267.71,0l14-14a218.39,218.39,0,0,0-296.06,0Z'/%3e%3cpath%20id='Shape-3'%20class='cls-1'%20d='M108.31,389a198.34,198.34,0,0,1,0-267.57l-14-14a218.39,218.39,0,0,0,0,296.06Z'/%3e%3cpath%20id='Shape-4'%20class='cls-1'%20d='M389,401.89a198.35,198.35,0,0,1-267.71,0l-14,14a218.39,218.39,0,0,0,296.06,0Z'/%3e%3cpath%20id='Shape-5'%20class='cls-2'%20d='M343.6,208.39c-2.8-29.23-28-39-59.92-42V126.1H259v39.51H239.31V126.1H214.84v40.54h-50V193s18.21-.33,17.93,0a12.75,12.75,0,0,1,14,10.83v111a8.78,8.78,0,0,1-9.34,8.18c.33.28-17.93,0-17.93,0l-4.67,29.47h49.55v41.19H239V353.08h19.71v40.4h24.71V352.76c41.66-2.53,70.71-12.8,74.35-51.8,2.94-31.38-11.82-45.4-35.4-51C336.74,242.86,345.61,229.78,343.6,208.39ZM309,296.1c0,30.64-52.49,27.14-69.21,27.14V268.88C256.55,268.92,309,264.11,309,296.1ZM297.6,219.51c0,28-43.81,24.61-57.73,24.61V194.71C253.79,194.71,297.6,190.32,297.6,219.51Z'/%3e%3cpath%20id='Shape-6'%20class='cls-3'%20d='M255.1,510.29C114.19,510.26,0,396,0,255.1S114.28,0,255.19,0s255.07,114.22,255.1,255.1S396.1,510.26,255.19,510.29Zm0-490.39c-129.85.1-235,105.44-234.92,235.29s105.44,235,235.29,234.92,234.87-105.28,234.92-235S385.22,20,255.38,19.9Z'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Kde="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2037.8%2043.6'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:%232a5ada;}%3c/style%3e%3c/defs%3e%3ctitle%3eAsset%201%3c/title%3e%3cg%20id='Layer_2'%20data-name='Layer%202'%3e%3cg%20id='Layer_1-2'%20data-name='Layer%201'%3e%3cpath%20class='cls-1'%20d='M18.9,0l-4,2.3L4,8.6,0,10.9V32.7L4,35l11,6.3,4,2.3,4-2.3L33.8,35l4-2.3V10.9l-4-2.3L22.9,2.3ZM8,28.1V15.5L18.9,9.2l10.9,6.3V28.1L18.9,34.4Z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Qde=({onComplete:t})=>{const[e,r]=C.useState(Array(4).fill("")),[n,i]=C.useState(""),[s,a]=C.useState("verify"),[o,c]=C.useState(""),{t:l}=pB(),{verifyPin:u,isPinLocked:d,lockScreen:f,setPin:h,setPinLocked:g,user:m}=C.useContext(gS);C.useEffect(()=>{m&&!localStorage.getItem(Gd)&&a("initial")},[m]);const y=()=>{const _=e.map(S=>S!=="").lastIndexOf(!0);if(_!==-1){const S=[...e];S[_]="",r(S),i("")}},b=_=>{if(_.length!==4){i("Please enter all 4 digits");return}if(s==="initial"){c(_),a("confirm"),r(Array(4).fill("")),i("");return}if(s==="confirm"){_===o?(localStorage.setItem(Gd,_),h(_),i(""),r(Array(4).fill("")),c(""),g(!1),t&&t()):(i("PINs don't match. Please try again"),a("initial"),r(Array(4).fill("")),c(""));return}u(_)?(i(""),r(Array(4).fill(""))):(i("Invalid PIN"),r(Array(4).fill("")))},E=_=>{const S=e.findIndex(A=>A==="");if(S!==-1){const A=[...e];A[S]=_,r(A),S===3&&setTimeout(()=>{b(A.join(""))},300)}},v=()=>{s!=="verify"&&(a("verify"),r(Array(4).fill("")),i(""),localStorage.getItem(Gd)||g(!1))},w=()=>{switch(s){case"initial":return l("pinLock.setYourAccessCode");case"confirm":return l("pinLock.repeatYourAccessCode");default:return l("pinLock.enterAccessCode")}},x=()=>{switch(s){case"initial":case"confirm":return l("pinLock.theCode");default:return l("pinLock.pleaseEnter")}};return C.useEffect(()=>{const _=S=>{const A=S.key;if(/^[0-9]$/.test(A)){E(A);return}if(A==="Backspace"||A==="Delete"){y();return}if(A==="Enter"){const I=e.join("");I.length===4&&b(I)}};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[e]),m?p.jsx("div",{className:"flex items-center justify-center min-h-screen w-full bg-white",tabIndex:0,children:d?p.jsxs("div",{className:"w-full h-full max-w-[1200px] px-6 flex items-center justify-between",children:[p.jsxs("div",{className:"flex flex-col items-center space-y-8 w-full max-w-md mx-auto",children:[p.jsx("div",{className:"py-[13px] px-[11px] bg-black rounded-[20px]",children:p.jsx("img",{src:Hde,alt:"Lock Icon",className:"w-10 h-10"})}),p.jsx("h2",{className:"text-2xl font-bold text-gray-800",children:w()}),p.jsx("p",{className:"text-gray-500 text-center text-sm",children:x()}),p.jsx("div",{className:"flex space-x-4 mb-8",children:e.map((_,S)=>p.jsx("div",{className:`w-6 h-6 rounded-full ${_?"bg-green-500":"bg-gray-200"}`},S))}),p.jsxs("div",{className:"grid grid-cols-3 gap-6 w-full max-w-xs",children:[[1,2,3,4,5,6,7,8,9].map(_=>p.jsx("button",{onClick:()=>E(_.toString()),className:"w-16 h-16 rounded-full text-2xl font-medium hover:bg-gray-100 transition-colors",children:_},_)),p.jsx("button",{className:"w-16 h-16 text-lg font-medium hover:bg-gray-100 transition-colors",onClick:v,children:l("pinLock.skip")}),p.jsx("button",{onClick:()=>E("0"),className:"w-16 h-16 rounded-full text-2xl font-medium hover:bg-gray-100 transition-colors",children:"0"}),p.jsx("button",{onClick:y,className:"w-16 h-16 text-lg font-medium hover:bg-gray-100 transition-colors",children:"â«"})]}),n&&p.jsx("p",{className:"text-red-500 text-sm mt-4",children:n}),s!=="verify"&&p.jsxs("p",{className:"text-gray-500 text-xs text-center mt-6",children:[l("pinLock.non"),p.jsx("br",{}),l("pinLock.youControl")]})]}),p.jsx("div",{className:"hidden md:block w-1/2",children:p.jsx("img",{src:Vde,alt:"Desktop Illustration",className:"w-full max-w-[500px] mx-auto"})})]}):p.jsx(tne,{type:"primary",icon:p.jsx(rne,{}),onClick:f,className:"fixed top-4 right-4",children:"Lock Screen"})}):null};class re extends Array{constructor(e,r){if(super(e),this.sign=r,Object.setPrototypeOf(this,re.prototype),e>re.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded")}static BigInt(e){var r=Math.floor,n=Number.isFinite;if(typeof e=="number"){if(e===0)return re.__zero();if(re.__isOneDigitInt(e))return 0>e?re.__oneDigit(-e,!0):re.__oneDigit(e,!1);if(!n(e)||r(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return re.__fromDouble(e)}if(typeof e=="string"){const i=re.__fromString(e);if(i===null)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return i}
83if(typeof e=="boolean")return e===!0?re.__oneDigit(1,!1):re.__zero();if(typeof e=="object"){if(e.constructor===re)return e;const i=re.__toPrimitive(e);return re.BigInt(i)}throw new TypeError("Cannot convert "+e+" to a BigInt")}toDebugString(){const e=["BigInt["];for(const r of this)e.push((r&&(r>>>0).toString(16))+", ");return e.push("]"),e.join("")}toString(e=10){if(2>e||36<e)throw new RangeError("toString() radix argument must be between 2 and 36");return this.length===0?"0":(e&e-1)==0?re.__toStringBasePowerOfTwo(this,e):re.__toStringGeneric(this,e,!1)}valueOf(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}static toNumber(e){const r=e.length;if(r===0)return 0;if(r===1){const y=e.__unsignedDigit(0);return e.sign?-y:y}const n=e.__digit(r-1),i=re.__clz30(n),s=30*r-i;if(1024<s)return e.sign?-1/0:1/0;let a=s-1,o=n,c=r-1;const l=i+3;let u=l===32?0:o<<l;u>>>=12;const d=l-12;let f=12<=l?0:o<<20+l,h=20+l;for(0<d&&0<c&&(c--,o=e.__digit(c),u|=o>>>30-d,f=o<<d+2,h=d+2);0<h&&0<c;)c--,o=e.__digit(c),f|=30<=h?o<<h-30:o>>>30-h,h-=30;const g=re.__decideRounding(e,h,c,o);if((g===1||g===0&&(1&f)==1)&&(f=f+1>>>0,f===0&&(u++,u>>>20!=0&&(u=0,a++,1023<a))))return e.sign?-1/0:1/0;const m=e.sign?-2147483648:0;return a=a+1023<<20,re.__kBitConversionInts[re.__kBitConversionIntHigh]=m|a|u,re.__kBitConversionInts[re.__kBitConversionIntLow]=f,re.__kBitConversionDouble[0]}static unaryMinus(e){if(e.length===0)return e;const r=e.__copy();return r.sign=!e.sign,r}static bitwiseNot(e){return e.sign?re.__absoluteSubOne(e).__trim():re.__absoluteAddOne(e,!0)}static exponentiate(e,r){if(r.sign)throw new RangeError("Exponent must be positive");if(r.length===0)return re.__oneDigit(1,!1);if(e.length===0)return e;if(e.length===1&&e.__digit(0)===1)return e.sign&&(1&r.__digit(0))==0?re.unaryMinus(e):e;if(1<r.length)throw new RangeError("BigInt too big");let n=r.__unsignedDigit(0);if(n===1)return e;if(n>=re.__kMaxLengthBits)throw new RangeError("BigInt too big");if(e.length===1&&e.__digit(0)===2){const a=1+(0|n/30),o=e.sign&&(1&n)!=0,c=new re(a,o);c.__initializeDigits();const l=1<<n%30;return c.__setDigit(a-1,l),c}let i=null,s=e;for((1&n)!=0&&(i=e),n>>=1;n!==0;n>>=1)s=re.multiply(s,s),(1&n)!=0&&(i===null?i=s:i=re.multiply(i,s));return i}static multiply(e,r){if(e.length===0)return e;if(r.length===0)return r;let n=e.length+r.length;30<=e.__clzmsd()+r.__clzmsd()&&n--;const i=new re(n,e.sign!==r.sign);i.__initializeDigits();for(let s=0;s<e.length;s++)re.__multiplyAccumulate(r,e.__digit(s),i,s);return i.__trim()}static divide(e,r){if(r.length===0)throw new RangeError("Division by zero");if(0>re.__absoluteCompare(e,r))return re.__zero();const n=e.sign!==r.sign,i=r.__unsignedDigit(0);let s;if(r.length===1&&32767>=i){if(i===1)return n===e.sign?e:re.unaryMinus(e);s=re.__absoluteDivSmall(e,i,null)}else s=re.__absoluteDivLarge(e,r,!0,!1);return s.sign=n,s.__trim()}static remainder(e,r){if(r.length===0)throw new RangeError("Division by zero");if(0>re.__absoluteCompare(e,r))return e;const n=r.__unsignedDigit(0);if(r.length===1&&32767>=n){if(n===1)return re.__zero();const s=re.__absoluteModSmall(e,n);return s===0?re.__zero():re.__oneDigit(s,e.sign)}const i=re.__absoluteDivLarge(e,r,!1,!0);return i.sign=e.sign,i.__trim()}static add(e,r){const n=e.sign;return n===r.sign?re.__absoluteAdd(e,r,n):0<=re.__absoluteCompare(e,r)?re.__absoluteSub(e,r,n):re.__absoluteSub(r,e,!n)}static subtract(e,r){const n=e.sign;return n===r.sign?0<=re.__absoluteCompare(e,r)?re.__absoluteSub(e,r,n):re.__absoluteSub(r,e,!n):re.__absoluteAdd(e,r,n)}static leftShift(e,r){return r.length===0||e.length===0?e:r.sign?re.__rightShiftByAbsolute(e,r):re.__leftShiftByAbsolute(e,r)}static signedRightShift(e,r){return r.length===0||e.length===0?e:r.sign?re.__leftShiftByAbsolute(e,r):re.__rightShiftByAbsolute(e,r)}static unsignedRightShift(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}static lessThan(e,r){return 0>re.__compareToBigInt(e,r)}static lessThanOrEqual(e,r){return 0>=re.__compareToBigInt(e,r)}static greaterThan(e,r){return 0<re.__compareToBigInt(e,r)}static greaterThanOrEqual(e,r){return 0<=re.__compareToBigInt(e,r)}static equal(e,r){if(e.sign!==r.sign||e.length!==r.length)return!1;for(let n=0;n<e.length;n++)if(e.__digit(n)!==r.__digit(n))return!1;return!0}static notEqual(e,r){return!re.equal(e,r)}static bitwiseAnd(e,r){var n=Math.max;if(!e.sign&&!r.sign)return re.__absoluteAnd(e,r).__trim();if(e.sign&&r.sign){const i=n(e.length,r.length)+1;let s=re.__absoluteSubOne(e,i);const a=re.__absoluteSubOne(r);return s=re.__absoluteOr(s,a,s),re.__absoluteAddOne(s,!0,s).__trim()}return e.sign&&([e,r]=[r,e]),re.__absoluteAndNot(e,re.__absoluteSubOne(r)).__trim()}static bitwiseXor(e,r){var n=Math.max;if(!e.sign&&!r.sign)return re.__absoluteXor(e,r).__trim();if(e.sign&&r.sign){const a=n(e.length,r.length),o=re.__absoluteSubOne(e,a),c=re.__absoluteSubOne(r);return re.__absoluteXor(o,c,o).__trim()}const i=n(e.length,r.length)+1;e.sign&&([e,r]=[r,e]);let s=re.__absoluteSubOne(r,i);return s=re.__absoluteXor(s,e,s),re.__absoluteAddOne(s,!0,s).__trim()}static bitwiseOr(e,r){var n=Math.max;const i=n(e.length,r.length);if(!e.sign&&!r.sign)return re.__absoluteOr(e,r).__trim();if(e.sign&&r.sign){let a=re.__absoluteSubOne(e,i);const o=re.__absoluteSubOne(r);return a=re.__absoluteAnd(a,o,a),re.__absoluteAddOne(a,!0,a).__trim()}e.sign&&([e,r]=[r,e]);let s=re.__absoluteSubOne(r,i);return s=re.__absoluteAndNot(s,e,s),re.__absoluteAddOne(s,!0,s).__trim()}static asIntN(e,r){var n=Math.floor;if(r.length===0)return r;if(e=n(e),0>
83e)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(e===0)return re.__zero();if(e>=re.__kMaxLengthBits)return r;const i=0|(e+29)/30;if(r.length<i)return r;const s=r.__unsignedDigit(i-1),a=1<<(e-1)%30;if(r.length===i&&s<a)return r;if((s&a)!==a)return re.__truncateToNBits(e,r);if(!r.sign)return re.__truncateAndSubFromPowerOfTwo(e,r,!0);if((s&a-1)==0){for(let o=i-2;0<=o;o--)if(r.__digit(o)!==0)return re.__truncateAndSubFromPowerOfTwo(e,r,!1);return r.length===i&&s===a?r:re.__truncateToNBits(e,r)}return re.__truncateAndSubFromPowerOfTwo(e,r,!1)}static asUintN(e,r){var n=Math.floor;if(r.length===0)return r;if(e=n(e),0>e)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(e===0)return re.__zero();if(r.sign){if(e>re.__kMaxLengthBits)throw new RangeError("BigInt too big");return re.__truncateAndSubFromPowerOfTwo(e,r,!1)}if(e>=re.__kMaxLengthBits)return r;const i=0|(e+29)/30;if(r.length<i)return r;const s=e%30;return r.length==i&&(s===0||!(r.__digit(i-1)>>>s))?r:re.__truncateToNBits(e,r)}static ADD(e,r){if(e=re.__toPrimitive(e),r=re.__toPrimitive(r),typeof e=="string")return typeof r!="string"&&(r=r.toString()),e+r;if(typeof r=="string")return e.toString()+r;if(e=re.__toNumeric(e),r=re.__toNumeric(r),re.__isBigInt(e)&&re.__isBigInt(r))return re.add(e,r);if(typeof e=="number"&&typeof r=="number")return e+r;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}static LT(e,r){return re.__compare(e,r,0)}static LE(e,r){return re.__compare(e,r,1)}static GT(e,r){return re.__compare(e,r,2)}static GE(e,r){return re.__compare(e,r,3)}static EQ(e,r){for(;;){if(re.__isBigInt(e))return re.__isBigInt(r)?re.equal(e,r):re.EQ(r,e);if(typeof e=="number"){if(re.__isBigInt(r))return re.__equalToNumber(r,e);if(typeof r!="object")return e==r;r=re.__toPrimitive(r)}else if(typeof e=="string"){if(re.__isBigInt(r))return e=re.__fromString(e),e!==null&&re.equal(e,r);if(typeof r!="object")return e==r;r=re.__toPrimitive(r)}else if(typeof e=="boolean"){if(re.__isBigInt(r))return re.__equalToNumber(r,+e);if(typeof r!="object")return e==r;r=re.__toPrimitive(r)}else if(typeof e=="symbol"){if(re.__isBigInt(r))return!1;if(typeof r!="object")return e==r;r=re.__toPrimitive(r)}else if(typeof e=="object"){if(typeof r=="object"&&r.constructor!==re)return e==r;e=re.__toPrimitive(e)}else return e==r}}static NE(e,r){return!re.EQ(e,r)}static DataViewGetBigInt64(e,r,n=!1){return re.asIntN(64,re.DataViewGetBigUint64(e,r,n))}static DataViewGetBigUint64(e,r,n=!1){const[i,s]=n?[4,0]:[0,4],a=e.getUint32(r+i,n),o=e.getUint32(r+s,n),c=new re(3,!1);return c.__setDigit(0,1073741823&o),c.__setDigit(1,(268435455&a)<<2|o>>>30),c.__setDigit(2,a>>>28),c.__trim()}static DataViewSetBigInt64(e,r,n,i=!1){re.DataViewSetBigUint64(e,r,n,i)}static DataViewSetBigUint64(e,r,n,i=!1){n=re.asUintN(64,n);let s=0,a=0;if(0<n.length&&(a=n.__digit(0),1<n.length)){const l=n.__digit(1);a|=l<<30,s=l>>>2,2<n.length&&(s|=n.__digit(2)<<28)}const[o,c]=i?[4,0]:[0,4];e.setUint32(r+o,s,i),e.setUint32(r+c,a,i)}static __zero(){return new re(0,!1)}static __oneDigit(e,r){const n=new re(1,r);return n.__setDigit(0,e),n}__copy(){const e=new re(this.length,this.sign);for(let r=0;r<this.length;r++)e[r]=this[r];return e}__trim(){let e=this.length,r=this[e-1];for(;r===0;)e--,r=this[e-1],this.pop();return e===0&&(this.sign=!1),this}__initializeDigits(){for(let e=0;e<this.length;e++)this[e]=0}static __decideRounding(e,r,n,i){if(0<r)return-1;let s;if(0>r)s=-r-1;else{if(n===0)return-1;n--,i=e.__digit(n),s=29}let a=1<<s;if((i&a)==0)return-1;if(a-=1,(i&a)!=0)return 1;for(;0<n;)if(n--,e.__digit(n)!==0)return 1;return 0}static __fromDouble(e){re.__kBitConversionDouble[0]=e;const r=2047&re.__kBitConversionInts[re.__kBitConversionIntHigh]>>>20,n=r-1023,i=(0|n/30)+1,s=new re(i,0>e);let a=1048575&re.__kBitConversionInts[re.__kBitConversionIntHigh]|1048576,o=re.__kBitConversionInts[re.__kBitConversionIntLow];const c=20,l=n%30;let u,d=0;if(l<20){const f=c-l;d=f+32,u=a>>>f,a=a<<32-f|o>>>f,o<<=32-f}else if(l===20)d=32,u=a,a=o,o=0;else{const f=l-c;d=32-f,u=a<<f|o>>>32-f,a=o<<f,o=0}s.__setDigit(i-1,u);for(let f=i-2;0<=f;f--)0<d?(d-=30,u=a>>>2,a=a<<30|o>>>2,o<<=30):u=0,s.__setDigit(f,u);return s.__trim()}static __isWhitespace(e){return 13>=e&&9<=e||(159>=e?e==32:131071>=e?e==160||e==5760:196607>=e?(e&=131071,10>=e||e==40||e==41||e==47||e==95||e==4096):e==65279)}static __fromString(e,r=0){let n=0;const i=e.length;let s=0;if(s===i)return re.__zero();let a=e.charCodeAt(s);for(;re.__isWhitespace(a);){if(++s===i)return re.__zero();a=e.charCodeAt(s)}if(a===43){if(++s===i)return null;a=e.charCodeAt(s),n=1}else if(a===45){if(++s===i)return null;a=e.charCodeAt(s),n=-1}if(r===0){if(r=10,a===48){if(++s===i)return re.__zero();if(a=e.charCodeAt(s),a===88||a===120){if(r=16,++s===i)return null;a=e.charCodeAt(s)}else if(a===79||a===111){if(r=8,++s===i)return null;a=e.charCodeAt(s)}else if(a===66||a===98){if(r=2,++s===i)return null;a=e.charCodeAt(s)}}}else if(r===16&&a===48){if(++s===i)return re.__zero();if(a=e.charCodeAt(s),a===88||a===120){if(++s===i)return null;a=e.charCodeAt(s)}}if(n!=0&&r!==10)return null;for(;a===48;){if(++s===i)return re.__zero();a=e.charCodeAt(s)}const o=i-s;let c=re.__kMaxBitsPerChar[r],l=re.__kBitsPerCharTableMultiplier-1;if(o>1073741824/c)return null;const u=c*o+l>>>re.__kBitsPerCharTableShift,d=new re(0|(u+29)/30,!1),f=10>r?r:10,h=10<r?r-10:0;if((r&r-1)==0){c>>=re.__kBitsPerCharTableShift;const g=[],m=[];let y=!1;do{let b=0,E=0;for(;;){let v;if(a-48>>>0<f)v=a-48;else if((32|a)-97>>>0<h)v=(32|a)-87;else{y=!0;break}if(E+=c,b=b<<c|v,++s===i){y=!0;break}if(a=e.charCodeAt(s),30<E+c)break}g.push(b),m.push(E)}while(!y);re.__fillFromParts(d,g,m)}else{d.__initializeDigits();let g=!1,m=0;do{let y=0,b=1;for(;;){let v;if(a-48>>>0<f)v=a-48;else if((32|a)-97>>>0<h)v=(32|a)-87;else{g=!0;break}const w=b*r;if(1073741823<w)break;if(b=w,y=y*r+v,m++,++s===i){g=!0;break}a=e.charCodeAt(s)}l=30*re.__kBitsPerCharTableMultiplier-1;const E=0|(c*m+l>>>re.__kBitsPerCharTableShift)/30;d.__inplaceMultiplyAdd(b,y,E)}while(!g)}if(s!==i){if(!re.__isWhitespace(a))return null;for(s++;s<i;
83s++)if(a=e.charCodeAt(s),!re.__isWhitespace(a))return null}return d.sign=n==-1,d.__trim()}static __fillFromParts(e,r,n){let i=0,s=0,a=0;for(let o=r.length-1;0<=o;o--){const c=r[o],l=n[o];s|=c<<a,a+=l,a===30?(e.__setDigit(i++,s),a=0,s=0):30<a&&(e.__setDigit(i++,1073741823&s),a-=30,s=c>>>l-a)}if(s!==0){if(i>=e.length)throw new Error("implementation bug");e.__setDigit(i++,s)}for(;i<e.length;i++)e.__setDigit(i,0)}static __toStringBasePowerOfTwo(e,r){const n=e.length;let i=r-1;i=(85&i>>>1)+(85&i),i=(51&i>>>2)+(51&i),i=(15&i>>>4)+(15&i);const s=i,a=r-1,o=e.__digit(n-1),c=re.__clz30(o);let l=0|(30*n-c+s-1)/s;if(e.sign&&l++,268435456<l)throw new Error("string too long");const u=Array(l);let d=l-1,f=0,h=0;for(let m=0;m<n-1;m++){const y=e.__digit(m),b=(f|y<<h)&a;u[d--]=re.__kConversionChars[b];const E=s-h;for(f=y>>>E,h=30-E;h>=s;)u[d--]=re.__kConversionChars[f&a],f>>>=s,h-=s}const g=(f|o<<h)&a;for(u[d--]=re.__kConversionChars[g],f=o>>>s-h;f!==0;)u[d--]=re.__kConversionChars[f&a],f>>>=s;if(e.sign&&(u[d--]="-"),d!=-1)throw new Error("implementation bug");return u.join("")}static __toStringGeneric(e,r,n){const i=e.length;if(i===0)return"";if(i===1){let m=e.__unsignedDigit(0).toString(r);return n===!1&&e.sign&&(m="-"+m),m}const s=30*i-re.__clz30(e.__digit(i-1)),a=re.__kMaxBitsPerChar[r],o=a-1;let c=s*re.__kBitsPerCharTableMultiplier;c+=o-1,c=0|c/o;const l=c+1>>1,u=re.exponentiate(re.__oneDigit(r,!1),re.__oneDigit(l,!1));let d,f;const h=u.__unsignedDigit(0);if(u.length===1&&32767>=h){d=new re(e.length,!1),d.__initializeDigits();let m=0;for(let y=2*e.length-1;0<=y;y--){const b=m<<15|e.__halfDigit(y);d.__setHalfDigit(y,0|b/h),m=0|b%h}f=m.toString(r)}else{const m=re.__absoluteDivLarge(e,u,!0,!0);d=m.quotient;const y=m.remainder.__trim();f=re.__toStringGeneric(y,r,!0)}d.__trim();let g=re.__toStringGeneric(d,r,!0);for(;f.length<l;)f="0"+f;return n===!1&&e.sign&&(g="-"+g),g+f}static __unequalSign(e){return e?-1:1}static __absoluteGreater(e){return e?-1:1}static __absoluteLess(e){return e?1:-1}static __compareToBigInt(e,r){const n=e.sign;if(n!==r.sign)return re.__unequalSign(n);const i=re.__absoluteCompare(e,r);return 0<i?re.__absoluteGreater(n):0>i?re.__absoluteLess(n):0}static __compareToNumber(e,r){if(re.__isOneDigitInt(r)){const n=e.sign,i=0>r;if(n!==i)return re.__unequalSign(n);if(e.length===0){if(i)throw new Error("implementation bug");return r===0?0:-1}if(1<e.length)return re.__absoluteGreater(n);const s=Math.abs(r),a=e.__unsignedDigit(0);return a>s?re.__absoluteGreater(n):a<s?re.__absoluteLess(n):0}return re.__compareToDouble(e,r)}static __compareToDouble(e,r){if(r!==r)return r;if(r===1/0)return-1;if(r===-1/0)return 1;const n=e.sign;if(n!==0>r)return re.__unequalSign(n);if(r===0)throw new Error("implementation bug: should be handled elsewhere");if(e.length===0)return-1;re.__kBitConversionDouble[0]=r;const i=2047&re.__kBitConversionInts[re.__kBitConversionIntHigh]>>>20;if(i==2047)throw new Error("implementation bug: handled elsewhere");const s=i-1023;if(0>s)return re.__absoluteGreater(n);const a=e.length;let o=e.__digit(a-1);const c=re.__clz30(o),l=30*a-c,u=s+1;if(l<u)return re.__absoluteLess(n);if(l>u)return re.__absoluteGreater(n);let d=1048576|1048575&re.__kBitConversionInts[re.__kBitConversionIntHigh],f=re.__kBitConversionInts[re.__kBitConversionIntLow];const h=20,g=29-c;if(g!==(0|(l-1)%30))throw new Error("implementation bug");let m,y=0;if(20>g){const b=h-g;y=b+32,m=d>>>b,d=d<<32-b|f>>>b,f<<=32-b}else if(g===20)y=32,m=d,d=f,f=0;else{const b=g-h;y=32-b,m=d<<b|f>>>32-b,d=f<<b,f=0}if(o>>>=0,m>>>=0,o>m)return re.__absoluteGreater(n);if(o<m)return re.__absoluteLess(n);for(let b=a-2;0<=b;b--){0<y?(y-=30,m=d>>>2,d=d<<30|f>>>2,f<<=30):m=0;const E=e.__unsignedDigit(b);if(E>m)return re.__absoluteGreater(n);if(E<m)return re.__absoluteLess(n)}if(d!==0||f!==0){if(y===0)throw new Error("implementation bug");return re.__absoluteLess(n)}return 0}static __equalToNumber(e,r){var n=Math.abs;return re.__isOneDigitInt(r)?r===0?e.length===0:e.length===1&&e.sign===0>r&&e.__unsignedDigit(0)===n(r):re.__compareToDouble(e,r)===0}static __comparisonResultToBool(e,r){return r===0?0>e:r===1?0>=e:r===2?0<e:r===3?0<=e:void 0}static __compare(e,r,n){if(e=re.__toPrimitive(e),r=re.__toPrimitive(r),typeof e=="string"&&typeof r=="string")switch(n){case 0:return e<r;case 1:return e<=r;case 2:return e>r;case 3:return e>=r}if(re.__isBigInt(e)&&typeof r=="string")return r=re.__fromString(r),r!==null&&re.__comparisonResultToBool(re.__compareToBigInt(e,r),n);if(typeof e=="string"&&re.__isBigInt(r))return e=re.__fromString(e),e!==null&&re.__comparisonResultToBool(re.__compareToBigInt(e,r),n);if(e=re.__toNumeric(e),r=re.__toNumeric(r),re.__isBigInt(e)){if(re.__isBigInt(r))return re.__comparisonResultToBool(re.__compareToBigInt(e,r),n);if(typeof r!="number")throw new Error("implementation bug");return re.__comparisonResultToBool(re.__compareToNumber(e,r),n)}if(typeof e!="number")throw new Error("implementation bug");if(re.__isBigInt(r))return re.__comparisonResultToBool(re.__compareToNumber(r,e),2^n);if(typeof r!="number")throw new Error("implementation bug");return n===0?e<r:n===1?e<=r:n===2?e>r:n===3?e>=r:void 0}__clzmsd(){return re.__clz30(this.__digit(this.length-1))}static __absoluteAdd(e,r,n){if(e.length<r.length)return re.__absoluteAdd(r,e,n);if(e.length===0)return e;if(r.length===0)return e.sign===n?e:re.unaryMinus(e);let i=e.length;(e.__clzmsd()===0||r.length===e.length&&r.__clzmsd()===0)&&i++;const s=new re(i,n);let a=0,o=0;for(;o<r.length;o++){const c=e.__digit(o)+r.__digit(o)+a;a=c>>>30,s.__setDigit(o,1073741823&c)}for(;o<e.length;o++){const c=e.__digit(o)+a;a=c>>>30,s.__setDigit(o,1073741823&c)}return o<s.length&&s.__setDigit(o,a),s.__trim()}static __absoluteSub(e,r,n){if(e.length===0)return e;if(r.length===0)return e.sign===n?e:re.unaryMinus(e);const i=new re(e.length,n);let s=0,a=0;for(;a<r.length;a++){const o=e.__digit(a)-r.__digit(a)-s;s=1&o>>>30,i.__setDigit(a,1073741823&o)}for(;a<e.length;a++){const o=e.__digit(a)-s;s=1&o>>>30,i.__setDigit(a,1073741823&o)}return i.__trim()}static __absoluteAddOne(e,r,n=null){const i=e.length;n===null?n=new re(i,r):n.sign=r;let s=1;for(let a=0;a<i;a++){const o=e.__digit(a)+s;s=o>>>30,n.__setDigit(a,1073741823&o)}return s!=0&&n.__setDigitGrow(i,1),n}static __absoluteSubOne(e,r){const n=e.length;r=r||n;const i=new re(r,!1);let s=1;for(let a=0;a<n;a++){const o=e.__digit(a)-s;s=1&o>>>30,i.__setDigit(a,1073741823&o)}if(s!=0)throw new Error("implementation bug");for(let a=n;a<r;a++)i.__setDigit(a,0);return i}static __absoluteAnd(e,r,n=null){let i=e.length,s=r.length,a=s;if(i<s){a=i;const l=e,u=i;e=r,i=s,r=l,s=u}let o=a;n===null?n=new re(o,!1):o=n.length;let c=0;for(;c<a;c++)n.__setDigit(c,e.__digit(c)&r.__digit(c));for(;c<o;c++)n.__setDigit(c,0);return n}static __absoluteAndNot(e,r,n=null){const i=e.length,s=r.length;let a=s;i<s&&(a=i);let o=i;n===null?n=new re(o,!1):o=n.length;let c=0;for(;c<a;c++)n.__setDigit(c,e.__digit(c)&~r.__digit(c));for(;c<i;c++)n.__setDigit(c,e.__digit(c));for(;c<o;c++)n.__setDigit(c,0);return n}static __absoluteOr(e,r,n=null){let i=e.length,s=r.length,a=s;if(i<s){a=i;const l=e,u=i;e=r,i=s,r=l,s=u}let o=i;n===null?n=new re(o,!1):o=n.length;let c=0;for(;c<a;c++)n.__setDigit(c,e.__digit(c)|r.__digit(c));for(;c<i;c++)n.__setDigit(c,e.__digit(c));for(;c<o;c++)n.__setDigit(c,0);return n}static __absoluteXor(e,r,n=null){let i=e.length,s=r.length,a=s;if(i<s){a=i;const l=e,u=i;e=r,i=s,r=l,s=u}let o=i;n===null?n=new re(o,!1):o=n.length;let c=0;for(;c<a;c++)n.__setDigit(c,e.__digit(c)^r.__digit(c));for(;c<i;c++)n.__setDigit(c,e.__digit(c));for(;c<o;c++)n.__setDigit(c,0);return n}static __absoluteCompare(e,r){const n=e.length-r.length;if(n!=0)return n;let i=e.length-1;for(;0<=i&&e.__digit(i)===r.__digit(i);)i--;return 0>i?0:e.__unsignedDigit(i)>r.__unsignedDigit(i)?1:-1}static __multiplyAccumulate(e,r,n,i){if(r===0)return;const s=32767&r,a=r>>>15;let o=0,c=0;for(let l,u=0;u<e.length;u++,i++){l=n.__digit(i);const d=e.__digit(u),f=32767&d,h=d>>>15,g=re.__imul(f,s),m=re.__imul(f,a),y=re.__imul(h,s),b=re.__imul(h,a);l+=c+g+o,o=l>>>
8330,l&=1073741823,l+=((32767&m)<<15)+((32767&y)<<15),o+=l>>>30,c=b+(m>>>15)+(y>>>15),n.__setDigit(i,1073741823&l)}for(;o!=0||c!==0;i++){let l=n.__digit(i);l+=o+c,c=0,o=l>>>30,n.__setDigit(i,1073741823&l)}}static __internalMultiplyAdd(e,r,n,i,s){let a=n,o=0;for(let c=0;c<i;c++){const l=e.__digit(c),u=re.__imul(32767&l,r),d=re.__imul(l>>>15,r),f=u+((32767&d)<<15)+o+a;a=f>>>30,o=d>>>15,s.__setDigit(c,1073741823&f)}if(s.length>i)for(s.__setDigit(i++,a+o);i<s.length;)s.__setDigit(i++,0);else if(a+o!==0)throw new Error("implementation bug")}__inplaceMultiplyAdd(e,r,n){n>this.length&&(n=this.length);const i=32767&e,s=e>>>15;let a=0,o=r;for(let c=0;c<n;c++){const l=this.__digit(c),u=32767&l,d=l>>>15,f=re.__imul(u,i),h=re.__imul(u,s),g=re.__imul(d,i),m=re.__imul(d,s);let y=o+f+a;a=y>>>30,y&=1073741823,y+=((32767&h)<<15)+((32767&g)<<15),a+=y>>>30,o=m+(h>>>15)+(g>>>15),this.__setDigit(c,1073741823&y)}if(a!=0||o!==0)throw new Error("implementation bug")}static __absoluteDivSmall(e,r,n=null){n===null&&(n=new re(e.length,!1));let i=0;for(let s,a=2*e.length-1;0<=a;a-=2){s=(i<<15|e.__halfDigit(a))>>>0;const o=0|s/r;i=0|s%r,s=(i<<15|e.__halfDigit(a-1))>>>0;const c=0|s/r;i=0|s%r,n.__setDigit(a>>>1,o<<15|c)}return n}static __absoluteModSmall(e,r){let n=0;for(let i=2*e.length-1;0<=i;i--)n=0|((n<<15|e.__halfDigit(i))>>>0)%r;return n}static __absoluteDivLarge(e,r,n,i){const s=r.__halfDigitLength(),a=r.length,o=e.__halfDigitLength()-s;let c=null;n&&(c=new re(o+2>>>1,!1),c.__initializeDigits());const l=new re(s+2>>>1,!1);l.__initializeDigits();const u=re.__clz15(r.__halfDigit(s-1));0<u&&(r=re.__specialLeftShift(r,u,0));const d=re.__specialLeftShift(e,u,1),f=r.__halfDigit(s-1);let h=0;for(let g,m=o;0<=m;m--){g=32767;const y=d.__halfDigit(m+s);if(y!==f){const E=(y<<15|d.__halfDigit(m+s-1))>>>0;g=0|E/f;let v=0|E%f;const w=r.__halfDigit(s-2),x=d.__halfDigit(m+s-2);for(;re.__imul(g,w)>>>0>(v<<16|x)>>>0&&(g--,v+=f,!(32767<v)););}re.__internalMultiplyAdd(r,g,0,a,l);let b=d.__inplaceSub(l,m,s+1);b!==0&&(b=d.__inplaceAdd(r,m,s),d.__setHalfDigit(m+s,32767&d.__halfDigit(m+s)+b),g--),n&&(1&m?h=g<<15:c.__setDigit(m>>>1,h|g))}if(i)return d.__inplaceRightShift(u),n?{quotient:c,remainder:d}:d;if(n)return c;throw new Error("unreachable")}static __clz15(e){return re.__clz30(e)-15}__inplaceAdd(e,r,n){let i=0;for(let s=0;s<n;s++){const a=this.__halfDigit(r+s)+e.__halfDigit(s)+i;i=a>>>15,this.__setHalfDigit(r+s,32767&a)}return i}__inplaceSub(e,r,n){let i=0;if(1&r){r>>=1;let s=this.__digit(r),a=32767&s,o=0;for(;o<n-1>>>1;o++){const u=e.__digit(o),d=(s>>>15)-(32767&u)-i;i=1&d>>>15,this.__setDigit(r+o,(32767&d)<<15|32767&a),s=this.__digit(r+o+1),a=(32767&s)-(u>>>15)-i,i=1&a>>>15}const c=e.__digit(o),l=(s>>>15)-(32767&c)-i;if(i=1&l>>>15,this.__setDigit(r+o,(32767&l)<<15|32767&a),r+o+1>=this.length)throw new RangeError("out of bounds");(1&n)==0&&(s=this.__digit(r+o+1),a=(32767&s)-(c>>>15)-i,i=1&a>>>15,this.__setDigit(r+e.length,1073709056&s|32767&a))}else{r>>=1;let s=0;for(;s<e.length-1;s++){const u=this.__digit(r+s),d=e.__digit(s),f=(32767&u)-(32767&d)-i;i=1&f>>>15;const h=(u>>>15)-(d>>>15)-i;i=1&h>>>15,this.__setDigit(r+s,(32767&h)<<15|32767&f)}const a=this.__digit(r+s),o=e.__digit(s),c=(32767&a)-(32767&o)-i;i=1&c>>>15;let l=0;(1&n)==0&&(l=(a>>>15)-(o>>>15)-i,i=1&l>>>15),this.__setDigit(r+s,(32767&l)<<15|32767&c)}return i}__inplaceRightShift(e){if(e===0)return;let r=this.__digit(0)>>>e;const n=this.length-1;for(let i=0;i<n;i++){const s=this.__digit(i+1);this.__setDigit(i,1073741823&s<<30-e|r),r=s>>>e}this.__setDigit(n,r)}static __specialLeftShift(e,r,n){const i=e.length,s=new re(i+n,!1);if(r===0){for(let o=0;o<i;o++)s.__setDigit(o,e.__digit(o));return 0<n&&s.__setDigit(i,0),s}let a=0;for(let o=0;o<i;o++){const c=e.__digit(o);s.__setDigit(o,1073741823&c<<r|a),a=c>>>30-r}return 0<n&&s.__setDigit(i,a),s}static __leftShiftByAbsolute(e,r){const n=re.__toShiftAmount(r);if(0>n)throw new RangeError("BigInt too big");const i=0|n/30,s=n%30,a=e.length,o=s!==0&&e.__digit(a-1)>>>30-s!=0,c=a+i+(o?1:0),l=new re(c,e.sign);if(s===0){let u=0;for(;u<i;u++)l.__setDigit(u,0);for(;u<c;u++)l.__setDigit(u,e.__digit(u-i))}else{let u=0;for(let d=0;d<i;d++)l.__setDigit(d,0);for(let d=0;d<a;d++){const f=e.__digit(d);l.__setDigit(d+i,1073741823&f<<s|u),u=f>>>30-s}if(o)l.__setDigit(a+i,u);else if(u!==0)throw new Error("implementation bug")}return l.__trim()}static __rightShiftByAbsolute(e,r){const n=e.length,i=e.sign,s=re.__toShiftAmount(r);if(0>s)return re.__rightShiftByMaximum(i);const a=0|s/30,o=s%30;let c=n-a;if(0>=c)return re.__rightShiftByMaximum(i);let l=!1;if(i){if((e.__digit(a)&(1<<o)-1)!=0)l=!0;else for(let d=0;d<a;d++)if(e.__digit(d)!==0){l=!0;break}}l&&o===0&&~e.__digit(n-1)==0&&c++;let u=new re(c,i);if(o===0){u.__setDigit(c-1,0);for(let d=a;d<n;d++)u.__setDigit(d-a,e.__digit(d))}else{let d=e.__digit(a)>>>o;const f=n-a-1;for(let h=0;h<f;h++){const g=e.__digit(h+a+1);u.__setDigit(h,1073741823&g<<30-o|d),d=g>>
83>o}u.__setDigit(f,d)}return l&&(u=re.__absoluteAddOne(u,!0,u)),u.__trim()}static __rightShiftByMaximum(e){return e?re.__oneDigit(1,!0):re.__zero()}static __toShiftAmount(e){if(1<e.length)return-1;const r=e.__unsignedDigit(0);return r>re.__kMaxLengthBits?-1:r}static __toPrimitive(e,r="default"){if(typeof e!="object"||e.constructor===re)return e;if(typeof Symbol<"u"&&typeof Symbol.toPrimitive=="symbol"&&e[Symbol.toPrimitive]){const s=e[Symbol.toPrimitive](r);if(typeof s!="object")return s;throw new TypeError("Cannot convert object to primitive value")}const n=e.valueOf;if(n){const s=n.call(e);if(typeof s!="object")return s}const i=e.toString;if(i){const s=i.call(e);if(typeof s!="object")return s}throw new TypeError("Cannot convert object to primitive value")}static __toNumeric(e){return re.__isBigInt(e)?e:+e}static __isBigInt(e){return typeof e=="object"&&e!==null&&e.constructor===re}static __truncateToNBits(e,r){const n=0|(e+29)/30,i=new re(n,r.sign),s=n-1;for(let o=0;o<s;o++)i.__setDigit(o,r.__digit(o));let a=r.__digit(s);if(e%30!=0){const o=32-e%30;a=a<<o>>>o}return i.__setDigit(s,a),i.__trim()}static __truncateAndSubFromPowerOfTwo(e,r,n){var i=Math.min;const s=0|(e+29)/30,a=new re(s,n);let o=0;const c=s-1;let l=0;for(const h=i(c,r.length);o<h;o++){const g=0-r.__digit(o)-l;l=1&g>>>30,a.__setDigit(o,1073741823&g)}for(;o<c;o++)a.__setDigit(o,0|1073741823&-l);let u=c<r.length?r.__digit(c):0;const d=e%30;let f;if(d==0)f=0-u-l,f&=1073741823;else{const h=32-d;u=u<<h>>>h;const g=1<<32-h;f=g-u-l,f&=g-1}return a.__setDigit(c,f),a.__trim()}__digit(e){return this[e]}__unsignedDigit(e){return this[e]>>>0}__setDigit(e,r){this[e]=0|r}__setDigitGrow(e,r){this[e]=0|r}__halfDigitLength(){const e=this.length;return 32767>=this.__unsignedDigit(e-1)?2*e-1:2*e}__halfDigit(e){return 32767&this[e>>>1]>>>15*(1&e)}__setHalfDigit(e,r){const n=e>>>1,i=this.__digit(n),s=1&e?32767&i|r<<15:1073709056&i|32767&r;this.__setDigit(n,s)}static __digitPow(e,r){let n=1;for(;0<r;)1&r&&(n*=e),r>>>=1,e*=e;return n}static __detectBigEndian(){return re.__kBitConversionDouble[0]=-0,re.__kBitConversionInts[0]!==0}static __isOneDigitInt(e){return(1073741823&e)===e}}re.__kMaxLength=33554432,re.__kMaxLengthBits=re.__kMaxLength<<5,re.__kMaxBitsPerChar=[0,0,32,51,64,75,83,90,96,102,107,111,115,119,122,126,128,131,134,136,139,141,143,145,147,149,151,153,154,156,158,159,160,162,163,165,166],re.__kBitsPerCharTableShift=5,re.__kBitsPerCharTableMultiplier=1<<re.__kBitsPerCharTableShift,re.__kConversionChars=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],re.__kBitConversionBuffer=new ArrayBuffer(8),re.__kBitConversionDouble=new Float64Array(re.__kBitConversionBuffer),re.__kBitConversionInts=new Int32Array(re.__kBitConversionBuffer),re.__kBitConversionIntHigh=re.__detectBigEndian()?0:1,re.__kBitConversionIntLow=re.__detectBigEndian()?1:0,re.__clz30=Math.clz32?function(t){return Math.clz32(t)-2}:function(t){return t===0?30:0|29-(0|Math.log(t>>>0)/Math.LN2)},re.__imul=Math.imul||function(t,e){return 0|t*e};var dl=(t=>(t[t.ROUND_DOWN=0]="ROUND_DOWN",t[t.ROUND_HALF_UP=1]="ROUND_HALF_UP",t[t.ROUND_UP=2]="ROUND_UP",t))(dl||{});re.BigInt(1e3);const Yde=re.BigInt(0),Zde=re.BigInt(1);re.BigInt(2);re.BigInt(3);re.BigInt(5);re.BigInt(10);const Xde=re.BigInt(100);re.BigInt(997);re.BigInt(1e3);re.BigInt(1e4);re.BigInt(1e4);var lz=(t=>(t.uint8="uint8",t.uint256="uint256",t))(lz||{});const Jde={uint8:re.BigInt("0xff"),uint256:re.BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")};function efe(t,e){qh(re.greaterThanOrEqual(t,Yde)),qh(re.lessThanOrEqual(t,Jde[e]))}function Ac(t){return t instanceof re?t:typeof t=="bigint"?re.BigInt(t.toString()):re.BigInt(t)}const Dw=class Dw{constructor(e,r,n,i){Gt(this,"decimals");Gt(this,"symbol");Gt(this,"name");Gt(this,"icon");efe(re.BigInt(e),lz.uint8),this.decimals=e,this.symbol=r,this.name=n,this.icon=i}};Gt(Dw,"ETHER",new Dw(18,"BNB","BNB"));let L$=Dw;var tfe=nne();const pS=Rl(tfe),C1=pS(ine),$6=pS(_B),rfe={[dl.ROUND_DOWN]:C1.ROUND_DOWN,[dl.ROUND_HALF_UP]:C1.ROUND_HALF_UP,[dl.ROUND_UP]:C1.ROUND_UP},nfe={[dl.ROUND_DOWN]:0,[dl.ROUND_HALF_UP]:1,[dl.ROUND_UP]:3};class mn{constructor(e,r=Zde){Gt(this,"numerator");Gt(this,"denominator");this.numerator=Ac(e),this.denominator=Ac(r)}get quotient(){return re.divide(this.numerator,this.denominator)}get remainder(){return new mn(re.remainder(this.numerator,this.denominator),this.denominator)}invert(){return new mn(this.denominator,this.numerator)}add(e){const r=e instanceof mn?e:new mn(Ac(e));return re.equal(this.denominator,r.denominator)?new mn(re.add(this.numerator,r.numerator),this.denominator):new mn(re.add(re.multiply(this.numerator,r.denominator),re.multiply(r.numerator,this.denominator)),re.multiply(this.denominator,r.denominator))}subtract(e){const r=e instanceof mn?e:new mn(Ac(e));return re.equal(this.denominator,r.denominator)?new mn(re.subtract(this.numerator,r.numerator),this.denominator):new mn(re.subtract(re.multiply(this.numerator,r.denominator),re.multiply(r.numerator,this.denominator)),re.multiply(this.denominator,r.denominator))}lessThan(e){const r=e instanceof mn?e:new mn(Ac(e));return re.lessThan(re.multiply(this.numerator,r.denominator),re.multiply(r.numerator,this.denominator))}equalTo(e){const r=e instanceof mn?e:new mn(Ac(e));return re.equal(re.multiply(this.numerator,r.denominator),re.multiply(r.numerator,this.denominator))}greaterThan(e){const r=e instanceof mn?e:new mn(Ac(e));return re.greaterThan(re.multiply(this.numerator,r.denominator),re.multiply(r.numerator,this.denominator))}multiply(e){const r=e instanceof mn?e:new mn(Ac(e));return new mn(re.multiply(this.numerator,r.numerator),re.multiply(this.denominator,r.denominator))}divide(e){const r=e instanceof mn?e:new mn(Ac(e));return new mn(re.multiply(this.numerator,r.denominator),re.multiply(this.denominator,r.numerator))}toSignificant(e,r={groupSeparator:""},n=dl.ROUND_HALF_UP){qh(Number.isInteger(e)),qh(e>0),C1.set({precision:e+1,rounding:rfe[n]});const i=new C1(this.numerator.toString()).div(this.denominator.toString()).toSignificantDigits(e);return i.toFormat(i.decimalPlaces(),r)}toFixed(e,r={groupSeparator:""},n=dl.ROUND_HALF_UP){return qh(Number.isInteger(e)),qh(e>=0),$6.DP=e,$6.RM=nfe[n],new $6(this.numerator.toString()).div(this.denominator.toString()).toFormat(e,r)}}pS(_B);function F$(t){return"0x"+Ho.sha256().update(Sn(t)).digest("hex")}new mn(Xde);const ife={valid:!1,blockNumber:void 0,data:void 0};function sfe(t,e){const r=sd,n=g0(a=>a.multicall.callResults),i=Gf(),s=C.useMemo(()=>{var a,o;return JSON.stringify(((o=(a=t==null?void 0:t.filter(c=>!!c))==null?void 0:a.map(Vh))==null?void 0:o.sort())??[])},[t]);return C.useEffect(()=>{const a=JSON.parse(s);if(!r||a.length===0)return;const o=a.map(c=>aq(c));return i(oq({chainId:r,calls:o,options:e})),()=>{i(cq({chainId:r,calls:o,options:e}))}},[r,i,e,s]),C.useMemo(()=>t.map(a=>{var l;if(!r||!a)return ife;const o=(l=n[r])==null?void 0:l[Vh(a)];let c;return o!=null&&o.data&&(o==null?void 0:o.data)!=="0x"&&(c=o.data),{valid:!0,data:c,blockNumber:o==null?void 0:o.blockNumber,address:a.address}}),[n,t,r])}const U$={valid:!1,result:void 0,loading:!1,syncing:!1,error:!1},B$={valid:!0,result:void 0,loading:!0,syncing:!0,error:!1};function afe(t,e,r,n){if(!t)return U$;const{valid:i,data:s,blockNumber:a,address:o}=t;if(!i)return U$;if(i&&!a||!e||!r||!n)return B$;const c=s&&s.length>2,l=(a??0)<n;let u;if(c&&s)try{u=e.decodeFunctionResult(r,s)}catch{return console.debug("Result data parsing failed",r,s),{valid:!0,loading:!1,error:!0,syncing:l,result:u,pairAddress:o}}return{valid:!0,loading:!1,syncing:l,result:u,error:!c,pairAddress:o}}function ofe(t,e,r,n){const i=C.useMemo(()=>{var c;return(c=t==null?void 0:t.interface)==null?void 0:c.getFunction(e)},[t,e]),s=C.useMemo(()=>t&&i&&r&&r.length>0?r.map(c=>({address:t.address,callData:t.interface.encodeFunctionData(i,c)}
83)):[],[r,t,i]),a=sfe(s,n),o=az();return C.useMemo(()=>a.map(c=>afe(c,t==null?void 0:t.interface,i,o)),[i,t,a,o])}const cfe="0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",lfe={WETH:{icon:I6,name:"ETH",symbol:"ETH",address:{[st.MAINNET]:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",[st.ARBITRUM_ONE]:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1",[st.ARB_TESTNET]:"0x82af49447d8a07e3bd95bd0d56f35241523fbab1"},decimals:18},wstETH:{icon:I6,name:"wstETH",symbol:"wstETH",address:{[st.MAINNET]:"",[st.ARBITRUM_ONE]:"0x5979D7b546E38E414F7E9822514be443A4800529",[st.ARB_TESTNET]:""},decimals:18},USDC:{icon:"https://static.oklink.com/cdn/wallet/logo/USDC.png",name:"USDC",symbol:"USDC",address:{[st.MAINNET]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[st.ARBITRUM_ONE]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[st.ARB_TESTNET]:"0x0274c4561324D3ED61aae4a49C72D49aeFF02837"},decimals:6},"USDC.e":{icon:"https://static.oklink.com/cdn/wallet/logo/USDC.png",name:"USDC.e",symbol:"USDC.e",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",[st.ARB_TESTNET]:"0x0274c4561324D3ED61aae4a49C72D49aeFF02837"},decimals:6},ETH:{icon:I6,name:"ETH",symbol:"ETH",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",[st.ARB_TESTNET]:"0x2522D9E36e27e88615f81376eD2A9FB5443E681b"},decimals:18},USDT:{icon:k6,name:"USDT",symbol:"USDT",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",[st.ARB_TESTNET]:"0xb83fed234B6384fdF317FB66Cc743ac39248E60b"},decimals:6},TUSDT:{icon:k6,name:"TUSDT",symbol:"TUSDT",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0xCC233302FC4116B0926d0BEDbc9A86fD7Ee113A6",[st.ARB_TESTNET]:"0x0d933Fe0fe8c1395FACB60043242812c3Ff0AFF5"},decimals:6},GD1:{icon:k6,name:"GD1",symbol:"GD1",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0x4c0DeD3A1fCB7697Ad57c558Bfe55a5B41d453A6",[st.ARB_TESTNET]:"0x8e5027D0e7FD9c4a8Fd96B082ADc69f4D6A326D1"},decimals:18},WBTC:{icon:Gde,name:"WBTC",symbol:"WBTC",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",[st.ARB_TESTNET]:"0xD22889C28ba98A4Fec365941FDd3a7615bE4CE79"},decimals:8},LINK:{icon:Kde,name:"LINK",symbol:"LINK",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",[st.ARB_TESTNET]:"0xfaFedb041c0DD4fA2Dc0d87a6B0979Ee6FA7af5F"},decimals:18},DAI:{icon:"https://arbiscan.io/token/images/MCDDai_32.png",name:"DAI",symbol:"DAI",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",[st.ARB_TESTNET]:"0xD22889C28ba98A4Fec365941FDd3a7615bE4CE79"},decimals:18},PEPE:{icon:"https://arbiscan.io/token/images/pepe_32.png",name:"PEPE",symbol:"PEPE",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00",[st.ARB_TESTNET]:"0xD22889C28ba98A4Fec365941FDd3a7615bE4CE79"},decimals:18},ARB:{icon:"https://arbiscan.io/token/images/arbitrumone2_32_new.png",name:"ARB",symbol:"ARB",address:{[st.MAINNET]:"0xdAC17F958D2ee523a2206206994597C13D831ec7",[st.ARBITRUM_ONE]:"0x912CE59144191C1204E64559FE8253a0e49E6548",[st.ARB_TESTNET]:"0xB6702bA5d1eF0E54E78bfC868AdDBAC41891429B"},decimals:18}},Nn=t=>{const e=lfe[t];return{name:e.name,symbol:e.symbol,address:e.address[sd],decimals:e.decimals,icon:e.icon}};Nn("USDC").address,Nn("USDC").icon,Nn("USDC").decimals,Nn("USDT").address,Nn("USDT").icon,Nn("USDT").decimals,Nn("ETH").icon,Nn("ETH").decimals,Nn("WBTC").address,Nn("WBTC").icon,Nn("WBTC").decimals,Nn("wstETH").address,Nn("wstETH").icon,Nn("wstETH").decimals,Nn("LINK").address,Nn("LINK").icon,Nn("LINK").decimals,Nn("ARB").address,Nn("ARB").icon,Nn("ARB").decimals;const gS=C.createContext({}),ufe=["/wallet","/swap","social-trade"],dfe=({children:t})=>{const[e,r]=C.useState(localStorage.getItem(zh)?JSON.parse(localStorage.getItem(zh)||"{}"):null),n=hS(),[i,s]=C.useState(!0),[a,o]=C.useState(localStorage.getItem("hidden")==="true"),c=!!localStorage.getItem(Gd),[l,u]=C.useState([]),[d,f]=C.useState(null),h=gB(),[g,m]=C.useState(()=>{const D=!!localStorage.getItem(zh),q=!!localStorage.getItem(Gd);return D&&q}),[y,b]=C.useState(()=>localStorage.getItem(Gd)||""),[E,v]=C.useState(Date.now()),w=600*1e3,x=()=>{const D=!a;o(D),localStorage.setItem("hidden",D.toString())},_=()=>{r(null);const D=`orders_${e==null?void 0:e.address}`,q=localStorage.getItem(VI);if(q&&e){const U=JSON.parse(q);delete U[e.address],localStorage.setItem(VI,JSON.stringify(U))}localStorage.removeItem(qp),localStorage.removeItem(zh),localStorage.removeItem(D),localStorage.removeItem(Gd),h("/"),document.location.reload()},S=C.useCallback(async()=>{var D;try{const q=await qde.me();if(q){const U=[V_.Accepted,V_.LevelUpPending].includes(q==null?void 0:q.businessStatus),W=q!=null&&q.kycStatus?[zc.Incomplete,zc.Waiting,zc.InReview,zc.Pending].includes(q.kycStatus)?zc.Pending:zc.Approved:zc.Unverified,V=W===zc.Approved,Y=(D=q.code)==null?void 0:D.includes("PGD_");r({...q,isPartnership:Y,isBusiness:U,KYCVerified:W,isKYCVerified:V}),localStorage.setItem("user",JSON.stringify({...q,isPartnership:Y,privateKey:"",KYCVerified:W}))}return q}catch(q){console.error({refetchUser:q}),r(null)}finally{s(!1)}},[]),A=C.useCallback(async()=>{try{const D=await jC.getWalletToken(),q=D.reduce((U,W)=>W.usd_value?U.plus(W.usd_value):U,dn(0));f(q.toString()),u(D)}catch(D){console.error(D)}},[]),I=mB(),$=C.useCallback(()=>{m(!0)},[]);C.useEffect(()=>{if(!(e!=null&&e._id)||!n||!ufe.includes(I.pathname))return;A();const D=setInterval(A,12e4);return()=>{clearInterval(D)}},[e==null?void 0:e._id,n,A,I.pathname]),C.useEffect(()=>{(async()=>{localStorage.getItem(qp)?await S():s(!1)})()},[S]),C.useEffect(()=>{n&&v(Date.now())},[n]),C.useEffect(()=>{const q=setInterval(()=>{Date.now()-E>=w&&!g&&c&&$()},6e4),U=()=>v(Date.now());return window.addEventListener("mousedown",U),window.addEventListener("keydown",U),window.addEventListener("touchstart",U),window.addEventListener("scroll",U),()=>{clearInterval(q),window.removeEventListener("mousedown",U),window.removeEventListener("keydown",U),window.removeEventListener("touchstart",U),window.removeEventListener("scroll",U)}},[E,g]),C.useEffect(()=>{!n&&!g&&Date.now()-E>=w&&c&&$()},[n,g,E]);const P=D=>{m(D)},j=D=>y&&D===y?(m(!1),!0):!1,L=D=>{b(D)},B=C.useCallback(D=>{try{if(!l)return{tokens:[],totalUsdValue:"0"};const q=D.map(V=>V.toUpperCase()),U=l.filter(V=>{var K;const Y=V.symbol.toUpperCase();if(Y==="USDC"){const ge=(K=V.token_address)==null?void 0:K.toLowerCase();if(q.includes("USDC")){const ae=Nn("USDC");return ge===ae.address.toLowerCase()}if(q.includes("USDC.e")){const ae=Nn("USDC.e");return ge===ae.address.toLowerCase()}}return q.includes(Y)}),W=U.reduce((V,Y)=>Y.usd_value?V.plus(Y.usd_value):V,dn(0));return{tokens:U.map(V=>({...V})),totalUsdValue:W.toString()}}catch(q){return console.error("Error getting token balances:",q),{tokens:[],totalUsdValue:"0"}}},[l]),k={user:e,refetchUser:S,signOut:_,setUser:r,balancePriceUSD:d,loading:i,walletTokenBalance:l,fetchBalance:A,hiddenBalance:a,handleHidden:x,isPinLocked:g,setPinLocked:P,verifyPin:j,setPin:L,lockScreen:$,getTokenBalances:B};return p.jsx(gS.Provider,{value:k,children:e&&g?p.jsx(Qde,{}):t})},r3=()=>{const t=C.useContext(gS);if(!t)throw new Error("Forgot to wrap component in AuthContext");return t};function uz(t,e){const{user:r}=r3();return C.useMemo(()=>
83{if(!t||!e)return null;try{if(r!=null&&r.privateKey){const n=new xne(r.privateKey,Wp);return new TI(t,e,n)}else return new TI(t,e,Wp)}catch(n){return console.error("Failed to get contract",n),null}},[t,e,r==null?void 0:r.privateKey])}function ffe(){return uz(Rde(),Bde)}function hfe(){return uz(Dde(),Ude)}function pfe(t,e){if((t==null?void 0:t.length)<=e)return[t];const r=Math.ceil(t.length/e),n=Math.ceil(t.length/r);return[...Array(r).keys()].map(i=>t.slice(i*n,i*n+n))}function gfe(t){return new Promise(e=>setTimeout(e,t))}function mfe(t,e){return gfe(t+Math.round(Math.random()*Math.max(0,e-t)))}let dz=class extends Error{constructor(){super("Cancelled")}};class fz extends Error{}function yfe(t,{n:e,minWait:r,maxWait:n}){let i=!1,s;return{promise:new Promise(async(o,c)=>{for(s=c;;){let l;try{l=await t(),i||(o(l),i=!0);break}catch(u){if(i)break;if(e<=0||!(u instanceof fz)){c(u),i=!0;break}e--}await mfe(r,n)}}),cancel:()=>{i||(i=!0,s(new dz))}}}const bfe=500;async function vfe(t,e,r){console.debug("Fetching chunk",t,e,r);let n,i;try{[n,i]=await t.aggregate(e.map(s=>[s.address,s.callData]))}catch(s){throw console.debug("Failed to fetch chunk inside retry",s),s}if(n.toNumber()<r)throw console.debug(`Fetched results for old block number: ${n.toString()} vs. ${r}`),new fz("Fetched for old block number");return{results:i,blockNumber:n.toNumber()}}function wfe(t,e){if(!t||!e)return{};const r=t[e];return r?Object.keys(r).reduce((n,i)=>{const s=r[i];return n[i]=Object.keys(s).filter(a=>{const o=parseInt(a);return o<=0?!1:s[o]>0}).reduce((a,o)=>Math.min(a,parseInt(o)),1/0),n},{}):{}}function Efe(t,e,r,n){return!r||!n?[]:t[r]?Object.keys(e).filter(s=>{const a=e[s],o=t[r][s];if(!o)return!0;const c=n-(a-1);return o.fetchingBlockNumber&&o.fetchingBlockNumber>=c?!1:!o.blockNumber||o.blockNumber<c}):Object.keys(e)}function xfe(){const t=Gf(),e=g0(u=>u.multicall),r=jq(e.callListeners,100),n=az(),i=sd,s=ffe(),a=C.useRef(),o=C.useMemo(()=>wfe(r,i),[r,i]),c=C.useMemo(()=>Efe(e.callResults,o,i,n),[i,e.callResults,o,n]),l=C.useMemo(()=>JSON.stringify(c.sort()),[c]);return C.useEffect(()=>{var h,g,m;if(!n||!i||!s)return;const u=JSON.parse(l);if(u.length===0)return;const d=u.map(y=>aq(y)),f=pfe(d,bfe);((h=a.current)==null?void 0:h.blockNumber)!==n&&((m=(g=a.current)==null?void 0:g.cancellations)==null||m.forEach(y=>y())),t(lq({calls:d,chainId:i,fetchingBlockNumber:n})),a.current={blockNumber:n,cancellations:f.map((y,b)=>{const{cancel:E,promise:v}=yfe(()=>vfe(s,y,n),{n:1/0,minWait:2500,maxWait:3500});return v.then(({results:w,blockNumber:x})=>{a.current={cancellations:[],blockNumber:n};const _=f.slice(0,b).reduce((A,I)=>A+I.length,0),S=_+w.length;t(dq({chainId:i,results:u.slice(_,S).reduce((A,I,$)=>(A[I]=w[$]??null,A),{}),blockNumber:x}))}).catch(w=>{if(w instanceof dz){console.debug("Cancelled fetch for blockNumber",n);return}console.error("Failed to fetch multicall chunk",y,i,w),t(uq({calls:y,chainId:i,fetchingBlockNumber:n}))}),E})}},[i,s,t,l,n]),null}async function _fe(t,e,r,n,i=1e3){let s={},a=!1,o=0,c=!1;try{for(;!a&&!c;){let l=n.length;o+i<n.length&&(l=o+i);const u=n.slice(o,l);if(!u.length)break;const d=await e.query({query:t(...r,u),fetchPolicy:"cache-first"});d.data?(s={...s,...d.data},Object.keys(d.data).length<i||o+i>n.length?a=!0:o+=i):c=!0}return s}catch(l){return console.log(l),s}}function hz(){const t=y0(),e=t.subtract(1,"day").startOf("minute").unix(),r=t.subtract(1,"week").startOf("minute").unix(),n=t.subtract(1,"month").startOf("day").unix(),i=t.subtract(3,"month").startOf("day").unix();return[e,r,n,i]}const Cfe=t=>{let e="query blocks {";return e+=t.map(r=>`t${r}:blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_gt: ${r}, timestamp_lt: ${r+600} }) { 84 number 85 }`),e+="}",fa(e)};function pz(t,e){const[r]=Zf(),[n,i]=C.useState(),[s,a]=C.useState(!1),{blockClient:o}=dS(),c=o,l=n==null?void 0:n[r.id];return C.useEffect(()=>{async function d(){const f=await _fe(Cfe,c,[],t);f?i({...n??{},[r.id]:f}):a(!0)}!l&&!s&&d()}),{blocks:C.useMemo(()=>{if(n!=null&&n[r.id]){const d=n==null?void 0:n[r.id],f=[];for(const h in d)if(d[h].length>0){const g=d[h][0].number,m=Gie[r.id],y=g>m?g:m;f.push({timestamp:h.split("t")[1],number:y})}return f}},[r.id,n]),error:s}}const Sfe=fa` 86 query prices($block24: Int!, $blockWeek: Int!, $blockMonth: Int!, $blockThreeMonth: Int!) { 87 current: bundles(first: 1, subgraphError: allow) { 88 ethPriceUSD 89 } 90 oneDay: bundles(first: 1, block: { number: $block24 }, subgraphError: allow) { 91 ethPriceUSD 92 } 93 oneWeek: bundles(first: 1, block: { number: $blockWeek }, subgraphError: allow) { 94 ethPriceUSD 95 } 96 oneMonth: bundles(first: 1, block: { number: $blockMonth }, subgraphError: allow) { 97 ethPriceUSD 98 } 99 threeMonth: bundles(first: 1, block: { number: $blockThreeMonth }, subgraphError: allow) { 100 ethPriceUSD 101 } 102 } 103`;async function Afe(t,e){var r,n,i,s;try{const{data:a,error:o}=await e.query({query:Sfe,variables:{block24:Number(t[0]),blockWeek:Number(t[1])??1,blockMonth:Number(t[2])??1,blockThreeMonth:Number(t[3])??1}});return o?{error:!0,data:void 0}:a?{data:{current:parseFloat(a.current[0].ethPriceUSD??0),oneDay:parseFloat(((r=a.oneDay[0])==null?void 0:r.ethPriceUSD)??0),week:parseFloat(((n=a.oneWeek[0])==null?void 0:n.ethPriceUSD)??0),oneMonth:parseFloat(((i=a.oneMonth[0])==null?void 0:i.ethPriceUSD)??0),threeMonth:parseFloat(((s=a.threeMonth[0])==null?void 0:s.ethPriceUSD)??0)},error:!1}:{data:void 0,error:!0}}catch(a){return console.log(a),{data:void 0,error:!0}}}function Tfe(){const[t,e]=C.useState(),[r,n]=C.useState(!1),{dataClient:i}=dS(),[s,a,o,c]=hz(),{blocks:l,error:u}=pz([s,a,o,c]),[d]=Zf(),f=t==null?void 0:t[d.id],h=C.useMemo(()=>
103{if(l)return l.map(g=>g.number)},[l]);return C.useEffect(()=>{async function g(){const{data:m,error:y}=await Afe(h,i);y||u?n(!0):m&&e({[d.id]:m})}!f&&!r&&h&&g()},[r,t,h,u,i,f,d.id]),t==null?void 0:t[d.id]}const sg=(t,e)=>{if(t&&e){const r=(parseFloat(t)-parseFloat(e))/parseFloat(e)*100;if(isFinite(r))return r}return 0};function Ife(t,e,r){return iq.includes(t)?"ETH":e}function kfe(t,e,r){return iq.includes(t)?"Ether":e}const ag=(t,e)=>{let r="[";e.map(i=>r+=`"${i}",`),r+="]";const n=` 104 query tokens { 105 tokens(where: {id_in: ${r}},`+(t?`block: {number: ${t}} ,`:"")+` orderBy: totalValueLockedUSD, orderDirection: desc, subgraphError: allow) { 106 id 107 symbol 108 name 109 derivedETH 110 volumeUSD 111 volume 112 txCount 113 totalValueLocked 114 feesUSD 115 totalValueLockedUSD 116 } 117 } 118 `;return fa(n)};function $fe(t){const{dataClient:e}=dS(),[r,n,i,s]=hz(),{blocks:a,error:o}=pz([r,n,i,s]),[c,l,u,d]=a??[],f=Tfe(),{loading:h,error:g,data:m}=Lh(ag(void 0,t),{client:e,skip:!t.length}),{loading:y,error:b,data:E}=Lh(ag(c==null?void 0:c.number,t),{client:e,skip:!t.length}),{loading:v,error:w,data:x}=Lh(ag(l==null?void 0:l.number,t),{client:e,skip:!t.length}),{loading:_,error:S,data:A}=Lh(ag(u==null?void 0:u.number,t),{client:e,skip:!t.length}),{loading:I,error:$,data:P}=Lh(ag(d==null?void 0:d.number,t),{client:e,skip:!t.length}),j=!!(g||S||$||b||o||w),L=!!(h||_||I||y||v||!a);if(!f)return{loading:!0,error:!1,data:void 0};if(j||L)return{loading:L,error:j,data:void 0};const B=m!=null&&m.tokens?m.tokens.reduce((V,Y)=>(V[Y.id]=Y,V),{}):{},k=E!=null&&E.tokens?E.tokens.reduce((V,Y)=>(V[Y.id]=Y,V),{}):{},D=x!=null&&x.tokens?x.tokens.reduce((V,Y)=>(V[Y.id]=Y,V),{}):{},q=A!=null&&A.tokens?A.tokens.reduce((V,Y)=>(V[Y.id]=Y,V),{}):{},U=P!=null&&P.tokens?P.tokens.reduce((V,Y)=>(V[Y.id]=Y,V),{}):{},W=t.reduce((V,Y)=>{const K=B[Y],ge=k[Y],ae=D[Y],ce=q[Y],Q=U[Y],se=K&&ae?parseFloat(K.volumeUSD)-parseFloat(ae.volumeUSD):K?parseFloat(K.volumeUSD):0,me=K?parseFloat(K.totalValueLockedUSD):0,_e=sg(K==null?void 0:K.totalValueLockedUSD,ge==null?void 0:ge.totalValueLockedUSD),z=K?parseFloat(K.totalValueLocked):0,R=K?parseFloat(K.derivedETH)*f.current:0,M=ge?parseFloat(ge.derivedETH)*f.oneDay:0,ee=ae?parseFloat(ae.derivedETH)*f.week:0,ie=ce?parseFloat(ce.derivedETH)*f.oneMonth:0,le=Q?parseFloat(Q.derivedETH)*f.threeMonth:0,ye=R&&M?sg(R.toString(),M.toString()):0,fe=R&&ee?sg(R.toString(),ee.toString()):0,we=R&&ie?sg(R.toString(),ie.toString()):0,Ce=R&&le?sg(R.toString(),le.toString()):0,ne=K&&ge?parseFloat(K.txCount)-parseFloat(ge.txCount):K?parseFloat(K.txCount):0,Re=K&&ge?parseFloat(K.feesUSD)-parseFloat(ge.feesUSD):K?parseFloat(K.feesUSD):0;return V[Y]={exists:!!K,address:Y,name:K?kfe(Y,K.name):"",symbol:K?Ife(Y,K.symbol):"",volumeUSDWeek:se,txCount:ne,tvlUSD:me,feesUSD:Re,tvlUSDChange:_e,tvlToken:z,priceUSD:R,priceUSDChange:ye,priceUSDChangeWeek:fe,priceUSDChangeMonth:we,priceUSDChangeThreeMonth:Ce},V},{});return{loading:L,error:j,data:W}}y0.extend(SC);y0.extend(yB);fa` 119 query tokenDayDatas($startTime: Int!, $skip: Int!, $address: Bytes!) { 120 tokenDayDatas( 121 first: 1000 122 skip: $skip 123 where: { token: $address, date_gt: $startTime } 124 orderBy: date 125 orderDirection: asc 126 subgraphError: allow 127 ) { 128 date 129 volumeUSD 130 totalValueLockedUSD 131 } 132 } 133`;fa` 134 query topPools($address: Bytes!) { 135 asToken0: pools( 136 first: 200 137 orderBy: totalValueLockedUSD 138 orderDirection: desc 139 where: { token0: $address } 140 subgraphError: allow 141 ) { 142 id 143 } 144 asToken1: pools( 145 first: 200 146 orderBy: totalValueLockedUSD 147 orderDirection: desc 148 where: { token1: $address } 149 subgraphError: allow 150 ) { 151 id 152 } 153 } 154`;y0.extend(SC);y0.extend(yB);fa` 155 query tokenHourDatas($startTime: Int!, $skip: Int!, $address: String!) { 156 tokenHourDatas( 157 first: 100 158 skip: $skip 159 where: { token: $address, periodStartUnix_gt: $startTime } 160 orderBy: periodStartUnix 161 orderDirection: asc 162 ) { 163 periodStartUnix 164 priceUSD 165 } 166 } 167`;fa` 168 query transactions($address: Bytes!) { 169 swapsAs0: swaps( 170 first: 50 171 orderBy: timestamp 172 orderDirection: desc 173 where: { token0: $address } 174 subgraphError: allow 175 ) { 176 timestamp 177 transaction { 178 id 179 } 180 pool { 181 token0 { 182 id 183 symbol 184 } 185 token1 { 186 id 187 symbol 188 } 189 } 190 origin 191 amount0 192 amount1 193 amountUSD 194 } 195 swapsAs1: swaps( 196 first: 50 197 orderBy: timestamp 198 orderDirection: desc 199 where: { token1: $address } 200 subgraphError: allow 201 ) { 202 timestamp 203 transaction { 204 id 205 } 206 pool { 207 token0 { 208 id 209 symbol 210 } 211 token1 { 212 id 213 symbol 214 } 215 } 216 origin 217 amount0 218 amount1 219 amountUSD 220 } 221 } 222`;y0.extend(SC);function Nfe(){const[t]=Zf();return g0(e=>e.tokens.byAddress[t.id]??{})}function Pfe(){const t=Gf(),[e]=Zf();return C.useCallback(r=>{t(Iq({tokens:r,networkId:e.id}))},[e.id,t])}function Ofe(){const t=Pfe(),e=Nfe(),r=C.useMemo(()=>Object.keys(e).reduce((a,o)=>{const c=e[o];return(!c||!c.data||!c.lastUpdated)&&a.push(o),a},[]),[e]),{error:n,loading:i,data:s}=$fe(r);return C.useEffect(()=>{s&&!n&&!i&&t(Object.values(s))},[n,i,s,t]),null}const Rfe=iy(["0%{transform:translateX(-100%);}100%{transform:translateX(-50%);}"]),Dfe=iy(["0%{transform:translateX(0%);}100%{transform:translateX(-50%);}"]),Mfe=iy(["from{transform:translateX(-50%) scale(0.5);opacity:0;}to{transform:translateX(-50%) scale(1);opacity:1;}"]),jfe=t=>{let e=null;switch(t){case"home-menu":e=Rfe;break;case"user-menu":e=Dfe;break;default:e=Mfe}return e},gz=oe.div(["position:absolute;height:calc(var(--vh,1vh) * 100);transform:translateX(-50%);top:0;left:50%;bottom:0;"]),Lfe=oe(gz)(["z-index:99;width:100vw;@media screen and (min-width:768px){width:100%;}animation:",";"],({modalid:t})=>ns([""," 0.2s ease-out forwards"],jfe(t))),Ffe=oe(gz)(["background:rgba(0,0,0,0.3);width:100%;z-index:11;@media screen and (min-width:768px){width:100%;}"]),Ufe=C.createContext({isOpen:!1,nodeId:"",modalNode:null,setModalNo
222de:()=>null,onPresent:()=>null,onDismiss:()=>null,setCloseOnOverlayClick:()=>!1}),Bfe=({children:t})=>{const[e,r]=C.useState(!1),[n,i]=C.useState(),[s,a]=C.useState(""),[o,c]=C.useState(!1),l=C.useRef(null),u=(f,h)=>{i(f),a(h),r(!0)},d=()=>{i(void 0),r(!1),a("")};return p.jsxs(Ufe.Provider,{value:{isOpen:e,nodeId:s,modalNode:n,setModalNode:i,onPresent:u,onDismiss:d,setCloseOnOverlayClick:c},children:[e&&p.jsxs(p.Fragment,{children:[p.jsx(Lfe,{ref:l,modalid:s,children:Rt.isValidElement(n)&&Rt.cloneElement(n,{onDismiss:d})}),p.jsx(Ffe,{})]}),t]})};var qfe={VITE_APP_AWS_API_ENDPOINT:"https://gateway-arbitrum.network.thegraph.com/api/d762176fa97a19cbfec853f321540d1f/subgraphs/id/35AYsvtJ7SjD93JZcjHK7KTSFyC8h74YHkg2hTxRsRer"};const Wfe=qfe.VITE_APP_AWS_API_ENDPOINT,zfe=new $W({uri:Wfe}),Vfe=new od({connectToDevTools:!0,link:zfe,headers:{"Content-Type":"application/json",Origin:"https://app.uniswap.org"},cache:new ad({typePolicies:{Query:{fields:{account:wle()}}}}),defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}});function Hfe({children:t}){return p.jsx(rde,{client:Vfe,children:t})}const mz=async t=>await Xe.get(`/order${t?`?${t}`:""}`);var n3=(t=>(t[t.PENDING=0]="PENDING",t[t.STOPPED=1]="STOPPED",t[t.STOP_LOSS=2]="STOP_LOSS",t[t.TAKE_PROFIT=3]="TAKE_PROFIT",t))(n3||{});new dn(0);new dn(1);new dn(1e-7);new dn(9);const Gfe=new dn(10),Kfe=(t,e=18)=>new dn(t).dividedBy(Gfe.pow(e)),q$=(t,e=18)=>{const r=Kfe(t,e);return r.isZero()?"0":r.toFixed()};var Qfe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/*! 223 * Copyright (c) 2017 Benjamin Van Ryseghem<[email protected]> 224 * 225 * Permission is hereby granted, free of charge, to any person obtaining a copy 226 * of this software and associated documentation files (the "Software"), to deal 227 * in the Software without restriction, including without limitation the rights 228 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 229 * copies of the Software, and to permit persons to whom the Software is 230 * furnished to do so, subject to the following conditions: 231 * 232 * The above copyright notice and this permission notice shall be included in 233 * all copies or substantial portions of the Software. 234 * 235 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 236 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 237 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 238 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 239 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 240 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 241 * SOFTWARE. 242 */var N6,W$;function Yfe(){return W$||(W$=1,N6={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(t){let e=t%10;return~~(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),N6}/*! 243 * Copyright (c) 2017 Benjamin Van Ryseghem<[email protected]> 244 * 245 * Permission is hereby granted, free of charge, to any person obtaining a copy 246 * of this software and associated documentation files (the "Software"), to deal 247 * in the Software without restriction, including without limitation the rights 248 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 249 * copies of the Software, and to permit persons to whom the Software is 250 * furnished to do so, subject to the following conditions: 251 * 252 * The above copyright notice and this permission notice shall be included in 253 * all copies or substantial portions of the Software. 254 * 255 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 256 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 257 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 258 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 259 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 260 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 261 * SOFTWARE. 262 */var P6,z$;function yz(){if(z$)return P6;z$=1;const t=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function e(c){return c.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function r(c,l,u,d,f,h,g){if(!isNaN(+c))return+c;let m="",y=c.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");
262if(y!==c)return-1*r(y,l,u,d,f,h);for(let _=0;_<t.length;_++){let S=t[_];if(m=c.replace(RegExp(`([0-9 ])(${S.key})$`),"$1"),m!==c)return r(m,l,u,d,f,h)*S.factor}if(m=c.replace("%",""),m!==c)return r(m,l,u,d,f,h)/100;let b=parseFloat(c);if(isNaN(b))return;let E=d(b);if(E&&E!=="."&&(m=c.replace(new RegExp(`${e(E)}$`),""),m!==c))return r(m,l,u,d,f,h);let v={};Object.keys(h).forEach(_=>{v[h[_]]=_});let w=Object.keys(v).sort().reverse(),x=w.length;for(let _=0;_<x;_++){let S=w[_],A=v[S];if(m=c.replace(S,""),m!==c){let I;switch(A){case"thousand":I=Math.pow(10,3);break;case"million":I=Math.pow(10,6);break;case"billion":I=Math.pow(10,9);break;case"trillion":I=Math.pow(10,12);break}return r(m,l,u,d,f,h)*I}}}function n(c,l,u){let d=c.replace(u,"");return d=d.replace(new RegExp(`([0-9])${e(l.thousands)}([0-9])`,"g"),"$1$2"),d=d.replace(l.decimal,"."),d}function i(c,l,u="",d,f,h,g){if(c==="")return;if(c===f)return 0;let m=n(c,l,u);return r(m,l,u,d,f,h)}function s(c,l){if(!(c.indexOf(":")&&l.thousands!==":"))return!1;let d=c.split(":");if(d.length!==3)return!1;let f=+d[0],h=+d[1],g=+d[2];return!isNaN(f)&&!isNaN(h)&&!isNaN(g)}function a(c){let l=c.split(":"),u=+l[0],d=+l[1];return+l[2]+60*d+3600*u}function o(c,l){const u=yS();let d=u.currentDelimiters(),f=u.currentCurrency().symbol,h=u.currentOrdinal(),g=u.getZeroFormat(),m=u.currentAbbreviations(),y;if(typeof c=="string")s(c,d)?y=a(c):y=i(c,d,f,h,g,m);else if(typeof c=="number")y=c;else return;if(y!==void 0)return y}return P6={unformat:o},P6}/*! 263 * Copyright (c) 2017 Benjamin Van Ryseghem<[email protected]> 264 * 265 * Permission is hereby granted, free of charge, to any person obtaining a copy 266 * of this software and associated documentation files (the "Software"), to deal 267 * in the Software without restriction, including without limitation the rights 268 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 269 * copies of the Software, and to permit persons to whom the Software is 270 * furnished to do so, subject to the following conditions: 271 * 272 * The above copyright notice and this permission notice shall be included in 273 * all copies or substantial portions of the Software. 274 * 275 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 276 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 277 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 278 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 279 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 280 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 281 * SOFTWARE. 282 */var O6,V$;function mS(){if(V$)return O6;V$=1;let t=yz();const e=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,r=["currency","percent","byte","time","ordinal","number"],n=["trillion","billion","million","thousand"],i=["prefix","infix","postfix"],s=["sign","parenthesis"],a={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},l={output:{type:"string",validValues:r},base:{type:"string",validValues:["decimal","binary","general"],restriction:(y,b)=>b.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:y=>y.output==="byte"},characteristic:{type:"number",restriction:y=>y>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:n},average:"boolean",lowPrecision:{type:"boolean",restriction:(y,b)=>b.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:i},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:y=>y>=0,message:"value must be positive"},{restriction:(y,b)=>!b.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:y=>y>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:s},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(y,b)=>b.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},u={languageTag:{type:"string",mandatory:!0,restriction:y=>y.match(e),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:a,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}}
282,currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function d(y,b){let E=f(y),v=g(b);return E&&v}function f(y){return t.unformat(y)!==void 0}function h(y,b,E,v=!1){let w=Object.keys(y).map(x=>{if(!b[x])return console.error(`${E} Invalid key: ${x}`),!1;let _=y[x],S=b[x];if(typeof S=="string"&&(S={type:S}),S.type==="format"){if(!h(_,l,`[Validate ${x}]`,!0))return!1}else if(typeof _!==S.type)return console.error(`${E} ${x} type mismatched: "${S.type}" expected, "${typeof _}" provided`),!1;if(S.restrictions&&S.restrictions.length){let A=S.restrictions.length;for(let I=0;I<A;I++){let{restriction:$,message:P}=S.restrictions[I];if(!$(_,y))return console.error(`${E} ${x} invalid value: ${P}`),!1}}return S.restriction&&!S.restriction(_,y)?(console.error(`${E} ${x} invalid value: ${S.message}`),!1):S.validValues&&S.validValues.indexOf(_)===-1?(console.error(`${E} ${x} invalid value: must be among ${JSON.stringify(S.validValues)}, "${_}" provided`),!1):!(S.children&&!h(_,S.children,`[Validate ${x}]`))});return v||w.push(...Object.keys(b).map(x=>{let _=b[x];if(typeof _=="string"&&(_={type:_}),_.mandatory){let S=_.mandatory;if(typeof S=="function"&&(S=S(y)),S&&y[x]===void 0)return console.error(`${E} Missing mandatory key "${x}"`),!1}return!0})),w.reduce((x,_)=>x&&_,!0)}function g(y){return h(y,l,"[Validate format]")}function m(y){return h(y,u,"[Validate language]")}return O6={validate:d,validateFormat:g,validateInput:f,validateLanguage:m},O6}/*! 283 * Copyright (c) 2017 Benjamin Van Ryseghem<[email protected]> 284 * 285 * Permission is hereby granted, free of charge, to any person obtaining a copy 286 * of this software and associated documentation files (the "Software"), to deal 287 * in the Software without restriction, including without limitation the rights 288 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 289 * copies of the Software, and to permit persons to whom the Software is 290 * furnished to do so, subject to the following conditions: 291 * 292 * The above copyright notice and this permission notice shall be included in 293 * all copies or substantial portions of the Software. 294 * 295 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 296 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 297 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 298 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 299 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 300 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 301 * SOFTWARE. 302 */function Zfe(t,e){let r=t.match(/^{([^}]*)}/);return r?(e.prefix=r[1],t.slice(r[0].length)):t}function Xfe(t,e){let r=t.match(/{([^}]*)}$/);return r?(e.postfix=r[1],t.slice(0,-r[0].length)):t}function Jfe(t,e){if(t.indexOf("$")!==-1){e.output="currency";return}if(t.indexOf("%")!==-1){e.output="percent";return}if(t.indexOf("bd")!==-1){e.output="byte",e.base="general";return}if(t.indexOf("b")!==-1){e.output="byte",e.base="binary";return}if(t.indexOf("d")!==-1){e.output="byte",e.base="decimal";return}if(t.indexOf(":")!==-1){e.output="time";return}t.indexOf("o")!==-1&&(e.output="ordinal")}function ehe(t,e){t.indexOf(",")!==-1&&(e.thousandSeparated=!0)}function the(t,e){t.indexOf(" ")!==-1&&(e.spaceSeparated=!0,e.spaceSeparatedCurrency=!0,(e.average||e.forceAverage)&&(e.spaceSeparatedAbbreviation=!0))}function rhe(t,e){let r=t.match(/[1-9]+[0-9]*/);r&&(e.totalLength=+r[0])}function nhe(t,e){let n=t.split(".")[0].match(/0+/);n&&(e.characteristic=n[0].length)}function ihe(t,e){let r=t.split(".")[1];if(r){let n=r.match(/0+/);n&&(e.mantissa=n[0].length)}}function she(t,e){const r=t.split(".")[1];r&&(e.trimMantissa=r.indexOf("[")!==-1)}function ahe(t,e){t.indexOf("a")!==-1&&(e.average=!0)}function ohe(t,e){t.indexOf("K")!==-1?e.forceAverage="thousand":t.indexOf("M")!==-1?e.forceAverage="million":t.indexOf("B")!==-1?e.forceAverage="billion":t.indexOf("T")!==-1&&(e.forceAverage="trillion")}function che(t,e){t.match(/\[\.]/)?e.optionalMantissa=!0:t.match(/\./)&&(e.optionalMantissa=!1)}function lhe(t,e){if(t.indexOf(".")!==-1){let r=t.split(".")[0];e.optionalCharacteristic=r.indexOf("0")===-1}}function uhe(t,e){t.match(/^\+?\([^)]*\)$/)&&(e.negative="parenthesis"),t.match(/^\+?-/)&&(e.negative="sign")}function dhe(t,e){t.match(/^\+/)&&(e.forceSign=!0)}function fhe(t,e={}){return typeof t!="string"?t:(t=Zfe(t,e),t=Xfe(t,e),Jfe(t,e),rhe(t,e),nhe(t,e),lhe(t,e),ahe(t,e),ohe(t,e),ihe(t,e),che(t,e),she(t,e),ehe(t,e),the(t,e),uhe(t,e),dhe(t,e),e)}var hhe={parseFormat:fhe};/*! 303 * Copyright (c) 2017 Benjamin Van Ryseghem<[email protected]> 304 * 305 * Permission is hereby granted, free of charge, to any person obtaining a copy 306 * of this software and associated documentation files (the "Software"), to deal 307 * in the Software without restriction, including without limitation the rights 308 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 309 * copies of the Software, and to permit persons to whom the Software is 310 * furnished to do so, subject to the following conditions: 311 * 312 * The above copyright notice and this permission notice shall be included in 313 * all copies or substantial portions of the Software. 314 * 315 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 316 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 317 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 318 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 319 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 320 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 321 * SOFTWARE. 322 */var R6,H$;function yS(){if(H$)return R6;H$=1;const t=Yfe(),e=mS(),r=hhe;let n={},i,s={},a=null,o={};function c(u){i=u}function l(){return s[i]}return n.languages=()=>Object.assign({},s),n.currentLanguage=()=>i,n.currentBytes=()=>
322l().bytes||{},n.currentCurrency=()=>l().currency,n.currentAbbreviations=()=>l().abbreviations,n.currentDelimiters=()=>l().delimiters,n.currentOrdinal=()=>l().ordinal,n.currentDefaults=()=>Object.assign({},l().defaults,o),n.currentOrdinalDefaultFormat=()=>Object.assign({},n.currentDefaults(),l().ordinalFormat),n.currentByteDefaultFormat=()=>Object.assign({},n.currentDefaults(),l().byteFormat),n.currentPercentageDefaultFormat=()=>Object.assign({},n.currentDefaults(),l().percentageFormat),n.currentCurrencyDefaultFormat=()=>Object.assign({},n.currentDefaults(),l().currencyFormat),n.currentTimeDefaultFormat=()=>Object.assign({},n.currentDefaults(),l().timeFormat),n.setDefaults=u=>{u=r.parseFormat(u),e.validateFormat(u)&&(o=u)},n.getZeroFormat=()=>a,n.setZeroFormat=u=>a=typeof u=="string"?u:null,n.hasZeroFormat=()=>a!==null,n.languageData=u=>{if(u){if(s[u])return s[u];throw new Error(`Unknown tag "${u}"`)}return l()},n.registerLanguage=(u,d=!1)=>{if(!e.validateLanguage(u))throw new Error("Invalid language data");s[u.languageTag]=u,d&&c(u.languageTag)},n.setLanguage=(u,d=t.languageTag)=>{if(!s[u]){let f=u.split("-")[0],h=Object.keys(s).find(g=>g.split("-")[0]===f);if(!s[h]){c(d);return}c(h);return}c(u)},n.registerLanguage(t),i=t.languageTag,R6=n,R6}var phe={exports:{}};(function(t){(function(e){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,s=Math.floor,a="[BigNumber Error] ",o=a+"Number primitive has more than 15 significant digits: ",c=1e14,l=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,h=1e9;function g(_){var S,A,I,$=ae.prototype={constructor:ae,toString:null,valueOf:null},P=new ae(1),j=20,L=4,B=-7,k=21,D=-1e7,q=1e7,U=!1,W=1,V=0,Y={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"Â ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz",ge=!0;function ae(z,R){var M,ee,ie,le,ye,fe,we,Ce,ne=this;if(!(ne instanceof ae))return new ae(z,R);if(R==null){if(z&&z._isBigNumber===!0){ne.s=z.s,!z.c||z.e>q?ne.c=ne.e=null:z.e<D?ne.c=[ne.e=0]:(ne.e=z.e,ne.c=z.c.slice());return}if((fe=typeof z=="number")&&z*0==0){if(ne.s=1/z<0?(z=-z,-1):1,z===~~z){for(le=0,ye=z;ye>=10;ye/=10,le++);le>q?ne.c=ne.e=null:(ne.e=le,ne.c=[z]);return}Ce=String(z)}else{if(!n.test(Ce=String(z)))return I(ne,Ce,fe);ne.s=Ce.charCodeAt(0)==45?(Ce=Ce.slice(1),-1):1}(le=Ce.indexOf("."))>-1&&(Ce=Ce.replace(".","")),(ye=Ce.search(/e/i))>0?(le<0&&(le=ye),le+=+Ce.slice(ye+1),Ce=Ce.substring(0,ye)):le<0&&(le=Ce.length)}else{if(E(R,2,K.length,"Base"),R==10&&ge)return ne=new ae(z),me(ne,j+ne.e+1,L);if(Ce=String(z),fe=typeof z=="number"){if(z*0!=0)return I(ne,Ce,fe,R);if(ne.s=1/z<0?(Ce=Ce.slice(1),-1):1,ae.DEBUG&&Ce.replace(/^0\.0*|\./,"").length>15)throw Error(o+z)}else ne.s=Ce.charCodeAt(0)===45?(Ce=Ce.slice(1),-1):1;for(M=K.slice(0,R),le=ye=0,we=Ce.length;ye<we;ye++)if(M.indexOf(ee=Ce.charAt(ye))<0){if(ee=="."){if(ye>le){le=we;continue}}else if(!ie&&(Ce==Ce.toUpperCase()&&(Ce=Ce.toLowerCase())||Ce==Ce.toLowerCase()&&(Ce=Ce.toUpperCase()))){ie=!0,ye=-1,le=0;continue}return I(ne,String(z),fe,R)}fe=!1,Ce=A(Ce,R,10,ne.s),(le=Ce.indexOf("."))>-1?Ce=Ce.replace(".",""):le=Ce.length}for(ye=0;Ce.charCodeAt(ye)===48;ye++);for(we=Ce.length;Ce.charCodeAt(--we)===48;);if(Ce=Ce.slice(ye,++we)){if(we-=ye,fe&&ae.DEBUG&&we>15&&(z>u||z!==s(z)))throw Error(o+ne.s*z);if((le=le-ye-1)>q)ne.c=ne.e=null;else if(le<D)ne.c=[ne.e=0];else{if(ne.e=le,ne.c=[],ye=(le+1)%l,le<0&&(ye+=l),ye<we){for(ye&&ne.c.push(+Ce.slice(0,ye)),we-=l;ye<we;)ne.c.push(+Ce.slice(ye,ye+=l));ye=l-(Ce=Ce.slice(ye)).length}else ye-=we;for(;ye--;Ce+="0");ne.c.push(+Ce)}}else ne.c=[ne.e=0]}ae.clone=g,ae.ROUND_UP=0,ae.ROUND_DOWN=1,ae.ROUND_CEIL=2,ae.ROUND_FLOOR=3,ae.ROUND_HALF_UP=4,ae.ROUND_HALF_DOWN=5,ae.ROUND_HALF_EVEN=6,ae.ROUND_HALF_CEIL=7,ae.ROUND_HALF_FLOOR=8,ae.EUCLID=9,ae.config=ae.set=function(z){var R,M;if(z!=null)if(typeof z=="object"){if(z.hasOwnProperty(R="DECIMAL_PLACES")&&(M=z[R],E(M,0,h,R),j=M),z.hasOwnProperty(R="ROUNDING_MODE")&&(M=z[R],E(M,0,8,R),L=M),z.hasOwnProperty(R="EXPONENTIAL_AT")&&(M=z[R],M&&M.pop?(E(M[0],-h,0,R),E(M[1],0,h,R),B=M[0],k=M[1]):(E(M,-h,h,R),B=-(k=M<0?-M:M))),z.hasOwnProperty(R="RANGE"))if(M=z[R],M&&M.pop)E(M[0],-h,-1,R),E(M[1],1,h,R),D=M[0],q=M[1];else if(E(M,-h,h,R),M)D=-(q=M<0?-M:M);else throw Error(a+R+" cannot be zero: "+M);if(z.hasOwnProperty(R="CRYPTO"))if(M=z[R],M===!!M)if(M)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))U=M;else throw U=!M,Error(a+"crypto unavailable");else U=M;else throw Error(a+R+" not true or false: "+M);if(z.hasOwnProperty(R="MODULO_MODE")&&(M=z[R],E(M,0,9,R),W=M),z.hasOwnProperty(R="POW_PRECISION")&&(M=z[R],E(M,0,h,R),V=M),z.hasOwnProperty(R="FORMAT"))if(M=z[R],typeof M=="object")Y=M;else throw Error(a+R+" not an object: "+M);
vendor: 15,029 bytes, line 322
322if(z.hasOwnProperty(R="ALPHABET"))if(M=z[R],typeof M=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(M))ge=M.slice(0,10)=="0123456789",K=M;else throw Error(a+R+" invalid: "+M)}else throw Error(a+"Object expected: "+z);return{DECIMAL_PLACES:j,ROUNDING_MODE:L,EXPONENTIAL_AT:[B,k],RANGE:[D,q],CRYPTO:U,MODULO_MODE:W,POW_PRECISION:V,FORMAT:Y,ALPHABET:K}},ae.isBigNumber=function(z){if(!z||z._isBigNumber!==!0)return!1;if(!ae.DEBUG)return!0;var R,M,ee=z.c,ie=z.e,le=z.s;e:if({}.toString.call(ee)=="[object Array]"){if((le===1||le===-1)&&ie>=-h&&ie<=h&&ie===s(ie)){if(ee[0]===0){if(ie===0&&ee.length===1)return!0;break e}if(R=(ie+1)%l,R<1&&(R+=l),String(ee[0]).length==R){for(R=0;R<ee.length;R++)if(M=ee[R],M<0||M>=c||M!==s(M))break e;if(M!==0)return!0}}}else if(ee===null&&ie===null&&(le===null||le===1||le===-1))return!0;throw Error(a+"Invalid BigNumber: "+z)},ae.maximum=ae.max=function(){return Q(arguments,-1)},ae.minimum=ae.min=function(){return Q(arguments,1)},ae.random=(function(){var z=9007199254740992,R=Math.random()*z&2097151?function(){return s(Math.random()*z)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(M){var ee,ie,le,ye,fe,we=0,Ce=[],ne=new ae(P);if(M==null?M=j:E(M,0,h),ye=i(M/l),U)if(crypto.getRandomValues){for(ee=crypto.getRandomValues(new Uint32Array(ye*=2));we<ye;)fe=ee[we]*131072+(ee[we+1]>>>11),fe>=9e15?(ie=crypto.getRandomValues(new Uint32Array(2)),ee[we]=ie[0],ee[we+1]=ie[1]):(Ce.push(fe%1e14),we+=2);we=ye/2}else if(crypto.randomBytes){for(ee=crypto.randomBytes(ye*=7);we<ye;)fe=(ee[we]&31)*281474976710656+ee[we+1]*1099511627776+ee[we+2]*4294967296+ee[we+3]*16777216+(ee[we+4]<<16)+(ee[we+5]<<8)+ee[we+6],fe>=9e15?crypto.randomBytes(7).copy(ee,we):(Ce.push(fe%1e14),we+=7);we=ye/7}else throw U=!1,Error(a+"crypto unavailable");if(!U)for(;we<ye;)fe=R(),fe<9e15&&(Ce[we++]=fe%1e14);for(ye=Ce[--we],M%=l,ye&&M&&(fe=d[l-M],Ce[we]=s(ye/fe)*fe);Ce[we]===0;Ce.pop(),we--);if(we<0)Ce=[le=0];else{for(le=-1;Ce[0]===0;Ce.splice(0,1),le-=l);for(we=1,fe=Ce[0];fe>=10;fe/=10,we++);we<l&&(le-=l-we)}return ne.e=le,ne.c=Ce,ne}})(),ae.sum=function(){for(var z=1,R=arguments,M=new ae(R[0]);z<R.length;)M=M.plus(R[z++]);return M},A=(function(){var z="0123456789";function R(M,ee,ie,le){for(var ye,fe=[0],we,Ce=0,ne=M.length;Ce<ne;){for(we=fe.length;we--;fe[we]*=ee);for(fe[0]+=le.indexOf(M.charAt(Ce++)),ye=0;ye<fe.length;ye++)fe[ye]>ie-1&&(fe[ye+1]==null&&(fe[ye+1]=0),fe[ye+1]+=fe[ye]/ie|0,fe[ye]%=ie)}return fe.reverse()}return function(M,ee,ie,le,ye){var fe,we,Ce,ne,Re,Pe,Ae,Ue,He=M.indexOf("."),Qe=j,O=L;for(He>=0&&(ne=V,V=0,M=M.replace(".",""),Ue=new ae(ee),Pe=Ue.pow(M.length-He),V=ne,Ue.c=R(x(y(Pe.c),Pe.e,"0"),10,ie,z),Ue.e=Ue.c.length),Ae=R(M,ee,ie,ye?(fe=K,z):(fe=z,K)),Ce=ne=Ae.length;Ae[--ne]==0;Ae.pop());if(!Ae[0])return fe.charAt(0);if(He<0?--Ce:(Pe.c=Ae,Pe.e=Ce,Pe.s=le,Pe=S(Pe,Ue,Qe,O,ie),Ae=Pe.c,Re=Pe.r,Ce=Pe.e),we=Ce+Qe+1,He=Ae[we],ne=ie/2,Re=Re||we<0||Ae[we+1]!=null,Re=O<4?(He!=null||Re)&&(O==0||O==(Pe.s<0?3:2)):He>ne||He==ne&&(O==4||Re||O==6&&Ae[we-1]&1||O==(Pe.s<0?8:7)),we<1||!Ae[0])M=Re?x(fe.charAt(1),-Qe,fe.charAt(0)):fe.charAt(0);else{if(Ae.length=we,Re)for(--ie;++Ae[--we]>ie;)Ae[we]=0,we||(++Ce,Ae=[1].concat(Ae));for(ne=Ae.length;!Ae[--ne];);for(He=0,M="";He<=ne;M+=fe.charAt(Ae[He++]));M=x(M,Ce,fe.charAt(0))}return M}})(),S=(function(){function z(ee,ie,le){var ye,fe,we,Ce,ne=0,Re=ee.length,Pe=ie%f,Ae=ie/f|0;for(ee=ee.slice();Re--;)we=ee[Re]%f,Ce=ee[Re]/f|0,ye=Ae*we+Ce*Pe,fe=Pe*we+ye%f*f+ne,ne=(fe/le|0)+(ye/f|0)+Ae*Ce,ee[Re]=fe%le;return ne&&(ee=[ne].concat(ee)),ee}function R(ee,ie,le,ye){var fe,we;if(le!=ye)we=le>ye?1:-1;else for(fe=we=0;fe<le;fe++)if(ee[fe]!=ie[fe]){we=ee[fe]>ie[fe]?1:-1;break}return we}function M(ee,ie,le,ye){for(var fe=0;le--;)ee[le]-=fe,fe=ee[le]<ie[le]?1:0,ee[le]=fe*ye+ee[le]-ie[le];for(;!ee[0]&&ee.length>1;ee.splice(0,1));}return function(ee,ie,le,ye,fe){var we,Ce,ne,Re,Pe,Ae,Ue,He,Qe,O,T,N,G,te,ue,pe,Ie,je=ee.s==ie.s?1:-1,Te=ee.c,ve=ie.c;if(!Te||!Te[0]||!ve||!ve[0])return new ae(!ee.s||!ie.s||(Te?ve&&Te[0]==ve[0]:!ve)?NaN:Te&&Te[0]==0||!ve?je*0:je/0);for(He=new ae(je),Qe=He.c=[],Ce=ee.e-ie.e,je=le+Ce+1,fe||(fe=c,Ce=m(ee.e/l)-m(ie.e/l),je=je/l|0),ne=0;ve[ne]==(Te[ne]||0);ne++);if(ve[ne]>(Te[ne]||0)&&Ce--,je<0)Qe.push(1),Re=!0;else{for(te=Te.length,pe=ve.length,ne=0,je+=2,Pe=s(fe/(ve[0]+1)),Pe>1&&(ve=z(ve,Pe,fe),Te=z(Te,Pe,fe),pe=ve.length,te=Te.length),G=pe,O=Te.slice(0,pe),T=O.length;T<pe;O[T++]=0);Ie=ve.slice(),Ie=[0].concat(Ie),ue=ve[0],ve[1]>=fe/2&&ue++;do{if(Pe=0,we=R(ve,O,pe,T),we<0){if(N=O[0],pe!=T&&(N=N*fe+(O[1]||0)),Pe=s(N/ue),Pe>1)for(Pe>=fe&&(Pe=fe-1),Ae=z(ve,Pe,fe),Ue=Ae.length,T=O.length;R(Ae,O,Ue,T)==1;)Pe--,M(Ae,pe<Ue?Ie:ve,Ue,fe),Ue=Ae.length,we=1;else Pe==0&&(we=Pe=1),Ae=ve.slice(),Ue=Ae.length;if(Ue<T&&(Ae=[0].concat(Ae)),M(O,Ae,T,fe),T=O.length,we==-1)for(;R(ve,O,pe,T)<1;)Pe++,M(O,pe<T?Ie:ve,T,fe),T=O.length}else we===0&&(Pe++,O=[0]);Qe[ne++]=Pe,O[0]?O[T++]=Te[G]||0:(O=[Te[G]],T=1)}while((G++<te||O[0]!=null)&&je--);Re=O[0]!=null,Qe[0]||Qe.splice(0,1)}if(fe==c){for(ne=1,je=Qe[0];je>=10;je/=10,ne++);me(He,le+(He.e=ne+Ce*l-1)+1,ye,Re)}else He.e=Ce,He.r=+Re;return He}})();function ce(z,R,M,ee){var ie,le,ye,fe,we;if(M==null?M=L:E(M,0,8),!z.c)return z.toString();if(ie=z.c[0],ye=z.e,R==null)we=y(z.c),we=ee==1||ee==2&&(ye<=B||ye>=k)?w(we,ye):x(we,ye,"0");else if(z=me(new ae(z),R,M),le=z.e,we=y(z.c),fe=we.length,ee==1||ee==2&&(R<=le||le<=B)){for(;fe<R;we+="0",fe++);we=w(we,le)}else if(R-=ye,we=x(we,le,"0"),le+1>fe){if(--R>0)for(we+=".";R--;we+="0");}else if(R+=le-fe,R>0)for(le+1==fe&&(we+=".");R--;we+="0");return z.s<0&&ie?"-"+we:we}function Q(z,R){for(var M,ee,ie=1,le=new ae(z[0]);ie<z.length;ie++)ee=new ae(z[ie]),(!ee.s||(M=b(le,ee))===R||M===0&&le.s===R)&&(le=ee);return le}function se(z,R,M){for(var ee=1,ie=R.length;!R[--ie];R.pop());for(ie=R[0];ie>=10;ie/=10,ee++);return(M=ee+M*l-1)>q?z.c=z.e=null:M<D?z.c=[z.e=0]:(z.e=M,z.c=R),z}I=(function(){var z=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,M=/^\.([^.]+)$/,ee=/^-?(Infinity|NaN)$/,ie=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(le,ye,fe,we){var Ce,ne=fe?ye:ye.replace(ie,"");if(ee.test(ne))le.s=isNaN(ne)?null:ne<0?-1:1;else{if(!fe&&(ne=ne.replace(z,function(Re,Pe,Ae){return Ce=(Ae=Ae.toLowerCase())=="x"?16:Ae=="b"?2:8,!we||we==Ce?Pe:Re}),we&&(Ce=we,ne=ne.replace(R,"$1").replace(M,"0.$1")),ye!=ne))return new ae(ne,Ce);if(ae.DEBUG)throw Error(a+"Not a"+(we?" base "+we:"")+" number: "+ye);le.s=null}le.c=le.e=null}})();function me(z,R,M,ee){var ie,le,ye,fe,we,Ce,ne,Re=z.c,Pe=d;if(Re){e:{for(ie=1,fe=Re[0];fe>=10;fe/=10,ie++);if(le=R-ie,le<0)le+=l,ye=R,we=Re[Ce=0],ne=s(we/Pe[ie-ye-1]%10);else if(Ce=i((le+1)/l),Ce>=Re.length)if(ee){for(;Re.length<=Ce;Re.push(0));we=ne=0,ie=1,le%=l,ye=le-l+1}else break e;else{for(we=fe=Re[Ce],ie=1;fe>=10;fe/=10,ie++);le%=l,ye=le-l+ie,ne=ye<0?0:s(we/Pe[ie-ye-1]%10)}if(ee=ee||R<0||Re[Ce+1]!=null||(ye<0?we:we%Pe[ie-ye-1]),ee=M<4?(ne||ee)&&(M==0||M==(z.s<0?3:2)):ne>5||ne==5&&(M==4||ee||M==6&&(le>0?ye>0?we/Pe[ie-ye]:0:Re[Ce-1])%10&1||M==(z.s<0?8:7)),R<1||!Re[0])return Re.length=0,ee?(R-=z.e+1,Re[0]=Pe[(l-R%l)%l],z.e=-R||0):Re[0]=z.e=0,z;if(le==0?(Re.length=Ce,fe=1,Ce--):(Re.length=Ce+1,fe=Pe[l-le],Re[Ce]=ye>0?s(we/Pe[ie-ye]%Pe[ye])*fe:0),ee)for(;;)if(Ce==0){for(le=1,ye=Re[0];ye>=10;ye/=10,le++);for(ye=Re[0]+=fe,fe=1;ye>=10;ye/=10,fe++);le!=fe&&(z.e++,Re[0]==c&&(Re[0]=1));break}else{if(Re[Ce]+=fe,Re[Ce]!=c)break;Re[Ce--]=0,fe=1}for(le=Re.length;Re[--le]===0;Re.pop());}z.e>q?z.c=z.e=null:z.e<D&&(z.c=[z.e=0])}return z}function _e(z){var R,M=z.e;return M===null?z.toString():(R=y(z.c),R=M<=B||M>=k?w(R,M):x(R,M,"0"),z.s<0?"-"+R:R)}return $.absoluteValue=$.abs=function(){var z=new ae(this);return z.s<0&&(z.s=1),z},$.comparedTo=function(z,R){return b(this,new ae(z,R))},$.decimalPlaces=$.dp=function(z,R){var M,ee,ie,le=this;if(z!=null)return E(z,0,h),R==null?R=L:E(R,0,8),me(new ae(le),z+le.e+1,R);if(!(M=le.c))return null;if(ee=((ie=M.length-1)-m(this.e/l))*l,ie=M[ie])for(;ie%10==0;ie/=10,ee--);return ee<0&&(ee=0),ee},$.dividedBy=$.div=function(z,R){return S(this,new ae(z,R),j,L)},$.dividedToIntegerBy=$.idiv=function(z,R){return S(this,new ae(z,R),0,1)},$.exponentiatedBy=$.pow=function(z,R){var M,ee,ie,le,ye,fe,we,Ce,ne,Re=this;if(z=new ae(z),z.c&&!z.isInteger())throw Error(a+"Exponent not an integer: "+_e(z));if(R!=null&&(R=new ae(R)),fe=z.e>14,!Re.c||!Re.c[0]||Re.c[0]==1&&!Re.e&&Re.c.length==1||!z.c||!z.c[0])return ne=new ae(Math.pow(+_e(Re),fe?z.s*(2-v(z)):+_e(z))),R?ne.mod(R):ne;if(we=z.s<0,R){if(R.c?!R.c[0]:!R.s)return new ae(NaN);ee=!we&&Re.isInteger()&&R.isInteger(),ee&&(Re=Re.mod(R))}else{if(z.e>9&&(Re.e>0||Re.e<-1||(Re.e==0?Re.c[0]>1||fe&&Re.c[1]>=24e7:Re.c[0]<8e13||fe&&Re.c[0]<=9999975e7)))return le=Re.s<0&&v(z)?-0:0,Re.e>-1&&(le=1/le),new ae(we?1/le:le);V&&(le=i(V/l+2))}for(fe?(M=new ae(.5),we&&(z.s=1),Ce=v(z)):(ie=Math.abs(+_e(z)),Ce=ie%2),ne=new ae(P);;){if(Ce){if(ne=ne.times(Re),!ne.c)break;le?ne.c.length>le&&(ne.c.length=le):ee&&(ne=ne.mod(R))}if(ie){if(ie=s(ie/2),ie===0)break;Ce=ie%2}else if(z=z.times(M),me(z,z.e+1,1),z.e>14)Ce=v(z);else{if(ie=+_e(z),ie===0)break;Ce=ie%2}Re=Re.times(Re),le?Re.c&&Re.c.length>le&&(Re.c.length=le):ee&&(Re=Re.mod(R))}return ee?ne:(we&&(ne=P.div(ne)),R?ne.mod(R):le?me(ne,V,L,ye):ne)},$.integerValue=function(z){var R=new ae(this);return z==null?z=L:E(z,0,8),me(R,R.e+1,z)},$.isEqualTo=$.eq=function(z,R){return b(this,new ae(z,R))===0},$.isFinite=function(){return!!this.c},$.isGreaterThan=$.gt=function(z,R){return b(this,new ae(z,R))>0},$.isGreaterThanOrEqualTo=$.gte=function(z,R){return(R=b(this,new ae(z,R)))===1||R===0},$.isInteger=function(){return!!this.c&&m(this.e/l)>this.c.length-2},$.isLessThan=$.lt=function(z,R){return b(this,new ae(z,R))<0},$.isLessThanOrEqualTo=$.lte=function(z,R){return(R=b(this,new ae(z,R)))===-1||R===0},$.isNaN=function(){return!this.s},$.isNegative=function(){return this.s<0},$.isPositive=function(){return this.s>0},$.isZero=function(){return!!this.c&&this.c[0]==0},$.minus=function(z,R){var M,ee,ie,le,ye=this,fe=ye.s;if(z=new ae(z,R),R=z.s,!fe||!R)return new ae(NaN);if(fe!=R)return z.s=-R,ye.plus(z);var we=ye.e/l,Ce=z.e/l,ne=ye.c,Re=z.c;if(!we||!Ce){if(!ne||!Re)return ne?(z.s=-R,z):new ae(Re?ye:NaN);if(!ne[0]||!Re[0])return Re[0]?(z.s=-R,z):new ae(ne[0]?ye:L==3?-0:0)}if(we=m(we),Ce=m(Ce),ne=ne.slice(),fe=we-Ce){for((le=fe<0)?(fe=-fe,ie=ne):(Ce=we,ie=Re),ie.reverse(),R=fe;R--;ie.push(0));ie.reverse()}else for(ee=(le=(fe=ne.length)<(R=Re.length))?fe:R,fe=R=0;R<ee;R++)if(ne[R]!=Re[R]){le=ne[R]<Re[R];break}if(le&&(ie=ne,ne=Re,Re=ie,z.s=-z.s),R=(ee=Re.length)-(M=ne.length),R>0)for(;R--;ne[M++]=0);for(R=c-1;ee>fe;){if(ne[--ee]<Re[ee]){for(M=ee;M&&!ne[--M];ne[M]=R);--ne[M],ne[ee]+=c}ne[ee]-=Re[ee]}for(;ne[0]==0;ne.splice(0,1),--Ce);return ne[0]?se(z,ne,Ce):(z.s=L==3?-1:1,z.c=[z.e=0],z)},$.modulo=$.mod=function(z,R){var M,ee,ie=this;return z=new ae(z,R),!ie.c||!z.s||z.c&&!z.c[0]?new ae(NaN):!z.c||ie.c&&!ie.c[0]?new ae(ie):(W==9?(ee=z.s,z.s=1,M=S(ie,z,0,3),z.s=ee,M.s*=ee):M=S(ie,z,0,W),z=ie.minus(M.times(z)),!z.c[0]&&W==1&&(z.s=ie.s),z)},$.multipliedBy=$.times=function(z,R){var M,ee,ie,le,ye,fe,we,Ce,ne,Re,Pe,Ae,Ue,He,Qe,O=this,T=O.c,N=(z=new ae(z,R)).c;if(!T||!N||!T[0]||!N[0])return!O.s||!z.s||T&&!T[0]&&!N||N&&!N[0]&&!T?z.c=z.e=z.s=null:(z.s*=O.s,!T||!N?z.c=z.e=null:(z.c=[0],z.e=0)),z;for(ee=m(O.e/l)+m(z.e/l),z.s*=O.s,we=T.length,Re=N.length,we<Re&&(Ue=T,T=N,N=Ue,ie=we,we=Re,Re=ie),ie=we+Re,Ue=[];ie--;Ue.push(0));for(He=c,Qe=f,ie=Re;--ie>=0;){for(M=0,Pe=N[ie]%Qe,Ae=N[ie]/Qe|0,ye=we,le=ie+ye;le>ie;)Ce=T[--ye]%Qe,ne=T[ye]/Qe|0,fe=Ae*Ce+ne*Pe,Ce=Pe*Ce+fe%Qe*Qe+Ue[le]+M,M=(Ce/He|0)+(fe/Qe|0)+Ae*ne,Ue[le--]=Ce%He;Ue[le]=M}return M?++ee:Ue.splice(0,1),se(z,Ue,ee)},$.negated=function(){var z=new ae(this);return z.s=-z.s||null,z},$.plus=function(z,R){var M,ee=this,ie=ee.s;if(z=new ae(z,R),R=z.s,!ie||!R)return new ae(NaN);if(ie!=R)return z.s=-R,ee.minus(z);var le=ee.e/l,ye=z.e/l,fe=ee.c,we=z.c;if(!le||!ye){if(!fe||!we)return new ae(ie/0);if(!fe[0]||!we[0])return we[0]?z:new ae(fe[0]?ee:ie*0)}if(le=m(le),ye=m(ye),fe=fe.slice(),ie=le-ye){for(ie>0?(ye=le,M=we):(ie=-ie,M=fe),M.reverse();ie--;M.push(0));M.reverse()}for(ie=fe.length,R=we.length,ie-R<0&&(M=we,we=fe,fe=M,R=ie),ie=0;R;)ie=(fe[--R]=fe[R]+we[R]+ie)/c|0,fe[R]=c===fe[R]?0:fe[R]%c;return ie&&(fe=[ie].concat(fe),++ye),se(z,fe,ye)},$.precision=$.sd=function(z,R){var M,ee,ie,le=this;if(z!=null&&z!==!!z)return E(z,1,h),R==null?R=L:E(R,0,8),me(new ae(le),z,R);if(!(M=le.c))return null;if(ie=M.length-1,ee=ie*l+1,ie=M[ie]){for(;ie%10==0;ie/=10,ee--);for(ie=M[0];ie>=10;ie/=10,ee++);}return z&&le.e+1>ee&&(ee=le.e+1),ee},$.shiftedBy=function(z){return E(z,-u,u),this.times("1e"+z)},$.squareRoot=$.sqrt=function(){var z,R,M,ee,ie,le=this,ye=le.c,fe=le.s,we=le.e,Ce=j+4,ne=new ae("0.5");if(fe!==1||!ye||!ye[0])return new ae(!fe||fe<0&&(!ye||ye[0])?NaN:ye?le:1/0);if(fe=Math.sqrt(+_e(le)),fe==0||fe==1/0?(R=y(ye),(R.length+we)%2==0&&(R+="0"),fe=Math.sqrt(+R),we=m((we+1)/2)-(we<0||we%2),fe==1/0?R="5e"+we:(R=fe.toExponential(),R=R.slice(0,R.indexOf("e")+1)+we),M=new ae(R)):M=new ae(fe+""),M.c[0]){for(we=M.e,fe=we+Ce,fe<3&&(fe=0);;)if(ie=M,M=ne.times(ie.plus(S(le,ie,Ce,1))),y(ie.c).slice(0,fe)===(R=y(M.c)).slice(0,fe))if(M.e<we&&--fe,R=R.slice(fe-3,fe+1),R=="9999"||!ee&&R=="4999"){if(!ee&&(me(ie,ie.e+j+2,0),ie.times(ie).eq(le))){M=ie;break}Ce+=4,fe+=4,ee=1}else{(!+R||!+R.slice(1)&&R.charAt(0)=="5")&&(me(M,M.e+j+2,1),z=!M.times(M).eq(le));break}}return me(M,M.e+j+1,L,z)},$.toExponential=function(z,R){return z!=null&&(E(z,0,h),z++),ce(this,z,R,1)},$.toFixed=function(z,R){return z!=null&&(E(z,0,h),z=z+this.e+1),ce(this,z,R)},$.toFormat=function(z,R,M){var ee,ie=this;if(M==null)z!=null&&R&&typeof R=="object"?(M=R,R=null):z&&typeof z=="object"?(M=z,z=R=null):M=Y;else if(typeof M!="object")throw Error(a+"Argument not an object: "+M);if(ee=ie.toFixed(z,R),ie.c){var le,ye=ee.split("."),fe=+M.groupSize,we=+M.secondaryGroupSize,Ce=M.groupSeparator||"",ne=ye[0],Re=ye[1],Pe=ie.s<0,Ae=Pe?ne.slice(1):ne,Ue=Ae.length;if(we&&(le=fe,fe=we,we=le,Ue-=le),fe>0&&Ue>0){for(le=Ue%fe||fe,ne=Ae.substr(0,le);le<Ue;le+=fe)ne+=Ce+Ae.substr(le,fe);we>0&&(ne+=Ce+Ae.slice(le)),Pe&&(ne="-"+ne)}ee=Re?ne+(M.decimalSeparator||"")+((we=+M.fractionGroupSize)?Re.replace(new RegExp("\\d{"+we+"}\\B","g"),"$&"+(M.fractionGroupSeparator||"")):Re):ne}return(M.prefix||"")+ee+(M.suffix||"")},$.toFraction=function(z){var R,M,ee,ie,le,ye,fe,we,Ce,ne,Re,Pe,Ae=this,Ue=Ae.c;if(z!=null&&(fe=new ae(z),!fe.isInteger()&&(fe.c||fe.s!==1)||fe.lt(P)))throw Error(a+"Argument "+(fe.isInteger()?"out of range: ":"not an integer: ")+_e(fe));if(!Ue)return new ae(Ae);for(R=new ae(P),Ce=M=new ae(P),ee=we=new ae(P),Pe=y(Ue),le=R.e=Pe.length-Ae.e-1,R.c[0]=d[(ye=le%l)<0?l+ye:ye],z=!z||fe.comparedTo(R)>0?le>0?R:Ce:fe,ye=q,q=1/0,fe=new ae(Pe),we.c[0]=0;ne=S(fe,R,0,1),ie=M.plus(ne.times(ee)),ie.comparedTo(z)!=1;)M=ee,ee=ie,Ce=we.plus(ne.times(ie=Ce)),we=ie,R=fe.minus(ne.times(ie=R)),fe=ie;return ie=S(z.minus(M),ee,0,1),we=we.plus(ie.times(Ce)),M=M.plus(ie.times(ee)),we.s=Ce.s=Ae.s,le=le*2,Re
322=S(Ce,ee,le,L).minus(Ae).abs().comparedTo(S(we,M,le,L).minus(Ae).abs())<1?[Ce,ee]:[we,M],q=ye,Re},$.toNumber=function(){return+_e(this)},$.toPrecision=function(z,R){return z!=null&&E(z,1,h),ce(this,z,R,2)},$.toString=function(z){var R,M=this,ee=M.s,ie=M.e;return ie===null?ee?(R="Infinity",ee<0&&(R="-"+R)):R="NaN":(z==null?R=ie<=B||ie>=k?w(y(M.c),ie):x(y(M.c),ie,"0"):z===10&&ge?(M=me(new ae(M),j+ie+1,L),R=x(y(M.c),M.e,"0")):(E(z,2,K.length,"Base"),R=A(x(y(M.c),ie,"0"),10,z,ee,!0)),ee<0&&M.c[0]&&(R="-"+R)),R},$.valueOf=$.toJSON=function(){return _e(this)},$._isBigNumber=!0,_!=null&&ae.set(_),ae}function m(_){var S=_|0;return _>0||_===S?S:S-1}function y(_){for(var S,A,I=1,$=_.length,P=_[0]+"";I<$;){for(S=_[I++]+"",A=l-S.length;A--;S="0"+S);P+=S}for($=P.length;P.charCodeAt(--$)===48;);return P.slice(0,$+1||1)}function b(_,S){var A,I,$=_.c,P=S.c,j=_.s,L=S.s,B=_.e,k=S.e;if(!j||!L)return null;if(A=$&&!$[0],I=P&&!P[0],A||I)return A?I?0:-L:j;if(j!=L)return j;if(A=j<0,I=B==k,!$||!P)return I?0:!$^A?1:-1;if(!I)return B>k^A?1:-1;for(L=(B=$.length)<(k=P.length)?B:k,j=0;j<L;j++)if($[j]!=P[j])return $[j]>P[j]^A?1:-1;return B==k?0:B>k^A?1:-1}function E(_,S,A,I){if(_<S||_>A||_!==s(_))throw Error(a+(I||"Argument")+(typeof _=="number"?_<S||_>A?" out of range: ":" not an integer: ":" not a primitive number: ")+String(_))}function v(_){var S=_.c.length-1;return m(_.e/l)==S&&_.c[S]%2!=0}function w(_,S){return(_.length>1?_.charAt(0)+"."+_.slice(1):_)+(S<0?"e":"e+")+S}function x(_,S,A){var I,$;if(S<0){for($=A+".";++S;$+=A);_=$+_}else if(I=_.length,++S>I){for($=A,S-=I;--S;$+=A);_+=$}else S<I&&(_=_.slice(0,S)+"."+_.slice(S));return _}r=g(),r.default=r.BigNumber=r,t.exports?t.exports=r:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=r)})(Qfe)})(phe);/*! 323 * Copyright (c) 2017 Benjamin Van Ryseghem<[email protected]> 324 * 325 * Permission is hereby granted, free of charge, to any person obtaining a copy 326 * of this software and associated documentation files (the "Software"), to deal 327 * in the Software without restriction, including without limitation the rights 328 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 329 * copies of the Software, and to permit persons to whom the Software is 330 * furnished to do so, subject to the following conditions: 331 * 332 * The above copyright notice and this permission notice shall be included in 333 * all copies or substantial portions of the Software. 334 * 335 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 336 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 337 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 338 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 339 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 340 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 341 * SOFTWARE. 342 */const ghe=yS();mS();const{binarySuffixes:drt,decimalSuffixes:frt}=ghe.currentBytes(),Ml=yS(),mhe=mS(),yhe=yz();Ml.currentLanguage;Ml.registerLanguage;Ml.setLanguage;Ml.languages;Ml.languageData;Ml.setZeroFormat;Ml.currentDefaults;Ml.setDefaults;Ml.currentCurrencyDefaultFormat;mhe.validate;yhe.unformat;const Kp=(t="0",e=2)=>{const r={maximumFractionDigits:e};return typeof t=="object"?t=t.toNumber():t=Number(t),t.toLocaleString("en-US",r)},bhe=(t,e,r)=>t.map(i=>{const{status:s,createdAt:a,takeProfit:o,stopLoss:c,amountIn:l,amountOut:u,amountOutStart:d,updatedAt:f,userId:h,...g}=i,m=dn(c).div(l).times(100),y=dn(100).minus(m.div(1e6)),E=dn(o).div(l).times(100).div(1e6).minus(100),v=dn(d).div(dn(10).pow(18)).toString();return{...g,createdAt:new Date(a).getTime(),stoppedAt:s!==n3.PENDING?new Date(f).getTime():null,amountIn:l.toString(),amountOutStart:v,amountOutStop:u.toString(),stopLoss:Kp(y,2),takeProfit:Kp(E,2),status:s,userId:e?e._id:h,vaultCopiedId:r}});function vhe(){const t=hfe(),{user:e}=r3(),r=C.useMemo(()=>e!=null&&e.address?[[e==null?void 0:e.address,0,400],[e==null?void 0:e.address,1,400],[e==null?void 0:e.address,2,400],[e==null?void 0:e.address,3,400],[e==null?void 0:e.address,4,400]]:[[zie,0,400]],[e==null?void 0:e.address]),[n,i]=C.useState(),s=hS(),a=ofe(t,"getAccountOrders",r),o=sne(()=>{const c=a.reduce((l,u)=>{var d,f,h;return(f=(d=u.result)==null?void 0:d[0])!=null&&f.length&&l.push(...((h=u.result)==null?void 0:h[0])||[]),l},[]);return c.length>0?c:void 0},[a]);return C.useEffect(()=>{(async()=>
342{if((!n||!n.length)&&(e!=null&&e.address)){const c=`orders_${e==null?void 0:e.address}`,l=localStorage.getItem(c),u=JSON.parse(l||"{}"),d=Object.values(u);if(d.length)i(d);else{const f=await mz(),h=bhe(f,e),g=h.reduce((m,y)=>(m[y.index]=y,m),{});localStorage.setItem(c,JSON.stringify(g)),i(h)}}})()},[e==null?void 0:e.address]),C.useEffect(()=>{if(!o||!s||!(e!=null&&e.address))return;const c=`orders_${e.address}`,l=localStorage.getItem(c),u=JSON.parse(l||"{}");(async()=>{const d=await Promise.all(o.map(async h=>{const g=h.index.toNumber(),m=h.status;let y=null,b=null,E=null;if(u[g]&&u[g].stoppedAt)return u[g];const v=h.stopBlock.toNumber(),w=h.startBlock.toNumber();u[g]?b=u[g].createdAt:b=(await Wp.getBlock(w)).timestamp*1e3;const x=q$(dn(h.amountInStart.toString()),6);m!==n3.PENDING&&(E=(await Wp.getBlock(v)).timestamp*1e3,y=q$(dn(h.amountOutStop.toString()),6));const _=dn(h.sl.toString()).div(x).times(100),S=dn(100).minus(_.div(1e6)),I=dn(h.tp.toString()).div(x).times(100).div(1e6).minus(100),$=dn(h.amountOutStart.toString()).div(dn(10).pow(18)).toString();return{createdAt:b,stoppedAt:E,amountIn:x,amountOutStart:$,amountOutStop:y,token:h.token,stopLoss:Kp(S,2),takeProfit:Kp(I,2),status:m,index:g,stopBlock:v,startBlock:w,userId:e._id}})),f=d.reduce((h,g)=>(h[g.index]=g,h),{});localStorage.setItem(c,JSON.stringify(f)),i(d)})()},[o,s,e==null?void 0:e.address]),n}function whe({page:t=0,limit:e=1e3}){const{user:r}=r3(),n=`orders_vault_copied_${r==null?void 0:r.address}`,i=localStorage.getItem(n),s=JSON.parse(i||"{}"),[a,o]=C.useState(r!=null&&r.address?Object.values(s):[]);return C.useEffect(()=>{(async()=>{if(!a&&(r!=null&&r.address)){const l=(await mz("isVaultCopied=true")).map(d=>{const{status:f,createdAt:h,takeProfit:g,stopLoss:m,amountIn:y,amountOut:b,amountOutStart:E,updatedAt:v,...w}=d,x=dn(m).div(y).times(100),_=dn(100).minus(x.div(1e6)),A=dn(g).div(y).times(100).div(1e6).minus(100),I=dn(E).div(dn(10).pow(18)).toString();return{...w,createdAt:new Date(h).getTime(),stoppedAt:f!==n3.PENDING?new Date(v).getTime():null,amountIn:y.toString(),amountOutStart:I,amountOutStop:b.toString(),stopLoss:Kp(_,2),takeProfit:Kp(A,2),status:f}}),u=l.reduce((d,f)=>{var g;d.orders[f.index]=f;const h=(g=f.vaultCopiedId)==null?void 0:g.address;return h&&!d.routerAddress.includes(h)&&d.routerAddress.push(h),d},{orders:{},routerAddress:[]});localStorage.setItem(n,JSON.stringify(u.orders)),localStorage.setItem("router_address",JSON.stringify(u.routerAddress)),o(l)}})()},[r==null?void 0:r.address]),a}const Ehe="661f51d5aaeae9d2f951e562",G$="vaults",xhe=C.createContext({vaults:[],loading:!1,refetch:()=>Promise.resolve(),orders:void 0,ordersOnVaultCopied:[],portfolioCopying:{},updatePortfolio:()=>null});function _he({children:t}){const[e,r]=C.useState([]),[n,i]=C.useState(!0),[s,a]=C.useState({}),o=vhe(),c=whe({}),l=C.useCallback((f,h)=>{a(g=>({...g,[f]:h}))},[]);C.useEffect(()=>{const f=localStorage.getItem(G$),h=JSON.parse(f||"[]");h.length&&r(h)},[]);const u=async()=>{try{const h=(await fq.list()).map(g=>g._id===Ehe?{...g,name:"Wintermute",avatar:zde}:g);r(h),localStorage.setItem(G$,JSON.stringify(h))}catch(f){console.log(f)}finally{i(!1)}};C.useEffect(()=>{u()},[]);const d={vaults:e,loading:n,orders:o,refetch:u,portfolioCopying:s,updatePortfolio:l,ordersOnVaultCopied:c};return p.jsx(xhe.Provider,{value:d,children:t})}const Che="networks/5.8.0",K$=new tt(Che);function She(t){return t&&typeof t.renetwork=="function"}function so(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 a=new r.PocketProvider(t,n.pocket);a.network&&s.indexOf(a.network.name)===-1&&i.push(a)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],a=new r.AnkrProvider(t,n.ankr);a.network&&s.indexOf(a.network.name)===-1&&i.push(a)}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 so(r)},e}function Sv(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return Sv(t,n)},r}const Q$={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:so("homestead")},Y$={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:so("ropsten")},Z$={chainId:63,name:"classicMordor",_defaultProvider:Sv("https://www.ethercluster.com/mordor","classicMordor")},T2={unspecified:{chainId:0,name:"unspecified"},homestead:Q$,mainnet:Q$,morden:{chainId:2,name:"morden"}
342,ropsten:Y$,testnet:Y$,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:so("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:so("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:so("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"sepolia",_defaultProvider:so("sepolia")},holesky:{chainId:17e3,name:"holesky",_defaultProvider:so("holesky")},classic:{chainId:61,name:"classic",_defaultProvider:Sv("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Z$,classicTestnet:Z$,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Sv("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:so("matic")},maticmum:{chainId:80001,name:"maticmum",_defaultProvider:so("maticmum")},optimism:{chainId:10,name:"optimism",_defaultProvider:so("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 Ahe(t){if(t==null)return null;if(typeof t=="number"){for(const n in T2){const i=T2[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=T2[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=T2[t.name];if(!e)return typeof t.chainId!="number"&&K$.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&K$.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(She(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}class bz{constructor(e){At(this,"alphabet",e),At(this,"base",e.length),At(this,"_alphabetMap",{}),At(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=Sn(e);if(r.length===0)return"";let n=[0];for(let s=0;s<r.length;++s){let a=r[s];for(let o=0;o<n.length;++o)a+=n[o]<<8,n[o]=a%this.base,a=a/this.base|0;for(;a>0;)n.push(a%this.base),a=a/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 a=0;a<r.length;++a)s+=r[a]*this.base,r[a]=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 Sn(new Uint8Array(r.reverse()))}}new bz("abcdefghijklmnopqrstuvwxyz234567");const H_=new bz("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),The="web/5.8.0";var Ihe=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};function khe(t,e){return Ihe(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};
342if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const a=e.fetchOptions;a.mode&&(r.mode=a.mode),a.cache&&(r.cache=a.cache),a.credentials&&(r.credentials=a.credentials),a.redirect&&(r.redirect=a.redirect),a.referrer&&(r.referrer=a.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((a,o)=>{s[o.toLowerCase()]=a}):n.headers.keys().forEach(a=>{s[a.toLowerCase()]=n.headers.get(a)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:Sn(new Uint8Array(i))}})}var $he=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};const eo=new tt(The);function X$(t){return new Promise(e=>{setTimeout(e,t)})}function Kl(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Cne(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return sy(t)}catch{}return Zn(t)}return t}function Nhe(t){return jp(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Phe(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;eo.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;eo.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const a=typeof t=="object"?!!t.errorPassThrough:!1,o={};let c=null;const l={method:"GET"};let u=!1,d=120*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&eo.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(d=t.timeout),t.headers)for(const b in t.headers)o[b.toLowerCase()]={key:b,value:String(t.headers[b])},["if-none-match","if-modified-since"].indexOf(b.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&eo.throwError("basic authentication requires a secure https url",tt.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const b=t.user+":"+t.password;o.authorization={key:"Authorization",value:"Basic "+bB(jp(b))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=ji(t.fetchOptions))}const f=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(f):null;if(h)try{const b={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?_ne(h[3]):Nhe(h[3])};let E=b.body;return r&&(E=r(b.body,b)),Promise.resolve(E)}catch(b){eo.throwError("processing response error",tt.errors.SERVER_ERROR,{body:Kl(h[1],h[2]),error:b,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.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 g={};Object.keys(o).forEach(b=>{const E=o[b];g[E.key]=E.value}),l.headers=g;const m=(function(){let b=null;return{promise:new Promise(function(w,x){d&&(b=setTimeout(()=>{b!=null&&(b=null,x(eo.makeError("timeout",tt.errors.TIMEOUT,{requestBody:Kl(l.body,g["content-type"]),requestMethod:l.method,timeout:d,url:c})))},d))}),cancel:function(){b!=null&&(clearTimeout(b),b=null)}}})(),y=(function(){return $he(this,void 0,void 0,function*(){for(let b=0;b<n;b++){let E=null;try{if(E=yield khe(c,l),b<n){if(E.statusCode===301||E.statusCode===302){const w=E.headers.location||"";if(l.method==="GET"&&w.match(/^https:/)){c=E.headers.location;continue}}else if(E.statusCode===429){let w=!0;if(i&&(w=yield i(b,c)),w){let x=0;const _=E.headers["retry-after"];
342typeof _=="string"&&_.match(/^[1-9][0-9]*$/)?x=parseInt(_)*1e3:x=s*parseInt(String(Math.random()*Math.pow(2,b))),yield X$(x);continue}}}}catch(w){E=w.response,E==null&&(m.cancel(),eo.throwError("missing response",tt.errors.SERVER_ERROR,{requestBody:Kl(l.body,g["content-type"]),requestMethod:l.method,serverError:w,url:c}))}let v=E.body;if(u&&E.statusCode===304?v=null:!a&&(E.statusCode<200||E.statusCode>=300)&&(m.cancel(),eo.throwError("bad response",tt.errors.SERVER_ERROR,{status:E.statusCode,headers:E.headers,body:Kl(v,E.headers?E.headers["content-type"]:null),requestBody:Kl(l.body,g["content-type"]),requestMethod:l.method,url:c})),r)try{const w=yield r(v,E);return m.cancel(),w}catch(w){if(w.throttleRetry&&b<n){let x=!0;if(i&&(x=yield i(b,c)),x){const _=s*parseInt(String(Math.random()*Math.pow(2,b)));yield X$(_);continue}}m.cancel(),eo.throwError("processing response error",tt.errors.SERVER_ERROR,{body:Kl(v,E.headers?E.headers["content-type"]:null),error:w,requestBody:Kl(l.body,g["content-type"]),requestMethod:l.method,url:c})}return m.cancel(),v}return eo.throwError("failed response",tt.errors.SERVER_ERROR,{requestBody:Kl(l.body,g["content-type"]),requestMethod:l.method,url:c})})})();return Promise.race([m.promise,y])}function bS(t,e,r){let n=(s,a)=>{let o=null;if(s!=null)try{o=JSON.parse(sy(s))}catch(c){eo.throwError("invalid JSON",tt.errors.SERVER_ERROR,{body:s,error:c})}return r&&(o=r(o,a)),o},i=null;if(e!=null){i=jp(e);const s=typeof t=="string"?{url:t}:ji(t);s.headers?Object.keys(s.headers).filter(o=>o.toLowerCase()==="content-type").length!==0||(s.headers=ji(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return Phe(t,i,n)}function n1(t,e){return e||(e={}),e=ji(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 a=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{a()&&n(new Error("timeout"))},e.timeout));const o=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)a()&&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>o){a()&&n(new Error("retry limit reached"));return}let d=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));d<e.floor&&(d=e.floor),d>e.ceiling&&(d=e.ceiling),setTimeout(l,d)}return null},function(u){a()&&n(u)})}l()})}const my="providers/5.8.0";function _0(t,e,r){return r={path:e,exports:{},require:function(n,i){return Ohe(n,i??r.path)}},t(r,r.exports),r.exports}function Ohe(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var vS=vz;function vz(t,e){if(!t)throw new Error(e||"Assertion failed")}vz.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var ho=_0(function(t,e){var r=e;function n(a,o){if(Array.isArray(a))return a.slice();if(!a)return[];var c=[];if(typeof a!="string"){for(var l=0;l<a.length;l++)c[l]=a[l]|0;return c}if(o==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var l=0;l<a.length;l+=2)c.push(parseInt(a[l]+a[l+1],16))}else for(var l=0;l<a.length;l++){var u=a.charCodeAt(l),d=u>>8,f=u&255;d?c.push(d,f):c.push(f)}return c}r.toArray=n;function i(a){return a.length===1?"0"+a:a}r.zero2=i;function s(a){for(var o="",c=0;c<a.length;c++)o+=i(a[c].toString(16));return o}r.toHex=s,r.encode=function(o,c){return c==="hex"?s(o):o}}),ya=_0(function(t,e){var r=e;r.assert=vS,r.toArray=ho.toArray,r.zero2=ho.zero2,r.toHex=ho.toHex,r.encode=ho.encode;function n(c,l,u){var d=new Array(Math.max(c.bitLength(),u)+1),f;for(f=0;f<d.length;f+=1)d[f]=0;var h=1<<l+1,g=c.clone();for(f=0;f<d.length;f++){var m,y=g.andln(h-1);g.isOdd()?(y>(h>>1)-1?m=(h>>1)-y:m=y,g.isubn(m)):m=0,d[f]=m,g.iushrn(1)}return d}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var d=0,f=0,h;c.cmpn(-d)>0||l.cmpn(-f)>0;){var g=c.andln(3)+d&3,m=l.andln(3)+f&3;g===3&&(g=-1),m===3&&(m=-1);var y;(g&1)===0?y=0:(h=c.andln(7)+d&7,(h===3||h===5)&&m===2?y=-g:y=g),u[0].push(y);var b;(m&1)===0?b=0:(h=l.andln(7)+f&7,(h===3||h===5)&&g===2?b=-m:b=m),u[1].push(b),2*d===y+1&&(d=1-d),2*f===b+1&&(f=1-f),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var d="_"+l;c.prototype[l]=function(){return this[d]!==void 0?this[d]:this[d]=u.call(this)}}r.cachedProperty=s;function a(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=a;function o(c){return new ar(c,"hex","le")}r.intFromLE=o}),Av=ya.getNAF,Rhe=ya.getJSF,Tv=ya.assert;function cd(t,e){this.type=t,this.p=new ar(e.p,16),this.red=e.prime?ar.red(e.prime):ar.mont(this.p),this.zero=new ar(0).toRed(this.red),this.one=new ar(1).toRed(this.red),this.two=new ar(2).toRed(this.red),this.n=e.n&&new ar(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 Xf=cd;cd.prototype.point=function(){throw new Error("Not implemented")};cd.prototype.validate=function(){throw new Error("Not implemented")};cd.prototype._fixedNafMul=function(e,r){Tv(e.precomputed);var n=e._getDoubles(),i=Av(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],o,c;for(o=0;o<i.length;o+=n.step){c=0;for(var l=o+n.step-1;l>=o;l--)c=(c<<1)+i[l];a.push(c)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=s;f>0;f--){for(o=0;o<a.length;o++)c=a[o],c===f?d=d.mixedAdd(n.points[o]):c===-f&&(d=d.mixedAdd(n.points[o].neg()));u=u.add(d)}return u.toP()};cd.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=Av(r,n,this._bitLength),o=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var l=0;c>=0&&a[c]===0;c--)l++;if(c>=0&&l++,o=o.dblp(l),c<0)break;var u=a[c];Tv(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(s[u-1>>1]):o=o.mixedAdd(s[-u-1>>1].neg()):u>0?o=o.add(s[u-1>>1]):o=o.add(s[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};cd.prototype._wnafMulAdd=function(e,r,n,i,s){var a=this._wnafT1,o=this._wnafT2,c=this._wnafT3,l=0,u,d,f;for(u=0;
342u<i;u++){f=r[u];var h=f._getNAFPoints(e);a[u]=h.wnd,o[u]=h.points}for(u=i-1;u>=1;u-=2){var g=u-1,m=u;if(a[g]!==1||a[m]!==1){c[g]=Av(n[g],a[g],this._bitLength),c[m]=Av(n[m],a[m],this._bitLength),l=Math.max(c[g].length,l),l=Math.max(c[m].length,l);continue}var y=[r[g],null,null,r[m]];r[g].y.cmp(r[m].y)===0?(y[1]=r[g].add(r[m]),y[2]=r[g].toJ().mixedAdd(r[m].neg())):r[g].y.cmp(r[m].y.redNeg())===0?(y[1]=r[g].toJ().mixedAdd(r[m]),y[2]=r[g].add(r[m].neg())):(y[1]=r[g].toJ().mixedAdd(r[m]),y[2]=r[g].toJ().mixedAdd(r[m].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],E=Rhe(n[g],n[m]);for(l=Math.max(E[0].length,l),c[g]=new Array(l),c[m]=new Array(l),d=0;d<l;d++){var v=E[0][d]|0,w=E[1][d]|0;c[g][d]=b[(v+1)*3+(w+1)],c[m][d]=0,o[g]=y}}var x=this.jpoint(null,null,null),_=this._wnafT4;for(u=l;u>=0;u--){for(var S=0;u>=0;){var A=!0;for(d=0;d<i;d++)_[d]=c[d][u]|0,_[d]!==0&&(A=!1);if(!A)break;S++,u--}if(u>=0&&S++,x=x.dblp(S),u<0)break;for(d=0;d<i;d++){var I=_[d];I!==0&&(I>0?f=o[d][I-1>>1]:I<0&&(f=o[d][-I-1>>1].neg()),f.type==="affine"?x=x.mixedAdd(f):x=x.add(f))}}for(u=0;u<i;u++)o[u]=null;return s?x:x.toP()};function Ba(t,e){this.curve=t,this.type=e,this.precomputed=null}cd.BasePoint=Ba;Ba.prototype.eq=function(){throw new Error("Not implemented")};Ba.prototype.validate=function(){return this.curve.validate(this)};cd.prototype.decodePoint=function(e,r){e=ya.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?Tv(e[e.length-1]%2===0):e[0]===7&&Tv(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")};Ba.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Ba.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))};Ba.prototype.encode=function(e,r){return ya.encode(this._encode(r),e)};Ba.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};Ba.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};Ba.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 a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}};Ba.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}};Ba.prototype._getBeta=function(){return null};Ba.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r};var wS=_0(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}}}),Dhe=ya.assert;function qa(t){Xf.call(this,"short",t),this.a=new ar(t.a,16).toRed(this.red),this.b=new ar(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)}wS(qa,Xf);var Mhe=qa;qa.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new ar(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 ar(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],Dhe(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(o){return{a:new ar(o.a,16),b:new ar(o.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};qa.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:ar.mont(e),n=new ar(2).toRed(r).redInvm(),i=n.redNeg(),s=new ar(3).toRed(r).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),o=i.redSub(s).fromRed();return[a,o]};qa.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new ar(1),a=new ar(0),o=new ar(0),c=new ar(1),l,u,d,f,h,g,m,y=0,b,E;n.cmpn(0)!==0;){var v=i.div(n);b=i.sub(v.mul(n)),E=o.sub(v.mul(s));var w=c.sub(v.mul(a));if(!d&&b.cmp(r)<0)l=m.neg(),u=s,d=b.neg(),f=E;else if(d&&++y===2)break;m=b,i=n,n=b,o=s,s=E,c=a,a=w}h=b.neg(),g=E;var x=d.sqr().add(f.sqr()),_=h.sqr().add(g.sqr());return _.cmp(x)>=0&&(h=l,g=u),d.negative&&(d=d.neg(),f=f.neg()),h.negative&&(h=h.neg(),g=g.neg()),[{a:d,b:f},{a:h,b:g}]};qa.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=s.mul(n.a),c=a.mul(i.a),l=s.mul(n.b),u=a.mul(i.b),d=e.sub(o
342).sub(c),f=l.add(u).neg();return{k1:d,k2:f}};qa.prototype.pointFromX=function(e,r){e=new ar(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)};qa.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};qa.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(r[a]),c=e[a],l=c._getBeta();o.k1.negative&&(o.k1.ineg(),c=c.neg(!0)),o.k2.negative&&(o.k2.ineg(),l=l.neg(!0)),i[a*2]=c,i[a*2+1]=l,s[a*2]=o.k1,s[a*2+1]=o.k2}for(var u=this._wnafMulAdd(1,i,s,a*2,n),d=0;d<a*2;d++)i[d]=null,s[d]=null;return u};function Ai(t,e,r,n){Xf.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ar(e,16),this.y=new ar(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)}wS(Ai,Xf.BasePoint);qa.prototype.point=function(e,r,n){return new Ai(this,e,r,n)};qa.prototype.pointFromJSON=function(e,r){return Ai.fromJSON(this,e,r)};Ai.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}};Ai.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]};Ai.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(o){return e.point(o[0],o[1],n)}var a=r[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i};Ai.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)+">"};Ai.prototype.isInfinity=function(){return this.inf};Ai.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)};Ai.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),a=s.redSqr().redISub(this.x.redAdd(this.x)),o=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)};Ai.prototype.getX=function(){return this.x.fromRed()};Ai.prototype.getY=function(){return this.y.fromRed()};Ai.prototype.mul=function(e){return e=new ar(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)};Ai.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)};Ai.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)};Ai.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)};Ai.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());
vendor: 4,851 bytes, line 342
342if(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};Ai.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 Fi(t,e,r,n){Xf.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ar(0)):(this.x=new ar(e,16),this.y=new ar(r,16),this.z=new ar(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}wS(Fi,Xf.BasePoint);qa.prototype.jpoint=function(e,r,n){return new Fi(this,e,r,n)};Fi.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)};Fi.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Fi.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),a=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=a.redSub(o);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),d=u.redMul(c),f=i.redMul(u),h=l.redSqr().redIAdd(d).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(d)),m=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,g,m)};Fi.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,a=e.y.redMul(r).redMul(this.z),o=n.redSub(i),c=s.redSub(a);if(o.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),d=n.redMul(l),f=c.redSqr().redIAdd(u).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(s.redMul(u)),g=this.z.redMul(o);return this.curve.jpoint(f,h,g)};Fi.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,a=this.x,o=this.y,c=this.z,l=c.redSqr().redSqr(),u=o.redAdd(o);for(r=0;r<e;r++){var d=a.redSqr(),f=u.redSqr(),h=f.redSqr(),g=d.redAdd(d).redIAdd(d).redIAdd(i.redMul(l)),m=a.redMul(f),y=g.redSqr().redISub(m.redAdd(m)),b=m.redISub(y),E=g.redMul(b);E=E.redIAdd(E).redISub(h);var v=u.redMul(c);r+1<e&&(l=l.redMul(h)),a=y,c=v,u=E}return this.curve.jpoint(a,u.redMul(s),c)};Fi.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Fi.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),o=this.x.redAdd(s).redSqr().redISub(i).redISub(a);o=o.redIAdd(o);var c=i.redAdd(i).redIAdd(i),l=c.redSqr().redISub(o).redISub(o),u=a.redIAdd(a);u=u.redIAdd(u),u=u.redIAdd(u),e=l,r=c.redMul(o.redISub(l)).redISub(u),n=this.y.redAdd(this.y)}else{var d=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),g=this.x.redAdd(f).redSqr().redISub(d).redISub(h);g=g.redIAdd(g);var m=d.redAdd(d).redIAdd(d),y=m.redSqr(),b=h.redIAdd(h);b=b.redIAdd(b),b=b.redIAdd(b),e=y.redISub(g).redISub(g),r=m.redMul(g.redISub(e)).redISub(b),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};Fi.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),o=this.x.redAdd(s).redSqr().redISub(i).redISub(a);o=o.redIAdd(o);var c=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),l=c.redSqr().redISub(o).redISub(o);e=l;var u=a.redIAdd(a);u=u.redIAdd(u),u=u.redIAdd(u),r=c.redMul(o.redISub(l)).redISub(u),n=this.y.redAdd(this.y)}else{var d=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),g=this.x.redSub(d).redMul(this.x.redAdd(d));g=g.redAdd(g).redIAdd(g);var m=h.redIAdd(h);m=m.redIAdd(m);var y=m.redAdd(m);e=g.redSqr().redISub(y),n=this.y.redAdd(this.z).redSqr().redISub(f).redISub(d);var b=f.redSqr();b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b),r=g.redMul(m.redISub(e)).redISub(b)}return this.curve.jpoint(e,r,n)};Fi.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=r.redSqr(),o=n.redSqr(),c=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),l=r.redAdd(r);l=l.redIAdd(l);var u=l.redMul(o),d=c.redSqr().redISub(u.redAdd(u)),f=u.redISub(d),h=o.redSqr();h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=c.redMul(f).redISub(h),m=n.redAdd(n).redMul(i);return this.curve.jpoint(d,g,m)};Fi.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);
342var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),o=this.x.redAdd(r).redSqr().redISub(e).redISub(i);o=o.redIAdd(o),o=o.redAdd(o).redIAdd(o),o=o.redISub(a);var c=o.redSqr(),l=i.redIAdd(i);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var u=s.redIAdd(o).redSqr().redISub(a).redISub(c).redISub(l),d=r.redMul(u);d=d.redIAdd(d),d=d.redIAdd(d);var f=this.x.redMul(c).redISub(d);f=f.redIAdd(f),f=f.redIAdd(f);var h=this.y.redMul(u.redMul(l.redISub(u)).redISub(o.redMul(c)));h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var g=this.z.redAdd(o).redSqr().redISub(n).redISub(c);return this.curve.jpoint(f,h,g)};Fi.prototype.mul=function(e,r){return e=new ar(e,r),this.curve._wnafMul(this,e)};Fi.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};Fi.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}};Fi.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)+">"};Fi.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Ob=_0(function(t,e){var r=e;r.base=Xf,r.short=Mhe,r.mont=null,r.edwards=null}),Rb=_0(function(t,e){var r=e,n=ya.assert;function i(o){o.type==="short"?this.curve=new Ob.short(o):o.type==="edwards"?this.curve=new Ob.edwards(o):this.curve=new Ob.mont(o),this.g=this.curve.g,this.n=this.curve.n,this.hash=o.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(o,c){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,o,{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:Ho.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:Ho.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:Ho.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:Ho.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:Ho.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:Ho.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:Ho.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch{a=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:Ho.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
342,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function Ku(t){if(!(this instanceof Ku))return new Ku(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=ho.toArray(t.entropy,t.entropyEnc||"hex"),r=ho.toArray(t.nonce,t.nonceEnc||"hex"),n=ho.toArray(t.pers,t.persEnc||"hex");vS(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var wz=Ku;Ku.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};Ku.prototype._hmac=function(){return new Ho.hmac(this.hash,this.K)};Ku.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())};Ku.prototype.reseed=function(e,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),e=ho.toArray(e,r),n=ho.toArray(n,i),vS(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ku.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=ho.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 a=s.slice(0,e);return this._update(n),this._reseed++,ho.encode(a,r)};var G_=ya.assert;function rs(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 ES=rs;rs.fromPublic=function(e,r,n){return r instanceof rs?r:new rs(e,{pub:r,pubEnc:n})};rs.fromPrivate=function(e,r,n){return r instanceof rs?r:new rs(e,{priv:r,privEnc:n})};rs.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"}};rs.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};rs.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};rs.prototype._importPrivate=function(e,r){this.priv=new ar(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};rs.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?G_(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&G_(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)};rs.prototype.derive=function(e){return e.validate()||G_(e.validate(),"public point not validated"),e.mul(this.priv).getX()};rs.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};rs.prototype.verify=function(e,r,n){return this.ec.verify(e,r,this,void 0,n)};rs.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var jhe=ya.assert;function i3(t,e){if(t instanceof i3)return t;this._importDER(t,e)||(jhe(t.r&&t.s,"Signature without r or s"),this.r=new ar(t.r,16),this.s=new ar(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var s3=i3;function Lhe(){this.place=0}function D6(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,a=e.place;s<n;s++,a++)i<<=8,i|=t[a],i>>>=0;return i<=127?!1:(e.place=a,i)}function J$(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)}i3.prototype._importDER=function(e,r){e=ya.toArray(e,r);var n=new Lhe;if(e[n.place++]!==48)return!1;var i=D6(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=D6(e,n);if(s===!1||(e[n.place]&128)!==0)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var o=D6(e,n);if(o===!1||e.length!==o+n.place||(e[n.place]&128)!==0)return!1;var c=e.slice(n.place,o+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;return this.r=new ar(a),this.s=new ar(c),this.recoveryParam=null,!0};function M6(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)}i3.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=J$(r),n=J$(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];M6(i,r.length),i=i.concat(r),i.push(2),M6(i,n.length);var s=i.concat(n),a=[48];return M6(a,s.length),a=a.concat(s),ya.encode(a,e)};var Fhe=(function(){throw new Error("unsupported")}),qd=ya.assert;function ja(t){if(!(this instanceof ja))return new ja(t);typeof t=="string"&&(qd(Object.prototype.hasOwnProperty.call(Rb,t),"Unknown curve "+t),t=Rb[t]),t instanceof Rb.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 Uhe=ja;ja.prototype.keyPair=function(e){return new ES(this,e)};ja.prototype.keyFromPrivate=function(e,r){return ES.fromPrivate(this,e,r)};
342ja.prototype.keyFromPublic=function(e,r){return ES.fromPublic(this,e,r)};ja.prototype.genKeyPair=function(e){e||(e={});for(var r=new wz({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Fhe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ar(2));;){var s=new ar(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};ja.prototype._truncateToN=function(e,r,n){var i;if(ar.isBN(e)||typeof e=="number")e=new ar(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new ar(e,16);else{var s=e.toString();i=s.length+1>>>1,e=new ar(s,16)}typeof n!="number"&&(n=i*8);var a=n-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ja.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!ar.isBN(e)){qd(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),qd(e.length>>>0===e.length);for(var s=0;s<e.length;s++)qd((e[s]&255)===e[s])}r=this.keyFromPrivate(r,n),e=this._truncateToN(e,!1,i.msgBitLength),qd(!e.isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),o=r.getPrivate().toArray("be",a),c=e.toArray("be",a);qd(new ar(c).eq(e),"Can not sign message");for(var l=new wz({hash:this.hash,entropy:o,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ar(1)),d=0;;d++){var f=i.k?i.k(d):new ar(l.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(u)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var g=h.getX(),m=g.umod(this.n);if(m.cmpn(0)!==0){var y=f.invm(this.n).mul(m.mul(r.getPrivate()).iadd(e));if(y=y.umod(this.n),y.cmpn(0)!==0){var b=(h.getY().isOdd()?1:0)|(g.cmp(m)!==0?2:0);return i.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new s3({r:m,s:y,recoveryParam:b})}}}}}};ja.prototype.verify=function(e,r,n,i,s){s||(s={}),e=this._truncateToN(e,!1,s.msgBitLength),n=this.keyFromPublic(n,i),r=new s3(r,"hex");var a=r.r,o=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c=o.invm(this.n),l=c.mul(e).umod(this.n),u=c.mul(a).umod(this.n),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(l,n.getPublic(),u),d.isInfinity()?!1:d.eqXToP(a)):(d=this.g.mulAdd(l,n.getPublic(),u),d.isInfinity()?!1:d.getX().umod(this.n).cmp(a)===0)};ja.prototype.recoverPubKey=function(t,e,r,n){qd((3&r)===r,"The recovery param is more than two bits"),e=new s3(e,n);var i=this.n,s=new ar(t),a=e.r,o=e.s,c=r&1,l=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?a=this.curve.pointFromX(a.add(this.curve.n),c):a=this.curve.pointFromX(a,c);var u=e.r.invm(i),d=i.sub(s).mul(u).umod(i),f=o.mul(u).umod(i);return this.g.mulAdd(d,a,f)};ja.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new s3(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 Bhe=_0(function(t,e){var r=e;r.version="6.6.1",r.utils=ya,r.rand=(function(){throw new Error("unsupported")}),r.curve=Ob,r.curves=Rb,r.ec=Uhe,r.eddsa=null}),qhe=Bhe.ec;const Whe="signing-key/5.8.0",K_=new tt(Whe);let j6=null;function fu(){return j6||(j6=new qhe("secp256k1")),j6}class zhe{constructor(e){At(this,"curve","secp256k1"),At(this,"privateKey",Zn(e)),Ef(this.privateKey)!==32&&K_.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=fu().keyFromPrivate(Sn(this.privateKey));At(this,"publicKey","0x"+r.getPublic(!1,"hex")),At(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),At(this,"_isSigningKey",!0)}_addPoint(e){const r=fu().keyFromPublic(Sn(this.publicKey)),n=fu().keyFromPublic(Sn(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=fu().keyFromPrivate(Sn(this.privateKey)),n=Sn(e);n.length!==32&&K_.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return jw({recoveryParam:i.recoveryParam,r:ca("0x"+i.r.toString(16),32),s:ca("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=fu().keyFromPrivate(Sn(this.privateKey)),n=fu().keyFromPublic(Sn(Ez(e)));return ca("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Vhe(t,e){const r=jw(e),n={r:Sn(r.r),s:Sn(r.s)};return"0x"+fu().recoverPubKey(Sn(t),n,r.recoveryParam).encode("hex",!1)}function Ez(t,e){const r=Sn(t);return r.length===32?new zhe(r).publicKey:r.length===33?"0x"+fu().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Zn(r):K_.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Hhe="transactions/5.8.0",Ms=new tt(Hhe);var eN;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(eN||(eN={}));function xS(t){return t==="0x"?null:jr(t)}function Xi(t){return t==="0x"?Sne:zt.from(t)}const Ghe=[{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"}],Khe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Qhe(t){const e=Ez(t);return jr(ks(Fp(ks(e,1)),12))}function xz(t,e){return Qhe(Vhe(Sn(t),e))}function na(t,e){const r=Lp(zt.from(t).toHexString());return r.length>32&&Ms.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function L6(t,e){return{address:jr(t),storageKeys:(e||[]).map((r,n)=>(Ef(r)!==32&&Ms.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function C0(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Ms.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),L6(r[0],r[1])):L6(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return L6(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function _z(t){return C0(t).map(e=>[e.address,e.storageKeys])}function Cz(t,e){if(t.gasPrice!=null){const n=zt.from(t.gasPrice),i=zt.from(t.maxFeePerGas||0);n.eq(i)||Ms.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[na(t.chainId||0,"chainId"),na(t.nonce||0,"nonce"),na(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),na(t.maxFeePerGas||0,"maxFeePerGas"),na(t.gasLimit||0,"gasLim
342it"),t.to!=null?jr(t.to):"0x",na(t.value||0,"value"),t.data||"0x",_z(t.accessList||[])];if(e){const n=jw(e);r.push(na(n.recoveryParam,"recoveryParam")),r.push(Lp(n.r)),r.push(Lp(n.s))}return nl(["0x02",Lw(r)])}function Sz(t,e){const r=[na(t.chainId||0,"chainId"),na(t.nonce||0,"nonce"),na(t.gasPrice||0,"gasPrice"),na(t.gasLimit||0,"gasLimit"),t.to!=null?jr(t.to):"0x",na(t.value||0,"value"),t.data||"0x",_z(t.accessList||[])];if(e){const n=jw(e);r.push(na(n.recoveryParam,"recoveryParam")),r.push(Lp(n.r)),r.push(Lp(n.s))}return nl(["0x01",Lw(r)])}function Yhe(t,e){vB(t,Khe);const r=[];Ghe.forEach(function(i){let s=t[i.name]||[];const a={};i.numeric&&(a.hexPad="left"),s=Sn(Zn(s,a)),i.length&&s.length!==i.length&&s.length>0&&Ms.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,s),i.maxLength&&(s=Lp(s),s.length>i.maxLength&&Ms.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,s)),r.push(Zn(s))});let n=0;return t.chainId!=null&&(n=t.chainId,typeof n!="number"&&Ms.throwArgumentError("invalid transaction.chainId","transaction",t)),n!==0&&(r.push(Zn(n)),r.push("0x"),r.push("0x")),Lw(r)}function Zhe(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Ms.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),Yhe(t);switch(t.type){case 1:return Sz(t,e);case 2:return Cz(t,e)}return Ms.throwError(`unsupported transaction type: ${t.type}`,tt.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function Az(t,e,r){try{const n=Xi(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Ms.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=ca(e[1],32),t.s=ca(e[2],32);try{const n=Fp(r(t));t.from=xz(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function Xhe(t){const e=AC(t.slice(1));e.length!==9&&e.length!==12&&Ms.throwArgumentError("invalid component count for transaction type: 2","payload",Zn(t));const r=Xi(e[2]),n=Xi(e[3]),i={type:2,chainId:Xi(e[0]).toNumber(),nonce:Xi(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Xi(e[4]),to:xS(e[5]),value:Xi(e[6]),data:e[7],accessList:C0(e[8])};return e.length===9||(i.hash=Fp(t),Az(i,e.slice(9),Cz)),i}function Jhe(t){const e=AC(t.slice(1));e.length!==8&&e.length!==11&&Ms.throwArgumentError("invalid component count for transaction type: 1","payload",Zn(t));const r={type:1,chainId:Xi(e[0]).toNumber(),nonce:Xi(e[1]).toNumber(),gasPrice:Xi(e[2]),gasLimit:Xi(e[3]),to:xS(e[4]),value:Xi(e[5]),data:e[6],accessList:C0(e[7])};return e.length===8||(r.hash=Fp(t),Az(r,e.slice(8),Sz)),r}function epe(t){const e=AC(t);e.length!==9&&e.length!==6&&Ms.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:Xi(e[0]).toNumber(),gasPrice:Xi(e[1]),gasLimit:Xi(e[2]),to:xS(e[3]),value:Xi(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=zt.from(e[6]).toNumber()}catch{return r}if(r.r=ca(e[7],32),r.s=ca(e[8],32),zt.from(r.r).isZero()&&zt.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(Zn(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Fp(Lw(i));try{r.from=xz(s,{r:Zn(r.r),s:Zn(r.s),recoveryParam:n})}catch{}r.hash=Fp(t)}return r.type=null,r}function tpe(t){const e=Sn(t);if(e[0]>127)return epe(e);switch(e[0]){case 1:return Jhe(e);case 2:return Xhe(e)}return Ms.throwError(`unsupported transaction type: ${e[0]}`,tt.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const og=new tt(my);class Ot{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),a=this.hash.bind(this),o=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this),u=d=>this.data(d,!0);return e.transaction={hash:a,type:l,accessList:Ot.allowNull(this.accessList.bind(this),null),blockHash:Ot.allowNull(a,null),blockNumber:Ot.allowNull(c,null),transactionIndex:Ot.allowNull(c,null),
342confirmations:Ot.allowNull(c,null),from:r,gasPrice:Ot.allowNull(n),maxPriorityFeePerGas:Ot.allowNull(n),maxFeePerGas:Ot.allowNull(n),gasLimit:n,to:Ot.allowNull(r,null),value:n,nonce:c,data:s,r:Ot.allowNull(this.uint256),s:Ot.allowNull(this.uint256),v:Ot.allowNull(c),creates:Ot.allowNull(r,null),raw:Ot.allowNull(s)},e.transactionRequest={from:Ot.allowNull(r),nonce:Ot.allowNull(c),gasLimit:Ot.allowNull(n),gasPrice:Ot.allowNull(n),maxPriorityFeePerGas:Ot.allowNull(n),maxFeePerGas:Ot.allowNull(n),to:Ot.allowNull(r),value:Ot.allowNull(n),data:Ot.allowNull(u),type:Ot.allowNull(c),accessList:Ot.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:a,address:r,topics:Ot.arrayOf(a),data:s,logIndex:c,blockHash:a},e.receipt={to:Ot.allowNull(this.address,null),from:Ot.allowNull(this.address,null),contractAddress:Ot.allowNull(r,null),transactionIndex:c,root:Ot.allowNull(o),gasUsed:n,logsBloom:Ot.allowNull(s),blockHash:a,transactionHash:a,logs:Ot.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:Ot.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:Ot.allowNull(n),status:Ot.allowNull(c),type:l},e.block={hash:Ot.allowNull(a),parentHash:a,number:c,timestamp:c,nonce:Ot.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Ot.allowNull(r),extraData:s,transactions:Ot.allowNull(Ot.arrayOf(a)),baseFeePerGas:Ot.allowNull(n)},e.blockWithTransactions=ji(e.block),e.blockWithTransactions.transactions=Ot.allowNull(Ot.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ot.allowNull(i,void 0),toBlock:Ot.allowNull(i,void 0),blockHash:Ot.allowNull(a,void 0),address:Ot.allowNull(r,void 0),topics:Ot.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ot.allowNull(c),blockHash:Ot.allowNull(a),transactionIndex:c,removed:Ot.allowNull(this.boolean.bind(this)),address:r,data:Ot.allowFalsish(s,"0x"),topics:Ot.arrayOf(a),transactionHash:a,logIndex:c},e}accessList(e){return C0(e||[])}number(e){return e==="0x"?0:zt.from(e).toNumber()}type(e){return e==="0x"||e==null?0:zt.from(e).toNumber()}bigNumber(e){return zt.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),ia(e))?e.toLowerCase():og.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(!ia(e,32))return null;const r=jr(ks(e,12));return r===Ane?null:r}contractAddress(e){return wB(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"||ia(e))return TC(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Ef(n)!==32?og.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=zt.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!ia(e))throw new Error("invalid uint256");return ca(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=Ot.check(r,e);return i._difficulty=n==null?null:zt.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ot.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&zt.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=Ot.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;ia(n)&&(n=zt.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),ia(n)&&(n=zt.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 tpe(e)}receiptLog(e){return Ot.check(this.formats.receiptLog,e)}receipt(e){const r=Ot.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=zt.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&og.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):og.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&og.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 Ot.check(this.formats.filter,e)}filterLog(e){return Ot.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 ur=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};const br=new tt(my),rpe=10;function tN(t){return t==null?"null":(Ef(t)!==32&&br.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function rN(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=>
342{r[tN(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return tN(e)}).join("&")}function npe(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 xh(t){if(typeof t=="string"){if(t=t.toLowerCase(),Ef(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+rN(t);if(kne.isForkEvent(t))throw br.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+rN(t.topics||[])}throw new Error("invalid event - "+t)}function cg(){return new Date().getTime()}function nN(t){return new Promise(e=>{setTimeout(e,t)})}const ipe=["block","network","pending","poll"];let spe=class{constructor(e,r,n){At(this,"tag",e),At(this,"listener",r),At(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=npe(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||ipe.indexOf(this.tag)>=0}};const ape={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 F6(t){return ca(zt.from(t).toHexString(),32)}function iN(t){return H_.encode(Zg([t,ks(F$(F$(t)),0,4)]))}const Tz=new RegExp("^(ipfs)://(.*)$","i"),sN=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Tz,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Db(t,e){try{return sy(Q1(t,e))}catch{}return null}function Q1(t,e){if(t==="0x")return null;const r=zt.from(ks(t,e,e+32)).toNumber(),n=zt.from(ks(t,r,r+32)).toNumber();return ks(t,r+32,r+32+n)}function U6(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):br.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function aN(t){const e=Sn(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function ope(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function Iz(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=Sn(t[n]);e[n]=aN(r),e.push(aN(i.length)),e.push(ope(i)),r+=32+Math.ceil(i.length/32)*32}return nl(e)}class oN{constructor(e,r,n,i){At(this,"provider",e),At(this,"name",n),At(this,"address",e.formatter.address(r)),At(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(e=>zt.from(e).eq(1)).catch(e=>{if(e.code===tt.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return ur(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:nl([e,wb(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=nl(["0x9061b923",Iz([Tne(this.name),n.data])]));try{let s=yield this.provider.call(n);return Sn(s).length%32===4&&br.throwError("resolver threw error",tt.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=Q1(s,0)),s}catch(s){if(s.code===tt.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return ur(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?Q1(n,0):null})}_getAddress(e,r){const n=ape[String(e)];if(n==null&&br.throwError(`unsupported coin type: ${e}`,tt.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=Sn(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const a=parseInt(s[1],16);if(s[2].length===a*2&&a>=1&&a<=75)return iN(Zg([[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 a=parseInt(s[1],16);if(s[2].length===a*2&&a>=1&&a<=75)return iN(Zg([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let a=i[0];if(a===0?s!==20&&s!==32&&(a=-1):a=-1,a>=0&&i.length===2+s&&s>=1&&s<=75){const o=II.toWords(i.slice(2));return o.unshift(a),II.encode(n.prefix,o)}}return null}getAddress(e){return ur(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Ine?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===tt.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",F6(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&br.throwError("invalid or unsupported coin data",tt.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return ur(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<sN.length;n++){const i=r.match(sN[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:U6(r)}
342;case"erc721":case"erc1155":{const a=s==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:s,content:r});const o=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=ca(zt.from(c[1]).toHexString(),32);if(s==="erc721"){const m=this.provider.formatter.callAddress(yield this.provider.call({to:l,data:nl(["0x6352211e",u])}));if(o!==m)return null;e.push({type:"owner",content:m})}else if(s==="erc1155"){const m=zt.from(yield this.provider.call({to:l,data:nl(["0x00fdd58e",ca(o,32),u])}));if(m.isZero())return null;e.push({type:"balance",content:m.toString()})}const d={to:this.provider.formatter.address(c[0]),data:nl([a,u])};let f=Db(yield this.provider.call(d),0);if(f==null)return null;e.push({type:"metadata-url-base",content:f}),s==="erc1155"&&(f=f.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:f})),f.match(/^ipfs:/i)&&(f=U6(f)),e.push({type:"metadata-url",content:f});const h=yield bS(f);if(!h)return null;e.push({type:"metadata",content:JSON.stringify(h)});let g=h.image;if(typeof g!="string")return null;if(!g.match(/^(https:\/\/|data:)/i)){if(g.match(Tz)==null)return null;e.push({type:"url-ipfs",content:g}),g=U6(g)}return e.push({type:"url",content:g}),{linkage:e,url:g}}}}}catch{}return null})}getContentHash(){return ur(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 a=parseInt(r[3],16);if(r[4].length===a*2)return"ipfs://"+H_.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 a=parseInt(n[3],16);if(n[4].length===a*2)return"ipns://"+H_.encode("0x"+n[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===64)return"bzz://"+i[1];const s=e.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&s[1].length===68){const a={"=":"","+":"-","/":"_"};return"sia://"+bB("0x"+s[1]).replace(/[=+\/]/g,c=>a[c])}return br.throwError("invalid or unsupported content hash data",tt.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ur(this,void 0,void 0,function*(){let r=jp(e);r=Zg([F6(64),F6(r.length),r]),r.length%32!==0&&(r=Zg([r,ca("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Zn(r));return n==null||n==="0x"?null:sy(n)})}}let B6=null,cpe=1;class lpe extends EB{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),At(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=Wh(new.target,"getNetwork")(e);r?(At(this,"_network",r),this.emit("network",r,null)):br.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ur(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||br.throwError("no network detected",tt.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:At(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return n1(()=>this._ready().then(e=>e,e=>{if(!(e.code===tt.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return B6==null&&(B6=new Ot),B6}static getNetwork(e){return Ahe(e??"homestead")}ccipReadFetch(e,r,n){return ur(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),a=[];for(let o=0;o<n.length;o++){const c=n[o],l=c.replace("{sender}",i).replace("{data}",s),u=c.indexOf("{data}")>=0?null:JSON.stringify({data:s,sender:i}),d=yield bS({url:l,errorPassThrough:!0},u,(h,g)=>(h.status=g.statusCode,h));if(d.data)return d.data;const f=d.message||"unknown error";
342if(d.status>=400&&d.status<500)return br.throwError(`response not found during CCIP fetch: ${f}`,tt.errors.SERVER_ERROR,{url:c,errorMessage:f});a.push(f)}return br.throwError(`error encountered during CCIP fetch: ${a.map(o=>JSON.stringify(o)).join(", ")}`,tt.errors.SERVER_ERROR,{urls:n,errorMessages:a})})}_getInternalBlockNumber(e){return ur(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(cg()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=cg(),n=si({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 a=cg();return i=zt.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:r,respTime:a}});return this._internalBlockNumber=n,n.catch(i=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return ur(this,void 0,void 0,function*(){const e=cpe++,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)br.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",br.makeError("network block skew detected",tt.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 a=this.getTransactionReceipt(s).then(o=>(!o||o.blockNumber==null||(this._emitted["t:"+s]=o.blockNumber,this.emit(s,o)),null)).catch(o=>{this.emit("error",o)});r.push(a);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 a=s.toBlock-this._maxFilterBlockRange;a>s.fromBlock&&(s.fromBlock=a),s.fromBlock<0&&(s.fromBlock=0);const o=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(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 ur(this,void 0,void 0,function*(){return br.throwError("provider does not support network detection",tt.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ur(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 nN(0),this._network;const n=br.makeError("underlying network changed",tt.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=cg();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=cg(),(this._fastBlockNumber==null||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return ur(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return ur(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((a,o)=>{const c=[];let l=!1;
342const u=function(){return l?!0:(l=!0,c.forEach(f=>{f()}),!1)},d=f=>{f.confirmations<r||u()||a(f)};if(this.on(e,d),c.push(()=>{this.removeListener(e,d)}),i){let f=i.startBlock,h=null;const g=m=>ur(this,void 0,void 0,function*(){l||(yield nN(1e3),this.getTransactionCount(i.from).then(y=>ur(this,void 0,void 0,function*(){if(!l){if(y<=i.nonce)f=m;else{{const b=yield this.getTransaction(e);if(b&&b.blockNumber!=null)return}for(h==null&&(h=f-3,h<i.startBlock&&(h=i.startBlock));h<=m;){if(l)return;const b=yield this.getBlockWithTransactions(h);for(let E=0;E<b.transactions.length;E++){const v=b.transactions[E];if(v.hash===e)return;if(v.from===i.from&&v.nonce===i.nonce){if(l)return;const w=yield this.waitForTransaction(v.hash,r);if(u())return;let x="replaced";v.data===i.data&&v.to===i.to&&v.value.eq(i.value)?x="repriced":v.data==="0x"&&v.from===v.to&&v.value.isZero()&&(x="cancelled"),o(br.makeError("transaction was replaced",tt.errors.TRANSACTION_REPLACED,{cancelled:x==="replaced"||x==="cancelled",reason:x,replacement:this._wrapTransaction(v),hash:e,receipt:w}));return}}h++}}l||this.once("block",g)}}),y=>{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 f=setTimeout(()=>{u()||o(br.makeError("timeout exceeded",tt.errors.TIMEOUT,{timeout:n}))},n);f.unref&&f.unref(),c.push(()=>{clearTimeout(f)})}})})}getBlockNumber(){return ur(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return zt.from(e)}catch(r){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield si({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return zt.from(i)}catch(s){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield si({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return zt.from(i).toNumber()}catch(s){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield si({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Zn(i)}catch(s){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield si({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(a=>
342TC(a))}),s=yield this.perform("getStorageAt",i);try{return Zn(s)}catch(a){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:a})}})}_wrapTransaction(e,r,n){if(r!=null&&Ef(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&br.throwError("Transaction hash mismatch from Provider.sendTransaction.",tt.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,a)=>ur(this,void 0,void 0,function*(){s==null&&(s=1),a==null&&(a=0);let o;s!==0&&n!=null&&(o={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,a,o);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&br.throwError("transaction failed",tt.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>Zn(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 ur(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{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?zt.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?Zn(s):null))}),this.formatter.transactionRequest(yield si(n))})}_getFilter(e){return ur(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 si(r))})}_call(e,r,n){return ur(this,void 0,void 0,function*(){n>=rpe&&br.throwError("CCIP read exceeded maximum redirections",tt.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"&&Ef(s)%32===4)try{const a=ks(s,4),o=ks(a,0,32);zt.from(o).eq(i)||br.throwError("CCIP Read sender did not match",tt.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=zt.from(ks(a,32,64)).toNumber(),u=zt.from(ks(a,l,l+32)).toNumber(),d=ks(a,l+32);for(let b=0;b<u;b++){const E=Db(d,b*32);E==null&&br.throwError("CCIP Read contained corrupt URL string",tt.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s}),c.push(E)}const f=Q1(a,64);zt.from(ks(a,100,128)).isZero()||br.throwError("CCIP Read callback selector included junk",tt.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const h=ks(a,96,100),g=Q1(a,128),m=yield this.ccipReadFetch(e,f,c);m==null&&br.throwError("CCIP Read disabled or provided no URLs",tt.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const y={to:i,data:nl([h,Iz([m,g])])};return this._call(y,r,n+1)}catch(a){if(a.code===tt.errors.SERVER_ERROR)throw a}try{return Zn(s)}catch(a){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:r},result:s,error:a})}})}call(e,r){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield si({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(e.cci
342pReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)})}estimateGas(e){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield si({transaction:this._getTransactionRequest(e)}),n=yield this.perform("estimateGas",r);try{return zt.from(n)}catch(i){return br.throwError("bad result from backend",tt.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:i})}})}_getAddress(e){return ur(this,void 0,void 0,function*(){e=yield e,typeof e!="string"&&br.throwArgumentError("invalid address or ENS name","name",e);const r=yield this.resolveName(e);return r==null&&br.throwError("ENS name not configured",tt.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),r})}_getBlock(e,r){return ur(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let n=-128;const i={includeTransactions:!!r};if(ia(e,32))i.blockHash=e;else try{i.blockTag=yield this._getBlockTag(e),ia(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16))}catch{br.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return n1(()=>ur(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 a=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){a==null&&(a=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let u=a-l.blockNumber+1;u<=0&&(u=1),l.confirmations=u}}const o=this.formatter.blockWithTransactions(s);return o.transactions=o.transactions.map(c=>this._wrapTransaction(c)),o}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ur(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return n1(()=>ur(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 a=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;a<=0&&(a=1),i.confirmations=a}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return ur(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return n1(()=>ur(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 a=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;a<=0&&(a=1),i.confirmations=a}return i}),{oncePoll:this})})}getLogs(e){return ur(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield si({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),Ot.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return ur(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ur(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&br.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 ur(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 oN(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return ur(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||br.throwError("network does not support ENS",tt.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+wb(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return ur(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(ia(e))throw n}typeof e!="string"&&br.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return ur(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=Db(yield this.call({to:n,data:"0x691f3431"+wb(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return ur(this,void 0,void 0,function*(){let r=null;if(ia(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",a=yield this._getResolver(s,"getAvatar");if(!a)return null;r=new oN(this,a,s);try{const o=yield r.getAvatar();if(o)return o.url}catch(o){if(o.code!==tt.errors.CALL_EXCEPTION)throw o}try{const o=Db(yield this.call({to:a,data:"0x691f3431"+wb(s).substring(2)}),0);r=yield this.getResolver(o)}catch(o){if(o.code!==tt.errors.CALL_EXCEPTION)throw o;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 br.throwError(e+" not implemented",tt.errors.NOT_IMPLEMENT
342ED,{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 spe(xh(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=xh(e);return this._events=this._events.filter(a=>a.tag!==s?!0:(setTimeout(()=>{a.listener.apply(this,r)},0),n=!0,a.once?(i.push(a),!1):!0)),i.forEach(a=>{this._stopEvent(a)}),n}listenerCount(e){if(!e)return this._events.length;let r=xh(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=xh(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=xh(e);return this._events=this._events.filter(a=>a.tag!==s||a.listener!=r||i?!0:(i=!0,n.push(a),!1)),n.forEach(a=>{this._stopEvent(a)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=xh(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const upe="abstract-signer/5.8.0";var Va=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};const Ca=new tt(upe),dpe=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],fpe=[tt.errors.INSUFFICIENT_FUNDS,tt.errors.NONCE_EXPIRED,tt.errors.REPLACEMENT_UNDERPRICED];class yy{constructor(){Ca.checkAbstract(new.target,yy),At(this,"_isSigner",!0)}getBalance(e){return Va(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Va(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Va(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield si(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Va(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield si(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Va(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 Va(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Va(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Va(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Va(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)dpe.indexOf(n)===-1&&Ca.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=ji(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()&&Ca.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Va(this,void 0,void 0,function*(){const r=yield si(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Va(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Ca.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)?Ca.throwArgumentError("eip-1559 transaction do n
342ot support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ca.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&&Ca.throwError("network does not support EIP-1559",tt.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ca.throwError("failed to get consistent fee data",tt.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
342it==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(fpe.indexOf(i.code)>=0)throw i;return Ca.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",tt.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]&&Ca.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield si(r)})}_checkProvider(e){this.provider||Ca.throwError("missing provider",tt.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class a3 extends yy{constructor(e,r){super(),At(this,"address",e),At(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ca.throwError(e,tt.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 a3(this.address,e)}}var Qc=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};const Gn=new tt(my),hpe=["call","estimateGas"];function S1(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=ia(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=S1(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return S1(JSON.parse(t),e)}catch{}return null}function kz(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=S1(e,!0);if(s)return s.data;Gn.throwError("missing revert data in call exception; Transaction reverted without a reason string",tt.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=S1(e.body,!1);s==null&&(s=S1(e,!1)),s&&Gn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",tt.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===tt.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)&&Gn.throwError("insufficient funds for intrinsic transaction cost",tt.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Gn.throwError("nonce has already been used",tt.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Gn.throwError("replacement fee too low",tt.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Gn.throwError("legacy pre-eip-155 transactions not supported",tt.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),hpe.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Gn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",tt.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function cN(t){return new Promise(function(e){setTimeout(e,t)})}function ppe(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 lg(t){return t&&t.toLowerCase()}const Q_={};class $z extends yy{constructor(e,r,n){if(super(),e!==Q_)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");At(this,"provider",r),n==null&&(n=0),typeof n=="string"?(At(this,"_address",this.provider.formatter.address(n)),At(this,"_index",null)):typeof n=="number"?(At(this,"_index",n),At(this,"_address",null)):Gn.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Gn.throwError("cannot alter JSON-RPC Signer connection",tt.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new gpe(Q_,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&&Gn.throwError("unknown account #"+this._index,tt.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=ji(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));
342if(e.gasLimit==null){const n=ji(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Qc(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Gn.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),si({tx:si(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Gn.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(a=>a,a=>(typeof a.message=="string"&&a.message.match(/user denied/i)&&Gn.throwError("user rejected transaction",tt.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),kz("sendTransaction",a,s)))})}signTransaction(e){return Gn.throwError("signing transactions is unsupported",tt.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Qc(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 n1(()=>Qc(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 Qc(this,void 0,void 0,function*(){const r=typeof e=="string"?jp(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Zn(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Gn.throwError("user rejected signing",tt.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Qc(this,void 0,void 0,function*(){const r=typeof e=="string"?jp(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Zn(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Gn.throwError("user rejected signing",tt.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Qc(this,void 0,void 0,function*(){const i=yield kI.resolveNames(e,r,n,a=>this.provider.resolveName(a)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(kI.getPayload(i.domain,r,i.value))])}catch(a){throw typeof a.message=="string"&&a.message.match(/user denied/i)&&Gn.throwError("user rejected signing",tt.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),a}})}unlock(e){return Qc(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class gpe extends $z{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 mpe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Nz extends lpe{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(a=>{i(a)},a=>{s(a)})},0)})),super(n),e||(e=Wh(this.constructor,"defaultUrl")()),typeof e=="string"?At(this,"connection",Object.freeze({url:e})):At(this,"connection",Object.freeze(ji(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 Qc(this,void 0,void 0,function*(){yield cN(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=Wh(this.constructor,"getNetwork");try{return r(zt.from(e).toNumber())}catch(n){return Gn.throwError("could not detect network",tt.errors.NETWORK_E
342RROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Gn.throwError("could not detect network",tt.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new $z(Q_,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:ay(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=bS(this.connection,JSON.stringify(n),ppe).then(a=>(this.emit("debug",{action:"response",request:n,response:a,provider:this}),a),a=>{throw this.emit("debug",{action:"response",error:a,request:n,provider:this}),a});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",[lg(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[lg(r.address),r.blockTag]];case"getCode":return["eth_getCode",[lg(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[lg(r.address),ca(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",[Wh(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Wh(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=lg(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Qc(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&zt.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=ji(r),r.transaction=ji(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Gn.throwError(e+" not implemented",tt.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return kz(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 a=Promise.resolve();return s.forEach(function(o){e._emitted["t:"+o.toLowerCase()]="pending",a=a.then(function(){return e.getTransaction(o).then(function(c){return e.emit("pending",c),null})})}),a.then(function(){return cN(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=ji(mpe);if(r)for(const s in r)r[s]&&(n[s]=!0);vB(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const a=TC(zt.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=a}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=Zn(e[s]))}),e.accessList&&(i.accessList=C0(e.accessList)),i}}var ype=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};const bpe=new tt(my);class vpe extends Nz{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return ype(this,void 0,void 0,function*(){let r=this.network;
342return r==null&&(r=yield e.detectNetwork.call(this),r||bpe.throwError("no network detected",tt.errors.UNKNOWN_ERROR,{}),this._network==null&&(At(this,"_network",r),this.emit("network",r,null))),r})}}const lN=new tt(my);let wpe=1;function uN(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:wpe++,jsonrpc:"2.0"};return new Promise((a,o)=>{this.emit("debug",{action:"request",fetcher:r,request:ay(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),o(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,o(u)}a(l.result)})})}}function Epe(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:ay(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 Iv extends Nz{constructor(e,r){e==null&&lN.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=Epe(e)):e.sendAsync?i=uN(e,e.sendAsync.bind(e)):e.send?i=uN(e,e.send.bind(e)):lN.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),At(this,"jsonRpcFetchFunc",i),At(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}function xpe(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 _pe(){const t=new Set;let e=[];const r=()=>xpe(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)}}}var It={},i1={exports:{}},Cpe=i1.exports,dN;function Spe(){return dN||(dN=1,(function(t,e){(function(r,n){var i="1.0.41",s="",a="?",o="function",c="undefined",l="object",u="string",d="major",f="model",h="name",g="type",m="vendor",y="version",b="architecture",E="console",v="mobile",w="tablet",x="smarttv",_="wearable",S="embedded",A=500,I="Amazon",$="Apple",P="ASUS",j="BlackBerry",L="Browser",B="Chrome",k="Edge",D="Firefox",q="Google",U="Honor",W="Huawei",V="Lenovo",Y="LG",K="Microsoft",ge="Motorola",ae="Nvidia",ce="OnePlus",Q="Opera",se="OPPO",me="Samsung",_e="Sharp",z="Sony",R="Xiaomi",M="Zebra",ee="Facebook",ie="Chromium OS",le="Mac OS",ye=" Browser",fe=function(te,ue){var pe={};for(var Ie in te)ue[Ie]&&ue[Ie].length%2===0?pe[Ie]=ue[Ie].concat(te[Ie]):pe[Ie]=te[Ie];return pe},we=function(te){for(var ue={},pe=0;pe<te.length;pe++)ue[te[pe].toUpperCase()]=te[pe];return ue},Ce=function(te,ue){return typeof te===u?ne(ue).indexOf(ne(te))!==-1:!1},ne=function(te){return te.toLowerCase()},Re=function(te){return typeof te===u?te.replace(/[^\d\.]/g,s).split(".")[0]:n},Pe=function(te,ue){if(typeof te===u)return te=te.replace(/^\s\s*/,s),typeof ue===c?te:te.substring(0,A)},Ae=function(te,ue){for(var pe=0,Ie,je,Te,ve,Oe,at;pe<ue.length&&!Oe;){var gt=ue[pe],$t=ue[pe+1];for(Ie=je=0;Ie<gt.length&&!Oe&>[Ie];)if(Oe=gt[Ie++].exec(te),Oe)for(Te=0;Te<$t.length;Te++)at=Oe[++je],ve=$t[Te],typeof ve===l&&ve.length>0?ve.length===2?typeof ve[1]==o?this[ve[0]]=ve[1].call(this,at):this[ve[0]]=ve[1]:ve.length===3?typeof ve[1]===o&&!(ve[1].exec&&ve[1].test)?this[ve[0]]=at?ve[1].call(this,at,ve[2]):n:this[ve[0]]=at?at.replace(ve[1],ve[2]):n:ve.length===4&&(this[ve[0]]=at?ve[3].call(this,at.replace(ve[1],ve[2])):n):this[ve]=at||n;pe+=2}},Ue=function(te,ue){for(var pe in ue)if(typeof ue[pe]===l&&ue[pe].length>0){for(var Ie=0;Ie<ue[pe].length;Ie++)if(Ce(ue[pe][Ie],te))return pe===a?n:pe}else if(Ce(ue[pe],te))return pe===a?n:pe;return ue.hasOwnProperty("*")?ue["*"]:te},He={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Qe={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},O={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,Q+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,Q+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,Q]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+L]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+L]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+L],y],[/\bfocus\/([\w\.]+)/i],[y,[h,D+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,Q+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,Q+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI"+ye]],[/fxios\/([\w\.-]+)/i],[y,[h,D]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+ye],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,me+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,ee],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.
vendor: 14,929 bytes, line 342
342+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,B+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,B+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+L]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,Ue,He]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,D+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[b,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[b,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[b,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[b,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[b,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[b,/ower/,s,ne]],[/ sun4\w[;\)]/i],[[b,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[b,ne]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[m,me],[g,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[f,[m,me],[g,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[m,$],[g,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[m,$],[g,w]],[/(macintosh);/i],[f,[m,$]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[m,_e],[g,v]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[f,[m,U],[g,w]],[/honor([-\w ]+)[;\)]/i],[f,[m,U],[g,v]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[f,[m,W],[g,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[m,W],[g,v]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[f,/_/g," "],[m,R],[g,w]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[f,/_/g," "],[m,R],[g,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[m,se],[g,v]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[f,[m,Ue,{OnePlus:["304","403","203"],"*":se}],[g,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[m,"Vivo"],[g,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[f,[m,"Realme"],[g,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[m,ge],[g,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[m,ge],[g,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[m,Y],[g,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[m,Y],[g,v]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[f,[m,V],[g,w]],[/(nokia) (t[12][01])/i],[m,f,[g,w]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[f,/_/g," "],[g,v],[m,"Nokia"]],[/(pixel (c|tablet))\b/i],[f,[m,q],[g,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[m,q],[g,v]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[m,z],[g,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[m,z],[g,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[m,ce],[g,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[m,I],[g,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[m,I],[g,v]],[/(playbook);[-\w\),; ]+(rim)/i],[f,m,[g,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[m,j],[g,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[m,P],[g,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[m,P],[g,v]],[/(nexus 9)/i],[f,[m,"HTC"],[g,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[m,[f,/_/g," "],[g,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[f,[m,"TCL"],[g,w]],[/(itel) ((\w+))/i],[[m,ne],f,[g,Ue,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[m,"Acer"],[g,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[m,"Meizu"],[g,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[f,[m,"Ulefone"],[g,v]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[f,[m,"Energizer"],[g,v]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[f,[m,"Cat"],[g,v]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[f,[m,"Smartfren"],[g,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[f,[m,"Nothing"],[g,v]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[f,[m,"Archos"],[g,w]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[f,[m,"Archos"],[g,v]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[m,f,[g,w]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[m,f,[g,v]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[m,f,[g,w]],[/(surface duo)/i],[f,[m,K],[g,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[m,"Fairphone"],[g,v]],[/(u304aa)/i],[f,[m,"AT&T"],[g,v]],[/\bsie-(\w*)/i],[f,[m,"Siemens"],[g,v]],[/\b(rct\w+) b/i],[f,[m,"RCA"],[g,w]],[/\b(venue[\d ]{2,7}) b/i],[f,[m,"Dell"],[g,w]],[/\b(q(?:mv|ta)\w+) b/i],[f,[m,"Verizon"],[g,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[m,"Barnes & Noble"],[g,w]],[/\b(tm\d{3}\w+) b/i],[f,[m,"NuVision"],[g,w]],[/\b(k88) b/i],[f,[m,"ZTE"],[g,w]],[/\b(nx\d{3}j) b/i],[f,[m,"ZTE"],[g,v]],[/\b(gen\d{3}) b.+49h/i],[f,[m,"Swiss"],[g,v]],[/\b(zur\d{3}) b/i],[f,[m,"Swiss"],[g,w]],[/\b((zeki)?tb.*\b) b/i],[f,[m,"Zeki"],[g,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[m,"Dragon Touch"],f,[g,w]],[/\b(ns-?\w{0,9}) b/i],[f,[m,"Insignia"],[g,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[m,"NextBook"],[g,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[m,"Voice"],f,[g,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[m,"LvTel"],f,[g,v]],[/\b(ph-1) /i],[f,[m,"Essential"],[g,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[m,"Envizen"],[g,w]],[/\b(trio[-\w\. ]+) b/i],[f,[m,"MachSpeed"],[g,w]],[/\btu_(1491) b/i],[f,[m,"Rotor"],[g,w]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[f,[m,ae],[g,w]],[/(sprint) (\w+)/i],[m,f,[g,v]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[m,K],[g,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[m,M],[g,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[m,M],[g,v]],[/smart-tv.+(samsung)/i],[m,[g,x]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[m,me],[g,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[m,Y],[g,x]],[/(apple) ?tv/i],[m,[f,$+" TV"],[g,x]],[/crkey/i],[[f,B+"cast"],[m,q],[g,x]],[/droid.+aft(\w+)( bui|\))/i],[f,[m,I],[g,x]],[/(shield \w+ tv)/i],[f,[m,ae],[g,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[m,_e],[g,x]],[/(bravia[\w ]+)( bui|\))/i],[f,[m,z],[g,x]],[/(mi(tv|box)-?\w+) bui/i],[f,[m,R],[g,x]],[/Hbbtv.*(technisat) (.*);/i],[m,f,[g,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[m,Pe],[f,Pe],[g,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[f,[g,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[g,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[m,f,[g,E]],[/droid.+; (shield)( bui|\))/i],[f,[m,ae],[g,E]],[/(playstation \w+)/i],[f,[m,z],[g,E]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[m,K],[g,E]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[f,[m,me],[g,_]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[m,f,[g,_]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[f,[m,se],[g,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[m,$],[g,_]],[/(opwwe\d{3})/i],[f,[m,ce],[g,_]],[/(moto 360)/i],[f,[m,ge],[g,_]],[/(smartwatch 3)/i],[f,[m,z],[g,_]],[/(g watch r)/i],[f,[m,Y],[g,_]],[/droid.+; (wt63?0{2,3})\)/i],[f,[m,M],[g,_]],[/droid.+; (glass) \d/i],[f,[m,q],[g,_]],[/(pico) (4|neo3(?: link|pro)?)/i],[m,f,[g,_]],[/; (quest( \d| pro)?)/i],[f,[m,ee],[g,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[m,[g,S]],[/(aeobc)\b/i],[f,[m,I],[g,S]],[/(homepod).+mac os/i],[f,[m,$],[g,S]],[/windows iot/i],[[g,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[f,[g,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[g,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,v]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[f,[m,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,k+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[h,[y,Ue,Qe]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,Ue,Qe],[h,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,le],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],y],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[h,y],[/\(bb(10);/i],[y,[h,j]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,D+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,B+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,ie],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},T=function(te,ue){if(typeof te===l&&(ue=te,te=n),!(this instanceof T))return new T(te,ue).getResult();var pe=typeof r!==c&&r.navigator?r.navigator:n,Ie=te||(pe&&pe.userAgent?pe.userAgent:s),je=pe&&pe.userAgentData?pe.userAgentData:n,Te=ue?fe(O,ue):O,ve=pe&&pe.userAgent==Ie;return this.getBrowser=function(){var Oe={};return Oe[h]=n,Oe[y]=n,Ae.call(Oe,Ie,Te.browser),Oe[d]=Re(Oe[y]),ve&&pe&&pe.brave&&typeof pe.brave.isBrave==o&&(Oe[h]="Brave"),Oe},this.getCPU=function(){var Oe={};return Oe[b]=n,Ae.call(Oe,Ie,Te.cpu),Oe},this.getDevice=function(){var Oe={};return Oe[m]=n,Oe[f]=n,Oe[g]=n,Ae.call(Oe,Ie,Te.device),ve&&!Oe[g]&&je&&je.mobile&&(Oe[g]=v),ve&&Oe[f]=="Macintosh"&&pe&&typeof pe.standalone!==c&&pe.maxTouchPoints&&pe.maxTouchPoints>2&&(Oe[f]="iPad",Oe[g]=w),Oe},this.getEngine=function(){var Oe={};return Oe[h]=n,Oe[y]=n,Ae.call(Oe,Ie,Te.engine),Oe},this.getOS=function(){var Oe={};return Oe[h]=n,Oe[y]=n,Ae.call(Oe,Ie,Te.os),ve&&!Oe[h]&&je&&je.platform&&je.platform!="Unknown"&&(Oe[h]=je.platform.replace(/chrome os/i,ie).replace(/macos/i,le)),Oe},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ie},this.setUA=function(Oe){return Ie=typeof Oe===u&&Oe.length>A?Pe(Oe,A):Oe,this},this.setUA(Ie),this};T.VERSION=i,T.BROWSER=we([h,y,d]),T.CPU=we([b]),T.DEVICE=we([f,m,g,E,v,x,w,_,S]),T.ENGINE=T.OS=we([h,y]),t.exports&&(e=t.exports=T),e.UAParser=T;var N=typeof r!==c&&(r.jQuery||r.Zepto);if(N&&!N.ua){var G=new T;N.ua=G.getResult(),N.ua.get=function(){return G.getUA()},N.ua.set=function(te){G.setUA(te);var ue=G.getResult();for(var pe in ue)N.ua[pe]=ue[pe]}}})(typeof window=="object"?window:Cpe)}
342)(i1,i1.exports)),i1.exports}var fN;function Ape(){if(fN)return It;fN=1,Object.defineProperty(It,"__esModule",{value:!0});function t(Ne){return Ne&&typeof Ne=="object"&&"default"in Ne?Ne.default:Ne}var e=CC(),r=t(e),n=Spe(),i=new n,s=i.getBrowser(),a=i.getCPU(),o=i.getDevice(),c=i.getEngine(),l=i.getOS(),u=i.getUA(),d=function(he){return i.setUA(he)},f=function(he){if(!he){console.error("No userAgent string was provided");return}var be=new n(he);return{UA:be,browser:be.getBrowser(),cpu:be.getCPU(),device:be.getDevice(),engine:be.getEngine(),os:be.getOS(),ua:be.getUA(),setUserAgent:function(Ve){return be.setUA(Ve)}}},h=Object.freeze({ClientUAInstance:i,browser:s,cpu:a,device:o,engine:c,os:l,ua:u,setUa:d,parseUserAgent:f});function g(Ne,he){var be=Object.keys(Ne);if(Object.getOwnPropertySymbols){var Le=Object.getOwnPropertySymbols(Ne);he&&(Le=Le.filter(function(Ve){return Object.getOwnPropertyDescriptor(Ne,Ve).enumerable})),be.push.apply(be,Le)}return be}function m(Ne){for(var he=1;he<arguments.length;he++){var be=arguments[he]!=null?arguments[he]:{};he%2?g(Object(be),!0).forEach(function(Le){w(Ne,Le,be[Le])}):Object.getOwnPropertyDescriptors?Object.defineProperties(Ne,Object.getOwnPropertyDescriptors(be)):g(Object(be)).forEach(function(Le){Object.defineProperty(Ne,Le,Object.getOwnPropertyDescriptor(be,Le))})}return Ne}function y(Ne){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?y=function(he){return typeof he}:y=function(he){return he&&typeof Symbol=="function"&&he.constructor===Symbol&&he!==Symbol.prototype?"symbol":typeof he},y(Ne)}function b(Ne,he){if(!(Ne instanceof he))throw new TypeError("Cannot call a class as a function")}function E(Ne,he){for(var be=0;be<he.length;be++){var Le=he[be];Le.enumerable=Le.enumerable||!1,Le.configurable=!0,"value"in Le&&(Le.writable=!0),Object.defineProperty(Ne,Le.key,Le)}}function v(Ne,he,be){return he&&E(Ne.prototype,he),Ne}function w(Ne,he,be){return he in Ne?Object.defineProperty(Ne,he,{value:be,enumerable:!0,configurable:!0,writable:!0}):Ne[he]=be,Ne}function x(){return x=Object.assign||function(Ne){for(var he=1;he<arguments.length;he++){var be=arguments[he];for(var Le in be)Object.prototype.hasOwnProperty.call(be,Le)&&(Ne[Le]=be[Le])}return Ne},x.apply(this,arguments)}function _(Ne,he){if(typeof he!="function"&&he!==null)throw new TypeError("Super expression must either be null or a function");Ne.prototype=Object.create(he&&he.prototype,{constructor:{value:Ne,writable:!0,configurable:!0}}),he&&A(Ne,he)}function S(Ne){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(be){return be.__proto__||Object.getPrototypeOf(be)},S(Ne)}function A(Ne,he){return A=Object.setPrototypeOf||function(Le,Ve){return Le.__proto__=Ve,Le},A(Ne,he)}function I(Ne,he){if(Ne==null)return{};var be={},Le=Object.keys(Ne),Ve,Xt;for(Xt=0;Xt<Le.length;Xt++)Ve=Le[Xt],!(he.indexOf(Ve)>=0)&&(be[Ve]=Ne[Ve]);return be}function $(Ne,he){if(Ne==null)return{};var be=I(Ne,he),Le,Ve;if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(Ne);for(Ve=0;Ve<Xt.length;Ve++)Le=Xt[Ve],!(he.indexOf(Le)>=0)&&Object.prototype.propertyIsEnumerable.call(Ne,Le)&&(be[Le]=Ne[Le])}return be}function P(Ne){if(Ne===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ne}function j(Ne,he){if(he&&(typeof he=="object"||typeof he=="function"))return he;if(he!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(Ne)}function L(Ne,he){return B(Ne)||k(Ne,he)||D(Ne,he)||U()}function B(Ne){if(Array.isArray(Ne))return Ne}function k(Ne,he){var be=Ne==null?null:typeof Symbol<"u"&&Ne[Symbol.iterator]||Ne["@@iterator"];if(be!=null){var Le=[],Ve=!0,Xt=!1,or,Rr;try{for(be=be.call(Ne);!(Ve=(or=be.next()).done)&&(Le.push(or.value),!(he&&Le.length===he));Ve=!0);}catch(ki){Xt=!0,Rr=ki}finally{try{!Ve&&be.return!=null&&be.return()}finally{if(Xt)throw Rr}}return Le}}function D(Ne,he){if(Ne){if(typeof Ne=="string")return q(Ne,he);var be=Object.prototype.toString.call(Ne).slice(8,-1);if(be==="Object"&&Ne.constructor&&(be=Ne.constructor.name),be==="Map"||be==="Set")return Array.from(Ne);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return q(Ne,he)}}function q(Ne,he){(he==null||he>Ne.length)&&(he=Ne.length);for(var be=0,Le=new Array(he);be<he;be++)Le[be]=Ne[be];return Le}
342function U(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 343In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},V={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},Y={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},K={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},ge=function(he){switch(he){case W.Mobile:return{isMobile:!0};case W.Tablet:return{isTablet:!0};case W.SmartTv:return{isSmartTV:!0};case W.Console:return{isConsole:!0};case W.Wearable:return{isWearable:!0};case W.Browser:return{isBrowser:!0};case W.Embedded:return{isEmbedded:!0};default:return K}},ae=function(he){return d(he)},ce=function(he){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return he||be},Q=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},se=function(he){var be=Q();return be&&be.platform&&(be.platform.indexOf(he)!==-1||be.platform==="MacIntel"&&be.maxTouchPoints>1&&!window.MSStream)},me=function(he,be,Le,Ve,Xt){return{isBrowser:he,browserMajorVersion:ce(be.major),browserFullVersion:ce(be.version),browserName:ce(be.name),engineName:ce(Le.name),engineVersion:ce(Le.version),osName:ce(Ve.name),osVersion:ce(Ve.version),userAgent:ce(Xt)}},_e=function(he,be,Le,Ve){return m({},he,{vendor:ce(be.vendor),model:ce(be.model),os:ce(Le.name),osVersion:ce(Le.version),ua:ce(Ve)})},z=function(he,be,Le,Ve){return{isSmartTV:he,engineName:ce(be.name),engineVersion:ce(be.version),osName:ce(Le.name),osVersion:ce(Le.version),userAgent:ce(Ve)}},R=function(he,be,Le,Ve){return{isConsole:he,engineName:ce(be.name),engineVersion:ce(be.version),osName:ce(Le.name),osVersion:ce(Le.version),userAgent:ce(Ve)}},M=function(he,be,Le,Ve){return{isWearable:he,engineName:ce(be.name),engineVersion:ce(be.version),osName:ce(Le.name),osVersion:ce(Le.version),userAgent:ce(Ve)}},ee=function(he,be,Le,Ve,Xt){return{isEmbedded:he,vendor:ce(be.vendor),model:ce(be.model),engineName:ce(Le.name),engineVersion:ce(Le.version),osName:ce(Ve.name),osVersion:ce(Ve.version),userAgent:ce(Xt)}};function ie(Ne){var he=Ne?f(Ne):h,be=he.device,Le=he.browser,Ve=he.engine,Xt=he.os,or=he.ua,Rr=ge(be.type),ki=Rr.isBrowser,$i=Rr.isMobile,vd=Rr.isTablet,K0=Rr.isSmartTV,Q0=Rr.isConsole,Y0=Rr.isWearable,bh=Rr.isEmbedded;if(ki)return me(ki,Le,Ve,Xt,or);if(K0)return z(K0,Ve,Xt,or);if(Q0)return R(Q0,Ve,Xt,or);if($i||vd)return _e(Rr,be,Xt,or);if(Y0)return M(Y0,Ve,Xt,or);if(bh)return ee(bh,be,Ve,Xt,or)}var le=function(he){var be=he.type;return be===W.Mobile},ye=function(he){var be=he.type;return be===W.Tablet},fe=function(he){var be=he.type;return be===W.Mobile||be===W.Tablet},we=function(he){var be=he.type;return be===W.SmartTv},Ce=function(he){var be=he.type;return be===W.Browser},ne=function(he){var be=he.type;return be===W.Wearable},Re=function(he){var be=he.type;return be===W.Console},Pe=function(he){var be=he.type;return be===W.Embedded},Ae=function(he){var be=he.vendor;return ce(be)},Ue=function(he){var be=he.model;return ce(be)},He=function(he){var be=he.type;return ce(be,"browser")},Qe=function(he){var be=he.name;return be===Y.Android},O=function(he){var be=he.name;return be===Y.Windows},T=function(he){var be=he.name;return be===Y.MAC_OS},N=function(he){var be=he.name;return be===Y.WindowsPhone},G=function(he){var be=he.name;return be===Y.IOS},te=function(he){var be=he.version;return ce(be)},ue=function(he){var be=he.name;return ce(be)},pe=function(he){var be=he.name;return be===V.Chrome},Ie=function(he){var be=he.name;return be===V.Firefox},je=function(he){var be=he.name;return be===V.Chromium},Te=function(he){var be=he.name;return be===V.Edge},ve=function(he){var be=he.name;return be===V.Yandex},Oe=function(he){var be=he.name;return be===V.Safari||be===V.MobileSafari},at=function(he){var be=he.name;return be===V.MobileSafari},gt=function(he){var be=he.name;return be===V.Opera},$t=function(he){var be=he.name;return be===V.InternetExplorer||be===V.Ie},ir=function(he){var be=he.name;return be===V.MIUI},_r=function(he){var be=he.name;return be===V.SamsungBrowser},Ar=function(he){var be=he.version;return ce(be)},Zt=function(he){var be=he.major;return ce(be)},dr=function(he){var be=he.name;return ce(be)},gn=function(he){var be=he.name;return ce(be)},Ti=function(he){var be=he.version;return ce(be)},Ks=function(){var he=Q(),be=he&&he.userAgent&&he.userAgent.toLowerCase();return typeof be=="string"?/electron/.test(be):!1},ti=function(he){return typeof he=="string"&&he.indexOf("Edg/")!==-1},xn=function(){var he=Q();return he&&(/iPad|iPhone|iPod/.test(he.platform)||he.platform==="MacIntel"&&he.maxTouchPoints>1)&&!window.MSStream},Jr=function(){return se("iPad")},Qs=function(){return se("iPhone")},Wi=function(){return se("iPod")},jt=function(he){return ce(he)};function Wa(Ne){var he=Ne||h,be=he.device,Le=he.browser,Ve=he.os,Xt=he.engine,or=he.ua;return{isSmartTV:we(be),isConsole:Re(be),isWearable:ne(be),isEmbedded:Pe(be),isMobileSafari:at(Le)||Jr(),isChromium:je(Le),isMobile:fe(be)||Jr(),isMobileOnly:le(be),isTablet:ye(be)||Jr(),isBrowser:Ce(be),isDesktop:Ce(be),isAndroid:Qe(Ve),isWinPhone:N(Ve),isIOS:G(Ve)||Jr(),isChrome:pe(Le),isFirefox:Ie(Le),isSafari:Oe(Le),isOpera:gt(Le),isIE:$t(Le),osVersion:te(Ve),osName:ue(Ve),fullBrowserVersion:Ar(Le),browserVersion:Zt(Le),browserName:dr(Le),mobileVendor:Ae(be),mobileModel:Ue(be),engineName:gn(Xt),engineVersion:Ti(Xt),getUA:jt(or),isEdge:Te(Le)||ti(or),isYandex:ve
343(Le),deviceType:He(be),isIOS13:xn(),isIPad13:Jr(),isIPhone13:Qs(),isIPod13:Wi(),isElectron:Ks(),isEdgeChromium:ti(or),isLegacyEdge:Te(Le)&&!ti(or),isWindows:O(Ve),isMacOs:T(Ve),isMIUI:ir(Le),isSamsungBrowser:_r(Le)}}var $e=we(o),We=Re(o),Ke=ne(o),rt=Pe(o),Ze=at(s)||Jr(),_t=je(s),Et=fe(o)||Jr(),F=le(o),H=ye(o)||Jr(),J=Ce(o),Z=Ce(o),X=Qe(l),Ee=N(l),Me=G(l)||Jr(),De=pe(s),Be=Ie(s),Je=Oe(s),nt=gt(s),et=$t(s),Ct=te(l),Nt=ue(l),nr=Ar(s),gr=Zt(s),Fr=dr(s),kn=Ae(o),Wr=Ue(o),Kr=gn(c),en=Ti(c),wa=jt(u),zi=Te(s)||ti(u),er=ve(s),Or=He(o),tn=xn(),Ln=Jr(),Fn=Qs(),Ii=Wi(),Qr=Ks(),Er=ti(u),Mr=Te(s)&&!ti(u),Cr=O(l),$n=T(l),Ur=ir(s),mt=_r(s),Yt=function(he){if(!he||typeof he!="string"){console.error("No valid user agent string was provided");return}var be=f(he),Le=be.device,Ve=be.browser,Xt=be.os,or=be.engine,Rr=be.ua;return Wa({device:Le,browser:Ve,os:Xt,engine:or,ua:Rr})},Lt=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return X?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},St=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return J?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},Pt=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return et?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},fr=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return Me?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},qt=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return Et?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},vt=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return H?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},it=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return Ee?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},wt=function(he){var be=he.renderWithFragment,Le=he.children;he.viewClassName,he.style;var Ve=$(he,["renderWithFragment","children","viewClassName","style"]);return F?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},ct=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return $e?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},ft=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return We?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},xt=function(he){var be=he.renderWithFragment,Le=he.children,Ve=$(he,["renderWithFragment","children"]);return Ke?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Ve,Le):null},Bt=function(he){var be=he.renderWithFragment,Le=he.children;he.viewClassName,he.style;var Ve=he.condition,Xt=$(he,["renderWithFragment","children","viewClassName","style","condition"]);return Ve?be?r.createElement(e.Fragment,null,Le):r.createElement("div",Xt,Le):null};function Ft(Ne){return(function(he){_(be,he);function be(Le){var Ve;return b(this,be),Ve=j(this,S(be).call(this,Le)),Ve.isEventListenerAdded=!1,Ve.handleOrientationChange=Ve.handleOrientationChange.bind(P(Ve)),Ve.onOrientationChange=Ve.onOrientationChange.bind(P(Ve)),Ve.onPageLoad=Ve.onPageLoad.bind(P(Ve)),Ve.state={isLandscape:!1,isPortrait:!1},Ve}return v(be,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var Ve=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:Ve===0,isLandscape:Ve===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":y(window))!==void 0&&Et&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return r.createElement(Ne,x({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),be})(r.Component)}function Qt(){var Ne=e.useState(function(){var Xt=window.innerWidth>window.innerHeight?90:0;return{isPortrait:Xt===0,isLandscape:Xt===90,orientation:Xt===0?"portrait":"landscape"}}),he=L(Ne,2),be=he[0],Le=he[1],Ve=e.useCallback(function(){var Xt=window.innerWidth>window.innerHeight?90:0,or={isPortrait:Xt===0,isLandscape:Xt===90,orientation:Xt===0?"portrait":"landscape"};be.orientation!==or.orientation&&Le(or)},[be.orientation]);return e.useEffect(function(){return(typeof window>"u"?"undefined":y(window))!==void 0&&Et&&(Ve(),window.addEventListener("load",Ve,!1),window.addEventListener("resize",Ve,!1)),function(){window.removeEventListener("resize",Ve,!1),window.removeEventListener("load",Ve,!1)}},[Ve]),be}function Tr(Ne){var he=Ne||window.navigator.userAgent;return f(he)}function xr(Ne){var he=Ne||window.navigator.userAgent,be=Tr(he),Le=Wa(be);return[Le,be]}return It.AndroidView=Lt,It.BrowserTypes=V,It.BrowserView=St,It.ConsoleView=ft,It.CustomView=Bt,It.IEView=Pt,It.IOSView=fr,It.MobileOnlyView=wt,It.MobileView=qt,It.OsTypes=Y,It.SmartTVView=ct,It.TabletView=vt,It.WearableView=xt,It.WinPhoneView=it,It.browserName=Fr,It.browserVersion=gr,It.deviceDetect=ie,It.deviceType=Or,It.engineName=Kr,It.engineVersion=en,It.fullBrowserVersion=nr,It.getSelectorsByUserAgent=Yt,It.getUA=wa,It.isAndroid=X,It.isBrowser=J,It.isChrome=De,It.isChromium=_t,It.isConsole=We,It.isDesktop=Z,It.isEdge=zi,It.isEdgeChromium=Er,It.isElectron=Qr,It.isEmbedded=rt,It.isFirefox=Be,It.isIE=et,It.isIOS=Me,It.isIOS13=tn,It.isIPad13=Ln,It.isIPhone13=Fn,It.isIPod13=Ii,It.isLegacyEdge=Mr,It.isMIUI=Ur,It.isMacOs=$n,It.isMobile=Et,It.isMobileOnly=F,It.isMobileSafari=Ze,It.isOpera=nt,It.isSafari=Je,It.isSamsungBrowser=mt,It.isSmartTV=$e,It.isTablet=H,It.isWearable=Ke,It.isWinPhone=Ee,It.isWindows=Cr,It.isYandex=er,It.mobileModel=Wr,It.mobileVendor=kn,It.osName=Nt,It.osVersion=Ct,It.parseUserAgent=f,It.setUserAgent=ae,It.useDeviceData=Tr,It.useDeviceSelectors=xr,It.useMobileOrientation=Qt,It.withOrientationChange=Ft,It}var An=Ape();function hN(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var s=Number(r[i]),a=Number(n[i]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var Tpe={}.constructor;function hf(t){return t!=null&&t.constructor===Tpe}function Qp(t){"@babel/helpers - typeof";return Qp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qp(t)}function o3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ipe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,kpe(n.key),n)}}function c3(t,e,r){return e&&Ipe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kpe(t){var e=$pe(t,"string");return Qp(e)=="symbol"?e:e+""}function $pe(t,e){if(Qp(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Qp(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Npe="1.2.0",Ppe="1.7.35",pN=" ext. ",Ope=/^\d+$/,ui=(function(){function t(e){o3(this,t),Pz(e),this.metadata=e,Oz.call(this,e)}return c3(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(r){return r!=="001"})}},{key:"getCountryMetadata",value:function(r){return this.metadata.countries[r]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(r){return this.getCountryMetadata(r)!==void 0}},{key:"hasCallingCode",value:function(r){if(this.getCountryCodesForCallingCode(r))return!0;
vendor: 69,988 bytes, lines 343-355
343if(this.nonGeographic()){if(this.nonGeographic()[r])return!0}else{var n=this.countryCallingCodes()[r];if(n&&n.length===1&&n[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(r){return this.nonGeographic()?!!this.nonGeographic()[r]:!this.getCountryCodesForCallingCode(r)}},{key:"country",value:function(r){return this.selectNumberingPlan(r)}},{key:"selectNumberingPlan",value:function(r,n){if(r&&Ope.test(r)&&(n=r,r=null),r&&r!=="001"){if(!this.hasCountry(r))throw new Error("Unknown country: ".concat(r));this.numberingPlan=new gN(this.getCountryMetadata(r),this)}else if(n){if(!this.hasCallingCode(n))throw new Error("Unknown calling code: ".concat(n));this.numberingPlan=new gN(this.getNumberingPlanMetadata(n),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(r){var n=this.countryCallingCodes()[r];if(n)return n.length===1&&n[0].length===3?void 0:n}},{key:"getCountryCodeForCallingCode",value:function(r){var n=this.getCountryCodesForCallingCode(r);if(n)return n[0]}},{key:"getNumberingPlanMetadata",value:function(r){var n=this.getCountryCodeForCallingCode(r);if(n)return this.getCountryMetadata(n);if(this.nonGeographic()){var i=this.nonGeographic()[r];if(i)return i}else{var s=this.countryCallingCodes()[r];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(r){return this.numberingPlan.type(r)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(r){return this.selectNumberingPlan(r)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),gN=(function(){function t(e,r){o3(this,t),this.globalMetadataObject=r,this.metadata=e,Oz.call(this,r.metadata)}return c3(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(r){return r[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var r=this,n=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return n.map(function(i){return new Rpe(i,r)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(r){return r[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(r){if(this.hasTypes()&&mN(this.types(),r))return new Mpe(mN(this.types(),r),this)}},{key:"ext",value:function(){return this.v1||this.v2?pN:this.metadata[13]||pN}}])})(),Rpe=(function(){function t(e,r){o3(this,t),this._format=e,this.metadata=r}return c3(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!Dpe.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),Dpe=/^\(?\$1\)?$/,Mpe=(function(){function t(e,r){o3(this,t),this.type=e,this.metadata=r}return c3(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function mN(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function Pz(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!hf(t)||!hf(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(hf(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+jpe(t)+": "+t,"."))}var jpe=function(e){return Qp(e)};function l3(t,e){if(e=new ui(e),e.hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function Lpe(t,e){return e.countries.hasOwnProperty(t)}function Oz(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?hN(e,Npe)===-1?this.v2=!0:hN(e,Ppe)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function u3(t,e,r){return Fpe(t,e,void 0,r)}function Fpe(t,e,r,n){e&&(n=new ui(n.metadata),n.selectNumberingPlan(e));var i=n.type(r),s=i&&i.possibleLengths()||n.possibleLengths();if(!s)return"IS_POSSIBLE";var a=t.length,o=s[0];return o===a?"IS_POSSIBLE":o>a?"TOO_SHORT":s[s.length-1]<a?"TOO_LONG":s.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function Upe(t,e,r){if(e===void 0&&(e={}),r=new ui(r),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return Rz(t.phone||t.nationalNumber,t.country,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function Rz(t,e,r){switch(u3(t,e,r)){case"IS_POSSIBLE":return!0;default:return!1}}function xl(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function Bpe(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=qpe(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 344In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qpe(t,e){if(t){if(typeof t=="string")return yN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yN(t,e):void 0}}function yN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Wpe=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function _S(t,e,r){if(e=e||{},!(!t.country&&!t.countryCallingCode)){r=new ui(r),r.selectNumberingPlan(t.country,t.countryCallingCode);var n=e.v2?t.nationalNumber:t.phone;if(xl(n,r.nationalNumberPattern())){if(q6(n,"FIXED_LINE",r))return r.type("MOBILE")&&r.type("MOBILE").pattern()===""||!r.type("MOBILE")||q6(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var i=Bpe(Wpe),s;!(s=i()).done;){var a=s.value;if(q6(n,a,r))return a}}}}function q6(t,e,r){var n=r.type(e);return!n||!n.pattern()||n.possibleLengths()&&n.possibleLengths().indexOf(t.length)<0?!1:xl(t,n.pattern())}function zpe(t,e,r){if(e=e||{},r=new ui(r),r.selectNumberingPlan(t.country,t.countryCallingCode),r.hasTypes())return _S(t,e,r.metadata)!==void 0;var n=e.v2?t.nationalNumber:t.phone;return xl(n,r.nationalNumberPattern())}function Vpe(t,e,r){var n=new ui(r),i=n.getCountryCodesForCallingCode(t);return i?i.filter(function(s){return Hpe(e,s,r)}):[]}function Hpe(t,e,r){var n=new ui(r);return n.selectNumberingPlan(e),n.numberingPlan.possibleLengths().indexOf(t.length)>=0}var CS=2,Gpe=17,Kpe=3,vs="0-9ï¼-ï¼Ù -Ù©Û°-Û¹",Qpe="-â-ââã¼ï¼",Ype="ï¼/",Zpe="ï¼.",Xpe="  Âââ ã",Jpe="()ï¼ï¼ï¼»ï¼½\\[\\]",e0e="~ââ¼ï½",mo="".concat(Qpe).concat(Ype).concat(Zpe).concat(Xpe).concat(Jpe).concat(e0e),d3="+ï¼",t0e=new RegExp("(["+vs+"])");function Dz(t,e,r,n){if(e){var i=new ui(n);i.selectNumberingPlan(e,r);var s=new RegExp(i.IDDPrefix());if(t.search(s)===0){t=t.slice(t.match(s)[0].length);var a=t.match(t0e);if(!(a&&a[1]!=null&&a[1].length>0&&a[1]==="0"))return t}}}function Y_(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,s,a=n.length-1,o=a>0&&n[a];if(e.nationalPrefixTransformRule()&&o)i=t.replace(r,e.nationalPrefixTransformRule()),a>1&&(s=n[1]);else{var c=n[0];i=t.slice(c.length),o&&(s=n[1])}var l;if(o){var u=t.indexOf(n[1]),d=t.slice(0,u);d===e.numberingPlan.nationalPrefix()&&(l=e.numberingPlan.nationalPrefix())}else l=n[0];return{nationalNumber:i,nationalPrefix:l,carrierCode:s}}}return{nationalNumber:t}}function r0e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=n0e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 345In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n0e(t,e){if(t){if(typeof t=="string")return bN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bN(t,e):void 0}}function bN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Mz(t,e){var r=e.countries,n=e.metadata;n=new ui(n);for(var i=r0e(r),s;!(s=i()).done;){var a=s.value;if(n.selectNumberingPlan(a),n.leadingDigits()){if(t&&t.search(n.leadingDigits())===0)return a}else if(_S({phone:t,country:a},void 0,n.metadata))return a}}function SS(t,e){var r=e.nationalNumber,n=e.metadata,i=n.getCountryCodesForCallingCode(t);if(i)return i.length===1?i[0]:Mz(r,{countries:i,metadata:n.metadata})}function Z_(t,e,r){var n=Y_(t,r),i=n.carrierCode,s=n.nationalNumber;if(s!==t){if(!i0e(t,s,r))return{nationalNumber:t};if(r.numberingPlan.possibleLengths()&&(e||(e=SS(r.numberingPlan.callingCode(),{nationalNumber:s,metadata:r})),!s0e(s,e,r)))return{nationalNumber:t}}return{nationalNumber:s,carrierCode:i}}function i0e(t,e,r){return!(xl(t,r.nationalNumberPattern())&&!xl(e,r.nationalNumberPattern()))}function s0e(t,e,r){switch(u3(t,e,r)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function jz(t,e,r,n,i){var s=e||r?l3(e||r,i):n;if(t.indexOf(s)===0){i=new ui(i),i.selectNumberingPlan(e||r,s);var a=t.slice(s.length),o=Z_(a,e,i),c=o.nationalNumber,l=Z_(t,e,i),u=l.nationalNumber;if(!xl(u,i.nationalNumberPattern())&&xl(c,i.nationalNumberPattern())||u3(u,e,i)==="TOO_LONG")return{countryCallingCode:s,number:a}}return{number:t}}function AS(t,e,r,n,i){if(!t)return{};var s;if(t[0]!=="+"){var a=Dz(t,e||r,n,i);if(a&&a!==t)s=!0,t="+"+a;else{if(e||r||n){var o=jz(t,e,r,n,i),c=o.countryCallingCode,l=o.number;if(c)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:c,number:l}}return{number:t}}}if(t[1]==="0")return{};i=new ui(i);for(var u=2;u-1<=Kpe&&u<=t.length;){var d=t.slice(1,u);if(i.hasCallingCode(d))return i.selectNumberingPlan(d),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:d,number:t.slice(u)};u++}return{}}function Lz(t){return t.replace(new RegExp("[".concat(mo,"]+"),"g")," ").trim()}var Fz=/(\$\d)/;function Uz(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var s=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(Fz,e.nationalPrefixFormattingRule()):e.format());return n?Lz(s):s}var a0e=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function o0e(t,e,r){var n=new ui(r);if(n.selectNumberingPlan(t,e),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(a0e.test(n.IDDPrefix()))return n.IDDPrefix()}var c0e=";ext=",_h=function(e){return"([".concat(vs,"]{1,").concat(e,"})")};function Bz(t){var e="20",r="15",n="9",i="6",s="[  \\t,]*",a="[:\\.ï¼]?[  \\t,-]*",o="#?",c="(?:e?xt(?:ensi(?:oÌ?|ó))?n?|ï½ ?ï½ï½ï½?|доб|anexo)",l="(?:[xï½#ï¼~ï½]|int|ï½ï½ï½)",u="[- ]+",d="[  \\t]*",f="(?:,{2}|;)",h=c0e+_h(e),g=s+c+a+_h(e)+o,m=s+l+a+_h(n)+o,y=u+_h(i)+"#",b=d+f+a+_h(r)+o,E=d+"(?:,)+"+a+_h(n)+o;return h+"|"+g+"|"+m+"|"+y+"|"+b+"|"+E}var l0e="["+vs+"]{"+CS+"}",u0e="["+d3+"]{0,1}(?:["+mo+"]*["+vs+"]){3,}["+mo+vs+"]*",d0e=new RegExp("^["+d3+"]{0,1}(?:["+mo+"]*["+vs+"]){1,2}$","i"),f0e=u0e+"(?:"+Bz()+")?",h0e=new RegExp("^"+l0e+"$|^"+f0e+"$","i");function p0e(t){return t.length>=CS&&h0e.test(t)}function g0e(t){return d0e.test(t)}function m0e(t){var e=t.number,r=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(r?";ext="+r:"")}var vN={formatExtension:function(e,r,n){return"".concat(e).concat(n.ext()).concat(r)}};function y0e(t,e,r,n){if(r?r=w0e({},vN,r):r=vN,n=new ui(n),t.country&&t.country!=="001"){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.selectNumberingPlan(t.country)}else if(t.countryCallingCode)n.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var i=n.countryCallingCode(),s=r.v2?t.nationalNumber:t.phone,a;switch(e){case"NATIONAL":return s?(a=kv(s,t.carrierCode,"NATIONAL",n,r),W6(a,t.ext,n,r.formatExtension)):"";case"INTERNATIONAL":return s?(a=kv(s,null,"INTERNATIONAL",n,r),a="+".concat(i," ").concat(a),W6(a,t.ext,n,r.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(s);case"RFC3966":return m0e({number:"+".concat(i).concat(s),ext:t.ext});case"IDD":if(!r.fromCountry)return;var o=v0e(s,t.carrierCode,i,r.fromCountry,n);return o?W6(o,t.ext,n,r.formatExtension):void 0;default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function kv(t,e,r,n,i){var s=b0e(n.formats(),t);return s?Uz(t,s,{useInternationalFormat:r==="INTERNATIONAL",withNationalPrefix:!(s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1),carrierCode:e,metadata:n}):t}function b0e(t,e){return E0e(t,function(r){if(r.leadingDigitsPatterns().length>0){var n=r.leadingDigitsPatterns()[r.leadingDigitsPatterns().length-1];if(e.search(n)!==0)return!1}return xl(e,r.pattern())})}function W6(t,e,r,n){return e?n(t,e,r):t}function v0e(t,e,r,n,i){var s=l3(n,i.metadata);if(s===r){var a=kv(t,e,"NATIONAL",i);return r==="1"?r+" "+a:a}var o=o0e(n,void 0,i.metadata);if(o)return"".concat(o," ").concat(r," ").concat(kv(t,null,"INTERNATIONAL",i))}function w0e(){for(var t=1,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(;t<r.length;){if(r[t])for(var i in r[t])r[0][i]=r[t][i];t++}return r[0]}function E0e(t,e){for(var r=0;r<t.length;){if(e(t[r]))return t[r];r++}}function Y1(t){"@babel/helpers - typeof";return Y1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y1(t)}function wN(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function EN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wN(Object(r),!0).forEach(function(n){x0e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function x0e(t,e,r){return(e=qz(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _0e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C0e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qz(n.key),n)}}function S0e(t,e,r){return e&&C0e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qz(t){var e=A0e(t,"string");return Y1(e)=="symbol"?e:e+""}function A0e(t,e){if(Y1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Y1(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var TS=(function(){function t(e,r,n){if(_0e(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!r)throw new TypeError("`metadata` argument not passed");if(hf(r)&&hf(r.countries)){n=r;var i=e;if(!k0e.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=AS(i,void 0,void 0,void 0,n),a=s.countryCallingCode,o=s.number;if(r=o,e=a,!r)throw new Error("Invalid `number` argument passed: too short")}if(!r)throw new TypeError("`nationalNumber` argument is required");if(typeof r!="string")throw new TypeError("`nationalNumber` argument must be a string");Pz(n);var c=I0e(e,n),l=c.country,u=c.countryCallingCode;this.country=l,this.countryCallingCode=u,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return S0e(t,[{key:"setExt",value:function(r){this.ext=r}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Vpe(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return Upe(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return zpe(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var r=new ui(this.getMetadata());return r.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(r){return this.number===r.number&&this.ext===r.ext}},{key:"getType",value:function(){return _S(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(r,n){return y0e(this,r,n?EN(EN({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(r){return this.format("NATIONAL",r)}},{key:"formatInternational",value:function(r){return this.format("INTERNATIONAL",r)}},{key:"getURI",value:function(r){return this.format("RFC3966",r)}}])})(),T0e=function(e){return/^[A-Z]{2}$/.test(e)};function I0e(t,e){var r,n,i=new ui(e);return T0e(t)?(r=t,i.selectNumberingPlan(r),n=i.countryCallingCode()):n=t,{country:r,countryCallingCode:n}}var k0e=/^\+\d+$/;function X_(t){"@babel/helpers - typeof";return X_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X_(t)}function $0e(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function N0e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P0e(t,e,r){return e=X1(e),O0e(t,IS()?Reflect.construct(e,r||[],X1(t).constructor):e.apply(t,r))}function O0e(t,e){if(e&&(X_(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R0e(t)}function R0e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function D0e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Z1(t,e)}function J_(t){var e=typeof Map=="function"?new Map:void 0;return J_=function(n){if(n===null||!j0e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return M0e(n,arguments,X1(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Z1(i,n)},J_(t)}function M0e(t,e,r){if(IS())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Z1(i,r.prototype),i}function IS(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IS=function(){return!!t})()}function j0e(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function Z1(t,e){return Z1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Z1(t,e)}function X1(t){return X1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},X1(t)}var Xc=(function(t){function e(r){var n;return N0e(this,e),n=P0e(this,e,[r]),Object.setPrototypeOf(n,e.prototype),n.name=n.constructor.name,n}return D0e(e,t),$0e(e)})(J_(Error)),xN=new RegExp("(?:"+Bz()+")$","i");function L0e(t){var e=t.search(xN);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(xN),i=1;i<n.length;){if(n[i])return{number:r,ext:n[i]};i++}}function F0e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=U0e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 346In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U0e(t,e){if(t){if(typeof t=="string")return _N(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_N(t,e):void 0}}function _N(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var B0e={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","ï¼":"0","ï¼":"1","ï¼":"2","ï¼":"3","ï¼":"4","ï¼":"5","ï¼":"6","ï¼":"7","ï¼":"8","ï¼":"9","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9"};function Wz(t){return B0e[t]}function $v(t){for(var e="",r=F0e(t.split("")),n;!(n=r()).done;){var i=n.value,s=Wz(i);s&&(e+=s)}return e}function q0e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=W0e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 347In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W0e(t,e){if(t){if(typeof t=="string")return CN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?CN(t,e):void 0}}function CN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function SN(t){for(var e="",r=q0e(t.split("")),n;!(n=r()).done;){var i=n.value;e+=z0e(i,e)||""}return e}function z0e(t,e,r){return t==="+"?e?void 0:"+":Wz(t)}var zz="+",V0e="[\\-\\.\\(\\)]?",AN="(["+vs+"]|"+V0e+")",H0e="^\\"+zz+AN+"*["+vs+"]"+AN+"*$",G0e=new RegExp(H0e,"g"),e9=vs,K0e="["+e9+"]+((\\-)*["+e9+"])*",Q0e="a-zA-Z",Y0e="["+Q0e+"]+((\\-)*["+e9+"])*",Z0e="^("+K0e+"\\.)*"+Y0e+"\\.?$",X0e=new RegExp(Z0e,"g"),TN="tel:",t9=";phone-context=",J0e=";isub=";function ege(t){var e=t.indexOf(t9);if(e<0)return null;var r=e+t9.length;if(r>=t.length)return"";var n=t.indexOf(";",r);return n>=0?t.substring(r,n):t.substring(r)}function tge(t){return t===null?!0:t.length===0?!1:G0e.test(t)||X0e.test(t)}function rge(t,e){var r=e.extractFormattedPhoneNumber,n=ege(t);if(!tge(n))throw new Xc("NOT_A_NUMBER");var i;if(n===null)i=r(t)||"";else{i="",n.charAt(0)===zz&&(i+=n);var s=t.indexOf(TN),a;s>=0?a=s+TN.length:a=0;var o=t.indexOf(t9);i+=t.substring(a,o)}var c=i.indexOf(J0e);if(c>0&&(i=i.substring(0,c)),i!=="")return i}var nge=250,ige=new RegExp("["+d3+vs+"]"),sge=new RegExp("[^"+vs+"#]+$");function age(t,e,r){if(e=e||{},r=new ui(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new Xc("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var n=cge(t,e.v2,e.extract),i=n.number,s=n.ext,a=n.error;if(!i){if(e.v2)throw a==="TOO_SHORT"?new Xc("TOO_SHORT"):new Xc("NOT_A_NUMBER");return{}}var o=uge(i,e.defaultCountry,e.defaultCallingCode,r),c=o.country,l=o.nationalNumber,u=o.countryCallingCode,d=o.countryCallingCodeSource,f=o.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new Xc("INVALID_COUNTRY");return{}}if(!l||l.length<CS){if(e.v2)throw new Xc("TOO_SHORT");return{}}if(l.length>Gpe){if(e.v2)throw new Xc("TOO_LONG");return{}}if(e.v2){var h=new TS(u,l,r.metadata);return c&&(h.country=c),f&&(h.carrierCode=f),s&&(h.ext=s),h.__countryCallingCodeSource=d,h}var g=(e.extended?r.hasSelectedNumberingPlan():c)?xl(l,r.nationalNumberPattern()):!1;return e.extended?{country:c,countryCallingCode:u,carrierCode:f,valid:g,possible:g?!0:!!(e.extended===!0&&r.possibleLengths()&&Rz(l,c,r)),phone:l,ext:s}:g?lge(c,l,s):{}}function oge(t,e,r){if(t){if(t.length>nge){if(r)throw new Xc("TOO_LONG");return}if(e===!1)return t;var n=t.search(ige);if(!(n<0))return t.slice(n).replace(sge,"")}}function cge(t,e,r){var n=rge(t,{extractFormattedPhoneNumber:function(a){return oge(a,r,e)}});if(!n)return{};if(!p0e(n))return g0e(n)?{error:"TOO_SHORT"}:{};var i=L0e(n);return i.ext?i:{number:n}}function lge(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}function uge(t,e,r,n){var i=AS(SN(t),void 0,e,r,n.metadata),s=i.countryCallingCodeSource,a=i.countryCallingCode,o=i.number,c;if(a)n.selectNumberingPlan(a);else if(o&&(e||r))n.selectNumberingPlan(e,r),e&&(c=e),a=r||l3(e,n.metadata);else return{};if(!o)return{countryCallingCodeSource:s,countryCallingCode:a};var l=Z_(SN(o),c,n),u=l.nationalNumber,d=l.carrierCode,f=SS(a,{nationalNumber:u,metadata:n});return f&&(c=f,f==="001"||n.selectNumberingPlan(c)),{country:c,countryCallingCode:a,countryCallingCodeSource:s,nationalNumber:u,carrierCode:d}}function J1(t){"@babel/helpers - typeof";return J1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J1(t)}function IN(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function kN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IN(Object(r),!0).forEach(function(n){dge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dge(t,e,r){return(e=fge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fge(t){var e=hge(t,"string");return J1(e)=="symbol"?e:e+""}function hge(t,e){if(J1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(J1(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pge(t,e,r){return age(t,kN(kN({},e),{},{v2:!0}),r)}function em(t){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},em(t)}function $N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gge(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$N(Object(r),!0).forEach(function(n){mge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$N(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mge(t,e,r){return(e=yge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yge(t){var e=bge(t,"string");return em(e)=="symbol"?e:e+""}function bge(t,e){if(em(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(em(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vge(t,e){return _ge(t)||xge(t,e)||Ege(t,e)||wge()}function wge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 348In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ege(t,e){if(t){if(typeof t=="string")return NN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?NN(t,e):void 0}}function NN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function xge(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,l=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return o}}function _ge(t){if(Array.isArray(t))return t}function Cge(t){var e=Array.prototype.slice.call(t),r=vge(e,4),n=r[0],i=r[1],s=r[2],a=r[3],o,c,l;if(typeof n=="string")o=n;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")a?(c=s,l=a):(c=void 0,l=s),i&&(c=gge({defaultCountry:i},c));else if(hf(i))s?(c=i,l=s):l=i;else throw new Error("Invalid second argument: ".concat(i));return{text:o,options:c,metadata:l}}function tm(t){"@babel/helpers - typeof";return tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tm(t)}function PN(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ON(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?PN(Object(r),!0).forEach(function(n){Sge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):PN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Sge(t,e,r){return(e=Age(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Age(t){var e=Tge(t,"string");return tm(e)=="symbol"?e:e+""}function Tge(t,e){if(tm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ige(t,e,r){e&&e.defaultCountry&&!Lpe(e.defaultCountry,r)&&(e=ON(ON({},e),{},{defaultCountry:void 0}));try{return pge(t,e,r)}catch(n){if(!(n instanceof Xc))throw n}}function rm(t){"@babel/helpers - typeof";return rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rm(t)}function RN(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function DN(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RN(Object(r),!0).forEach(function(n){kge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RN(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function kge(t,e,r){return(e=$ge(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $ge(t){var e=Nge(t,"string");return rm(e)=="symbol"?e:e+""}function Nge(t,e){if(rm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(rm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Pge(){var t=Cge(arguments),e=t.text,r=t.options,n=t.metadata;r=DN(DN({},r),{},{extract:!1});var i=Ige(e,r,n);return i&&i.isPossible()||!1}function nm(t){"@babel/helpers - typeof";return nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nm(t)}function Oge(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rge(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Mge(n.key),n)}}function Dge(t,e,r){return e&&Rge(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Mge(t){var e=jge(t,"string");return nm(e)=="symbol"?e:e+""}function jge(t,e){if(nm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Lge=(function(){function t(e){var r=e.onCountryChange,n=e.onCallingCodeChange;Oge(this,t),this.onCountryChange=r,this.onCallingCodeChange=n}return Dge(t,[{key:"reset",value:function(r){var n=r.country,i=r.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(n,i)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(r){for(var n=0,i=Object.keys(r);n<i.length;n++){var s=i[n];this[s]=r[s]}}},{key:"initCountryAndCallingCode",value:function(r,n){this.setCountry(r),this.setCallingCode(n)}},{key:"setCountry",value:function(r){this.country=r,this.onCountryChange(r)}},{key:"setCallingCode",value:function(r){this.callingCode=r,this.onCallingCodeChange(r,this.country)}},{key:"startInternationalNumber",value:function(r,n){this.international=!0,this.initCountryAndCallingCode(r,n)}},{key:"appendDigits",value:function(r){this.digits+=r}},{key:"appendNationalSignificantNumberDigits",value:function(r){this.nationalSignificantNumber+=r}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])})();function Fge(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=Uge(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 349In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uge(t,e){if(t){if(typeof t=="string")return MN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?MN(t,e):void 0}}function MN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var no="x",z6=new RegExp(no);function Mb(t,e){if(e<1)return"";for(var r="";e>1;)e&1&&(r+=t),e>>=1,t+=t;return r+t}function jN(t,e){return t[e]===")"&&e++,Bge(t.slice(0,e))}function Bge(t){for(var e=[],r=0;r<t.length;)t[r]==="("?e.push(r):t[r]===")"&&e.pop(),r++;var n=0,i="";e.push(t.length);for(var s=0,a=e;s<a.length;s++){var o=a[s];i+=t.slice(n,o),n=o+1}return i}function qge(t,e,r){for(var n=Fge(r.split("")),i;!(i=n()).done;){var s=i.value;if(t.slice(e+1).search(z6)<0)return;e=t.search(z6),t=t.replace(z6,s)}return[t,e]}function Wge(t,e,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,s=r.getSeparatorAfterNationalPrefix,a=new RegExp("^(?:".concat(e.pattern(),")$"));if(a.test(t.nationalSignificantNumber))return Vge(t,e,{metadata:n,shouldTryNationalPrefixFormattingRule:i,getSeparatorAfterNationalPrefix:s})}function zge(t,e,r){return u3(t,e,r)==="IS_POSSIBLE"}function Vge(t,e,r){var n=r.metadata,i=r.shouldTryNationalPrefixFormattingRule,s=r.getSeparatorAfterNationalPrefix;if(t.nationalSignificantNumber,t.international,t.nationalPrefix,t.carrierCode,i(e)){var a=LN(t,e,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:s,metadata:n});if(a)return a}return LN(t,e,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:s,metadata:n})}function LN(t,e,r){var n=r.metadata,i=r.useNationalPrefixFormattingRule,s=r.getSeparatorAfterNationalPrefix,a=Uz(t.nationalSignificantNumber,e,{carrierCode:t.carrierCode,useInternationalFormat:t.international,withNationalPrefix:i,metadata:n});if(i||(t.nationalPrefix?a=t.nationalPrefix+s(e)+a:t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix&&(a=t.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix+" "+a)),Hge(a,t))return a}function Hge(t,e){return $v(t)===e.getNationalDigits()}function im(t){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},im(t)}function Gge(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kge(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Yge(n.key),n)}}function Qge(t,e,r){return e&&Kge(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yge(t){var e=Zge(t,"string");return im(e)=="symbol"?e:e+""}function Zge(t,e){if(im(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(im(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Xge=(function(){function t(){Gge(this,t)}return Qge(t,[{key:"parse",value:function(r){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(r),this.context.length!==1)throw new Error("Non-finalized contexts left when pattern parse ended");var n=this.context[0],i=n.branches,s=n.instructions;if(i)return{op:"|",args:i.concat([V6(s)])};if(s.length===0)throw new Error("Pattern is required");return s.length===1?s[0]:s}},{key:"startContext",value:function(r){this.context.push(r)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(r){if(!r)throw new Error("Pattern is required");var n=r.match(t1e);if(!n){if(e1e.test(r))throw new Error("Illegal characters found in a pattern: ".concat(r));this.getContext().instructions=this.getContext().instructions.concat(r.split(""));return}var i=n[1],s=r.slice(0,n.index),a=r.slice(n.index+i.length);switch(i){case"(?:":s&&this.parsePattern(s),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw new Error('")" operator must be preceded by "(?:" operator');if(s&&this.parsePattern(s),this.getContext().instructions.length===0)throw new Error('No instructions found after "|" operator in an "or" group');var o=this.getContext(),c=o.branches;c.push(V6(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:c});break;case"|":if(!this.getContext().or)throw new Error('"|" operator can only be used inside "or" groups');if(s&&this.parsePattern(s),!this.getContext().branches)if(this.context.length===1)this.getContext().branches=[];else throw new Error('"branches" not found in an "or" group context');this.getContext().branches.push(V6(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":s&&this.parsePattern(s),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw new Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:Jge(s)});break;default:throw new Error("Unknown operator: ".concat(i))}a&&this.parsePattern(a)}}])})();function Jge(t){for(var e=[],r=0;r<t.length;){if(t[r]==="-"){if(r===0||r===t.length-1)throw new Error("Couldn't parse a one-of set pattern: ".concat(t));for(var n=t[r-1].charCodeAt(0)+1,i=t[r+1].charCodeAt(0)-1,s=n;s<=i;)e.push(String.fromCharCode(s)),s++}else e.push(t[r]);r++}return e}var e1e=/[\(\)\[\]\?\:\|]/,t1e=new RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function V6(t){return t.length===1?t[0]:t}function FN(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=r1e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 350In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r1e(t,e){if(t){if(typeof t=="string")return UN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?UN(t,e):void 0}}function UN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function sm(t){"@babel/helpers - typeof";return sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sm(t)}function n1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i1e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a1e(n.key),n)}}function s1e(t,e,r){return e&&i1e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function a1e(t){var e=o1e(t,"string");return sm(e)=="symbol"?e:e+""}function o1e(t,e){if(sm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(sm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var c1e=(function(){function t(e){n1e(this,t),this.matchTree=new Xge().parse(e)}return s1e(t,[{key:"match",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.allowOverflow;if(!r)throw new Error("String is required");var s=r9(r.split(""),this.matchTree,!0);if(s&&s.match&&delete s.matchedChars,!(s&&s.overflow&&!i))return s}}])})();function r9(t,e,r){if(typeof e=="string"){var n=t.join("");return e.indexOf(n)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:n.indexOf(e)===0?r&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),s=0;s<e.length;){var a=e[s],o=r9(i,a,r&&s===e.length-1);if(o){if(o.overflow)return o;if(o.match){if(i=i.slice(o.matchedChars.length),i.length===0)return s===e.length-1?{match:!0,matchedChars:t}:{partialMatch:!0}}else{if(o.partialMatch)return{partialMatch:!0};throw new Error(`Unsupported match result: 351`.concat(JSON.stringify(o,null,2)))}}else return;s++}return r?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(e.op){case"|":for(var c,l=FN(e.args),u;!(u=l()).done;){var d=u.value,f=r9(t,d,r);if(f){if(f.overflow)return f;if(f.match)return{match:!0,matchedChars:f.matchedChars};if(f.partialMatch)c=!0;else throw new Error(`Unsupported match result: 352`.concat(JSON.stringify(f,null,2)))}}return c?{partialMatch:!0}:void 0;case"[]":for(var h=FN(e.args),g;!(g=h()).done;){var m=g.value;if(t[0]===m)return t.length===1?{match:!0,matchedChars:t}:r?{overflow:!0}:{match:!0,matchedChars:[m]}}return;default:throw new Error("Unsupported instruction tree: ".concat(e))}}function am(t){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(t)}function BN(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=l1e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 353In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l1e(t,e){if(t){if(typeof t=="string")return qN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qN(t,e):void 0}}function qN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d1e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h1e(n.key),n)}}function f1e(t,e,r){return e&&d1e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function h1e(t){var e=p1e(t,"string");return am(e)=="symbol"?e:e+""}function p1e(t,e){if(am(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(am(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var n9="9",g1e=15,m1e=Mb(n9,g1e),y1e=/[- ]/,b1e=function(){return/\[([^\[\]])*\]/g},v1e=function(){return/\d(?=[^,}][^,}])/g},w1e=new RegExp("["+mo+"]*\\$1["+mo+"]*(\\$\\d["+mo+"]*)*$"),WN=3,E1e=(function(){function t(e){e.state;var r=e.metadata;u1e(this,t),this.metadata=r,this.resetFormat()}return f1e(t,[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(r,n){this.resetFormat(),r?(this.isNANP=r.callingCode()==="1",this.matchingFormats=r.formats(),n.nationalSignificantNumber&&this.narrowDownMatchingFormats(n)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(r,n){var i=this;if(zge(n.nationalSignificantNumber,n.country,this.metadata))for(var s=BN(this.matchingFormats),a;!(a=s()).done;){var o=a.value,c=Wge(n,o,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(u){return i.shouldTryNationalPrefixFormattingRule(u,{international:n.international,nationalPrefix:n.nationalPrefix})},getSeparatorAfterNationalPrefix:function(u){return i.getSeparatorAfterNationalPrefix(u)}});if(c)return this.resetFormat(),this.chosenFormat=o,this.setNationalNumberTemplate(c.replace(/\d/g,no),n),this.populatedNationalNumberTemplate=c,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf(no),c}return this.formatNationalNumberWithNextDigits(r,n)}},{key:"formatNationalNumberWithNextDigits",value:function(r,n){var i=this.chosenFormat,s=this.chooseFormat(n);if(s)return s===i?this.formatNextNationalNumberDigits(r):this.formatNextNationalNumberDigits(n.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(r){var n=this,i=r.nationalSignificantNumber,s=r.nationalPrefix,a=r.international,o=i,c=o.length-WN;c<0&&(c=0),this.matchingFormats=this.matchingFormats.filter(function(l){return n.formatSuits(l,a,s)&&n.formatMatches(l,o,c)}),this.chosenFormat&&this.matchingFormats.indexOf(this.chosenFormat)===-1&&this.resetFormat()}},{key:"formatSuits",value:function(r,n,i){return!(i&&!r.usesNationalPrefix()&&!r.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!n&&!i&&r.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(r,n,i){var s=r.leadingDigitsPatterns().length;if(s===0)return!0;i=Math.min(i,s-1);var a=r.leadingDigitsPatterns()[i];if(n.length<WN)try{return new c1e(a).match(n,{allowOverflow:!0})!==void 0}catch(o){return console.error(o),!0}return new RegExp("^(".concat(a,")")).test(n)}},{key:"getFormatFormat",value:function(r,n){return n?r.internationalFormat():r.format()}},{key:"chooseFormat",value:function(r){for(var n=this,i=function(){var l=o.value;return n.chosenFormat===l?0:w1e.test(n.getFormatFormat(l,r.international))?n.createTemplateForFormat(l,r)?(n.chosenFormat=l,0):(n.matchingFormats=n.matchingFormats.filter(function(u){return u!==l}),1):1},s,a=BN(this.matchingFormats.slice()),o;!(o=a()).done&&(s=i(),s!==0););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(r,n){if(!(r.pattern().indexOf("|")>=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&y1e.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,s=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":s?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,s=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";i<s.length+r.getDigitsWithoutInternationalPrefix().length;)n=this.template.indexOf(no,n+1),i++;return jN(this.template,n+1)}}},{key:"setNationalNumberTemplate",value:function(r,n){this.nationalNumberTemplate=r,this.populatedNationalNumberTemplate=r,this.populatedNationalNumberTemplatePosition=-1,n.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(n).replace(/[\d\+]/g,no)+Mb(no,n.callingCode.length)+" "+r:this.template=r}},{key:"getTemplateForFormat",value:function(r,n){var i=n.nationalSignificantNumber,s=n.international,a=n.nationalPrefix,o=n.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,c=r.pattern();c=c.replace(b1e(),"\\d").replace(v1e(),"\\d");var l=m1e.match(c)[0];if(!(i.length>l.length)){var u=new RegExp("^"+c+"$"),d=i.replace(/\d/g,n9);u.test(d)&&(l=d);var f=this.getFormatFormat(r,s),h;if(this.shouldTryNationalPrefixFormattingRule(r,{international:s,nationalPrefix:a})){var g=f.replace(Fz,r.nationalPrefixFormattingRule());if($v(r.nationalPrefixFormattingRule())===(a||"")+$v("$1")&&(f=g,h=!0,a))for(var m=a.length;m>0;)f=f.replace(/\d/,no),m--}var y=l.replace(new RegExp(c),f).replace(new RegExp(n9,"g"),no);return h||(o?y=Mb(no,o.length)+" "+y:a&&(y=Mb(no,a.length)+this.getSeparatorAfterNationalPrefix(r)+y)),s&&(y=Lz(y)),y}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=qge(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],jN(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,s=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var a=r.usesNationalPrefix();if(a&&s||!a&&!i)return!0}}}])})();function om(t){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},om(t)}function Vz(t,e){return S1e(t)||C1e(t,e)||_1e(t,e)||x1e()}function x1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 354In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _1e(t,e){if(t){if(typeof t=="string")return zN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zN(t,e):void 0}}function zN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function C1e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,l=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return o}}function S1e(t){if(Array.isArray(t))return t}function A1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T1e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k1e(n.key),n)}}function I1e(t,e,r){return e&&T1e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function k1e(t){var e=$1e(t,"string");return om(e)=="symbol"?e:e+""}function $1e(t,e){if(om(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(om(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var N1e="["+mo+vs+"]+",P1e=new RegExp("^"+N1e+"$","i"),O1e="(?:["+d3+"]["+mo+vs+"]*|["+mo+vs+"]+)",R1e=new RegExp("[^"+mo+vs+"]+.*$"),D1e=/[^\d\[\]]/,M1e=(function(){function t(e){var r=e.defaultCountry,n=e.defaultCallingCode,i=e.metadata,s=e.onNationalSignificantNumberChange;A1e(this,t),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=i,this.onNationalSignificantNumberChange=s}return I1e(t,[{key:"input",value:function(r,n){var i=F1e(r),s=Vz(i,2),a=s[0],o=s[1],c=$v(a),l;return o&&(n.digits||(n.startInternationalNumber(void 0,void 0),c||(l=!0))),c&&this.inputDigits(c,n),{digits:c,justLeadingPlus:l}}},{key:"inputDigits",value:function(r,n){var i=n.digits,s=i.length<3&&i.length+r.length>=3;if(n.appendDigits(r),s&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(a){return n.update(a)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=AS("+"+r.getDigitsWithoutInternationalPrefix(),r.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,s=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:s}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&D1e.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=Y_(r,this.metadata),s=i.nationalPrefix,a=i.nationalNumber,o=i.carrierCode;if(a!==r)return this.onExtractedNationalNumber(s,o,a,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var s=Y_(r,this.metadata),a=s.nationalPrefix,o=s.nationalNumber,c=s.carrierCode;if(o!==n)return this.onExtractedNationalNumber(a,c,o,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,s,a){var o=!1,c,l=s.lastIndexOf(i);if(l<0||l!==s.length-i.length)o=!0;else{var u=s.slice(0,l);u&&u!==r&&(c=u)}a({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberIsModified:o,prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix:c}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,s=r.digits;if(r.nationalSignificantNumber,!(n||i)){var a=Dz(s,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(a!==void 0&&a!==s)return r.update({IDDPrefix:s.slice(0,s.length-a.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=jz(r.digits,r.country,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,s=n.callingCode;r.startInternationalNumber(i,s),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}])})();function j1e(t){var e=t.search(O1e);if(!(e<0)){t=t.slice(e);var r;return t[0]==="+"&&(r=!0,t=t.slice(1)),t=t.replace(R1e,""),r&&(t="+"+t),t}}function L1e(t){var e=j1e(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function F1e(t){var e=L1e(t),r=Vz(e,2),n=r[0],i=r[1];return P1e.test(n)||(n=""),[n,i]}function cm(t){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cm(t)}function U1e(t,e){return z1e(t)||W1e(t,e)||q1e(t,e)||B1e()}function B1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 355In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q1e(t,e){if(t){if(typeof t=="string")return VN(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?VN(t,e):void 0}}function VN(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function W1e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,s,a,o=[],c=!0,l=!1;try{if(s=(r=r.call(t)).next,e!==0)for(;!(c=(n=s.call(r)).done)&&(o.push(n.value),o.length!==e);c=!0);}catch(u){l=!0,i=u}finally{try{if(!c&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return o}}function z1e(t){if(Array.isArray(t))return t}function V1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function H1e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,K1e(n.key),n)}}function G1e(t,e,r){return e&&H1e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function K1e(t){var e=Q1e(t,"string");return cm(e)=="symbol"?e:e+""}function Q1e(t,e){if(cm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Hz=(function(){function t(e,r){V1e(this,t),this.metadata=new ui(r);var n=this.getCountryAndCallingCode(e),i=U1e(n,2),s=i[0],a=i[1];this.defaultCountry=s,this.defaultCallingCode=a,this.reset()}return G1e(t,[{key:"getCountryAndCallingCode",value:function(r){var n,i;return r&&(hf(r)?(n=r.defaultCountry,i=r.defaultCallingCode):n=r),n&&!this.metadata.hasCountry(n)&&(n=void 0),[n,i]}},{key:"input",value:function(r){var n=this.parser.input(r,this.state),i=n.digits,s=n.justLeadingPlus;if(s)this.formattedOutput="+";else if(i){this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state);var a;if(this.metadata.hasSelectedNumberingPlan()&&(a=this.formatter.format(i,this.state)),a===void 0&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var o=this.state.getNationalDigits();o&&(a=this.formatter.format(o,this.state))}this.formattedOutput=a?this.getFullNumber(a):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var r=this;return this.state=new Lge({onCountryChange:function(i){r.country=i},onCallingCodeChange:function(i,s){r.metadata.selectNumberingPlan(s,i),r.formatter.reset(r.metadata.numberingPlan,r.state),r.parser.reset(r.metadata.numberingPlan)}}),this.formatter=new E1e({state:this.state,metadata:this.metadata}),this.parser=new M1e({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){r.determineTheCountryIfNeeded(),r.formatter.reset(r.metadata.numberingPlan,r.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){var r=this.state.digits;if(r)return this._getCountry()}},{key:"_getCountry",value:function(){var r=this.state.country;return r}},{key:"determineTheCountryIfNeeded",value:function(){(!this.state.country||this.isCountryCallingCodeAmbiguous())&&this.determineTheCountry()}},{key:"getFullNumber",value:function(r){var n=this;if(this.isInternational()){var i=function(o){return n.formatter.getInternationalPrefixBeforeCountryCallingCode(n.state,{spacing:!!o})+o},s=this.state.callingCode;return i(s?r?"".concat(s," ").concat(r):s:"".concat(this.state.getDigitsWithoutInternationalPrefix()))}return r}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix,s=r.nationalPrefix,a=n,o=i||s;return o&&(a=o+a),a}},{key:"getNonFormattedNumber",value:function(){var r=this.state.nationalSignificantNumberIsModified;return this.getFullNumber(r?this.state.getNationalDigits():this.getNonFormattedNationalNumberWithPrefix())}},{key:"getNonFormattedTemplate",value:function(){var r=this.getNonFormattedNumber();if(r)return r.replace(/[\+\d]/g,no)}},{key:"isCountryCallingCodeAmbiguous",value:function(){var r=this.state.callingCode,n=this.metadata.getCountryCodesForCallingCode(r);return n&&n.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(SS(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,s=r.country,a=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+a:"+"+n;if(s||i){var o=s?this.metadata.countryCallingCode():i;return"+"+o+a}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,s=r.callingCode,a=this._getCountry();if(n&&!(!a&&!s)){if(a&&a===this.defaultCountry){var o=new ui(this.metadata.metadata);o.selectNumberingPlan(a);var c=o.numberingPlan.callingCode(),l=this.metadata.getCountryCodesForCallingCode(c);if(l.length>1){var u=Mz(n,{countries:l,metadata:this.metadata.metadata});u&&(a=u)}}var d=new TS(a||s,n,this.metadata.metadata);return i&&(d.carrierCode=i),d}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}])})();function Y1e(t){return new ui(t).getCountries()}function Z1e(t,e,r){if(e[t])return new TS(t,e[t],r)}const X1e={id:42161},J1e={id:421613},eme={id:421614},tme={id:8453},rme={id:84531},nme={id:84532},ime={id:10},sme={id:420},ame={id:11155420},Gz={id:137},Kz={id:80001},ome={id:7777777},cme={id:999999999},lme={id:999};var xs;(xs={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",xs.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",xs.INVALID_DATA="invalid_data",xs.LINKED_TO_ANOTHER_USER="linked_to_another_user",xs.ALLOWLIST_REJECTED="allowlist_rejected",xs.OAUTH_USER_DENIED="oauth_user_denied",xs.UNKNOWN_AUTH_ERROR="unknown_auth_error",xs.USER_EXITED_AUTH_FLOW="exited_auth_flow",xs.MUST_BE_AUTHENTICATED="must_be_authenticated",xs.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",xs.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",xs.CLIENT_REQUEST_TIMEOUT="client_request_timeout",xs.INVALID_CREDENTIALS="invalid_credentials";
355let ume=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},dme=class extends ume{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}};const xi={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Donât see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};let H6=class extends dme{constructor(e){var n,i,s;super(e.message,e.code,e.data);let r=Object.values(xi).find((a=>a.eipCode===e.code));this.details=r||xi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=xi.E32002_CONNECTION_ALREADY_PENDING:this.details=xi.E32002_REQUEST_ALREADY_PENDING:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=xi.E32002_WALLET_LOCKED))}};const cs=t=>zt.from(t);function i9(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")return t;if(typeof t.toHexString=="function")return t.toHexString();throw Error(`Expected numeric value but received ${t}`)}function fme(t){let e={};return t.to!==void 0&&(e.to=t.to),t.data!==void 0&&(e.data=t.data),t.chainId!==void 0&&(e.chainId=t.chainId),t.type!==void 0&&(e.type=t.type),t.accessList!==void 0&&(e.accessList=t.accessList),t.nonce!==void 0&&(e.nonce=cs(t.nonce).toNumber()),t.gasLim
355it!==void 0&&(e.gasLimit=cs(t.gasLimit)),t.gasPrice!==void 0&&(e.gasPrice=cs(t.gasPrice)),t.value!==void 0&&(e.value=cs(t.value)),t.maxFeePerGas!==void 0&&(e.maxFeePerGas=cs(t.maxFeePerGas)),t.maxPriorityFeePerGas!==void 0&&(e.maxPriorityFeePerGas=cs(t.maxPriorityFeePerGas)),e}const Qz=t=>[X1e.id,J1e.id,eme.id].includes(t),hme=async(t,e)=>{if(!Qz(t.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(t.type===void 0&&(t.type=2),t.maxFeePerGas)return t;try{let{lastBaseFeePerGas:r}=await e.getFeeData();if(r){let n=r.mul(zt.from(120)).div(zt.from(100));t.maxFeePerGas=i9(n),t.maxPriorityFeePerGas=i9(zt.from(0))}}catch(r){throw Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return t},Yz=t=>[56,97].includes(t),pme=async(t,e)=>{var r;if(!Yz(t.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(t.type===void 0?t.type=0:(t.type==1||t.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!t.gasPrice){let n=await e.getFeeData();t.gasPrice=(r=n.gasPrice)==null?void 0:r.toHexString()}return t},gme="contracts/5.8.0";var Sf=function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})};const Bn=new tt(gme);function Nv(t,e){return Sf(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&Bn.throwArgumentError("invalid address or ENS name","name",r);try{return jr(r)}catch{}t||Bn.throwError("a provider or signer is needed to resolve ENS names",tt.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&Bn.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function jb(t,e,r){return Sf(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>jb(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield Nv(t,e):r.type==="tuple"?yield jb(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>jb(t,n,r.arrayChildren))):Promise.reject(Bn.makeError("invalid value for array",tt.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function f3(t,e,r){return Sf(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=ji(r.pop())),Bn.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=si({override:Nv(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>Sf(this,void 0,void 0,function*(){return jr(l.signer)!==l.override&&Bn.throwError("Contract with a Signer cannot override from",tt.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=Nv(t.provider,n.from));const i=yield si({args:jb(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:si(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),a={data:s,to:i.address},o=i.overrides;if(o.nonce!=null&&(a.nonce=zt.from(o.nonce).toNumber()),o.gasLimit!=null&&(a.gasLimit=zt.from(o.gasLimit)),o.gasPrice!=null&&(a.gasPrice=zt.from(o.gasPrice)),o.maxFeePerGas!=null&&(a.maxFeePerGas=zt.from(o.maxFeePerGas)),o.maxPriorityFeePerGas!=null&&(a.maxPriorityFeePerGas=zt.from(o.maxPriorityFeePerGas)),o.from!=null&&(a.from=o.from),o.type!=null&&(a.type=o.type),o.accessList!=null&&(a.accessList=C0(o.accessList)),a.gasLimit==null&&e.gas!=null){let l=21e3;const u=Sn(s);for(let d=0;d<u.length;d++)l+=4,u[d]&&(l+=64);a.gasLimit=zt.from(e.gas).add(l)}if(o.value){const l=zt.from(o.value);!l.isZero()&&!e.payable&&Bn.throwError("non-payable method cannot override value",tt.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),a.value=l}o.customData&&(a.customData=ji(o.customData)),o.ccipReadEnabled&&(a.ccipReadEnabled=!!o.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const c=Object.keys(n).filter(l=>n[l]!=null);return c.length&&Bn.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,tt.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a})}function mme(t,e){return function(...r){return f3(t,e,r)}}function yme(t,e){const r=t.signer||t.provider;return function(...n){return Sf(this,void 0,void 0,function*(){r||Bn.throwError("estimate require a provider or signer",tt.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield f3(t,e,n);return yield r.estimateGas(i)})}}function bme(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let a=ay(s),o=null;try{o=t.interface.parseLog(s)}catch{}return o&&(a.args=o.args,a.decode=(c,l)=>t.interface.decodeEventLog(o.eventFragment,c,l),a.event=o.name,a.eventSignature=o.signature),a.removeListener=()=>t.provider,a.getBlock=()=>t.provider.getBlock(i.blockHash),a.getTransaction=()=>t.provider.getTransaction(i.transactionHash),a.getTransactionReceipt=()=>Promise.resolve(i),a}),i))}function Zz(t,e,r){const n=t.signer||t.provider;return function(...i){return Sf(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=ji(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));
355const a=yield f3(t,e,i),o=yield n.call(a,s);try{let c=t.interface.decodeFunctionResult(e,o);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===tt.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=a),c}})}}function vme(t,e){return function(...r){return Sf(this,void 0,void 0,function*(){t.signer||Bn.throwError("sending a transaction requires a signer",tt.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield f3(t,e,r),i=yield t.signer.sendTransaction(n);return bme(t,i),i})}}function HN(t,e,r){return e.constant?Zz(t,e,r):vme(t,e)}function Xz(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class lm{constructor(e,r){At(this,"tag",e),At(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 wme extends lm{constructor(){super("error",null)}}class GN extends lm{constructor(e,r,n,i){const s={address:e};let a=r.getEventTopic(n);i?(a!==i[0]&&Bn.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[a],super(Xz(s),s),At(this,"address",e),At(this,"interface",r),At(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=Nne(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class KN extends lm{constructor(e,r){super("*",{address:e}),At(this,"address",e),At(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 Eme{constructor(e,r,n){At(this,"interface",Wh(new.target,"getInterface")(r)),n==null?(At(this,"provider",null),At(this,"signer",null)):yy.isSigner(n)?(At(this,"provider",n.provider||null),At(this,"signer",n)):EB.isProvider(n)?(At(this,"provider",n),At(this,"signer",null)):Bn.throwArgumentError("invalid signer or provider","signerOrProvider",n),At(this,"callStatic",{}),At(this,"estimateGas",{}),At(this,"functions",{}),At(this,"populateTransaction",{}),At(this,"filters",{});{const a={};Object.keys(this.interface.events).forEach(o=>{const c=this.interface.events[o];At(this.filters,o,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),a[c.name]||(a[c.name]=[]),a[c.name].push(o)}),Object.keys(a).forEach(o=>{const c=a[o];c.length===1?At(this.filters,o,this.filters[c[0]]):Bn.warn(`Duplicate definition of ${o} (${c.join(", ")})`)})}if(At(this,"_runningEvents",{}),At(this,"_wrappedEmits",{}),e==null&&Bn.throwArgumentError("invalid contract address or ENS name","addressOrName",e),At(this,"address",e),this.provider)At(this,"resolvedAddress",Nv(this.provider,e));else try{At(this,"resolvedAddress",Promise.resolve(jr(e)))}catch{Bn.throwError("provider is required to use ENS name as contract address",tt.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(a=>{});const i={},s={};Object.keys(this.interface.functions).forEach(a=>{const o=this.interface.functions[a];if(s[a]){Bn.warn(`Duplicate ABI entry for ${JSON.stringify(a)}`);return}s[a]=!0;{const c=o.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(a)}this[a]==null&&At(this,a,HN(this,o,!0)),this.functions[a]==null&&At(this.functions,a,HN(this,o,!1)),this.callStatic[a]==null&&At(this.callStatic,a,Zz(this,o,!0)),this.populateTransaction[a]==null&&At(this.populateTransaction,a,mme(this,o)),this.estimateGas[a]==null&&At(this.estimateGas,a,yme(this,o))}
355),Object.keys(i).forEach(a=>{const o=i[a];if(o.length>1)return;a=a.substring(1);const c=o[0];try{this[a]==null&&At(this,a,this[c])}catch{}this.functions[a]==null&&At(this.functions,a,this.functions[c]),this.callStatic[a]==null&&At(this.callStatic,a,this.callStatic[c]),this.populateTransaction[a]==null&&At(this.populateTransaction,a,this.populateTransaction[c]),this.estimateGas[a]==null&&At(this.estimateGas,a,this.estimateGas[c])})}static getContractAddress(e){return wB(e)}static getInterface(e){return Mp.isInterface(e)?e:new Mp(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"&&Bn.throwError("contract not deployed",tt.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Bn.throwError("sending a transactions require a signer",tt.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=ji(e||{});return["from","to"].forEach(function(n){r[n]!=null&&Bn.throwError("cannot override "+n,tt.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new a3(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&At(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return $ne.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 wme);if(e==="event")return this._normalizeRunningEvent(new lm("event",null));if(e==="*")return this._normalizeRunningEvent(new KN(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new GN(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 GN(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new lm(Xz(r),r))}return this._normalizeRunningEvent(new KN(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=ay(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||Bn.throwError("events require a provider or a signer with a provider",tt.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let a=this._wrapEvent(e,s,r);if(a.decodeError==null)try{const o=e.getEmit(a);this.emit(e.filter,...o)}catch(o){a.decodeError=o.error}e.filter!=null&&this.emit("event",a),a.decodeError!=null&&this.emit("error",a.decodeError,a)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=ji(i.filter);return typeof r=="string"&&ia(r,32)?(n!=null&&Bn.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(a=>a.map(o=>this._wrapEvent(i,o,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}
355listenerCount(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 xme extends Eme{}const _me=["function getL1Fee(bytes memory _data) external view returns (uint256)"],h3=t=>[tme.id,rme.id,nme.id,ime.id,sme.id,ame.id,ome.id,lme.id,cme.id,81457,168587773].includes(t),Cme=async(t,e)=>{if(!h3(t.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(t.type===void 0&&(t.type=2),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{if(!t.maxPriorityFeePerGas){let r=await e.send("eth_maxPriorityFeePerGas",[]);t.maxPriorityFeePerGas=r}if(t.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),t.maxPriorityFeePerGas>=t.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!t.maxFeePerGas){let{lastBaseFeePerGas:r}=await e.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=zt.from(r).mul(zt.from(126)).div(zt.from(100)).add(zt.from(t.maxPriorityFeePerGas));t.maxFeePerGas=i9(n)}}catch(r){throw Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return t};async function Sme(t,e){if(!t.chainId||t.chainId&&!h3(t.chainId))return zt.from(0);let r=zt.from(0);try{let n=new xme("0x420000000000000000000000000000000000000F",_me,e),i=fme(t),s=Zhe(i);r=await n.getL1Fee(s)}catch{}return r}var Lb={exports:{}},Ame=Lb.exports,QN;function Tme(){return QN||(QN=1,(function(t,e){(function(r,n){t.exports=n()})(Ame,(function(){var r=function(s,a){if(a=a||{},typeof s!="function")throw new i("fetch must be a function");if(typeof a!="object")throw new i("defaults must be an object");if(a.retries!==void 0&&!n(a.retries))throw new i("retries must be a positive integer");if(a.retryDelay!==void 0&&!n(a.retryDelay)&&typeof a.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(a.retryOn!==void 0&&!Array.isArray(a.retryOn)&&typeof a.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return a=Object.assign(o,a),function(l,u){var d=a.retries,f=a.retryDelay,h=a.retryOn;if(u&&u.retries!==void 0)if(n(u.retries))d=u.retries;else throw new i("retries must be a positive integer");if(u&&u.retryDelay!==void 0)if(n(u.retryDelay)||typeof u.retryDelay=="function")f=u.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(u&&u.retryOn)if(Array.isArray(u.retryOn)||typeof u.retryOn=="function")h=u.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(g,m){var y=function(E){var v=typeof Request<"u"&&l instanceof Request?l.clone():l;s(v,u).then(function(w){if(Array.isArray(h)&&h.indexOf(w.status)===-1)g(w);else if(typeof h=="function")try{return Promise.resolve(h(E,null,w)).then(function(x){x?b(E,null,w):g(w)}).catch(m)}catch(x){m(x)}else E<d?b(E,null,w):g(w)}).catch(function(w){if(typeof h=="function")try{Promise.resolve(h(E,w,null)).then(function(x){x?b(E,w,null):m(w)}
355).catch(function(x){m(x)})}catch(x){m(x)}else E<d?b(E,w,null):m(w)})};function b(E,v,w){var x=typeof f=="function"?f(E,v,w):f;setTimeout(function(){y(++E)},x)}y(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r}))})(Lb)),Lb.exports}var Ime=Tme();const kme=Rl(Ime),Jz={id:80002};let $me=kme(fetch,{retries:3,retryDelay:500});const eV=t=>[Gz.id,Kz.id,Jz.id].includes(t);let G6=t=>({maxPriorityFee:pk(t.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:pk(t.maxFee.toFixed(9),"gwei").toHexString()}),Nme=t=>({safeLow:G6(t.safeLow),standard:G6(t.standard),fast:G6(t.fast)});const Pme=async t=>{let e="";switch(t){case Gz.id:e="https://gasstation.polygon.technology/v2";break;case Kz.id:e="https://gasstation-testnet.polygon.technology/v2";break;case Jz.id:e="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${t} does not support polygon gas stations`)}let r=await $me(e),n=await r.json();if(r.status>399)throw n;return Nme(n)};async function Ome(t){if(!eV(t.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(t.type===void 0&&(t.type=2),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{let{standard:e}=await Pme(t.chainId);t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=e.maxPriorityFee),t.maxFeePerGas||(t.maxFeePerGas=e.maxFee),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return t}const Rme=async(t,e)=>{var r,n,i;if(t.type===void 0&&(t.type=2),t.type===2){if(!t.maxFeePerGas||!t.maxPriorityFeePerGas){let s=await e.getFeeData();t.maxFeePerGas||(t.maxFeePerGas=(r=s.maxFeePerGas)==null?void 0:r.toHexString()),t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=(n=s.maxPriorityFeePerGas)==null?void 0:n.toHexString())}}else if(!t.gasPrice){let s=await e.getFeeData();t.gasPrice=(i=s.gasPrice)==null?void 0:i.toHexString()}return t};async function kS(t,e){if(!t.gasLimit)throw new H6("gasLimit was not successfully set for transaction.");let r=cs(t.gasLimit),n=zt.from(0);if(t.type==2){if(!t.maxFeePerGas)throw new H6("maxFeePerGas was not successfully set for transaction of type 2.");n=cs(t.maxFeePerGas)}else{if(!t.gasPrice)throw new H6("gasPrice was not successfully set for transaction of type 0 or 1.");n=cs(t.gasPrice)}let i=r.mul(n),s=zt.from(0);if(t.chainId&&h3(t.chainId))try{s=await Sme(t,e),i=i.add(s)}catch{}return{totalGasEstimate:i,l1ExecutionFeeEstimate:s}}async function Dme(t,e){try{return(await e.estimateGas(t)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await(async function({txRequest:i,provider:s}){try{let a={...i,value:void 0};return(await s.estimateGas(a)).toHexString()}catch(a){return console.warn(`Gas estimation failed with error: ${a} when omitting the 'value'`),null}})({txRequest:t,provider:e})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await(async function({txRequest:i,provider:s}){try{let a={...i,from:void 0};return(await s.estimateGas(a)).toHexString()}catch(a){return console.warn(`Gas estimation failed with error: ${a} when omitting the 'from' address`),null}})({txRequest:t,provider:e})),!n)throw r;return n}}function tV(t){return/^-?0x[a-f0-9]+$/i.test(t)}function Mme(t){for(let e of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=t[e];if(r!==void 0&&!(function(n){let i=typeof n=="number",s=typeof n=="bigint",a=typeof n=="string"&&tV(n);return i||s||a})(r))throw Error(`Transaction request property '${e}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof t.chainId!="number")throw Error("Transaction request property 'chainId' must be a number")}async function $S(t,e,r){if(e.chainId=Number(e.chainId),Mme(e),e.from||(e.from=t),!e.nonce){let n=new a3(t,r);
355e.nonce=await n.getTransactionCount("pending")}return e.gasLimit||(e.gas?(e.gasLimit=e.gas,delete e.gas):e.gasLimit=await Dme(e,r)),typeof e.type=="string"&&tV(e.type)&&(e.type=Number(e.type)),[23294,23295].includes(e.chainId)&&(e.type=0),(e=eV(e.chainId)?await Ome(e):Qz(e.chainId)?await hme(e,r):h3(e.chainId)?await Cme(e,r):Yz(e.chainId)?await pme(e,r):await Rme(e,r)).type===0&&delete e.accessList,e.type!==2&&(delete e.maxPriorityFeePerGas,delete e.maxFeePerGas),e}var K6={exports:{}},YN;function rV(){return YN||(YN=1,(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,d,f){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,d||c,f),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 a(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var l=[],u,d;if(this._eventsCount===0)return l;for(d in u=this._events)e.call(u,d)&&l.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},o.prototype.listeners=function(l){var u=r?r+l:l,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,h=d.length,g=new Array(h);f<h;f++)g[f]=d[f].fn;return g},o.prototype.listenerCount=function(l){var u=r?r+l:l,d=this._events[u];return d?d.fn?1:d.length:0},o.prototype.emit=function(l,u,d,f,h,g){var m=r?r+l:l;if(!this._events[m])return!1;var y=this._events[m],b=arguments.length,E,v;if(y.fn){switch(y.once&&this.removeListener(l,y.fn,void 0,!0),b){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,u),!0;case 3:return y.fn.call(y.context,u,d),!0;case 4:return y.fn.call(y.context,u,d,f),!0;case 5:return y.fn.call(y.context,u,d,f,h),!0;case 6:return y.fn.call(y.context,u,d,f,h,g),!0}for(v=1,E=new Array(b-1);v<b;v++)E[v-1]=arguments[v];y.fn.apply(y.context,E)}else{var w=y.length,x;for(v=0;v<w;v++)switch(y[v].once&&this.removeListener(l,y[v].fn,void 0,!0),b){case 1:y[v].fn.call(y[v].context);break;case 2:y[v].fn.call(y[v].context,u);break;case 3:y[v].fn.call(y[v].context,u,d);break;case 4:y[v].fn.call(y[v].context,u,d,f);break;default:if(!E)for(x=1,E=new Array(b-1);x<b;x++)E[x-1]=arguments[x];y[v].fn.apply(y[v].context,E)}}return!0},o.prototype.on=function(l,u,d){return s(this,l,u,d,!1)},o.prototype.once=function(l,u,d){return s(this,l,u,d,!0)},o.prototype.removeListener=function(l,u,d,f){var h=r?r+l:l;if(!this._events[h])return this;if(!u)return a(this,h),this;var g=this._events[h];if(g.fn)g.fn===u&&(!f||g.once)&&(!d||g.context===d)&&a(this,h);else{for(var m=0,y=[],b=g.length;m<b;m++)(g[m].fn!==u||f&&!g[m].once||d&&g[m].context!==d)&&y.push(g[m]);y.length?this._events[h]=y.length===1?y[0]:y:a(this,h)}return this},o.prototype.removeAllListeners=function(l){var u;return l?(u=r?r+l:l,this._events[u]&&a(this,u)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,t.exports=o})(K6)),K6.exports}var jme=rV();const NS=Rl(jme);let I2;const Lme=new Uint8Array(16);function Fme(){if(!I2&&(I2=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!I2))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return I2(Lme)}const Di=[];for(let t=0;t<256;++t)Di.push((t+256).toString(16).slice(1));function Ume(t,e=0){return Di[t[e+0]]+Di[t[e+1]]+Di[t[e+2]]+Di[t[e+3]]+"-"+Di[t[e+4]]+Di[t[e+5]]+"-"+Di[t[e+6]]+Di[t[e+7]]+"-"+Di[t[e+8]]+Di[t[e+9]]+"-"+Di[t[e+10]]+Di[t[e+11]]+Di[t[e+12]]+Di[t[e+13]]+Di[t[e+14]]+Di[t[e+15]]}const Bme=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZN={randomUUID:Bme};function nV(t,e,r){if(ZN.randomUUID&&!t)return ZN.randomUUID();t=t||{};const n=t.random||(t.rng||Fme)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Ume(n)}const qme=new TextEncoder,iV=new TextDecoder,Wme=t=>{let e=t;typeof e=="string"&&(e=qme.encode(e));const r=32768,n=[];for(let i=0;i<e.length;i+=r)n.push(String.fromCharCode.apply(null,e.subarray(i,i+r)));return btoa(n.join(""))},zme=t=>Wme(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),Vme=t=>{const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r},Hme=t=>{let e=t;e instanceof Uint8Array&&(e=iV.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Vme(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};
355class Gme extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var r;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class Ed extends Gme{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function Kme(t){return typeof t=="object"&&t!==null}function Qme(t){if(!Kme(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const Pv=zme,Yme=Hme;function XN(t){if(typeof t!="string")throw new Ed("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:r}=t.split(".");if(r===5)throw new Ed("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Ed("Invalid JWT");if(!e)throw new Ed("JWTs must contain a payload");let n;try{n=Yme(e)}catch{throw new Ed("Failed to base64url decode the payload")}let i;try{i=JSON.parse(iV.decode(n))}catch{throw new Ed("Failed to parse the decoded payload as JSON")}if(!Qme(i))throw new Ed("Invalid JWT Claims Set");return i}/*! js-cookie v3.0.5 | MIT */function k2(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}var Zme={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function s9(t,e){function r(i,s,a){if(!(typeof document>"u")){a=k2({},e,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var c in a)a[c]&&(o+="; "+c,a[c]!==!0&&(o+="="+a[c].split(";")[0]));return document.cookie=i+"="+t.write(s,i)+o}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var s=document.cookie?document.cookie.split("; "):[],a={},o=0;o<s.length;o++){var c=s[o].split("="),l=c.slice(1).join("=");try{var u=decodeURIComponent(c[0]);if(a[u]=t.read(l,u),i===u)break}catch{}}return i?a[i]:a}}return Object.create({set:r,get:n,remove:function(i,s){r(i,"",k2({},s,{expires:-1}))},withAttributes:function(i){return s9(this.converter,k2({},this.attributes,i))},withConverter:function(i){return s9(k2({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var Ql=s9(Zme,{path:"/"});const Xme={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"450001234",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"60123456",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},sV={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-4
3556-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80\\d{7}"],["8[129]\\d{7}"]
vendor: 20,370 bytes, line 355
355,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","8776\\d{4}|(?:[27]\\d|61)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-8]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,0,[["528[89]\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","
3557093\\d{5}|(?:[56]94|[89]\\d\\d)\\d{6}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|80[6-9]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80\\d{7}"],["8[129]\\d{7}"]
vendor: 18,953 bytes, line 355
355,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","8\\d{13}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["20"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["20"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{4})(\\d{5})","$1-$2",["892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8(?:0[0-7]|9)"],"0$1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[5-8]"],"0$1"]],"0",0,0,0,0,"[5-8]"],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|
355[89]\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80\\d{7}"],["8[129]\\d{7}"],0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}
355(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","30|(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[78]\\d{8}|[2-9]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[2-9
vendor: 19,956 bytes, line 355
355]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["3[289]|4[246-8]|61|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"[3489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-579]|61)","5(?:[0-579]|61[06])","5(?:[0-579]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|5[12]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|5(?:0\\d{3}|2[0-2]))\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function
355p3(t,e){var r=Array.prototype.slice.call(e);return r.push(sV),t.apply(this,r)}function Jme(){return p3(Pge,arguments)}function um(t){return Hz.call(this,t,sV)}um.prototype=Object.create(Hz.prototype,{});um.prototype.constructor=um;function eye(){return p3(Y1e,arguments)}function PS(){return p3(l3,arguments)}function tye(){return p3(Z1e,arguments)}const $2=(t,e)=>Jme(String(t),e),Q6=(t,e)=>`+${PS(e)} ${t}`,rye=t=>`*${t.replaceAll("-","").slice(-4)}`,nye=t=>new um(t),iye=eye().map((t=>({code:t,callCode:PS(t)}))),sye=t=>{var r;let e=(r=tye(t,Xme))==null?void 0:r.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},aye=t=>{let e=new um;e.input(t);let r=e.getCountry()||"US",n=e.getCallingCode()||"1";return{countryCode:r,phone:t.replace("+"+n,"")}},oye=(t,e=!0)=>t.reduce(((r,n)=>({...r,[n]:e})),{});let cye={buy:"CARD",send:"CRYPTO_ACCOUNT"},lye={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1"};function uye({input:t,amount:e,blockchain:r,asset:n,experience:i}){let s=new URL("https://pay.coinbase.com/buy/select-asset");return s.searchParams.set("appId",t.app_id),s.searchParams.set("sessionToken",t.session_token),s.searchParams.set("defaultExperience",i),s.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),s.searchParams.set("defaultNetwork",r),s.searchParams.set("defaultPaymentMethod",cye[i]),s.searchParams.set("defaultAsset",lye[n]),s.searchParams.set("partnerUserId",t.partner_user_id),{url:s}}let dye=class{async invokeRpc({method:e,params:r}){return await(await fetch(this.cluster.rpcUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:nV(),method:e,params:r})})).json()}async getBalance(e){try{let r=await this.invokeRpc({method:"getBalance",params:[e]});return r.error?null:BigInt(r.result.value)}catch{return null}}async getTokenAccountsByOwner(e,r){var n,i,s,a,o;try{let c=await this.invokeRpc({method:"getTokenAccountsByOwner",params:[e,{mint:r},{encoding:"jsonParsed"}]});if(c.error)return null;let l=(o=(a=(s=(i=(n=c.result.value.at(0))==null?void 0:n.account)==null?void 0:i.data)==null?void 0:s.parsed)==null?void 0:a.info)==null?void 0:o.tokenAmount;return l?{amount:BigInt(l.amount),decimals:l.decimals}:null}catch{return null}}async getAccountInfo(e){var r,n,i;try{let s=await this.invokeRpc({method:"getAccountInfo",params:[e,{encoding:"jsonParsed"}]});if(s.error)return null;let a=(i=(n=(r=s.result.value)==null?void 0:r.data)==null?void 0:n.parsed)==null?void 0:i.info;return a?{decimals:a.decimals}:null}catch{return null}}constructor(e){this.cluster=e}};const fye="1.2.3";let qs=class a9 extends Error{constructor(e,r={}){var a;const n=r.cause instanceof a9?r.cause.details:(a=r.cause)!=null&&a.message?r.cause.message:r.details,i=r.cause instanceof a9&&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@${fye}`].join(` 356`);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 jl(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const aV=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,oV=/^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)?$/,cV=/^\(.+?\).*?$/,JN=/^tuple(?<array>(\[(\d*)\])*)$/;function o9(t){let e=t.type;if(JN.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+=o9(s),i<r-1&&(e+=", ")}const n=jl(JN,t.type);return e+=`)${(n==null?void 0:n.array)||""}`,o9({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e}
356 indexed`),t.name?`${e} ${t.name}`:e}function Fh(t){let e="";const r=t.length;for(let n=0;n<r;n++){const i=t[n];e+=o9(i),n!==r-1&&(e+=", ")}return e}function Ov(t){var e;return t.type==="function"?`function ${t.name}(${Fh(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${(e=t.outputs)!=null&&e.length?` returns (${Fh(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${Fh(t.inputs)})`:t.type==="error"?`error ${t.name}(${Fh(t.inputs)})`:t.type==="constructor"?`constructor(${Fh(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?`fallback() external${t.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const lV=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function hye(t){return lV.test(t)}function pye(t){return jl(lV,t)}const uV=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function gye(t){return uV.test(t)}function mye(t){return jl(uV,t)}const dV=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function yye(t){return dV.test(t)}function bye(t){return jl(dV,t)}const fV=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function g3(t){return fV.test(t)}function vye(t){return jl(fV,t)}const hV=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function wye(t){return hV.test(t)}function Eye(t){return jl(hV,t)}const pV=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function xye(t){return pV.test(t)}function _ye(t){return jl(pV,t)}const Cye=/^receive\(\) external payable$/;function Sye(t){return Cye.test(t)}const eP=new Set(["memory","indexed","storage","calldata"]),Aye=new Set(["indexed"]),c9=new Set(["calldata","memory","storage"]);class Tye extends qs{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 Iye extends qs{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 kye extends qs{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 $ye extends qs{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 Nye extends qs{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Pye extends qs{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 Oye extends qs{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 Rye extends qs{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 Dye extends qs{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invali
356d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class S0 extends qs{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Mye extends qs{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class jye extends qs{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 Lye extends qs{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 Fye extends qs{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 Uye(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let s="";for(const a of i[1])s+=`[${a.type}${a.name?`:${a.name}`:""}]`;n+=`(${i[0]}{${s}})`}return e?`${e}:${t}${n}`:`${t}${n}`}
356const Y6=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 l9(t,e={}){if(yye(t))return Bye(t,e);if(gye(t))return qye(t,e);if(hye(t))return Wye(t,e);if(wye(t))return zye(t,e);if(xye(t))return Vye(t);if(Sye(t))return{type:"receive",stateMutability:"payable"};throw new Mye({signature:t})}function Bye(t,e={}){const r=bye(t);if(!r)throw new S0({signature:t,type:"function"});const n=sa(r.parameters),i=[],s=n.length;for(let o=0;o<s;o++)i.push(_l(n[o],{modifiers:c9,structs:e,type:"function"}));const a=[];if(r.returns){const o=sa(r.returns),c=o.length;for(let l=0;l<c;l++)a.push(_l(o[l],{modifiers:c9,structs:e,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:a}}function qye(t,e={}){const r=mye(t);if(!r)throw new S0({signature:t,type:"event"});const n=sa(r.parameters),i=[],s=n.length;for(let a=0;a<s;a++)i.push(_l(n[a],{modifiers:Aye,structs:e,type:"event"}));return{name:r.name,type:"event",inputs:i}}function Wye(t,e={}){const r=pye(t);if(!r)throw new S0({signature:t,type:"error"});const n=sa(r.parameters),i=[],s=n.length;for(let a=0;a<s;a++)i.push(_l(n[a],{structs:e,type:"error"}));return{name:r.name,type:"error",inputs:i}}function zye(t,e={}){const r=Eye(t);if(!r)throw new S0({signature:t,type:"constructor"});const n=sa(r.parameters),i=[],s=n.length;for(let a=0;a<s;a++)i.push(_l(n[a],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}function Vye(t){const e=_ye(t);if(!e)throw new S0({signature:t,type:"fallback"});return{type:"fallback",stateMutability:e.stateMutability??"nonpayable"}}const Hye=/^(?<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$_]*))?$/,Gye=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Kye=/^u?int$/;function _l(t,e){var d,f;const r=Uye(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(Y6.has(r))return Y6.get(r);const n=cV.test(t),i=jl(n?Gye:Hye,t);if(!i)throw new Nye({param:t});if(i.name&&Yye(i.name))throw new Pye({param:t,name:i.name});const s=i.name?{name:i.name}:{},a=i.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let c,l={};if(n){c="tuple";const h=sa(i.type),g=[],m=h.length;for(let y=0;y<m;y++)g.push(_l(h[y],{structs:o}));l={components:g}}else if(i.type in o)c="tuple",l={components:o[i.type]};else if(Kye.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"&&!gV(c))throw new kye({type:c});if(i.modifier){if(!((f=(d=e==null?void 0:e.modifiers)==null?void 0:d.has)!=null&&f.call(d,i.modifier)))throw new Oye({param:t,type:e==null?void 0:e.type,modifier:i.modifier});if(c9.has(i.modifier)&&!Zye(c,!!i.array))throw new Rye({param:t,type:e==null?void 0:e.type,modifier:i.modifier})}const u={type:`${c}${i.array??""}`,...s,...a,...l};return Y6.set(r,u),u}function sa(t,e=[],r="",n=0){const i=t.trim().length;for(let s=0;s<i;s++){const a=t[s],o=t.slice(s+1);switch(a){case",":return n===0?sa(o,[...e,r.trim()]):sa(o,e,`${r}${a}`,n);case"(":return sa(o,e,`${r}${a}`,n+1);case")":return sa(o,e,`${r}${a}`,n-1);default:return sa(o,e,`${r}${a}`,n)}}if(r==="")return e;if(n!==0)throw new Fye({current:r,depth:n});return e.push(r.trim()),e}function gV(t){return t==="address"||t==="bool"||t==="function"||t==="string"||aV.test(t)||oV.test(t)}const Qye=/^(?: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 Yye(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||aV.test(t)||oV.test(t)||Qye.test(t)}function Zye(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}function OS(t){const e={},r=t.length;for(let a=0;a<r;a++){const o=t[a];if(!g3(o))continue;const c=vye(o);if(!c)throw new S0({signature:o,type:"struct"});const l=c.properties.split(";"),u=[],d=l.length;for(let f=0;f<d;f++){const g=l[f].trim();if(!g)continue;const m=_l(g,{type:"struct"});u.push(m)}if(!u.length)throw new jye({signature:o});e[c.name]=u}const n={},i=Object.entries(e),s=i.length;for(let a=0;a<s;a++){const[o,c]=i[a];n[o]=mV(c,e)}return n}const Xye=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function mV(t=[],e={},r=new Set){const n=[],i=t.length;for(let s=0;s<i;s++){const a=t[s];if(cV.test(a.type))n.push(a);else{const c=jl(Xye,a.type);if(!(c!=null&&c.type))throw new Dye({abiParameter:a});const{array:l,type:u}=c;if(u in e){if(r.has(u))throw new Lye({type:u});n.push({...a,type:`tuple${l??""}`,components:mV(e[u],e,new Set([...r,u]))})}else if(gV(u))n.push(a);else throw new Iye({type:u})}}return n}function yV(t){const e=OS(t),r=[],n=t.length;for(let i=0;i<n;i++){const s=t[i];g3(s)||r.push(l9(s,e))}return r}function tP(t){let e;if(typeof t=="string")e=l9(t);else{const r=OS(t),n=t.length;for(let i=0;i<n;i++){const s=t[i];if(!g3(s)){e=l9(s,r);break}}}if(!e)throw new Tye({signature:t});return e}function rP(t){const e=[];
356if(typeof t=="string"){const r=sa(t),n=r.length;for(let i=0;i<n;i++)e.push(_l(r[i],{modifiers:eP}))}else{const r=OS(t),n=t.length;for(let i=0;i<n;i++){const s=t[i];if(g3(s))continue;const a=sa(s),o=a.length;for(let c=0;c<o;c++)e.push(_l(a[c],{modifiers:eP,structs:r}))}}if(e.length===0)throw new $ye({params:t});return e}function Tt(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 Eo(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new f2e(t.type);return`${t.name}(${m3(t.inputs,{includeName:e})})`}function m3(t,{includeName:e=!1}={}){return t?t.map(r=>Jye(r,{includeName:e})).join(e?", ":","):""}function Jye(t,{includeName:e}){return t.type.startsWith("tuple")?`(${m3(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function xo(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Tn(t){return xo(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const bV="2.47.6";let ug={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${bV}`},Ye=class u9 extends Error{constructor(e,r={}){var o;const n=(()=>{var c;return r.cause instanceof u9?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),i=r.cause instanceof u9&&r.cause.docsPath||r.docsPath,s=(o=ug.getDocsUrl)==null?void 0:o.call(ug,{...r,docsPath:i}),a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...ug.version?[`Version: ${ug.version}`]:[]].join(` 357`);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,"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=bV}walk(e){return vV(this,e)}};function vV(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?vV(t.cause,e):e?null:t}class e2e extends Ye{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(` 358`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class nP extends Ye{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(` 359`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class wV extends Ye{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` 360`),{metaMessages:[`Params: (${m3(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 by extends Ye{constructor({cause:e}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:e})}}class t2e extends Ye{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(`
361`),{name:"AbiEncodingArrayLengthMismatchError"})}}class r2e extends Ye{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Tn(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class n2e extends Ye{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` 362`),{name:"AbiEncodingLengthMismatchError"})}}class i2e extends Ye{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(` 363`),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}}class iP extends Ye{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(` 364`),{docsPath:r,name:"AbiErrorNotFoundError"})}}class EV extends Ye{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(` 365`),{docsPath:r,name:"AbiErrorSignatureNotFoundError",cause:n}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class s2e extends Ye{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class a2e extends Ye{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(` 366`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}}class sP extends Ye{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(` 367`),{docsPath:r,name:"AbiEventNotFoundError"})}}class Yp extends Ye{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(` 368`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class xV extends Ye{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(` 369`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class o2e extends Ye{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(` 370`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class c2e extends Ye{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Eo(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Eo(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let l2e=class extends Ye{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}};class Rv extends Ye{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` 371`),{metaMessages:[`Params: (${m3(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 RS extends Ye{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Eo(e,{includeName:!0})}".`].join(` 372`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class u2e extends Ye{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` 373`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class d2e extends Ye{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` 374`),{docsPath:r,name:"InvalidAbiDecodingType"})}}let _V=class extends Ye{constructor(e){super([`Value "${e}" is not a valid array.`].join(` 375`),{name:"InvalidArrayError"})}};class f2e extends Ye{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` 376`),{name:"InvalidDefinitionTypeError"})}}class h2e extends Ye{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let CV=class extends Ye{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},SV=class extends Ye{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 aP extends Ye{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 A0(t,{dir:e,size:r=32}={}){return typeof t=="string"?Du(t,{dir:e,size:r}):p2e(t,{dir:e,size:r})}function Du(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new SV({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function p2e(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new SV({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 DS=class extends Ye{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"})}},g2e=class extends Ye{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 m2e extends Ye{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let y2e=class extends Ye{constructor({givenSize:e,maxSize:r}
376){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}};function Mu(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 Do(t,{size:e}){if(Tn(t)>e)throw new y2e({givenSize:Tn(t),maxSize:e})}function ha(t,e={}){const{signed:r}=e;e.size&&Do(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 b2e(t,e={}){let r=t;if(e.size&&(Do(r,{size:e.size}),r=Mu(r)),Mu(r)==="0x00")return!1;if(Mu(r)==="0x01")return!0;throw new m2e(r)}function _o(t,e={}){const r=ha(t,e),n=Number(r);if(!Number.isSafeInteger(n))throw new DS({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:e.signed,size:e.size,value:`${r}n`});return n}const v2e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function bc(t,e={}){return typeof t=="number"||typeof t=="bigint"?Vt(t,e):typeof t=="string"?Zp(t,e):typeof t=="boolean"?AV(t,e):di(t,e)}function AV(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Do(r,{size:e.size}),A0(r,{size:e.size})):r}function di(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=v2e[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(Do(n,{size:e.size}),A0(n,{dir:"right",size:e.size})):n}function Vt(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 a=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<a){const c=typeof t=="bigint"?"n":"";throw new DS({max:s?`${s}${c}`:void 0,min:`${a}${c}`,signed:r,size:n,value:`${t}${c}`})}const o=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?A0(o,{size:n}):o}const w2e=new TextEncoder;function Zp(t,e={}){const r=w2e.encode(t);return di(r,e)}const E2e=new TextEncoder;function T0(t,e={}){return typeof t=="number"||typeof t=="bigint"?_2e(t,e):typeof t=="boolean"?x2e(t,e):xo(t)?vc(t,e):pf(t,e)}function x2e(t,e={}){const r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(Do(r,{size:e.size}),A0(r,{size:e.size})):r}const Tc={zero:48,nine:57,A:65,F:70,a:97,f:102};function oP(t){if(t>=Tc.zero&&t<=Tc.nine)return t-Tc.zero;if(t>=Tc.A&&t<=Tc.F)return t-(Tc.A-10);if(t>=Tc.a&&t<=Tc.f)return t-(Tc.a-10)}function vc(t,e={}){let r=t;e.size&&(Do(r,{size:e.size}),r=A0(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 a=0,o=0;a<i;a++){const c=oP(n.charCodeAt(o++)),l=oP(n.charCodeAt(o++));if(c===void 0||l===void 0)throw new Ye(`Invalid byte sequence ("${n[o-2]}${n[o-1]}" in "${n}").`);s[a]=c*16+l}return s}function _2e(t,e){const r=Vt(t,e);return vc(r)}function pf(t,e={}){const r=E2e.encode(t);return typeof e.size=="number"?(Do(r,{size:e.size}),A0(r,{dir:"right",size:e.size})):r}const N2=BigInt(2**32-1),cP=BigInt(32);function C2e(t,e=!1){return e?{h:Number(t&N2),l:Number(t>>cP&N2)}:{h:Number(t>>cP&N2)|0,l:Number(t&N2)|0}}function S2e(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:a,l:o}=C2e(t[s],e);[n[s],i[s]]=[a,o]}return[n,i]}const A2e=(t,e,r)=>t<<r|e>>>32-r,T2e=(t,e,r)=>e<<r|t>>>32-r,I2e=(t,e,r)=>e<<r-32|t>>>64-r,k2e=(t,e,r)=>t<<r-32|e>>>64-r,Ch=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function $2e(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function dm(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Af(t,...e){if(!$2e(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 N2e(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");dm(t.outputLen),dm(t.blockLen)}function Xp(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 TV(t,e){Af(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function P2e(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Jp(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function Z6(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Lo(t,e){return t<<32-e|t>>>e}
vendor: 1,317 bytes, line 376
376const O2e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function R2e(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function D2e(t){for(let e=0;e<t.length;e++)t[e]=R2e(t[e]);return t}const lP=O2e?t=>t:D2e;function M2e(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function y3(t){return typeof t=="string"&&(t=M2e(t)),Af(t),t}function j2e(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];Af(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 MS{}function IV(t){const e=n=>t().update(y3(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function L2e(t=32){if(Ch&&typeof Ch.getRandomValues=="function")return Ch.getRandomValues(new Uint8Array(t));if(Ch&&typeof Ch.randomBytes=="function")return Uint8Array.from(Ch.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const F2e=BigInt(0),dg=BigInt(1),U2e=BigInt(2),B2e=BigInt(7),q2e=BigInt(256),W2e=BigInt(113),kV=[],$V=[],NV=[];for(let t=0,e=dg,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],kV.push(2*(5*n+r)),$V.push((t+1)*(t+2)/2%64);let i=F2e;for(let s=0;s<7;s++)e=(e<<dg^(e>>B2e)*W2e)%q2e,e&U2e&&(i^=dg<<(dg<<BigInt(s))-dg);NV.push(i)}
376const PV=S2e(NV,!0),z2e=PV[0],V2e=PV[1],uP=(t,e,r)=>r>32?I2e(t,e,r):A2e(t,e,r),dP=(t,e,r)=>r>32?k2e(t,e,r):T2e(t,e,r);function H2e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,c=(a+2)%10,l=r[c],u=r[c+1],d=uP(l,u,1)^r[o],f=dP(l,u,1)^r[o+1];for(let h=0;h<50;h+=10)t[a+h]^=d,t[a+h+1]^=f}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=$V[a],c=uP(i,s,o),l=dP(i,s,o),u=kV[a];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)r[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=z2e[n],t[1]^=V2e[n]}Jp(r)}class jS extends MS{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,dm(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=P2e(this.state)}clone(){return this._cloneInto()}keccak(){lP(this.state32),H2e(this.state32,this.rounds),lP(this.state32),this.posOut=0,this.pos=0}update(e){Xp(this),e=y3(e),Af(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(r-this.pos,i-s);for(let o=0;o<a;o++)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)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Xp(this,!1),Af(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 a=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return dm(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(TV(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,Jp(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new jS(r,n,i,a,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=a,e.destroyed=this.destroyed,e}}const G2e=(t,e,r)=>IV(()=>new jS(e,t,r)),LS=G2e(1,136,256/8);function Li(t,e){const r=e||"hex",n=LS(xo(t,{strict:!1})?T0(t):t);return r==="bytes"?n:bc(n)}const K2e=t=>Li(T0(t));function Q2e(t){return K2e(t)}function Y2e(t){let e=!0,r="",n=0,i="",s=!1;for(let a=0;a<t.length;a++){const o=t[a];if(["(",")",","].includes(o)&&(e=!0),o==="("&&n++,o===")"&&n--,!!e){if(n===0){if(o===" "&&["event","function",""].includes(i))i="";else if(i+=o,o===")"){s=!0;break}continue}if(o===" "){t[a-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=o,r+=o}}if(!s)throw new Ye("Unable to normalize signature.");return i}const Z2e=t=>{const e=typeof t=="string"?t:Ov(t);return Y2e(e)};function OV(t){return Q2e(Z2e(t))}const b3=OV;let Qu=class extends Ye{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"})}},I0=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 X6=new I0(8192);function vy(t,e){if(X6.has(`${t}.${e}`))return X6.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=Li(pf(r),"bytes"),i=r.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&i[a]&&(i[a]=i[a].toUpperCase()),(n[a>>1]&15)>=8&&i[a+1]&&(i[a+1]=i[a+1].toUpperCase());const s=`0x${i.join("")}`;return X6.set(`${t}.${e}`,s),s}
376function e0(t,e){if(!La(t,{strict:!1}))throw new Qu({address:t});return vy(t,e)}const X2e=/^0x[a-fA-F0-9]{40}$/,J6=new I0(8192);function La(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(J6.has(n))return J6.get(n);const i=X2e.test(t)?t.toLowerCase()===t?!0:r?vy(t)===t:!0:!1;return J6.set(n,i),i}function is(t){return typeof t[0]=="string"?k0(t):J2e(t)}function J2e(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 k0(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Tf(t,e,r,{strict:n}={}){return xo(t,{strict:!1})?d9(t,e,r,{strict:n}):MV(t,e,r,{strict:n})}function RV(t,e){if(typeof e=="number"&&e>0&&e>Tn(t)-1)throw new CV({offset:e,position:"start",size:Tn(t)})}function DV(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Tn(t)!==r-e)throw new CV({offset:r,position:"end",size:Tn(t)})}function MV(t,e,r,{strict:n}={}){RV(t,e);const i=t.slice(e,r);return n&&DV(i,e,r),i}function d9(t,e,r,{strict:n}={}){RV(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&DV(i,e,r),i}const ebe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,jV=/^(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 Jf(t,e){if(t.length!==e.length)throw new n2e({expectedLength:t.length,givenLength:e.length});const r=tbe({params:t,values:e}),n=US(r);return n.length===0?"0x":n}function tbe({params:t,values:e}){const r=[];for(let n=0;n<t.length;n++)r.push(FS({param:t[n],value:e[n]}));return r}function FS({param:t,value:e}){const r=BS(t.type);if(r){const[n,i]=r;return nbe(e,{length:n,param:{...t,type:i}})}if(t.type==="tuple")return cbe(e,{param:t});if(t.type==="address")return rbe(e);if(t.type==="bool")return sbe(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const n=t.type.startsWith("int"),[,,i="256"]=jV.exec(t.type)??[];return abe(e,{signed:n,size:Number(i)})}if(t.type.startsWith("bytes"))return ibe(e,{param:t});if(t.type==="string")return obe(e);throw new u2e(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function US(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?e+=32:e+=Tn(o)}const r=[],n=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?(r.push(Vt(e+i,{size:32})),n.push(o),i+=Tn(o)):r.push(o)}return is([...r,...n])}function rbe(t){if(!La(t))throw new Qu({address:t});return{dynamic:!1,encoded:Du(t.toLowerCase())}}function nbe(t,{length:e,param:r}){const n=e===null;if(!Array.isArray(t))throw new _V(t);if(!n&&t.length!==e)throw new t2e({expectedLength:e,givenLength:t.length,type:`${r.type}[${e}]`});let i=!1;const s=[];for(let a=0;a<t.length;a++){const o=FS({param:r,value:t[a]});o.dynamic&&(i=!0),s.push(o)}if(n||i){const a=US(s);if(n){const o=Vt(s.length,{size:32});return{dynamic:!0,encoded:s.length>0?is([o,a]):o}}if(i)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:is(s.map(({encoded:a})=>a))}}function ibe(t,{param:e}){const[,r]=e.type.split("bytes"),n=Tn(t);if(!r){let i=t;return n%32!==0&&(i=Du(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:is([Du(Vt(n,{size:32})),i])}}if(n!==Number.parseInt(r,10))throw new r2e({expectedSize:Number.parseInt(r,10),value:t});return{dynamic:!1,encoded:Du(t,{dir:"right"})}}function sbe(t){if(typeof t!="boolean")throw new Ye(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Du(AV(t))}}function abe(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 DS({max:n.toString(),min:i.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:Vt(t,{size:32,signed:e})}}function obe(t){const e=Zp(t),r=Math.ceil(Tn(e)/32),n=[];for(let i=0;i<r;i++)n.push(Du(Tf(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:is([Du(Vt(Tn(e),{size:32})),...n])}}function cbe(t,{param:e}){let r=!1;const n=[];for(let i=0;i<e.components.length;i++){const s=e.components[i],a=Array.isArray(t)?i:s.name,o=FS({param:s,value:t[a]});n.push(o),o.dynamic&&(r=!0)}return{dynamic:r,encoded:r?US(n):is(n.map(({encoded:i})=>i))}}function BS(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const wy=t=>Tf(OV(t),0,4);function eh(t){const{abi:e,args:r=[],name:n}=t,i=xo(n,{strict:!1}),s=e.filter(o=>i?o.type==="function"?wy(o)===n:o.type==="event"?b3(o)===n:!1:"name"in o&&o.name===n);if(s.length===0)return;if(s.length===1)return s[0];let a;for(const o of s){if(!("inputs"in o))continue;if(!r||r.length===0){if(!o.inputs||o.inputs.length===0)return o;continue}if(!o.inputs||o.inputs.length===0||o.inputs.length!==r.length)continue;if(r.every((l,u)=>{const d="inputs"in o&&o.inputs[u];return d?f9(l,d):!1}
376)){if(a&&"inputs"in a&&a.inputs){const l=LV(o.inputs,a.inputs,r);if(l)throw new c2e({abiItem:o,type:l[0]},{abiItem:a,type:l[1]})}a=o}}return a||s[0]}function f9(t,e){const r=typeof t,n=e.type;switch(n){case"address":return La(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"&&f9(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=>f9(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function LV(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 LV(i.components,s.components,r[n]);const a=[i.type,s.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?La(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?La(r[n],{strict:!1}):!1)return a}}const fP="/docs/contract/encodeEventTopics";function Ey(t){var c;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const l=eh({abi:e,name:r});if(!l)throw new sP(r,{docsPath:fP});i=l}if(i.type!=="event")throw new sP(void 0,{docsPath:fP});const s=Eo(i),a=b3(s);let o=[];if(n&&"inputs"in i){const l=(c=i.inputs)==null?void 0:c.filter(d=>"indexed"in d&&d.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(l==null?void 0:l.map(d=>n[d.name]))??[]:[];u.length>0&&(o=(l==null?void 0:l.map((d,f)=>Array.isArray(u[f])?u[f].map((h,g)=>hP({param:d,value:u[f][g]})):typeof u[f]<"u"&&u[f]!==null?hP({param:d,value:u[f]}):null))??[])}return[a,...o]}function hP({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Li(T0(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new h2e(t.type);return Jf([t],[e])}function v3(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:a,status:o,transport:c})=>{o==="success"&&e===s&&(r[a]=c.request)})),(s=>r[s]||t.request)}async function FV(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:a,strict:o,toBlock:c}=e,l=v3(t,{method:"eth_newFilter"}),u=s?Ey({abi:n,args:i,eventName:s}):void 0,d=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof a=="bigint"?Vt(a):a,toBlock:typeof c=="bigint"?Vt(c):c,topics:u}]});return{abi:n,args:i,eventName:s,id:d,request:l(d),strict:!!o,type:"event"}}function vn(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const pP="/docs/contract/encodeFunctionData";function lbe(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const s=eh({abi:e,args:r,name:n});if(!s)throw new Yp(n,{docsPath:pP});i=s}if(i.type!=="function")throw new Yp(void 0,{docsPath:pP});return{abi:[i],functionName:wy(Eo(i))}}function ws(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var o;return t.abi.length===1&&((o=t.functionName)!=null&&o.startsWith("0x"))?t:lbe(t)})(),i=r[0],s=n,a="inputs"in i&&i.inputs?Jf(i.inputs,e??[]):void 0;return k0([s,a??"0x"])}const ube={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."},UV={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},dbe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let gP=class extends Ye{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}},BV=class extends Ye{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}},fbe=class extends Ye{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}};const hbe={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 fbe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new BV({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new gP({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 gP({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 qS(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(hbe);return r.bytes=t,r.dataView=new DataView(t.buffer??t,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function pbe(t,e={}){typeof e.size<"u"&&Do(t,{size:e.size});const r=di(t,e);return ha(r,e)}function gbe(t,e={}){let r=t;if(typeof e.size<"u"&&(Do(r,{size:e.size}),r=Mu(r)),r.length>1||r[0]>1)throw new g2e(r);return!!r[0]}function fl(t,e={}){typeof e.size<"u"&&Do(t,{size:e.size});const r=di(t,e);return _o(r,e)}function mbe(t,e={}){let r=t;return typeof e.size<"u"&&(Do(r,{size:e.size}),r=Mu(r,{dir:"right"})),new TextDecoder().decode(r)}function $0(t,e){const r=typeof e=="string"?vc(e):e,n=qS(r);if(Tn(r)===0&&t.length>0)throw new by;if(Tn(e)&&Tn(e)<32)throw new wV({data:typeof e=="string"?e:di(e),params:t,size:Tn(e)});let i=0;const s=[];for(let a=0;a<t.length;++a){const o=t[a];n.setPosition(i);const[c,l]=gp(n,o,{staticPosition:0});i+=l,s.push(c)}return s}function gp(t,e,{staticPosition:r}){const n=BS(e.type);if(n){const[i,s]=n;return bbe(t,{...e,type:s},{length:i,staticPosition:r})}if(e.type==="tuple")return xbe(t,e,{staticPosition:r});if(e.type==="address")return ybe(t);if(e.type==="bool")return vbe(t);if(e.type.startsWith("bytes"))return wbe(t,e,{staticPosition:r});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Ebe(t,e);if(e.type==="string")return _be(t,{staticPosition:r});throw new d2e(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const mP=32,h9=32;function ybe(t){const e=t.readBytes(32);return[vy(di(MV(e,-20))),32]}function bbe(t,e,{length:r,staticPosition:n}){if(!r){const a=fl(t.readBytes(h9)),o=n+a,c=o+mP;t.setPosition(o);const l=fl(t.readBytes(mP)),u=fm(e);let d=0;const f=[];for(let h=0;h<l;++h){t.setPosition(c+(u?h*32:d));const[g,m]=gp(t,e,{staticPosition:c});d+=m,f.push(g)}return t.setPosition(n+32),[f,32]}if(fm(e)){const a=fl(t.readBytes(h9)),o=n+a,c=[];for(let l=0;l<r;++l){t.setPosition(o+l*32);const[u]=gp(t,e,{staticPosition:o});c.push(u)}return t.setPosition(n+32),[c,32]}let i=0;const s=[];for(let a=0;a<r;++a){const[o,c]=gp(t,e,{staticPosition:n+i});i+=c,s.push(o)}return[s,i]}function vbe(t){return[gbe(t.readBytes(32),{size:32}),32]}function wbe(t,e,{staticPosition:r}){const[n,i]=e.type.split("bytes");if(!i){const a=fl(t.readBytes(32));t.setPosition(r+a);const o=fl(t.readBytes(32));if(o===0)return t.setPosition(r+32),["0x",32];const c=t.readBytes(o);return t.setPosition(r+32),[di(c),32]}return[di(t.readBytes(Number.parseInt(i,10),32)),32]}function Ebe(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?pbe(i,{signed:r}):fl(i,{signed:r}),32]}function xbe(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:a})=>!a),i=n?[]:{};let s=0;if(fm(e)){const a=fl(t.readBytes(h9)),o=r+a;for(let c=0;c<e.components.length;++c){const l=e.components[c];t.setPosition(o+s);const[u,d]=gp(t,l,{staticPosition:o});s+=d,i[n?c:l==null?void 0:l.name]=u}return t.setPosition(r+32),[i,32]}for(let a=0;a<e.components.length;++a){const o=e.components[a],[c,l]=gp(t,o,{staticPosition:r});i[n?a:o==null?void 0:o.name]=c,s+=l}return[i,s]}function _be(t,{staticPosition:e}){const r=fl(t.readBytes(32)),n=e+r;t.setPosition(n);const i=fl(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),a=mbe(Mu(s));return t.setPosition(e+32),[a,32]}function fm(t){var n;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;
376if(e==="tuple")return(n=t.components)==null?void 0:n.some(fm);const r=BS(t.type);return!!(r&&fm({...t,type:r[1]}))}function Cbe(t){const{abi:e,data:r,cause:n}=t,i=Tf(r,0,4);if(i==="0x")throw new by({cause:n});const a=[...e||[],UV,dbe].find(o=>o.type==="error"&&i===wy(Eo(o)));if(!a)throw new EV(i,{docsPath:"/docs/contract/decodeErrorResult",cause:n});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?$0(a.inputs,Tf(r,4)):void 0,errorName:a.name}}const li=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function qV({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"?li(e[s]):e[s]}`).join(", ")})`}const WV={gwei:9,wei:18},Sbe={ether:-9,wei:9};function hm(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 xy(t,e="wei"){return hm(t,WV[e])}function js(t,e="wei"){return hm(t,Sbe[e])}class Abe extends Ye{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class Tbe extends Ye{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function yP(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} 377`,"")}function Ibe(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: 378`;return n.nonce&&(i+=` nonce: ${n.nonce} 379`),n.balance&&(i+=` balance: ${n.balance} 380`),n.code&&(i+=` code: ${n.code} 381`),n.state&&(i+=` state: 382`,i+=yP(n.state)),n.stateDiff&&(i+=` stateDiff: 383`,i+=yP(n.stateDiff)),i},` State Override: 384`).slice(0,-1)}function _y(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(` 385`)}class kbe extends Ye{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",_y(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 $be extends Ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var g;const h=_y({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${xy(f)} ${((g=i==null?void 0:i.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${js(o)} gwei`,maxFeePerGas:typeof c<"u"&&`${js(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${js(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class zV extends Ye{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let a="Transaction";n&&s!==void 0&&(a=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(a=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(a=`Transaction at block number "${r}" at index "${s}"`),i&&(a=`Transaction with hash "${i}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}}class VV extends Ye{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 HV extends Ye{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 Nbe extends Ye{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const Pbe=t=>t,WS=t=>t;class GV extends Ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f,stateOverride:h}){var y;const g=r?vn(r):void 0;let m=_y({from:g==null?void 0:g.address,to:d,value:typeof f<"u"&&`${xy(f)} ${((y=i==null?void 0:i.nativeCurrency)==null?void 0:y.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${js(o)} gwei`,maxFeePerGas:typeof c<"u"&&`${js(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${js(l)} gwei`,nonce:u});h&&(m+=` 386${Ibe(h)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",m].filter(
386Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class KV extends Ye{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:a,sender:o}){const c=eh({abi:r,args:n,name:a}),l=c?qV({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Eo(c,{includeName:!0}):void 0,d=_y({address:i&&Pbe(i),function:u,args:l&&l!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],d&&"Contract Call:",d].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=a,this.sender=o}}class p9 extends Ye{constructor({abi:e,data:r,functionName:n,message:i,cause:s}){let a,o,c,l;if(r&&r!=="0x")try{o=Cbe({abi:e,data:r,cause:s});const{abiItem:d,errorName:f,args:h}=o;if(f==="Error")l=h[0];else if(f==="Panic"){const[g]=h;l=ube[g]}else{const g=d?Eo(d,{includeName:!0}):void 0,m=d&&h?qV({abiItem:d,args:h,includeFunctionName:!1,includeName:!1}):void 0;c=[g?`Error: ${g}`:"",m&&m!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(d){a=d}else i&&(l=i);let u;a instanceof EV&&(u=a.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(` 387`):`The contract function "${n}" reverted.`,{cause:a??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=o,this.raw=r,this.reason=l,this.signature=u}}class Obe extends Ye{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 Rbe extends Ye{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 w3 extends Ye{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 A1 extends Ye{constructor({body:e,cause:r,details:n,headers:i,status:s,url:a}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${WS(a)}`,e&&`Request body: ${li(e)}
387`].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=a}}class zS extends Ye{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${WS(n)}`,`Request body: ${li(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 bP extends Ye{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${WS(r)}`,`Request body: ${li(e)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=r}}const Dbe=-1;class Ws extends Ye{constructor(e,{code:r,docsPath:n,metaMessages:i,name:s,shortMessage:a}){super(a,{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 zS?e.code:r??Dbe}}class zs 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 pm extends Ws{constructor(e){super(e,{code:pm.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(pm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class gm extends Ws{constructor(e){super(e,{code:gm.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(gm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class mm extends Ws{constructor(e,{method:r}={}){super(e,{code:mm.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(mm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class ym extends Ws{constructor(e){super(e,{code:ym.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` 388`)})}}Object.defineProperty(ym,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class If extends Ws{constructor(e){super(e,{code:If.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(If,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Yu extends Ws{constructor(e){super(e,{code:Yu.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` 389`)})}}Object.defineProperty(Yu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class bm extends Ws{constructor(e){super(e,{code:bm.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(bm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class vm extends Ws{constructor(e){super(e,{code:vm.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(vm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class wm extends Ws{constructor(e){super(e,{code:wm.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(wm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Zd extends Ws{constructor(e,{method:r}={}){super(e,{code:Zd.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(Zd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class t0 extends Ws{constructor(e){super(e,{code:t0.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(t0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Em extends Ws{constructor(e){super(e,{code:Em.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Em,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class mp extends zs{constructor(e){super(e,{code:mp.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(mp,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class xm extends zs{constructor(e){super(e,{code:xm.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(xm,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class _m extends zs{constructor(e,{method:r}={}){super(e,{code:_m.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(_m,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Cm extends zs{constructor(e){super(e,{code:Cm.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Cm,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Sm extends zs{constructor(e){super(e,{code:Sm.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Sm,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Am extends zs{constructor(e){super(e,{code:Am.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(Am,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class r0 extends zs{constructor(e){super(e,{code:r0.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(r0,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class Tm extends zs{constructor(e){super(e,{code:Tm.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(Tm,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Im extends zs{constructor(e){super(e,{code:Im.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Im,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class km extends zs{constructor(e){super(e,{code:km.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(km,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class $m extends zs{constructor(e){super(e,{code:$m.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty($m,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Nm extends zs{constructor(e){super(e,{code:Nm.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Nm,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
389);class n0 extends zs{constructor(e){super(e,{code:n0.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(n0,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Pm extends zs{constructor(e){super(e,{code:Pm.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}}Object.defineProperty(Pm,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});class Mbe extends Ws{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const jbe=3;function kf(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:a}){const o=t instanceof w3?t:t instanceof Ye?t.walk(g=>"data"in g)||t.walk():{},{code:c,data:l,details:u,message:d,shortMessage:f}=o,h=t instanceof by?new Obe({functionName:s,cause:t}):[jbe,If.code].includes(c)&&(l||u||d||f)||c===Yu.code&&u==="execution reverted"&&l?new p9({abi:e,data:typeof l=="object"?l.data:l,functionName:s,message:o instanceof zS?u:f??d,cause:t}):t;return new KV(h,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:a})}function Lbe(t){const e=Li(`0x${t.substring(4)}`).substring(26);return vy(`0x${e}`)}async function Fbe({hash:t,signature:e}){const r=xo(t)?t:bc(t),{secp256k1:n}=await sc(async()=>{const{secp256k1:a}=await Promise.resolve().then(()=>h5e);return{secp256k1:a}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:u,v:d,yParity:f}=e,h=Number(f??d),g=vP(h);return new n.Signature(ha(l),ha(u)).addRecoveryBit(g)}const a=xo(e)?e:bc(e);if(Tn(a)!==65)throw new Error("invalid signature length");const o=_o(`0x${a.slice(130)}`),c=vP(o);return n.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function vP(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 g9({hash:t,signature:e}){return Lbe(await Fbe({hash:t,signature:e}))}function Ube(t,e="hex"){const r=QV(t),n=qS(new Uint8Array(r.length));return r.encode(n),e==="hex"?di(n.bytes):n.bytes}function QV(t){return Array.isArray(t)?Bbe(t.map(e=>QV(e))):qbe(t)}function Bbe(t){const e=t.reduce((i,s)=>i+s.length,0),r=YV(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+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 qbe(t){const e=typeof t=="string"?vc(t):t,r=YV(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(183+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 YV(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new Ye("Length is too large.")}function Wbe(t){const{chainId:e,nonce:r,to:n}=t,i=t.contractAddress??t.address,s=Li(k0(["0x05",Ube([e?Vt(e):"0x",i,r?Vt(r):"0x"])]));return n==="bytes"?vc(s):s}async function E3(t){const{authorization:e,signature:r}=t;return g9({hash:Wbe(e),signature:r??e})}class zbe extends Ye{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:a,gasPrice:o,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:f}){var g;const h=_y({from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${xy(f)} ${((g=i==null?void 0:i.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:a,gasPrice:typeof o<"u"&&`${js(o)} gwei`,maxFeePerGas:typeof c<"u"&&`${js(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${js(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 Zh extends Ye{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(Zh,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Zh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Dv extends Ye{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${js(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(Dv,"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 m9 extends Ye{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${js(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(m9,"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 y9 extends Ye{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(y9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class b9 extends Ye{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(` 390`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(b9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class v9 extends Ye{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(v9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class w9 extends Ye{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` 391`),{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(w9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class E9 extends Ye{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(E9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class x9 extends Ye{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(x9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class _9 extends Ye{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(_9,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Mv extends Ye{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${js(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${js(n)} gwei`:""}).`].join(` 392`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(Mv,"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 Cy extends Ye{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function x3(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Ye?t.walk(i=>(i==null?void 0:i.code)===Zh.code):t;return n instanceof Ye?new Zh({cause:t,message:n.details}):Zh.nodeMessage.test(r)?new Zh({cause:t,message:t.details}):Dv.nodeMessage.test(r)?new Dv({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):m9.nodeMessage.test(r)?new m9({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):y9.nodeMessage.test(r)?new y9({cause:t,nonce:e==null?void 0:e.nonce}):b9.nodeMessage.test(r)?new b9({cause:t,nonce:e==null?void 0:e.nonce}):v9.nodeMessage.test(r)?new v9({cause:t,nonce:e==null?void 0:e.nonce}):w9.nodeMessage.test(r)?new w9({cause:t}):E9.nodeMessage.test(r)?new E9({cause:t,gas:e==null?void 0:e.gas}):x9.nodeMessage.test(r)?new x9({cause:t,gas:e==null?void 0:e.gas}):_9.nodeMessage.test(r)?new _9({cause:t}):Mv.nodeMessage.test(r)?new Mv({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Cy({cause:t})}function Vbe(t,{docsPath:e,...r}){const n=(()=>{const i=x3(t,r);return i instanceof Cy?t:i})();return new zbe(n,{docsPath:e,...r})}function N0(t,{format:e}){if(!e)return{};const r={};function n(s){const a=Object.keys(s);for(const o of a)o in t&&(r[o]=t[o]),s[o]&&typeof s[o]=="object"&&!Array.isArray(s[o])&&n(s[o])}const i=e(t||{});return n(i),r}const Hbe={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function ld(t,e){const r={};return typeof t.authorizationList<"u"&&(r.authorizationList=Gbe(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]!="str
392ing"?r.blobs=t.blobs.map(n=>di(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=Vt(t.gas)),typeof t.gasPrice<"u"&&(r.gasPrice=Vt(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=Vt(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(r.maxFeePerGas=Vt(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=Vt(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(r.nonce=Vt(t.nonce)),typeof t.to<"u"&&(r.to=t.to),typeof t.type<"u"&&(r.type=Hbe[t.type]),typeof t.value<"u"&&(r.value=Vt(t.value)),r}function Gbe(t){return t.map(e=>({address:e.address,r:e.r?Vt(BigInt(e.r)):e.r,s:e.s?Vt(BigInt(e.s)):e.s,chainId:Vt(e.chainId),nonce:Vt(e.nonce),...typeof e.yParity<"u"?{yParity:Vt(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Vt(e.v)}:{}}))}function wP(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new aP({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new aP({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function Kbe(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:s}=t,a={};if(s!==void 0&&(a.code=s),e!==void 0&&(a.balance=Vt(e)),r!==void 0&&(a.nonce=Vt(r)),n!==void 0&&(a.state=wP(n)),i!==void 0){if(a.state)throw new Tbe;a.stateDiff=wP(i)}return a}function VS(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!La(r,{strict:!1}))throw new Qu({address:r});if(e[r])throw new Abe({address:r});e[r]=Kbe(n)}return e}const Qbe=2n**256n-1n;function Ll(t){const{account:e,maxFeePerGas:r,maxPriorityFeePerGas:n,to:i}=t,s=e?vn(e):void 0;if(s&&!La(s.address))throw new Qu({address:s.address});if(i&&!La(i))throw new Qu({address:i});if(r&&r>Qbe)throw new Dv({maxFeePerGas:r});if(n&&r&&n>r)throw new Mv({maxFeePerGas:r,maxPriorityFeePerGas:n})}class ZV extends Ye{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class HS extends Ye{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class Ybe extends Ye{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${js(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class XV extends Ye{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 JV={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function GS(t,e){const r={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?_o(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?_o(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?JV[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=Zbe(t.authorizationList)),r.yParity=(()=>{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}function Zbe(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 eH(t,e){const r=(t.transactions??[]).map(n=>typeof n=="string"?n:GS(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}}async function po(t,{blockHash:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest",includeTransactions:i}={}){var l,u,d;const s=i??!1,a=r!==void 0?Vt(r):void 0;let o=null;if(e?o=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):o=await t.request({method:"eth_getBlockByNumber",params:[a||n,s]},{dedupe:!!a}),!o)throw new XV({blockHash:e,blockNumber:r});return(((d=(u=(l=t.chain)==null?void 0:l.formatters)==null?void 0:u.block)==null?void 0:d.format)||eH)(o,"getBlock")}async function KS(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function Xbe(t,e){return tH(t,e)}async function tH(t,e){var s,a;const{block:r,chain:n=t.chain,request:i}=e||{};try{const o=((s=n==null?void 0:n.fees)==null?void 0:s.maxPriorityFeePerGas)??((a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee);if(typeof o=="function"){const l=r||await Tt(t,po,"getBlock")({}),u=await o({block:l,client:t,request:i});if(u===null)throw new Error;return u}if(typeof o<"u")return o;const c=await t.request({method:"eth_maxPriorityFeePerGas"});return ha(c)}catch{const[o,c]=await Promise.all([r?Promise.resolve(r):Tt(t,po,"getBlock")({}),Tt(t,KS,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new HS;const l=c-o.baseFeePerGas;return l<0n?0n:l}}async function Jbe(t,e){return C9(t,e)}async function C9(t,e){var f,h;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},a=await(async()=>{var g,m;return typeof((g=n==null?void 0:n.fees)==null?void 0:g.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(a<1)throw new ZV;const c=10**(((f=a.toString().split(".")[1])==null?void 0:f.length)??0),l=g=>g*BigInt(Math.ceil(a*c))/BigInt(c),u=r||await Tt(t,po,"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 HS;const g=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await tH(t,{block:u,chain:n,request:i}),m=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??m+g,maxPriorityFeePerGas:g}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await Tt(t,KS,"getGasPrice")({}))}}async function QS(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,typeof n=="bigint"?Vt(n):r]},{dedupe:!!n});return _o(i)}function rH(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=>vc(s)):t.blobs,i=[];for(const s of n)i.push(Uint8Array.from(e.blobToKzgCommitment(s)));return r==="bytes"?i:i.map(s=>di(s))}function nH(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(a=>vc(a)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(a=>vc(a)):t.commitments,s=[];for(let a=0;a<n.length;a++){const o=n[a],c=i[a];s.push(Uint8Array.from(e.computeBlobKzgProof(o,c)))}return r==="bytes"?s:s.map(a=>di(a))}function eve(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+l,o,n)}function tve(t,e,r){return t&e^~t&r}function rve(t,e,r){return t&e^t&r^e&r}class nve extends MS{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=Z6(this.buffer)}update(e){Xp(this),e=y3(e),Af(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const c=Z6(e);for(;i<=s-a;a+=i)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Xp(this),TV(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:a}=this;r[a++]=128,Jp(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let d=a;d<i;d++)r[d]=0;eve(n,i-8,BigInt(this.length*8),s),this.process(n,0);const o=Z6(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 d=0;d<l;d++)o.setUint32(4*d,u[d],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:a,pos:o}=this;return e.destroyed=a,e.finished=s,e.length=i,e.pos=o,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}}const Yl=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ive=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
392734187,3204031479,3329325298]),Zl=new Uint32Array(64);class sve extends nve{constructor(e=32){super(64,e,8,!1),this.A=Yl[0]|0,this.B=Yl[1]|0,this.C=Yl[2]|0,this.D=Yl[3]|0,this.E=Yl[4]|0,this.F=Yl[5]|0,this.G=Yl[6]|0,this.H=Yl[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:a,G:o,H:c}=this;return[e,r,n,i,s,a,o,c]}set(e,r,n,i,s,a,o,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)Zl[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const f=Zl[d-15],h=Zl[d-2],g=Lo(f,7)^Lo(f,18)^f>>>3,m=Lo(h,17)^Lo(h,19)^h>>>10;Zl[d]=m+Zl[d-7]+g+Zl[d-16]|0}let{A:n,B:i,C:s,D:a,E:o,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=Lo(o,6)^Lo(o,11)^Lo(o,25),h=u+f+tve(o,c,l)+ive[d]+Zl[d]|0,m=(Lo(n,2)^Lo(n,13)^Lo(n,22))+rve(n,i,s)|0;u=l,l=c,c=o,o=a+h|0,a=s,s=i,i=n,n=h+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,a,o,c,l,u)}roundClean(){Jp(Zl)}destroy(){this.set(0,0,0,0,0,0,0,0),Jp(this.buffer)}}const iH=IV(()=>new sve),ave=iH;function ove(t,e){return ave(xo(t,{strict:!1})?T0(t):t)}function cve(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=ove(e);return i.set([r],0),n==="bytes"?i:di(i)}function lve(t){const{commitments:e,version:r}=t,n=t.to,i=[];for(const s of e)i.push(cve({commitment:s,to:n,version:r}));return i}const EP=6,sH=32,YS=4096,aH=sH*YS,xP=aH*EP-1-1*YS*EP;class uve extends Ye{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class dve extends Ye{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function fve(t){const e=typeof t.data=="string"?vc(t.data):t.data,r=Tn(e);if(!r)throw new dve;if(r>xP)throw new uve({maxSize:xP,size:r});const n=[];let i=!0,s=0;for(;i;){const a=qS(new Uint8Array(aH));let o=0;for(;o<YS;){const c=e.slice(s,s+(sH-1));if(a.pushByte(0),a.pushBytes(c),c.length<31){a.pushByte(128),i=!1;break}o++,s+=31}n.push(a)}return n.map(a=>di(a.bytes))}function hve(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??fve({data:e}),s=t.commitments??rH({blobs:i,kzg:r,to:n}),a=t.proofs??nH({blobs:i,commitments:s,kzg:r,to:n}),o=[];for(let c=0;c<i.length;c++)o.push({blob:i[c],commitment:s[c],proof:a[c]});return o}function pve(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 kbe({transaction:t})}function _3(t,{docsPath:e,...r}){const n=(()=>{const i=x3(t,r);return i instanceof Cy?t:i})();return new $be(n,{docsPath:e,...r})}async function ud(t){const e=await t.request({method:"eth_chainId"},{dedupe:!0});return _o(e)}async function ZS(t,e){var A,I,$,P,j;const{account:r=t.account,accessList:n,authorizationList:i,chain:s=t.chain,blobVersionedHashes:a,blobs:o,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,nonceManager:m,to:y,type:b,value:E,...v}=e,w=await(async()=>{if(!r||!m||typeof g<"u")return g;const L=vn(r),B=s?s.id:await Tt(t,ud,"getChainId")({});return await m.consume({address:L.address,chainId:B,client:t})})();Ll(e);const x=(I=(A=s==null?void 0:s.formatters)==null?void 0:A.transactionRequest)==null?void 0:I.format,S=(x||ld)({...N0(v,{format:x}),account:r?vn(r):void 0,accessList:n,authorizationList:i,blobs:o,blobVersionedHashes:a,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:w,to:y,type:b,value:E},"fillTransaction");try{const L=await t.request({method:"eth_fillTransaction",params:[S]}),k=(((P=($=s==null?void 0:s.formatters)==null?void 0:$.transaction)==null?void 0:P.format)||GS)(L.tx);delete k.blockHash,delete k.blockNumber,delete k.r,delete k.s,delete k.transactionIndex,delete k.v,delete k.yParity,k.data=k.input,k.gas&&(k.gas=e.gas??k.gas),k.gasPrice&&(k.gasPrice=e.gasPrice??k.gasPrice),k.maxFeePerBlobGas&&(k.maxFeePerBlobGas=e.maxFeePerBlobGas??k.maxFeePerBlobGas),k.maxFeePerGas&&(k.maxFeePerGas=e.maxFeePerGas??k.maxFeePerGas),
392k.maxPriorityFeePerGas&&(k.maxPriorityFeePerGas=e.maxPriorityFeePerGas??k.maxPriorityFeePerGas),k.nonce&&(k.nonce=e.nonce??k.nonce);const D=await(async()=>{var V,Y;if(typeof((V=s==null?void 0:s.fees)==null?void 0:V.baseFeeMultiplier)=="function"){const K=await Tt(t,po,"getBlock")({});return s.fees.baseFeeMultiplier({block:K,client:t,request:e})}return((Y=s==null?void 0:s.fees)==null?void 0:Y.baseFeeMultiplier)??1.2})();if(D<1)throw new ZV;const U=10**(((j=D.toString().split(".")[1])==null?void 0:j.length)??0),W=V=>V*BigInt(Math.ceil(D*U))/BigInt(U);return k.maxFeePerGas&&!e.maxFeePerGas&&(k.maxFeePerGas=W(k.maxFeePerGas)),k.gasPrice&&!e.gasPrice&&(k.gasPrice=W(k.gasPrice)),{raw:L.raw,transaction:{from:S.from,...k}}}catch(L){throw _3(L,{...e,chain:t.chain})}}const XS=["blobVersionedHashes","chainId","fees","gas","nonce","type"],_P=new Map,e4=new I0(128);async function Sy(t,e){var w,x,_;let r=e;r.account??(r.account=t.account),r.parameters??(r.parameters=XS);const{account:n,chain:i=t.chain,nonceManager:s,parameters:a}=r,o=(()=>
392{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 Tt(t,ud,"getChainId")({}),c))}const u=n&&vn(n);let d=r.nonce;if(a.includes("nonce")&&typeof d>"u"&&u&&s){const S=await l();d=await s.consume({address:u.address,chainId:S,client:t})}o!=null&&o.fn&&((w=o.runAt)!=null&&w.includes("beforeFillTransaction"))&&(r=await o.fn({...r,chain:i},{phase:"beforeFillTransaction"}),d??(d=r.nonce));const h=((a.includes("blobVersionedHashes")||a.includes("sidecars"))&&r.kzg&&r.blobs||e4.get(t.uid)===!1||!["fees","gas"].some(A=>a.includes(A))?!1:!!(a.includes("chainId")&&typeof r.chainId!="number"||a.includes("nonce")&&typeof d!="number"||a.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||a.includes("gas")&&typeof r.gas!="bigint"))?await Tt(t,ZS,"fillTransaction")({...r,nonce:d}).then(S=>{const{chainId:A,from:I,gas:$,gasPrice:P,nonce:j,maxFeePerBlobGas:L,maxFeePerGas:B,maxPriorityFeePerGas:k,type:D,...q}=S.transaction;return e4.set(t.uid,!0),{...r,...I?{from:I}:{},...D&&!r.type?{type:D}:{},...typeof A<"u"?{chainId:A}:{},...typeof $<"u"?{gas:$}:{},...typeof P<"u"?{gasPrice:P}:{},...typeof j<"u"?{nonce:j}:{},...typeof L<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerBlobGas:L}:{},...typeof B<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerGas:B}:{},...typeof k<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxPriorityFeePerGas:k}:{},..."nonceKey"in q&&typeof q.nonceKey<"u"?{nonceKey:q.nonceKey}:{}}}).catch(S=>{var $;const A=S;return A.name!=="TransactionExecutionError"||(($=A.walk)==null?void 0:$.call(A,P=>{var L;const j=P;return j.name==="MethodNotFoundRpcError"||j.name==="MethodNotSupportedRpcError"||((L=j.message)==null?void 0:L.includes("eth_fillTransaction is not available"))}))&&e4.set(t.uid,!1),r}):r;d??(d=h.nonce),r={...h,...u?{from:u==null?void 0:u.address}:{},...d?{nonce:d}:{}};const{blobs:g,gas:m,kzg:y,type:b}=r;o!=null&&o.fn&&((x=o.runAt)!=null&&x.includes("beforeFillParameters"))&&(r=await o.fn({...r,chain:i},{phase:"beforeFillParameters"}));let E;async function v(){return E||(E=await Tt(t,po,"getBlock")({blockTag:"latest"}),E)}if(a.includes("nonce")&&typeof d>"u"&&u&&!s&&(r.nonce=await Tt(t,QS,"getTransactionCount")({address:u.address,blockTag:"pending"})),(a.includes("blobVersionedHashes")||a.includes("sidecars"))&&g&&y){const S=rH({blobs:g,kzg:y});if(a.includes("blobVersionedHashes")){const A=lve({commitments:S,to:"hex"});r.blobVersionedHashes=A}if(a.includes("sidecars")){const A=nH({blobs:g,commitments:S,kzg:y}),I=hve({blobs:g,commitments:S,proofs:A,to:"hex"});r.sidecars=I}}if(a.includes("chainId")&&(r.chainId=await l()),(a.includes("fees")||a.includes("type"))&&typeof b>"u")try{r.type=pve(r)}catch{let S=_P.get(t.uid);if(typeof S>"u"){const A=await v();S=typeof(A==null?void 0:A.baseFeePerGas)=="bigint",_P.set(t.uid,S)}r.type=S?"eip1559":"legacy"}if(a.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){const S=await v(),{maxFeePerGas:A,maxPriorityFeePerGas:I}=await C9(t,{block:S,chain:i,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<I)throw new Ybe({maxPriorityFeePerGas:I});r.maxPriorityFeePerGas=I,r.maxFeePerGas=A}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new HS;if(typeof r.gasPrice>"u"){const S=await v(),{gasPrice:A}=await C9(t,{block:S,chain:i,request:r,type:"legacy"});r.gasPrice=A}}return a.includes("gas")&&typeof m>"u"&&(r.gas=await Tt(t,JS,"estimateGas")({...r,account:u,prepare:(u==null?void 0:u.type)==="local"?[]:["blobVersionedHashes"]})),o!=null&&o.fn&&((_=o.runAt)!=null&&_.includes("afterFillParameters"))&&(r=await o.fn({...r,chain:i},{phase:"afterFillParameters"})),Ll(r),delete r.parameters,r}async function JS(t,e){var a,o,c;const{account:r=t.account,prepare:n=!0}=e,i=r?vn(r):void 0,s=(()=>
392{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 E3({authorization:e.authorizationList[0]}).catch(()=>{throw new Ye("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:h,blockNumber:g,blockTag:m,data:y,gas:b,gasPrice:E,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:_,value:S,stateOverride:A,...I}=n?await Sy(t,{...e,parameters:s,to:l}):e;if(b&&e.gas!==b)return b;const P=(typeof g=="bigint"?Vt(g):void 0)||m,j=VS(A);Ll(e);const L=(c=(o=(a=t.chain)==null?void 0:a.formatters)==null?void 0:o.transactionRequest)==null?void 0:c.format,k=(L||ld)({...N0(I,{format:L}),account:i,accessList:u,authorizationList:d,blobs:f,blobVersionedHashes:h,data:y,gasPrice:E,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:_,to:l,value:S},"estimateGas");return BigInt(await t.request({method:"eth_estimateGas",params:j?[k,P??t.experimental_blockTag??"latest",j]:P?[k,P]:[k]}))}catch(l){throw Vbe(l,{...e,account:i,chain:t.chain})}}async function gve(t,e){var l;const{abi:r,address:n,args:i,functionName:s,dataSuffix:a=typeof t.dataSuffix=="string"?t.dataSuffix:(l=t.dataSuffix)==null?void 0:l.value,...o}=e,c=ws({abi:r,args:i,functionName:s});try{return await Tt(t,JS,"estimateGas")({data:`${c}${a?a.replace("0x",""):""}`,to:n,...o})}catch(u){const d=o.account?vn(o.account):void 0;throw kf(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:d==null?void 0:d.address})}}function i0(t,e){if(!La(t,{strict:!1}))throw new Qu({address:t});if(!La(e,{strict:!1}))throw new Qu({address:e});return t.toLowerCase()===e.toLowerCase()}function wc(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 CP="/docs/contract/decodeEventLog";function jv(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[a,...o]=i;if(!a)throw new s2e({docsPath:CP});const c=e.find(b=>b.type==="event"&&a===b3(Eo(b)));if(!(c&&"name"in c)||c.type!=="event")throw new a2e(a,{docsPath:CP});const{name:l,inputs:u}=c,d=u==null?void 0:u.some(b=>!("name"in b&&b.name)),f=d?[]:{},h=u.map((b,E)=>[b,E]).filter(([b])=>"indexed"in b&&b.indexed),g=[];for(let b=0;b<h.length;b++){const[E,v]=h[b],w=o[b];if(!w){if(s)throw new RS({abiItem:c,param:E});g.push([E,v]);continue}f[d?v:E.name||v]=mve({param:E,value:w})}const m=u.filter(b=>!("indexed"in b&&b.indexed)),y=s?m:[...g.map(([b])=>b),...m];if(y.length>0){if(r&&r!=="0x")try{const b=$0(y,r);if(b){let E=0;if(!s)for(const[v,w]of g)f[d?w:v.name||w]=b[E++];if(d)for(let v=0;v<u.length;v++)f[v]===void 0&&E<b.length&&(f[v]=b[E++]);else for(let v=0;v<m.length;v++)f[m[v].name]=b[E++]}}catch(b){if(s)throw b instanceof wV||b instanceof BV?new Rv({abiItem:c,data:r,params:y,size:Tn(r)}):b}else if(s)throw new Rv({abiItem:c,data:"0x",params:y,size:0})}return{eventName:l,args:Object.values(f).length>0?f:void 0}}function mve({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:($0([t],e)||[])[0]}function eA(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,s=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})(),a=e.filter(o=>o.type==="event").map(o=>({abi:o,selector:b3(o)}));return n.map(o=>{var f;const c=typeof o.blockNumber=="string"?wc(o):o,l=a.filter(h=>c.topics[0]===h.selector);if(l.length===0)return null;let u,d;for(const h of l)try{u=jv({...c,abi:[h.abi],strict:!0}),d=h;break}catch{}if(!u&&!i){d=l[0];try{u=jv({data:c.data,topics:c.topics,abi:[d.abi],strict:!1})}catch{const h=(f=d.abi.inputs)==null?void 0:f.some(g=>!("name"in g&&g.name));return{...c,args:h?[]:{},eventName:d.abi.name}}}return!u||!d||s&&!s.includes(u.eventName)||!yve({args:u.args,inputs:d.abi.inputs,matchArgs:r})?null:{...u,...c}}
392).filter(Boolean)}function yve(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(s,a,o){try{return s.type==="address"?i0(a,o):s.type==="string"||s.type==="bytes"?Li(T0(a))===o:a===o}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((s,a)=>{if(s==null)return!0;const o=r[a];return o?(Array.isArray(s)?s:[s]).some(l=>i(o,l,e[a])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,a])=>{if(a==null)return!0;const o=r.find(l=>l.name===s);return o?(Array.isArray(a)?a:[a]).some(l=>i(o,l,e[s])):!1}):!1}async function tA(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:a,args:o,strict:c}={}){const l=c??!1,u=a??(s?[s]:void 0);let d=[];u&&(d=[u.flatMap(m=>Ey({abi:[m],eventName:m.name,args:a?void 0:o}))],s&&(d=d[0]));let f;r?f=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,blockHash:r}]}):f=await t.request({method:"eth_getLogs",params:[{address:e,topics:d,fromBlock:typeof n=="bigint"?Vt(n):n,toBlock:typeof i=="bigint"?Vt(i):i}]});const h=f.map(g=>wc(g));return u?eA({abi:u,args:o,logs:h,strict:l}):h}async function oH(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:a,fromBlock:o,toBlock:c,strict:l}=e,u=a?eh({abi:r,name:a}):void 0,d=u?void 0:r.filter(f=>f.type==="event");return Tt(t,tA,"getLogs")({address:n,args:i,blockHash:s,event:u,events:d,fromBlock:o,toBlock:c,strict:l})}const t4="/docs/contract/decodeFunctionResult";function dd(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const o=eh({abi:e,args:r,name:n});if(!o)throw new Yp(n,{docsPath:t4});s=o}if(s.type!=="function")throw new Yp(void 0,{docsPath:t4});if(!s.outputs)throw new xV(s.name,{docsPath:t4});const a=$0(s.outputs,i);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rA=BigInt(0),S9=BigInt(1);function Ay(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function nA(t){if(!Ay(t))throw new Error("Uint8Array expected")}function Om(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}function P2(t){const e=t.toString(16);return e.length&1?"0"+e:e}function cH(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?rA:BigInt("0x"+t)}const lH=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",bve=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Rm(t){if(nA(t),lH)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=bve[t[r]];return e}const Ic={_0:48,_9:57,A:65,F:70,a:97,f:102};function SP(t){if(t>=Ic._0&&t<=Ic._9)return t-Ic._0;if(t>=Ic.A&&t<=Ic.F)return t-(Ic.A-10);if(t>=Ic.a&&t<=Ic.f)return t-(Ic.a-10)}function Lv(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(lH)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 a=SP(t.charCodeAt(s)),o=SP(t.charCodeAt(s+1));if(a===void 0||o===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]=a*16+o}return n}function gf(t){return cH(Rm(t))}function uH(t){return nA(t),cH(Rm(Uint8Array.from(t).reverse()))}function Ty(t,e){return Lv(t.toString(16).padStart(e*2,"0"))}function dH(t,e){return Ty(t,e).reverse()}function Aa(t,e,r){let n;if(typeof e=="string")try{n=Lv(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(Ay(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 Fv(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];nA(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 r4=t=>typeof t=="bigint"&&rA<=t;function iA(t,e,r){return r4(t)&&r4(e)&&r4(r)&&e<=t&&t<r}function yp(t,e,r,n){if(!iA(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function vve(t){let e;for(e=0;t>rA;t>>=S9,e+=1);return e}const C3=t=>(S9<<BigInt(t))-S9,n4=t=>new Uint8Array(t),AP=t=>Uint8Array.from(t);function wve(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=n4(t),i=n4(t),s=0;const a=()=>{n.fill(1),i.fill(0),s=0},o=(...d)=>r(i,n,...d),c=(d=n4(0))=>{i=o(AP([0]),d),n=o(),d.length!==0&&(i=o(AP([1]),d),n=o())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d<e;){n=o();const h=n.slice();f.push(h),d+=n.length}return Fv(...f)};return(d,f)=>{a(),c(d);let h;for(;!(h=f(l()));)c();return a(),h}}const Eve={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"||Ay(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 S3(t,e,r={}){const n=(i,s,a)=>{const o=Eve[s];if(typeof o!="function")throw new Error("invalid validator function");const c=t[i];if(!(a&&c===void 0)&&!o(c,t))throw new Error("param "+String(i)+" is invali
392d. 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 TP(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 xve="0.1.1";function _ve(){return xve}let wr=class Vc extends Error{static setStaticOptions(e){Vc.prototype.docsOrigin=e.docsOrigin,Vc.prototype.showVersion=e.showVersion,Vc.prototype.version=e.version}constructor(e,r={}){const n=(()=>{var u;if(r.cause instanceof Vc){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 Vc&&r.cause.docsPath||r.docsPath,s=r.docsOrigin??Vc.prototype.docsOrigin,a=`${s}${i??""}`,o=!!(r.version??Vc.prototype.showVersion),c=r.version??Vc.prototype.version,l=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i||o?["",n?`Details: ${n}`:void 0,i?`See: ${a}`:void 0,o?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(` 393`);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=a,this.docsOrigin=s,this.docsPath=i,this.shortMessage=e,this.showVersion=o,this.version=c}walk(e){return fH(this,e)}};Object.defineProperty(wr,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${_ve()}`}});wr.setStaticOptions(wr.defaultStaticOptions);function fH(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?fH(t.cause,e):e?null:t}function Iy(t,e){if(Xh(t)>e)throw new Uve({givenSize:Xh(t),maxSize:e})}const kc={zero:48,nine:57,A:65,F:70,a:97,f:102};function IP(t){if(t>=kc.zero&&t<=kc.nine)return t-kc.zero;if(t>=kc.A&&t<=kc.F)return t-(kc.A-10);if(t>=kc.a&&t<=kc.f)return t-(kc.a-10)}function Cve(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;if(t.length>n)throw new Bve({size:t.length,targetSize:n,type:"Bytes"});const i=new Uint8Array(n);for(let s=0;s<n;s++){const a=r==="right";i[a?s:n-s-1]=t[a?s:t.length-s-1]}return i}function hH(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 A3(t,e){if(pa(t)>e)throw new Gve({givenSize:pa(t),maxSize:e})}function Sve(t,e){if(typeof e=="number"&&e>0&&e>pa(t)-1)throw new xH({offset:e,position:"start",size:pa(t)})}function Ave(t,e,r){if(typeof e=="number"&&typeof r=="number"&&pa(t)!==r-e)throw new xH({offset:r,position:"end",size:pa(t)})}function pH(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 Kve({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}const Tve="#__bigint";function gH(t,e,r){return JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString()+Tve:i,r)}const Ive=new TextDecoder,kve=new TextEncoder;function $ve(t){return t instanceof Uint8Array?t:typeof t=="string"?mH(t):Nve(t)}function Nve(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function mH(t,e={}){const{size:r}=e;let n=t;r&&(A3(t,r),n=Nf(t,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,a=new Uint8Array(s);for(let o=0,c=0;o<s;o++){const l=IP(i.charCodeAt(c++)),u=IP(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new wr(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);a[o]=l<<4|u}return a}function Pve(t,e={}){const{size:r}=e,n=kve.encode(t);return typeof r=="number"?(Iy(n,r),Ove(n,r)):n}function Ove(t,e){return Cve(t,{dir:"right",size:e})}function Xh(t){return t.length}function Rve(t,e,r,n={}){const{strict:i}=n;return t.slice(e,r)}function Dve(t,e={}){const{size:r}=e;typeof r<"u"&&Iy(t,r);const n=So(t,e);return vH(n,e)}function Mve(t,e={}){const{size:r}=e;let n=t;if(typeof r<"u"&&(Iy(n,r),n=yH(n)),n.length>1||n[0]>1)throw new Fve(n);return!!n[0]}function hl(t,e={}){const{size:r}=e;typeof r<"u"&&Iy(t,r);const n=So(t,e);return wH(n,e)}function jve(t,e={}){const{size:r}=e;let n=t;return typeof r<"u"&&(Iy(n,r),n=Lve(n)),Ive.decode(n)}function yH(t){return hH(t,{dir:"left"})}function Lve(t){return hH(t,{dir:"right"})}class Fve extends wr{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 Uve=class extends wr{constructor({givenSize:e,maxSize:r}
393){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${e}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},Bve=class extends wr{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 qve=new TextEncoder,Wve=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function zve(t,e={}){const{strict:r=!1}=e;if(!t)throw new kP(t);if(typeof t!="string")throw new kP(t);if(r&&!/^0x[0-9a-fA-F]*$/.test(t))throw new $P(t);if(!t.startsWith("0x"))throw new $P(t)}function Co(...t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Vve(t){return t instanceof Uint8Array?So(t):Array.isArray(t)?So(new Uint8Array(t)):t}function bH(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(A3(r,e.size),$f(r,e.size)):r}function So(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=Wve[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(A3(n,e.size),Nf(n,e.size)):n}function ls(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 a=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<a){const l=typeof t=="bigint"?"n":"";throw new EH({max:s?`${s}${l}`:void 0,min:`${a}${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?$f(c,n):c}function sA(t,e={}){return So(qve.encode(t),e)}function $f(t,e){return pH(t,{dir:"left",size:e})}function Nf(t,e){return pH(t,{dir:"right",size:e})}function oc(t,e,r,n={}){const{strict:i}=n;Sve(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return i&&Ave(s,e,r),s}function pa(t){return Math.ceil((t.length-2)/2)}function vH(t,e={}){const{signed:r}=e;e.size&&A3(t,e.size);const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<<BigInt(i)*8n)-1n,a=s>>1n;return n<=a?n:n-s-1n}function wH(t,e={}){const{signed:r,size:n}=e;return Number(!r&&!n?t:vH(t,e))}function Hve(t,e={}){const{strict:r=!1}=e;try{return zve(t,{strict:r}),!0}catch{return!1}}let EH=class extends wr{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"})}},kP=class extends wr{constructor(e){super(`Value \`${typeof e=="object"?gH(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"})}},$P=class extends wr{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"})}},Gve=class extends wr{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"})}},xH=class extends wr{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"})}},Kve=class extends wr{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 Qve(t){return{address:t.address,amount:ls(t.amount),index:ls(t.index),validatorIndex:ls(t.validatorIndex)}}function _H(t){return{...typeof t.baseFeePerGas=="bigint"&&{baseFeePerGas:ls(t.baseFeePerGas)},...typeof t.blobBaseFee=="bigint"&&{blobBaseFee:ls(t.blobBaseFee)},...typeof t.feeRecipient=="string"&&{feeRecipient:t.feeRecipient}
vendor: 5,878 bytes, line 393
393,...typeof t.gasLimit=="bigint"&&{gasLimit:ls(t.gasLimit)},...typeof t.number=="bigint"&&{number:ls(t.number)},...typeof t.prevRandao=="bigint"&&{prevRandao:ls(t.prevRandao)},...typeof t.time=="bigint"&&{time:ls(t.time)},...t.withdrawals&&{withdrawals:t.withdrawals.map(Qve)}}}const s0=[{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"}],A9=[{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"}]}],CH=[{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"}],SH=[...CH,{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"}]}],Yve=[...CH,{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"}]}],NP=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],PP=[{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"}]}],AH=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],OP=[{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"}],Lrt=[{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"}]}],Zve="0x82ad56cb",TH="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
393602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",Xve="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",Jve="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
393603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",aA="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
393150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class T9 extends Ye{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 ewe extends Ye{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 twe extends Ye{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(` 394`),{name:"ChainNotFoundError"})}}class IH extends Ye{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const i4="/docs/contract/encodeDeployData";function T3(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(a=>"type"in a&&a.type==="constructor");if(!i)throw new e2e({docsPath:i4});if(!("inputs"in i))throw new nP({docsPath:i4});if(!i.inputs||i.inputs.length===0)throw new nP({docsPath:i4});const s=Jf(i.inputs,r);return k0([n,s])}function P0({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 T9({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new T9({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function kH(t,{docsPath:e,...r}){const n=(()=>{const i=x3(t,r);return i instanceof Cy?t:i})();return new GV(n,{docsPath:e,...r})}function oA(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const s4=new Map;function $H({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=c();a();const d=u.map(({args:f})=>f);d.length!==0&&t(d).then(f=>{i&&Array.isArray(f)&&f.sort(i);for(let h=0;h<u.length;h++){const{resolve:g}=u[h];g==null||g([f[h],f])}}).catch(f=>{for(let h=0;h<u.length;h++){const{reject:g}=u[h];g==null||g(f)}})},a=()=>s4.delete(e),o=()=>c().map(({args:u})=>u),c=()=>s4.get(e)||[],l=u=>s4.set(e,[...c(),u]);return{flush:a,async schedule(u){const{promise:d,resolve:f,reject:h}=oA();return(r==null?void 0:r([...o(),u]))&&s(),c().length>0?(l({args:u,resolve:f,reject:h}),d):(l({args:u,resolve:f,reject:h}),setTimeout(s,n),d)}}}async function ky(t,e){var L,B,k,D;const{account:r=t.account,authorizationList:n,batch:i=!!((L=t.batch)!=null&&L.multicall),blockNumber:s,blockTag:a=t.experimental_blockTag??"latest",accessList:o,blobs:c,blockOverrides:l,code:u,data:d,factory:f,factoryData:h,gas:g,gasPrice:m,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:E,nonce:v,to:w,value:x,stateOverride:_,...S}=e,A=r?vn(r):void 0;if(u&&(f||h))throw new Ye("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(u&&w)throw new Ye("Cannot provide both `code` & `to` as parameters.");const I=u&&d,$=f&&h&&w&&d,P=I||$,j=I?NH({code:u,data:d}):$?iwe({data:d,factory:f,factoryData:h,to:w}):d;try{Ll(e);const U=(typeof s=="bigint"?Vt(s):void 0)||a,W=l?_H(l):void 0,V=VS(_),Y=(D=(k=(B=t.chain)==null?void 0:B.formatters)==null?void 0:k.transactionRequest)==null?void 0:D.format,ge=(Y||ld)({...N0(S,{format:Y}),accessList:o,account:A,authorizationList:n,blobs:c,data:j,gas:g,gasPrice:m,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:E,nonce:v,to:P?void 0:w,value:x},"call");if(i&&rwe({request:ge})&&!V&&!W)try{return await nwe(t,{...ge,blockNumber:s,blockTag:a})}catch(Q){if(!(Q instanceof IH)&&!(Q instanceof T9))throw Q}const ae=(()=>{const Q=[ge,U];return V&&W?[...Q,V,W]:V?[...Q,V]:W?[...Q,{},W]:Q})(),ce=await t.request({method:"eth_call",params:ae});return ce==="0x"?{data:void 0}:{data:ce}}catch(q){const U=swe(q),{offchainLookup:W,offchainLookupSignature:V}=await sc(async()=>{const{offchainLookup:Y,offchainLookupSignature:K}
394=await import("./ccip-MDYI2LLu.js");return{offchainLookup:Y,offchainLookupSignature:K}},__vite__mapDeps([0,1,2,3]));if(t.ccipRead!==!1&&(U==null?void 0:U.slice(0,10))===V&&w)return{data:await W(t,{data:U,to:w})};throw P&&(U==null?void 0:U.slice(0,10))==="0x101bb98d"?new Rbe({factory:f}):kH(q,{...e,account:A,chain:t.chain})}}function rwe({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(Zve)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function nwe(t,e){var m;const{batchSize:r=1024,deployless:n=!1,wait:i=0}=typeof((m=t.batch)==null?void 0:m.multicall)=="object"?t.batch.multicall:{},{blockNumber:s,blockTag:a=t.experimental_blockTag??"latest",data:o,to:c}=e,l=(()=>{if(n)return null;if(e.multicallAddress)return e.multicallAddress;if(t.chain)return P0({blockNumber:s,chain:t.chain,contract:"multicall3"});throw new IH})(),d=(typeof s=="bigint"?Vt(s):void 0)||a,{schedule:f}=$H({id:`${t.uid}.${d}`,wait:i,shouldSplitBatch(y){return y.reduce((E,{data:v})=>E+(v.length-2),0)>r*2},fn:async y=>{const b=y.map(w=>({allowFailure:!0,callData:w.data,target:w.to})),E=ws({abi:s0,args:[b],functionName:"aggregate3"}),v=await t.request({method:"eth_call",params:[{...l===null?{data:NH({code:aA,data:E})}:{to:l,data:E}},d]});return dd({abi:s0,args:[b],functionName:"aggregate3",data:v||"0x"})}}),[{returnData:h,success:g}]=await f({data:o,to:c});if(!g)throw new w3({data:h});return h==="0x"?{data:void 0}:{data:h}}function NH(t){const{code:e,data:r}=t;return T3({abi:yV(["constructor(bytes, bytes)"]),bytecode:TH,args:[e,r]})}function iwe(t){const{data:e,factory:r,factoryData:n,to:i}=t;return T3({abi:yV(["constructor(address, bytes, address, bytes)"]),bytecode:Xve,args:[i,e,r,n]})}function swe(t){var r;if(!(t instanceof Ye))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 Ao(t,e){const{abi:r,address:n,args:i,functionName:s,...a}=e,o=ws({abi:r,args:i,functionName:s});try{const{data:c}=await Tt(t,ky,"call")({...a,data:o,to:n});return dd({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw kf(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function awe(t,e){var u;const{abi:r,address:n,args:i,functionName:s,dataSuffix:a=typeof t.dataSuffix=="string"?t.dataSuffix:(u=t.dataSuffix)==null?void 0:u.value,...o}=e,c=o.account?vn(o.account):t.account,l=ws({abi:r,args:i,functionName:s});try{const{data:d}=await Tt(t,ky,"call")({batch:!1,data:`${l}${a?a.replace("0x",""):""}`,to:n,...o,account:c}),f=dd({abi:r,args:i,functionName:s,data:d||"0x"}),h=r.filter(g=>"name"in g&&g.name===e.functionName);return{result:f,request:{abi:h,address:n,args:i,dataSuffix:a,functionName:s,...o,account:c}}}catch(d){throw kf(d,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:c==null?void 0:c.address})}}const a4=new Map,RP=new Map;let owe=0;function Cl(t,e,r){const n=++owe,i=()=>a4.get(t)||[],s=()=>{const u=i();a4.set(t,u.filter(d=>d.id!==n))},a=()=>{const u=i();if(!u.some(f=>f.id===n))return;const d=RP.get(t);if(u.length===1&&d){const f=d();f instanceof Promise&&f.catch(()=>{})}s()},o=i();if(a4.set(t,[...o,{id:n,fns:e}]),o&&o.length>0)return a;const c={};for(const u in e)c[u]=((...d)=>{var h,g;const f=i();if(f.length!==0)for(const m of f)(g=(h=m.fns)[u])==null||g.call(h,...d)});const l=r(c);return typeof l=="function"&&RP.set(t,l),a}async function I9(t){return new Promise(e=>setTimeout(e,t))}function O0(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let o;e&&(o=await t({unpoll:s}));const c=await(r==null?void 0:r(o))??n;await I9(c);const l=async()=>{i&&(await t({unpoll:s}),await I9(n),l())};l()})(),s}const cwe=new Map,lwe=new Map;function uwe(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:a=>s.set(i,a)}),r=e(t,cwe),n=e(t,lwe);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function dwe(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=uwe(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 a=await s;return n.response.set({created:new Date,data:a}),a}finally{n.promise.clear()}}const fwe=t=>`blockNumber.${t}`;async function $y(t,{cacheTime:e=t.cacheTime}={}){const r=await dwe(()=>t.request({method:"eth_blockNumber"}),{cacheKey:fwe(t.uid),cacheTime:e});return BigInt(r)}async function I3(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=>wc(s));return!("abi"in e)||!e.abi?i:eA({abi:e.abi,logs:i,strict:r})}async function k3(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function hwe(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:a,fromBlock:o,onError:c,onLogs:l,poll:u,pollingInterval:d=t.pollingInterval,strict:f}=e;return(typeof u<"u"?u:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
394onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")))?(()=>{const y=f??!1,b=li(["watchContractEvent",n,i,s,t.uid,a,d,y,o]);return Cl(b,{onLogs:l,onError:c},E=>{let v;o!==void 0&&(v=o-1n);let w,x=!1;const _=O0(async()=>{var S;if(!x){try{w=await Tt(t,FV,"createContractEventFilter")({abi:r,address:n,args:i,eventName:a,strict:y,fromBlock:o})}catch{}x=!0;return}try{let A;if(w)A=await Tt(t,I3,"getFilterChanges")({filter:w});else{const I=await Tt(t,$y,"getBlockNumber")({});v&&v<I?A=await Tt(t,oH,"getContractEvents")({abi:r,address:n,args:i,eventName:a,fromBlock:v+1n,toBlock:I,strict:y}):A=[],v=I}if(A.length===0)return;if(s)E.onLogs(A);else for(const I of A)E.onLogs([I])}catch(A){w&&A instanceof Yu&&(x=!1),(S=E.onError)==null||S.call(E,A)}},{emitOnBegin:!0,interval:d});return async()=>{w&&await Tt(t,k3,"uninstallFilter")({filter:w}),_()}})})():(()=>{const y=f??!1,b=li(["watchContractEvent",n,i,s,t.uid,a,d,y]);let E=!0,v=()=>E=!1;return Cl(b,{onLogs:l,onError:c},w=>((async()=>{try{const x=(()=>{if(t.transport.type==="fallback"){const A=t.transport.transports.find(I=>I.config.type==="webSocket"||I.config.type==="ipc");return A?A.value:t.transport}return t.transport})(),_=a?Ey({abi:r,eventName:a,args:i}):[],{unsubscribe:S}=await x.subscribe({params:["logs",{address:n,topics:_}],onData(A){var $;if(!E)return;const I=A.result;try{const{eventName:P,args:j}=jv({abi:r,data:I.data,topics:I.topics,strict:f}),L=wc(I,{args:j,eventName:P});w.onLogs([L])}catch(P){let j,L;if(P instanceof Rv||P instanceof RS){if(f)return;j=P.abiItem.name,L=($=P.abiItem.inputs)==null?void 0:$.some(k=>!("name"in k&&k.name))}const B=wc(I,{args:L?[]:{},eventName:j});w.onLogs([B])}},onError(A){var I;(I=w.onError)==null||I.call(w,A)}});v=S,E||v()}catch(x){c==null||c(x)}})(),()=>v()))})()}class fd extends Ye{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(` 395`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class mf extends Ye{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function cA({chain:t,currentChainId:e}){if(!t)throw new twe;if(e!==t.id)throw new ewe({chain:t,currentChainId:e})}async function lA(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const o4=new I0(128);async function $3(t,e){var w,x,_,S,A;const{account:r=t.account,assertChainId:n=!0,chain:i=t.chain,accessList:s,authorizationList:a,blobs:o,data:c,dataSuffix:l=typeof t.dataSuffix=="string"?t.dataSuffix:(w=t.dataSuffix)==null?void 0:w.value,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:m,type:y,value:b,...E}=e;if(typeof r>"u")throw new fd({docsPath:"/docs/actions/wallet/sendTransaction"});const v=r?vn(r):null;try{Ll(e);const I=await(async()=>{if(e.to)return e.to;if(e.to!==null&&a&&a.length>0)return await E3({authorization:a[0]}).catch(()=>{throw new Ye("`to` is required. Could not infer from `authorizationList`.")})})();if((v==null?void 0:v.type)==="json-rpc"||v===null){let $;i!==null&&($=await Tt(t,ud,"getChainId")({}),n&&cA({currentChainId:$,chain:i}));const P=(S=(_=(x=t.chain)==null?void 0:x.formatters)==null?void 0:_.transactionRequest)==null?void 0:S.format,L=(P||ld)({...N0(E,{format:P}),accessList:s,account:v,authorizationList:a,blobs:o,chainId:$,data:l?is([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:m,to:I,type:y,value:b},"sendTransaction"),B=o4.get(t.uid),k=B?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:k,params:[L]},{retryCount:0})}catch(D){if(B===!1)throw D;const q=D;if(q.name==="InvalidInputRpcError"||q.name==="InvalidParamsRpcError"||q.name==="MethodNotFoundRpcError"||q.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[L]},{retryCount:0}).then(U=>(o4.set(t.uid,!0),U)).catch(U=>{const W=U;throw W.name==="MethodNotFoundRpcError"||W.name==="MethodNotSupportedRpcError"?(o4.set(t.uid,!1),q):W});throw q}}if((v==null?void 0:v.type)==="local"){const $=await Tt(t,Sy,"prepareTransactionRequest")({account:v,accessList:s,authorizationList:a,blobs:o,chain:i,data:l?is([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:m,nonceManager:v.nonceManager,parameters:[...XS,"sidecars"],type:y,value:b,...E,to:I}),P=(A=i==null?void 0:i.serializers)==null?void 0:A.transaction,j=await v.signTransaction($,{serializer:P});return await Tt(t,lA,"sendRawTransaction")({serializedTransaction:j})}throw(v==null?void 0:v.type)==="smart"?new mf({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new mf({docsPath:"/docs/actions/wallet/sendTransaction",type:v==null?void 0:v.type})}catch(I){throw I instanceof mf?I:_3(I,{...e,account:v,chain:e.chain||void 0})}}async function Dm(t,e){return Dm.internal(t,$3,"sendTransaction",e)}(function(t){async function e(r,n,i,s){const{abi:a,account:o=r.account,address:c,args:l,functionName:u,...d}=s;if(typeof o>"u")throw new fd({docsPath:"/docs/contract/writeContract"});const f=o?vn(o):null,h=ws({abi:a,args:l,functionName:u});try{return await Tt(r,n,i)({data:h,to:c,account:f,...d})}catch(g){throw kf(g,{abi:a,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:u,sender:f==null?void 0:f.address})}}t.internal=e})(Dm||(Dm={}));class pwe extends Ye{constructor(e){super(`Call bundle failed with status: ${e.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=e}}function Uv(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const a=async({count:o=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:o,error:l}):e;u&&await I9(u),a({count:o+1})};try{const l=await t();i(l)}catch(l){if(o<r&&await n({count:o,error:l}))return c({error:l});s(l)}};a()})}const PH={"0x0":"reverted","0x1":"success"};function OH(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=>wc(n)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?_o(t.transactionIndex):null,status:t.status?PH[t.status]:null,type:t.type?JV[t.type]||t.type:null};return t.blobGasPrice&&(r.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(r.blobGasUsed=BigInt(t.blobGasUsed)),r}const RH="0x5792579257925792579257925792579257925792579257925792579257925792",DH=Vt(0,{size:32});async function MH(t,e){var f;const{account:r=t.account,chain:n=t.chain,experimental_fallback:i,experimental_fallbackDelay:s=32,forceAtomic:a=!1,id:o,version:c="2.0.0"}=e,l=r?vn(r):null;let u=e.capabilities;t.dataSuffix&&!((f=e.capabilities)!=null&&f.dataSuffix)&&(typeof t.dataSuffix=="string"?u={...e.capabilities,dataSuffix:{value:t.dataSuffix,optional:!0}}:u={...e.capabilities,dataSuffix:{value:t.dataSuffix.value,...t.dataSuffix.required?{}:{optional:!0}}});const d=e.calls.map(h=>{const g=h,m=g.abi?ws({abi:g.abi,functionName:g.functionName,args:g.args}):g.data;return{data:g.dataSuffix&&m?is([m,g.dataSuffix]):m,to:g.to,value:g.value?Vt(g.value):void 0}});try{const h=await t.request({method:"wallet_sendCalls",params:[{atomicRequired:a,calls:d,capabilities:u,chainId:Vt(n.id),from:l==null?void 0:l.address,id:o,version:c}]},{retryCount:0});return typeof h=="string"?{id:h}:h}catch(h){const g=h;if(i&&(g.name==="MethodNotFoundRpcError"||g.name==="MethodNotSupportedRpcError"||g.name==="UnknownRpcError"||g.details.toLowerCase().includes("does not exist / is not available")||g.details.toLowerCase().includes("missing or invalid. request()")||g.details.toLowerCase().includes("did n
395ot match any variant of untagged enum")||g.details.toLowerCase().includes("account upgraded to unsupported contract")||g.details.toLowerCase().includes("eip-7702 not supported")||g.details.toLowerCase().includes("unsupported wc_ method")||g.details.toLowerCase().includes("feature toggled misconfigured")||g.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(u&&Object.values(u).some(v=>!v.optional)){const v="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new r0(new Ye(v,{details:v}))}if(a&&d.length>1){const E="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new n0(new Ye(E,{details:E}))}const m=[];for(const E of d){const v=$3(t,{account:l,chain:n,data:E.data,to:E.to,value:E.value?ha(E.value):void 0});m.push(v),s>0&&await new Promise(w=>setTimeout(w,s))}const y=await Promise.allSettled(m);if(y.every(E=>E.status==="rejected"))throw y[0].reason;const b=y.map(E=>E.status==="fulfilled"?E.value:DH);return{id:is([...b,Vt(n.id,{size:32}),RH])}}throw _3(h,{...e,account:l,chain:e.chain})}}async function jH(t,e){async function r(u){if(u.endsWith(RH.slice(2))){const f=Mu(d9(u,-64,-32)),h=d9(u,0,-64).slice(2).match(/.{1,64}/g),g=await Promise.all(h.map(y=>DH.slice(2)!==y?t.request({method:"eth_getTransactionReceipt",params:[`0x${y}`]},{dedupe:!0}):void 0)),m=g.some(y=>y===null)?100:g.every(y=>(y==null?void 0:y.status)==="0x1")?200:g.every(y=>(y==null?void 0:y.status)==="0x0")?500:600;return{atomic:!1,chainId:_o(f),receipts:g.filter(Boolean),status:m,version:"2.0.0"}}return t.request({method:"wallet_getCallsStatus",params:[u]})}const{atomic:n=!1,chainId:i,receipts:s,version:a="2.0.0",...o}=await r(e.id),[c,l]=(()=>{const u=o.status;return u>=100&&u<200?["pending",u]:u>=200&&u<300?["success",u]:u>=300&&u<700?["failure",u]:u==="CONFIRMED"?["success",200]:u==="PENDING"?["pending",100]:[void 0,u]})();return{...o,atomic:n,chainId:i?_o(i):void 0,receipts:(s==null?void 0:s.map(u=>({...u,blockNumber:ha(u.blockNumber),gasUsed:ha(u.gasUsed),status:PH[u.status]})))??[],statusCode:l,status:c,version:a}}async function LH(t,e){const{id:r,pollingInterval:n=t.pollingInterval,status:i=({statusCode:m})=>m===200||m>=300,retryCount:s=4,retryDelay:a=({count:m})=>~~(1<<m)*200,timeout:o=6e4,throwOnFailure:c=!1}=e,l=li(["waitForCallsStatus",t.uid,r]),{promise:u,resolve:d,reject:f}=oA();let h;const g=Cl(l,{resolve:d,reject:f},m=>{const y=O0(async()=>{const b=E=>{clearTimeout(h),y(),E(),g()};try{const E=await Uv(async()=>{const v=await Tt(t,jH,"getCallsStatus")({id:r});if(c&&v.status==="failure")throw new pwe(v);return v},{retryCount:s,delay:a});if(!i(E))return;b(()=>m.resolve(E))}catch(E){b(()=>m.reject(E))}},{interval:n,emitOnBegin:!0});return y});return h=o?setTimeout(()=>{g(),clearTimeout(h),f(new gwe({id:r}))},o):void 0,await u}class gwe extends Ye{constructor({id:e}){super(`Timed out while waiting for call bundle with id "${e}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const k9=256;let O2=k9,R2;function FH(t=11){if(!R2||O2+t>k9*2){R2="",O2=0;for(let e=0;e<k9;e++)R2+=(256+Math.random()*256|0).toString(16).substring(1)}return R2.substring(O2,O2+++t)}function UH(t){const{batch:e,chain:r,ccipRead:n,dataSuffix:i,key:s="base",name:a="Base Client",type:o="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),d=t.pollingInterval??u,f=t.cacheTime??d,h=t.account?vn(t.account):void 0,{config:g,request:m,value:y}=t.transport({account:h,chain:r,pollingInterval:d}),b={...g,...y},E={account:h,batch:e,cacheTime:f,ccipRead:n,chain:r,dataSuffix:i,key:s,name:a,pollingInterval:d,request:m,transport:b,type:o,uid:FH(),...c?{experimental_blockTag:c}:{}};function v(w){return x=>{const _=x(w);for(const A in E)delete _[A];const S={...w,..._};return Object.assign(S,{extend:v(S)})}}return Object.assign(E,{extend:v(E)})}function uA(t){var r,n,i,s,a,o;if(!(t instanceof Ye))return!1;const e=t.walk(c=>c instanceof p9);return e instanceof p9?((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"||((a=e.data)==null?void 0:a.errorName)==="ReverseAddressMismatch"||((o=e.data)==null?void 0:o.errorName)==="UnsupportedResolverProfile":!1}function BH(t){const{abi:e,data:r}=t,n=Tf(r,0,4),i=e.find(s=>
395s.type==="function"&&n===wy(Eo(s)));if(!i)throw new o2e(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?$0(i.inputs,Tf(r,4)):void 0}}const c4="/docs/contract/encodeErrorResult";function DP(t){const{abi:e,errorName:r,args:n}=t;let i=e[0];if(r){const c=eh({abi:e,args:n,name:r});if(!c)throw new iP(r,{docsPath:c4});i=c}if(i.type!=="error")throw new iP(void 0,{docsPath:c4});const s=Eo(i),a=wy(s);let o="0x";if(n&&n.length>0){if(!i.inputs)throw new i2e(i.name,{docsPath:c4});o=Jf(i.inputs,n)}return k0([a,o])}const l4="/docs/contract/encodeFunctionResult";function mwe(t){const{abi:e,functionName:r,result:n}=t;let i=e[0];if(r){const a=eh({abi:e,name:r});if(!a)throw new Yp(r,{docsPath:l4});i=a}if(i.type!=="function")throw new Yp(void 0,{docsPath:l4});if(!i.outputs)throw new xV(i.name,{docsPath:l4});const s=(()=>{if(i.outputs.length===0)return[];if(i.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new _V(n)})();return Jf(i.outputs,s)}const N3="x-batch-gateway:true";async function ywe(t){const{data:e,ccipRequest:r}=t,{args:[n]}=BH({abi:A9,data:e}),i=[],s=[];return await Promise.all(n.map(async(a,o)=>{try{s[o]=a.urls.includes(N3)?await ywe({data:a.data,ccipRequest:r}):await r(a),i[o]=!1}catch(c){i[o]=!0,s[o]=bwe(c)}})),mwe({abi:A9,functionName:"query",result:[i,s]})}function bwe(t){return t.name==="HttpRequestError"&&t.status?DP({abi:A9,errorName:"HttpError",args:[t.status,t.shortMessage]}):DP({abi:[UV],errorName:"Error",args:["shortMessage"in t?t.shortMessage:t.message]})}function qH(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return xo(e)?e:null}function $9(t){let e=new Uint8Array(32).fill(0);if(!t)return di(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=qH(r[n]),s=i?T0(i):Li(pf(r[n]),"bytes");e=Li(is([e,s]),"bytes")}return di(e)}function vwe(t){return`[${t.slice(2)}]`}function wwe(t){const e=new Uint8Array(32).fill(0);return t?qH(t)||Li(pf(t)):di(e)}function dA(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(pf(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s<i.length;s++){let a=pf(i[s]);a.byteLength>255&&(a=pf(vwe(wwe(i[s])))),r[n]=a.length,r.set(a,n+1),n+=a.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function Ewe(t,e){const{blockNumber:r,blockTag:n,coinType:i,name:s,gatewayUrls:a,strict:o}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return P0({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(f=>s.endsWith(f)))return null;const d=i!=null?[$9(s),BigInt(i)]:[$9(s)];try{const f=ws({abi:PP,functionName:"addr",args:d}),h={address:l,abi:SH,functionName:"resolveWithGateways",args:[bc(dA(s)),f,a??[N3]],blockNumber:r,blockTag:n},m=await Tt(t,Ao,"readContract")(h);if(m[0]==="0x")return null;const y=dd({abi:PP,args:d,functionName:"addr",data:m[0]});return y==="0x"||Mu(y)==="0x00"?null:y}catch(f){if(o)throw f;if(uA(f))return null;throw f}}class xwe extends Ye{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 fg extends Ye{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class fA extends Ye{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 _we extends Ye{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Cwe=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Swe=/^(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>\/.*)?$/,Awe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Twe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Iwe(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 MP(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function WH({uri:t,gatewayUrls:e}){const r=Awe.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=MP(e==null?void 0:e.ipfs,"https://ipfs.io"),i=MP(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(Cwe),{protocol:a,subpath:o,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=a==="ipns:/"||o==="ipns/",d=a==="ipfs:/"||o==="ipfs/"||Swe.test(t);if(t.startsWith("http")&&!u&&!d){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||d)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let f=t.replace(Twe,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new fA({uri:t})}function zH(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new xwe({data:t});return t.image||t.image_url||t.image_data}async function kwe({gatewayUrls:t,uri:e}){try{const r=await fetch(e).then(i=>i.json());return await hA({gatewayUrls:t,uri:zH(r)})}catch{throw new fA({uri:e})}}async function hA({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=WH({uri:e,gatewayUrls:t});if(n||await Iwe(r))return r;throw new fA({uri:e})}function $we(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,a]=r.split(":"),[o,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new fg({reason:"Only EIP-155 supported"});if(!a)throw new fg({reason:"Chain ID not found"});if(!c)throw new fg({reason:"Contract address not found"});if(!i)throw new fg({reason:"Token ID not found"});if(!o)throw new fg({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:o.toLowerCase(),contractAddress:c,tokenID:i}}async function Nwe(t,{nft:e}){if(e.namespace==="erc721")return Ao(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}
395],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Ao(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 _we({namespace:e.namespace})}async function Pwe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?Owe(t,{gatewayUrls:e,record:r}):hA({uri:r,gatewayUrls:e})}async function Owe(t,{gatewayUrls:e,record:r}){const n=$we(r),i=await Nwe(t,{nft:n}),{uri:s,isOnChain:a,isEncoded:o}=WH({uri:i,gatewayUrls:e});if(a&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=o?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return hA({uri:zH(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),kwe({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function VH(t,e){const{blockNumber:r,blockTag:n,key:i,name:s,gatewayUrls:a,strict:o}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return P0({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c==null?void 0:c.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;try{const d={address:l,abi:SH,args:[bc(dA(s)),ws({abi:NP,functionName:"text",args:[$9(s),i]}),a??[N3]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},h=await Tt(t,Ao,"readContract")(d);if(h[0]==="0x")return null;const g=dd({abi:NP,functionName:"text",data:h[0]});return g===""?null:g}catch(d){if(o)throw d;if(uA(d))return null;throw d}}async function Rwe(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:a,universalResolverAddress:o}){const c=await Tt(t,VH,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:s,strict:a});if(!c)return null;try{return await Pwe(t,{record:c,gatewayUrls:n})}catch{return null}}async function Dwe(t,e){const{address:r,blockNumber:n,blockTag:i,coinType:s=60n,gatewayUrls:a,strict:o}=e,{chain:c}=t,l=(()=>{if(e.universalResolverAddress)return e.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return P0({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{const u={address:l,abi:Yve,args:[r,s,a??[N3]],functionName:"reverseWithGateways",blockNumber:n,blockTag:i},d=Tt(t,Ao,"readContract"),[f]=await d(u);return f||null}catch(u){if(o)throw u;if(uA(u))return null;throw u}}async function Mwe(t,e){const{blockNumber:r,blockTag:n,name:i}=e,{chain:s}=t,a=(()=>
395{if(e.universalResolverAddress)return e.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return P0({blockNumber:r,chain:s,contract:"ensUniversalResolver"})})(),o=s==null?void 0:s.ensTlds;if(o&&!o.some(l=>i.endsWith(l)))throw new Error(`${i} is not a valid ENS TLD (${o==null?void 0:o.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);const[c]=await Tt(t,Ao,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[bc(dA(i))],blockNumber:r,blockTag:n});return c}async function HH(t,e){var y,b,E;const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:s,data:a,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:h,...g}=e,m=r?vn(r):void 0;try{Ll(e);const w=(typeof n=="bigint"?Vt(n):void 0)||i,x=(E=(b=(y=t.chain)==null?void 0:y.formatters)==null?void 0:b.transactionRequest)==null?void 0:E.format,S=(x||ld)({...N0(g,{format:x}),account:m,blobs:s,data:a,gas:o,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:f,value:h},"createAccessList"),A=await t.request({method:"eth_createAccessList",params:[S,w]});return{accessList:A.accessList,gasUsed:BigInt(A.gasUsed)}}catch(v){throw kH(v,{...e,account:m,chain:t.chain})}}async function jwe(t){const e=v3(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function GH(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:a,toBlock:o}={}){const c=i??(n?[n]:void 0),l=v3(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(h=>Ey({abi:[h],eventName:h.name,args:r}))],n&&(u=u[0]));const d=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?Vt(s):s,toBlock:typeof o=="bigint"?Vt(o):o,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:d,request:l(d),strict:!!a,toBlock:o,type:"event"}}async function KH(t){const e=v3(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function Lwe(t,{address:e,blockNumber:r,blockTag:n=t.experimental_blockTag??"latest"}){var a,o,c;if((a=t.batch)!=null&&a.multicall&&((c=(o=t.chain)==null?void 0:o.contracts)!=null&&c.multicall3)){const l=t.chain.contracts.multicall3.address,u=ws({abi:s0,functionName:"getEthBalance",args:[e]}),{data:d}=await Tt(t,ky,"call")({to:l,data:u,blockNumber:r,blockTag:n});return dd({abi:s0,functionName:"getEthBalance",args:[e],data:d||"0x"})}const i=typeof r=="bigint"?Vt(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function Fwe(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function Uwe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Vt(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),_o(s)}async function Bv(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Vt(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]},{dedupe:!!i});if(s!=="0x")return s}async function Bwe(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=await Bv(t,{address:e,...r!==void 0?{blockNumber:r}:{blockTag:n}});if(i&&Tn(i)===23&&i.startsWith("0xef0100"))return e0(Tf(i,3,23))}class qwe extends Ye{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function Wwe(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[s,a,o,c,l,u,d]=await Tt(t,Ao,"readContract")({abi:zwe,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:a,version:o,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:s}}catch(s){const a=s;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new qwe({address:r}):a}}const zwe=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function Vwe(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function Hwe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=typeof r=="bigint"?Vt(r):void 0,a=await t.request({method:"eth_feeHistory",params:[Vt(e),s||n,i]},{dedupe:!!s});return Vwe(a)}async function Gwe(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>wc(s));return e.abi?eA({abi:e.abi,logs:i,strict:r}):i}async function Kwe({address:t,authorization:e,signature:r}){return i0(e0(t),await E3({authorization:e,signature:r}))}const D2=new I0(8192);function Qwe(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(D2.get(r))return D2.get(r);const n=t().finally(()=>D2.delete(r));return D2.set(r,n),n}function Ywe(t,e={}){return async(r,n={})=>{var d;const{dedupe:i=!1,methods:s,retryDelay:a=150,retryCount:o=3,uid:c}={...e,...n},{method:l}=r;if((d=s==null?void 0:s.exclude)!=null&&d.includes(l))throw new Zd(new Error("method not supported"),{method:l});if(s!=null&&s.include&&!s.include.includes(l))throw new Zd(new Error("method not supported"),{method:l});const u=i?Zp(`${c}.${li(r)}`):void 0;return Qwe(()=>Uv(async()=>{try{return await t(r)}catch(f){const h=f;switch(h.code){case pm.code:throw new pm(h);case gm.code:throw new gm(h);case mm.code:throw new mm(h,{method:r.method});case ym.code:throw new ym(h);case If.code:throw new If(h);case Yu.code:throw new Yu(h);case bm.code:throw new bm(h);case vm.code:throw new vm(h);case wm.code:throw new wm(h);case Zd.code:throw new Zd(h,{method:r.method});case t0.code:throw new t0(h);case Em.code:throw new Em(h);case mp.code:throw new mp(h);case xm.code:throw new xm(h);case _m.code:throw new _m(h);case Cm.code:throw new Cm(h);case Sm.code:throw new Sm(h);case Am.code:throw new Am(h);case r0.code:throw new r0(h);case Tm.code:throw new Tm(h);case Im.code:throw new Im(h);case km.code:throw new km(h);case $m.code:throw new $m(h);case Nm.code:throw new Nm(h);case n0.code:throw new n0(h);case 5e3:throw new mp(h);case Pm.code:throw new Pm(h);default:throw f instanceof Ye?f:new Mbe(h)}}},{delay:({count:f,error:h})=>{var g;if(h&&h instanceof A1){const m=(g=h==null?void 0:h.headers)==null?void 0:g.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<f)*a},retryCount:o,shouldRetry:({error:f})=>Zwe(f)}),{enabled:i,id:u})}}function Zwe(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===t0.code||t.code===If.code:t instanceof A1&&t.status?t.status===403||t.status===408||t.status===4
39513||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function Xwe(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let a;try{const o=new AbortController;r>0&&(a=setTimeout(()=>{n&&o.abort()},r)),i(await t({signal:(o==null?void 0:o.signal)||null}))}catch(o){(o==null?void 0:o.name)==="AbortError"&&s(e),s(o)}finally{clearTimeout(a)}})()})}function Jwe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const jP=Jwe();function e3e(t,e={}){const{url:r,headers:n}=t3e(t);return{async request(i){var g,m,y;const{body:s,fetchFn:a=e.fetchFn??fetch,onRequest:o=e.onRequest,onResponse:c=e.onResponse,timeout:l=e.timeout??1e4}=i,u={...e.fetchOptions??{},...i.fetchOptions??{}},{headers:d,method:f,signal:h}=u;try{const b=await Xwe(async({signal:v})=>{const w={...u,body:Array.isArray(s)?li(s.map(A=>({jsonrpc:"2.0",id:A.id??jP.take(),...A}))):li({jsonrpc:"2.0",id:s.id??jP.take(),...s}),headers:{...n,"Content-Type":"application/json",...d},method:f||"POST",signal:h||(l>0?v:null)},x=new Request(r,w),_=await(o==null?void 0:o(x,w))??{...w,url:r};return await a(_.url??r,_)},{errorInstance:new bP({body:s,url:r}),timeout:l,signal:!0});c&&await c(b);let E;if((g=b.headers.get("Content-Type"))!=null&&g.startsWith("application/json"))E=await b.json();else{E=await b.text();try{E=JSON.parse(E||"{}")}catch(v){if(b.ok)throw v;E={error:E}}}if(!b.ok){if(typeof((m=E.error)==null?void 0:m.code)=="number"&&typeof((y=E.error)==null?void 0:y.message)=="string")return E;throw new A1({body:s,details:li(E.error)||b.statusText,headers:b.headers,status:b.status,url:r})}return E}catch(b){throw b instanceof A1||b instanceof bP?b:new A1({body:s,cause:b,url:r})}}}}function t3e(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}}}const r3e=`�Ethereum Signed Message: 396`;function n3e(t){const e=typeof t=="string"?Zp(t):typeof t.raw=="string"?t.raw:di(t.raw),r=Zp(`${r3e}${Tn(e)}`);return is([r,e])}function QH(t,e){return Li(n3e(t),e)}class i3e extends Ye{constructor({domain:e}){super(`Invalid domain "${li(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class s3e extends Ye{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class a3e extends Ye{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function o3e(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(c,l)=>{const u={...l};for(const d of c){const{name:f,type:h}=d;h==="address"&&(u[f]=u[f].toLowerCase())}return u},a=i.EIP712Domain?e?s(i.EIP712Domain,e):{}:{},o=(()=>{if(n!=="EIP712Domain")return s(i[n],r)})();return li({domain:a,message:o,primaryType:n,types:i})}function YH(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(a,o)=>{for(const c of a){const{name:l,type:u}=c,d=o[l],f=u.match(jV);if(f&&(typeof d=="number"||typeof d=="bigint")){const[m,y,b]=f;Vt(d,{signed:y==="int",size:Number.parseInt(b,10)/8})}if(u==="address"&&typeof d=="string"&&!La(d))throw new Qu({address:d});const h=u.match(ebe);if(h){const[m,y]=h;if(y&&Tn(d)!==Number.parseInt(y,10))throw new l2e({expectedSize:Number.parseInt(y,10),givenSize:Tn(d)})}const g=i[u];g&&(c3e(u),s(g,d))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new i3e({domain:e});s(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])s(i[n],r);else throw new s3e({primaryType:n,types:i})}function ZH({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},(typeof(t==null?void 0:t.chainId)=="number"||typeof(t==null?void 0:t.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}
396].filter(Boolean)}function c3e(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new a3e({type:t})}function l3e(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:ZH({domain:e}),...t.types};YH({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(u3e({domain:e,types:i})),n!=="EIP712Domain"&&s.push(XH({data:r,primaryType:n,types:i})),Li(is(s))}function u3e({domain:t,types:e}){return XH({data:t,primaryType:"EIP712Domain",types:e})}function XH({data:t,primaryType:e,types:r}){const n=JH({data:t,primaryType:e,types:r});return Li(n)}function JH({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[d3e({primaryType:e,types:r})];for(const s of r[e]){const[a,o]=tG({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(a),i.push(o)}return Jf(n,i)}function d3e({primaryType:t,types:e}){const r=bc(f3e({primaryType:t,types:e}));return Li(r)}function f3e({primaryType:t,types:e}){let r="";const n=eG({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:a,type:o})=>`${o} ${a}`).join(",")})`;return r}function eG({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])eG({primaryType:s.type,types:e},r);return r}function tG({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Li(JH({data:n,primaryType:r,types:t}))];if(r==="bytes")return[{type:"bytes32"},Li(n)];if(r==="string")return[{type:"bytes32"},Li(bc(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(a=>tG({name:e,type:i,types:t,value:a}));return[{type:"bytes32"},Li(Jf(s.map(([a])=>a),s.map(([,a])=>a)))]}return[{type:r},n]}let h3e=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)&&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 p3e={checksum:new h3e(8192)},u4=p3e.checksum;class rG extends MS{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,N2e(e);const n=y3(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 a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),Jp(s)}update(e){return Xp(this),this.iHash.update(e),this}digestInto(e){Xp(this),Af(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:a,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=o,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 nG=(t,e,r)=>new rG(t,e).update(r).digest();nG.create=(t,e)=>new rG(t,e);function iG(t,e={}){const{as:r=typeof t=="string"?"Hex":"Bytes"}=e,n=LS($ve(t));return r==="Bytes"?n:So(n)}const g3e=/^0x[a-fA-F0-9]{40}$/;function P3(t,e={}){const{strict:r=!0}=e;if(!g3e.test(t))throw new LP({address:t,cause:new m3e});if(r){if(t.toLowerCase()===t)return;if(sG(t)!==t)throw new LP({address:t,cause:new y3e})}}function sG(t){if(u4.has(t))return u4.get(t);P3(t,{strict:!1});const e=t.substring(2).toLowerCase(),r=iG(Pve(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 u4.set(t,i),i}function N9(t,e={}){const{strict:r=!0}=e??{};try{return P3(t,{strict:r}),!0}catch{return!1}}let LP=class extends wr{constructor({address:e,cause:r}){super(`Address "${e}
396" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},m3e=class extends wr{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"})}},y3e=class extends wr{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}};const b3e=/^(.*)\[([0-9]*)\]$/,v3e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,aG=/^(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)?$/,FP=2n**256n-1n;function bp(t,e,r){const{checksumAddress:n,staticPosition:i}=r,s=mA(e.type);if(s){const[a,o]=s;return E3e(t,{...e,type:o},{checksumAddress:n,length:a,staticPosition:i})}if(e.type==="tuple")return S3e(t,e,{checksumAddress:n,staticPosition:i});if(e.type==="address")return w3e(t,{checksum:n});if(e.type==="bool")return x3e(t);if(e.type.startsWith("bytes"))return _3e(t,e,{staticPosition:i});if(e.type.startsWith("uint")||e.type.startsWith("int"))return C3e(t,e);if(e.type==="string")return A3e(t,{staticPosition:i});throw new bA(e.type)}const UP=32,P9=32;function w3e(t,e={}){const{checksum:r=!1}=e,n=t.readBytes(32);return[(s=>r?sG(s):s)(So(Rve(n,-20))),32]}function E3e(t,e,r){const{checksumAddress:n,length:i,staticPosition:s}=r;if(!i){const c=hl(t.readBytes(P9)),l=s+c,u=l+UP;t.setPosition(l);const d=hl(t.readBytes(UP)),f=Mm(e);let h=0;const g=[];for(let m=0;m<d;++m){t.setPosition(u+(f?m*32:h));const[y,b]=bp(t,e,{checksumAddress:n,staticPosition:u});h+=b,g.push(y)}return t.setPosition(s+32),[g,32]}if(Mm(e)){const c=hl(t.readBytes(P9)),l=s+c,u=[];for(let d=0;d<i;++d){t.setPosition(l+d*32);const[f]=bp(t,e,{checksumAddress:n,staticPosition:l});u.push(f)}return t.setPosition(s+32),[u,32]}let a=0;const o=[];for(let c=0;c<i;++c){const[l,u]=bp(t,e,{checksumAddress:n,staticPosition:s+a});a+=u,o.push(l)}return[o,a]}function x3e(t){return[Mve(t.readBytes(32),{size:32}),32]}function _3e(t,e,{staticPosition:r}){const[n,i]=e.type.split("bytes");if(!i){const a=hl(t.readBytes(32));t.setPosition(r+a);const o=hl(t.readBytes(32));if(o===0)return t.setPosition(r+32),["0x",32];const c=t.readBytes(o);return t.setPosition(r+32),[So(c),32]}return[So(t.readBytes(Number.parseInt(i,10),32)),32]}function C3e(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?Dve(i,{signed:r}):hl(i,{signed:r}),32]}function S3e(t,e,r){const{checksumAddress:n,staticPosition:i}=r,s=e.components.length===0||e.components.some(({name:c})=>!c),a=s?[]:{};let o=0;if(Mm(e)){const c=hl(t.readBytes(P9)),l=i+c;for(let u=0;u<e.components.length;++u){const d=e.components[u];t.setPosition(l+o);const[f,h]=bp(t,d,{checksumAddress:n,staticPosition:l});o+=h,a[s?u:d==null?void 0:d.name]=f}return t.setPosition(i+32),[a,32]}for(let c=0;c<e.components.length;++c){const l=e.components[c],[u,d]=bp(t,l,{checksumAddress:n,staticPosition:i});a[s?c:l==null?void 0:l.name]=u,o+=d}return[a,o]}function A3e(t,{staticPosition:e}){const r=hl(t.readBytes(32)),n=e+r;t.setPosition(n);const i=hl(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];const s=t.readBytes(i,32),a=jve(yH(s));return t.setPosition(e+32),[a,32]}function T3e({checksumAddress:t,parameters:e,values:r}){const n=[];for(let i=0;i<e.length;i++)n.push(pA({checksumAddress:t,parameter:e[i],value:r[i]}));return n}function pA({checksumAddress:t=!1,parameter:e,value:r}){const n=e,i=mA(n.type);if(i){const[s,a]=i;return k3e(r,{checksumAddress:t,length:s,parameter:{...n,type:a}})}if(n.type==="tuple")return R3e(r,{checksumAddress:t,parameter:n});if(n.type==="address")return I3e(r,{checksum:t});if(n.type==="bool")return N3e(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){const s=n.type.startsWith("int"),[,,a="256"]=aG.exec(n.type)??[];return P3e(r,{signed:s,size:Number(a)})}if(n.type.startsWith("bytes"))return $3e(r,{type:n.type});if(n.type==="string")return O3e(r);throw new bA(n.type)}function gA(t){let e=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?e+=32:e+=pa(o)}const r=[],n=[];let i=0;for(let s=0;s<t.length;s++){const{dynamic:a,encoded:o}=t[s];a?(r.push(ls(e+i,{size:32})),n.push(o),i+=pa(o)):r.push(o)}return Co(...r,...n)}function I3e(t,e){const{checksum:r=!1}=e;return P3(t,{strict:r}),{dynamic:!1,encoded:$f(t.toLowerCase())}}function k3e(t,e){const{checksumAddress:r,length:n,parameter:i}=e,s=n===null;if(!Array.isArray(t))throw new W3e(t);if(!s&&t.length!==n)throw new q3e({expectedLength:n,givenLength:t.length,type:`${i.type}[${n}]`});let a=!1;const o=[];for(let c=0;c<t.length;c++){const l=pA({checksumAddress:r,parameter:i,value:t[c]});l.dynamic&&(a=!0),o.push(l)}if(s||a){const c=gA(o);if(s){const l=ls(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?Co(l,c):l}}if(a)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:Co(...o.map(({encoded:c})=>c))}}function $3e(t,{type:e}){const[,r]=e.split("bytes"),n=pa(t);if(!r){let i=t;return n%32!==0&&(i=Nf(i,Math.ceil((t.length-2)/2/32)*32)),{dynamic:!0,encoded:Co($f(ls(n,{size:32})),i)}}if(n!==Number.parseInt(r,10))throw new cG({expectedSize:Number.parseInt(r,10),value:t});return{dynamic:!1,encoded:Nf(t)}
396}function N3e(t){if(typeof t!="boolean")throw new wr(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:$f(bH(t))}}function P3e(t,{signed:e,size:r}){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 EH({max:n.toString(),min:i.toString(),signed:e,size:r/8,value:t.toString()})}return{dynamic:!1,encoded:ls(t,{size:32,signed:e})}}function O3e(t){const e=sA(t),r=Math.ceil(pa(e)/32),n=[];for(let i=0;i<r;i++)n.push(Nf(oc(e,i*32,(i+1)*32)));return{dynamic:!0,encoded:Co(Nf(ls(pa(e),{size:32})),...n)}}function R3e(t,e){const{checksumAddress:r,parameter:n}=e;let i=!1;const s=[];for(let a=0;a<n.components.length;a++){const o=n.components[a],c=Array.isArray(t)?a:o.name,l=pA({checksumAddress:r,parameter:o,value:t[c]});s.push(l),l.dynamic&&(i=!0)}return{dynamic:i,encoded:i?gA(s):Co(...s.map(({encoded:a})=>a))}}function mA(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function Mm(t){var n;const{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return(n=t.components)==null?void 0:n.some(Mm);const r=mA(t.type);return!!(r&&Mm({...t,type:r[1]}))}const D3e={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 L3e({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new j3e({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new BP({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 BP({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 M3e(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(D3e);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}class BP extends wr{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class j3e extends wr{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class L3e extends wr{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function F3e(t,e,r={}){const{as:n="Array",checksumAddress:i=!1}=r,s=typeof e=="string"?mH(e):e,a=M3e(s);if(Xh(s)===0&&t.length>0)throw new B3e;if(Xh(s)&&Xh(s)<32)throw new U3e({data:typeof e=="string"?e:So(e),parameters:t,size:Xh(s)});let o=0;const c=n==="Array"?[]:{};for(let l=0;l<t.length;++l){const u=t[l];a.setPosition(o);const[d,f]=bp(a,u,{checksumAddress:i,staticPosition:0});o+=f,n==="Array"?c.push(d):c[u.name??l]=d}return c}function yA(t,e,r){const{checksumAddress:n=!1}={};if(t.length!==e.length)throw new lG({expectedLength:t.length,givenLength:e.length});const i=T3e({checksumAddress:n,parameters:t,values:e}),s=gA(i);return s.length===0?"0x":s}function O9(t,e){if(t.length!==e.length)throw new lG({expectedLength:t.length,givenLength:e.length});const r=[];for(let n=0;n<t.length;n++){const i=t[n],s=e[n];
396r.push(O9.encode(i,s))}return Co(...r)}(function(t){function e(r,n,i=!1){if(r==="address"){const c=n;return P3(c),$f(c.toLowerCase(),i?32:0)}if(r==="string")return sA(n);if(r==="bytes")return n;if(r==="bool")return $f(bH(n),i?32:1);const s=r.match(aG);if(s){const[c,l,u="256"]=s,d=Number.parseInt(u,10)/8;return ls(n,{size:i?32:d,signed:l==="int"})}const a=r.match(v3e);if(a){const[c,l]=a;if(Number.parseInt(l,10)!==(n.length-2)/2)throw new cG({expectedSize:Number.parseInt(l,10),value:n});return Nf(n,i?32:0)}const o=r.match(b3e);if(o&&Array.isArray(n)){const[c,l]=o,u=[];for(let d=0;d<n.length;d++)u.push(e(l,n[d],!0));return u.length===0?"0x":Co(...u)}throw new bA(r)}t.encode=e})(O9||(O9={}));function oG(t){return Array.isArray(t)&&typeof t[0]=="string"||typeof t=="string"?rP(t):t}class U3e extends wr{constructor({data:e,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${Fh(r)})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class B3e extends wr{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class q3e extends wr{constructor({expectedLength:e,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${e}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class cG extends wr{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${pa(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class lG extends wr{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${e}`,`Given length (values): ${r}`].join(` 397`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}class W3e extends wr{constructor(e){super(`Value \`${e}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}}class bA extends wr{constructor(e){super(`Type \`${e}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Rs=BigInt(0),gs=BigInt(1),Xd=BigInt(2),z3e=BigInt(3),uG=BigInt(4),dG=BigInt(5),fG=BigInt(8);function $s(t,e){const r=t%e;return r>=Rs?r:e+r}function Ea(t,e,r){let n=t;for(;e-- >Rs;)n*=n,n%=r;return n}function R9(t,e){if(t===Rs)throw new Error("invert: expected non-zero number");if(e<=Rs)throw new Error("invert: expected positive modulus, got "+e);let r=$s(t,e),n=e,i=Rs,s=gs;for(;r!==Rs;){const o=n/r,c=n%r,l=i-s*o;n=r,r=c,i=s,s=l}if(n!==gs)throw new Error("invert: does not exist");return $s(i,e)}function hG(t,e){const r=(t.ORDER+gs)/uG,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw new Error("Cannot find square root");return n}function V3e(t,e){const r=(t.ORDER-dG)/fG,n=t.mul(e,Xd),i=t.pow(n,r),s=t.mul(e,i),a=t.mul(t.mul(s,Xd),i),o=t.mul(s,t.sub(a,t.ONE));if(!t.eql(t.sqr(o),e))throw new Error("Cannot find square root");return o}function H3e(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-gs,r=0;for(;e%Xd===Rs;)e/=Xd,r++;let n=Xd;const i=vA(t);for(;qP(i,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return hG;let s=i.pow(n,e);const a=(e+gs)/Xd;return function(c,l){if(c.is0(l))return l;if(qP(c,l)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,s),f=c.pow(l,e),h=c.pow(l,a);for(;!c.eql(f,c.ONE);){if(c.is0(f))return c.ZERO;let g=1,m=c.sqr(f);for(;!c.eql(m,c.ONE);)if(g++,m=c.sqr(m),g===u)throw new Error("Cannot find square root");const y=gs<<BigInt(u-g-1),b=c.pow(d,y);u=g,d=c.sqr(b),f=c.mul(f,d),h=c.mul(h,b)}return h}}function G3e(t){return t%uG===z3e?hG:t%fG===dG?V3e:H3e(t)}const K3e=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Q3e(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=K3e.reduce((n,i)=>(n[i]="function",n),e);return S3(t,r)}function Y3e(t,e,r){if(r<Rs)throw new Error("invalid exponent, negatives unsupported");if(r===Rs)return t.ONE;if(r===gs)return e;let n=t.ONE,i=e;for(;r>Rs;)r&gs&&(n=t.mul(n,i)),i=t.sqr(i),r>>=gs;return n}function pG(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((a,o,c)=>t.is0(o)?a:(n[c]=a,t.mul(a,o)),t.ONE),s=t.inv(i);return e.reduceRight((a,o,c)=>t.is0(o)?a:(n[c]=t.mul(a,n[c]),t.mul(a,o)),s),n}function qP(t,e){const r=(t.ORDER-gs)/Xd,n=t.pow(e,r),i=t.eql(n,t.ONE),s=t.eql(n,t.ZERO),a=t.eql(n,t.neg(t.ONE));if(!i&&!s&&!a)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function gG(t,e){e!==void 0&&dm(e);const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function vA(t,e,r=!1,n={}){if(t<=Rs)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=gG(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const o=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:C3(i),ZERO:Rs,ONE:gs,create:c=>$s(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Rs<=c&&c<t},is0:c=>c===Rs,isOdd:c=>(c&gs)===gs,neg:c=>
vendor: 8,308 bytes, line 397
397$s(-c,t),eql:(c,l)=>c===l,sqr:c=>$s(c*c,t),add:(c,l)=>$s(c+l,t),sub:(c,l)=>$s(c-l,t),mul:(c,l)=>$s(c*l,t),pow:(c,l)=>Y3e(o,c,l),div:(c,l)=>$s(c*R9(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>R9(c,t),sqrt:n.sqrt||(c=>(a||(a=G3e(t)),a(o,c))),toBytes:c=>r?dH(c,s):Ty(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?uH(c):gf(c)},invertBatch:c=>pG(o,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(o)}function mG(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 yG(t){const e=mG(t);return e+Math.ceil(e/2)}function Z3e(t,e,r=!1){const n=t.length,i=mG(e),s=yG(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const a=r?uH(t):gf(t),o=$s(a,e-gs)+gs;return r?dH(o,i):Ty(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const WP=BigInt(0),D9=BigInt(1);function d4(t,e){const r=e.negate();return t?r:e}function bG(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function f4(t,e){bG(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t,s=C3(t),a=BigInt(t);return{windows:r,windowSize:n,mask:s,maxNumber:i,shiftBy:a}}function zP(t,e,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r;let o=Number(t&i),c=t>>a;o>n&&(o-=s,c+=D9);const l=e*n,u=l+Math.abs(o)-1,d=o===0,f=o<0,h=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function X3e(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 J3e(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 h4=new WeakMap,vG=new WeakMap;function p4(t){return vG.get(t)||1}function e5e(t,e){return{constTimeNegate:d4,hasPrecomputes(r){return p4(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>WP;)n&D9&&(i=i.add(s)),s=s.double(),n>>=D9;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=f4(n,e),a=[];let o=r,c=o;for(let l=0;l<i;l++){c=o,a.push(c);for(let u=1;u<s;u++)c=c.add(o),a.push(c);o=c.double()}return a},wNAF(r,n,i){let s=t.ZERO,a=t.BASE;const o=f4(r,e);for(let c=0;c<o.windows;c++){const{nextN:l,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:g}=zP(i,c,o);i=l,d?a=a.add(d4(h,n[g])):s=s.add(d4(f,n[u]))}return{p:s,f:a}},wNAFUnsafe(r,n,i,s=t.ZERO){const a=f4(r,e);for(let o=0;o<a.windows&&i!==WP;o++){const{nextN:c,offset:l,isZero:u,isNeg:d}=zP(i,o,a);if(i=c,!u){const f=n[l];s=s.add(d?f.negate():f)}}return s},getPrecomputes(r,n,i){let s=h4.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&h4.set(n,i(s))),s},wNAFCached(r,n,i){const s=p4(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const a=p4(r);return a===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(a,this.getPrecomputes(a,r,i),n,s)},setWindowSize(r,n){bG(n,e),vG.set(r,n),h4.delete(r)}}}function t5e(t,e,r,n){X3e(r,t),J3e(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 a=t.ZERO,o=vve(BigInt(i));let c=1;o>12?c=o-3:o>4?c=o-2:o>0&&(c=2);const l=C3(c),u=new Array(Number(l)+1).fill(a),d=Math.floor((e.BITS-1)/c)*c;let f=a;for(let h=d;h>=0;h-=c){u.fill(a);for(let m=0;m<s;m++){const y=n[m],b=Number(y>>BigInt(h)&l);u[b]=u[b].add(r[m])}let g=a;for(let m=u.length-1,y=a;m>0;m--)y=y.add(u[m]),g=g.add(y);if(f=f.add(g),h!==0)for(let m=0;m<c;m++)f=f.double()}return f}function wG(t){return Q3e(t.Fp),S3(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...gG(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function VP(t){t.lowS!==void 0&&Om("lowS",t.lowS),t.prehash!==void 0&&Om("prehash",t.prehash)}function r5e(t){const e=wG(t);S3(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 n5e extends Error{constructor(e=""){super(e)}}const Jc={Err:n5e,_tlv:{encode:(t,e)=>{const{Err:r}=Jc;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=P2(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?P2(i.length/2|128):"";return P2(t)+s+i+e},decode(t,e){const{Err:r}=Jc;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 a=0;if(!s)a=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)a=a<<8|u;if(n+=c,a<128)throw new r("tlv.decode(long): not minimal encoding")}const o=e.subarray(n,n+a);if(o.length!==a)throw new r("tlv.decode: wrong value length");return{v:o,l:e.subarray(n+a)}}},_int:{encode(t){const{Err:e}=Jc;if(t<il)throw new e("integer: negative integers are not allowed");let r=P2(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}=Jc;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 gf(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=Jc,i=Aa("signature",t),{v:s,l:a}=n.decode(48,i);if(a.length)throw new e("invalid signature: left bytes after parsing");const{v:o,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(o),s:r.decode(l)}},hexFromSig(t){const{_tlv:e,_int:r}=Jc,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 g4(t,e){return Rm(Ty(t,e))}const il=BigInt(0),mi=BigInt(1);BigInt(2);const m4=BigInt(3),i5e=BigInt(4);function s5e(t){const e=r5e(t),{Fp:r}=e,n=vA(e.n,e.nBitLength),i=e.toBytes||((v,w,x)=>{const _=w.toAffine();return Fv(Uint8Array.from([4]),r.toBytes(_.x),r.toBytes(_.y))}),s=e.fromBytes||(v=>{const w=v.subarray(1),x=r.fromBytes(w.subarray(0,r.BYTES)),_=r.fromBytes(w.subarray(r.BYTES,2*r.BYTES));return{x,y:_}});function a(v){const{a:w,b:x}=e,_=r.sqr(v),S=r.mul(_,v);return r.add(r.add(S,r.mul(v,w)),x)}function o(v,w){const x=r.sqr(w),_=a(v);return r.eql(x,_)}if(!o(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const c=r.mul(r.pow(e.a,m4),i5e),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(v){return iA(v,mi,e.n)}function d(v){const{allowedPrivateKeyLengths:w,nByteLength:x,wrapPrivateKey:_,n:S}=e;if(w&&typeof v!="bigint"){if(Ay(v)&&(v=Rm(v)),typeof v!="string"||!w.includes(v.length))throw new Error("invalid private key");v=v.padStart(x*2,"0")}let A;try{A=typeof v=="bigint"?v:gf(Aa("private key",v,x))}catch{throw new Error("invalid private key, expected hex or "+x+" bytes, got "+typeof v)}return _&&(A=$s(A,S)),yp("private key",A,mi,S),A}function f(v){if(!(v instanceof m))throw new Error("ProjectivePoint expected")}const h=TP((v,w)=>{const{px:x,py:_,pz:S}=v;if(r.eql(S,r.ONE))return{x,y:_};const A=v.is0();w==null&&(w=A?r.ONE:r.inv(S));const I=r.mul(x,w),$=r.mul(_,w),P=r.mul(S,w);if(A)return{x:r.ZERO,y:r.ZERO};if(!r.eql(P,r.ONE))throw new Error("invZ was invalid");return{x:I,y:$}}),g=TP(v=>{if(v.is0()){if(e.allowInfinityPoint&&!r.is0(v.py))return;throw new Error("bad point: ZERO")}const{x:w,y:x}=v.toAffine();if(!r.isValid(w)||!r.isValid(x))throw new Error("bad point: x or y not FE");if(!o(w,x))throw new Error("bad point: equation left != right");
vendor: 5,650 bytes, line 397
397if(!v.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(w,x,_){if(w==null||!r.isValid(w))throw new Error("x required");if(x==null||!r.isValid(x)||r.is0(x))throw new Error("y required");if(_==null||!r.isValid(_))throw new Error("z required");this.px=w,this.py=x,this.pz=_,Object.freeze(this)}static fromAffine(w){const{x,y:_}=w||{};if(!w||!r.isValid(x)||!r.isValid(_))throw new Error("invalid affine point");if(w instanceof m)throw new Error("projective point not allowed");const S=A=>r.eql(A,r.ZERO);return S(x)&&S(_)?m.ZERO:new m(x,_,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const x=pG(r,w.map(_=>_.pz));return w.map((_,S)=>_.toAffine(x[S])).map(m.fromAffine)}static fromHex(w){const x=m.fromAffine(s(Aa("pointHex",w)));return x.assertValidity(),x}static fromPrivateKey(w){return m.BASE.multiply(d(w))}static msm(w,x){return t5e(m,n,w,x)}_setWindowSize(w){E.setWindowSize(this,w)}assertValidity(){g(this)}hasEvenY(){const{y:w}=this.toAffine();if(r.isOdd)return!r.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){f(w);const{px:x,py:_,pz:S}=this,{px:A,py:I,pz:$}=w,P=r.eql(r.mul(x,$),r.mul(A,S)),j=r.eql(r.mul(_,$),r.mul(I,S));return P&&j}negate(){return new m(this.px,r.neg(this.py),this.pz)}double(){const{a:w,b:x}=e,_=r.mul(x,m4),{px:S,py:A,pz:I}=this;let $=r.ZERO,P=r.ZERO,j=r.ZERO,L=r.mul(S,S),B=r.mul(A,A),k=r.mul(I,I),D=r.mul(S,A);return D=r.add(D,D),j=r.mul(S,I),j=r.add(j,j),$=r.mul(w,j),P=r.mul(_,k),P=r.add($,P),$=r.sub(B,P),P=r.add(B,P),P=r.mul($,P),$=r.mul(D,$),j=r.mul(_,j),k=r.mul(w,k),D=r.sub(L,k),D=r.mul(w,D),D=r.add(D,j),j=r.add(L,L),L=r.add(j,L),L=r.add(L,k),L=r.mul(L,D),P=r.add(P,L),k=r.mul(A,I),k=r.add(k,k),L=r.mul(k,D),$=r.sub($,L),j=r.mul(k,B),j=r.add(j,j),j=r.add(j,j),new m($,P,j)}add(w){f(w);const{px:x,py:_,pz:S}=this,{px:A,py:I,pz:$}=w;let P=r.ZERO,j=r.ZERO,L=r.ZERO;const B=e.a,k=r.mul(e.b,m4);let D=r.mul(x,A),q=r.mul(_,I),U=r.mul(S,$),W=r.add(x,_),V=r.add(A,I);W=r.mul(W,V),V=r.add(D,q),W=r.sub(W,V),V=r.add(x,S);let Y=r.add(A,$);return V=r.mul(V,Y),Y=r.add(D,U),V=r.sub(V,Y),Y=r.add(_,S),P=r.add(I,$),Y=r.mul(Y,P),P=r.add(q,U),Y=r.sub(Y,P),L=r.mul(B,V),P=r.mul(k,U),L=r.add(P,L),P=r.sub(q,L),L=r.add(q,L),j=r.mul(P,L),q=r.add(D,D),q=r.add(q,D),U=r.mul(B,U),V=r.mul(k,V),q=r.add(q,U),U=r.sub(D,U),U=r.mul(B,U),V=r.add(V,U),D=r.mul(q,V),j=r.add(j,D),D=r.mul(Y,V),P=r.mul(W,P),P=r.sub(P,D),D=r.mul(W,q),L=r.mul(Y,L),L=r.add(L,D),new m(P,j,L)}subtract(w){return this.add(w.negate())}is0(){return this.equals(m.ZERO)}wNAF(w){return E.wNAFCached(this,w,m.normalizeZ)}multiplyUnsafe(w){const{endo:x,n:_}=e;yp("scalar",w,il,_);const S=m.ZERO;if(w===il)return S;if(this.is0()||w===mi)return this;if(!x||E.hasPrecomputes(this))return E.wNAFCachedUnsafe(this,w,m.normalizeZ);let{k1neg:A,k1:I,k2neg:$,k2:P}=x.splitScalar(w),j=S,L=S,B=this;for(;I>il||P>il;)I&mi&&(j=j.add(B)),P&mi&&(L=L.add(B)),B=B.double(),I>>=mi,P>>=mi;return A&&(j=j.negate()),$&&(L=L.negate()),L=new m(r.mul(L.px,x.beta),L.py,L.pz),j.add(L)}multiply(w){const{endo:x,n:_}=e;yp("scalar",w,mi,_);let S,A;if(x){const{k1neg:I,k1:$,k2neg:P,k2:j}=x.splitScalar(w);let{p:L,f:B}=this.wNAF($),{p:k,f:D}=this.wNAF(j);L=E.constTimeNegate(I,L),k=E.constTimeNegate(P,k),k=new m(r.mul(k.px,x.beta),k.py,k.pz),S=L.add(k),A=B.add(D)}else{const{p:I,f:$}=this.wNAF(w);S=I,A=$}return m.normalizeZ([S,A])[0]}multiplyAndAddUnsafe(w,x,_){const S=m.BASE,A=($,P)=>P===il||P===mi||!$.equals(S)?$.multiplyUnsafe(P):$.multiply(P),I=A(this,x).add(A(w,_));return I.is0()?void 0:I}toAffine(w){return h(this,w)}isTorsionFree(){const{h:w,isTorsionFree:x}=e;if(w===mi)return!0;if(x)return x(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:x}=e;return w===mi?this:x?x(m,this):this.multiplyUnsafe(e.h)}toRawBytes(w=!0){return Om("isCompressed",w),this.assertValidity(),i(m,this,w)}toHex(w=!0){return Om("isCompressed",w),Rm(this.toRawBytes(w))}}m.BASE=new m(e.Gx,e.Gy,r.ONE),m.ZERO=new m(r.ZERO,r.ONE,r.ZERO);const{endo:y,nBitLength:b}=e,E=e5e(m,y?Math.ceil(b/2):b);return{CURVE:e,ProjectivePoint:m,normPrivateKeyToScalar:d,weierstrassEquation:a,isWithinCurveOrder:u}}function a5e(t){const e=wG(t);return S3(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function o5e(t){const e=a5e(t),{Fp:r,n,nByteLength:i,nBitLength:s}=e,a=r.BYTES+1,o=2*r.BYTES+1;function c(k){return $s(k,n)}function l(k){return R9(k,n)}const{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=s5e({...e,toBytes(k,D,q){const U=D.toAffine(),W=r.toBytes(U.x),V=Fv;return Om("isCompressed",q),q?V(Uint8Array.from([D.hasEvenY()?2:3]),W):V(Uint8Array.from([4]),W,r.toBytes(U.y))},fromBytes(k){const D=k.length,q=k[0],U=k.subarray(1);if(D===a&&(q===2||q===3)){const W=gf(U);if(!iA(W,mi,r.ORDER))throw new Error("Point is not on curve");const V=f(W);let Y;try{Y=r.sqrt(V)}catch(ae){const ce=ae instanceof Error?": "+ae.message:"";throw new Error("Point is not on curve"+ce)}const K=(Y&mi)===mi;return(q&1)===1!==K&&(Y=r.neg(Y)),{x:W,y:Y}}else if(D===o&&q===4){const W=r.fromBytes(U.subarray(0,r.BYTES)),V=r.fromBytes(U.subarray(r.BYTES,2*r.BYTES));return{x:W,y:V}}else{const W=a,V=o;throw new Error("invalid Point, expected length of "+W+", or uncompressed "+V+", got "+D)}}});function g(k){const D=n>>mi;return k>D}function m(k){return g(k)?c(-k):k}const y=(k,D,q)=>gf(k.slice(D,q));class b{constructor(D,q,U){yp("r",D,mi,n),yp("s",q,mi,n),this.r=D,this.s=q,U!=null&&(this.recovery=U),Ob
vendor: 7,111 bytes, line 397
397ject.freeze(this)}static fromCompact(D){const q=i;return D=Aa("compactSignature",D,q*2),new b(y(D,0,q),y(D,q,2*q))}static fromDER(D){const{r:q,s:U}=Jc.toSig(Aa("DER",D));return new b(q,U)}assertValidity(){}addRecoveryBit(D){return new b(this.r,this.s,D)}recoverPublicKey(D){const{r:q,s:U,recovery:W}=this,V=S(Aa("msgHash",D));if(W==null||![0,1,2,3].includes(W))throw new Error("recovery id invalid");const Y=W===2||W===3?q+e.n:q;if(Y>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const K=(W&1)===0?"02":"03",ge=u.fromHex(K+g4(Y,r.BYTES)),ae=l(Y),ce=c(-V*ae),Q=c(U*ae),se=u.BASE.multiplyAndAddUnsafe(ge,ce,Q);if(!se)throw new Error("point at infinify");return se.assertValidity(),se}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Lv(this.toDERHex())}toDERHex(){return Jc.hexFromSig(this)}toCompactRawBytes(){return Lv(this.toCompactHex())}toCompactHex(){const D=i;return g4(this.r,D)+g4(this.s,D)}}const E={isValidPrivateKey(k){try{return d(k),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const k=yG(e.n);return Z3e(e.randomBytes(k),e.n)},precompute(k=8,D=u.BASE){return D._setWindowSize(k),D.multiply(BigInt(3)),D}};function v(k,D=!0){return u.fromPrivateKey(k).toRawBytes(D)}function w(k){if(typeof k=="bigint")return!1;if(k instanceof u)return!0;const q=Aa("key",k).length,U=r.BYTES,W=U+1,V=2*U+1;if(!(e.allowedPrivateKeyLengths||i===W))return q===W||q===V}function x(k,D,q=!0){if(w(k)===!0)throw new Error("first arg must be private key");if(w(D)===!1)throw new Error("second arg must be public key");return u.fromHex(D).multiply(d(k)).toRawBytes(q)}const _=e.bits2int||function(k){if(k.length>8192)throw new Error("input is too large");const D=gf(k),q=k.length*8-s;return q>0?D>>BigInt(q):D},S=e.bits2int_modN||function(k){return c(_(k))},A=C3(s);function I(k){return yp("num < 2^"+s,k,il,A),Ty(k,i)}function $(k,D,q=P){if(["recovered","canonical"].some(_e=>_e in q))throw new Error("sign() legacy options not supported");const{hash:U,randomBytes:W}=e;let{lowS:V,prehash:Y,extraEntropy:K}=q;V==null&&(V=!0),k=Aa("msgHash",k),VP(q),Y&&(k=Aa("prehashed msgHash",U(k)));const ge=S(k),ae=d(D),ce=[I(ae),I(ge)];if(K!=null&&K!==!1){const _e=K===!0?W(r.BYTES):K;ce.push(Aa("extraEntropy",_e))}const Q=Fv(...ce),se=ge;function me(_e){const z=_(_e);if(!h(z))return;const R=l(z),M=u.BASE.multiply(z).toAffine(),ee=c(M.x);if(ee===il)return;const ie=c(R*c(se+ee*ae));if(ie===il)return;let le=(M.x===ee?0:2)|Number(M.y&mi),ye=ie;return V&&g(ie)&&(ye=m(ie),le^=1),new b(ee,ye,le)}return{seed:Q,k2sig:me}}const P={lowS:e.lowS,prehash:!1},j={lowS:e.lowS,prehash:!1};function L(k,D,q=P){const{seed:U,k2sig:W}=$(k,D,q),V=e;return wve(V.hash.outputLen,V.nByteLength,V.hmac)(U,W)}u.BASE._setWindowSize(8);function B(k,D,q,U=j){var le;const W=k;D=Aa("msgHash",D),q=Aa("publicKey",q);const{lowS:V,prehash:Y,format:K}=U;if(VP(U),"strict"in U)throw new Error("options.strict was renamed to lowS");if(K!==void 0&&K!=="compact"&&K!=="der")throw new Error("format must be compact or der");const ge=typeof W=="string"||Ay(W),ae=!ge&&!K&&typeof W=="object"&&W!==null&&typeof W.r=="bigint"&&typeof W.s=="bigint";if(!ge&&!ae)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let ce,Q;try{if(ae&&(ce=new b(W.r,W.s)),ge){try{K!=="compact"&&(ce=b.fromDER(W))}catch(ye){if(!(ye instanceof Jc.Err))throw ye}!ce&&K!=="der"&&(ce=b.fromCompact(W))}Q=u.fromHex(q)}catch{return!1}if(!ce||V&&ce.hasHighS())return!1;Y&&(D=e.hash(D));const{r:se,s:me}=ce,_e=S(D),z=l(me),R=c(_e*z),M=c(se*z),ee=(le=u.BASE.multiplyAndAddUnsafe(Q,R,M))==null?void 0:le.toAffine();return ee?c(ee.x)===se:!1}return{CURVE:e,getPublicKey:v,getSharedSecret:x,sign:L,verify:B,ProjectivePoint:u,Signature:b,utils:E}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function c5e(t){return{hash:t,hmac:(e,...r)=>nG(t,e,j2e(...r)),randomBytes:L2e}}function l5e(t,e){const r=n=>o5e({...t,...c5e(n)});return{...r(e),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const EG=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),HP=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),u5e=BigInt(0),d5e=BigInt(1),M9=BigInt(2),GP=(t,e)=>(t+e/M9)/e;function f5e(t){const e=EG,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),o=BigInt(44),c=BigInt(88),l=t*t*t%e,u=l*l*t%e,d=Ea(u,r,e)*u%e,f=Ea(d,r,e)*u%e,h=Ea(f,M9,e)*l%e,g=Ea(h,i,e)*h%e,m=Ea(g,s,e)*g%e,y=Ea(m,o,e)*m%e,b=Ea(y,c,e)*y%e,E=Ea(b,o,e)*m%e,v=Ea(E,r,e)*u%e,w=Ea(v,a,e)*g%e,x=Ea(w,n,e)*l%e,_=Ea(x,M9,e);if(!j9.eql(j9.sqr(_),t))throw new Error("Cannot find square root");return _}const j9=vA(EG,void 0,void 0,{sqrt:f5e}),wA=l5e({a:u5e,b:BigInt(7),Fp:j9,n:HP,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=HP,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-d5e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),o=GP(s*t,e),c=GP(-n*t,e);let l=$s(t-o*r-c*i,e),u=$s(-o*n-c*s,e);const d=l>a,f=u>a;if(d&&(l=e-l),f&&(u=e-u),l>a||u>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},iH),h5e=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:wA},Symbol.toStringTag,{value:"Module"}));function xG(t,e={}){const{recovered:r}=e;if(typeof t.r>"u")throw new y4({signature:t});if(typeof t.s>"u")throw new y4({signature:t});if(r&&typeof t.yParity>"u")throw new y4({signature:t});if(t.r<0n||t.r>FP)throw new w5e({value:t.r});if(t.s<0n||t.s>FP)throw new E5e({value:t.s});if(typeof t.yParity=="number"&&t.yParity!==0&&t.yParity!==1)throw new xA({value:t.yParity})}function p5e(t){return _G(So(t))}function _G(t){if(t.length!==130&&t.length!==132)throw new v5e({signature:t});const e=BigInt(oc(t,0,32)),r=BigInt(oc(t,32,64)),n=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return EA(i)}catch{throw new xA({value:i})}})();return typeof n>"u"?{r:e,s:r}:{r:e,s:r,yParity:n}}function g5e(t){if(!(typeof t.r>"u")&&!(typeof t.s>"u"))return m5e(t)}function m5e(t){const e=typeof t=="string"?_G(t):t instanceof Uint8Array?p5e(t):typeof t.r=="string"?b5e(t):t.v?y5e(t):{r:t.r,s:t.s,...typeof t.yParity<"u"?{yParity:t.yParity}:{}};return xG(e),e}function y5e(t){return{r:t.r,s:t.s,yParity:EA(t.v)}}function b5e(t){const e=(()=>{const r=t.v?Number(t.v):void 0;let n=t.yParity?Number(t.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=EA(r)),typeof n!="number")throw new xA({value:t.yParity});return n})();return{r:BigInt(t.r),s:BigInt(t.s),yParity:e}}function EA(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 x5e({value:t})}let v5e=class extends wr{constructor({signature:e}){super(`Value \`${e}
397\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${pa(Vve(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}};class y4 extends wr{constructor({signature:e}){super(`Signature \`${gH(e)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class w5e extends wr{constructor({value:e}){super(`Value \`${e}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class E5e extends wr{constructor({value:e}){super(`Value \`${e}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}let xA=class extends wr{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"})}},x5e=class extends wr{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"})}};function _5e(t,e={}){return typeof t.chainId=="string"?C5e(t):{...t,...e.signature}}function C5e(t){const{address:e,chainId:r,nonce:n}=t,i=g5e(t);return{address:e,chainId:Number(r),nonce:BigInt(n),...i}}const S5e="0x8010801080108010801080108010801080108010801080108010801080108010",A5e=oG("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function CG(t){if(typeof t=="string"){if(oc(t,-32)!==S5e)throw new k5e(t)}else xG(t.authorization)}function T5e(t){CG(t);const e=wH(oc(t,-64,-32)),r=oc(t,-e-64,-64),n=oc(t,0,-e-64),[i,s,a]=F3e(A5e,r);return{authorization:_5e({address:i.delegation,chainId:Number(i.chainId),nonce:i.nonce,yParity:i.yParity,r:i.r,s:i.s}),signature:n,...a&&a!=="0x"?{data:a,to:s}:{}}}function I5e(t){try{return CG(t),!0}catch{return!1}}let k5e=class extends wr{constructor(e){super(`Value \`${e}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class $5e extends Ye{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function N5e(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new $5e({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,a,o]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],c=Math.round(+`${a}.${o}`);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}`)}function SG(t,e="wei"){return N5e(t,WV[e])}function P5e(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function O5e(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?_o(t.nonce):void 0,storageProof:t.storageProof?P5e(t.storageProof):void 0}}async function R5e(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",a=r!==void 0?Vt(r):void 0,o=await t.request({method:"eth_getProof",params:[e,i,a||s]});return O5e(o)}async function D5e(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?Vt(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function _A(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s,sender:a,nonce:o}){var f,h,g;const c=n||"latest",l=r!==void 0?Vt(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,Vt
397(s)]},{dedupe:!0}):typeof s=="number"?u=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||c,Vt(s)]},{dedupe:!!l}):a&&typeof o=="number"&&(u=await t.request({method:"eth_getTransactionBySenderAndNonce",params:[a,Vt(o)]},{dedupe:!0})),!u)throw new zV({blockHash:e,blockNumber:r,blockTag:c,hash:i,index:s});return(((g=(h=(f=t.chain)==null?void 0:f.formatters)==null?void 0:h.transaction)==null?void 0:g.format)||GS)(u,"getTransaction")}async function M5e(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([Tt(t,$y,"getBlockNumber")({}),e?Tt(t,_A,"getTransaction")({hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function Fb(t,{hash:e}){var i,s,a;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new VV({hash:e});return(((a=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:a.format)||OH)(r,"getTransactionReceipt")}async function j5e(t,e){var E;const{account:r,authorizationList:n,allowFailure:i=!0,blockNumber:s,blockOverrides:a,blockTag:o,stateOverride:c}=e,l=e.contracts,{batchSize:u=e.batchSize??1024,deployless:d=e.deployless??!1}=typeof((E=t.batch)==null?void 0:E.multicall)=="object"?t.batch.multicall:{},f=(()=>{if(e.multicallAddress)return e.multicallAddress;if(d)return null;if(t.chain)return P0({blockNumber:s,chain:t.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),h=[[]];let g=0,m=0;for(let v=0;v<l.length;v++){const{abi:w,address:x,args:_,functionName:S}=l[v];try{const A=ws({abi:w,args:_,functionName:S});m+=(A.length-2)/2,u>0&&m>u&&h[g].length>0&&(g++,m=(A.length-2)/2,h[g]=[]),h[g]=[...h[g],{allowFailure:!0,callData:A,target:x}]}catch(A){const I=kf(A,{abi:w,address:x,args:_,docsPath:"/docs/contract/multicall",functionName:S,sender:r});if(!i)throw I;h[g]=[...h[g],{allowFailure:!0,callData:"0x",target:x}]}}const y=await Promise.allSettled(h.map(v=>Tt(t,Ao,"readContract")({...f===null?{code:aA}:{address:f},abi:s0,account:r,args:[v],authorizationList:n,blockNumber:s,blockOverrides:a,blockTag:o,functionName:"aggregate3",stateOverride:c}))),b=[];for(let v=0;v<y.length;v++){const w=y[v];if(w.status==="rejected"){if(!i)throw w.reason;for(let _=0;_<h[v].length;_++)b.push({status:"failure",error:w.reason,result:void 0});continue}const x=w.value;for(let _=0;_<x.length;_++){const{returnData:S,success:A}=x[_],{callData:I}=h[v][_],{abi:$,address:P,functionName:j,args:L}=l[b.length];try{if(I==="0x")throw new by;if(!A)throw new w3({data:S});const B=dd({abi:$,args:L,data:S,functionName:j});b.push(i?{result:B,status:"success"}:B)}catch(B){const k=kf(B,{abi:$,address:P,args:L,docsPath:"/docs/contract/multicall",functionName:j});if(!i)throw k;b.push({error:k,result:void 0,status:"failure"})}}}if(b.length!==l.length)throw new Ye("multicall results mismatch");return b}async function L9(t,e){const{blockNumber:r,blockTag:n=t.experimental_blockTag??"latest",blocks:i,returnFullTransactions:s,traceTransfers:a,validation:o}=e;try{const c=[];for(const f of i){const h=f.blockOverrides?_H(f.blockOverrides):void 0,g=f.calls.map(y=>{const b=y,E=b.account?vn(b.account):void 0,v=b.abi?ws(b):b.data,w={...b,account:E,data:b.dataSuffix?is([v||"0x",b.dataSuffix]):v,from:b.from??(E==null?void 0:E.address)};return Ll(w),ld(w)}),m=f.stateOverrides?VS(f.stateOverrides):void 0;c.push({blockOverrides:h,calls:g,stateOverrides:m})}const u=(typeof r=="bigint"?Vt(r):void 0)||n;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:s,traceTransfers:a,validation:o},u]})).map((f,h)=>({...eH(f),calls:f.calls.map((g,m)=>{var $,P;const{abi:y,args:b,functionName:E,to:v}=i[h].calls[m],w=(($=g.error)==null?void 0:$.data)??g.returnData,x=BigInt(g.gasUsed),_=(P=g.logs)==null?void 0:P.map(j=>wc(j)),S=g.status==="0x1"?"success":"failure",A=y&&S==="success"&&w!=="0x"?dd({abi:y,data:w,functionName:E}):null,I=(()=>{if(S==="success")return;let j;if(w==="0x"?j=new by:w&&(j=new w3({data:w})),!!j)return kf(j,{abi:y??[],address:v??"0x",args:b,functionName:E??"<unknown>"})})();return{data:w,gasUsed:x,logs:_,status:S,...S==="success"?{result:A}:{error:I}}})}))}catch(c){const l=c,u=x3(l,{});throw u instanceof Cy?l:u}}function F9(t){let e=!0,r="",n=0,i="",s=!1;for(let a=0;a<t.length;a++){const o=t[a];if(["(",")",","].includes(o)&&(e=!0),o==="("&&n++,o===")"&&n--,!!e){if(n===0){if(o===" "&&["event","function","error",""].includes(i))i="";else if(i+=o,o===")"){s=!0;break}continue}if(o===" "){t[a-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=o,r+=o}}if(!s)throw new wr("Unable to normalize signature.");return i}function U9(t,e){const r=typeof t,n=e.type;switch(n){case"address":return N9(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)=>U9(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=>U9(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function AG(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 AG(i.components,s.components,r[n]);const a=[i.type,s.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?N9(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?N9(r[n],{strict:!1}):!1)return a}}function TG(t,e={}){const{prepare:r=!0}=e,n=Array.isArray(t)||typeof t=="string"?tP(t):t;return{...n,...r?{hash:Jh(n)}:{}}}function O3(t,e,r){const{args:n=[],prepare:i=!0}=r??{},s=Hve(e,{strict:!1}),a=t.filter(l=>s?l.type==="function"||l.type==="error"?IG(l)===oc(e,0,4):l.type==="event"?Jh(l)===e:!1:"name"in l&&l.name===e);if(a.length===0)throw new qv({name:e});if(a.length===1)return{...a[0],...i?{hash:Jh(a[0])}:{}};let o;for(const l of a){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...i?{hash:Jh(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((d,f)=>{const h="inputs"in l&&l.inputs[f];return h?U9(d,h):!1}
397)){if(o&&"inputs"in o&&o.inputs){const d=AG(l.inputs,o.inputs,n);if(d)throw new F5e({abiItem:l,type:d[0]},{abiItem:o,type:d[1]})}o=l}}const c=(()=>{if(o)return o;const[l,...u]=a;return{...l,overloads:u}})();if(!c)throw new qv({name:e});return{...c,...i?{hash:Jh(c)}:{}}}function IG(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,n]=t;return O3(r,n)}return t[0]})();return oc(Jh(e),0,4)}function L5e(...t){const e=(()=>{if(Array.isArray(t[0])){const[n,i]=t;return O3(n,i)}return t[0]})(),r=typeof e=="string"?e:Ov(e);return F9(r)}function Jh(...t){const e=(()=>{if(Array.isArray(t[0])){const[r,n]=t;return O3(r,n)}return t[0]})();return typeof e!="string"&&"hash"in e&&e.hash?e.hash:iG(sA(L5e(e)))}class F5e extends wr{constructor(e,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${e.type}\` in \`${F9(Ov(e.abiItem))}\`, and`,`\`${r.type}\` in \`${F9(Ov(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class qv extends wr{constructor({name:e,data:r,type:n="item"}){const i=e?` with name "${e}"`:r?` with data "${r}"`:"";super(`ABI ${n}${i} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function U5e(...t){var s;const[e,r]=(()=>{if(Array.isArray(t[0])){const[a,o]=t;return[q5e(a),o]}return t})(),{bytecode:n,args:i}=r;return Co(n,(s=e.inputs)!=null&&s.length&&(i!=null&&i.length)?yA(e.inputs,i):"0x")}function B5e(t){return TG(t)}function q5e(t){const e=t.find(r=>r.type==="constructor");if(!e)throw new qv({name:"constructor"});return e}function W5e(...t){const[e,r=[]]=(()=>{if(Array.isArray(t[0])){const[l,u,d]=t;return[KP(l,u,{args:d}),d]}const[o,c]=t;return[o,c]})(),{overloads:n}=e,i=n?KP([e,...n],e.name,{args:r}):e,s=z5e(i),a=r.length>0?yA(i.inputs,r):void 0;return a?Co(s,a):s}function Sh(t,e={}){return TG(t,e)}function KP(t,e,r){const n=O3(t,e,r);if(n.type!=="function")throw new qv({name:e,type:"function"});return n}function z5e(t){return IG(t)}const V5e="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ha="0x0000000000000000000000000000000000000000",H5e="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function G5e(t,e){const{blockNumber:r,blockTag:n,calls:i,stateOverrides:s,traceAssetChanges:a,traceTransfers:o,validation:c}=e,l=e.account?vn(e.account):void 0;if(a&&!l)throw new Ye("`account` is required when `traceAssetChanges` is true");const u=l?U5e(B5e("constructor(bytes, bytes)"),{bytecode:TH,args:[H5e,W5e(Sh("function getBalance(address)"),[l.address])]}):void 0,d=a?await Promise.all(e.calls.map(async U=>{if(!U.data&&!U.abi)return;const{accessList:W}=await HH(t,{account:l.address,...U,data:U.abi?ws(U):U.data});return W.map(({address:V,storageKeys:Y})=>Y.length>0?V:null)})).then(U=>U.flat().filter(Boolean)):[],f=await L9(t,{blockNumber:r,blockTag:n,blocks:[...a?[{calls:[{data:u}],stateOverrides:s},{calls:d.map((U,W)=>({abi:[Sh("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:U,from:Ha,nonce:W})),stateOverrides:[{address:Ha,nonce:0}]}]:[],{calls:[...i,{to:Ha}].map(U=>({...U,from:l==null?void 0:l.address})),stateOverrides:s},...a?[{calls:[{data:u}]},{calls:d.map((U,W)=>({abi:[Sh("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:U,from:Ha,nonce:W})),stateOverrides:[{address:Ha,nonce:0}]},{calls:d.map((U,W)=>({to:U,abi:[Sh("function decimals() returns (uint256)")],functionName:"decimals",from:Ha,nonce:W})),stateOverrides:[{address:Ha,nonce:0}]},{calls:d.map((U,W)=>({to:U,abi:[Sh("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ha,nonce:W})),stateOverrides:[{address:Ha,nonce:0}]},{calls:d.map((U,W)=>({to:U,abi:[Sh("function symbol() returns (string)")],functionName:"symbol",from:Ha,nonce:W})),stateOverrides:[{address:Ha,nonce:0}]}]:[]],traceTransfers:o,validation:c}),h=a?f[2]:f[0],[g,m,,y,b,E,v,w]=a?f:[],{calls:x,..._}=h,S=x.slice(0,-1)??[],A=(g==null?void 0:g.calls)??[],I=(m==null?void 0:m.calls)??[],$=[...A,...I].map(U=>U.status==="success"?ha(U.data):null),P=(y==null?void 0:y.calls)??[],j=(b==null?void 0:b.calls)??[],L=[...P,...j].map(U=>
397U.status==="success"?ha(U.data):null),B=((E==null?void 0:E.calls)??[]).map(U=>U.status==="success"?U.result:null),k=((w==null?void 0:w.calls)??[]).map(U=>U.status==="success"?U.result:null),D=((v==null?void 0:v.calls)??[]).map(U=>U.status==="success"?U.result:null),q=[];for(const[U,W]of L.entries()){const V=$[U];if(typeof W!="bigint"||typeof V!="bigint")continue;const Y=B[U-1],K=k[U-1],ge=D[U-1],ae=U===0?{address:V5e,decimals:18,symbol:"ETH"}:{address:d[U-1],decimals:ge||Y?Number(Y??1):void 0,symbol:K??void 0};q.some(ce=>ce.token.address===ae.address)||q.push({token:ae,value:{pre:V,post:W,diff:W-V}})}return{assetChanges:q,block:_,results:S}}const kG="0x6492649264926492649264926492649264926492649264926492649264926492";function K5e(t){if(oc(t,-32)!==kG)throw new Z5e(t)}function Q5e(t){const{data:e,signature:r,to:n}=t;return Co(yA(oG("address, bytes, bytes"),[n,e,r]),kG)}function Y5e(t){try{return K5e(t),!0}catch{return!1}}class Z5e extends wr{constructor(e){super(`Value \`${e}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function X5e({r:t,s:e,to:r="hex",v:n,yParity:i}){const s=(()=>{if(i===0||i===1)return i;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new wA.Signature(ha(t),ha(e)).toCompactHex()}${s===0?"1b":"1c"}`;return r==="hex"?a:vc(a)}async function R3(t,e){var l,u,d,f;const{address:r,chain:n=t.chain,hash:i,erc6492VerifierAddress:s=e.universalSignatureVerifierAddress??((u=(l=n==null?void 0:n.contracts)==null?void 0:l.erc6492Verifier)==null?void 0:u.address),multicallAddress:a=e.multicallAddress??((f=(d=n==null?void 0:n.contracts)==null?void 0:d.multicall3)==null?void 0:f.address),mode:o="auto"}=e;if(n!=null&&n.verifyHash)return await n.verifyHash(t,e);const c=(()=>{const h=e.signature;return xo(h)?h:typeof h=="object"&&"r"in h&&"s"in h?X5e(h):di(h)})();try{if(o==="eoa")try{if(i0(e0(r),await g9({hash:i,signature:c})))return!0}catch{}return I5e(c)?await J5e(t,{...e,multicallAddress:a,signature:c}):await e6e(t,{...e,verifierAddress:s,signature:c})}catch(h){if(o!=="eoa")try{if(i0(e0(r),await g9({hash:i,signature:c})))return!0}catch{}if(h instanceof Pf)return!1;throw h}}async function J5e(t,e){var y;const{address:r,blockNumber:n,blockTag:i,hash:s,multicallAddress:a}=e,{authorization:o,data:c,signature:l,to:u}=T5e(e.signature);if(await Bv(t,{address:r,blockNumber:n,blockTag:i})===k0(["0xef0100",o.address]))return await t6e(t,{address:r,blockNumber:n,blockTag:i,hash:s,signature:l});const f={address:o.address,chainId:Number(o.chainId),nonce:Number(o.nonce),r:Vt(o.r,{size:32}),s:Vt(o.s,{size:32}),yParity:o.yParity};if(!await Kwe({address:r,authorization:f}))throw new Pf;const g=await Tt(t,Ao,"readContract")({...a?{address:a}:{code:aA},authorizationList:[f],abi:s0,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...c?[{allowFailure:!0,target:u??r,callData:c}]:[],{allowFailure:!0,target:r,callData:ws({abi:AH,functionName:"isValidSignature",args:[s,l]})}]]}),m=(y=g[g.length-1])==null?void 0:y.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new Pf}async function e6e(t,e){const{address:r,factory:n,factoryData:i,hash:s,signature:a,verifierAddress:o,...c}=e,l=await(async()=>!n&&!i||Y5e(a)?a:Q5e({data:i,signature:a,to:n}))(),u=o?{to:o,data:ws({abi:OP,functionName:"isValidSig",args:[r,s,l]}),...c}:{data:T3({abi:OP,args:[r,s,l],bytecode:Jve}),...c},{data:d}=await Tt(t,ky,"call")(u).catch(f=>{throw f instanceof GV?new Pf:f});if(b2e(d??"0x0"))return!0;throw new Pf}async function t6e(t,e){const{address:r,blockNumber:n,blockTag:i,hash:s,signature:a}=e;if((await Tt(t,Ao,"readContract")({address:r,abi:AH,args:[s,a],blockNumber:n,blockTag:i,functionName:"isValidSignature"}).catch(c=>{throw c instanceof KV?new Pf:c})).startsWith("0x1626ba7e"))return!0;throw new Pf}class Pf extends Error{}async function r6e(t,{address:e,message:r,factory:n,factoryData:i,signature:s,...a}){const o=QH(r);return Tt(t,R3,"verifyHash")({address:e,factory:n,factoryData:i,hash:o,signature:s,...a})}async function n6e(t,e){const{address:r,factory:n,factoryData:i,signature:s,message:a,primaryType:o,types:c,domain:l,...u}=e,d=l3e({message:a,primaryType:o,types:c,domain:l});return Tt(t,R3,"verifyHash")({address:r,factory:n,factoryData:i,hash:d,signature:s,...u})}function $G(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:a=t.pollingInterval}){const o=typeof s<"u"?s:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
397onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc"));let c;return o?(()=>{const d=li(["watchBlockNumber",t.uid,e,r,a]);return Cl(d,{onBlockNumber:n,onError:i},f=>O0(async()=>{var h;try{const g=await Tt(t,$y,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(g===c)return;if(g-c>1&&r)for(let m=c+1n;m<g;m++)f.onBlockNumber(m,c),c=m}(c===void 0||g>c)&&(f.onBlockNumber(g,c),c=g)}catch(g){(h=f.onError)==null||h.call(f,g)}},{emitOnBegin:e,interval:a}))})():(()=>{const d=li(["watchBlockNumber",t.uid,e,r]);return Cl(d,{onBlockNumber:n,onError:i},f=>{let h=!0,g=()=>h=!1;return(async()=>{try{const m=(()=>{if(t.transport.type==="fallback"){const b=t.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return b?b.value:t.transport}return t.transport})(),{unsubscribe:y}=await m.subscribe({params:["newHeads"],onData(b){var v;if(!h)return;const E=ha((v=b.result)==null?void 0:v.number);f.onBlockNumber(E,c),c=E},onError(b){var E;(E=f.onError)==null||E.call(f,b)}});g=y,h||g()}catch(m){i==null||i(m)}})(),()=>g()})})()}async function NG(t,e){const{checkReplacement:r=!0,confirmations:n=1,hash:i,onReplaced:s,retryCount:a=6,retryDelay:o=({count:x})=>~~(1<<x)*200,timeout:c=18e4}=e,l=li(["waitForTransactionReceipt",t.uid,i]),u=(()=>{var x;return e.pollingInterval?e.pollingInterval:(x=t.chain)!=null&&x.experimental_preconfirmationTime?t.chain.experimental_preconfirmationTime:t.pollingInterval})();let d,f,h,g=!1,m,y;const{promise:b,resolve:E,reject:v}=oA(),w=c?setTimeout(()=>{y==null||y(),m==null||m(),v(new Nbe({hash:i}))},c):void 0;return m=Cl(l,{onReplaced:s,resolve:E,reject:v},async x=>{if(h=await Tt(t,Fb,"getTransactionReceipt")({hash:i}).catch(()=>{}),h&&n<=1){clearTimeout(w),x.resolve(h),m==null||m();return}y=Tt(t,$G,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(_){const S=I=>{clearTimeout(w),y==null||y(),I(),m==null||m()};let A=_;if(!g)try{if(h){if(n>1&&(!h.blockNumber||A-h.blockNumber+1n<n))return;S(()=>x.resolve(h));return}if(r&&!d&&(g=!0,await Uv(async()=>{d=await Tt(t,_A,"getTransaction")({hash:i}),d.blockNumber&&(A=d.blockNumber)},{delay:o,retryCount:a}),g=!1),h=await Tt(t,Fb,"getTransactionReceipt")({hash:i}),n>1&&(!h.blockNumber||A-h.blockNumber+1n<n))return;S(()=>x.resolve(h))}catch(I){if(I instanceof zV||I instanceof VV){if(!d){g=!1;return}try{f=d,g=!0;const $=await Uv(()=>Tt(t,po,"getBlock")({blockNumber:A,includeTransactions:!0}),{delay:o,retryCount:a,shouldRetry:({error:L})=>L instanceof XV});g=!1;const P=$.transactions.find(({from:L,nonce:B})=>L===f.from&&B===f.nonce);if(!P||(h=await Tt(t,Fb,"getTransactionReceipt")({hash:P.hash}),n>1&&(!h.blockNumber||A-h.blockNumber+1n<n)))return;let j="replaced";P.to===f.to&&P.value===f.value&&P.input===f.input?j="repriced":P.from===P.to&&P.value===0n&&(j="cancelled"),S(()=>{var L;(L=x.onReplaced)==null||L.call(x,{reason:j,replacedTransaction:f,transaction:P,transactionReceipt:h}),x.resolve(h)})}catch($){S(()=>x.reject($))}}else S(()=>x.reject(I))}}})}),b}function i6e(t,{blockTag:e=t.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:a,poll:o,pollingInterval:c=t.pollingInterval}){const l=typeof o<"u"?o:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
397onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),u=a??!1;let d;return l?(()=>{const g=li(["watchBlocks",t.uid,e,r,n,u,c]);return Cl(g,{onBlock:i,onError:s},m=>O0(async()=>{var y;try{const b=await Tt(t,po,"getBlock")({blockTag:e,includeTransactions:u});if(b.number!==null&&(d==null?void 0:d.number)!=null){if(b.number===d.number)return;if(b.number-d.number>1&&r)for(let E=(d==null?void 0:d.number)+1n;E<b.number;E++){const v=await Tt(t,po,"getBlock")({blockNumber:E,includeTransactions:u});m.onBlock(v,d),d=v}}((d==null?void 0:d.number)==null||e==="pending"&&(b==null?void 0:b.number)==null||b.number!==null&&b.number>d.number)&&(m.onBlock(b,d),d=b)}catch(b){(y=m.onError)==null||y.call(m,b)}},{emitOnBegin:n,interval:c}))})():(()=>{let g=!0,m=!0,y=()=>g=!1;return(async()=>{try{n&&Tt(t,po,"getBlock")({blockTag:e,includeTransactions:u}).then(v=>{g&&m&&(i(v,void 0),m=!1)}).catch(s);const b=(()=>{if(t.transport.type==="fallback"){const v=t.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return v?v.value:t.transport}return t.transport})(),{unsubscribe:E}=await b.subscribe({params:["newHeads"],async onData(v){var x;if(!g)return;const w=await Tt(t,po,"getBlock")({blockNumber:(x=v.result)==null?void 0:x.number,includeTransactions:u}).catch(()=>{});g&&(i(w,d),m=!1,d=w)},onError(v){s==null||s(v)}});y=E,g||y()}catch(b){s==null||s(b)}})(),()=>y()})()}function s6e(t,{address:e,args:r,batch:n=!0,event:i,events:s,fromBlock:a,onError:o,onLogs:c,poll:l,pollingInterval:u=t.pollingInterval,strict:d}){const f=typeof l<"u"?l:typeof a=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="ipc"||t.transport.type==="fallback"&&(t.transport.transports[0].c
397onfig.type==="webSocket"||t.transport.transports[0].config.type==="ipc")),h=d??!1;return f?(()=>{const y=li(["watchEvent",e,r,n,t.uid,i,u,a]);return Cl(y,{onLogs:c,onError:o},b=>{let E;a!==void 0&&(E=a-1n);let v,w=!1;const x=O0(async()=>{var _;if(!w){try{v=await Tt(t,GH,"createEventFilter")({address:e,args:r,event:i,events:s,strict:h,fromBlock:a})}catch{}w=!0;return}try{let S;if(v)S=await Tt(t,I3,"getFilterChanges")({filter:v});else{const A=await Tt(t,$y,"getBlockNumber")({});E&&E!==A?S=await Tt(t,tA,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:E+1n,toBlock:A}):S=[],E=A}if(S.length===0)return;if(n)b.onLogs(S);else for(const A of S)b.onLogs([A])}catch(S){v&&S instanceof Yu&&(w=!1),(_=b.onError)==null||_.call(b,S)}},{emitOnBegin:!0,interval:u});return async()=>{v&&await Tt(t,k3,"uninstallFilter")({filter:v}),x()}})})():(()=>{let y=!0,b=()=>y=!1;return(async()=>{try{const E=(()=>{if(t.transport.type==="fallback"){const _=t.transport.transports.find(S=>S.config.type==="webSocket"||S.config.type==="ipc");return _?_.value:t.transport}return t.transport})(),v=s??(i?[i]:void 0);let w=[];v&&(w=[v.flatMap(S=>Ey({abi:[S],eventName:S.name,args:r}))],i&&(w=w[0]));const{unsubscribe:x}=await E.subscribe({params:["logs",{address:e,topics:w}],onData(_){var A;if(!y)return;const S=_.result;try{const{eventName:I,args:$}=jv({abi:v??[],data:S.data,topics:S.topics,strict:h}),P=wc(S,{args:$,eventName:I});c([P])}catch(I){let $,P;if(I instanceof Rv||I instanceof RS){if(d)return;$=I.abiItem.name,P=(A=I.abiItem.inputs)==null?void 0:A.some(L=>!("name"in L&&L.name))}const j=wc(S,{args:P?[]:{},eventName:$});c([j])}},onError(_){o==null||o(_)}});b=x,y||b()}catch(E){o==null||o(E)}})(),()=>b()})()}function a6e(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=li(["watchPendingTransactions",t.uid,e,s]);return Cl(l,{onTransactions:n,onError:r},u=>{let d;const f=O0(async()=>{var h;try{if(!d)try{d=await Tt(t,KH,"createPendingTransactionFilter")({});return}catch(m){throw f(),m}const g=await Tt(t,I3,"getFilterChanges")({filter:d});if(g.length===0)return;if(e)u.onTransactions(g);else for(const m of g)u.onTransactions([m])}catch(g){(h=u.onError)==null||h.call(u,g)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await Tt(t,k3,"uninstallFilter")({filter:d}),f()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:d}=await t.transport.subscribe({params:["newPendingTransactions"],onData(f){if(!l)return;const h=f.result;n([h])},onError(f){r==null||r(f)}});u=d,l||u()}catch(d){r==null||r(d)}})(),()=>u()})()}function o6e(t){var d,f,h;const{scheme:e,statement:r,...n}=((d=t.match(c6e))==null?void 0:d.groups)??{},{chainId:i,expirationTime:s,issuedAt:a,notBefore:o,requestId:c,...l}=((f=t.match(l6e))==null?void 0:f.groups)??{},u=(h=t.split("Resources:")[1])==null?void 0:h.split(` 398- `).slice(1);return{...n,...l,...i?{chainId:Number(i)}:{},...s?{expirationTime:new Date(s)}:{},...a?{issuedAt:new Date(a)}:{},...o?{notBefore:new Date(o)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const c6e=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,l6e=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/;function u6e(t){const{address:e,domain:r,message:n,nonce:i,scheme:s,time:a=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&a>=n.expirationTime||n.notBefore&&a<n.notBefore)return!1;try{if(!n.address||!La(n.address,{strict:!1})||e&&!i0(n.address,e))return!1}catch{return!1}return!0}async function d6e(t,e){const{address:r,domain:n,message:i,nonce:s,scheme:a,signature:o,time:c=new Date,...l}=e,u=o6e(i);
398if(!u.address||!u6e({address:r,domain:n,message:u,nonce:s,scheme:a,time:c}))return!1;const f=QH(i);return R3(t,{address:u.address,hash:f,signature:o,...l})}async function CA(t,{serializedTransaction:e,throwOnReceiptRevert:r,timeout:n}){var o,c,l;const i=await t.request({method:"eth_sendRawTransactionSync",params:n?[e,n]:[e]},{retryCount:0}),a=(((l=(c=(o=t.chain)==null?void 0:o.formatters)==null?void 0:c.transactionReceipt)==null?void 0:l.format)||OH)(i);if(a.status==="reverted"&&r)throw new HV({receipt:a});return a}function SA(t){return{call:e=>ky(t,e),createAccessList:e=>HH(t,e),createBlockFilter:()=>jwe(t),createContractEventFilter:e=>FV(t,e),createEventFilter:e=>GH(t,e),createPendingTransactionFilter:()=>KH(t),estimateContractGas:e=>gve(t,e),estimateGas:e=>JS(t,e),getBalance:e=>Lwe(t,e),getBlobBaseFee:()=>Fwe(t),getBlock:e=>po(t,e),getBlockNumber:e=>$y(t,e),getBlockTransactionCount:e=>Uwe(t,e),getBytecode:e=>Bv(t,e),getChainId:()=>ud(t),getCode:e=>Bv(t,e),getContractEvents:e=>oH(t,e),getDelegation:e=>Bwe(t,e),getEip712Domain:e=>Wwe(t,e),getEnsAddress:e=>Ewe(t,e),getEnsAvatar:e=>Rwe(t,e),getEnsName:e=>Dwe(t,e),getEnsResolver:e=>Mwe(t,e),getEnsText:e=>VH(t,e),getFeeHistory:e=>Hwe(t,e),estimateFeesPerGas:e=>Jbe(t,e),getFilterChanges:e=>I3(t,e),getFilterLogs:e=>Gwe(t,e),getGasPrice:()=>KS(t),getLogs:e=>tA(t,e),getProof:e=>R5e(t,e),estimateMaxPriorityFeePerGas:e=>Xbe(t,e),fillTransaction:e=>ZS(t,e),getStorageAt:e=>D5e(t,e),getTransaction:e=>_A(t,e),getTransactionConfirmations:e=>M5e(t,e),getTransactionCount:e=>QS(t,e),getTransactionReceipt:e=>Fb(t,e),multicall:e=>j5e(t,e),prepareTransactionRequest:e=>Sy(t,e),readContract:e=>Ao(t,e),sendRawTransaction:e=>lA(t,e),sendRawTransactionSync:e=>CA(t,e),simulate:e=>L9(t,e),simulateBlocks:e=>L9(t,e),simulateCalls:e=>G5e(t,e),simulateContract:e=>awe(t,e),verifyHash:e=>R3(t,e),verifyMessage:e=>r6e(t,e),verifySiweMessage:e=>d6e(t,e),verifyTypedData:e=>n6e(t,e),uninstallFilter:e=>k3(t,e),waitForTransactionReceipt:e=>NG(t,e),watchBlocks:e=>i6e(t,e),watchBlockNumber:e=>$G(t,e),watchContractEvent:e=>hwe(t,e),watchEvent:e=>s6e(t,e),watchPendingTransactions:e=>a6e(t,e)}}function Of(t){const{key:e="public",name:r="Public Client"}=t;return UH({...t,key:e,name:r,type:"publicClient"}).extend(SA)}async function f6e(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:a}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:Vt(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:a?Object.values(a).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}function h6e(t,e){const{abi:r,args:n,bytecode:i,...s}=e,a=T3({abi:r,args:n,bytecode:i});return $3(t,{...s,...s.authorizationList?{to:null}:{},data:a})}async function p6e(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>vy(n))}async function g6e(t,e={}){const{account:r=t.account,chainId:n}=e,i=r?vn(r):void 0,s=n?[i==null?void 0:i.address,[Vt(n)]]:[i==null?void 0:i.address],a=await t.request({method:"wallet_getCapabilities",params:s}),o={};for(const[c,l]of Object.entries(a)){o[Number(c)]={};for(let[u,d]of Object.entries(l))u==="addSubAccount"&&(u="unstable_addSubAccount"),o[Number(c)][u]=d}return typeof n=="number"?o[n]:o}async function m6e(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function PG(t,e){var c;const{account:r=t.account,chainId:n,nonce:i}=e;if(!r)throw new fd({docsPath:"/docs/eip7702/prepareAuthorization"});const s=vn(r),a=(()=>{if(e.executor)return e.executor==="self"?e.executor:vn(e.executor)})(),o={address:e.contractAddress??e.address,chainId:n,nonce:i};return typeof o.chainId>"u"&&(o.chainId=((c=t.chain)==null?void 0:c.id)??await Tt(t,ud,"getChainId")({})),typeof o.nonce>"u"&&(o.nonce=await Tt(t,QS,"getTransactionCount")({address:s.address,blockTag:"pending"}),(a==="self"||a!=null&&a.address&&i0(a.address,s.address))&&(o.nonce+=1)),o}async function y6e(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>e0(r))}async function b6e(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function v6e(t,e){const{chain:r=t.chain}=e,n=e.timeout??Math.max(((r==null?void 0:r.blockTime)??0)*3,5e3),i=await Tt(t,MH,"sendCalls")(e);return await Tt(t,LH,"waitForCallsStatus")({...e,id:i.id,timeout:n})}const b4=new I0(128);async function OG(t,e){var S,A,I,$,P;const{account:r=t.account,assertChainId:n=!0,chain:i=t.chain,accessList:s,authorizationList:a,blobs:o,data:c,dataSuffix:l=typeof t.dataSuffix=="string"?t.dataSuffix:(S=t.dataSuffix)==null?void 0:S.value,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:m,pollingInterval:y,throwOnReceiptRevert:b,type:E,value:v,...w}=e,x=e.timeout??Math.max(((i==null?void 0:i.blockTime)??0)*3,5e3);if(typeof r>"u")throw new fd({docsPath:"/docs/actions/wallet/sendTransactionSync"});const _=r?vn(r):null;try{Ll(e);const j=await(async()=>
398{if(e.to)return e.to;if(e.to!==null&&a&&a.length>0)return await E3({authorization:a[0]}).catch(()=>{throw new Ye("`to` is required. Could not infer from `authorizationList`.")})})();if((_==null?void 0:_.type)==="json-rpc"||_===null){let L;i!==null&&(L=await Tt(t,ud,"getChainId")({}),n&&cA({currentChainId:L,chain:i}));const B=($=(I=(A=t.chain)==null?void 0:A.formatters)==null?void 0:I.transactionRequest)==null?void 0:$.format,D=(B||ld)({...N0(w,{format:B}),accessList:s,account:_,authorizationList:a,blobs:o,chainId:L,data:c&&is([c,l??"0x"]),gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:m,to:j,type:E,value:v},"sendTransaction"),q=b4.get(t.uid),U=q?"wallet_sendTransaction":"eth_sendTransaction",W=await(async()=>{try{return await t.request({method:U,params:[D]},{retryCount:0})}catch(Y){if(q===!1)throw Y;const K=Y;if(K.name==="InvalidInputRpcError"||K.name==="InvalidParamsRpcError"||K.name==="MethodNotFoundRpcError"||K.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[D]},{retryCount:0}).then(ge=>(b4.set(t.uid,!0),ge)).catch(ge=>{const ae=ge;throw ae.name==="MethodNotFoundRpcError"||ae.name==="MethodNotSupportedRpcError"?(b4.set(t.uid,!1),K):ae});throw K}})(),V=await Tt(t,NG,"waitForTransactionReceipt")({checkReplacement:!1,hash:W,pollingInterval:y,timeout:x});if(b&&V.status==="reverted")throw new HV({receipt:V});return V}if((_==null?void 0:_.type)==="local"){const L=await Tt(t,Sy,"prepareTransactionRequest")({account:_,accessList:s,authorizationList:a,blobs:o,chain:i,data:c&&is([c,l??"0x"]),gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:g,nonce:m,nonceManager:_.nonceManager,parameters:[...XS,"sidecars"],type:E,value:v,...w,to:j}),B=(P=i==null?void 0:i.serializers)==null?void 0:P.transaction,k=await _.signTransaction(L,{serializer:B});return await Tt(t,CA,"sendRawTransactionSync")({serializedTransaction:k,throwOnReceiptRevert:b,timeout:e.timeout})}throw(_==null?void 0:_.type)==="smart"?new mf({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new mf({docsPath:"/docs/actions/wallet/sendTransactionSync",type:_==null?void 0:_.type})}catch(j){throw j instanceof mf?j:_3(j,{...e,account:_,chain:e.chain||void 0})}}async function w6e(t,e){const{id:r}=e;await t.request({method:"wallet_showCallsStatus",params:[r]})}async function E6e(t,e){const{account:r=t.account}=e;if(!r)throw new fd({docsPath:"/docs/eip7702/signAuthorization"});const n=vn(r);if(!n.signAuthorization)throw new mf({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const i=await PG(t,e);return n.signAuthorization(i)}async function x6e(t,{account:e=t.account,message:r}){if(!e)throw new fd({docsPath:"/docs/actions/wallet/signMessage"});const n=vn(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?Zp(r):r.raw instanceof Uint8Array?bc(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function _6e(t,e){var l,u,d,f;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new fd({docsPath:"/docs/actions/wallet/signTransaction"});const s=vn(r);Ll({account:s,...e});const a=await Tt(t,ud,"getChainId")({});n!==null&&cA({currentChainId:a,chain:n});const o=(n==null?void 0:n.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=o==null?void 0:o.transactionRequest)==null?void 0:u.format)||ld;return s.signTransaction?s.signTransaction({...i,chainId:a},{serializer:(f=(d=t.chain)==null?void 0:d.serializers)==null?void 0:f.transaction}):await t.request({method:"eth_signTransaction",params:[{...c({...i,account:s},"signTransaction"),chainId:Vt(a),from:s.address}]},{retryCount:0})}async function C6e(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new fd({docsPath:"/docs/actions/wallet/signTypedData"});const a=vn(r),o={EIP712Domain:ZH({domain:n}),...e.types};if(YH({domain:n,message:i,primaryType:s,types:o}),a.signTypedData)return a.signTypedData({domain:n,message:i,primaryType:s,types:o});const c=o3e({domain:n,message:i,primaryType:s,types:o});return t.request({method:"eth_signTypedData_v4",params:[a.address,c]},{retryCount:0})}async function S6e(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Vt(e)}]},{retryCount:0})}async function A6e(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}async function T6e(t,e){return Dm.internal(t,OG,"sendTransactionSync",e)}function I6e(t){return{addChain:e=>f6e(t,e),deployContract:e=>h6e(t,e),fillTransaction:e=>ZS(t,e),getAddresses:()=>p6e(t),getCallsStatus:e=>jH(t,e),getCapabilities:e=>g6e(t,e),getChainId:()=>ud(t),getPermissions:()=>m6e(t),prepareAuthorization:e=>PG(t,e),prepareTransactionRequest:e=>Sy(t,e),requestAddresses:()=>y6e(t),requestPermissions:e=>b6e(t,e),sendCalls:e=>MH(t,e),sendCallsSync:e=>v6e(t,e),sendRawTransaction:e=>lA(t,e),sendRawTransactionSync:e=>CA(t,e),sendTransaction:e=>$3(t,e),sendTransactionSync:e=>OG(t,e),showCallsStatus:e=>w6e(t,e),signAuthorization:e=>E6e(t,e),signMessage:e=>x6e(t,e),signTransaction:e=>_6e(t,e),signTypedData:e=>C6e(t,e),switchChain:e=>S6e(t,e),waitForCallsStatus:e=>LH(t,e),watchAsset:e=>A6e(t,e),writeContract:e=>Dm(t,e),writeContractSync:e=>T6e(t,e)}}function RG(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;
398return UH({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(I6e)}function DG({key:t,methods:e,name:r,request:n,retryCount:i=3,retryDelay:s=150,timeout:a,type:o},c){const l=FH();return{config:{key:t,methods:e,name:r,request:n,retryCount:i,retryDelay:s,timeout:a,type:o},request:Ywe(n,{methods:e,retryCount:i,retryDelay:s,uid:l}),value:c}}function MG(t,e={}){const{key:r="custom",methods:n,name:i="Custom Provider",retryDelay:s}=e;return({retryCount:a})=>DG({key:r,methods:n,name:i,request:t.request.bind(t),retryCount:e.retryCount??a,retryDelay:s,type:"custom"})}class k6e extends Ye{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 Rf(t,e={}){const{batch:r,fetchFn:n,fetchOptions:i,key:s="http",methods:a,name:o="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:u,raw:d}=e;return({chain:f,retryCount:h,timeout:g})=>{const{batchSize:m=1e3,wait:y=0}=typeof r=="object"?r:{},b=e.retryCount??h,E=g??e.timeout??1e4,v=t||(f==null?void 0:f.rpcUrls.default.http[0]);if(!v)throw new k6e;const w=e3e(v,{fetchFn:n,fetchOptions:i,onRequest:c,onResponse:l,timeout:E});return DG({key:s,methods:a,name:o,async request({method:x,params:_}){const S={method:x,params:_},{schedule:A}=$H({id:v,wait:y,shouldSplitBatch(j){return j.length>m},fn:j=>w.request({body:j}),sort:(j,L)=>j.id-L.id}),I=async j=>r?A(j):[await w.request({body:j})],[{error:$,result:P}]=await I(S);if(d)return{error:$,result:P};if($)throw new zS({body:S,error:$,url:v});return P},retryCount:b,retryDelay:u,timeout:E,type:"http"},{fetchOptions:i,url:v})}}function QP(t){return t?`${t.slice(0,5)}â¦${t.slice(-4)}`:""}function $6e({wei:t,precision:e=3}){return parseFloat(xy(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function YP({amount:t,decimals:e}){return hm(BigInt(t),e)}const N6e=/"(?:_|\\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*:/,P6e=/"(?: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*:/,O6e=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function R6e(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){D6e(t);return}return e}function D6e(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function s1(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(!O6e.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(N6e.test(t)||P6e.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,R6e)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const M6e=/#/g,j6e=/&/g,L6e=/\//g,F6e=/=/g,AA=/\+/g,U6e=/%5e/gi,B6e=/%60/gi,q6e=/%7c/gi,W6e=/%20/gi;function z6e(t){return encodeURI(""+t).replace(q6e,"|")}function B9(t){return z6e(typeof t=="string"?t:JSON.stringify(t)).replace(AA,"%2B").replace(W6e,"+").replace(M6e,"%23").replace(j6e,"%26").replace(B6e,"`").replace(U6e,"^").replace(L6e,"%2F")}function v4(t){return B9(t).replace(F6e,"%3D")}function jG(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function V6e(t){return jG(t.replace(AA," "))}function H6e(t){return jG(t.replace(AA," "))}function G6e(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const r of t.split("&")){const n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const i=V6e(n[1]);if(i==="__proto__"||i==="constructor")continue;const s=H6e(n[2]||"");e[i]===void 0?e[i]=s:Array.isArray(e[i])?e[i].push(s):e[i]=[e[i],s]}return e}function K6e(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${v4(t)}=${B9(r)}`).join("&"):`${v4(t)}=${B9(e)}`:v4(t)}function Q6e(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>
398K6e(e,t[e])).filter(Boolean).join("&")}const Y6e=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Z6e=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,X6e=/^([/\\]\s*){2,}[^/\\]/,J6e=/^\.?\//;function LG(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?Y6e.test(t):Z6e.test(t)||(e.acceptRelative?X6e.test(t):!1)}function e4e(t="",e){return t.endsWith("/")}function t4e(t="",e){return(e4e(t)?t.slice(0,-1):t)||"/"}function r4e(t="",e){return t.endsWith("/")?t:t+"/"}function n4e(t,e){if(s4e(e)||LG(t))return t;const r=t4e(e);if(t.startsWith(r)){const n=t[r.length];if(!n||n==="/"||n==="?")return t}return o4e(r,t)}function i4e(t,e){const r=c4e(t),n={...G6e(r.search),...e};return r.search=Q6e(n),l4e(r)}function s4e(t){return!t||t==="/"}function a4e(t){return t&&t!=="/"}function o4e(t,...e){let r=t||"";for(const n of e.filter(i=>a4e(i)))if(r){const i=n.replace(J6e,"");r=r4e(r)+i}else r=n;return r}const FG=Symbol.for("ufo:protocolRelative");function c4e(t="",e){const r=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){const[,d,f=""]=r;return{protocol:d.toLowerCase(),pathname:f,href:d+f,auth:"",host:"",search:"",hash:""}}if(!LG(t,{acceptRelative:!0}))return ZP(t);const[,n="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,a="",o=""]=s.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:c,search:l,hash:u}=ZP(o);return{protocol:n.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:a,pathname:c,search:l,hash:u,[FG]:!n}}function ZP(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function l4e(t){const e=t.pathname||"",r=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",i=t.auth?t.auth+"@":"",s=t.host||"";return(t.protocol||t[FG]?(t.protocol||"")+"//":"")+i+s+e+r+n}class UG extends Error{constructor(e,r){super(e,r),this.name="FetchError",r!=null&&r.cause&&!this.cause&&(this.cause=r.cause)}}function u4e(t){var c,l,u,d,f;const e=((c=t.error)==null?void 0:c.message)||((l=t.error)==null?void 0:l.toString())||"",r=((u=t.request)==null?void 0:u.method)||((d=t.options)==null?void 0:d.method)||"GET",n=((f=t.request)==null?void 0:f.url)||String(t.request)||"/",i=`[${r}] ${JSON.stringify(n)}`,s=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",a=`${i}: ${s}${e?` ${e}`:""}`,o=new UG(a,t.error?{cause:t.error}:void 0);for(const h of["request","options","response"])Object.defineProperty(o,h,{get(){return t[h]}});for(const[h,g]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,h,{get(){return t.response&&t.response[g]}});return o}const d4e=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function XP(t="GET"){return d4e.has(t.toUpperCase())}function f4e(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer||t instanceof FormData||t instanceof URLSearchParams?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const h4e=new Set(["image/svg","application/xml","application/xhtml","application/html"]),p4e=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function g4e(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return p4e.test(e)?"json":e==="text/event-stream"?"stream":h4e.has(e)||e.startsWith("text/")?"text":"blob"}function m4e(t,e,r,n){const i=y4e((e==null?void 0:e.headers)??(t==null?void 0:t.headers),r==null?void 0:r.headers,n);let s;return(r!=null&&r.query||r!=null&&r.params||e!=null&&e.params||e!=null&&e.query)&&(s={...r==null?void 0:r.params,...r==null?void 0:r.query,...e==null?void 0:e.params,...e==null?void 0:e.query}),{...r,...e,query:s,params:s,headers:i}}function y4e(t,e,r){if(!e)return new r(t);const n=new r(e);if(t)for(const[i,s]of Symbol.iterator in t||Array.isArray(t)?t:new r(t))n.set(i,s);return n}async function M2(t,e){if(e)if(Array.isArray(e))for(const r of e)await r(t);else await e(t)}const b4e=new Set([408,409,425,429,500,502,503,504]),v4e=new Set([101,204,205,304]);function BG(t={}){const{fetch:e=globalThis.fetch,Headers:r=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function i(o){const c=o.error&&o.error.name==="AbortError"&&!o.options.timeout||!1;if(o.options.retry!==!1&&!c){let u;typeof o.options.retry=="number"?u=o.options.retry:u=XP(o.options.method)?0:1;const d=o.response&&o.response.status||500;if(u>0&&(Array.isArray(o.options.retryStatusCodes)?o.options.retryStatusCodes.includes(d):b4e.has(d))){const f=typeof o.options.retryDelay=="function"?o.options.retryDelay(o):o.options.retryDelay||0;return f>0&&await new Promise(h=>setTimeout(h,f)),s(o.request,{...o.options,retry:u-1})}}const l=u4e(o);throw Error.captureStackTrace&&Error.captureStackTrace(l,s),l}const s=async function(c,l={}){const u={request:c,options:m4e(c,l,t.defaults,r),response:void 0,error:void 0};if(u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&(await M2(u,u.options.onRequest),u.options.headers instanceof r||(u.options.headers=new r(u.options.headers||{}))),typeof u.request=="string"&&(u.options.baseURL&&(u.request=n4e(u.request,u.options.baseURL)),u.options.query&&(u.request=i4e(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&XP(u.options.method))if(f4e(u.options.body)){const h=u.options.headers.get("content-type");typeof u.options.body!="string"&&(u.options.body=h==="application/x-www-form-urlencoded"?new URLSearchParams(u.options.body).toString():JSON.stringify(u.options.body)),h||u.options.headers.set("content-type","application/json"),u.o
398ptions.headers.has("accept")||u.options.headers.set("accept","application/json")}else("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half"));let d;if(!u.options.signal&&u.options.timeout){const h=new n;d=setTimeout(()=>{const g=new Error("[TimeoutError]: The operation was aborted due to timeout");g.name="TimeoutError",g.code=23,h.abort(g)},u.options.timeout),u.options.signal=h.signal}try{u.response=await e(u.request,u.options)}catch(h){return u.error=h,u.options.onRequestError&&await M2(u,u.options.onRequestError),await i(u)}finally{d&&clearTimeout(d)}if((u.response.body||u.response._bodyInit)&&!v4e.has(u.response.status)&&u.options.method!=="HEAD"){const h=(u.options.parseResponse?"json":u.options.responseType)||g4e(u.response.headers.get("content-type")||"");switch(h){case"json":{const g=await u.response.text(),m=u.options.parseResponse||s1;u.response._data=m(g);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[h]()}}return u.options.onResponse&&await M2(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await M2(u,u.options.onResponseError),await i(u)):u.response},a=async function(c,l){return(await s(c,l))._data};return a.raw=s,a.native=(...o)=>e(...o),a.create=(o={},c={})=>BG({...t,...c,defaults:{...t.defaults,...c.defaults,...o}}),a}const Wv=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),w4e=Wv.fetch?(...t)=>Wv.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),E4e=Wv.Headers,x4e=Wv.AbortController,qG=BG({fetch:w4e,Headers:E4e,AbortController:x4e});var Jt;let Fs=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},$a=class extends Fs{constructor(e,r,n,i,s,a){super(n,i,s),this.type=e,this.status=r,this.data=a}},xe=class extends Fs{constructor(e,r,n){super(e,r,n),this.type="client_error"}},_4e=class extends xe{constructor(){super("Request timed out",void 0,"client_request_timeout")}},un=class extends Fs{constructor(e,r,n){super(e,r,n),this.type="connector_error"}};const $r=t=>{if(t instanceof Fs)return t;if(!(t instanceof UG))return rn(t);if(!t.response)return new $a("api_error",null,t.message,t);let{type:e,message:r,error:n,code:i}=t.data;return new $a(e||"ApiError",t.response.status,r||n,t,i,t.data)},rn=t=>t instanceof Fs?t:t instanceof Error?new xe(t.message,t):new xe(`Internal error: ${t}`);var Se=((Jt={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",Jt.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Jt.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Jt.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",Jt.INVALID_DATA="invalid_data",Jt.INVALID_CAPTCHA="invalid_captcha",Jt.LINKED_TO_ANOTHER_USER="linked_to_another_user",Jt.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",Jt.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",Jt.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",Jt.USER_EXITED_UPDATE_FLOW="exited_update_flow",Jt.ALLOWLIST_REJECTED="allowlist_rejected",Jt.OAUTH_USER_DENIED="oauth_user_denied",Jt.OAUTH_UNEXPECTED="oauth_unexpected",Jt.UNKNOWN_AUTH_ERROR="unknown_auth_error",Jt.USER_EXITED_AUTH_FLOW="exited_auth_flow",Jt.USER_EXITED_LINK_FLOW="exited_link_flow",Jt.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",Jt.MUST_BE_AUTHENTICATED="must_be_authenticated",Jt.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",Jt.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",Jt.CLIENT_REQUEST_TIMEOUT="client_request_timeout",Jt.INVALID_CREDENTIALS="invalid_credentials",Jt.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",Jt.UNKNOWN_MFA_ERROR="unknown_mfa_error",Jt.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",Jt.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",Jt.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",Jt.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",Jt.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",Jt.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",Jt.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",Jt.TRANSACTION_FAILURE="transaction_failure",Jt.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",Jt.NOT_SUPPORTED="not_supported",Jt.CAPTCHA_TIMEOUT="captcha_timeout",Jt.INVALID_MESSAGE="invalid_message",Jt.UNABLE_TO_SIGN="unable_to_sign",Jt.CAPTCHA_FAILURE="captcha_failure",Jt.CAPTCHA_DISABLED="captcha_disabled",Jt.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",Jt.TOO_MANY_REQUESTS="too_many_requests",Jt.USER_LIMIT_REACHED="max_accounts_reached",Jt.DISALLOWED_LOGIN_METHOD="disallowed_login_method",Jt.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",Jt.PASSKEY_NOT_ALLOWED="passkey_not_allowed",Jt.USER_DOES_NOT_EXIST="user_does_not_exist",Jt.INSUFFICIENT_BALANCE="insufficient_balance",Jt.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",Jt);let xd=class extends xe{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ju=class extends xe{constructor(e="Embedded wallet error",r){super(e,r,"unknown_embedded_wallet_error")}},C4e=class extends xe{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},Ny=class extends xe{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}};
398const WG="/api/v1/sessions",zG="/api/v1/sessions/logout",S4e="/api/v1/sessions/fork",VG="/api/v1/sessions/fork/recover",A4e="/api/v1/siwe/init",T4e="/api/v1/siwe/authenticate",I4e="/api/v1/siwe/link",k4e="/api/v1/siwe/link_smart_wallet",$4e="/api/v1/siwe/unlink",N4e="/api/v1/siwe/transfer",P4e="/api/v1/siws/init",O4e="/api/v1/siws/authenticate",R4e="/api/v1/siws/link",D4e="/api/v1/siws/unlink",M4e="/api/v1/farcaster/init",j4e="/api/v1/farcaster/authenticate",L4e="/api/v1/farcaster/link",F4e="/api/v1/farcaster/status",U4e="/api/v1/farcaster/unlink",B4e="/api/v1/farcaster/transfer",q4e="/api/v1/passwordless/init",W4e="/api/v1/passwordless/authenticate",z4e="/api/v1/passwordless/link",V4e="/api/v1/passwordless/unlink",H4e="/api/v1/passwordless/update",G4e="/api/v1/passwordless/transfer",K4e="/api/v1/passwordless_sms/init",Q4e="/api/v1/passwordless_sms/link",Y4e="/api/v1/passwordless_sms/unlink",Z4e="/api/v1/passwordless_sms/authenticate",X4e="/api/v1/passwordless_sms/update",J4e="/api/v1/passwordless_sms/transfer",HG="/api/v1/oauth/init",GG="/api/v1/oauth/authenticate",KG="/api/v1/oauth/link",e8e="/api/v1/oauth/unlink",t8e="/api/v1/oauth/transfer",r8e="/api/v1/recovery/oauth/init",n8e="/api/v1/recovery/oauth/init_icloud",i8e="/api/v1/recovery/oauth/authenticate",s8e="/api/v1/passkeys/link/init",a8e="/api/v1/passkeys/authenticate/init",o8e="/api/v1/passkeys/register/init",c8e="/api/v1/passkeys/link",l8e="/api/v1/passkeys/authenticate",u8e="/api/v1/passkeys/register",d8e="/api/v1/passkeys/unlink",f8e="/api/v1/telegram/authenticate",h8e="/api/v1/telegram/link",p8e="/api/v1/telegram/unlink",g8e="/api/v1/telegram/transfer",m8e="/api/v1/mfa/passwordless_sms/init",y8e="/api/v1/mfa/passkeys/init",b8e="/api/v1/users/me/accept_terms",QG="/api/v1/analytics_events",v8e="/api/v1/custom_jwt_account/authenticate",w8e="/api/v1/guest/authenticate",E8e="/api/v1/plugins/moonpay_on_ramp/sign",x8e="/api/v1/funding/coinbase_on_ramp/init",_8e="/api/v1/funding/coinbase_on_ramp/status",C8e="/api/v1/wallets/revoke";let YG=class{async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(v8e,{token:this.meta.token})}catch(e){throw $r(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}};function jm(t){return t?{"privy-ui":"t"}:void 0}let ep=class{async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new xe("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(W4e,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $r(e)}}async link(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new xe("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(z4e,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw $r(e)}}async sendCodeEmail({email:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new xe("Auth flow has no API instance");if(e&&(this.meta.email=e),r&&(this.meta.captchaToken=r),!this.meta.email)throw new xe("Email must be set when initialzing authentication.");let i=jm(n);try{return await this.api.post(q4e,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw $r(s)}}constructor({email:e,captchaToken:r,disableSignup:n}){this.meta={email:e,captchaToken:r,disableSignup:n??!1}}},S8e=class extends ep{async link(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new xe("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(H4e,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw $r(e)}}constructor(e,r,n){super({email:r,captchaToken:n}),this.meta={email:r,captchaToken:n,oldAddress:e,disableSignup:!1}}},A8e=class{get(e){return this._cache[e]}put(e,r){r!==void 0?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}},ZG=class{get(e){let r=localStorage.getItem(e);return r===null?void 0:JSON.parse(r)}put(e,r){r!==void 0?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}};function q9(){try{let t="privy:__session_storage__test",e=new ZG;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var Ut=typeof window<"u"&&window.localStorage?new ZG:new A8e;function T8e(){var n;let t=window,e=t.ethereum;if(!e)return[];let r=[];if((n=e.providers)!=null&&n.length)for(let i of e.providers)i&&r.push(i);return r.push(t.ethereum),r}const XG=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,JG=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;
398if(t.isBraveWallet&&!t._events&&!t._state||XG(t)!=="MetaMask")return!1;if(t.providers){for(let r of t.providers)if(!JG(r))return!1}return!0},D3=()=>{var t,e,r,n,i,s;if("phantom"in window){let a=window;if((e=(t=a==null?void 0:a.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((n=(r=a==null?void 0:a.phantom)==null?void 0:r.ethereum)!=null&&n.chainId)||(s=(i=a==null?void 0:a.phantom)==null?void 0:i.solana)!=null&&s.isPhantom)return!0}return!1},eK=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},I8e=(t,e)=>{let r=[],n=[];for(let[i,s]of t.entries())i<e?r.push(s):n.push(s);return[r,n]},tK=t=>!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),k8e=(t,e)=>{let r=t.slice(0),n=[];for(;r.length;)n.push(r.splice(0,e));return n},fs=(t,e=3,r=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0;return e+r+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-r,t.length)}`},w4=(t,e=3,r=4)=>fs(t,e,r,"solana"),rK=t=>new Promise((e=>setTimeout(e,t)));function $8e(t,{interval:e=100,timeout:r=5e3}={}){return new Promise(((n,i)=>{let s,a=0,o=()=>{a>=r?i("Max attempts reached without result"):(s=t(),a+=e,s==null?setTimeout(o,e):n(s))};o()}))}const W9=(t,e={})=>{let r=e.delayMs||150,n=e.maxAttempts||270;return new Promise((async(i,s)=>{var c;let a=!1,o=0;for(;!a&&o<n;){if((c=e.abortSignal)!=null&&c.aborted)return;t().then((l=>{a=!0,i(l)}),((...l)=>{a=!0,s(...l)})),o+=1,await rK(r)}a||s(Error("Exceeded max attempts before resolving function"))}))},nK=(t,e,r={},n={})=>{let i=new URL(e,t);for(let[a,o]of Object.entries(r))o!==void 0&&i.searchParams.set(a,o);let s=Object.entries(n);if(s.length>0){let a=new URLSearchParams;for(let[o,c]of s)a.append(o,c);i.hash=a.toString()}return i.href},N8e=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),zv=t=>typeof t=="string"?t:"0x"+t.toString(16);async function P8e({store:t,walletList:e,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let s=!1,a=window;return new Promise((o=>{function c(){if(s)return;s=!0,window.removeEventListener("ethereum#initialized",c);let l=t.getProviders();console.debug("Detected injected providers:",l.map((d=>d.info)));let u=[];for(let d of l)e.includes("coinbase_wallet")&&d.info.rdns==="com.coinbase.wallet"||n==="solana-only"&&d.info.rdns==="app.phantom"||u.push({type:d.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:d});if(n!=="solana-only")for(let d of T8e()){let f=XG(d);if(!l.some((h=>h.info.name===f))){if(JG(d,!0)&&!u.find((h=>h.type==="metamask"))){u.push({type:"metamask",legacyInjectedProvider:d});continue}if(f==="Phantom"&&!u.find((h=>h.type==="phantom"))){u.push({type:"phantom",legacyInjectedProvider:d});continue}if(f==="Coinbase Wallet"&&!u.find((h=>{var g;return h.type==="coinbase_wallet"&&((g=r.coinbaseWallet)==null?void 0:g.connectionOptions)!=="smartWalletOnly"}))){u.push({type:"coinbase_wallet",legacyInjectedProvider:d});continue}u.find((h=>h.type==="unknown_browser_extension"))||u.push({type:"unknown_browser_extension",legacyInjectedProvider:d})}}o(u)}a.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),i))}))}function Ub(t){return`eip155:${String(Number(t))}`}const O8e=(t,e,r,n)=>{let i=Number(t),s=e.find((a=>a.id===i));if(!s)throw new un(`Unsupported chainId ${t}`,4901);return Zu(s,r,n)},Zu=(t,e,r)=>{var a,o,c;let n,i=t.id,s=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])n=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[s])n=e.rpcUrls[s];else if((a=t.rpcUrls.privy)!=null&&a.http[0]){let l=new URL(t.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",r),n=l.toString()}else n=(o=t.rpcUrls.public)!=null&&o.http[0]?t.rpcUrls.public.http[0]:(c=t.rpcUrls.default)==null?void 0:c.http[0];if(!n)throw new un(`No RPC url found for ${i}`);return n},R8e=(t,e)=>{var i;let r=Number(t),n=e.find((s=>s.id===r));if(!n)throw new un(`Unsupported chainId ${t}`,4901);return(i=n.blockExplorers)==null?void 0:i.default.url},a0=(t,e,r,n)=>{var a,o,c;let i=Number(t),s=e.find((l=>l.id===i));if(!s)throw new un(`Unsupported chainId ${t}`,4901);return new vpe(s.rpcUrls.privyWalletOverride&&s.rpcUrls.privyWalletOverride.http[0]?s.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:(a=s.rpcUrls.privy)!=null&&a.http[0]?{url:s.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:(o=s.rpcUrls.public)!=null&&o.http[0]?s.rpcUrls.public.http[0]:(c=s.rpcUrls.default)==null?void 0:c.http[0])},z9=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=t.types.EIP712Domain??Object.entries(t.domain).map((([n,i])=>{if(i!=null&&typeof n=="string"&&n in e)return{name:n,type:e[n]}})).filter((n=>n!==void 0));return{...t,types:{...t.types,EIP712Domain:r}}};function D8e(t,{min:e,max:r}){return Math.min(Math.max(t,e),r)}const E4=t=>{let e;try{e=new URL(t).hostname}catch{return}for(let[r,n]of Object.entries(V9))if(e.includes(n.hostname))return{walletClientType:r,entry:n}},V9={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb2870
3985e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d1
3987ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
398a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}},bybit_wallet:{id:"15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f",displayName:"Bybit Wallet",hostname:"bybit.com",mobile:{}}};function iK(t){return{name:t.displayName||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function M8e(t,e){let r=iK(e);if(r.deepLink)return oK(r.deepLink,t);if(r.universalLink)return TA(r.universalLink,t);throw new xe(`Unsupported wallet ${e.id}`)}function j8e(t,e){let r=iK(e);if(r.universalLink)return TA(r.universalLink,t)}let sK="WALLETCONNECT_DEEPLINK_CHOICE";function L8e(){try{localStorage.removeItem(sK)}catch{}}function F8e({href:t,name:e}){try{localStorage.setItem(sK,JSON.stringify({href:t,name:e}))}catch{}}function aK(t){return t.startsWith("http://")||t.startsWith("https://")}function oK(t,e){if(aK(t))return TA(t,e);let r=t;return r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function TA(t,e){if(!aK(t))return oK(t,e);let r=t;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function cK(t,e){window.open(t,e,"noreferrer noopener")}let es=class{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}},JP=class{get meta(){return this._meta}async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.channelToken)throw new xe("Auth flow must be initialized first");try{let e=await this.api.post(j4e,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new xe("No response from authentication");return e}catch(e){throw $r(e)}}async link(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(L4e,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw $r(e)}}async _startChannelOnce(){if(!this.api)throw new xe("Auth flow has no API instance");let e=await this.api.post(M4e,{token:this.captchaToken});An.isMobile&&!An.isIOS&&e.connect_uri&&cK(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new xe("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.channelToken)throw new xe("Auth flow must be initialized first");let e=await this.api.get(F4e,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,r=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new es(this._startChannelOnce.bind(this)),this.pollForReady=new es(this._pollForReady.bind(this)),this._meta.disableSignup=r}};const U8e="34357d3c125c2bcf2ce2bc3309d98715",H9="https://auth.privy.io",B8e=2e4,fn=1400,IA=2500,M3=4e3,q8e="1.99.1",a1="privy:token",eO="privy-token",x4="privy:refresh_token",W8e="privy-refresh-token",Bb="privy:pat",tO="privy:id_token",rO="privy-id-token",_4="privy-session",G9="privy:session_transfer_token",K9="privy:caid",lK=t=>`privy:guest:${t}`,j2=t=>`privy:cross-app:${t}`,Vv="privy:state_code",o1="privy:code_verifier",Hv="privy:headless_oauth",Gv="privy:oauth_disable_signup",C4=t=>`privy:wallet:${t}`,nO="privy:connectors",uK="privy:connections",j3=12e4,Lm=1,iO="0x1",kA=3e4,z8e="https://api.moonpay.com/v1",V8e="https://api.moonpay.com/v1",H8e="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",G8e="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",K8e="deprecated";async function Q8e(t){let e=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest("SHA-256",e))}function Q9(t){return crypto.getRandomValues(new Uint8Array(t))}let dK=class{getOrCreateGuestCredential(e){let r=lK(e);if(q9()){if(Ut.get(r))return Ut.get(r);{let n=Pv(Q9(32));return Ut.put(r,n),n}}return Pv(Q9(32))}async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(w8e,{guest_credential:this.meta.guestCredential})}catch(e){throw $r(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}},Ah=class{async initRegisterFlow(e){if(!this.api)throw new xe("Auth flow has no API instance");this.authenticateForRegistration=!0,this.meta.initRegisterResponse=await this.initRegisterOnce.execute(e)}async initAuthenticationFlow(e){if(!this.api)throw new xe("Auth flow has no API instance");this.authenticateForRegistration=!1,this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new xe("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async register(){var r,n;let e=await sc(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new xe("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new xe("WebAuthn is not supported in this browser");this.meta.initRegisterResponse||(this.meta.initRegisterResponse=await this.initRegisterOnce.execute());try{let i=this.meta.initRegisterResponse.options,s=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(u8e,{relying_party:this.meta.initRegisterResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new xe("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):$r(i)}}async authenticate(){var r,n;if(this.authenticateForRegistration)return this.register();let e=await sc(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new xe("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new xe("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let i=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(l8e,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(i)})}catch(i){throw i.name==="NotAllowedError"?new xe("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):$r(i)}}async link(){var r,n;let e=await sc(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new xe("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new xe("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,s=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(c8e,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(s)})}catch(i){throw i.name==="NotAllowedError"?new xe("Passkey request timed out or rejected by user.",void 0,Se.PASSKEY_NOT_ALLOWED):$r(i)}}async _initRegisterOnce(e){if(!this.api)throw new xe("Auth flow has no API instance");let r=jm(e);return await this.api.post(o8e,{token:this.meta.captchaToken},{headers:{...r}})}async _initAuthenticateOnce(e){if(!this.api)throw new xe("Auth flow has no API instance");let r=jm(e);return await this.api.post(a8e,{token:this.meta.captchaToken},{headers:{...r}})}async _initLinkOnce(){if(!this.api)throw new xe("Auth flow has no API instance");return await this.api.post(s8e,{})}_transformInitLinkOptionsToCamelCase(e){var r,n,i,s,a,o,c,l,u;return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map((d=>({type:d.type,alg:d.alg}))),timeout:e.timeout,excludeCredentials:(r=e.exclude_credentials)==null?void 0:r.map((d=>({id:d.id,type:d.type,transports:d.transports}))),authenticatorSelection:{authenticatorAttachment:(n=e.authenticator_selection)==null?void 0:n.authenticator_attachment,requireResidentKey:(i=e.authenticator_selection)==null?void 0:i.require_resident_key,residentKey:(s=e.authenticator_selection)==null?void 0:s.resident_key,userVerification:(a=e.authenticator_selection)==null?void 0:a.user_verification},attestation:e.attestation,extensions:{appid:(o=e.extensions)==null?void 0:o.app_id,credProps:(l=(c=e.extensions)==null?void 0:c.cred_props)==null?void 0:l.rk,hmacCreateSecret:(u=e.extensions)==null?void 0:u.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_i
398d:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var r,n,i,s;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((r=e.allow_credentials)==null?void 0:r.map((a=>({id:a.id,type:a.type,transports:a.transports}))))||[],timeout:e.timeout,extensions:{appid:(n=e.extensions)==null?void 0:n.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(s=e.extensions)==null?void 0:s.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:r}){this.authenticateForRegistration=!1,this.initRegisterOnce=new es(this._initRegisterOnce.bind(this)),this.initAuthenticateOnce=new es(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new es(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:r}}};const Y9=({address:t,chainId:e,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account: 399${t} 400 401By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. 402 403URI: ${window.location.origin} 404Version: 1 405Chain ID: ${e} 406Nonce: ${r} 407Issued At: ${new Date().toISOString()} 408Resources: 409- https://privy.io`;let Kv=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new xe("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $r(e)}}async link(){if(!this.client)throw new xe("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw $r(e)}}async sign(){if(!this.client)throw new xe("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new xe("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new xe("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new xe("SiweFlow has no client instance");let e=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Y9({address:e,chainId:r,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new es(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}};const Y8e=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: 410${t} 411 412${`You are proving you own ${t}.`} 413 414URI: ${window.location.origin} 415Version: 1 416Chain ID: mainnet 417Nonce: ${e} 418Issued At: ${new Date().toISOString()} 419Resources: 420- https://privy.io`;let Z9=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new xe("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $r(e)}}async link(){if(!this.client)throw new xe("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw $r(e)}}async sign(){if(!this.client)throw new xe("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new xe("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new xe("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new xe("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new xe("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Y8e({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1}
420,this.getNonceOnce=new es(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}},tp=class{async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new xe("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Z4e,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $r(e)}}async link(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new xe("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Q4e,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw $r(e)}}async sendSmsCode({phoneNumber:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new xe("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new xe("phone nNumber must be set when initialzing authentication.");let i=jm(n);try{return await this.api.post(K4e,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(s){throw $r(s)}}constructor({phoneNumber:e,captchaToken:r,disableSignup:n}){this.meta={phoneNumber:e,captchaToken:r,disableSignup:n??!1}}},Z8e=class extends tp{async link(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new xe("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(X4e,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw $r(e)}}constructor(e,r,n){super({phoneNumber:r,captchaToken:n}),this.meta={phoneNumber:r,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}};const Fe=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},L2=t=>()=>{throw Error(t.trim())},fK=C.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:Fe,setError:Fe,setExecuting:Fe,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:Fe,reset:Fe,execute:Fe});let L3=class extends Fs{constructor(e,r,n){super(e||"Captcha failed"),this.type="Captcha",r instanceof Error&&(this.cause=r),this.privyErrorCode=n}};const X8e=({children:t,id:e,captchaSiteKey:r,captchaEnabled:n})=>{let i=C.useRef(null),[s,a]=C.useState(),[o,c]=C.useState(),[l,u]=C.useState(!1),d=C.useMemo((()=>n?l||s||o?!l||s||o?s&&!o?{status:"success",token:s}:o?{status:"error",error:o}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[n,s,o,l]);return p.jsx(fK.Provider,{value:{...d,ref:i,enabled:n,siteKey:r,appId:e,setToken:a,setError:c,setExecuting:u,remove(){var f;n&&((f=i.current)==null||f.remove(),u(!1),c(void 0),a(void 0))},reset(){var f;n&&((f=i.current)==null||f.reset(),u(!1),c(void 0),a(void 0))},execute(){var f;n&&(u(!0),(f=i.current)==null||f.execute())},async waitForResult(){if(!n)return"";try{return await $8e((()=>{var f;return(f=i.current)==null?void 0:f.getResponse()}),{interval:200,timeout:2e4})}catch{throw new L3("Captcha failed",null,Se.CAPTCHA_TIMEOUT)}}},children:t})},Vs=()=>C.useContext(fK);let hg=class{async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(f8e,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $r(e)}}async link(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(h8e,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw $r(e)}}constructor(e,r=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=r}};
420function sO(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Se.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof L3&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function J8e(){let t;return(t=(function(){let e=new URLSearchParams(window.location.search),r=Number(e.get("id")||""),n=e.get("hash"),i=Number(e.get("auth_date")||""),s=e.get("first_name");if(r&&s&&i&&n)return Object.fromEntries(e.entries())})())?(aO(),{flowType:"login-url",authData:t}):(t=(function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let r=hK(e.replace("#tgWebAppData=","")),{user:n,auth_date:i,hash:s}=r;return n&&i&&s?r:void 0})())?(aO(),{flowType:"web-app",authData:t}):void 0}function hK(t){return Object.fromEntries(decodeURIComponent(t).split("&").map((e=>e.split("=").map(decodeURIComponent))))}function aO(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}let Uh=class pK{static parse(e){try{return new pK(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return XN(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=XN(e)}},eEe=class gK extends Uh{static parse(e){try{return new gK(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}};function Kt(t){return t?new Date(1e3*t):null}function ss(t,e){return t.slice().sort(((r,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime())).find((r=>r.type===e))}const Is=t=>(t==null?void 0:t.linkedAccounts.find((e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0)))||null,qb=t=>((t==null?void 0:t.linkedAccounts)??[]).filter((e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum")),tEe=t=>qb(t).reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),mK=(t,e)=>((t==null?void 0:t.linkedAccounts)??[]).filter((r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType===e)),Wb=t=>((t==null?void 0:t.linkedAccounts)??[]).filter((e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana")),Jo=t=>(t==null?void 0:t.linkedAccounts.find((e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0)))||null,rEe=t=>Wb(t).reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),X9=t=>(t==null?void 0:t.linkedAccounts.find((e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum")))||null,zb=t=>(t==null?void 0:t.linkedAccounts.find((e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana")))||null,Qv=(t,e)=>(t==null?void 0:t.linkedAccounts.find((r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===e)))||null,Ts=t=>Is(t)??Jo(t),_n=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-ver
420ifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},nEe=t=>{let e=Ts(t);if(!e)throw Error("Failed to find primary wallet");return _n(e)},F2=(t,e)=>{let r=mK(t,"ethereum").find((n=>jr(n.address)===jr(e)));return{signingWallet:r,rootWallet:r?r.imported?r:Is(t):void 0}},Vb=(t,e)=>{let r=mK(t,"solana").find((n=>n.address===e));return r?r.imported||r.walletIndex===0?{signingWallet:r,rootWallet:r}:{signingWallet:r,rootWallet:Jo(t)}:{}},Sl=(t,e)=>{var r;return!(Is(t)||Jo(t)||e!=="all-users"&&(e!=="users-without-wallets"||(r=(n=>n.linkedAccounts.filter((i=>i.type==="wallet")))(t))!=null&&r.length))};function Ki(t){if(!t)return null;let e=(function(E){let v=[];for(let w of E){let x=w.type;switch(w.type){case"wallet":let _={address:w.address,type:w.type,imported:w.imported,delegated:w.delegated,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at),chainType:w.chain_type,chainId:w.chain_id,walletClient:w.wallet_client_type==="privy"?"privy":"unknown",walletClientType:w.wallet_client_type,connectorType:w.connector_type,recoveryMethod:w.recovery_method,walletIndex:w.wallet_index};v.push(_);break;case"smart_wallet":let S={address:w.address,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at),smartWalletType:w.smart_wallet_type};v.push(S);break;case"cross_app":let A={type:w.type,subject:w.subject,embeddedWallets:w.embedded_wallets,smartWallets:w.smart_wallets,providerApp:{id:w.provider_app_id},verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(A);break;case"email":let I={address:w.address,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(I);break;case"phone":let $={number:w.phoneNumber,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push($);break;case"google_oauth":let P={subject:w.subject,email:w.email,name:w.name,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(P);break;case"spotify_oauth":let j={subject:w.subject,email:w.email,name:w.name,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(j);break;case"instagram_oauth":let L={subject:w.subject,username:w.username,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(L);break;case"twitter_oauth":let B={subject:w.subject,username:w.username,name:w.name,type:w.type,profilePictureUrl:w.profile_picture_url,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(B);break;case"discord_oauth":let k={subject:w.subject,username:w.username,email:w.email,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(k);break;case"github_oauth":let D={subject:w.subject,username:w.username,name:w.name,email:w.email,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(D);break;case"tiktok_oauth":let q={subject:w.subject,username:w.username,name:w.name,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(q);break;case"linkedin_oauth":let U={subject:w.subject,name:w.name,email:w.email,vanityName:w.vanity_name,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(U);break;case"apple_oauth":let W={subject:w.subject,email:w.email,type:w.type,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(W);break;case"custom_auth":v.push({type:w.type,customUserId:w.custom_user_id,verifiedAt:Kt(w.verified_at),first
420VerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)});break;case"farcaster":let V={type:w.type,fid:w.fid,ownerAddress:w.owner_address,displayName:w.display_name,username:w.username,bio:w.bio,pfp:w.profile_picture_url,url:w.homepage_url,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at),signerPublicKey:w.signer_public_key};v.push(V);break;case"passkey":let Y={type:w.type,enrolledInMfa:w.enrolled_in_mfa,credentialId:w.credential_id,authenticatorName:w.authenticator_name,createdWithDevice:w.created_with_device,createdWithOs:w.created_with_os,createdWithBrowser:w.created_with_browser,verifiedAt:Kt(w.verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(Y);break;case"telegram":let K={type:w.type,telegramUserId:w.telegram_user_id,firstName:w.first_name,lastName:w.last_name,username:w.username,photoUrl:w.photo_url,verifiedAt:Kt(w.first_verified_at),firstVerifiedAt:Kt(w.first_verified_at),latestVerifiedAt:Kt(w.latest_verified_at)};v.push(K);break;default:console.warn(`Unrecognized account type: ${x}. Please consider upgrading the Privy SDK.`)}}return v})(t.linked_accounts),r=ss(e,"wallet"),n=ss(e,"smart_wallet"),i=ss(e,"email"),s=ss(e,"phone"),a=ss(e,"google_oauth"),o=ss(e,"twitter_oauth"),c=ss(e,"discord_oauth"),l=ss(e,"github_oauth"),u=ss(e,"spotify_oauth"),d=ss(e,"instagram_oauth"),f=ss(e,"tiktok_oauth"),h=ss(e,"linkedin_oauth"),g=ss(e,"apple_oauth"),m=ss(e,"farcaster"),y=ss(e,"telegram"),b=t.mfa_methods.map((({type:E,verified_at:v})=>({type:E,verifiedAt:Kt(v)})));return{id:t.id,createdAt:Kt(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:s&&{number:s==null?void 0:s.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:a&&{subject:a.subject,email:a.email,name:a.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:c&&{subject:c.subject,username:c.username,email:c.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:h&&{subject:h.subject,name:h.name,email:h.email,vanityName:h.vanityName},apple:g&&{subject:g.subject,email:g.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:y&&{telegramUserId:y.telegramUserId,firstName:y.firstName,lastName:y.lastName,username:y.username,photoUrl:y.photoUrl},delegatedWallets:[],mfaMethods:b.map((E=>E.type)),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}var S4={},pg={},gg={},oO;function iEe(){if(oO)return gg;oO=1,Object.defineProperty(gg,"__esModule",{value:!0}),gg.walletLogo=void 0;const t=(e,r)=>{let n;switch(e){case"standard":return n=r,`data:image/svg+xml,%3Csvg width='${r}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=r,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${r}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
420V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
420h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*r).toFixed(2),`data:image/svg+xml,%3Csvg width='${r}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return n=r,`data:image/svg+xml,%3Csvg width='${r}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};return gg.walletLogo=t,gg}var $c={},A4={},_d={},cO;function F3(){return cO||(cO=1,Object.defineProperty(_d,"__esModule",{value:!0}),_d.errorValues=_d.standardErrorCodes=void 0,_d.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},_d.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}),_d}var mg={},T4={},lO;function yK(){return lO||(lO=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=F3(),r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(f,h=r){if(f&&Number.isInteger(f)){const g=f.toString();if(u(e.errorValues,g))return e.errorValues[g].message;if(c(f))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return h}t.getMessageFromCode=n;function i(f){if(!Number.isInteger(f))return!1;const h=f.toString();return!!(e.errorValues[h]||c(f))}t.isValidCode=i;function s(f){var h;if(typeof f=="number")return f;if(a(f))return(h=f.code)!==null&&h!==void 0?h:f.errorCode}t.getErrorCode=s;function a(f){return typeof f=="object"&&f!==null&&(typeof f.code=="number"||typeof f.errorCode=="number")}function o(f,{shouldIncludeStack:h=!1}={}){const g={};if(f&&typeof f=="object"&&!Array.isArray(f)&&u(f,"code")&&i(f.code)){const m=f;g.code=m.code,m.message&&typeof m.message=="string"?(g.message=m.message,u(m,"data")&&(g.data=m.data)):(g.message=n(g.code),g.data={originalError:l(f)})}else g.code=e.standardErrorCodes.rpc.internal,g.message=d(f,"message")?f.message:r,g.data={originalError:l(f)};return h&&(g.stack=d(f,"stack")?f.stack:void 0),g}t.serialize=o;function c(f){return f>=-32099&&f<=-32e3}function l(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function u(f,h){return Object.prototype.hasOwnProperty.call(f,h)}function d(f,h){return typeof f=="object"&&f!==null&&h in f&&typeof f[h]=="string"}})(T4)),T4}var uO;function sEe(){if(uO)return mg;
420uO=1,Object.defineProperty(mg,"__esModule",{value:!0}),mg.standardErrors=void 0;const t=F3(),e=yK();mg.standardErrors={rpc:{parse:c=>r(t.standardErrorCodes.rpc.parse,c),invalidRequest:c=>r(t.standardErrorCodes.rpc.invalidRequest,c),invalidParams:c=>r(t.standardErrorCodes.rpc.invalidParams,c),methodNotFound:c=>r(t.standardErrorCodes.rpc.methodNotFound,c),internal:c=>r(t.standardErrorCodes.rpc.internal,c),server:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:l}=c;if(!Number.isInteger(l)||l>-32005||l<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return r(l,c)},invalidInput:c=>r(t.standardErrorCodes.rpc.invalidInput,c),resourceNotFound:c=>r(t.standardErrorCodes.rpc.resourceNotFound,c),resourceUnavailable:c=>r(t.standardErrorCodes.rpc.resourceUnavailable,c),transactionRejected:c=>r(t.standardErrorCodes.rpc.transactionRejected,c),methodNotSupported:c=>r(t.standardErrorCodes.rpc.methodNotSupported,c),limitExceeded:c=>r(t.standardErrorCodes.rpc.limitExceeded,c)},provider:{userRejectedRequest:c=>n(t.standardErrorCodes.provider.userRejectedRequest,c),unauthorized:c=>n(t.standardErrorCodes.provider.unauthorized,c),unsupportedMethod:c=>n(t.standardErrorCodes.provider.unsupportedMethod,c),disconnected:c=>n(t.standardErrorCodes.provider.disconnected,c),chainDisconnected:c=>n(t.standardErrorCodes.provider.chainDisconnected,c),unsupportedChain:c=>n(t.standardErrorCodes.provider.unsupportedChain,c),custom:c=>{if(!c||typeof c!="object"||Array.isArray(c))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:l,message:u,data:d}=c;if(!u||typeof u!="string")throw new Error('"message" must be a nonempty string');return new a(l,u,d)}}};function r(c,l){const[u,d]=i(l);return new s(c,u||(0,e.getMessageFromCode)(c),d)}function n(c,l){const[u,d]=i(l);return new a(c,u||(0,e.getMessageFromCode)(c),d)}function i(c){if(c){if(typeof c=="string")return[c];if(typeof c=="object"&&!Array.isArray(c)){const{message:l,data:u}=c;
420if(l&&typeof l!="string")throw new Error("Must specify string message.");return[l||void 0,u]}}return[]}class s extends Error{constructor(l,u,d){if(!Number.isInteger(l))throw new Error('"code" must be an integer.');if(!u||typeof u!="string")throw new Error('"message" must be a nonempty string.');super(u),this.code=l,d!==void 0&&(this.data=d)}}class a extends s{constructor(l,u,d){if(!o(l))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(l,u,d)}}function o(c){return Number.isInteger(c)&&c>=1e3&&c<=4999}return mg}var dO;function Fl(){return dO||(dO=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=void 0;var e=F3();Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var r=sEe();Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})(A4)),A4}var yg={},bg={},fO;function $A(){if(fO)return bg;fO=1,Object.defineProperty(bg,"__esModule",{value:!0}),bg.isErrorResponse=void 0;function t(e){return e.errorMessage!==void 0}return bg.isErrorResponse=t,bg}var vg={},hO;function U3(){return hO||(hO=1,Object.defineProperty(vg,"__esModule",{value:!0}),vg.LIB_VERSION=void 0,vg.LIB_VERSION="4.0.3"),vg}var pO;function aEe(){if(pO)return yg;pO=1,Object.defineProperty(yg,"__esModule",{value:!0}),yg.serializeError=void 0;const t=$A(),e=U3(),r=F3(),n=yK();function i(o,c){const l=(0,n.serialize)(s(o),{shouldIncludeStack:!0}),u=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");u.searchParams.set("version",e.LIB_VERSION),u.searchParams.set("code",l.code.toString());const d=a(l.data,c);return d&&u.searchParams.set("method",d),u.searchParams.set("message",l.message),Object.assign(Object.assign({},l),{docUrl:u.href})}yg.serializeError=i;function s(o){return typeof o=="string"?{message:o,code:r.standardErrorCodes.rpc.internal}:(0,t.isErrorResponse)(o)?Object.assign(Object.assign({},o),{message:o.errorMessage,code:o.errorCode,data:{method:o.method}}):o}function a(o,c){const l=o==null?void 0:o.method;if(l)return l;if(c!==void 0){if(typeof c=="string")return c;if(Array.isArray(c)){if(c.length>0)return c[0].method}else return c.method}}return yg}var as={},gO;function NA(){if(gO)return as;gO=1,Object.defineProperty(as,"__esModule",{value:!0}),as.RegExpString=as.IntNumber=as.BigIntString=as.AddressString=as.HexString=as.OpaqueType=void 0;function t(){return r=>r}as.OpaqueType=t,as.HexString=t(),as.AddressString=t(),as.BigIntString=t();function e(r){return Math.floor(r)}return as.IntNumber=e,as.RegExpString=t(),as}var tr={},mO;function Ul(){if(mO)return tr;mO=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.areAddressArraysEqual=tr.getFavicon=tr.range=tr.isBigNumber=tr.ensureParsedJSONObject=tr.ensureBigInt=tr.ensureRegExpString=tr.ensureIntNumber=tr.ensureBuffer=tr.ensureAddressString=tr.ensureEvenLengthHexString=tr.ensureHexString=tr.isHexString=tr.prepend0x=tr.strip0x=tr.has0xPrefix=tr.hexStringFromIntNumber=tr.intNumberFromHexString=tr.bigIntStringFromBigInt=tr.hexStringFromBuffer=tr.hexStringToUint8Array=tr.uint8ArrayToHex=tr.randomBytesHex=void 0;const t=Fl(),e=NA(),r=/^[0-9]*$/,n=/^[a-f0-9]*$/;function i(P){return s(crypto.getRandomValues(new Uint8Array(P)))}tr.randomBytesHex=i;function s(P){return[...P].map(j=>j.toString(16).padStart(2,"0")).join("")}tr.uint8ArrayToHex=s;function a(P){return new Uint8Array(P.match(/.{1,2}/g).map(j=>parseInt(j,16)))}tr.hexStringToUint8Array=a;function o(P,j=!1){const L=P.toString("hex");return(0,e.HexString)(j?`0x${L}`:L)}tr.hexStringFromBuffer=o;function c(P){return(0,e.BigIntString)(P.toString(10))}tr.bigIntStringFromBigInt=c;function l(P){return(0,e.IntNumber)(Number(BigInt(y(P,!0))))}tr.intNumberFromHexString=l;function u(P){return(0,e.HexString)(`0x${BigInt(P).toString(16)}`)}tr.hexStringFromIntNumber=u;function d(P){return P.startsWith("0x")||P.startsWith("0X")}tr.has0xPrefix=d;function f(P){return d(P)?P.slice(2):P}tr.strip0x=f;function h(P){return d(P)?`0x${P.slice(2)}`:`0x${P}`}tr.prepend0x=h;function g(P){if(typeof P!="string")return!1;const j=f(P).toLowerCase();return n.test(j)}tr.isHexString=g;function m(P,j=!1){if(typeof P=="string"){const L=f(P).toLowerCase();if(n.test(L))return(0,e.HexString)(j?`0x${L}`:L)}throw t.standardErrors.rpc.invalidParams(`"${String(P)}" is not a hexadecimal string`)}tr.ensureHexString=m;function y(P,j=!1){let L=m(P,!1);return L.length%2===1&&(L=(0,e.HexString)(`0${L}`)),j?(0,e.HexString)(`0x${L}`):L}tr.ensureEvenLengthHexString=y;function b(P){if(typeof P=="string"){const j=f(P).toLowerCase();if(g(j)&&j.length===40)return(0,e.AddressString)(h(j))}throw t.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(P)}`)}tr.ensureAddressString=b;function E(P){if(Buffer.isBuffer(P))return P;if(typeof P=="string"){if(g(P)){const j=y(P,!1);return Buffer.from(j,"hex")}return Buffer.from(P,"utf8")}throw t.standardErrors.rpc.invalidParams(`Not binary data: ${String(P)}`)}tr.ensureBuffer=E;function v(P){if(typeof P=="number"&&Number.isInteger(P))return(0,e.IntNumber)(P);if(typeof P=="string"){if(r.test(P))return(0,e.IntNumber)(Number(P));if(g(P))return(0,e.IntNumber)(Number(BigInt(y(P,!0))))}throw t.standardErrors.rpc.invalidParams(`Not an integer: ${String(P)}`)}tr.ensureIntNumber=v;function w(P){if(P instanceof RegExp)return(0,e.RegExpString)(P.toString());throw t.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(P)}`)}tr.ensureRegExpString=w;function x(P){if(P!==null&&(typeof P=="bigint"||S(P)))return BigInt(P.toString(10));if(typeof P=="number")return BigInt(v(P));if(typeof P=="string"){if(r.test(P))return BigInt(P);if(g(P))return BigInt(y(P,!0))}throw t.standardErrors.rpc.invalidParams(`Not an integer: ${String(P)}`)}tr.ensureBigInt=x;function _(P){if(typeof P=="string")return JSON.parse(P);if(typeof P=="object")return P;throw t.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(P)}`)}tr.ensureParsedJSONObject=_;function S(P){if(P==null||typeof P.constructor!="function")return!1;const{constructor:j}=P;return typeof j.config=="function"&&typeof j.EUCLID=="number"}tr.isBigNumber=S;function A(P,j){return Array.from({length:j-P},(L,B)=>P+B)}tr.range=A;function I(){const P=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:j,host:L}=document.location,B=P?P.getAttribute("href"):null;return!B||B.startsWith("javascript:")||B.startsWith("vbscript:")?null:B.startsWith("http://")||B.startsWith("https://")||B.startsWith("data:")?B:B.startsWith("//")?j+B:`${j}//${L}${B}`}tr.getFavicon=I;function $(P,j){return P.length===j.length&&P.every((L,B)=>L===j[B])}return tr.areAddressArraysEqual=$,tr}var Ga={},wg={},Eg={},ri={},yO;function bK(){if(yO)return ri;yO=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.decryptContent=ri.encryptContent=ri.importKeyFromHexString=ri.export
420KeyToHexString=ri.decrypt=ri.encrypt=ri.deriveSharedSecret=ri.generateKeyPair=void 0;const t=Ul();async function e(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}ri.generateKeyPair=e;async function r(u,d){return crypto.subtle.deriveKey({name:"ECDH",public:d},u,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}ri.deriveSharedSecret=r;async function n(u,d){const f=crypto.getRandomValues(new Uint8Array(12)),h=await crypto.subtle.encrypt({name:"AES-GCM",iv:f},u,new TextEncoder().encode(d));return{iv:f,cipherText:h}}ri.encrypt=n;async function i(u,{iv:d,cipherText:f}){const h=await crypto.subtle.decrypt({name:"AES-GCM",iv:d},u,f);return new TextDecoder().decode(h)}ri.decrypt=i;function s(u){switch(u){case"public":return"spki";case"private":return"pkcs8"}}async function a(u,d){const f=s(u),h=await crypto.subtle.exportKey(f,d);return(0,t.uint8ArrayToHex)(new Uint8Array(h))}ri.exportKeyToHexString=a;async function o(u,d){const f=s(u),h=(0,t.hexStringToUint8Array)(d).buffer;return await crypto.subtle.importKey(f,h,{name:"ECDH",namedCurve:"P-256"},!0,u==="private"?["deriveKey"]:[])}ri.importKeyFromHexString=o;async function c(u,d){const f=JSON.stringify(u,(h,g)=>{if(!(g instanceof Error))return g;const m=g;return Object.assign(Object.assign({},m.code?{code:m.code}:{}),{message:m.message})});return n(d,f)}ri.encryptContent=c;async function l(u,d){return JSON.parse(await i(d,u))}return ri.decryptContent=l,ri}var xg={},bO;function th(){if(bO)return xg;bO=1,Object.defineProperty(xg,"__esModule",{value:!0}),xg.ScopedLocalStorage=void 0;let t=class J9{constructor(r,n){this.scope=r,this.module=n}setItem(r,n){localStorage.setItem(this.scopedKey(r),n)}getItem(r){return localStorage.getItem(this.scopedKey(r))}removeItem(r){localStorage.removeItem(this.scopedKey(r))}clear(){const r=this.scopedKey(""),n=[];for(let i=0;i<localStorage.length;i++){const s=localStorage.key(i);typeof s=="string"&&s.startsWith(r)&&n.push(s)}n.forEach(i=>localStorage.removeItem(i))}scopedKey(r){return`-${this.scope}${this.module?`:${this.module}`:""}:${r}`}static clearAll(){new J9("CBWSDK").clear(),new J9("walletlink").clear()}};return xg.ScopedLocalStorage=t,xg}var vO;function oEe(){if(vO)return Eg;vO=1,Object.defineProperty(Eg,"__esModule",{value:!0}),Eg.SCWKeyManager=void 0;const t=bK(),e=th(),r={storageKey:"ownPrivateKey",keyType:"private"},n={storageKey:"ownPublicKey",keyType:"public"},i={storageKey:"peerPublicKey",keyType:"public"};let s=class{constructor(){this.storage=new e.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(o){this.sharedSecret=null,this.peerPublicKey=o,await this.storeKey(i,o),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(n.storageKey),this.storage.removeItem(r.storageKey),this.storage.removeItem(i.storageKey)}async generateKeyPair(){const o=await(0,t.generateKeyPair)();this.ownPrivateKey=o.privateKey,this.ownPublicKey=o.publicKey,await this.storeKey(r,o.privateKey),await this.storeKey(n,o.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(r)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(n)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(i)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,t.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(o){const c=this.storage.getItem(o.storageKey);return c?(0,t.importKeyFromHexString)(o.keyType,c):null}async storeKey(o,c){const l=await(0,t.exportKeyToHexString)(o.keyType,c);this.storage.setItem(o.storageKey,l)}};
420return Eg.SCWKeyManager=s,Eg}var _g={},wO;function cEe(){if(wO)return _g;wO=1,Object.defineProperty(_g,"__esModule",{value:!0}),_g.SCWStateManager=void 0;const t=th(),e="accounts",r="activeChain",n="availableChains",i="walletCapabilities";let s=class{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(o){var c,l;this.storage=new t.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=o.updateListener,this.availableChains=this.loadItemFromStorage(n),this._walletCapabilities=this.loadItemFromStorage(i);const u=this.loadItemFromStorage(e),d=this.loadItemFromStorage(r);u&&this.updateListener.onAccountsUpdate({accounts:u,source:"storage"}),d&&this.updateListener.onChainUpdate({chain:d,source:"storage"}),this._accounts=u||[],this._activeChain=d||{id:(l=(c=o.appChainIds)===null||c===void 0?void 0:c[0])!==null&&l!==void 0?l:1}}updateAccounts(o){this._accounts=o,this.storeItemToStorage(e,o),this.updateListener.onAccountsUpdate({accounts:o,source:"wallet"})}switchChain(o){var c;const l=(c=this.availableChains)===null||c===void 0?void 0:c.find(u=>u.id===o);return l?(l===this._activeChain||(this._activeChain=l,this.storeItemToStorage(r,l),this.updateListener.onChainUpdate({chain:l,source:"wallet"})),!0):!1}updateAvailableChains(o){if(!o||Object.keys(o).length===0)return;const c=Object.entries(o).map(([l,u])=>({id:Number(l),rpcUrl:u}));this.availableChains=c,this.storeItemToStorage(n,c),this.switchChain(this._activeChain.id)}updateWalletCapabilities(o){this._walletCapabilities=o,this.storeItemToStorage(i,o)}storeItemToStorage(o,c){this.storage.setItem(o,JSON.stringify(c))}loadItemFromStorage(o){const c=this.storage.getItem(o);return c?JSON.parse(c):void 0}clear(){this.storage.clear()}};return _g.SCWStateManager=s,_g}var EO;function lEe(){if(EO)return wg;EO=1,Object.defineProperty(wg,"__esModule",{value:!0}),wg.SCWSigner=void 0;const t=oEe(),e=cEe(),r=Fl(),n=Ul(),i=bK();let s=class{constructor(o){this.metadata=o.metadata,this.communicator=o.communicator,this.keyManager=new t.SCWKeyManager,this.stateManager=new e.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:o.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const o=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),c=await this.communicator.postRequestAndWaitForResponse(o);if("failure"in c.content)throw c.content.failure;const l=await(0,i.importKeyFromHexString)("public",c.sender);await this.keyManager.setPeerPublicKey(l);const u=await this.decryptResponseMessage(c);this.updateInternalState({method:"eth_requestAccounts"},u);const d=u.result;if("error"in d)throw d.error;return this.stateManager.accounts}async request(o){const c=this.tryLocalHandling(o);if(c!==void 0){if(c instanceof Error)throw c;return c}await this.communicator.waitForPopupLoaded();const l=await this.sendEncryptedRequest(o),u=await this.decryptResponseMessage(l);this.updateInternalState(o,u);const d=u.result;if("error"in d)throw d.error;return d.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(o){var c;switch(o.method){case"wallet_switchEthereumChain":{const l=o.params;if(!l||!(!((c=l[0])===null||c===void 0)&&c.chainId))throw r.standardErrors.rpc.invalidParams();const u=(0,n.ensureIntNumber)(l[0].chainId);return this.stateManager.switchChain(u)?null:void 0}case"wallet_getCapabilities":{const l=this.stateManager.walletCapabilities;if(!l)throw r.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return l}default:return}}async sendEncryptedRequest(o){const c=await this.keyManager.getSharedSecret();if(!c)throw r.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const l=await(0,i.encryptContent)({action:o,chainId:this.stateManager.activeChain.id},c),u=await this.createRequestMessage({encrypted:l});return this.communicator.postRequestAndWaitForResponse(u)}
420async createRequestMessage(o){const c=await(0,i.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:c,content:o,timestamp:new Date}}async decryptResponseMessage(o){const c=o.content;if("failure"in c)throw c.failure;const l=await this.keyManager.getSharedSecret();if(!l)throw r.standardErrors.provider.unauthorized("Invalid session");return(0,i.decryptContent)(c.encrypted,l)}updateInternalState(o,c){var l,u;const d=(l=c.data)===null||l===void 0?void 0:l.chains;d&&this.stateManager.updateAvailableChains(d);const f=(u=c.data)===null||u===void 0?void 0:u.capabilities;f&&this.stateManager.updateWalletCapabilities(f);const h=c.result;if(!("error"in h))switch(o.method){case"eth_requestAccounts":{const g=h.value;this.stateManager.updateAccounts(g);break}case"wallet_switchEthereumChain":{if(h.value!==null)return;const g=o.params,m=(0,n.ensureIntNumber)(g[0].chainId);this.stateManager.switchChain(m);break}}}};return wg.SCWSigner=s,wg}var Cd={},U2={exports:{}},B2={exports:{}},xO;function PA(){if(xO)return B2.exports;xO=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(x,_,S){return Function.prototype.apply.call(x,_,S)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:r=function(x){return Object.getOwnPropertyNames(x)};function n(w){console&&console.warn&&console.warn(w)}var i=Number.isNaN||function(x){return x!==x};function s(){s.init.call(this)}B2.exports=s,B2.exports.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(w){if(typeof w!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof w)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
vendor: 5,741 bytes, line 420
420,set:function(w){if(typeof w!="number"||w<0||i(w))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+w+".");a=w}}),s.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},s.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||i(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function c(w){return w._maxListeners===void 0?s.defaultMaxListeners:w._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(x){for(var _=[],S=1;S<arguments.length;S++)_.push(arguments[S]);var A=x==="error",I=this._events;if(I!==void 0)A=A&&I.error===void 0;else if(!A)return!1;if(A){var $;if(_.length>0&&($=_[0]),$ instanceof Error)throw $;var P=new Error("Unhandled error."+($?" ("+$.message+")":""));throw P.context=$,P}var j=I[x];if(j===void 0)return!1;if(typeof j=="function")e(j,this,_);else for(var L=j.length,B=g(j,L),S=0;S<L;++S)e(B[S],this,_);return!0};function l(w,x,_,S){var A,I,$;if(o(_),I=w._events,I===void 0?(I=w._events=Object.create(null),w._eventsCount=0):(I.newListener!==void 0&&(w.emit("newListener",x,_.listener?_.listener:_),I=w._events),$=I[x]),$===void 0)$=I[x]=_,++w._eventsCount;else if(typeof $=="function"?$=I[x]=S?[_,$]:[$,_]:S?$.unshift(_):$.push(_),A=c(w),A>0&&$.length>A&&!$.warned){$.warned=!0;var P=new Error("Possible EventEmitter memory leak detected. "+$.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");P.name="MaxListenersExceededWarning",P.emitter=w,P.type=x,P.count=$.length,n(P)}return w}s.prototype.addListener=function(x,_){return l(this,x,_,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(x,_){return l(this,x,_,!0)};function u(){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 d(w,x,_){var S={fired:!1,wrapFn:void 0,target:w,type:x,listener:_},A=u.bind(S);return A.listener=_,S.wrapFn=A,A}s.prototype.once=function(x,_){return o(_),this.on(x,d(this,x,_)),this},s.prototype.prependOnceListener=function(x,_){return o(_),this.prependListener(x,d(this,x,_)),this},s.prototype.removeListener=function(x,_){var S,A,I,$,P;if(o(_),A=this._events,A===void 0)return this;if(S=A[x],S===void 0)return this;if(S===_||S.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete A[x],A.removeListener&&this.emit("removeListener",x,S.listener||_));else if(typeof S!="function"){for(I=-1,$=S.length-1;$>=0;$--)if(S[$]===_||S[$].listener===_){P=S[$].listener,I=$;break}if(I<0)return this;I===0?S.shift():m(S,I),S.length===1&&(A[x]=S[0]),A.removeListener!==void 0&&this.emit("removeListener",x,P||_)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(x){var _,S,A;if(S=this._events,S===void 0)return this;if(S.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):S[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete S[x]),this;if(arguments.length===0){var I=Object.keys(S),$;for(A=0;A<I.length;++A)$=I[A],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(_=S[x],typeof _=="function")this.removeListener(x,_);else if(_!==void 0)for(A=_.length-1;A>=0;A--)this.removeListener(x,_[A]);return this};function f(w,x,_){var S=w._events;if(S===void 0)return[];var A=S[x];return A===void 0?[]:typeof A=="function"?_?[A.listener||A]:[A]:_?y(A):g(A,A.length)}s.prototype.listeners=function(x){return f(this,x,!0)},s.prototype.rawListeners=function(x){return f(this,x,!1)},s.listenerCount=function(w,x){return typeof w.listenerCount=="function"?w.listenerCount(x):h.call(w,x)},s.prototype.listenerCount=h;function h(w){var x=this._events;if(x!==void 0){var _=x[w];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function g(w,x){for(var _=new Array(x),S=0;S<x;++S)_[S]=w[S];return _}function m(w,x){for(;x+1<w.length;x++)w[x]=w[x+1];w.pop()}function y(w){for(var x=new Array(w.length),_=0;_<x.length;++_)x[_]=w[_].listener||w[_];return x}function b(w,x){return new Promise(function(_,S){function A($){w.removeListener(x,I),S($)}function I(){typeof w.removeListener=="function"&&w.removeListener("error",A),_([].slice.call(arguments))}v(w,x,I,{once:!0}),x!=="error"&&E(w,A,{once:!0})})}function E(w,x,_){typeof w.on=="function"&&v(w,"error",x,_)}function v(w,x,_,S){if(typeof w.on=="function")S.once?w.once(x,_):w.on(x,_);else if(typeof w.addEventListener=="function")w.addEventListener(x,function A(I){S.once&&w.removeEventListener(x,A),_(I)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof w)}return B2.exports}var I4,_O;function vK(){return _O||(_O=1,I4=PA().EventEmitter),I4}var k4={},q2={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var CO;function uEe(){return CO||(CO=1,q2.read=function(t,e,r,n,i){var s,a,o=i*8-n-1,c=(1<<o)-1,l=c>>1,u=-7,d=r?i-1:0,f=r?-1:1,h=t[e+d];for(d+=f,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+d],d+=f,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=a*256+t[e+d],d+=f,u-=8);if(s===0)s=1-l;else{if(s===c)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-l}return(h?-1:1)*a*Math.pow(2,s-n)}
vendor: 22,875 bytes, lines 420-425
420,q2.write=function(t,e,r,n,i,s){var a,o,c,l=s*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:s-1,g=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?e+=f/c:e+=f*Math.pow(2,1-d),e*c>=2&&(a++,c/=2),a+d>=u?(o=0,a=u):a+d>=1?(o=(e*c-1)*Math.pow(2,i),a=a+d):(o=e*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;t[r+h]=o&255,h+=g,o/=256,i-=8);for(a=a<<i|o,l+=i;l>0;t[r+h]=a&255,h+=g,a/=256,l-=8);t[r+h-g]|=m*128}),q2}/*! 421 * The buffer module from node.js, for the browser. 422 * 423 * @author Feross Aboukhadijeh <https://feross.org> 424 * @license MIT 425 */var SO;function B3(){return SO||(SO=1,(function(t){const e=ane(),r=uEe(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=E,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const O=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(O,T),O.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(O){if(O>i)throw new RangeError('The value "'+O+'" is invalid for option "size"');const T=new Uint8Array(O);return Object.setPrototypeOf(T,o.prototype),T}function o(O,T,N){if(typeof O=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(O)}return c(O,T,N)}o.poolSize=8192;function c(O,T,N){if(typeof O=="string")return f(O,T);if(ArrayBuffer.isView(O))return g(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(Pe(O,ArrayBuffer)||O&&Pe(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pe(O,SharedArrayBuffer)||O&&Pe(O.buffer,SharedArrayBuffer)))return m(O,T,N);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const G=O.valueOf&&O.valueOf();if(G!=null&&G!==O)return o.from(G,T,N);const te=y(O);if(te)return te;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return o.from(O[Symbol.toPrimitive]("string"),T,N);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}o.from=function(O,T,N){return c(O,T,N)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function u(O,T,N){return l(O),O<=0?a(O):T!==void 0?typeof N=="string"?a(O).fill(T,N):a(O).fill(T):a(O)}o.alloc=function(O,T,N){return u(O,T,N)};function d(O){return l(O),a(O<0?0:b(O)|0)}o.allocUnsafe=function(O){return d(O)},o.allocUnsafeSlow=function(O){return d(O)};function f(O,T){if((typeof T!="string"||T==="")&&(T="utf8"),!o.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const N=v(O,T)|0;let G=a(N);const te=G.write(O,T);return te!==N&&(G=G.slice(0,te)),G}function h(O){const T=O.length<0?0:b(O.length)|0,N=a(T);for(let G=0;G<T;G+=1)N[G]=O[G]&255;return N}function g(O){if(Pe(O,Uint8Array)){const T=new Uint8Array(O);return m(T.buffer,T.byteOffset,T.byteLength)}return h(O)}function m(O,T,N){if(T<0||O.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<T+(N||0))throw new RangeError('"length" is outside of buffer bounds');let G;return T===void 0&&N===void 0?G=new Uint8Array(O):N===void 0?G=new Uint8Array(O,T):G=new Uint8Array(O,T,N),Object.setPrototypeOf(G,o.prototype),G}function y(O){if(o.isBuffer(O)){const T=b(O.length)|0,N=a(T);return N.length===0||O.copy(N,0,0,T),N}if(O.length!==void 0)return typeof O.length!="number"||Ae(O.length)?a(0):h(O);if(O.type==="Buffer"&&Array.isArray(O.data))return h(O.data)}function b(O){if(O>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return O|0}function E(O){return+O!=O&&(O=0),o.alloc(+O)}o.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==o.prototype},o.compare=function(T,N){if(Pe(T,Uint8Array)&&(T=o.from(T,T.offset,T.byteLength)),Pe(N,Uint8Array)&&(N=o.from(N,N.offset,N.byteLength)),!o.isBuffer(T)||!o.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===N)return 0;let G=T.length,te=N.length;for(let ue=0,pe=Math.min(G,te);ue<pe;++ue)if(T[ue]!==N[ue]){G=T[ue],te=N[ue];break}return G<te?-1:te<G?1:0},o.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(T,N){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return o.alloc(0);let G;if(N===void 0)for(N=0,G=0;G<T.length;++G)N+=T[G].length;const te=o.allocUnsafe(N);let ue=0;for(G=0;G<T.length;++G){let pe=T[G];if(Pe(pe,Uint8Array))ue+pe.length>te.length?(o.isBuffer(pe)||(pe=o.from(pe)),pe.copy(te,ue)):Uint8Array.prototype.set.call(te,pe,ue);else if(o.isBuffer(pe))pe.copy(te,ue);else throw new TypeError('"list" argument must be an Array of Buffers');ue+=pe.length}return te};function v(O,T){if(o.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||Pe(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);const N=O.length,G=arguments.length>2&&arguments[2]===!0;if(!G&&N===0)return 0;let te=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return N;case"utf8":case"utf-8":return fe(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N*2;case"hex":return N>>>1;case"base64":return ne(O).length;default:if(te)return G?-1:fe(O).length;T=(""+T).toLowerCase(),te=!0}}o.byteLength=v;function w(O,T,N){let G=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((N===void 0||N>this.length)&&(N=this.length),N<=0)||(N>>>=0,T>>>=0,N<=T))return"";for(O||(O="utf8");;)switch(O){case"hex":return W(this,T,N);case"utf8":case"utf-8":return B(this,T,N);case"ascii":return q(this,T,N);case"latin1":case"binary":return U(this,T,N);case"base64":return L(this,T,N);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,T,N);default:if(G)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),G=!0}}o.prototype._isBuffer=!0;function x(O,T,N){const G=O[T];O[T]=O[N],O[N]=G}o.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<T;N+=2)x(this,N,N+1);return this},o.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<T;N+=4)x(this,N,N+3),x(this,N+1,N+2);return this},o.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<T;N+=8)x(this,N,N+7),x(this,N+1,N+6),x(this,N+2,N+5),x(this,N+3,N+4);return this},o.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?B(this,0,T):w.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(T){if(!o.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:o.compare(this,T)===0},o.prototype.inspect=function(){let T="";const N=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(T+=" ... "),"<Buffer "+T+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(T,N,G,te,ue){if(Pe(T,Uint8Array)&&(T=o.from(T,T.offset,T.byteLength)),!o.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(N===void 0&&(N=0),G===void 0&&(G=T?T.length:0),te===void 0&&(te=0),ue===void 0&&(ue=this.length),N<0||G>T.length||te<0||ue>this.length)throw new RangeError("out of range index");if(te>=ue&&N>=G)return 0;if(te>=ue)return-1;if(N>=G)return 1;if(N>>>=0,G>>>=0,te>>>=0,ue>>>=0,this===T)return 0;let pe=ue-te,Ie=G-N;const je=Math.min(pe,Ie),Te=this.slice(te,ue),ve=T.slice(N,G);for(let Oe=0;Oe<je;++Oe)if(Te[Oe]!==ve[Oe]){pe=Te[Oe],Ie=ve[Oe];break}return pe<Ie?-1:Ie<pe?1:0};function _(O,T,N,G,te){if(O.length===0)return-1;if(typeof N=="string"?(G=N,N=0):N>2147483647?N=2147483647:N<-2147483648&&(N=-2147483648),N=+N,Ae(N)&&(N=te?0:O.length-1),N<0&&(N=O.length+N),N>=O.length){if(te)return-1;N=O.length-1}else if(N<0)if(te)N=0;else return-1;if(typeof T=="string"&&(T=o.from(T,G)),o.isBuffer(T))return T.length===0?-1:S(O,T,N,G,te);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(O,T,N):Uint8Array.prototype.lastIndexOf.call(O,T,N):S(O,[T],N,G,te);throw new TypeError("val must be string, number or Buffer")}function S(O,T,N,G,te){let ue=1,pe=O.length,Ie=T.length;if(G!==void 0&&(G=String(G).toLowerCase(),G==="ucs2"||G==="ucs-2"||G==="utf16le"||G==="utf-16le")){if(O.length<2||T.length<2)return-1;ue=2,pe/=2,Ie/=2,N/=2}function je(ve,Oe){return ue===1?ve[Oe]:ve.readUInt16BE(Oe*ue)}let Te;if(te){let ve=-1;for(Te=N;Te<pe;Te++)if(je(O,Te)===je(T,ve===-1?0:Te-ve)){if(ve===-1&&(ve=Te),Te-ve+1===Ie)return ve*ue}else ve!==-1&&(Te-=Te-ve),ve=-1}else for(N+Ie>pe&&(N=pe-Ie),Te=N;Te>=0;Te--){let ve=!0;for(let Oe=0;Oe<Ie;Oe++)if(je(O,Te+Oe)!==je(T,Oe)){ve=!1;break}if(ve)return Te}return-1}o.prototype.includes=function(T,N,G){return this.indexOf(T,N,G)!==-1},o.prototype.indexOf=function(T,N,G){return _(this,T,N,G,!0)},o.prototype.lastIndexOf=function(T,N,G){return _(this,T,N,G,!1)};function A(O,T,N,G){N=Number(N)||0;const te=O.length-N;G?(G=Number(G),G>te&&(G=te)):G=te;const ue=T.length;G>ue/2&&(G=ue/2);let pe;for(pe=0;pe<G;++pe){const Ie=parseInt(T.substr(pe*2,2),16);if(Ae(Ie))return pe;O[N+pe]=Ie}return pe}function I(O,T,N,G){return Re(fe(T,O.length-N),O,N,G)}function $(O,T,N,G){return Re(we(T),O,N,G)}function P(O,T,N,G){return Re(ne(T),O,N,G)}function j(O,T,N,G){return Re(Ce(T,O.length-N),O,N,G)}o.prototype.write=function(T,N,G,te){if(N===void 0)te="utf8",G=this.length,N=0;else if(G===void 0&&typeof N=="string")te=N,G=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite(G)?(G=G>>>0,te===void 0&&(te="utf8")):(te=G,G=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ue=this.length-N;if((G===void 0||G>ue)&&(G=ue),T.length>0&&(G<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let pe=!1;for(;;)switch(te){case"hex":return A(this,T,N,G);case"utf8":case"utf-8":return I(this,T,N,G);case"ascii":case"latin1":case"binary":return $(this,T,N,G);case"base64":return P(this,T,N,G);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,T,N,G);default:if(pe)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),pe=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(O,T,N){return T===0&&N===O.length?e.fromByteArray(O):e.fromByteArray(O.slice(T,N))}function B(O,T,N){N=Math.min(O.length,N);const G=[];let te=T;for(;te<N;){const ue=O[te];let pe=null,Ie=ue>239?4:ue>223?3:ue>191?2:1;if(te+Ie<=N){let je,Te,ve,Oe;switch(Ie){case 1:ue<128&&(pe=ue);break;case 2:je=O[te+1],(je&192)===128&&(Oe=(ue&31)<<6|je&63,Oe>127&&(pe=Oe));break;case 3:je=O[te+1],Te=O[te+2],(je&192)===128&&(Te&192)===128&&(Oe=(ue&15)<<12|(je&63)<<6|Te&63,Oe>2047&&(Oe<55296||Oe>57343)&&(pe=Oe));break;case 4:je=O[te+1],Te=O[te+2],ve=O[te+3],(je&192)===128&&(Te&192)===128&&(ve&192)===128&&(Oe=(ue&15)<<18|(je&63)<<12|(Te&63)<<6|ve&63,Oe>65535&&Oe<1114112&&(pe=Oe))}}pe===null?(pe=65533,Ie=1):pe>65535&&(pe-=65536,G.push(pe>>>10&1023|55296),pe=56320|pe&1023),G.push(pe),te+=Ie}return D(G)}const k=4096;function D(O){const T=O.length;if(T<=k)return String.fromCharCode.apply(String,O);let N="",G=0;for(;G<T;)N+=String.fromCharCode.apply(String,O.slice(G,G+=k));return N}function q(O,T,N){let G="";N=Math.min(O.length,N);for(let te=T;te<N;++te)G+=String.fromCharCode(O[te]&127);return G}function U(O,T,N){let G="";N=Math.min(O.length,N);for(let te=T;te<N;++te)G+=String.fromCharCode(O[te]);return G}function W(O,T,N){const G=O.length;(!T||T<0)&&(T=0),(!N||N<0||N>G)&&(N=G);let te="";for(let ue=T;ue<N;++ue)te+=Ue[O[ue]];return te}function V(O,T,N){const G=O.slice(T,N);let te="";for(let ue=0;ue<G.length-1;ue+=2)te+=String.fromCharCode(G[ue]+G[ue+1]*256);return te}o.prototype.slice=function(T,N){const G=this.length;T=~~T,N=N===void 0?G:~~N,T<0?(T+=G,T<0&&(T=0)):T>G&&(T=G),N<0?(N+=G,N<0&&(N=0)):N>G&&(N=G),N<T&&(N=T);const te=this.subarray(T,N);return Object.setPrototypeOf(te,o.prototype),te};function Y(O,T,N){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+T>N)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(T,N,G){T=T>>>0,N=N>>>0,G||Y(T,N,this.length);let te=this[T],ue=1,pe=0;for(;++pe<N&&(ue*=256);)te+=this[T+pe]*ue;return te},o.prototype.readUintBE=o.prototype.readUIntBE=function(T,N,G){T=T>>>0,N=N>>>0,G||Y(T,N,this.length);let te=this[T+--N],ue=1;for(;N>0&&(ue*=256);)te+=this[T+--N]*ue;return te},o.prototype.readUint8=o.prototype.readUInt8=function(T,N){return T=T>>>0,N||Y(T,1,this.length),this[T]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(T,N){return T=T>>>0,N||Y(T,2,this.length),this[T]|this[T+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(T,N){return T=T>>>0,N||Y(T,2,this.length),this[T]<<8|this[T+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(T,N){return T=T>>>0,N||Y(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(T,N){return T=T>>>0,N||Y(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},o.prototype.readBigUInt64LE=He(function(T){T=T>>>0,ee(T,"offset");const N=this[T],G=this[T+7];(N===void 0||G===void 0)&&ie(T,this.length-8);const te=N+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,ue=this[++T]+this[++T]*2**8+this[++T]*2**16+G*2**24;return BigInt(te)+(BigInt(ue)<<BigInt(32))}),o.prototype.readBigUInt64BE=He(function(T){T=T>>>0,ee(T,"offset");const N=this[T],G=this[T+7];(N===void 0||G===void 0)&&ie(T,this.length-8);const te=N*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],ue=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+G;return(BigInt(te)<<BigInt(32))+BigInt(ue)}),o.prototype.readIntLE=function(T,N,G){T=T>>>0,N=N>>>0,G||Y(T,N,this.length);let te=this[T],ue=1,pe=0;for(;++pe<N&&(ue*=256);)te+=this[T+pe]*ue;return ue*=128,te>=ue&&(te-=Math.pow(2,8*N)),te},o.prototype.readIntBE=function(T,N,G){T=T>>>0,N=N>>>0,G||Y(T,N,this.length);let te=N,ue=1,pe=this[T+--te];for(;te>0&&(ue*=256);)pe+=this[T+--te]*ue;return ue*=128,pe>=ue&&(pe-=Math.pow(2,8*N)),pe},o.prototype.readInt8=function(T,N){return T=T>>>0,N||Y(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},o.prototype.readInt16LE=function(T,N){T=T>>>0,N||Y(T,2,this.length);const G=this[T]|this[T+1]<<8;return G&32768?G|4294901760:G},o.prototype.readInt16BE=function(T,N){T=T>>>0,N||Y(T,2,this.length);const G=this[T+1]|this[T]<<8;return G&32768?G|4294901760:G},o.prototype.readInt32LE=function(T,N){return T=T>>>0,N||Y(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},o.prototype.readInt32BE=function(T,N){return T=T>>>0,N||Y(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},o.prototype.readBigInt64LE=He(function(T){T=T>>>0,ee(T,"offset");const N=this[T],G=this[T+7];(N===void 0||G===void 0)&&ie(T,this.length-8);const te=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(G<<24);return(BigInt(te)<<BigInt(32))+BigInt(N+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),o.prototype.readBigInt64BE=He(function(T){T=T>>>0,ee(T,"offset");const N=this[T],G=this[T+7];(N===void 0||G===void 0)&&ie(T,this.length-8);const te=(N<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(te)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+G)}),o.prototype.readFloatLE=function(T,N){return T=T>>>0,N||Y(T,4,this.length),r.read(this,T,!0,23,4)},o.prototype.readFloatBE=function(T,N){return T=T>>>0,N||Y(T,4,this.length),r.read(this,T,!1,23,4)},o.prototype.readDoubleLE=function(T,N){return T=T>>>0,N||Y(T,8,this.length),r.read(this,T,!0,52,8)},o.prototype.readDoubleBE=function(T,N){return T=T>>>0,N||Y(T,8,this.length),r.read(this,T,!1,52,8)};function K(O,T,N,G,te,ue){if(!o.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>te||T<ue)throw new RangeError('"value" argument is out of bounds');if(N+G>O.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(T,N,G,te){if(T=+T,N=N>>>0,G=G>>>0,!te){const Ie=Math.pow(2,8*G)-1;K(this,T,N,G,Ie,0)}let ue=1,pe=0;for(this[N]=T&255;++pe<G&&(ue*=256);)this[N+pe]=T/ue&255;return N+G},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(T,N,G,te){if(T=+T,N=N>>>0,G=G>>>0,!te){const Ie=Math.pow(2,8*G)-1;K(this,T,N,G,Ie,0)}let ue=G-1,pe=1;for(this[N+ue]=T&255;--ue>=0&&(pe*=256);)this[N+ue]=T/pe&255;return N+G},o.prototype.writeUint8=o.prototype.writeUInt8=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,1,255,0),this[N]=T&255,N+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,2,65535,0),this[N]=T&255,this[N+1]=T>>>8,N+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,2,65535,0),this[N]=T>>>8,this[N+1]=T&255,N+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,4,4294967295,0),this[N+3]=T>>>24,this[N+2]=T>>>16,this[N+1]=T>>>8,this[N]=T&255,N+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,4,4294967295,0),this[N]=T>>>24,this[N+1]=T>>>16,this[N+2]=T>>>8,this[N+3]=T&255,N+4};function ge(O,T,N,G,te){M(T,G,te,O,N,7);let ue=Number(T&BigInt(4294967295));O[N++]=ue,ue=ue>>8,O[N++]=ue,ue=ue>>8,O[N++]=ue,ue=ue>>8,O[N++]=ue;let pe=Number(T>>BigInt(32)&BigInt(4294967295));return O[N++]=pe,pe=pe>>8,O[N++]=pe,pe=pe>>8,O[N++]=pe,pe=pe>>8,O[N++]=pe,N}function ae(O,T,N,G,te){M(T,G,te,O,N,7);let ue=Number(T&BigInt(4294967295));O[N+7]=ue,ue=ue>>8,O[N+6]=ue,ue=ue>>8,O[N+5]=ue,ue=ue>>8,O[N+4]=ue;let pe=Number(T>>BigInt(32)&BigInt(4294967295));return O[N+3]=pe,pe=pe>>8,O[N+2]=pe,pe=pe>>8,O[N+1]=pe,pe=pe>>8,O[N]=pe,N+8}o.prototype.writeBigUInt64LE=He(function(T,N=0){return ge(this,T,N,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=He(function(T,N=0){return ae(this,T,N,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(T,N,G,te){if(T=+T,N=N>>>0,!te){const je=Math.pow(2,8*G-1);K(this,T,N,G,je-1,-je)}let ue=0,pe=1,Ie=0;for(this[N]=T&255;++ue<G&&(pe*=256);)T<0&&Ie===0&&this[N+ue-1]!==0&&(Ie=1),this[N+ue]=(T/pe>>0)-Ie&255;return N+G},o.prototype.writeIntBE=function(T,N,G,te){if(T=+T,N=N>>>0,!te){const je=Math.pow(2,8*G-1);K(this,T,N,G,je-1,-je)}let ue=G-1,pe=1,Ie=0;for(this[N+ue]=T&255;--ue>=0&&(pe*=256);)T<0&&Ie===0&&this[N+ue+1]!==0&&(Ie=1),this[N+ue]=(T/pe>>0)-Ie&255;return N+G},o.prototype.writeInt8=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,1,127,-128),T<0&&(T=255+T+1),this[N]=T&255,N+1},o.prototype.writeInt16LE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,2,32767,-32768),this[N]=T&255,this[N+1]=T>>>8,N+2},o.prototype.writeInt16BE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,2,32767,-32768),this[N]=T>>>8,this[N+1]=T&255,N+2},o.prototype.writeInt32LE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,4,2147483647,-2147483648),this[N]=T&255,this[N+1]=T>>>8,this[N+2]=T>>>16,this[N+3]=T>>>24,N+4},o.prototype.writeInt32BE=function(T,N,G){return T=+T,N=N>>>0,G||K(this,T,N,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[N]=T>>>24,this[N+1]=T>>>16,this[N+2]=T>>>8,this[N+3]=T&255,N+4},o.prototype.writeBigInt64LE=He(function(T,N=0){return ge(this,T,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=He(function(T,N=0){return ae(this,T,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(O,T,N,G,te,ue){if(N+G>O.length)throw new RangeError("Index out of range");if(N<0)throw new RangeError("Index out of range")}function Q(O,T,N,G,te){return T=+T,N=N>>>0,te||ce(O,T,N,4),r.write(O,T,N,G,23,4),N+4}o.prototype.writeFloatLE=function(T,N,G){return Q(this,T,N,!0,G)},o.prototype.writeFloatBE=function(T,N,G){return Q(this,T,N,!1,G)};function se(O,T,N,G,te){return T=+T,N=N>>>0,te||ce(O,T,N,8),r.write(O,T,N,G,52,8),N+8}o.prototype.writeDoubleLE=function(T,N,G){return se(this,T,N,!0,G)},o.prototype.writeDoubleBE=function(T,N,G){return se(this,T,N,!1,G)},o.prototype.copy=function(T,N,G,te){if(!o.isBuffer(T))throw new TypeError("argument should be a Buffer");if(G||(G=0),!te&&te!==0&&(te=this.length),N>=T.length&&(N=T.length),N||(N=0),te>0&&te<G&&(te=G),te===G||T.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if(G<0||G>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),T.length-N<te-G&&(te=T.length-N+G);const ue=te-G;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,G,te):Uint8Array.prototype.set.call(T,this.subarray(G,te),N),ue},o.prototype.fill=function(T,N,G,te){if(typeof T=="string"){if(typeof N=="string"?(te=N,N=0,G=this.length):typeof G=="string"&&(te=G,G=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!o.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(T.length===1){const pe=T.charCodeAt(0);(te==="utf8"&&pe<128||te==="latin1")&&(T=pe)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(N<0||this.length<N||this.length<G)throw new RangeError("Out of range index");if(G<=N)return this;N=N>>>0,G=G===void 0?this.length:G>>>0,T||(T=0);let ue;if(typeof T=="number")for(ue=N;ue<G;++ue)this[ue]=T;else{const pe=o.isBuffer(T)?T:o.from(T,te),Ie=pe.length;
vendor: 4,120 bytes, line 425
425if(Ie===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(ue=0;ue<G-N;++ue)this[ue+N]=pe[ue%Ie]}return this};const me={};function _e(O,T,N){me[O]=class extends N{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}_e("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),_e("ERR_INVALID_ARG_TYPE",function(O,T){return`The "${O}" argument must be of type number. Received type ${typeof T}`},TypeError),_e("ERR_OUT_OF_RANGE",function(O,T,N){let G=`The value of "${O}" is out of range.`,te=N;return Number.isInteger(N)&&Math.abs(N)>2**32?te=z(String(N)):typeof N=="bigint"&&(te=String(N),(N>BigInt(2)**BigInt(32)||N<-(BigInt(2)**BigInt(32)))&&(te=z(te)),te+="n"),G+=` It must be ${T}. Received ${te}`,G},RangeError);function z(O){let T="",N=O.length;const G=O[0]==="-"?1:0;for(;N>=G+4;N-=3)T=`_${O.slice(N-3,N)}${T}`;return`${O.slice(0,N)}${T}`}function R(O,T,N){ee(T,"offset"),(O[T]===void 0||O[T+N]===void 0)&&ie(T,O.length-(N+1))}function M(O,T,N,G,te,ue){if(O>N||O<T){const pe=typeof T=="bigint"?"n":"";let Ie;throw T===0||T===BigInt(0)?Ie=`>= 0${pe} and < 2${pe} ** ${(ue+1)*8}${pe}`:Ie=`>= -(2${pe} ** ${(ue+1)*8-1}${pe}) and < 2 ** ${(ue+1)*8-1}${pe}`,new me.ERR_OUT_OF_RANGE("value",Ie,O)}R(G,te,ue)}function ee(O,T){if(typeof O!="number")throw new me.ERR_INVALID_ARG_TYPE(T,"number",O)}function ie(O,T,N){throw Math.floor(O)!==O?(ee(O,N),new me.ERR_OUT_OF_RANGE("offset","an integer",O)):T<0?new me.ERR_BUFFER_OUT_OF_BOUNDS:new me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${T}`,O)}const le=/[^+/0-9A-Za-z-_]/g;function ye(O){if(O=O.split("=")[0],O=O.trim().replace(le,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function fe(O,T){T=T||1/0;let N;const G=O.length;let te=null;const ue=[];for(let pe=0;pe<G;++pe){if(N=O.charCodeAt(pe),N>55295&&N<57344){if(!te){if(N>56319){(T-=3)>-1&&ue.push(239,191,189);continue}else if(pe+1===G){(T-=3)>-1&&ue.push(239,191,189);continue}te=N;continue}if(N<56320){(T-=3)>-1&&ue.push(239,191,189),te=N;continue}N=(te-55296<<10|N-56320)+65536}else te&&(T-=3)>-1&&ue.push(239,191,189);if(te=null,N<128){if((T-=1)<0)break;ue.push(N)}else if(N<2048){if((T-=2)<0)break;ue.push(N>>6|192,N&63|128)}else if(N<65536){if((T-=3)<0)break;ue.push(N>>12|224,N>>6&63|128,N&63|128)}else if(N<1114112){if((T-=4)<0)break;ue.push(N>>18|240,N>>12&63|128,N>>6&63|128,N&63|128)}else throw new Error("Invalid code point")}return ue}function we(O){const T=[];for(let N=0;N<O.length;++N)T.push(O.charCodeAt(N)&255);return T}function Ce(O,T){let N,G,te;const ue=[];for(let pe=0;pe<O.length&&!((T-=2)<0);++pe)N=O.charCodeAt(pe),G=N>>8,te=N%256,ue.push(te),ue.push(G);return ue}function ne(O){return e.toByteArray(ye(O))}function Re(O,T,N,G){let te;for(te=0;te<G&&!(te+N>=T.length||te>=O.length);++te)T[te+N]=O[te];return te}function Pe(O,T){return O instanceof T||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===T.name}function Ae(O){return O!==O}const Ue=(function(){const O="0123456789abcdef",T=new Array(256);for(let N=0;N<16;++N){const G=N*16;for(let te=0;te<16;++te)T[G+te]=O[N]+O[te]}return T})();function He(O){return typeof BigInt>"u"?Qe:O}function Qe(){throw new Error("BigInt not supported")}})(k4)),k4}var $4,AO;function dEe(){if(AO)return $4;AO=1;function t(g,m){var y=Object.keys(g);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(g);m&&(b=b.filter(function(E){return Object.getOwnPropertyDescriptor(g,E).enumerable})),y.push.apply(y,b)}return y}function e(g){for(var m=1;m<arguments.length;m++){var y=arguments[m]!=null?arguments[m]:{};m%2?t(Object(y),!0).forEach(function(b){r(g,b,y[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(y)):t(Object(y)).forEac
vendor: 4,186 bytes, line 425
425h(function(b){Object.defineProperty(g,b,Object.getOwnPropertyDescriptor(y,b))})}return g}function r(g,m,y){return m=a(m),m in g?Object.defineProperty(g,m,{value:y,enumerable:!0,configurable:!0,writable:!0}):g[m]=y,g}function n(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function i(g,m){for(var y=0;y<m.length;y++){var b=m[y];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(g,a(b.key),b)}}function s(g,m,y){return m&&i(g.prototype,m),Object.defineProperty(g,"prototype",{writable:!1}),g}function a(g){var m=o(g,"string");return typeof m=="symbol"?m:String(m)}function o(g,m){if(typeof g!="object"||g===null)return g;var y=g[Symbol.toPrimitive];if(y!==void 0){var b=y.call(g,m);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(g)}var c=B3(),l=c.Buffer,u=xB,d=u.inspect,f=d&&d.custom||"inspect";function h(g,m,y){l.prototype.copy.call(g,m,y)}return $4=(function(){function g(){n(this,g),this.head=null,this.tail=null,this.length=0}return s(g,[{key:"push",value:function(y){var b={data:y,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(y){var b={data:y,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var b=this.head,E=""+b.data;b=b.next;)E+=y+b.data;return E}},{key:"concat",value:function(y){if(this.length===0)return l.alloc(0);for(var b=l.allocUnsafe(y>>>0),E=this.head,v=0;E;)h(E.data,b,v),v+=E.data.length,E=E.next;return b}},{key:"consume",value:function(y,b){var E;return y<this.head.data.length?(E=this.head.data.slice(0,y),this.head.data=this.head.data.slice(y)):y===this.head.data.length?E=this.shift():E=b?this._getString(y):this._getBuffer(y),E}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(y){var b=this.head,E=1,v=b.data;for(y-=v.length;b=b.next;){var w=b.data,x=y>w.length?w.length:y;if(x===w.length?v+=w:v+=w.slice(0,y),y-=x,y===0){x===w.length?(++E,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=w.slice(x));break}++E}return this.length-=E,v}},{key:"_getBuffer",value:function(y){var b=l.allocUnsafe(y),E=this.head,v=1;for(E.data.copy(b),y-=E.data.length;E=E.next;){var w=E.data,x=y>w.length?w.length:y;if(w.copy(b,b.length-y,0,x),y-=x,y===0){x===w.length?(++v,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=w.slice(x));break}++v}return this.length-=v,b}},{key:f,value:function(y,b){return d(this,e(e({},b),{},{depth:0,customInspect:!1}))}}]),g})(),$4}var N4,TO;function wK(){if(TO)return N4;TO=1;function t(a,o){var c=this,l=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return l||u?(o?o(a):a&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,a)):process.nextTick(i,this,a)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(d){!o&&d?c._writableState?c._writableState.errorEmitted?process.nextTick(r,c):(c._writableState.errorEmitted=!0,process.nextTick(e,c,d)):process.nextTick(e,c,d):o?(process.nextTick(r,c),o(d)):process.nextTick(r,c)}),this)}function e(a,o){i(a,o),r(a)}function r(a){a._writableState&&!a._writableState.emitClose||a._readableState&&!a._readableState.emitClose||a.emit("close")}function n(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}
vendor: 12,821 bytes, line 425
425function i(a,o){a.emit("error",o)}function s(a,o){var c=a._readableState,l=a._writableState;c&&c.autoDestroy||l&&l.autoDestroy?a.destroy(o):a.emit("error",o)}return N4={destroy:t,undestroy:n,errorOrDestroy:s},N4}var P4={},IO;function R0(){if(IO)return P4;IO=1;function t(o,c){o.prototype=Object.create(c.prototype),o.prototype.constructor=o,o.__proto__=c}var e={};function r(o,c,l){l||(l=Error);function u(f,h,g){return typeof c=="string"?c:c(f,h,g)}var d=(function(f){t(h,f);function h(g,m,y){return f.call(this,u(g,m,y))||this}return h})(l);d.prototype.name=l.name,d.prototype.code=o,e[o]=d}function n(o,c){if(Array.isArray(o)){var l=o.length;return o=o.map(function(u){return String(u)}),l>2?"one of ".concat(c," ").concat(o.slice(0,l-1).join(", "),", or ")+o[l-1]:l===2?"one of ".concat(c," ").concat(o[0]," or ").concat(o[1]):"of ".concat(c," ").concat(o[0])}else return"of ".concat(c," ").concat(String(o))}function i(o,c,l){return o.substr(0,c.length)===c}function s(o,c,l){return(l===void 0||l>o.length)&&(l=o.length),o.substring(l-c.length,l)===c}function a(o,c,l){return typeof l!="number"&&(l=0),l+c.length>o.length?!1:o.indexOf(c,l)!==-1}return r("ERR_INVALID_OPT_VALUE",function(o,c){return'The value "'+c+'" is invalid for option "'+o+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(o,c,l){var u;typeof c=="string"&&i(c,"not ")?(u="must not be",c=c.replace(/^not /,"")):u="must be";var d;if(s(o," argument"))d="The ".concat(o," ").concat(u," ").concat(n(c,"type"));else{var f=a(o,".")?"property":"argument";d='The "'.concat(o,'" ').concat(f," ").concat(u," ").concat(n(c,"type"))}return d+=". Received type ".concat(typeof l),d},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),P4.codes=e,P4}var O4,kO;function EK(){if(kO)return O4;kO=1;var t=R0().codes.ERR_INVALID_OPT_VALUE;function e(n,i,s){return n.highWaterMark!=null?n.highWaterMark:i?n[s]:null}function r(n,i,s,a){var o=e(i,a,s);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var c=a?s:"highWaterMark";throw new t(c,o)}return Math.floor(o)}return n.objectMode?16:16*1024}return O4={getHighWaterMark:r},O4}var R4,$O;function fEe(){if($O)return R4;$O=1,R4=t;function t(r,n){if(e("noDeprecation"))return r;var i=!1;function s(){if(!i){if(e("throwDeprecation"))throw new Error(n);e("traceDeprecation")?console.trace(n):console.warn(n),i=!0}return r.apply(this,arguments)}return s}function e(r){try{if(!Yn.localStorage)return!1}catch{return!1}var n=Yn.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return R4}var D4,NO;function xK(){if(NO)return D4;NO=1,D4=A;function t(Q){var se=this;this.next=null,this.entry=null,this.finish=function(){ce(se,Q)}}var e;A.WritableState=_;var r={deprecate:fEe()},n=vK(),i=B3().Buffer,s=(typeof Yn<"u"?Yn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(Q){return i.from(Q)}function o(Q){return i.isBuffer(Q)||Q instanceof s}var c=wK(),l=EK(),u=l.getHighWaterMark,d=R0().codes,f=d.ERR_INVALID_ARG_TYPE,h=d.ERR_METHOD_NOT_IMPLEMENTED,g=d.ERR_MULTIPLE_CALLBACK,m=d.ERR_STREAM_CANNOT_PIPE,y=d.ERR_STREAM_DESTROYED,b=d.ERR_STREAM_NULL_VALUES,E=d.ERR_STREAM_WRITE_AFTER_END,v=d.ERR_UNKNOWN_ENCODING,w=c.errorOrDestroy;Ro()(A,n);function x(){}function _(Q,se,me){e=e||o0(),Q=Q||{},typeof me!="boolean"&&(me=se instanceof e),this.objectMode=!!Q.objectMode,me&&(this.objectMode=this.objectMode||!!Q.writableObjectMode),this.highWaterMark=u(this,Q,"writableHighWaterMark",me),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var _e=Q.decodeStrings===!1;this.decodeStrings=!_e,this.defaultEncoding=Q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){D(se,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Q.emitClose!==!1,this.autoDestroy=!!Q.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}_.prototype.getBuffer=function(){for(var se=this.bufferedRequest,me=[];se;)me.push(se),se=se.next;return me},(function(){try{Object.defineProperty(_.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var S;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(S=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(se){return S.call(this,se)?!0:this!==A?!1:se&&se._writableState instanceof _}})):S=function(se){return se instanceof this};function A(Q){e=e||o0();var se=this instanceof e;if(!se&&!S.call(A,this))return new A(Q);this._writableState=new _(Q,this,se),this.writable=!0,Q&&(typeof Q.write=="function"&&(this._write=Q.write),typeof Q.writev=="function"&&(this._writev=Q.writev),typeof Q.destroy=="function"&&(this._destroy=Q.destroy),typeof Q.final=="function"&&(this._final=Q.final)),n.call(this)}A.prototype.pipe=function(){w(this,new m)};function I(Q,se){var me=new E;w(Q,me),process.nextTick(se,me)}function $(Q,se,me,_e){var z;return me===null?z=new b:typeof me!="string"&&!se.objectMode&&(z=new f("chunk",["string","Buffer"],me)),z?(w(Q,z),process.nextTick(_e,z),!1):!0}A.prototype.write=function(Q,se,me){var _e=this._writableState,z=!1,R=!_e.objectMode&&o(Q);return R&&!i.isBuffer(Q)&&(Q=a(Q)),typeof se=="function"&&(me=se,se=null),R?se="buffer":se||(se=_e.defaultEncoding),typeof me!="function"&&(me=x),_e.ending?I(this,me):(R||$(this,_e,Q,me))&&(_e.pendingcb++,z=j(this,_e,R,Q,se,me)),z},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var Q=this._writableState;Q.corked&&(Q.corked--,!Q.writing&&!Q.corked&&!Q.bufferProcessing&&Q.bufferedRequest&&W(this,Q))},A.prototype.setDefaultEncoding=function(se){if(typeof se=="string"&&(se=se.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((se+"").toLowerCase())>-1))throw new v(se);return this._writableState.defaultEncoding=se,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function P(Q,se,me){return!Q.objectMode&&Q.decodeStrings!==!1&&typeof se=="string"&&(se=i.from(se,me)),se}Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function j(Q,se,me,_e,z,R){if(!me){var M=P(se,_e,z);_e!==M&&(me=!0,z="buffer",_e=M)}var ee=se.objectMode?1:_e.length;se.length+=ee;var ie=se.length<se.highWaterMark;if(ie||(se.needDrain=!0),se.writing||se.corked){var le=se.lastBufferedRequest;se.lastBufferedRequest={chunk:_e,encoding:z,isBuf:me,callback:R,next:null},le?le.next=se.lastBufferedRequest:se.bufferedRequest=se.lastBufferedRequest,se.bufferedRequestCount+=1}else L(Q,se,!1,ee,_e,z,R);return ie}function L(Q,se,me,_e,z,R,M){se.writelen=_e,se.writecb=M,se.writing=!0,se.sync=!0,se.destroyed?se.onwrite(new y("write")):me?Q._writev(z,se.onwrite):Q._write(z,R,se.onwrite),se.sync=!1}function B(Q,se,me,_e,z){--se.pendingcb,me?(process.nextTick(z,_e),process.nextTick(ge,Q,se),Q._writableState.errorEmitted=!0,w(Q,_e)):(z(_e),Q._writableState.errorEmitted=!0,w(Q,_e),ge(Q,se))}function k(Q){Q.writing=!1,Q.writecb=null,Q.length-=Q.writelen,Q.writelen=0}function D(Q,se){var me=Q._writableState,_e=me.sync,z=me.writecb;if(typeof z!="function")throw new g;if(k(me),se)B(Q,me,_e,se,z);else{var R=V(me)||Q.destroyed;!R&&!me.corked&&!me.bufferProcessing&&me.bufferedRequest&&W(Q,me),_e?process.nextTick(q,Q,me,R,z):q(Q,me,R,z)}}function q(Q,se,me,_e){me||U(Q,se),se.pendingcb--,_e(),ge(Q,se)}function U(Q,se){se.length===0&&se.needDrain&&(se.needDrain=!1,Q.emit("drain"))}function W(Q,se){se.bufferProcessing=!0;var me=se.bufferedRequest;if(Q._writev&&me&&me.next){var _e=se.bufferedRequestCount,z=new Array(_e),R=se.corkedRequestsFree;R.entry=me;for(var M=0,ee=!0;me;)z[M]=me,me.isBuf||(ee=!1),me=me.next,M+=1;z.allBuffers=ee,L(Q,se,!0,se.length,z,"",R.finish),se.pendingcb++,se.lastBufferedRequest=null,R.next?(se.corkedRequestsFree=R.next,R.next=null):se.corkedRequestsFree=new t(se),se.bufferedRequestCount=0}else{for(;me;){var ie=me.chunk,le=me.encoding,ye=me.callback,fe=se.objectMode?1:ie.length;if(L(Q,se,!1,fe,ie,le,ye),me=me.next,se.bufferedRequestCount--,se.writing)break}me===null&&(se.lastBufferedRequest=null)}se.bufferedRequest=me,se.bufferProcessing=!1}A.prototype._write=function(Q,se,me){me(new h("_write()"))},A.prototype._writev=null,A.prototype.end=function(Q,se,me){var _e=this._writableState;return typeof Q=="function"?(me=Q,Q=null,se=null):typeof se=="function"&&(me=se,se=null),Q!=null&&this.write(Q,se),_e.corked&&(_e.corked=1,this.uncork()),_e.ending||ae(this,_e,me),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function V(Q){return Q.ending&&Q.length===0&&Q.bufferedRequest===null&&!Q.finished&&!Q.writing}function Y(Q,se){Q._final(function(me){se.pendingcb--,me&&w(Q,me),se.prefinished=!0,Q.emit("prefinish"),ge(Q,se)})}function K(Q,se){!se.prefinished&&!se.finalCalled&&(typeof Q._final=="function"&&!se.destroyed?(se.pendingcb++,se.finalCalled=!0,process.nextTick(Y,Q,se)):(se.prefinished=!0,Q.emit("prefinish")))}function ge(Q,se){var me=V(se);if(me&&(K(Q,se),se.pendingcb===0&&(se.finished=!0,Q.emit("finish"),se.autoDestroy))){var _e=Q._readableState;(!_e||_e.autoDestroy&&_e.endEmitted)&&Q.destroy()}return me}function ae(Q,se,me){se.ending=!0,ge(Q,se),me&&(se.finished?process.nextTick(me):Q.once("finish",me)),se.ended=!0,Q.writable=!1}function ce(Q,se,me){var _e=Q.entry;for(Q.entry=null;_e;){var z=_e.callback;se.pendingcb--,z(me),_e=_e.next}se.corkedRequestsFree.next=Q}return Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(se){this._writableState&&(this._writableState.destroyed=se)}}),A.prototype.destroy=c.destroy,A.prototype._undestroy=c.undestroy,A.prototype._destroy=function(Q,se){se(Q)},D4}var M4,PO;function o0(){if(PO)return M4;PO=1;var t=Object.keys||function(l){var u=[];for(var d in l)u.push(d);return u};M4=a;var e=_K(),r=xK();Ro()(a,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var s=n[i];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(l){if(!(this instanceof a))return new a(l);e.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",o)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o(){this._writableState.ended||process.nextTick(c,this)}function c(l){l.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),M4}var j4={},W2={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var OO;function Bl(){return OO||(OO=1,(function(t,e){var r=B3(),n=r.Buffer;function i(a,o){for(var c in a)o[c]=a[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(a,o,c){return n(a,o,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,c){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,c)},s.alloc=function(a,o,c){if(typeof a!="number")throw new TypeError("Argument must be a number");var l=n(a);
vendor: 12,491 bytes, line 425
425return o!==void 0?typeof c=="string"?l.fill(o,c):l.fill(o):l.fill(0),l},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(W2,W2.exports)),W2.exports}var RO;function DO(){if(RO)return j4;RO=1;var t=Bl().Buffer,e=t.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(b){if(!b)return"utf8";for(var E;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(E)return;b=(""+b).toLowerCase(),E=!0}}function n(b){var E=r(b);if(typeof E!="string"&&(t.isEncoding===e||!e(b)))throw new Error("Unknown encoding: "+b);return E||b}j4.StringDecoder=i;function i(b){this.encoding=n(b);var E;switch(this.encoding){case"utf16le":this.text=d,this.end=f,E=4;break;case"utf8":this.fillLast=c,E=4;break;case"base64":this.text=h,this.end=g,E=3;break;default:this.write=m,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(E)}i.prototype.write=function(b){if(b.length===0)return"";var E,v;if(this.lastNeed){if(E=this.fillLast(b),E===void 0)return"";v=this.lastNeed,this.lastNeed=0}else v=0;return v<b.length?E?E+this.text(b,v):this.text(b,v):E||""},i.prototype.end=u,i.prototype.text=l,i.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function s(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function a(b,E,v){var w=E.length-1;if(w<v)return 0;var x=s(E[w]);return x>=0?(x>0&&(b.lastNeed=x-1),x):--w<v||x===-2?0:(x=s(E[w]),x>=0?(x>0&&(b.lastNeed=x-2),x):--w<v||x===-2?0:(x=s(E[w]),x>=0?(x>0&&(x===2?x=0:b.lastNeed=x-3),x):0))}function o(b,E,v){if((E[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&E.length>1){if((E[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&E.length>2&&(E[2]&192)!==128)return b.lastNeed=2,"�"}}function c(b){var E=this.lastTotal-this.lastNeed,v=o(this,b);if(v!==void 0)return v;if(this.lastNeed<=b.length)return b.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,E,0,b.length),this.lastNeed-=b.length}function l(b,E){var v=a(this,b,E);if(!this.lastNeed)return b.toString("utf8",E);this.lastTotal=v;var w=b.length-(v-this.lastNeed);return b.copy(this.lastChar,0,w),b.toString("utf8",E,w)}function u(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+"�":E}function d(b,E){if((b.length-E)%2===0){var v=b.toString("utf16le",E);if(v){var w=v.charCodeAt(v.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],v.slice(0,-1)}return v}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",E,b.length-1)}function f(b){var E=b&&b.length?this.write(b):"";if(this.lastNeed){var v=this.lastTotal-this.lastNeed;return E+this.lastChar.toString("utf16le",0,v)}return E}function h(b,E){var v=(b.length-E)%3;return v===0?b.toString("base64",E):(this.lastNeed=3-v,this.lastTotal=3,v===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",E,b.length-v))}function g(b){var E=b&&b.length?this.write(b):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function m(b){return b.toString(this.encoding)}function y(b){return b&&b.length?this.write(b):""}return j4}var L4,MO;function OA(){if(MO)return L4;MO=1;var t=R0().codes.ERR_STREAM_PREMATURE_CLOSE;function e(s){var a=!1;return function(){if(!a){a=!0;for(var o=arguments.length,c=new Array(o),l=0;l<o;l++)c[l]=arguments[l];s.apply(this,c)}}}function r(){}function n(s){return s.setHeader&&typeof s.abort=="function"}function i(s,a,o){if(typeof a=="function")return i(s,null,a);a||(a={}),o=e(o||r);var c=a.readable||a.readable!==!1&&s.readable,l=a.writable||a.writable!==!1&&s.writable,u=function(){s.writable||f()},d=s._writableState&&s._writableState.finished,f=function(){l=!1,d=!0,c||o.call(s)},h=s._readableState&&s._readableState.endEmitted,g=function(){c=!1,h=!0,l||o.call(s)},m=function(v){o.call(s,v)},y=function(){var v;if(c&&!h)return(!s._readableState||!s._readableState.ended)&&(v=new t),o.call(s,v);if(l&&!d)return(!s._writableState||!s._writableState.ended)&&(v=new t),o.call(s,v)},b=function(){s.req.on("finish",f)};return n(s)?(s.on("complete",f),s.on("abort",y),s.req?b():s.on("request",b)):l&&!s._writableState&&(s.on("end",u),s.on("close",u)),s.on("end",g),s.on("finish",f),a.error!==!1&&s.on("error",m),s.on("close",y),function(){s.removeListener("complete",f),s.removeListener("abort",y),s.removeListener("request",b),s.req&&s.req.removeListener("finish",f),s.removeListener("end",u),s.removeListener("close",u),s.removeListener("finish",f),s.removeListener("end",g),s.removeListener("error",m),s.removeListener("close",y)}}return L4=i,L4}var F4,jO;function hEe(){if(jO)return F4;jO=1;var t;function e(v,w,x){return w=r(w),w in v?Object.defineProperty(v,w,{value:x,enumerable:!0,configurable:!0,writable:!0}):v[w]=x,v}function r(v){var w=n(v,"string");return typeof w=="symbol"?w:String(w)}function n(v,w){if(typeof v!="object"||v===null)return v;var x=v[Symbol.toPrimitive];if(x!==void 0){var _=x.call(v,w);if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(v)}var i=OA(),s=Symbol("lastResolve"),a=Symbol("lastReject"),o=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function f(v,w){return{value:v,done:w}}function h(v){var w=v[s];if(w!==null){var x=v[d].read();x!==null&&(v[l]=null,v[s]=null,v[a]=null,w(f(x,!1)))}}function g(v){process.nextTick(h,v)}function m(v,w){return function(x,_){v.then(function(){if(w[c]){x(f(void 0,!0));return}w[u](x,_)},_)}}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((t={get stream(){return this[d]},next:function(){var w=this,x=this[o];if(x!==null)return Promise.reject(x);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(I,$){process.nextTick(function(){w[o]?$(w[o]):I(f(void 0,!0))})});var _=this[l],S;if(_)S=new Promise(m(_,this));else{var A=this[d].read();if(A!==null)return Promise.resolve(f(A,!1));S=new Promise(this[u])}return this[l]=S,S}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var w=this;return new Promise(function(x,_){w[d].destroy(null,function(S){if(S){_(S);return}x(f(void 0,!0))})})}),t),y),E=function(w){var x,_=Object.create(b,(x={},e(x,d,{value:w,writable:!0}),e(x,s,{value:null,writable:!0}),e(x,a,{value:null,writable:!0}),e(x,o,{value:null,writable:!0}),e(x,c,{value:w._readableState.endEmitted,writable:!0}),e(x,u,{value:function(A,I){var $=_[d].read();$?(_[l]=null,_[s]=null,_[a]=null,A(f($,!1))):(_[s]=A,_[a]=I)},writable:!0}),x));return _[l]=null,i(w,function(S){if(S&&S.code!=="ERR_STREAM_PREMATURE_CLOSE"){var A=_[a];A!==null&&(_[l]=null,_[s]=null,_[a]=null,A(S)),_[o]=S;return}var I=_[s];I!==null&&(_[l]=null,_[s]=null,_[a]=null,I(f(void 0,!0))),_[c]=!0}),w.on("readable",g.bind(null,_)),_};return F4=E,F4}var U4,LO;function pEe(){return LO||(LO=1,U4=function(){throw new Error("Readable.from is not available in the browser")}),U4}var B4,FO;function _K(){if(FO)return B4;FO=1,B4=I;var t;I.ReadableState=A,PA().EventEmitter;var e=function(M,ee){return M.listeners(ee).length},r=vK(),n=B3().Buffer,i=(typeof Yn<"u"?Yn:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(R){return n.from(R)}function a(R){return n.isBuffer(R)||R instanceof i}var o=xB,c;o&&o.debuglog?c=o.debuglog("stream"):c=function(){};var l=dEe(),u=wK(),d=EK(),f=d.getHighWaterMark,h=R0().codes,g=h.ERR_INVALID_ARG_TYPE,m=h.ERR_STREAM_PUSH_AFTER_EOF,y=h.ERR_METHOD_NOT_IMPLEMENTED,b=h.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,E,v,w;Ro()(I,r);var x=u.errorOrDestroy,_=["error","close","destroy","pause","resume"];function S(R,M,ee){if(typeof R.prependListener=="function")return R.prependListener(M,ee);!R._events||!R._events[M]?R.on(M,ee):Array.isArray(R._events[M])?R._events[M].unshift(ee):R._events[M]=[ee,R._events[M]]}function A(R,M,ee){t=t||o0(),R=R||{},typeof ee!="boolean"&&(ee=M instanceof t),this.objectMode=!!R.objectMode,ee&&(this.objectMode=this.objectMode||!!R.readableObjectMode),this.highWaterMark=f(this,R,"readableHighWaterMark",ee),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.destroyed=!1,this.defaultEncoding=R.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,R.encoding&&(E||(E=DO().StringDecoder),this.decoder=new E(R.encoding),this.encoding=R.encoding)}function I(R){if(t=t||o0(),!(this instanceof I))return new I(R);var M=this instanceof t;this._readableState=new A(R,this,M),this.readable=!0,R&&(typeof R.read=="function"&&(this._read=R.read),typeof R.destroy=="function"&&(this._destroy=R.destroy)),r.call(this)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(M){this._readableState&&(this._readableState.destroyed=M)}}),I.prototype.destroy=u.destroy,I.prototype._undestroy=u.undestroy,I.prototype._destroy=function(R,M){M(R)},I.prototype.push=function(R,M){var ee=this._readableState,ie;return ee.objectMode?ie=!0:typeof R=="string"&&(M=M||ee.defaultEncoding,M!==ee.encoding&&(R=n.from(R,M),M=""),ie=!0),$(this,R,M,!1,ie)},I.prototype.unshift=function(R){return $(this,R,null,!0,!1)};function $(R,M,ee,ie,le){c("readableAddChunk",M);var ye=R._readableState;if(M===null)ye.reading=!1,D(R,ye);else{var fe;if(le||(fe=j(ye,M)),fe)x(R,fe);else if(ye.objectMode||M&&M.length>0)if(typeof M!="string"&&!ye.objectMode&&Object.getPrototypeOf(M)!==n.prototype&&(M=s(M)),ie)ye.endEmitted?x(R,new b):P(R,ye,M,!0);else if(ye.ended)x(R,new m);else{if(ye.destroyed)return!1;ye.reading=!1,ye.decoder&&!ee?(M=ye.decoder.write(M),ye.objectMode||M.length!==0?P(R,ye,M,!1):W(R,ye)):P(R,ye,M,!1)}else ie||(ye.reading=!1,W(R,ye))}return!ye.ended&&(ye.length<ye.highWaterMark||ye.length===0)}function P(R,M,ee,ie){M.flowing&&M.length===0&&!M.sync?(M.awaitDrain=0,R.emit("data",ee)):(M.length+=M.objectMode?1:ee.length,ie?M.buffer.unshift(ee):M.buffer.push(ee),M.needReadable&&q(R)),W(R,M)}function j(R,M){var ee;return!a(M)&&typeof M!="string"&&M!==void 0&&!R.objectMode&&(ee=new g("chunk",["string","Buffer","Uint8Array"],M)),ee}I.prototype.isPaused=function(){return this._readableState.flowing===!1},I.prototype.setEncoding=function(R){E||(E=DO().StringDecoder);var M=new E(R);this._readableState.decoder=M,this._readableState.encoding=this._readableState.decoder.encoding;for(var ee=this._readableState.buffer.head,ie="";ee!==null;)ie+=M.write(ee.data),ee=ee.next;return this._readableState.buffer.clear(),ie!==""&&this._readableState.buffer.push(ie),this._readableState.length=ie.length,this};var L=1073741824;function B(R){return R>=L?R=L:(R--,R|=R>>>1,R|=R>>>2,R|=R>>>4,R|=R>>>8,R|=R>>>16,R++),R}function k(R,M){return R<=0||M.length===0&&M.ended?0:M.objectMode?1:R!==R?M.flowing&&M.length?M.buffer.head.data.length:M.length:(R>M.highWaterMark&&(M.highWaterMark=B(R)),R<=M.length?R:M.ended?M.length:(M.needReadable=!0,0))}I.prototype.read=function(R){c("read",R),R=parseInt(R,10);var M=this._readableState,ee=R;if(R!==0&&(M.emittedReadable=!1),R===0&&M.needReadable&&((M.highWaterMark!==0?M.length>=M.highWaterMark:M.length>0)||M.ended))return c("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?me(this):q(this),null;if(R=k(R,M),R===0&&M.ended)return M.length===0&&me(this),null;var ie=M.needReadable;c("need readable",ie),(M.length===0||M.length-R<M.highWaterMark)&&
vendor: 9,667 bytes, line 425
425(ie=!0,c("length less than watermark",ie)),M.ended||M.reading?(ie=!1,c("reading or ended",ie)):ie&&(c("do read"),M.reading=!0,M.sync=!0,M.length===0&&(M.needReadable=!0),this._read(M.highWaterMark),M.sync=!1,M.reading||(R=k(ee,M)));var le;return R>0?le=se(R,M):le=null,le===null?(M.needReadable=M.length<=M.highWaterMark,R=0):(M.length-=R,M.awaitDrain=0),M.length===0&&(M.ended||(M.needReadable=!0),ee!==R&&M.ended&&me(this)),le!==null&&this.emit("data",le),le};function D(R,M){if(c("onEofChunk"),!M.ended){if(M.decoder){var ee=M.decoder.end();ee&&ee.length&&(M.buffer.push(ee),M.length+=M.objectMode?1:ee.length)}M.ended=!0,M.sync?q(R):(M.needReadable=!1,M.emittedReadable||(M.emittedReadable=!0,U(R)))}}function q(R){var M=R._readableState;c("emitReadable",M.needReadable,M.emittedReadable),M.needReadable=!1,M.emittedReadable||(c("emitReadable",M.flowing),M.emittedReadable=!0,process.nextTick(U,R))}function U(R){var M=R._readableState;c("emitReadable_",M.destroyed,M.length,M.ended),!M.destroyed&&(M.length||M.ended)&&(R.emit("readable"),M.emittedReadable=!1),M.needReadable=!M.flowing&&!M.ended&&M.length<=M.highWaterMark,Q(R)}function W(R,M){M.readingMore||(M.readingMore=!0,process.nextTick(V,R,M))}function V(R,M){for(;!M.reading&&!M.ended&&(M.length<M.highWaterMark||M.flowing&&M.length===0);){var ee=M.length;if(c("maybeReadMore read 0"),R.read(0),ee===M.length)break}M.readingMore=!1}I.prototype._read=function(R){x(this,new y("_read()"))},I.prototype.pipe=function(R,M){var ee=this,ie=this._readableState;switch(ie.pipesCount){case 0:ie.pipes=R;break;case 1:ie.pipes=[ie.pipes,R];break;default:ie.pipes.push(R);break}ie.pipesCount+=1,c("pipe count=%d opts=%j",ie.pipesCount,M);var le=(!M||M.end!==!1)&&R!==process.stdout&&R!==process.stderr,ye=le?we:Qe;ie.endEmitted?process.nextTick(ye):ee.once("end",ye),R.on("unpipe",fe);function fe(O,T){c("onunpipe"),O===ee&&T&&T.hasUnpiped===!1&&(T.hasUnpiped=!0,Re())}function we(){c("onend"),R.end()}var Ce=Y(ee);R.on("drain",Ce);var ne=!1;function Re(){c("cleanup"),R.removeListener("close",Ue),R.removeListener("finish",He),R.removeListener("drain",Ce),R.removeListener("error",Ae),R.removeListener("unpipe",fe),ee.removeListener("end",we),ee.removeListener("end",Qe),ee.removeListener("data",Pe),ne=!0,ie.awaitDrain&&(!R._writableState||R._writableState.needDrain)&&Ce()}ee.on("data",Pe);function Pe(O){c("ondata");var T=R.write(O);c("dest.write",T),T===!1&&((ie.pipesCount===1&&ie.pipes===R||ie.pipesCount>1&&z(ie.pipes,R)!==-1)&&!ne&&(c("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ee.pause())}function Ae(O){c("onerror",O),Qe(),R.removeListener("error",Ae),e(R,"error")===0&&x(R,O)}S(R,"error",Ae);function Ue(){R.removeListener("finish",He),Qe()}R.once("close",Ue);function He(){c("onfinish"),R.removeListener("close",Ue),Qe()}R.once("finish",He);function Qe(){c("unpipe"),ee.unpipe(R)}return R.emit("pipe",ee),ie.flowing||(c("pipe resume"),ee.resume()),R};function Y(R){return function(){var ee=R._readableState;c("pipeOnDrain",ee.awaitDrain),ee.awaitDrain&&ee.awaitDrain--,ee.awaitDrain===0&&e(R,"data")&&(ee.flowing=!0,Q(R))}}I.prototype.unpipe=function(R){var M=this._readableState,ee={hasUnpiped:!1};if(M.pipesCount===0)return this;if(M.pipesCount===1)return R&&R!==M.pipes?this:(R||(R=M.pipes),M.pipes=null,M.pipesCount=0,M.flowing=!1,R&&R.emit("unpipe",this,ee),this);if(!R){var ie=M.pipes,le=M.pipesCount;M.pipes=null,M.pipesCount=0,M.flowing=!1;for(var ye=0;ye<le;ye++)ie[ye].emit("unpipe",this,{hasUnpiped:!1});return this}var fe=z(M.pipes,R);return fe===-1?this:(M.pipes.splice(fe,1),M.pipesCount-=1,M.pipesCount===1&&(M.pipes=M.pipes[0]),R.emit("unpipe",this,ee),this)},I.prototype.on=function(R,M){var ee=r.prototype.on.call(this,R,M),ie=this._readableState;return R==="data"?(ie.readableListening=this.listenerCount("readable")>0,ie.flowing!==!1&&this.resume()):R==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,c("on readable",ie.length,ie.reading),ie.length?q(this):ie.reading||process.nextTick(ge,this)),ee},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(R,M){var ee=r.prototype.removeListener.call(this,R,M);return R==="readable"&&process.nextTick(K,this),ee},I.prototype.removeAllListeners=function(R){var M=r.prototype.removeAllListeners.apply(this,arguments);return(R==="readable"||R===void 0)&&process.nextTick(K,this),M};function K(R){var M=R._readableState;M.readableListening=R.listenerCount("readable")>0,M.resumeScheduled&&!M.paused?M.flowing=!0:R.listenerCount("data")>0&&R.resume()}function ge(R){c("readable nexttick read 0"),R.read(0)}I.prototype.resume=function(){var R=this._readableState;return R.flowing||(c("resume"),R.flowing=!R.readableListening,ae(this,R)),R.paused=!1,this};function ae(R,M){M.resumeScheduled||(M.resumeScheduled=!0,process.nextTick(ce,R,M))}function ce(R,M){c("resume",M.reading),M.reading||R.read(0),M.resumeScheduled=!1,R.emit("resume"),Q(R),M.flowing&&!M.reading&&R.read(0)}I.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Q(R){var M=R._readableState;for(c("flow",M.flowing);M.flowing&&R.read()!==null;);}I.prototype.wrap=function(R){var M=this,ee=this._readableState,ie=!1;R.on("end",function(){if(c("wrapped end"),ee.decoder&&!ee.ended){var fe=ee.decoder.end();fe&&fe.length&&M.push(fe)}M.push(null)}),R.on("data",function(fe){if(c("wrapped data"),ee.decoder&&(fe=ee.decoder.write(fe)),!(ee.objectMode&&fe==null)&&!(!ee.objectMode&&(!fe||!fe.length))){var we=M.push(fe);we||(ie=!0,R.pause())}});for(var le in R)this[le]===void 0&&typeof R[le]=="function"&&(this[le]=(function(we){return function(){return R[we].apply(R,arguments)}})(le));for(var ye=0;ye<_.length;ye++)R.on(_[ye],this.emit.bind(this,_[ye]));return this._read=function(fe){c("wrapped _read",fe),ie&&(ie=!1,R.resume())},this},typeof Symbol=="function"&&(I.prototype[Symbol.asyncIterator]=function(){return v===void 0&&(v=hEe()),v(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(M){this._readableState&&(this._readableState.flowing=M)}}),I._fromList=se,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function se(R,M){if(M.length===0)return null;var ee;return M.objectMode?ee=M.buffer.shift():!R||R>=M.length?(M.decoder?ee=M.buffer.join(""):M.buffer.length===1?ee=M.buffer.first():ee=M.buffer.concat(M.length),M.buffer.clear()):ee=M.buffer.consume(R,M.decoder),ee}function me(R){var M=R._readableState;c("endReadable",M.endEmitted),M.endEmitted||(M.ended=!0,process.nextTick(_e,M,R))}function _e(R,M){if(c("endReadableNT",R.endEmitted,R.length),!R.endEmitted&&R.length===0&&(R.endEmitted=!0,M.readable=!1,M.emit("end"),R.autoDestroy)){var ee=M._writableState;(!ee||ee.autoDestroy&&ee.finished)&&M.destroy()}}typeof Symbol=="function"&&(I.from=function(R,M){return w===void 0&&(w=pEe()),w(I,R,M)});function z(R,M){for(var ee=0,ie=R.length;ee<ie;ee++)if(R[ee]===M)return ee;return-1}return B4}var q4,UO;function CK(){if(UO)return q4;UO=1,q4=o;var t=R0().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,r=t.ERR_MULTIPLE_CALLBACK,n=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,s=o0();Ro()(o,s);function a(u,d){var f=this._transformState;f.transforming=!1;var h=f.writecb;if(h===null)return this.emit("error",new r);f.writechunk=null,f.writecb=null,d!=null&&this.push(d),h(u);var g=this._readableState;g.reading=!1,(g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}function o(u){if(!(this instanceof o))return new o(u);s.call(this,u),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",c)}function c(){var u=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(d,f){l(u,d,f)}):l(this,null,null)}o.prototype.push=function(u,d){return this._transformState.needTransform=!1,s.prototype.push.call(this,u,d)},o.prototype._transform=function(u,d,f){f(new e("_transform()"))},o.prototype._write=function(u,d,f){var h=this._transformState;if(h.writecb=f,h.writechunk=u,h.writeencoding=d,!h.transforming){var g=this._readableState;(h.needTransform||g.needReadable||g.length<g.highWaterMark)&&this._read(g.highWaterMark)}},o.prototype._read=function(u){var d=this._transformState;d.writechunk!==null&&!d.transforming?(d.transforming=!0,this._transform(d.writechunk,d.writeencoding,d.afterTransform)):d.needTransform=!0},o.prototype._destroy=function(u,d){s.prototype._destroy.call(this,u,function(f){d(f)})};function l(u,d,f){if(d)return u.emit("error",d);if(f!=null&&u.push(f),u._writableState.length)throw new i;if(u._transformState.transforming)throw new n;return u.push(null)}return q4}var W4,BO;function gEe(){if(BO)return W4;BO=1,W4=e;var t=CK();Ro()(e,t);function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return e.prototype._transform=function(r,n,i){i(null,r)},W4}var z4,qO;
425function mEe(){if(qO)return z4;qO=1;var t;function e(f){var h=!1;return function(){h||(h=!0,f.apply(void 0,arguments))}}var r=R0().codes,n=r.ERR_MISSING_ARGS,i=r.ERR_STREAM_DESTROYED;function s(f){if(f)throw f}function a(f){return f.setHeader&&typeof f.abort=="function"}function o(f,h,g,m){m=e(m);var y=!1;f.on("close",function(){y=!0}),t===void 0&&(t=OA()),t(f,{readable:h,writable:g},function(E){if(E)return m(E);y=!0,m()});var b=!1;return function(E){if(!y&&!b){if(b=!0,a(f))return f.abort();if(typeof f.destroy=="function")return f.destroy();m(E||new i("pipe"))}}}function c(f){f()}function l(f,h){return f.pipe(h)}function u(f){return!f.length||typeof f[f.length-1]!="function"?s:f.pop()}function d(){for(var f=arguments.length,h=new Array(f),g=0;g<f;g++)h[g]=arguments[g];var m=u(h);if(Array.isArray(h[0])&&(h=h[0]),h.length<2)throw new n("streams");var y,b=h.map(function(E,v){var w=v<h.length-1,x=v>0;return o(E,w,x,function(_){y||(y=_),_&&b.forEach(c),!w&&(b.forEach(c),m(y))})});return h.reduce(l)}return z4=d,z4}var WO;function SK(){return WO||(WO=1,(function(t,e){e=t.exports=_K(),e.Stream=e,e.Readable=e,e.Writable=xK(),e.Duplex=o0(),e.Transform=CK(),e.PassThrough=gEe(),e.finished=OA(),e.pipeline=mEe()})(U2,U2.exports)),U2.exports}var V4,zO;function yEe(){if(zO)return V4;zO=1;const{Transform:t}=SK();return V4=e=>class AK extends t{constructor(n,i,s,a,o){super(o),this._rate=n,this._capacity=i,this._delimitedSuffix=s,this._hashBitLength=a,this._options=o,this._state=new e,this._state.initialize(n,i),this._finalized=!1}_transform(n,i,s){let a=null;try{this.update(n,i)}catch(o){a=o}s(a)}_flush(n){let i=null;try{this.push(this.digest())}catch(s){i=s}n(i)}update(n,i){if(!Buffer.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(n)||(n=Buffer.from(n,i)),this._state.absorb(n),this}digest(n){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let i=this._state.squeeze(this._hashBitLength/8);return n!==void 0&&(i=i.toString(n)),this._resetState(),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new AK(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}},V4}var H4,VO;function bEe(){if(VO)return H4;VO=1;const{Transform:t}=SK();return H4=e=>class TK extends t{constructor(n,i,s,a){super(a),this._rate=n,this._capacity=i,this._delimitedSuffix=s,this._options=a,this._state=new e,this._state.initialize(n,i),this._finalized=!1}_transform(n,i,s){let a=null;try{this.update(n,i)}catch(o){a=o}s(a)}_flush(){}_read(n){this.push(this.squeeze(n))}update(n,i){if(!Buffer.isBuffer(n)&&typeof n!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(n)||(n=Buffer.from(n,i)),this._state.absorb(n),this}squeeze(n,i){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let s=this._state.squeeze(n);return i!==void 0&&(s=s.toString(i)),s}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const n=new TK(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(n._state),n._finalized=this._finalized,n}},H4}var G4,HO;function vEe(){if(HO)return G4;HO=1;const t=yEe(),e=bEe();return G4=function(r){const n=t(r),i=e(r);return function(s,a){switch(typeof s=="string"?s.toLowerCase():s){case"keccak224":return new n(1152,448,null,224,a);case"keccak256":return new n(1088,512,null,256,a);case"keccak384":return new n(832,768,null,384,a);case"keccak512":return new n(576,1024,null,512,a);case"sha3-224":return new n(1152,448,6,224,a);case"sha3-256":return new n(1088,512,6,256,a);case"sha3-384":return new n(832,768,6,384,a);case"sha3-512":return new n(576,1024,6,512,a);case"shake128":return new i(1344,256,31,a);case"shake256":return new i(1088,512,31,a);default:throw new Error("Invald algorithm: "+s)}}},G4}var K4={},GO;function wEe(){if(GO)return K4;GO=1;const t=[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];return K4.p1600=function(e){for(let r=0;r<24;++r){const n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49];let h=d^(s<<1|a>>>31),g=f^(a<<1|s>>>31);const m=e[0]^h,y=e[1]^g,b=e[10]^h,E=e[11]^g,v=e[20]^h,w=e[21]^g,x=e[30]^h,_=e[31]^g,S=e[40]^h,A=e[41]^g;h=n^(o<<1|c>>>31),g=i^(c<<1|o>>>31);const I=e[2]^h,$=e[3]^g,P=e[12]^h,j=e[13]^g,L=e[22]^h,B=e[23]^g,k=e[32]^h,D=e[33]^g,q=e[42]^h,U=e[43]^g;h=s^(l<<1|u>>>31),g=a^(u<<1|l>>>31);const W=e[4]^h,V=e[5]^g,Y=e[14]^h,K=e[15]^g,ge=e[24]^h,ae=e[25]^g,ce=e[34]^h,Q=e[35]^g,se=e[44]^h,me=e[45]^g;h=o^(d<<1|f>>>31),g=c^(f<<1|d>>>31);const _e=e[6]^h,z=e[7]^g,R=e[16]^h,M=e[17]^g,ee=e[26]^h,ie=e[27]^g,le=e[36]^h,ye=e[37]^g,fe=e[46]^h,we=e[47]^g;h=l^(n<<1|i>>>31),g=u^(i<<1|n>>>31);const Ce=e[8]^h,ne=e[9]^g,Re=e[18]^h,Pe=e[19]^g,Ae=e[28]^h,Ue=e[29]^g,He=e[38]^h,Qe=e[39]^g,O=e[48]^h,T=e[49]^g,N=m,G=y,te=E<<4|b>>>28,ue=b<<4|E>>>28,pe=v<<3|w>>>29,Ie=w<<3|v>>>29,je=_<<9|x>>>23,Te=x<<9|_>>>23,ve=S<<18|A>>>14,Oe=A<<18|S>>>14,at=I<<1|$>>>31,gt=$<<1|I>>>31,$t=j<<12|P>>>20,ir=P<<12|j>>>20,_r=L<<10|B>>>22,Ar=B<<10|L>>>22,Zt=D<<13|k>>>19,dr=k<<13|D>>>19,gn=q<<2|U>>>30,Ti=U<<2|q>>>30,Ks=V<<30|W>>>2,ti=W<<30|V>>>2,xn=Y<<6|K>>>26,Jr=K<<6|Y>>>26,Qs=ae<<11|ge>>>21,Wi=ge<<11|ae>>>21,jt=ce<<15|Q>>>17,Wa=Q<<15|ce>>>17,$e=me<<29|se>>>3,We=se<<29|me>>>3,Ke=_e<<28|z>>>4,rt=z<<28|_e>>>4,Ze=M<<23|R>>>9,_t=R<<23|M>>>9,Et=ee<<25|ie>>>7,F=ie<<25|ee>>>7,H=le<<21|ye>>>11,J=ye<<21|le>>>11,Z=we<<24|fe>>>8,X=fe<<24|we>>>8,Ee=Ce<<27|ne>>>5,Me=ne<<27|Ce>>>5,De=Re<<20|Pe>>>12,Be=Pe<<20|Re>>>12,Je=Ue<<7|Ae>>>25,nt=Ae<<7|Ue>>>25,et=He<<8|Qe>>>24,Ct=Qe<<8|He>>>24,Nt=O<<14|T>>>18,nr=T<<14|O>>>18;e[0]=N^~$t&Qs,e[1]=G^~ir&Wi,e[10]=Ke^~De&pe,e[11]=rt^~Be&Ie,e[20]=at^~xn&Et,e[21]=gt^~Jr&F,e[30]=Ee^~te&_r,e[31]=Me^~ue&Ar,e[40]=Ks^~Ze&Je,e[41]=ti^~_t&nt,e[2]=$t^~Qs&H,e[3]=ir^~Wi&J,e[12]=De^~pe&Zt,e[13]=Be^~Ie&dr,e[22]=xn^~Et&et,e[23]=Jr^~F&Ct,e[32]=te^~_r&jt,e[33]=ue^~Ar&Wa,e[42]=Ze^~Je&je,e[43]=_t^~nt&Te,e[4]=Qs^~H&Nt,e[5]=Wi^~J&nr,e[14]=pe^~Zt&$e,e[15]=Ie^~dr&We,e[24]=Et^~et&ve,e[25]=F^~Ct&Oe,e[34]=_r^~jt&Z,e[35]=Ar^~Wa&X,e[44]=Je^~je&gn,e[45]=nt^~Te&Ti,e[6]=H^~Nt&N,e[7]=J^~nr&G,e[16]=Zt^~$e&Ke,e[17]=dr^~We&rt,e[26]=et^~ve&at,e[27]=Ct^~Oe>,e[36]=jt^~Z&Ee,e[37]=Wa^~X&Me,e[46]=je^~gn&Ks,e[47]=Te^~Ti&ti,e[8]=Nt^~N&$t,e[9]=nr^~G&ir,e[18]=$e^~Ke&De,e[19]=We^~rt&Be,e[28]=ve^~at&xn,e[29]=Oe^~gt&Jr,e[38]=Z^~Ee&te,e[39]=X^~Me&ue,e[48]=gn^~Ks&Ze,e[49]=Ti^~ti&_t,e[0]^=t[r*2],e[1]^=t[r*2+1]}},K4}var Q4,KO;function EEe(){if(KO)return Q4;KO=1;const t=wEe();function e(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}return e.prototype.initialize=function(r,n){for(let i=0;i<50;++i)this.state[i]=0;this.blockSize=r/8,this.count=0,this.squeezing=!1},e.prototype.absorb=function(r){for(let n=0;n<r.length;++n)this.state[~~(this.count/4)]^=r[n]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(t.p1600(this.state),this.count=0)},e.prototype.absorbLastFewBits=function(r){this.state[~~(this.count/4)]^=r<<8*(this.count%4),(r&128)!==0&&this.count===this.blockSize-1&&t.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),t.p1600(this.state),this.count=0,this.squeezing=!0},e.prototype.squeeze=function(r){this.squeezing||this.absorbLastFewBits(1);const n=Buffer.alloc(r);for(let i=0;i<r;++i)n[i]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(t.p1600(this.state),this.count=0);return n},e.prototype.copy=function(r){for(let n=0;n<50;++n)r.state[n]=this.state[n];r.blockSize=this.blockSize,r.count=this.count,r.squeezing=this.squeezing},Q4=e,Q4}var Y4,QO;function xEe(){return QO||(QO=1,Y4=vEe()(EEe())),Y4}var Z4,YO;function IK(){if(YO)return Z4;YO=1;const t=xEe();function e(h){return Buffer.allocUnsafe(h).fill(0)}function r(h){return h.toString(2).length}function n(h,g){let m=h.toString(16);m.length%2!==0&&(m="0"+m);const y=m.match(/.{1,2}/g).map(b=>parseInt(b,16));for(;y.length<g;)y.unshift(0);return Buffer.from(y)}function i(h,g){const m=h<0n;let y;if(m){const b=(1n<<BigInt(g))-1n;y=(~h&b)+1n}else y=h;return y&=(1n<<BigInt(g))-1n,y}function s(h,g,m){const y=e(g);return h=o(h),m?h.length<g?(h.copy(y),y):h.slice(0,g):h.length<g?(h.copy(y,g-h.length),y):h.slice(-g)}function a(h,g){return s(h,g,!0)}function o(h){if(!Buffer.isBuffer(h))if(Array.isArray(h))h=Buffer.from(h);else if(typeof h=="string")d(h)?h=Buffer.from(u(f(h)),"hex"):h=Buffer.from(h);else if(typeof h=="number")h=intToBuffer(h);else if(h==null)h=Buffer.allocUnsafe(0);else if(typeof h=="bigint")h=n(h);else if(h.toArray)h=Buffer.from(h.toArray());else throw new Error("invalid type");return h}function c(h){return h=o(h),"0x"+h.toString("hex")}function l(h,g){return h=o(h),g||(g=256),t("keccak"+g).update(h).digest()}function u(h){return h.length%2?"0"+h:h}function d(h){return typeof h=="string"&&h.match(/^0x[0-9A-Fa-f]*$/)}function f(h){return typeof h=="string"&&h.startsWith("0x")?h.slice(2):h}return Z4={zeros:e,setLength:s,setLengthRight:a,isHexString:d,stripHexPrefix:f,toBuffer:o,bufferToHex:c,keccak:l,bitLengthFromBigInt:r,bufferBEFromBigInt:n,twosFromBigInt:i},Z4}var X4,ZO;
425function _Ee(){if(ZO)return X4;ZO=1;const t=IK();function e(f){return f.startsWith("int[")?"int256"+f.slice(3):f==="int"?"int256":f.startsWith("uint[")?"uint256"+f.slice(4):f==="uint"?"uint256":f.startsWith("fixed[")?"fixed128x128"+f.slice(5):f==="fixed"?"fixed128x128":f.startsWith("ufixed[")?"ufixed128x128"+f.slice(6):f==="ufixed"?"ufixed128x128":f}function r(f){return parseInt(/^\D+(\d+)$/.exec(f)[1],10)}function n(f){var h=/^\D+(\d+)x(\d+)$/.exec(f);return[parseInt(h[1],10),parseInt(h[2],10)]}function i(f){var h=f.match(/(.*)\[(.*?)\]$/);return h?h[2]===""?"dynamic":parseInt(h[2],10):null}function s(f){var h=typeof f;if(h==="string"||h==="number")return BigInt(f);if(h==="bigint")return f;throw new Error("Argument is not a number")}function a(f,h){var g,m,y,b;if(f==="address")return a("uint160",s(h));if(f==="bool")return a("uint8",h?1:0);if(f==="string")return a("bytes",new Buffer(h,"utf8"));if(c(f)){if(typeof h.length>"u")throw new Error("Not an array?");if(g=i(f),g!=="dynamic"&&g!==0&&h.length>g)throw new Error("Elements exceed array size: "+g);y=[],f=f.slice(0,f.lastIndexOf("[")),typeof h=="string"&&(h=JSON.parse(h));for(b in h)y.push(a(f,h[b]));if(g==="dynamic"){var E=a("uint256",h.length);y.unshift(E)}return Buffer.concat(y)}else{if(f==="bytes")return h=new Buffer(h),y=Buffer.concat([a("uint256",h.length),h]),h.length%32!==0&&(y=Buffer.concat([y,t.zeros(32-h.length%32)])),y;if(f.startsWith("bytes")){if(g=r(f),g<1||g>32)throw new Error("Invalid bytes<N> width: "+g);return t.setLengthRight(h,32)}else if(f.startsWith("uint")){if(g=r(f),g%8||g<8||g>256)throw new Error("Invalid uint<N> width: "+g);m=s(h);const v=t.bitLengthFromBigInt(m);if(v>g)throw new Error("Supplied uint exceeds width: "+g+" vs "+v);if(m<0)throw new Error("Supplied uint is negative");return t.bufferBEFromBigInt(m,32)}else if(f.startsWith("int")){if(g=r(f),g%8||g<8||g>256)throw new Error("Invalid int<N> width: "+g);m=s(h);const v=t.bitLengthFromBigInt(m);if(v>g)throw new Error("Supplied int exceeds width: "+g+" vs "+v);const w=t.twosFromBigInt(m,256);return t.bufferBEFromBigInt(w,32)}else if(f.startsWith("ufixed")){if(g=n(f),m=s(h),m<0)throw new Error("Supplied ufixed is negative");return a("uint256",m*BigInt(2)**BigInt(g[1]))}else if(f.startsWith("fixed"))return g=n(f),a("int256",s(h)*BigInt(2)**BigInt(g[1]))}throw new Error("Unsupported or invalid type: "+f)}function o(f){return f==="string"||f==="bytes"||i(f)==="dynamic"}function c(f){return f.lastIndexOf("]")===f.length-1}function l(f,h){var g=[],m=[],y=32*f.length;for(var b in f){var E=e(f[b]),v=h[b],w=a(E,v);o(E)?(g.push(a("uint256",y)),m.push(w),y+=w.length):g.push(w)}return Buffer.concat(g.concat(m))}function u(f,h){if(f.length!==h.length)throw new Error("Number of types are not matching the values");for(var g,m,y=[],b=0;b<f.length;b++){var E=e(f[b]),v=h[b];if(E==="bytes")y.push(v);else if(E==="string")y.push(new Buffer(v,"utf8"));else if(E==="bool")y.push(new Buffer(v?"01":"00","hex"));else if(E==="address")y.push(t.setLength(v,20));else if(E.startsWith("bytes")){if(g=r(E),g<1||g>32)throw new Error("Invalid bytes<N> width: "+g);y.push(t.setLengthRight(v,g))}else if(E.startsWith("uint")){if(g=r(E),g%8||g<8||g>256)throw new Error("Invalid uint<N> width: "+g);m=s(v);const w=t.bitLengthFromBigInt(m);if(w>g)throw new Error("Supplied uint exceeds width: "+g+" vs "+w);y.push(t.bufferBEFromBigInt(m,g/8))}else if(E.startsWith("int")){if(g=r(E),g%8||g<8||g>256)throw new Error("Invalid int<N> width: "+g);m=s(v);const w=t.bitLengthFromBigInt(m);if(w>g)throw new Error("Supplied int exceeds width: "+g+" vs "+w);const x=t.twosFromBigInt(m,g);y.push(t.bufferBEFromBigInt(x,g/8))}else throw new Error("Unsupported or invalid type: "+E)}return Buffer.concat(y)}function d(f,h){return t.keccak(u(f,h))}return X4={rawEncode:l,solidityPack:u,soliditySHA3:d},X4}var J4,XO;function CEe(){if(XO)return J4;XO=1;const t=IK(),e=_Ee(),r={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},n={encodeData(s,a,o,c=!0){const l=["bytes32"],u=[this.hashType(s,o)];if(c){const d=(f,h,g)=>{if(o[h]!==void 0)return["bytes32",g==null?"0x0000000000000000000000000000000000000000000000000000000000000000":t.keccak(this.encodeData(h,g,o,c))];if(g===void 0)throw new Error(`missing value for field ${f} of type ${h}`);
425if(h==="bytes")return["bytes32",t.keccak(g)];if(h==="string")return typeof g=="string"&&(g=Buffer.from(g,"utf8")),["bytes32",t.keccak(g)];if(h.lastIndexOf("]")===h.length-1){const m=h.slice(0,h.lastIndexOf("[")),y=g.map(b=>d(f,m,b));return["bytes32",t.keccak(e.rawEncode(y.map(([b])=>b),y.map(([,b])=>b)))]}return[h,g]};for(const f of o[s]){const[h,g]=d(f.name,f.type,a[f.name]);l.push(h),u.push(g)}}else for(const d of o[s]){let f=a[d.name];if(f!==void 0)if(d.type==="bytes")l.push("bytes32"),f=t.keccak(f),u.push(f);else if(d.type==="string")l.push("bytes32"),typeof f=="string"&&(f=Buffer.from(f,"utf8")),f=t.keccak(f),u.push(f);else if(o[d.type]!==void 0)l.push("bytes32"),f=t.keccak(this.encodeData(d.type,f,o,c)),u.push(f);else{if(d.type.lastIndexOf("]")===d.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");l.push(d.type),u.push(f)}}return e.rawEncode(l,u)},encodeType(s,a){let o="",c=this.findTypeDependencies(s,a).filter(l=>l!==s);c=[s].concat(c.sort());for(const l of c){if(!a[l])throw new Error("No type definition specified: "+l);o+=l+"("+a[l].map(({name:d,type:f})=>f+" "+d).join(",")+")"}return o},findTypeDependencies(s,a,o=[]){if(s=s.match(/^\w*/)[0],o.includes(s)||a[s]===void 0)return o;o.push(s);for(const c of a[s])for(const l of this.findTypeDependencies(c.type,a,o))!o.includes(l)&&o.push(l);return o},hashStruct(s,a,o,c=!0){return t.keccak(this.encodeData(s,a,o,c))},hashType(s,a){return t.keccak(this.encodeType(s,a))},sanitizeData(s){const a={};for(const o in r.properties)s[o]&&(a[o]=s[o]);return a.types&&(a.types=Object.assign({EIP712Domain:[]},a.types)),a},hash(s,a=!0){const o=this.sanitizeData(s),c=[Buffer.from("1901","hex")];return c.push(this.hashStruct("EIP712Domain",o.domain,o.types,a)),o.primaryType!=="EIP712Domain"&&c.push(this.hashStruct(o.primaryType,o.message,o.types,a)),t.keccak(Buffer.concat(c))}};J4={TYPED_MESSAGE_SCHEMA:r,TypedDataUtils:n,hashForSignTypedDataLegacy:function(s){return i(s.data)},hashForSignTypedData_v3:function(s){return n.hash(s.data,!1)},hashForSignTypedData_v4:function(s){return n.hash(s.data)}};function i(s){const a=new Error("Expect argument to be non-empty array");if(typeof s!="object"||!s.length)throw a;const o=s.map(function(u){return u.type==="bytes"?t.toBuffer(u.value):u.value}),c=s.map(function(u){return u.type}),l=s.map(function(u){if(!u.name)throw a;return u.type+" "+u.name});return e.soliditySHA3(["bytes32","bytes32"],[e.soliditySHA3(new Array(s.length).fill("string"),l),e.soliditySHA3(c,o)])}return J4}var Nc={},JO;function RA(){return JO||(JO=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.APP_VERSION_KEY=Nc.LOCAL_STORAGE_ADDRESSES_KEY=Nc.WALLET_USER_NAME_KEY=void 0,Nc.WALLET_USER_NAME_KEY="walletUsername",Nc.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",Nc.APP_VERSION_KEY="AppVersion"),Nc}var Cg={},eR;function kK(){if(eR)return Cg;eR=1,Object.defineProperty(Cg,"__esModule",{value:!0}),Cg.RelayEventManager=void 0;const t=Ul();let e=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const n=this._nextRequestId,i=(0,t.prepend0x)(n.toString(16));return this.callbacks.get(i)&&this.callbacks.delete(i),n}};return Cg.RelayEventManager=e,Cg}var Sg={},Ag={},Tg={},tR;function SEe(){if(tR)return Tg;tR=1,Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.WalletLinkCipher=void 0;const t=Ul();let e=class{constructor(n){this.secret=n}async encrypt(n){const i=this.secret;if(i.length!==64)throw Error("secret must be 256 bits");const s=crypto.getRandomValues(new Uint8Array(12)),a=await crypto.subtle.importKey("raw",(0,t.hexStringToUint8Array)(i),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},a,o.encode(n)),l=16,u=c.slice(c.byteLength-l),d=c.slice(0,c.byteLength-l),f=new Uint8Array(u),h=new Uint8Array(d),g=new Uint8Array([...s,...f,...h]);return(0,t.uint8ArrayToHex)(g)}async decrypt(n){const i=this.secret;if(i.length!==64)throw Error("secret must be 256 bits");return new Promise((s,a)=>{(async function(){const o=await crypto.subtle.importKey("raw",(0,t.hexStringToUint8Array)(i),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,t.hexStringToUint8Array)(n),l=c.slice(0,12),u=c.slice(12,28),d=c.slice(28),f=new Uint8Array([...d,...u]),h={name:"AES-GCM",iv:new Uint8Array(l)};try{const g=await window.crypto.subtle.decrypt(h,o,f),m=new TextDecoder;s(m.decode(g))}catch(g){a(g)}})()})}};return Tg.WalletLinkCipher=e,Tg}var Ig={},rR;
425function AEe(){if(rR)return Ig;rR=1,Object.defineProperty(Ig,"__esModule",{value:!0}),Ig.WalletLinkHTTP=void 0;let t=class{constructor(r,n,i){this.linkAPIUrl=r,this.sessionId=n;const s=`${n}:${i}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(r){return Promise.all(r.map(n=>fetch(`${this.linkAPIUrl}/events/${n.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(n=>console.error("Unabled to mark event as failed:",n))}async fetchUnseenEvents(){var r;const n=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(n.ok){const{events:i,error:s}=await n.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const a=(r=i==null?void 0:i.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&r!==void 0?r:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${n.status}`)}};return Ig.WalletLinkHTTP=t,Ig}var Sd={},nR;function TEe(){if(nR)return Sd;nR=1,Object.defineProperty(Sd,"__esModule",{value:!0}),Sd.WalletLinkWebSocket=Sd.ConnectionState=void 0;var t;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(t||(Sd.ConnectionState=t={}));let e=class{setConnectionStateListener(n){this.connectionStateListener=n}setIncomingDataListener(n){this.incomingDataListener=n}constructor(n,i=WebSocket){this.WebSocketClass=i,this.webSocket=null,this.pendingData=[],this.url=n.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((n,i)=>{var s;let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(o){i(o);return}(s=this.connectionStateListener)===null||s===void 0||s.call(this,t.CONNECTING),a.onclose=o=>{var c;this.clearWebSocket(),i(new Error(`websocket error ${o.code}: ${o.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,t.DISCONNECTED)},a.onopen=o=>{var c;n(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,t.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(u=>this.sendData(u)),this.pendingData=[])},a.onmessage=o=>{var c,l;if(o.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const u=JSON.parse(o.data);(l=this.incomingDataListener)===null||l===void 0||l.call(this,u)}catch{}}})}disconnect(){var n;const{webSocket:i}=this;if(i){this.clearWebSocket(),(n=this.connectionStateListener)===null||n===void 0||n.call(this,t.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{i.close()}catch{}}}sendData(n){const{webSocket:i}=this;if(!i){this.pendingData.push(n),this.connect();return}i.send(n)}clearWebSocket(){const{webSocket:n}=this;n&&(this.webSocket=null,n.onclose=null,n.onerror=null,n.onmessage=null,n.onopen=null)}};return Sd.WalletLinkWebSocket=e,Sd}var iR;function IEe(){if(iR)return Ag;iR=1,Object.defineProperty(Ag,"__esModule",{value:!0}),Ag.WalletLinkConnection=void 0;const t=RA(),e=SEe(),r=AEe(),n=TEe(),i=NA(),s=1e4,a=6e4;let o=class{constructor({session:l,linkAPIUrl:u,listener:d,WebSocketClass:f=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,i.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=g=>{if(!g)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",y=>g.JsonRpcUrl&&this.handleChainUpdated(y,g.JsonRpcUrl)]]).forEach((y,b)=>{const E=g[b];E!==void 0&&y(E)})},this.handleDestroyed=g=>{var m;g==="1"&&((m=this.listener)===null||m===void 0||m.resetAndReload())},this.handleAccountUpdated=async g=>{var m;{const y=await this.cipher.decrypt(g);(m=this.listener)===null||m===void 0||m.accountUpdated(y)}},this.handleMetadataUpdated=async(g,m)=>{var y;{const b=await this.cipher.decrypt(m);(y=this.listener)===null||y===void 0||y.metadataUpdated(g,b)}},this.handleWalletUsernameUpdated=async g=>{this.handleMetadataUpdated(t.WALLET_USER_NAME_KEY,g)},this.handleAppVersionUpdated=async g=>{this.handleMetadataUpdated(t.APP_VERSION_KEY,g)},this.handleChainUpdated=async(g,m)=>{var y;{const b=await this.cipher.decrypt(g),E=await this.cipher.decrypt(m);(y=this.listener)===null||y===void 0||y.chainUpdated(b,E)}},this.session=l,this.cipher=new e.WalletLinkCipher(l.secret),this.listener=d;const h=new n.WalletLinkWebSocket(`${u}/rpc`,f);h.setConnectionStateListener(async g=>{let m=!1;switch(g){case n.ConnectionState.DISCONNECTED:if(!this.destroyed){const y=async()=>{await new Promise(b=>setTimeout(b,5e3)),this.destroyed||h.connect().catch(()=>{y()})};y()}break;case n.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),m=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},s),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case n.ConnectionState.CONNECTING:break}this.connected!==m&&(this.connected=m)}),h.setIncomingDataListener(g=>{var m;switch(g.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const y=g.type==="IsLinkedOK"?g.linked:void 0;this.linked=y||g.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(g.metadata);break}case"Event":{this.handleIncomingEvent(g);break}}g.id!==void 0&&((m=this.requestResolutions.get(g.id))===null||m===void 0||m(g))}),this.ws=h,this.http=new r.WalletLinkHTTP(u,l.id,l.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(l){var u;this._connected=l,l&&((u=this.onceConnected)===null||u===void 0||u.call(this))}setOnceConnected(l){return new Promise(u=>{this.connected?l().then(u):this.onceConnected=()=>{l().then(u),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(l){var u,d;this._linked=l,l&&((u=this.onceLinked)===null||u===void 0||u.call(this)),(d=this.listener)===null||d===void 0||d.linkedUpdated(l)}setOnceLinked(l){return new Promise(u=>{this.linked?l().then(u):this.onceLinked=()=>{l().then(u),this.onceLinked=void 0}})}async handleIncomingEvent(l){var u;if(!(l.type!=="Event"||l.event!=="Web3Response")){const d=await this.cipher.decrypt(l.data),f=JSON.parse(d);if(f.type!=="WEB3_RESPONSE")return;(u=this.listener)===null||u===void 0||u.handleWeb3ResponseMessage(f)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(l=>setTimeout(l,250));try{await this.fetchUnseenEventsAPI()}catch(l){console.error("Unable to check for unseen events",l)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEac
425h(u=>this.handleIncomingEvent(u))}async setSessionMetadata(l,u){const d={type:"SetSessionConfig",id:(0,i.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[l]:u}};return this.setOnceConnected(async()=>{const f=await this.makeRequest(d);if(f.type==="Fail")throw new Error(f.error||"failed to set session metadata")})}async publishEvent(l,u,d=!1){const f=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},u),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),h={type:"PublishEvent",id:(0,i.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:l,data:f,callWebhook:d};return this.setOnceLinked(async()=>{const g=await this.makeRequest(h);if(g.type==="Fail")throw new Error(g.error||"failed to publish event");return g.eventId})}sendData(l){this.ws.sendData(JSON.stringify(l))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>s*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(l,u=a){const d=l.id;this.sendData(l);let f;return Promise.race([new Promise((h,g)=>{f=window.setTimeout(()=>{g(new Error(`request ${d} timed out`))},u)}),new Promise(h=>{this.requestResolutions.set(d,g=>{clearTimeout(f),h(g),this.requestResolutions.delete(d)})})])}async authenticate(){const l={type:"HostSession",id:(0,i.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},u=await this.makeRequest(l);if(u.type==="Fail")throw new Error(u.error||"failed to authenticate")}sendIsLinked(){const l={type:"IsLinked",id:(0,i.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(l)}sendGetSessionConfig(){const l={type:"GetSessionConfig",id:(0,i.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(l)}};return Ag.WalletLinkConnection=o,Ag}var kg={},e8={exports:{}},t8,sR;function kEe(){if(sR)return t8;sR=1;var t={}.toString;return t8=Array.isArray||function(e){return t.call(e)=="[object Array]"},t8}var r8,aR;function Py(){return aR||(aR=1,r8=TypeError),r8}var n8,oR;function $K(){return oR||(oR=1,n8=Object),n8}var i8,cR;function $Ee(){return cR||(cR=1,i8=Error),i8}var s8,lR;function NEe(){return lR||(lR=1,s8=EvalError),s8}var a8,uR;function PEe(){return uR||(uR=1,a8=RangeError),a8}var o8,dR;function OEe(){return dR||(dR=1,o8=ReferenceError),o8}var c8,fR;function NK(){return fR||(fR=1,c8=SyntaxError),c8}var l8,hR;function REe(){return hR||(hR=1,l8=URIError),l8}var u8,pR;function DEe(){return pR||(pR=1,u8=Math.abs),u8}var d8,gR;function MEe(){return gR||(gR=1,d8=Math.floor),d8}var f8,mR;function jEe(){return mR||(mR=1,f8=Math.max),f8}var h8,yR;function LEe(){return yR||(yR=1,h8=Math.min),h8}var p8,bR;function FEe(){return bR||(bR=1,p8=Math.pow),p8}var g8,vR;function UEe(){return vR||(vR=1,g8=Math.round),g8}var m8,wR;function BEe(){return wR||(wR=1,m8=Number.isNaN||function(e){return e!==e}),m8}var y8,ER;function qEe(){if(ER)return y8;ER=1;var t=BEe();return y8=function(r){return t(r)||r===0?r:r<0?-1:1},y8}var b8,xR;function WEe(){return xR||(xR=1,b8=Object.getOwnPropertyDescriptor),b8}var v8,_R;function Oy(){if(_R)return v8;_R=1;var t=WEe();if(t)try{t([],"length")}catch{t=null}return v8=t,v8}var w8,CR;function q3(){if(CR)return w8;CR=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return w8=t,w8}var E8,SR;function PK(){return SR||(SR=1,E8=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0}),E8}var x8,AR;function zEe(){if(AR)return x8;AR=1;var t=typeof Symbol<"u"&&Symbol,e=PK();return x8=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:e()},x8}var _8,TR;function OK(){return TR||(TR=1,_8=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),_8}var C8,IR;function RK(){if(IR)return C8;IR=1;var t=$K();return C8=t.getPrototypeOf||null,C8}var S8,kR;function VEe(){if(kR)return S8;kR=1;var t="Function.prototype.bind called on incompatible ",e=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(c,l){for(var u=[],d=0;d<c.length;d+=1)u[d]=c[d];for(var f=0;f<l.length;f+=1)u[f+c.length]=l[f];return u},s=function(c,l){for(var u=[],d=l,f=0;d<c.length;d+=1,f+=1)u[f]=c[d];return u},a=function(o,c){for(var l="",u=0;u<o.length;u+=1)l+=o[u],u+1<o.length&&(l+=c);return l};return S8=function(c){var l=this;if(typeof l!="function"||e.apply(l)!==n)throw new TypeError(t+l);
vendor: 3,560 bytes, line 425
425for(var u=s(arguments,1),d,f=function(){if(this instanceof d){var b=l.apply(this,i(u,arguments));return Object(b)===b?b:this}return l.apply(c,i(u,arguments))},h=r(0,l.length-u.length),g=[],m=0;m<h;m++)g[m]="$"+m;if(d=Function("binder","return function ("+a(g,",")+"){ return binder.apply(this,arguments); }")(f),l.prototype){var y=function(){};y.prototype=l.prototype,d.prototype=new y,y.prototype=null}return d},S8}var A8,$R;function Ry(){if($R)return A8;$R=1;var t=VEe();return A8=Function.prototype.bind||t,A8}var T8,NR;function DA(){return NR||(NR=1,T8=Function.prototype.call),T8}var I8,PR;function MA(){return PR||(PR=1,I8=Function.prototype.apply),I8}var k8,OR;function HEe(){return OR||(OR=1,k8=typeof Reflect<"u"&&Reflect&&Reflect.apply),k8}var $8,RR;function DK(){if(RR)return $8;RR=1;var t=Ry(),e=MA(),r=DA(),n=HEe();return $8=n||t.call(r,e),$8}var N8,DR;function jA(){if(DR)return N8;DR=1;var t=Ry(),e=Py(),r=DA(),n=DK();return N8=function(s){if(s.length<1||typeof s[0]!="function")throw new e("a function is required");return n(t,r,s)},N8}var P8,MR;function GEe(){if(MR)return P8;MR=1;var t=jA(),e=Oy(),r;try{r=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var n=!!r&&e&&e(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return P8=n&&typeof n.get=="function"?t([n.get]):typeof s=="function"?function(o){return s(o==null?o:i(o))}:!1,P8}var O8,jR;function MK(){if(jR)return O8;jR=1;var t=OK(),e=RK(),r=GEe();return O8=t?function(i){return t(i)}:e?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return e(i)}:r?function(i){return r(i)}:null,O8}var R8,LR;function KEe(){if(LR)return R8;LR=1;var t=Function.prototype.call,e=Object.prototype.hasOwnProperty,r=Ry();return R8=r.call(t,e),R8}var D8,FR;function jK(){if(FR)return D8;FR=1;var t,e=$K(),r=$Ee(),n=NEe(),i=PEe(),s=OEe(),a=NK(),o=Py(),c=REe(),l=DEe(),u=MEe(),d=jEe(),f=LEe(),h=FEe(),g=UEe(),m=qEe(),y=Function,b=function(_e){try{return y('"use strict"; return ('+_e+").constructor;")()}catch{}},E=Oy(),v=q3(),w=function(){throw new o},x=E?(function(){try{return arguments.callee,w}catch{try{return E(arguments,"callee").get}catch{return w}}})():w,_=zEe()(),S=MK(),A=RK(),I=OK(),$=MA(),P=DA(),j={},L=typeof Uint8Array>"u"||!S?t:S(Uint8Array),B={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":_&&S?S([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":j,"%AsyncGenerator%":j,"%AsyncGeneratorFunction%":j,"%AsyncIteratorPrototype%":j,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":j,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 7,780 bytes, line 425
425"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":_&&S?S(S([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!_||!S?t:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":e,"%Object.getOwnPropertyDescriptor%":E,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":i,"%ReferenceError%":s,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!_||!S?t:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":_&&S?S(""[Symbol.iterator]()):t,"%Symbol%":_?Symbol:t,"%SyntaxError%":a,"%ThrowTypeError%":x,"%TypedArray%":L,"%TypeError%":o,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":$,"%Object.defineProperty%":v,"%Object.getPrototypeOf%":A,"%Math.abs%":l,"%Math.floor%":u,"%Math.max%":d,"%Math.min%":f,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":m,"%Reflect.getPrototypeOf%":I};if(S)try{null.error}catch(_e){var k=S(S(_e));B["%Error.prototype%"]=k}var D=function _e(z){var R;if(z==="%AsyncFunction%")R=b("async function () {}");else if(z==="%GeneratorFunction%")R=b("function* () {}");else if(z==="%AsyncGeneratorFunction%")R=b("async function* () {}");else if(z==="%AsyncGenerator%"){var M=_e("%AsyncGeneratorFunction%");M&&(R=M.prototype)}else if(z==="%AsyncIteratorPrototype%"){var ee=_e("%AsyncGenerator%");ee&&S&&(R=S(ee.prototype))}return B[z]=R,R},q={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=Ry(),W=KEe(),V=U.call(P,Array.prototype.concat),Y=U.call($,Array.prototype.splice),K=U.call(P,String.prototype.replace),ge=U.call(P,String.prototype.slice),ae=U.call(P,RegExp.prototype.exec),ce=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Q=/\\(\\)?/g,se=function(z){var R=ge(z,0,1),M=ge(z,-1);if(R==="%"&&M!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(M==="%"&&R!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var ee=[];return K(z,ce,function(ie,le,ye,fe){ee[ee.length]=ye?K(fe,Q,"$1"):le||ie}),ee},me=function(z,R){var M=z,ee;if(W(q,M)&&(ee=q[M],M="%"+ee[0]+"%"),W(B,M)){var ie=B[M];if(ie===j&&(ie=D(M)),typeof ie>"u"&&!R)throw new o("intrinsic "+z+" exists, but is not available. Please file an issue!");return{alias:ee,name:M,value:ie}}throw new a("intrinsic "+z+" does not exist!")};return D8=function(z,R){if(typeof z!="string"||z.length===0)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof R!="boolean")throw new o('"allowMissing" argument must be a boolean');if(ae(/^%?[^%]*%?$/,z)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var M=se(z),ee=M.length>0?M[0]:"",ie=me("%"+ee+"%",R),le=ie.name,ye=ie.value,fe=!1,we=ie.alias;we&&(ee=we[0],Y(M,V([0,1],we)));for(var Ce=1,ne=!0;Ce<M.length;Ce+=1){var Re=M[Ce],Pe=ge(Re,0,1),Ae=ge(Re,-1);if((Pe==='"'||Pe==="'"||Pe==="`"||Ae==='"'||Ae==="'"||Ae==="`")&&Pe!==Ae)throw new a("property names with quotes must have matching quotes");if((Re==="constructor"||!ne)&&(fe=!0),ee+="."+Re,le="%"+ee+"%",W(B,le))ye=B[le];else if(ye!=null){if(!(Re in ye)){if(!R)throw new o("base intrinsic for "+z+" exists, but the property is not available.");return}if(E&&Ce+1>=M.length){var Ue=E(ye,Re);ne=!!Ue,ne&&"get"in Ue&&!("originalValue"in Ue.get)?ye=Ue.get:ye=ye[Re]}else ne=W(ye,Re),ye=ye[Re];ne&&!fe&&(B[le]=ye)}}return ye},D8}var M8,UR;function LK(){if(UR)return M8;UR=1;var t=jK(),e=jA(),r=e([t("%String.prototype.indexOf%")]);return M8=function(i,s){var a=t(i,!!s);return typeof a=="function"&&r(i,".prototype.")>-1?e([a]):a},M8}var j8,BR;function QEe(){if(BR)return j8;BR=1;var t=Function.prototype.toString,e=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof e=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},e(function(){throw 42},null,r)}catch(E){E!==n&&(e=null)}else e=null;var i=/^\s*class\b/,s=function(v){try{var w=t.call(v);return i.test(w)}catch{return!1}},a=function(v){try{return s(v)?!1:(t.call(v),!0)}catch{return!1}},o=Object.prototype.toString,c="[object Object]",l="[object Function]",u="[object GeneratorFunction]",d="[object HTMLAllCollection]",f="[object HTML document.all class]",h="[object HTMLCollection]",g=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),y=function(){return!1};if(typeof document=="object"){var b=document.all;o.call(b)===o.call(document.all)&&(y=function(v){if((m||!v)&&(typeof v>"u"||typeof v=="object"))try{var w=o.call(v);return(w===d||w===f||w===h||w===c)&&v("")==null}catch{}return!1})}return j8=e?function(v){if(y(v))return!0;
425if(!v||typeof v!="function"&&typeof v!="object")return!1;try{e(v,null,r)}catch(w){if(w!==n)return!1}return!s(v)&&a(v)}:function(v){if(y(v))return!0;if(!v||typeof v!="function"&&typeof v!="object")return!1;if(g)return a(v);if(s(v))return!1;var w=o.call(v);return w!==l&&w!==u&&!/^\[object HTML/.test(w)?!1:a(v)},j8}var L8,qR;function YEe(){if(qR)return L8;qR=1;var t=QEe(),e=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(c,l,u){for(var d=0,f=c.length;d<f;d++)r.call(c,d)&&(u==null?l(c[d],d,c):l.call(u,c[d],d,c))},i=function(c,l,u){for(var d=0,f=c.length;d<f;d++)u==null?l(c.charAt(d),d,c):l.call(u,c.charAt(d),d,c)},s=function(c,l,u){for(var d in c)r.call(c,d)&&(u==null?l(c[d],d,c):l.call(u,c[d],d,c))};function a(o){return e.call(o)==="[object Array]"}return L8=function(c,l,u){if(!t(l))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=u),a(c)?n(c,l,d):typeof c=="string"?i(c,l,d):s(c,l,d)},L8}var F8,WR;function ZEe(){return WR||(WR=1,F8=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),F8}var U8,zR;function XEe(){if(zR)return U8;zR=1;var t=ZEe(),e=typeof globalThis>"u"?Yn:globalThis;return U8=function(){for(var n=[],i=0;i<t.length;i++)typeof e[t[i]]=="function"&&(n[n.length]=t[i]);return n},U8}var B8={exports:{}},q8,VR;function JEe(){if(VR)return q8;VR=1;var t=q3(),e=NK(),r=Py(),n=Oy();return q8=function(s,a,o){if(!s||typeof s!="object"&&typeof s!="function")throw new r("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,f=!!n&&n(s,a);if(t)t(s,a,{configurable:u===null&&f?f.configurable:!u,enumerable:c===null&&f?f.enumerable:!c,value:o,writable:l===null&&f?f.writable:!l});else if(d||!c&&!l&&!u)s[a]=o;else throw new e("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},q8}var W8,HR;function exe(){if(HR)return W8;HR=1;var t=q3(),e=function(){return!!t};return e.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},W8=e,W8}var z8,GR;function txe(){if(GR)return z8;GR=1;var t=jK(),e=JEe(),r=exe()(),n=Oy(),i=Py(),s=t("%Math.floor%");return z8=function(o,c){if(typeof o!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],u=!0,d=!0;if("length"in o&&n){var f=n(o,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(d=!1)}return(u||d||!l)&&(r?e(o,"length",c,!0,!0):e(o,"length",c)),o},z8}var V8,KR;function rxe(){if(KR)return V8;KR=1;var t=Ry(),e=MA(),r=DK();return V8=function(){return r(t,e,arguments)},V8}var QR;function nxe(){return QR||(QR=1,(function(t){var e=txe(),r=q3(),n=jA(),i=rxe();t.exports=function(a){var o=n(arguments),c=a.length-(arguments.length-1);return e(o,1+(c>0?c:0),!0)},r?r(t.exports,"apply",{value:i}):t.exports.apply=i})(B8)),B8.exports}var H8,YR;function ixe(){if(YR)return H8;YR=1;var t=PK();return H8=function(){return t()&&!!Symbol.toStringTag},H8}var G8,ZR;function sxe(){if(ZR)return G8;ZR=1;var t=YEe(),e=XEe(),r=nxe(),n=LK(),i=Oy(),s=MK(),a=n("Object.prototype.toString"),o=ixe()(),c=typeof globalThis>"u"?Yn:globalThis,l=e(),u=n("String.prototype.slice"),d=n("Array.prototype.indexOf",!0)||function(y,b){for(var E=0;E<y.length;E+=1)if(y[E]===b)return E;return-1},f={__proto__:null};o&&i&&s?t(l,function(m){var y=new c[m];if(Symbol.toStringTag in y&&s){var b=s(y),E=i(b,Symbol.toStringTag);if(!E&&b){var v=s(b);E=i(v,Symbol.toStringTag)}if(E&&E.get){var w=r(E.get);f["$"+m]=w}}}):t(l,function(m){var y=new c[m],b=y.slice||y.set;if(b){var E=r(b);f["$"+m]=E}});var h=function(y){var b=!1;return t(f,function(E,v){if(!b)try{"$"+E(y)===v&&(b=u(v,1))}catch{}}),b},g=function(y){var b=!1;return t(f,function(E,v){if(!b)try{E(y),b=u(v,1)}catch{}}),b};return G8=function(y){if(!y||typeof y!="object")return!1;if(!o){var b=u(a(y),8,-1);return d(l,b)>-1?b:b!=="Object"?!1:g(y)}return i?h(y):null},G8}var K8,XR;
425function axe(){if(XR)return K8;XR=1;var t=sxe();return K8=function(r){return!!t(r)},K8}var Q8,JR;function oxe(){if(JR)return Q8;JR=1;var t=Py(),e=LK(),r=e("TypedArray.prototype.buffer",!0),n=axe();return Q8=r||function(s){if(!n(s))throw new t("Not a Typed Array");return s.buffer},Q8}var Y8,eD;function cxe(){if(eD)return Y8;eD=1;var t=Bl().Buffer,e=kEe(),r=oxe(),n=ArrayBuffer.isView||function(c){try{return r(c),!0}catch{return!1}},i=typeof Uint8Array<"u",s=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",a=s&&(t.prototype instanceof Uint8Array||t.TYPED_ARRAY_SUPPORT);return Y8=function(c,l){if(t.isBuffer(c))return c.constructor&&!("isBuffer"in c)?t.from(c):c;if(typeof c=="string")return t.from(c,l);if(s&&n(c)){if(c.byteLength===0)return t.alloc(0);if(a){var u=t.from(c.buffer,c.byteOffset,c.byteLength);if(u.byteLength===c.byteLength)return u}var d=c instanceof Uint8Array?c:new Uint8Array(c.buffer,c.byteOffset,c.byteLength),f=t.from(d);if(f.length===c.byteLength)return f}if(i&&c instanceof Uint8Array)return t.from(c);var h=e(c);if(h)for(var g=0;g<c.length;g+=1){var m=c[g];if(typeof m!="number"||m<0||m>255||~~m!==m)throw new RangeError("Array items must be numbers in the range 0-255.")}if(h||t.isBuffer(c)&&c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c))return t.from(c);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},Y8}var Z8,tD;function D0(){if(tD)return Z8;tD=1;var t=Bl().Buffer,e=cxe();function r(n,i){this._block=t.alloc(n),this._finalSize=i,this._blockSize=n,this._len=0}return r.prototype.update=function(n,i){n=e(n,i||"utf8");for(var s=this._block,a=this._blockSize,o=n.length,c=this._len,l=0;l<o;){for(var u=c%a,d=Math.min(o-l,a-u),f=0;f<d;f++)s[u+f]=n[l+f];c+=d,l+=d,c%a===0&&this._update(s)}return this._len+=o,this},r.prototype.digest=function(n){var i=this._len%this._blockSize;this._block[i]=128,this._block.fill(0,i+1),i>=this._finalSize&&(this._update(this._block),this._block.fill(0));var s=this._len*8;if(s<=4294967295)this._block.writeUInt32BE(s,this._blockSize-4);else{var a=(s&4294967295)>>>0,o=(s-a)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(a,this._blockSize-4)}this._update(this._block);var c=this._hash();return n?c.toString(n):c},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Z8=r,Z8}var X8,rD;function lxe(){if(rD)return X8;rD=1;var t=Ro(),e=D0(),r=Bl().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],i=new Array(80);function s(){this.init(),this._w=i,e.call(this,64,56)}t(s,e),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function a(l){return l<<5|l>>>27}function o(l){return l<<30|l>>>2}function c(l,u,d,f){return l===0?u&d|~u&f:l===2?u&d|u&f|d&f:u^d^f}return s.prototype._update=function(l){for(var u=this._w,d=this._a|0,f=this._b|0,h=this._c|0,g=this._d|0,m=this._e|0,y=0;y<16;++y)u[y]=l.readInt32BE(y*4);for(;y<80;++y)u[y]=u[y-3]^u[y-8]^u[y-14]^u[y-16];for(var b=0;b<80;++b){var E=~~(b/20),v=a(d)+c(E,f,h,g)+m+u[b]+n[E]|0;m=g,g=h,h=o(f),f=d,d=v}this._a=d+this._a|0,this._b=f+this._b|0,this._c=h+this._c|0,this._d=g+this._d|0,this._e=m+this._e|0},s.prototype._hash=function(){var l=r.allocUnsafe(20);return l.writeInt32BE(this._a|0,0),l.writeInt32BE(this._b|0,4),l.writeInt32BE(this._c|0,8),l.writeInt32BE(this._d|0,12),l.writeInt32BE(this._e|0,16),l},X8=s,X8}var J8,nD;function uxe(){if(nD)return J8;nD=1;var t=Ro(),e=D0(),r=Bl().Buffer,n=[1518500249,1859775393,-1894007588,-899497514],i=new Array(80);function s(){this.init(),this._w=i,e.call(this,64,56)}t(s,e),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function a(u){return u<<1|u>>>31}function o(u){return u<<5|u>>>27}function c(u){return u<<30|u>>>2}function l(u,d,f,h){return u===0?d&f|~d&h:u===2?d&f|d&h|f&h:d^f^h}return s.prototype._update=function(u){for(var d=this._w,f=this._a|0,h=this._b|0,g=this._c|0,m=this._d|0,y=this._e|0,b=0;b<16;++b)d[b]=u.readInt32BE(b*4);for(;b<80;++b)d[b]=a(d[b-3]^d[b-8]^d[b-14]^d[b-16]);for(var E=0;E<80;++E){var v=~~(E/20),w=o(f)+l(v,h,g,m)+y+d[E]+n[v]|0;y=m,m=g,g=c(h),h=f,f=w}this._a=f+this._a|0,this._b=h+this._b|0,this._c=g+this._c|0,this._d=m+this._d|0,this._e=y+this._e|0},s.prototype._hash=function(){var u=r.allocUnsafe(20);return u.writeInt32BE(this._a|0,0),u.writeInt32BE(this._b|0,4),u.writeInt32BE(this._c|0,8),u.writeInt32BE(this._d|0,12),u.writeInt32BE(this._e|0,16),u},J8=s,J8}var eE,iD;function FK(){if(iD)return eE;iD=1;var t=Ro(),e=D0(),r=Bl().Buffer,n=[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
425734187,3204031479,3329325298],i=new Array(64);function s(){this.init(),this._w=i,e.call(this,64,56)}t(s,e),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function a(f,h,g){return g^f&(h^g)}function o(f,h,g){return f&h|g&(f|h)}function c(f){return(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10)}function l(f){return(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7)}function u(f){return(f>>>7|f<<25)^(f>>>18|f<<14)^f>>>3}function d(f){return(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10}return s.prototype._update=function(f){for(var h=this._w,g=this._a|0,m=this._b|0,y=this._c|0,b=this._d|0,E=this._e|0,v=this._f|0,w=this._g|0,x=this._h|0,_=0;_<16;++_)h[_]=f.readInt32BE(_*4);for(;_<64;++_)h[_]=d(h[_-2])+h[_-7]+u(h[_-15])+h[_-16]|0;for(var S=0;S<64;++S){var A=x+l(E)+a(E,v,w)+n[S]+h[S]|0,I=c(g)+o(g,m,y)|0;x=w,w=v,v=E,E=b+A|0,b=y,y=m,m=g,g=A+I|0}this._a=g+this._a|0,this._b=m+this._b|0,this._c=y+this._c|0,this._d=b+this._d|0,this._e=E+this._e|0,this._f=v+this._f|0,this._g=w+this._g|0,this._h=x+this._h|0},s.prototype._hash=function(){var f=r.allocUnsafe(32);return f.writeInt32BE(this._a,0),f.writeInt32BE(this._b,4),f.writeInt32BE(this._c,8),f.writeInt32BE(this._d,12),f.writeInt32BE(this._e,16),f.writeInt32BE(this._f,20),f.writeInt32BE(this._g,24),f.writeInt32BE(this._h,28),f},eE=s,eE}var tE,sD;function dxe(){if(sD)return tE;sD=1;var t=Ro(),e=FK(),r=D0(),n=Bl().Buffer,i=new Array(64);function s(){this.init(),this._w=i,r.call(this,64,56)}return t(s,e),s.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},s.prototype._hash=function(){var a=n.allocUnsafe(28);return a.writeInt32BE(this._a,0),a.writeInt32BE(this._b,4),a.writeInt32BE(this._c,8),a.writeInt32BE(this._d,12),a.writeInt32BE(this._e,16),a.writeInt32BE(this._f,20),a.writeInt32BE(this._g,24),a},tE=s,tE}var rE,aD;function UK(){if(aD)return rE;aD=1;var t=Ro(),e=D0(),r=Bl().Buffer,n=[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,
4251126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],i=new Array(160);function s(){this.init(),this._w=i,e.call(this,128,112)}t(s,e),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function a(m,y,b){return b^m&(y^b)}function o(m,y,b){return m&y|b&(m|y)}function c(m,y){return(m>>>28|y<<4)^(y>>>2|m<<30)^(y>>>7|m<<25)}function l(m,y){return(m>>>14|y<<18)^(m>>>18|y<<14)^(y>>>9|m<<23)}function u(m,y){return(m>>>1|y<<31)^(m>>>8|y<<24)^m>>>7}function d(m,y){return(m>>>1|y<<31)^(m>>>8|y<<24)^(m>>>7|y<<25)}function f(m,y){return(m>>>19|y<<13)^(y>>>29|m<<3)^m>>>6}function h(m,y){return(m>>>19|y<<13)^(y>>>29|m<<3)^(m>>>6|y<<26)}function g(m,y){return m>>>0<y>>>0?1:0}return s.prototype._update=function(m){for(var y=this._w,b=this._ah|0,E=this._bh|0,v=this._ch|0,w=this._dh|0,x=this._eh|0,_=this._fh|0,S=this._gh|0,A=this._hh|0,I=this._al|0,$=this._bl|0,P=this._cl|0,j=this._dl|0,L=this._el|0,B=this._fl|0,k=this._gl|0,D=this._hl|0,q=0;q<32;q+=2)y[q]=m.readInt32BE(q*4),y[q+1]=m.readInt32BE(q*4+4);for(;q<160;q+=2){var U=y[q-30],W=y[q-30+1],V=u(U,W),Y=d(W,U);U=y[q-4],W=y[q-4+1];var K=f(U,W),ge=h(W,U),ae=y[q-14],ce=y[q-14+1],Q=y[q-32],se=y[q-32+1
425],me=Y+ce|0,_e=V+ae+g(me,Y)|0;me=me+ge|0,_e=_e+K+g(me,ge)|0,me=me+se|0,_e=_e+Q+g(me,se)|0,y[q]=_e,y[q+1]=me}for(var z=0;z<160;z+=2){_e=y[z],me=y[z+1];var R=o(b,E,v),M=o(I,$,P),ee=c(b,I),ie=c(I,b),le=l(x,L),ye=l(L,x),fe=n[z],we=n[z+1],Ce=a(x,_,S),ne=a(L,B,k),Re=D+ye|0,Pe=A+le+g(Re,D)|0;Re=Re+ne|0,Pe=Pe+Ce+g(Re,ne)|0,Re=Re+we|0,Pe=Pe+fe+g(Re,we)|0,Re=Re+me|0,Pe=Pe+_e+g(Re,me)|0;var Ae=ie+M|0,Ue=ee+R+g(Ae,ie)|0;A=S,D=k,S=_,k=B,_=x,B=L,L=j+Re|0,x=w+Pe+g(L,j)|0,w=v,j=P,v=E,P=$,E=b,$=I,I=Re+Ae|0,b=Pe+Ue+g(I,Re)|0}this._al=this._al+I|0,this._bl=this._bl+$|0,this._cl=this._cl+P|0,this._dl=this._dl+j|0,this._el=this._el+L|0,this._fl=this._fl+B|0,this._gl=this._gl+k|0,this._hl=this._hl+D|0,this._ah=this._ah+b+g(this._al,I)|0,this._bh=this._bh+E+g(this._bl,$)|0,this._ch=this._ch+v+g(this._cl,P)|0,this._dh=this._dh+w+g(this._dl,j)|0,this._eh=this._eh+x+g(this._el,L)|0,this._fh=this._fh+_+g(this._fl,B)|0,this._gh=this._gh+S+g(this._gl,k)|0,this._hh=this._hh+A+g(this._hl,D)|0},s.prototype._hash=function(){var m=r.allocUnsafe(64);function y(b,E,v){m.writeInt32BE(b,v),m.writeInt32BE(E,v+4)}return y(this._ah,this._al,0),y(this._bh,this._bl,8),y(this._ch,this._cl,16),y(this._dh,this._dl,24),y(this._eh,this._el,32),y(this._fh,this._fl,40),y(this._gh,this._gl,48),y(this._hh,this._hl,56),m},rE=s,rE}var nE,oD;function fxe(){if(oD)return nE;oD=1;var t=Ro(),e=UK(),r=D0(),n=Bl().Buffer,i=new Array(160);function s(){this.init(),this._w=i,r.call(this,128,112)}return t(s,e),s.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s.prototype._hash=function(){var a=n.allocUnsafe(48);function o(c,l,u){a.writeInt32BE(c,u),a.writeInt32BE(l,u+4)}return o(this._ah,this._al,0),o(this._bh,this._bl,8),o(this._ch,this._cl,16),o(this._dh,this._dl,24),o(this._eh,this._el,32),o(this._fh,this._fl,40),a},nE=s,nE}var cD;function hxe(){return cD||(cD=1,(function(t){t.exports=function(r){var n=r.toLowerCase(),i=t.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},t.exports.sha=lxe(),t.exports.sha1=uxe(),t.exports.sha224=dxe(),t.exports.sha256=FK(),t.exports.sha384=fxe(),t.exports.sha512=UK()})(e8)),e8.exports}var lD;function pxe(){if(lD)return kg;lD=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.WalletLinkSession=void 0;const t=hxe(),e=Ul(),r="session:id",n="session:secret",i="session:linked";let s=class BK{constructor(o,c,l,u){this._storage=o,this._id=c||(0,e.randomBytesHex)(16),this._secret=l||(0,e.randomBytesHex)(32),this._key=new t.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!u}static load(o){const c=o.getItem(r),l=o.getItem(i),u=o.getItem(n);return c&&u?new BK(o,c,u,l==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(o){this._linked=o,this.persistLinked()}save(){return this._storage.setItem(r,this._id),this._storage.setItem(n,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(i,this._linked?"1":"0")}};return kg.WalletLinkSession=s,kg}var Ka={},uD;function W3(){if(uD)return Ka;uD=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.isDarkMode=Ka.isMobileWeb=Ka.getLocation=Ka.createQrUrl=void 0;function t(s,a,o,c,l,u){const d=c?"parent-id":"id",f=new URLSearchParams({[d]:s,secret:a,server:o,v:l,chainId:u.toString()}).toString();return`${o}/#/link?${f}`}Ka.createQrUrl=t;function e(){try{return window.frameElement!==null}catch{return!1}}function r(){try{return e()&&window.top?window.top.location:window.location}catch{return window.location}}Ka.getLocation=r;function n(){var s;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((s=window==null?void 0:window.navigator)===null||s===void 0?void 0:s.userAgent)}Ka.isMobileWeb=n;function i(){var s,a;return(a=(s=window==null?void 0:window.matchMedia)===null||s===void 0?void 0:s.call(window,"(prefers-color-scheme: dark)").matches)!==null&&a!==void 0?a:!1}return Ka.isDarkMode=i,Ka}var $g={},Ad={}
vendor: 13,264 bytes, line 425
425,z2={},dD;function gxe(){return dD||(dD=1,Object.defineProperty(z2,"__esModule",{value:!0}),z2.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'),z2}var fD;function qK(){if(fD)return Ad;fD=1;var t=Ad&&Ad.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.injectCssReset=void 0;const e=t(gxe());function r(){const n=document.createElement("style");n.type="text/css",n.appendChild(document.createTextNode(e.default)),document.documentElement.appendChild(n)}return Ad.injectCssReset=r,Ad}var Ng={};const WK=m0(one);var Dy,sn,zK,VK,hu,hD,HK,GK,KK,LA,e7,t7,QK,Yv={},Zv=[],mxe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,My=Array.isArray;function rc(t,e){for(var r in e)t[r]=e[r];return t}function FA(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function r7(t,e,r){var n,i,s,a={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?Dy.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return T1(t,a,n,i,null)}function T1(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++zK,__i:-1,__u:0};return i==null&&sn.vnode!=null&&sn.vnode(s),s}function yxe(){return{current:null}}function jy(t){return t.children}function I1(t,e){this.props=t,this.context=e}function c0(t,e){if(e==null)return t.__?c0(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?c0(t):null}function bxe(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],i=[],s=rc({},e);s.__v=e.__v+1,sn.vnode&&sn.vnode(s),UA(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??c0(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,eQ(n,s,i),e.__e=e.__=null,s.__e!=r&&YK(s)}}function YK(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),YK(t)}function n7(t){(!t.__d&&(t.__d=!0)&&hu.push(t)&&!Xv.__r++||hD!=sn.debounceRendering)&&((hD=sn.debounceRendering)||HK)(Xv)}function Xv(){try{for(var t,e=1;hu.length;)hu.length>e&&hu.sort(GK),t=hu.shift(),e=hu.length,bxe(t)}finally{hu.length=Xv.__r=0}}function ZK(t,e,r,n,i,s,a,o,c,l,u){var d,f,h,g,m,y,b,E=n&&n.__k||Zv,v=e.length;for(c=vxe(r,e,E,c,v),d=0;d<v;d++)(h=r.__k[d])!=null&&(f=h.__i!=-1&&E[h.__i]||Yv,h.__i=d,y=UA(t,h,f,i,s,a,o,c,l,u),g=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&BA(f.ref,null,h),u.push(h.ref,h.__c||g,h)),m==null&&g!=null&&(m=g),(b=!!(4&h.__u))||f.__k===h.__k?c=XK(h,c,t,b):typeof h.type=="function"&&y!==void 0?c=y:g&&(c=g.nextSibling),h.__u&=-7);return r.__e=m,c}function vxe(t,e,r,n,i){var s,a,o,c,l,u=r.length,d=u,f=0;for(t.__k=new Array(i),s=0;s<i;s++)(a=e[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=t.__k[s]=T1(null,a,null,null,null):My(a)?a=t.__k[s]=T1(jy,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=t.__k[s]=T1(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,c=s+f,a.__=t,a.__b=t.__b+1,o=null,(l=a.__i=wxe(a,r,c,d))!=-1&&(d--,(o=r[l])&&(o.__u|=2)),o==null||o.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof a.type!="function"&&(a.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,a.__u|=4))):t.__k[s]=null;if(d)for(s=0;s<u;s++)(o=r[s])!=null&&(2&o.__u)==0&&(o.__e==n&&(n=c0(o)),rQ(o,o));return n}function XK(t,e,r,n){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=XK(i[s],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=c0(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function JK(t,e){return e=e||[],t==null||typeof t=="boolean"||(My(t)?t.some(function(r){JK(r,e)}):e.push(t)),e}function wxe(t,e,r,n){var i,s,a,o=t.key,c=t.type,l=e[r],u=l!=null&&(2&l.__u)==0;if(l===null&&o==null||u&&o==l.key&&c==l.type)return r;if(n>(u?1:0)){for(i=r-1,s=r+1;i>=0||s<e.length;)if((l=e[a=i>=0?i--:s++])!=null&&(2&l.__u)==0&&o==l.key&&c==l.type)return a}return-1}function pD(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||mxe.test(e)?r:r+"px"}function V2(t,e,r,n,i){var s,a;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||pD(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||pD(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(KK,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=LA,t.addEventListener(e,s?t7:e7,s)):t.removeEventListener(e,s?t7:e7,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function gD(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=LA++;else if(e.t<r.u)return;return r(sn.event?sn.event(e):e)}}}function UA(t,e,r,n,i,s,a,o,c,l){var u,d,f,h,g,m,y,b,E,v,w,x,_,S,A,I=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),s=[o=e.__e=r.__e]),(u=sn.__b)&&u(e);e:if(typeof I=="function")try{if(b=e.props,E=I.prototype&&I.prototype.render,v=(u=I.contextType)&&n[u.__c],w=u?v?v.props.value:u.__:n,r.__c?y=(d=e.__c=r.__c).__=d.__E:(E?e.__c=d=new I(b,w):(e.__c=d=new I1(b,w),d.constructor=I,d.render=xxe),v&&v.sub(d),d.state||(d.state={}),d.__n=n,f=d.__d=!0,d.__h=[],d._sb=[]),E&&d.__s==null&&(d.__s=d.state),E&&I.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=rc({},d.__s)),rc(d.__s,I.getDerivedStateFromProps(b,d.__s))),h=d.props,g=d.state,d.__v=e,f)E&&I.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),E&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(E&&I.getDerivedStateFromProps==null&&b!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(b,w),e.__v==r.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(b,d.__s,w)===!1){e.__v!=r.__v&&(d.props=b,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function($){$&&($.__=e)}),Zv.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(b,d.__s,w),E&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,g,m)})}if(d.context=w,d.props=b,d.__P=t,d.__e=!1,x=sn.__r,_=0,E)d.state=d.__s,d.__d=!1,x&&x(e),u=d.render(d.props,d.state,d.context),Zv.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,x&&x(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++_<25);d.state=d.__s,d.getChildContext!=null&&(n=rc(rc({},n),d.getChildContext())),E&&!f&&d.getSnapshotBeforeUpdate!=null&&(m=d.getSnapshotBeforeUpdate(h,g)),S=u!=null&&u.type===jy&&u.key==null?tQ(u.props.children):u,o=ZK(t,My(S)?S:[S],e,r,n,i,s,a,o,c,l),d.base=e.__e,e.__u&=-161,d.__h.length&&a.push(d),y&&(d.__E=d.__=null)}catch($){if(e.__v=null,c||s!=null)if($.then){for(e.__u|=c?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;s[s.indexOf(o)]=null,e.__e=o}else{for(A=s.length;A--;)FA(s[A]);i7(e)}else e.__e=r.__e,e.__k=r.__k,$.then||i7(e);sn.__e($,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):o=e.__e=Exe(r.__e,e,r,n,i,s,a,c,l);return(u=sn.diffed)&&u(e),128&e.__u?void 0:o}function i7(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(i7))}function eQ(t,e,r){for(var n=0;n<r.length;n++)BA(r[n],r[++n],r[++n]);sn.__c&&sn.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){sn.__e(s,i.__v)}})}function tQ(t){return typeof t!="object"||t==null||t.__b>0?t:My(t)?t.map(tQ):rc({},t)}function Exe(t,e,r,n,i,s,a,o,c){var l,u,d,f,h,g,m,y=r.props||Yv,b=e.props,E=e.type;if(E=="svg"?i="http://www.w3.org/2000/svg":E=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((h=s[l])&&"setAttribute"in h==!!E&&(E?h.localName==E:h.nodeType==3)){t=h,s[l]=null;break}}if(t==null){if(E==null)return document.createTextNode(b);t=document.createElementNS(i,E,b.is&&b),o&&(sn.__m&&sn.__m(e,s),o=!1),s=null}if(E==null)y===b||o&&t.data==b||(t.data=b);else{if(s=s&&Dy.call(t.childNodes),!o&&s!=null)for(y={},l=0;l<t.attributes.length;l++)y[(h=t.attributes[l]).name]=h.value;for(l in y)h=y[l],l=="dangerouslySetInnerHTML"?d=h:l=="children"||l in b||l=="value"&&"defaultValue"in b||l=="checked"&&"defaultChecked"in b||V2(t,l,null,h,i);for(l in b)h=b[l],l=="children"?f=h:l=="dangerouslySetInnerHTML"?u=h:l=="value"?g=h:l=="checked"?m=h:o&&typeof h!="function"||y[l]===h||V2(t,l,h,y[l],i);if(u)o||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),ZK(e.type=="template"?t.content:t,My(f)?f:[f],e,r,n,E=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:r.__k&&c0(r,0),o,c),s!=null)for(l=s.length;l--;)FA(s[l]);o||(l="value",E=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[l]||E=="progress"&&!g||E=="option"&&g!=y[l])&&V2(t,l,g,y[l],i),l="checked",m!=null&&m!=t[l]&&V2(t,l,m,y[l],i))}return t}function BA(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){sn.__e(i,r)}}function rQ(t,e,r){var n,i;if(sn.unmount&&sn.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||BA(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){sn.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&rQ(n[i],e,r||typeof t.type!="function");r||FA(t.__e),t.__c=t.__=t.__e=void 0}function xxe(t,e,r){return this.constructor(t,r)}function nQ(t,e,r){var n,i,s,a;e==document&&(e=document.documentElement),sn.__&&sn.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],a=[],UA(e,t=(!n&&r||e).__k=r7(jy,null,[t]),i||Yv,Yv,e.
vendor: 1,752 bytes, line 425
425namespaceURI,!n&&r?[r]:i?null:e.firstChild?Dy.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,a),eQ(s,t,a)}function iQ(t,e){nQ(t,e,iQ)}function _xe(t,e,r){var n,i,s,a,o=rc({},t.props);for(s in t.type&&t.type.defaultProps&&(a=t.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s]===void 0&&a!=null?a[s]:e[s];return arguments.length>2&&(o.children=arguments.length>3?Dy.call(arguments,2):r),T1(t.type,o,n||t.key,i||t.ref,null)}function Cxe(t){function e(r){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&n.forEach(function(a){a.__e=!0,n7(a)})},this.sub=function(s){n.add(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){n&&n.delete(s),a&&a.call(s)}}),r.children}return e.__c="__cC"+QK++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}Dy=Zv.slice,sn={__e:function(t,e,r,n){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),a=i.__d),a)return i.__E=i}catch(o){t=o}throw t}},zK=0,VK=function(t){return t!=null&&t.constructor===void 0},I1.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=rc({},this.state),typeof t=="function"&&(t=t(rc({},r),this.props)),t&&rc(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),n7(this))},I1.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),n7(this))},I1.prototype.render=jy,hu=[],HK=typeof Promise=="function"?Promise.prototype.then.bind(Prom
vendor: 4,269 bytes, line 425
425ise.resolve()):setTimeout,GK=function(t,e){return t.__v.__b-e.__v.__b},Xv.__r=0,KK=/(PointerCapture)$|Capture$/i,LA=0,e7=gD(!1),t7=gD(!0),QK=0;const Sxe=Object.freeze(Object.defineProperty({__proto__:null,Component:I1,Fragment:jy,cloneElement:_xe,createContext:Cxe,createElement:r7,createRef:yxe,h:r7,hydrate:iQ,get isValidElement(){return VK},get options(){return sn},render:nQ,toChildArray:JK},Symbol.toStringTag,{value:"Module"})),sQ=m0(Sxe);var Al,Xr,iE,mD,l0=0,aQ=[],Cn=sn,yD=Cn.__b,bD=Cn.__r,vD=Cn.diffed,wD=Cn.__c,ED=Cn.unmount,xD=Cn.__;function rh(t,e){Cn.__h&&Cn.__h(Xr,t,l0||e),l0=0;var r=Xr.__H||(Xr.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function oQ(t){return l0=1,cQ(uQ,t)}function cQ(t,e,r){var n=rh(Al++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):uQ(void 0,e),function(o){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,o);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Xr,!Xr.__f)){var i=function(o,c,l){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(f){return f.__c});if(u.every(function(f){return!f.__N}))return!s||s.call(this,o,c,l);var d=n.__c.props!==o;return u.some(function(f){if(f.__N){var h=f.__[0];f.__=f.__N,f.__N=void 0,h!==f.__[0]&&(d=!0)}}),s&&s.call(this,o,c,l)||d};Xr.__f=!0;var s=Xr.shouldComponentUpdate,a=Xr.componentWillUpdate;Xr.componentWillUpdate=function(o,c,l){if(this.__e){var u=s;s=void 0,i(o,c,l),s=u}a&&a.call(this,o,c,l)},Xr.shouldComponentUpdate=i}return n.__N||n.__}function Axe(t,e){var r=rh(Al++,3);!Cn.__s&&WA(r.__H,e)&&(r.__=t,r.u=e,Xr.__H.__h.push(r))}function lQ(t,e){var r=rh(Al++,4);!Cn.__s&&WA(r.__H,e)&&(r.__=t,r.u=e,Xr.__h.push(r))}function Txe(t){return l0=5,qA(function(){return{current:t}},[])}function Ixe(t,e,r){l0=6,lQ(function(){if(typeof t=="function"){var n=t(e());return function(){t(null),n&&typeof n=="function"&&n()}}if(t)return t.current=e(),function(){return t.current=null}},r==null?r:r.concat(t))}function qA(t,e){var r=rh(Al++,7);return WA(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function kxe(t,e){return l0=8,qA(function(){return t},e)}function $xe(t){var e=Xr.context[t.__c],r=rh(Al++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Xr)),e.props.value):t.__}function Nxe(t,e){Cn.useDebugValue&&Cn.useDebugValue(e?e(t):t)}function Pxe(t){var e=rh(Al++,10),r=oQ();return e.__=t,Xr.componentDidCatch||(Xr.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Oxe(){var t=rh(Al++,11);if(!t.__){for(var e=Xr.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function Rxe(){for(var t;t=aQ.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Hb),e.__h.some(s7),e.__h=[]}catch(r){e.__h=[],Cn.__e(r,t.__v)}}}Cn.__b=function(t){Xr=null,yD&&yD(t)},Cn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),xD&&xD(t,e)},Cn.__r=function(t){bD&&bD(t),Al=0;var e=(Xr=t.__c).__H;e&&(iE===Xr?(e.__h=[],Xr.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(Hb),e.__h.some(s7),e.__h=[],Al=0)),iE=Xr},Cn.diffed=function(t){vD&&vD(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(aQ.push(e)!==1&&mD===Cn.requestAnimationFrame||((mD=Cn.requestAnimationFrame)||Dxe)(Rxe)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),iE=Xr=null},Cn.__c=function(t,e){e.some(function(r){try{r.__h.some(Hb),r.__h=r.__h.filter(function(n){return!n.__||s7(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Cn.__e(n,r.__v)}}),wD&&wD(t,e)},Cn.unmount=function(t){ED&&ED(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{Hb(n)}catch(i){e=i}}),r.__H=void 0,e&&Cn.__e(e,r.__v))};var _D=typeof requestAnimationFrame=="function";function Dxe(t){var e,r=function(){clearTimeout(n),_D&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);_D&&(e=requestAnimationFrame(r))}function Hb(t){var e=Xr,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Xr=e}function s7(t){var e=Xr;t.__c=t.__(),Xr=e}function WA(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function uQ(t,e){return typeof e=="function"?e(t):e}const Mxe=Object.freeze(Object.defineProperty({__proto__:null,useCallback:kxe,useContext:$xe,useDebugValue:Nxe,useEffect:Axe,useErrorBoundary:Pxe,useId:Oxe,useImperativeHandle:Ixe,useLayoutEffect:lQ,useMemo:qA,useReducer:cQ,useRef
425:Txe,useState:oQ},Symbol.toStringTag,{value:"Module"})),jxe=m0(Mxe);var H2={},CD;function Lxe(){return CD||(CD=1,Object.defineProperty(H2,"__esModule",{value:!0}),H2.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),H2}var SD;function dQ(){return SD||(SD=1,(function(t){var e=Ng&&Ng.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(WK),n=sQ,i=jxe,s=W3(),a=e(Lxe()),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiA
425wIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";let l=class{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,s.isDarkMode)()}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const g=this.nextItemKey++;return this.items.set(g,h),this.render(),()=>{this.items.delete(g),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,g])=>(0,n.h)(t.SnackbarInstance,Object.assign({},g,{key:h}))))),this.root)}};t.Snackbar=l;const u=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,a.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=u;const d=({autoExpand:f,message:h,menuItems:g})=>{const[m,y]=(0,i.useState)(!0),[b,E]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const w=[window.setTimeout(()=>{y(!1)},1),window.setTimeout(()=>{E(!0)},1e4)];return()=>{w.forEach(window.clearTimeout)}});const v=()=>{E(!b)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",m&&"-cbwsdk-snackbar-instance-hidden",b&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:v},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!b&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),g&&g.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},g.map((w,x)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:w.onClick,key:x},(0,n.h)("svg",{width:w.svgWidth,height:w.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":w.defaultFillRule,"clip-rule":w.defaultClipRule,d:w.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",w.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},w.info)))))};t.SnackbarInstance=d})(Ng)),Ng}var AD;function Fxe(){if(AD)return $g;AD=1,Object.defineProperty($g,"__esModule",{value:!0}),$g.WalletLinkRelayUI=void 0;const t=qK(),e=dQ();let r=class{constructor(){this.attached=!1,this.snackbar=new e.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const i=document.documentElement,s=document.createElement("div");s.className="-cbwsdk-css-reset",i.appendChild(s),this.snackbar.attach(s),this.attached=!0,(0,t.injectCssReset)()}showConnecting(i){let s;return i.isUnlinkedErrorState?s={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.9687
4255C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:i.onResetConnection}]}:s={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:i.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:i.onResetConnection}]},this.snackbar.presentItem(s)}};return $g.WalletLinkRelayUI=r,$g}var Pg={},Td={},G2={},TD;function Uxe(){return TD||(TD=1,Object.defineProperty(G2,"__esModule",{value:!0}),G2.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
425.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),G2}var ID;function Bxe(){if(ID)return Td;ID=1;var t=Td&&Td.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Td,"__esModule",{value:!0}),Td.RedirectDialog=void 0;const e=t(WK),r=sQ,n=qK(),i=dQ(),s=W3(),a=t(Uxe());let o=class{constructor(){this.root=null,this.darkMode=(0,s.isDarkMode)()}attach(){const u=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",u.appendChild(this.root),(0,n.injectCssReset)()}present(u){this.render(u)}clear(){this.render(null)}render(u){this.root&&((0,r.render)(null,this.root),u&&(0,r.render)((0,r.h)(c,Object.assign({},u,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}};Td.RedirectDialog=o;const c=({title:l,buttonText:u,darkMode:d,onButtonClick:f,onDismiss:h})=>{const g=d?"dark":"light";return(0,r.h)(i.SnackbarContainer,{darkMode:d},(0,r.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,r.h)("style",null,a.default),(0,r.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:h}),(0,r.h)("div",{class:(0,e.default)("-cbwsdk-redirect-dialog-box",g)},(0,r.h)("p",null,l),(0,r.h)("button",{onClick:f},u))))};return Td}var Pc={},kD;function zA(){return kD||(kD=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.CBW_MOBILE_DEEPLINK_URL=Pc.WALLETLINK_URL=Pc.CB_KEYS_URL=void 0,Pc.CB_KEYS_URL="https://keys.coinbase.com/connect",Pc.WALLETLINK_URL="https://www.walletlink.org",Pc.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink"),Pc}var $D;function qxe(){if($D)return Pg;$D=1,Object.defineProperty(Pg,"__esModule",{value:!0}),Pg.WLMobileRelayUI=void 0;const t=Bxe(),e=W3(),r=zA();let n=class{constructor(){this.attached=!1,this.redirectDialog=new t.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(s){const a=new URL(r.CBW_MOBILE_DEEPLINK_URL);a.searchParams.append("redirect_url",(0,e.getLocation)().href),s&&a.searchParams.append("wl_url",s);const o=document.createElement("a");o.target="cbw-opener",o.href=a.href,o.rel="noreferrer noopener",o.click()}openCoinbaseWalletDeeplink(s){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(s)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(s)},99)}showConnecting(s){return()=>{this.redirectDialog.clear()}}};return Pg.WLMobileRelayUI=n,Pg}var ND;function Wxe(){if(ND)return Sg;ND=1,Object.defineProperty(Sg,"__esModule",{value:!0}),Sg.WalletLinkRelay=void 0;const t=IEe(),e=RA(),r=kK(),n=pxe(),i=$A(),s=W3(),a=Fxe(),o=qxe(),c=Fl(),l=Ul(),u=th();let d=class Ld{constructor(h){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,s.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=b=>{this.isLinked=b;const E=this.storage.getItem(e.LOCAL_STORAGE_ADDRESSES_KEY);if(b&&(this._session.linked=b),this.isUnlinkedErrorState=!1,E){const v=E.split(" "),w=this.storage.getItem("IsStandaloneSigning")==="true";v[0]!==""&&!b&&this._session.linked&&!w&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(b,E)=>{this.storage.setItem(b,E)},this.chainUpdated=(b,E)=>{this.chainCallbackParams.chainId===b&&this.chainCallbackParams.jsonRpcUrl===E||(this.chainCallbackParams={chainId:b,jsonRpcUrl:E},this.chainCallback&&this.chainCallback(b,E))},this.accountUpdated=b=>{this.accountsCallback&&this.accountsCallback([b]),Ld.accountRequestCallbackIds.size>
4250&&(Array.from(Ld.accountRequestCallbackIds.values()).forEach(E=>{const v={type:"WEB3_RESPONSE",id:E,response:{method:"requestEthereumAccounts",result:[b]}};this.invokeCallback(Object.assign(Object.assign({},v),{id:E}))}),Ld.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=h.linkAPIUrl,this.storage=h.storage;const{session:g,ui:m,connection:y}=this.subscribe();this._session=g,this.connection=y,this.relayEventManager=new r.RelayEventManager,this.ui=m}subscribe(){const h=n.WalletLinkSession.load(this.storage)||new n.WalletLinkSession(this.storage).save(),{linkAPIUrl:g}=this,m=new t.WalletLinkConnection({session:h,linkAPIUrl:g,listener:this}),y=this.isMobileWeb?new o.WLMobileRelayUI:new a.WalletLinkRelayUI;return m.connect(),{session:h,ui:y,connection:m}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(h=>setTimeout(()=>h(null),1e3))]).then(()=>{this.connection.destroy();const h=n.WalletLinkSession.load(this.storage);(h==null?void 0:h.id)===this._session.id&&u.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(h=>{})}setAppInfo(h,g){this.appName=h,this.appLogoUrl=g}getStorageItem(h){return this.storage.getItem(h)}setStorageItem(h,g){this.storage.setItem(h,g)}signEthereumMessage(h,g,m,y){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,l.hexStringFromBuffer)(h,!0),address:g,addPrefix:m,typedDataJson:y||null}})}ethereumAddressFromSignedMessage(h,g,m){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,l.hexStringFromBuffer)(h,!0),signature:(0,l.hexStringFromBuffer)(g,!0),addPrefix:m}})}signEthereumTransaction(h){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:h.fromAddress,toAddress:h.toAddress,weiValue:(0,l.bigIntStringFromBigInt)(h.weiValue),data:(0,l.hexStringFromBuffer)(h.data,!0),nonce:h.nonce,gasPriceInWei:h.gasPriceInWei?(0,l.bigIntStringFromBigInt)(h.gasPriceInWei):null,maxFeePerGas:h.gasPriceInWei?(0,l.bigIntStringFromBigInt)(h.gasPriceInWei):null,maxPriorityFeePerGas:h.gasPriceInWei?(0,l.bigIntStringFromBigInt)(h.gasPriceInWei):null,gasLimit:h.gasLimit?(0,l.bigIntStringFromBigInt)(h.gasLimit):null,chainId:h.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(h){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:h.fromAddress,toAddress:h.toAddress,weiValue:(0,l.bigIntStringFromBigInt)(h.weiValue),data:(0,l.hexStringFromBuffer)(h.data,!0),nonce:h.nonce,gasPriceInWei:h.gasPriceInWei?(0,l.bigIntStringFromBigInt)(h.gasPriceInWei):null,maxFeePerGas:h.maxFeePerGas?(0,l.bigIntStringFromBigInt)(h.maxFeePerGas):null,maxPriorityFeePerGas:h.maxPriorityFeePerGas?(0,l.bigIntStringFromBigInt)(h.maxPriorityFeePerGas):null,gasLimit:h.gasLimit?(0,l.bigIntStringFromBigInt)(h.gasLimit):null,chainId:h.chainId,shouldSubmit:!0}})}submitEthereumTransaction(h,g){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,l.hexStringFromBuffer)(h,!0),chainId:g}})}scanQRCode(h){return this.sendRequest({method:"scanQRCode",params:{regExp:h}})}getWalletLinkSession(){return this._session}genericRequest(h,g){return this.sendRequest({method:"generic",params:{action:g,data:h}})}sendGenericMessage(h){return this.sendRequest(h)}sendRequest(h){let g=null;const m=(0,l.randomBytesHex)(8),y=b=>{this.publishWeb3RequestCanceledEvent(m),this.handleErrorResponse(m,h.method,b),g==null||g()};return new Promise((b,E)=>{g=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:y,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(m,v=>{if(g==null||g(),(0,i.isErrorResponse)(v))return E(new Error(v.errorMessage));b(v)}),this.publishWeb3RequestEvent(m,h)})}setAccountsCallback(h){this.accountsCallback=h}setChainCallback(h){this.chainCallback=h}setDappDefaultChainCallback(h){this.dappDefaultChain=h}publishWeb3RequestEvent(h,g){const m={type:"WEB3_REQUEST",id:h,request:g};this.publishEvent("Web3Request",m,!0).then(y=>{}).catch(y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:m.id,response:{method:g.method,errorMessage:y.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(g.method)}
425openCoinbaseWalletDeeplink(h){if(this.ui instanceof o.WLMobileRelayUI)switch(h){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(h){const g={type:"WEB3_REQUEST_CANCELED",id:h};this.publishEvent("Web3RequestCanceled",g,!1).then()}publishEvent(h,g,m){return this.connection.publishEvent(h,g,m)}handleWeb3ResponseMessage(h){const{response:g}=h;if(g.method==="requestEthereumAccounts"){Ld.accountRequestCallbackIds.forEach(m=>this.invokeCallback(Object.assign(Object.assign({},h),{id:m}))),Ld.accountRequestCallbackIds.clear();return}this.invokeCallback(h)}handleErrorResponse(h,g,m){var y;const b=(y=m==null?void 0:m.message)!==null&&y!==void 0?y:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:g,errorMessage:b}})}invokeCallback(h){const g=this.relayEventManager.callbacks.get(h.id);g&&(g(h.response),this.relayEventManager.callbacks.delete(h.id))}requestEthereumAccounts(){const h={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},g=(0,l.randomBytesHex)(8);return new Promise((m,y)=>{this.relayEventManager.callbacks.set(g,b=>{if((0,i.isErrorResponse)(b))return y(new Error(b.errorMessage));m(b)}),Ld.accountRequestCallbackIds.add(g),this.publishWeb3RequestEvent(g,h)})}watchAsset(h,g,m,y,b,E){const v={method:"watchAsset",params:{type:h,options:{address:g,symbol:m,decimals:y,image:b},chainId:E}};let w=null;const x=(0,l.randomBytesHex)(8),_=S=>{this.publishWeb3RequestCanceledEvent(x),this.handleErrorResponse(x,v.method,S),w==null||w()};return w=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:_,onResetConnection:this.resetAndReload}),new Promise((S,A)=>{this.relayEventManager.callbacks.set(x,I=>{if(w==null||w(),(0,i.isErrorResponse)(I))return A(new Error(I.errorMessage));S(I)}),this.publishWeb3RequestEvent(x,v)})}addEthereumChain(h,g,m,y,b,E){const v={method:"addEthereumChain",params:{chainId:h,rpcUrls:g,blockExplorerUrls:y,chainName:b,iconUrls:m,nativeCurrency:E}};let w=null;const x=(0,l.randomBytesHex)(8),_=S=>{this.publishWeb3RequestCanceledEvent(x),this.handleErrorResponse(x,v.method,S),w==null||w()};return w=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:_,onResetConnection:this.resetAndReload}),new Promise((S,A)=>{this.relayEventManager.callbacks.set(x,I=>{if(w==null||w(),(0,i.isErrorResponse)(I))return A(new Error(I.errorMessage));S(I)}),this.publishWeb3RequestEvent(x,v)})}switchEthereumChain(h,g){const m={method:"switchEthereumChain",params:Object.assign({chainId:h},{address:g})},y=(0,l.randomBytesHex)(8);return new Promise((b,E)=>{this.relayEventManager.callbacks.set(y,v=>{if((0,i.isErrorResponse)(v)&&v.errorCode)return E(c.standardErrors.provider.custom({code:v.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,i.isErrorResponse)(v))return E(new Error(v.errorMessage));b(v)}),this.publishWeb3RequestEvent(y,m)})}};return Sg.WalletLinkRelay=d,d.accountRequestCallbackIds=new Set,Sg}var PD;function zxe(){if(PD)return Cd;PD=1;var t=Cd&&Cd.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(Cd,"__esModule",{value:!0}),Cd.WalletLinkSigner=void 0;const e=t(CEe()),r=RA(),n=kK(),i=$A(),s=Wxe(),a=zA(),o=Fl(),c=Ul(),l=th(),u="DefaultChainId",d="DefaultJsonRpcUrl";let f=class{constructor(g){var m,y;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:b,appLogoUrl:E}=g.metadata;this._appName=b,this._appLogoUrl=E,this._storage=new l.ScopedLocalStorage("walletlink",a.WALLETLINK_URL),this.updateListener=g.updateListener,this._relayEventManager=new n.RelayEventManager,this._jsonRpcUrlFromOpts="";const v=this._storage.getItem(r.LOCAL_STORAGE_ADDRESSES_KEY);if(v){const x=v.split(" ");x[0]!==""&&(this._addresses=x.map(_=>(0,c.ensureAddressString)(_)),(m=this.updateListener)===null||m===void 0||m.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(u)&&((y=this.updateListener)===null||y===void 0||y.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const g=this.initializeRelay(),{id:m,secret:y}=g.getWalletLinkSession();return{id:m,secret:y}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var g;return(g=this._storage.getItem(d))!==null&&g!==void 0?g:this._jsonRpcUrlFromOpts}set jsonRpcUrl(g){this._storage.setItem(d,g)}updateProviderInfo(g,m){var y;this.jsonRpcUrl=g;const b=this.getChainId();this._storage.setItem(u,m.toString(10)),((0,c.ensureIntNumber)(m)!==b||!this.hasMadeFirstChainChangedEmission)&&((y=this.updateListener)===null||y===void 0||y.onChainUpdate({chain:{id:m,rpcUrl:g},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(g,m,y,b,E,v){const x=await this.initializeRelay().watchAsset(g,m,y,b,E,v==null?void 0:v.toString());return(0,i.isErrorResponse)(x)?!1:!!x.result}async addEthereumChain(g,m,y,b,E,v){var w,x;if((0,c.ensureIntNumber)(g)===this.getChainId())return!1;const _=this.initializeRelay();this._isAuthorized()||await _.requestEthereumAccounts();const S=await _.addEthereumChain(g.toString(),m,E,y,b,v);return(0,i.isErrorResponse)(S)?!1:(((w=S.result)===null||w===void 0?void 0:w.isApproved)===!0&&this.updateProviderInfo(m[0],g),
425((x=S.result)===null||x===void 0?void 0:x.isApproved)===!0)}async switchEthereumChain(g){const y=await this.initializeRelay().switchEthereumChain(g.toString(10),this.selectedAddress||void 0);if((0,i.isErrorResponse)(y)){if(!y.errorCode)return;throw y.errorCode===o.standardErrorCodes.provider.unsupportedChain?o.standardErrors.provider.unsupportedChain():o.standardErrors.provider.custom({message:y.errorMessage,code:y.errorCode})}const b=y.result;b.isApproved&&b.rpcUrl.length>0&&this.updateProviderInfo(b.rpcUrl,g)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(g){try{return this._request(g).catch(m=>{throw m})}catch(m){return Promise.reject(m)}}async _request(g){if(!g||typeof g!="object"||Array.isArray(g))throw o.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:g});const{method:m,params:y}=g;if(typeof m!="string"||m.length===0)throw o.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:g});if(y!==void 0&&!Array.isArray(y)&&(typeof y!="object"||y===null))throw o.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:g});const b=y===void 0?[]:y,E=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:m,params:b,jsonrpc:"2.0",id:E})).result}_setAddresses(g,m){var y;if(!Array.isArray(g))throw new Error("addresses is not an array");const b=g.map(E=>(0,c.ensureAddressString)(E));JSON.stringify(b)!==JSON.stringify(this._addresses)&&(this._addresses=b,(y=this.updateListener)===null||y===void 0||y.onAccountsUpdate({accounts:b,source:"wallet"}),this._storage.setItem(r.LOCAL_STORAGE_ADDRESSES_KEY,b.join(" ")))}_sendRequestAsync(g){return new Promise((m,y)=>{try{const b=this._handleSynchronousMethods(g);if(b!==void 0)return m({jsonrpc:"2.0",id:g.id,result:b})}catch(b){return y(b)}this._handleAsynchronousMethods(g).then(b=>b&&m(Object.assign(Object.assign({},b),{id:g.id}))).catch(b=>y(b))})}_handleSynchronousMethods(g){const{method:m}=g;switch(m){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(g){const{method:m}=g,y=g.params||[];switch(m){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(y);case"eth_ecRecover":return this._eth_ecRecover(y);case"personal_sign":return this._personal_sign(y);case"personal_ecRecover":return this._personal_ecRecover(y);case"eth_signTransaction":return this._eth_signTransaction(y);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(y);case"eth_sendTransaction":return this._eth_sendTransaction(y);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(y);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(y);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(y);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(y);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(y);case"wallet_watchAsset":return this._wallet_watchAsset(y);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(g){try{const m=(0,c.ensureAddressString)(g);return this._addresses.map(b=>(0,c.ensureAddressString)(b)).includes(m)}catch{}return!1}_ensureKnownAddress(g){if(!this._isKnownAddress(g))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(g){const m=g.from?(0,c.ensureAddressString)(g.from):this.selectedAddress;if(!m)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(m);const y=g.to?(0,c.ensureAddressString)(g.to):null,b=g.value!=null?(0,c.ensureBigInt)(g.value):BigInt(0),E=g.data?(0,c.ensureBuffer)(g.data):Buffer.alloc(0),v=g.nonce!=null?(0,c.ensureIntNumber)(g.nonce):null,w=g.gasPrice!=null?(0,c.ensureBigInt)(g.gasPrice):null,x=g.maxFeePerGas!=null?(0,c.ensureBigInt)(g.maxFeePerGas):null,_=g.maxPriorityFeePerGas!=null?(0,c.ensureBigInt)(g.maxPriorityFeePerGas):null,S=g.gas!=null?(0,c.ensureBigInt)(g.gas):null,A=g.chainId?(0,c.ensureIntNumber)(g.chainId):this.getChainId();return{fromAddress:m,toAddress:y,weiValue:b,data:E,nonce:v,gasPriceInWei:w,maxFeePerGas:x,maxPriorityFeePerGas:_,gasLim
425it:S,chainId:A}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw o.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw o.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(g,m,y,b){this._ensureKnownAddress(m);try{const v=await this.initializeRelay().signEthereumMessage(g,m,y,b);if((0,i.isErrorResponse)(v))throw new Error(v.errorMessage);return{jsonrpc:"2.0",id:0,result:v.result}}catch(E){throw typeof E.message=="string"&&E.message.match(/(denied|rejected)/i)?o.standardErrors.provider.userRejectedRequest("User denied message signature"):E}}async _ethereumAddressFromSignedMessage(g,m,y){const E=await this.initializeRelay().ethereumAddressFromSignedMessage(g,m,y);if((0,i.isErrorResponse)(E))throw new Error(E.errorMessage);return{jsonrpc:"2.0",id:0,result:E.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,c.hexStringFromIntNumber)(this.getChainId())}getChainId(){const g=this._storage.getItem(u);if(!g)return(0,c.ensureIntNumber)(1);const m=parseInt(g,10);return(0,c.ensureIntNumber)(m)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let g;try{if(g=await this.initializeRelay().requestEthereumAccounts(),(0,i.isErrorResponse)(g))throw new Error(g.errorMessage)}catch(m){throw typeof m.message=="string"&&m.message.match(/(denied|rejected)/i)?o.standardErrors.provider.userRejectedRequest("User denied account authorization"):m}if(!g.result)throw new Error("accounts received is empty");return this._setAddresses(g.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(g){this._requireAuthorization();const m=(0,c.ensureAddressString)(g[0]),y=(0,c.ensureBuffer)(g[1]);return this._signEthereumMessage(y,m,!1)}_eth_ecRecover(g){const m=(0,c.ensureBuffer)(g[0]),y=(0,c.ensureBuffer)(g[1]);return this._ethereumAddressFromSignedMessage(m,y,!1)}_personal_sign(g){this._requireAuthorization();const m=(0,c.ensureBuffer)(g[0]),y=(0,c.ensureAddressString)(g[1]);return this._signEthereumMessage(m,y,!0)}_personal_ecRecover(g){const m=(0,c.ensureBuffer)(g[0]),y=(0,c.ensureBuffer)(g[1]);return this._ethereumAddressFromSignedMessage(m,y,!0)}async _eth_signTransaction(g){this._requireAuthorization();const m=this._prepareTransactionParams(g[0]||{});try{const b=await this.initializeRelay().signEthereumTransaction(m);if((0,i.isErrorResponse)(b))throw new Error(b.errorMessage);return{jsonrpc:"2.0",id:0,result:b.result}}catch(y){throw typeof y.message=="string"&&y.message.match(/(denied|rejected)/i)?o.standardErrors.provider.userRejectedRequest("User denied transaction signature"):y}}async _eth_sendRawTransaction(g){const m=(0,c.ensureBuffer)(g[0]),b=await this.initializeRelay().submitEthereumTransaction(m,this.getChainId());if((0,i.isErrorResponse)(b))throw new Error(b.errorMessage);return{jsonrpc:"2.0",id:0,result:b.result}}async _eth_sendTransaction(g){this._requireAuthorization();const m=this._prepareTransactionParams(g[0]||{});try{const b=await this.initializeRelay().signAndSubmitEthereumTransaction(m);if((0,i.isErrorResponse)(b))throw new Error(b.errorMessage);return{jsonrpc:"2.0",id:0,result:b.result}}catch(y){throw typeof y.message=="string"&&y.message.match(/(denied|rejected)/i)?o.standardErrors.provider.userRejectedRequest("User denied transaction signature"):y}}async _eth_signTypedData_v1(g){this._requireAuthorization();const m=(0,c.ensureParsedJSONObject)(g[0]),y=(0,c.ensureAddressString)(g[1]);this._ensureKnownAddress(y);const b=e.default.hashForSignTypedDataLegacy({data:m}),E=JSON.stringify(m,null,2);return this._signEthereumMessage(b,y,!1,E)}async _eth_signTypedData_v3(g){this._requireAuthorization();const m=(0,c.ensureAddressString)(g[0]),y=(0,c.ensureParsedJSONObject)(g[1]);this._ensureKnownAddress(m);const b=e.default.hashForSignTypedData_v3({data:y}),E=JSON.stringify(y,null,2);return this._signEthereumMessage(b,m,!1,E)}async _eth_signTypedData_v4(g){this._requireAuthorization();const m=(0,c.ensureAddressString)(g[0]),y=(0,c.ensureParsedJSONObject)(g[1]);this._ensureKnownAddress(m);const b=e.default.hashForSignTypedData_v4({data:y}),E=JSON.stringify(y,null,2);return this._signEthereumMessage(b,m,!1,E)}async _wallet_addEthereumChain(g){var m,y,b,E;const v=g[0];if(((m=v.rpcUrls)===null||m===void 0?void 0:m.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!v.chainName||v.chainName.trim()==="")throw o.standardErrors.rpc.invalidParams("chainName is a required field");if(!v.nativeCurrency)throw o.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const w=parseInt(v.chainId,16);
425return await this.addEthereumChain(w,(y=v.rpcUrls)!==null&&y!==void 0?y:[],(b=v.blockExplorerUrls)!==null&&b!==void 0?b:[],v.chainName,(E=v.iconUrls)!==null&&E!==void 0?E:[],v.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(g){const m=g[0];return await this.switchEthereumChain(parseInt(m.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(g){const m=Array.isArray(g)?g[0]:g;if(!m.type)throw o.standardErrors.rpc.invalidParams("Type is required");if((m==null?void 0:m.type)!=="ERC20")throw o.standardErrors.rpc.invalidParams(`Asset of type '${m.type}' is not supported`);if(!(m!=null&&m.options))throw o.standardErrors.rpc.invalidParams("Options are required");if(!(m!=null&&m.options.address))throw o.standardErrors.rpc.invalidParams("Address is required");const y=this.getChainId(),{address:b,symbol:E,image:v,decimals:w}=m.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(m.type,b,E,w,v,y)}}initializeRelay(){if(!this._relay){const g=new s.WalletLinkRelay({linkAPIUrl:a.WALLETLINK_URL,storage:this._storage});g.setAppInfo(this._appName,this._appLogoUrl),g.attachUI(),g.setAccountsCallback((m,y)=>this._setAddresses(m,y)),g.setChainCallback((m,y)=>{this.updateProviderInfo(y,parseInt(m,10))}),this._relay=g}return this._relay}};return Cd.WalletLinkSigner=f,Cd}var Qa={},OD;function VA(){if(OD)return Qa;OD=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.checkErrorForInvalidRequestArgs=Qa.getCoinbaseInjectedProvider=Qa.getCoinbaseInjectedSigner=Qa.fetchRPCRequest=void 0;const t=U3(),e=Fl();async function r(a,o){if(!o.rpcUrl)throw e.standardErrors.rpc.internal("No RPC URL set for chain");const c=Object.assign(Object.assign({},a),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(o.rpcUrl,{method:"POST",body:JSON.stringify(c),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":t.LIB_VERSION}})).json()).result}Qa.fetchRPCRequest=r;function n(){return globalThis.coinbaseWalletSigner}Qa.getCoinbaseInjectedSigner=n;function i({metadata:a,preference:o}){var c,l,u;const d=globalThis;if(o.options!=="smartWalletOnly"){if(n())return;const g=d.coinbaseWalletExtension;if(g){const{appName:m,appLogoUrl:y,appChainIds:b}=a;return(c=g.setAppInfo)===null||c===void 0||c.call(g,m,y,b),g}}const f=(l=d.ethereum)!==null&&l!==void 0?l:(u=d.top)===null||u===void 0?void 0:u.ethereum;if(f!=null&&f.isCoinbaseBrowser)return f}Qa.getCoinbaseInjectedProvider=i;function s(a){if(!a||typeof a!="object"||Array.isArray(a))return e.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:a});const{method:o,params:c}=a;if(typeof o!="string"||o.length===0)return e.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:a});if(c!==void 0&&!Array.isArray(c)&&(typeof c!="object"||c===null))return e.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:a})}return Qa.checkErrorForInvalidRequestArgs=s,Qa}var RD;function Vxe(){if(RD)return Ga;RD=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.createSigner=Ga.fetchSignerType=Ga.storeSignerType=Ga.loadSignerType=void 0;const t=lEe(),e=zxe(),r=Fl(),n=VA(),i=th(),s="SignerType",a=new i.ScopedLocalStorage("CBWSDK","SignerConfigurator");function o(){return a.getItem(s)}Ga.loadSignerType=o;function c(f){a.setItem(s,f)}Ga.storeSignerType=c;async function l(f){const{communicator:h,metadata:g}=f;d(h,g).catch(()=>{});const m={id:crypto.randomUUID(),event:"selectSignerType",data:f.preference},{data:y}=await h.postRequestAndWaitForResponse(m);return y}Ga.fetchSignerType=l;function u(f){const{signerType:h,metadata:g,communicator:m,updateListener:y}=f;switch(h){case"scw":return new t.SCWSigner({metadata:g,updateListener:y,communicator:m});case"walletlink":return new e.WalletLinkSigner({metadata:g,updateListener:y});case"extension":{const b=(0,n.getCoinbaseInjectedSigner)();if(!b)throw r.standardErrors.rpc.internal("injected signer not found");return b}}}Ga.createSigner=u;async function d(f,h){await f.onMessage(({event:m})=>m==="WalletLinkSessionRequest");const g=new e.WalletLinkSigner({metadata:h});f.postMessage({event:"WalletLinkUpdate",data:{session:g.getSession()}}),await g.handshake(),f.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}return Ga}var Og={},Id={},DD;
425function Hxe(){if(DD)return Id;DD=1,Object.defineProperty(Id,"__esModule",{value:!0}),Id.closePopup=Id.openPopup=void 0;const t=Fl(),e=420,r=540;function n(s){const a=(window.innerWidth-e)/2+window.screenX,o=(window.innerHeight-r)/2+window.screenY,c=window.open(s,"Smart Wallet",`width=${e}, height=${r}, left=${a}, top=${o}`);if(c==null||c.focus(),!c)throw t.standardErrors.rpc.internal("Pop up window failed to open");return c}Id.openPopup=n;function i(s){s&&!s.closed&&s.close()}return Id.closePopup=i,Id}var MD;function Gxe(){if(MD)return Og;MD=1,Object.defineProperty(Og,"__esModule",{value:!0}),Og.Communicator=void 0;const t=U3(),e=Hxe(),r=zA(),n=Fl();let i=class{constructor(a=r.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async o=>{(await this.waitForPopupLoaded()).postMessage(o,this.url.origin)},this.postRequestAndWaitForResponse=async o=>{const c=this.onMessage(({requestId:l})=>l===o.id);return this.postMessage(o),await c},this.onMessage=async o=>new Promise((c,l)=>{const u=d=>{if(d.origin!==this.url.origin)return;const f=d.data;o(f)&&(c(f),window.removeEventListener("message",u),this.listeners.delete(u))};window.addEventListener("message",u),this.listeners.set(u,{reject:l})}),this.disconnect=()=>{(0,e.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:o},c)=>{o(n.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",c)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?this.popup:(this.popup=(0,e.openPopup)(this.url),this.onMessage(({event:o})=>o==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:o})=>o==="PopupLoaded").then(o=>{this.postMessage({requestId:o.id,data:{version:t.LIB_VERSION}})}).then(()=>{if(!this.popup)throw n.standardErrors.rpc.internal();return this.popup})),this.url=new URL(a)}};return Og.Communicator=i,Og}var Rg={}
425,jD;function Kxe(){if(jD)return Rg;jD=1,Object.defineProperty(Rg,"__esModule",{value:!0}),Rg.determineMethodCategory=void 0;const t={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function e(r){for(const n in t){const i=n;if(t[i].includes(r))return i}}return Rg.determineMethodCategory=e,Rg}var LD;function Qxe(){if(LD)return $c;LD=1;var t=$c&&$c.__rest||function(h,g){var m={};for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&g.indexOf(y)<0&&(m[y]=h[y]);if(h!=null&&typeof Object.getOwnPropertySymbols=="function")for(var b=0,y=Object.getOwnPropertySymbols(h);b<y.length;b++)g.indexOf(y[b])<0&&Object.prototype.propertyIsEnumerable.call(h,y[b])&&(m[y[b]]=h[y[b]]);return m},e=$c&&$c.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty($c,"__esModule",{value:!0}),$c.CoinbaseWalletProvider=void 0;const r=e(rV()),n=Fl(),i=aEe(),s=NA(),a=Ul(),o=Vxe(),c=VA(),l=Gxe(),u=Kxe(),d=th();let f=class extends r.default{constructor(g){var m,y,{metadata:b}=g,E=g.preference,{keysUrl:v}=E,w=t(E,["keysUrl"]);super(),this.accounts=[],this.handlers={handshake:async _=>{try{if(this.connected)return this.emit("connect",{chainId:(0,a.hexStringFromIntNumber)((0,s.IntNumber)(this.chain.id))}),this.accounts;const S=await this.requestSignerSelection(),A=this.initSigner(S),I=await A.handshake();return this.signer=A,(0,o.storeSignerType)(S),this.emit("connect",{chainId:(0,a.hexStringFromIntNumber)((0,s.IntNumber)(this.chain.id))}),I}catch(S){throw this.handleUnauthorizedError(S),S}},sign:async _=>{if(!this.connected||!this.signer)throw n.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(_)}catch(S){throw this.handleUnauthorizedError(S),S}},fetch:_=>(0,c.fetchRPCRequest)(_,this.chain),state:_=>{const S=()=>{if(this.connected)return this.accounts;throw n.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(_.method){case"eth_chainId":return(0,a.hexStringFromIntNumber)((0,s.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return S();case"eth_coinbase":return S()[0];default:return this.handlers.unsupported(_)}},deprecated:({method:_})=>{throw n.standardErrors.rpc.methodNotSupported(`Method ${_} is deprecated.`)},unsupported:({method:_})=>{throw n.standardErrors.rpc.methodNotSupported(`Method ${_} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:_,source:S})=>{(0,a.areAddressArraysEqual)(this.accounts,_)||(this.accounts=_,S!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:_,source:S})=>{_.id===this.chain.id&&_.rpcUrl===this.chain.rpcUrl||(this.chain=_,S!=="storage"&&this.emit("chainChanged",(0,a.hexStringFromIntNumber)((0,s.IntNumber)(_.id))))}},this.metadata=b,this.preference=w,this.communicator=new l.Communicator(v),this.chain={id:(y=(m=b.appChainIds)===null||m===void 0?void 0:m[0])!==null&&y!==void 0?y:1};const x=(0,o.loadSignerType)();this.signer=x?this.initSigner(x):null}get connected(){return this.accounts.length>0}async request(g){var m;try{const y=(0,c.checkErrorForInvalidRequestArgs)(g);if(y)throw y;const b=(m=(0,u.determineMethodCategory)(g.method))!==null&&m!==void 0?m:"fetch";return this.handlers[b](g)}catch(y){return Promise.reject((0,i.serializeError)(y,g.method))}}handleUnauthorizedError(g){g.code===n.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1}
425,d.ScopedLocalStorage.clearAll(),this.emit("disconnect",n.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,o.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(g){return(0,o.createSigner)({signerType:g,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}};return $c.CoinbaseWalletProvider=f,$c}var FD;function UD(){if(FD)return pg;FD=1,Object.defineProperty(pg,"__esModule",{value:!0}),pg.CoinbaseWalletSDK=void 0;const t=iEe(),e=Qxe(),r=th(),n=U3(),i=Ul(),s=VA();let a=class{constructor(c){this.metadata={appName:c.appName||"Dapp",appLogoUrl:c.appLogoUrl||(0,i.getFavicon)(),appChainIds:c.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(c={options:"all"}){var l;const u={metadata:this.metadata,preference:c};return(l=(0,s.getCoinbaseInjectedProvider)(u))!==null&&l!==void 0?l:new e.CoinbaseWalletProvider(u)}getCoinbaseWalletLogo(c,l=240){return(0,t.walletLogo)(c,l)}storeLatestVersion(){new r.ScopedLocalStorage("CBWSDK").setItem("VERSION",n.LIB_VERSION)}};return pg.CoinbaseWalletSDK=a,pg}var BD;function Yxe(){return BD||(BD=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;const e=UD();t.default=e.CoinbaseWalletSDK;var r=UD();Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(S4)),S4}var Zxe=Yxe();const a7=({style:t,...e})=>p.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),Xxe="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",hd={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},fQ={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]}
425,default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},HA={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},hQ={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},ql={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},pQ={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},Jxe={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},GA={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},e_e={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},t_e={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},r_e={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},n_e={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.
425com"}}},i_e={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},gQ={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},s_e={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},a_e={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},_c={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},nh={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},mQ={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},Wl={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},yQ={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},o_e={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18}
425,rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},bQ={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},vQ={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},c_e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},l_e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},Jv=[hd,fQ,bQ,_c,nh,mQ,Wl,yQ,GA,e_e,t_e,r_e,ql,pQ,Jxe,a_e,gQ,s_e,HA,hQ,vQ,l_e,c_e,i_e,o_e,n_e],wQ=new Set(Jv.map((t=>t.id)));let EQ=class extends un{constructor(){super("Wallet timeout"),this.type="wallet_error"}},xQ=class extends un{constructor(){super("User rejected connection"),this.type="wallet_error"}};const ih=t=>{if(t instanceof un)return t;if(t!=null&&t.code&&(t!=null&&t.reason)){let e=new yo(t);return t.code===Xg.ACTION_REJECTED&&(e.details=xi.E4001_USER_REJECTED_REQUEST),e}return t!=null&&t.code?new yo(t):new un("Unknown connector error",t)};let yf=class extends Fs{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}},yo=class extends yf{constructor(e){var n,i,s;super(e.message,e.code,e.data);let r=Object.values(xi).find((a=>a.eipCode===e.code));this.details=r||xi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=xi.E32002_CONNECTION_ALREADY_PENDING:this.details=xi.E32002_REQUEST_ALREADY_PENDING:(s=e.message)!=null&&s.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=xi.E32002_WALLET_LOCKED))}};const vu={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...xi};function el(t){return t.type==="ethereum"}function o7(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if((n==null?void 0:n.address)!==(i==null?void 0:i.address)||n&&i&&el(n)&&el(i)&&(n==null?void 0:n.chainId)!==(i==null?void 0:i.chainId)||(n==null?void 0:n.connectorType)!==(i==null?void 0:i.connectorType)||(n==null?void 0:n.connectedAt)!==(i==null?void 0:i.connectedAt)||(n==null?void 0:n.walletClientType)!==(i==null?void 0:i.walletClientType)||(n==null?void 0:n.isConnected)!==(i==null?void 0:i.isConnected)||(n==null?void 0:n.linked)!==(i==null?void 0:i.linked))return!1}return!0}let _Q=class extends NS{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}};const KA=(t,e)=>t.rpcTimeouts&&t.rpcTimeouts[e]||j3;let us=class{on(e,r){if(this.walletProvider)return this.walletProvider.on(e,r);this._subscriptions.push({eventName:e,listener:r})}async request(e){if(!this.walletProvider)throw new un(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((r=>{throw ih(r)}))}constructor(e,r){this.removeListener=(n,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(n,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(n=new EQ,i=this.rpcTimeoutDuration)=>new Promise(((s,a)=>setTimeout((()=>{a(n)}
425),i))),this.setWalletProvider=n=>{this.walletProvider&&this._subscriptions.forEach((i=>{this.removeListener(i.eventName,i.listener)})),this.walletProvider=n,this._subscriptions.forEach((i=>{var s;(s=this.walletProvider)==null||s.on(i.eventName,i.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=r||j3,this._subscriptions=[]}},ew=class extends us{constructor(e){super(e,e.rpcTimeoutDuration)}},c7=class extends us{sendAsync(e,r){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}};function Dg(t){return t.chainType==="ethereum"}let M0=class extends _Q{buildConnectedWallet(e,r,n,i){let s=async()=>!!this.wallets.find((a=>jr(a.address)===jr(e)));return{type:"ethereum",address:jr(e),chainId:r,meta:n,imported:i,switchChain:async a=>{var f,h,g,m;let o,c;if(!s)throw new un("Wallet is not currently connected.");let l=(f=this.wallets.find((y=>jr(y.address)===jr(e))))==null?void 0:f.chainId;if(!l)throw new un("Unable to determine current chainId.");if(typeof a=="number"?(o=`0x${a.toString(16)}`,c=a):(o=a,c=Number(a)),l===Ub(o))return;let u=this.chains.find((y=>y.id===c));if(!u)throw new un(`Unsupported chainId: ${a}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await d()}catch(y){if(((b,E)=>{var v;return E==="coinbase_wallet"?b.message.includes("addEthereumChain"):b.code===4902||((v=b.message)==null?void 0:v.includes("4902"))})(y,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[((h=u.rpcUrls.default)==null?void 0:h.http[0])??""],blockExplorerUrls:[((g=u.blockExplorers)==null?void 0:g.default.url)??""]}]}),d();throw this.walletClientType==="rainbow"&&((m=y.message)!=null&&m.includes("wallet_switchEthereumChain"))?new un(`Rainbow does not support the chainId ${r}`):y}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:s,getEthereumProvider:async()=>{if(!await s())throw new un("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await s())throw new un("Wallet is not currently connected.");return new Iv(new ew(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await s())throw new un("Wallet is not currently connected.");return new c7(this.proxyProvider)},sign:async a=>{if(!await s())throw new un("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let r,n=e;try{if(n===void 0){let c=await W9((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,c),Array.isArray(c)&&(n=c)}}catch(c){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!n||!Array.isArray(n)||n.length<=0||!n[0])return;let i=n[0],s=jr(i),a=[];if(this.walletClientType==="privy"){let c=Ut.get(C4(s));this.chains.find((l=>l.id===Number(c)))||(Ut.del(C4(s)),c=null),r=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${r} on initialization`)}}else try{let c=await W9((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,c),typeof c=="string")r=c;else{if(typeof c!="number")throw Error("Invalid chainId returned from provider");r=`0x${c.toString(16)}`}}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${iO}`,c),r=iO}let o=Ub(r);if(!a.find((c=>jr(c.address)===s))){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(jr(i),o,c,this.connectorType==="embedded_imported"))}
425o7(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((r,n)=>n.connectedAt-r.connectedAt)).find((r=>e.find((n=>jr(n)===jr(r.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new Iv(new ew(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,r,n,i){super(e),this.chainType="ethereum",this.onAccountsChanged=s=>{s.length===0?this.onDisconnect():this.syncAccounts(s)},this.onChainChanged=s=>{this.wallets.forEach((a=>{a.chainId=Ub(s),this.walletClientType==="privy"&&Ut.put(C4(a.address),s)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=KA(i,e),this.connected=!1,this.initialized=!1}},K2,u_e=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],qD=(t,e)=>t.makeWeb3Provider({options:e}),d_e=class extends M0{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Xxe,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new un("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw ih(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(qD(K2,this.connectionOptions))}constructor(e,r,n,i,s,a){if(super("coinbase_wallet",e,r,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new us(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!K2){let o=[r.id].concat(e.map((l=>l.id))),c=this.connectionOptions!=="eoaOnly"?o.filter((l=>!u_e.includes(l))):[];c.length>0&&!c.every((l=>wQ.has(l)))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${c.join(", ")}`),K2=new Zxe.CoinbaseWalletSDK({appName:s,appLogoUrl:a,appChainIds:o})}this.proxyProvider.setWalletProvider(qD(K2,this.connectionOptions))}};const CQ=({...t})=>p.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let WD=class extends M0{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit
425("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[zv((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:CQ,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:r,defaultChain:n,rpcConfig:i,imported:s,walletIndex:a}){super("privy",r,n,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=a,s&&(this.connectorType="embedded_imported"),this.subscribeListeners()}};const f_e=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"],h_e=t=>f_e.includes(t),p_e=({as:t="div",...e},r)=>p.jsx(t,{...e,ref:r}),g_e=C.forwardRef(p_e),m_e="https://challenges.cloudflare.com/turnstile/v0/api.js",tw="cf-turnstile-script",y_e="cf-turnstile",SQ="onloadTurnstileCallback",rw=t=>!!document.getElementById(t),b_e=({render:t="explicit",onLoadCallbackName:e=SQ,scriptOptions:{nonce:r="",defer:n=!0,async:i=!0,id:s="",appendTo:a,onError:o,crossOrigin:c=""}={}})=>{const l=s||tw;if(rw(l))return;const u=document.createElement("script");if(u.id=l,u.src=`${m_e}?onload=${e}&render=${t}`,document.querySelector(`script[src="${u.src}"]`))return;u.defer=!!n,u.async=!!i,r&&(u.nonce=r),c&&(u.crossOrigin=c),o&&(u.onerror=o),(a==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},Fo={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function v_e(t){let e;return t!=="invisible"&&(e=t),e}function w_e(t=tw){const[e,r]=C.useState(!1);return C.useEffect(()=>{const n=()=>{rw(t)&&r(!0)},i=new MutationObserver(n);return i.observe(document,{childList:!0,subtree:!0}),n(),()=>{i.disconnect()}},[t]),e}const AQ=C.forwardRef((t,e)=>{const{scriptOptions:r,options:n={},siteKey:i,onWidgetLoad:s,onSuccess:a,onExpire:o,onError:c,onBeforeInteractive:l,onAfterInteractive:u,onUnsupported:d,onLoadScript:f,id:h,style:g,as:m="div",injectScript:y=!0,...b}=t,E=n.size??"normal",[v,w]=C.useState(n.execution==="execute"?Fo.invisible:n.appearance==="interaction-only"?Fo.interactionOnly:Fo[E]),x=C.useRef(null),_=C.useRef(!1),[S,A]=C.useState(),[I,$]=C.useState(!1),P=h??y_e,j=y?(r==null?void 0:r.id)||`${tw}__${P}`:(r==null?void 0:r.id)||tw,L=w_e(j),B=r!=null&&r.onLoadCallbackName?`${r.onLoadCallbackName}__${P}`:`${SQ}__${P}`,k=C.useMemo(()=>({sitekey:i,action:n.action,cData:n.cData,callback:a,"error-callback":c,"expired-callback":o,"before-interactive-callback":l,"after-interactive-callback":u,"unsupported-callback":d,theme:n.theme??"auto",language:n.language??"auto",tabindex:n.tabIndex,"response-field":n.responseField,"response-field-name":n.responseFieldName,size:v_e(E),retry:n.retry??"auto","retry-interval":n.retryInterval??8e3,"refresh-expired":n.refreshExpired??"auto",execution:n.execution??"render",appearance:n.appearance??"always"}),[i,n,a,c,o,E,l,u,d]),D=C.useMemo(()=>JSON.stringify(k),[k]);return C.useImperativeHandle(e,()=>{if(typeof window>"u"||!L)return;const{turnstile:q}=window;return{getResponse(){if(!(q!=null&&q.getResponse)||!S){console.warn("Turnstile has not been loaded");return}return q.getResponse(S)},reset(){if(!(q!=null&&q.reset)||!S){console.warn("Turnstile has not been loaded");return}n.execution==="execute"&&w(Fo.invisible);try{q.reset(S)}catch(U){console.warn(`Failed to reset Turnstile widget ${S}`,U)}},remove(){if(!(q!=null&&q.remove)||!S){console.warn("Turnstile has not been loaded");return}A(""),w(Fo.invisible),q.remove(S)},render(){if(!(q!=null&&q.render)||!x.current||S){console.warn("Turnstile has not been loaded or widget already rendered");return}const U=q.render(x.current,k);return A(U),n.execution!=="execute"&&w(Fo[E]),U},execute(){if(n.execution==="execute"){if(!(q!=null&&q.execute)||!x.current||!S){console.warn("Turnstile has not been loaded or widget has not been rendered");return}q.execute(x.current,k),w(Fo[E])}},isExpired(){if(!(q!=null&&q.isExpired)||!S){console.warn("Turnstile has not been loaded");return}return q.isExpired(S)}}},[L,S,n.execution,E,k,x]),C.useEffect(()=>(window[B]=()=>$(!0),()=>{delete window[B]}
425),[B]),C.useEffect(()=>{y&&!I&&b_e({onLoadCallbackName:B,scriptOptions:{...r,id:j}})},[y,I,B,r,j]),C.useEffect(()=>{L&&!I&&window.turnstile&&$(!0)},[I,L]),C.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!L||!x.current||!I||_.current)return;const q=window.turnstile.render(x.current,k);A(q),_.current=!0},[L,i,k,_,I]),C.useEffect(()=>{if(window.turnstile&&x.current&&S){rw(S)&&window.turnstile.remove(S);const q=window.turnstile.render(x.current,k);A(q),_.current=!0}},[D,i]),C.useEffect(()=>{if(window.turnstile&&S&&rw(S))return s==null||s(S),()=>{window.turnstile.remove(S)}},[S,s]),C.useEffect(()=>{w(n.execution==="execute"?Fo.invisible:k.appearance==="interaction-only"?Fo.interactionOnly:Fo[E])},[n.execution,E,k.appearance]),C.useEffect(()=>{!L||typeof f!="function"||f()},[L,f]),p.jsx(g_e,{ref:x,as:m,id:P,style:{...v,...g},...b})});AQ.displayName="Turnstile";const E_e=t=>{let{enabled:e,siteKey:r,appId:n,setError:i,setToken:s,setExecuting:a,ref:o}=Vs(),[,c]=C.useMemo((()=>(r==null?void 0:r.split("t:"))||[]),[r]);if(C.useEffect((()=>{var l;return(l=o.current)==null?void 0:l.remove}),[]),!e)return null;if(!c)throw Error("Unsupported captcha site key");return p.jsx("div",{className:"hidden h-0 w-0",children:p.jsx(AQ,{...t,ref:o,siteKey:c,options:{action:n,size:"invisible",...t.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{var l;(l=t.onUnsupported)==null||l.call(t),console.warn("Browser does not support Turnstile.")},onError:()=>{var l;(l=t.onError)==null||l.call(t),i("Captcha failed"),a(!1)},onSuccess:l=>{var u;(u=t.onSuccess)==null||u.call(t,l),s(l),a(!1)},onExpire:()=>{var l,u;(l=t.onExpire)==null||l.call(t);try{(u=o.current)==null||u.reset(),i(void 0),s(void 0)}catch{i("expired_and_failed_reset")}}})})},Zs={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:U8e,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}},x_e=({input:t})=>{if(!t||!t.primary[0])return;let e=[t.primary[0]],r=[];for(let n of(t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),t.primary.slice(1)))e.includes(n)?console.warn(`Duplicated login method: ${n}`):e.push(n);for(let n of t.overflow??[])e.includes(n)||r.includes(n)?console.warn(`Duplicated login method: ${n}`):r.push(n);return{primary:e,overflow:r}};let __e=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),zD=t=>__e.has(t),VD=(t,e,r)=>r.indexOf(t)===e;const C_e=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(zD).filter(VD):t?t.filter(zD).filter(VD):Zs.appearance.walletList;function QA(t){let e=t.filter((r=>!wQ.has(r.id)));return Jv.concat(e)}function S_e(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const A_e="https://api.mainnet-beta.solana.com",T_e="https://api.testnet.solana.com",I_e="https://api.devnet.solana.com",l7=792703809,u7="11111111111111111111111111111111",k_e="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function z3(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function $_e(t,e){return`https://explorer.solana.com/tx/${t}?cluster=${e}`}function N_e(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}function P_e({name:t,rpcUrl:e}){if(e)return e;switch(t){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}function nw(t){"@babel/helpers - typeof";return nw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nw(t)}var O_e=/^\s+/,R_e=/\s+$/;function Dt(t,e){if(t=t||"",e=e||{},t instanceof Dt)return t;if(!(this instanceof Dt))return new Dt(t,e);var r=D_e(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}Dt.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,i,s,a,o;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*s+.7152*a+.0722*o},setAlpha:function(e){return this._a=TQ(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=GD(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=GD(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=HD(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=HD(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return KD(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return F_e(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(bn(this._r,255)*100)+"%",g:Math.round(bn(this._g,255)*100)+"%",b:Math.round(bn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(bn(this._r,255)*100)+"%, "+Math.round(bn(this._g,255)*100)+"%, "+Math.round(bn(this._b,255)*100)+"%)":"rgba("+Math.round(bn(this._r,255)*100)+"%, "+Math.round(bn(this._g,255)*100)+"%, "+Math.round(bn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:Z_e[KD(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+QD(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var s=Dt(e);n="#"+QD(s._r,s._g,s._b,s._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,s=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return s?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return Dt(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(W_e,arguments)},brighten:function(){return this._applyModification(z_e,arguments)},darken:function(){return this._applyModification(V_e,arguments)},desaturate:function(){return this._applyModification(U_e,arguments)},saturate:function(){return this._applyModification(B_e,arguments)},greyscale:function(){return this._applyModification(q_e,arguments)},spin:function(){return this._applyModification(H_e,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(Q_e,arguments)},complement:function(){return this._applyCombination(G_e,arguments)},monochromatic:function(){return this._applyCombination(Y_e,arguments)},splitcomplement:function(){return this._applyCombination(K_e,arguments)},triad:function(){return this._applyCombination(YD,[3])},tetrad:function(){return this._applyCombination(YD,[4])}};Dt.fromRatio=function(t,e){if(nw(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=c1(t[n]));t=r}return Dt(t,e)};function D_e(t){var e={r:0,g:0,b:0}
vendor: 6,215 bytes, line 425
425,r=1,n=null,i=null,s=null,a=!1,o=!1;return typeof t=="string"&&(t=t9e(t)),nw(t)=="object"&&(Oc(t.r)&&Oc(t.g)&&Oc(t.b)?(e=M_e(t.r,t.g,t.b),a=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Oc(t.h)&&Oc(t.s)&&Oc(t.v)?(n=c1(t.s),i=c1(t.v),e=L_e(t.h,n,i),a=!0,o="hsv"):Oc(t.h)&&Oc(t.s)&&Oc(t.l)&&(n=c1(t.s),s=c1(t.l),e=j_e(t.h,n,s),a=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=TQ(r),{ok:a,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function M_e(t,e,r){return{r:bn(t,255)*255,g:bn(e,255)*255,b:bn(r,255)*255}}function HD(t,e,r){t=bn(t,255),e=bn(e,255),r=bn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),s,a,o=(n+i)/2;if(n==i)s=a=0;else{var c=n-i;switch(a=o>.5?c/(2-n-i):c/(n+i),n){case t:s=(e-r)/c+(e<r?6:0);break;case e:s=(r-t)/c+2;break;case r:s=(t-e)/c+4;break}s/=6}return{h:s,s:a,l:o}}function j_e(t,e,r){var n,i,s;t=bn(t,360),e=bn(e,100),r=bn(r,100);function a(l,u,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?l+(u-l)*6*d:d<1/2?u:d<2/3?l+(u-l)*(2/3-d)*6:l}if(e===0)n=i=s=r;else{var o=r<.5?r*(1+e):r+e-r*e,c=2*r-o;n=a(c,o,t+1/3),i=a(c,o,t),s=a(c,o,t-1/3)}return{r:n*255,g:i*255,b:s*255}}function GD(t,e,r){t=bn(t,255),e=bn(e,255),r=bn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),s,a,o=n,c=n-i;if(a=n===0?0:c/n,n==i)s=0;else{switch(n){case t:s=(e-r)/c+(e<r?6:0);break;case e:s=(r-t)/c+2;break;case r:s=(t-e)/c+4;break}s/=6}return{h:s,s:a,v:o}}function L_e(t,e,r){t=bn(t,360)*6,e=bn(e,100),r=bn(r,100);var n=Math.floor(t),i=t-n,s=r*(1-e),a=r*(1-i*e),o=r*(1-(1-i)*e),c=n%6,l=[r,a,s,s,o,r][c],u=[o,r,r,a,s,s][c],d=[s,s,o,r,r,a][c];return{r:l*255,g:u*255,b:d*255}}function KD(t,e,r,n){var i=[go(Math.round(t).toString(16)),go(Math.round(e).toString(16)),go(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function F_e(t,e,r,n,i){var s=[go(Math.round(t).toString(16)),go(Math.round(e).toString(16)),go(Math.round(r).toString(16)),go(IQ(n))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function QD(t,e,r,n){var i=[go(IQ(n)),go(Math.round(t).toString(16)),go(Math.round(e).toString(16)),go(Math.round(r).toString(16))];return i.join("")}Dt.equals=function(t,e){return!t||!e?!1:Dt(t).toRgbString()==Dt(e).toRgbString()};Dt.random=function(){return Dt.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function U_e(t,e){e=e===0?0:e||10;var r=Dt(t).toHsl();return r.s-=e/100,r.s=V3(r.s),Dt(r)}function B_e(t,e){e=e===0?0:e||10;var r=Dt(t).toHsl();return r.s+=e/100,r.s=V3(r.s),Dt(r)}function q_e(t){return Dt(t).desaturate(100)}function W_e(t,e){e=e===0?0:e||10;var r=Dt(t).toHsl();return r.l+=e/100,r.l=V3(r.l),Dt(r)}function z_e(t,e){e=e===0?0:e||10;var r=Dt(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),Dt(r)}function V_e(t,e){e=e===0?0:e||10;var r=Dt(t).toHsl();return r.l-=e/100,r.l=V3(r.l),Dt(r)}function H_e(t,e){var r=Dt(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,Dt(r)}function G_e(t){var e=Dt(t).toHsl();return e.h=(e.h+180)%360,Dt(e)}function YD(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=Dt(t).toHsl(),n=[Dt(t)],i=360/e,s=1;s<e;s++)n.push(Dt({h:(r.h+s*i)%360,s:r.s,l:r.l}));return n}function K_e(t){var e=Dt(t).toHsl(),r=e.h;return[Dt(t),Dt({h:(r+72)%360,s:e.s,l:e.l}),Dt({h:(r+216)%360,s:e.s,l:e.l})]}function Q_e(t,e,r){e=e||6,r=r||30;var n=Dt(t).toHsl(),i=360/r,s=[Dt(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,s.push(Dt(n));return s}function Y_e(t,e){e=e||6;for(var r=Dt(t).toHsv(),n=r.h,i=r.s,s=r.v,a=[],o=1/e;e--;)a.push(Dt({h:n,s:i,v:s})),s=(s+o)%1;return a}Dt.mix=function(t,e,r){r=r===0?0:r||50;var n=Dt(t).toRgb(),i=Dt(e).toRgb(),s=r/100,a={r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a};return Dt(a)};Dt.readability=function(t,e){var r=Dt(t),n=Dt(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};Dt.isReadable=function(t,e,r){var n=Dt.readability(t,e),i,s;switch(s=!1,i=r9e(r),i.level+i.size){case"AAsmall":case"AAAlarge":s=n>=4.5;break;case"AAlarge":s=n>=3;break;case"AAAsmall":s=n>=7;break}return s};Dt.mostReadable=function(t,e,r){var n=null,i=0,s,a,o,c;r=r||{},a=r.includeFallbackColors,o=r.level,c=r.size;for(var l=0;l<e.length;l++)s=Dt.readability(t,e[l]),s>i&&(i=s,n=Dt(e[l]));return Dt.isReadable(t,n,{level:o,size:c})||!a?n:(r.includeFallbackColors=!1,Dt.mostReadable(t,["#fff","#000"],r))};var d7=Dt.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
4250",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Z_e=Dt.hexNames=X_e(d7);function X_e(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function TQ(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function bn(t,e){J_e(t)&&(t="100%");var r=e9e(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function V3(t){return Math.min(1,Math.max(0,t))}function Xs(t){return parseInt(t,16)}function J_e(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function e9e(t){return typeof t=="string"&&t.indexOf("%")!=-1}function go(t){return t.length==1?"0"+t:""+t}function c1(t){return t<=1&&(t=t*100+"%"),t}function IQ(t){return Math.round(parseFloat(t)*255).toString(16)}function ZD(t){return Xs(t)/255}var to=(function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"
425+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Oc(t){return!!to.CSS_UNIT.exec(t)}function t9e(t){t=t.replace(O_e,"").replace(R_e,"").toLowerCase();var e=!1;if(d7[t])t=d7[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=to.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=to.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=to.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=to.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=to.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=to.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=to.hex8.exec(t))?{r:Xs(r[1]),g:Xs(r[2]),b:Xs(r[3]),a:ZD(r[4]),format:e?"name":"hex8"}:(r=to.hex6.exec(t))?{r:Xs(r[1]),g:Xs(r[2]),b:Xs(r[3]),format:e?"name":"hex"}:(r=to.hex4.exec(t))?{r:Xs(r[1]+""+r[1]),g:Xs(r[2]+""+r[2]),b:Xs(r[3]+""+r[3]),a:ZD(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=to.hex3.exec(t))?{r:Xs(r[1]+""+r[1]),g:Xs(r[2]+""+r[2]),b:Xs(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function r9e(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}let XD="#FFFFFF";function n9e(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function _s(t,e){let r=Math.max(0,Math.min(1,t.toHsl().l+e));return Dt({...t.toHsl(),l:r})}function i9e({backgroundTheme:t,accentHex:e}){let r;switch(t){case"light":r=XD;break;case"dark":r="#1E1E1D";break;default:r=t}let n=Dt(r),i=Dt(e),s=Dt("#51BA81"),a=Dt("#FFB74D"),o=Dt("#EC6351"),c=n9e(n.getLuminance()),l=_s(n,c==="light"?-.04:.11),u=_s(n,c==="light"?-.08:.16),d=_s(n,c==="light"?-.88:.87),f=_s(n,c==="light"?-.7:.75),h=_s(n,c==="light"?-.43:.45).desaturate(c==="light"?60:20),g=_s(n,c==="light"?-.08:.25).desaturate(c==="light"?60:20),m=_s(i,.15),y=_s(i,.25),b=_s(i,-.06),E=_s(i,-.6),v=_s(o,.3),w=_s(a,.3),x=Dt(i.getLuminance()>.5?"#040217":XD),_=_s(s,-.16),S=_s(s,.4);return{colorScheme:c,background:n.toHslString(),background2:l.toHslString(),background3:u.toHslString(),foreground:d.toHslString(),foreground2:f.toHslString(),foreground3:h.toHslString(),foreground4:g.toHslString(),accent:i.toHslString(),accentLight:m.toHslString(),accentLightest:y.toHslString(),accentDark:b.toHslString(),accentDarkest:E.toHslString(),foregroundAccent:x.toHslString(),success:s.toHslString(),successDark:_.toHslString(),successLight:S.toHslString(),error:o.toHslString(),errorLight:v.toHslString(),warn:a.toHslString(),warnLight:w.toHslString()}}function kQ(t,e,r){var V,Y,K,ge,ae,ce,Q,se,me,_e,z,R,M,ee,ie,le,ye,fe,we,Ce,ne,Re,Pe,Ae,Ue,He,Qe,O,T,N,G,te,ue,pe,Ie,je,Te,ve,Oe,at,gt;let n,i,s,a,o,c,l,u,d,f,h,g,m,y,b,E,v=r?console.warn:()=>{};e!=null&&e.loginMethods?(n=e.loginMethods.includes("email"),i=e.loginMethods.includes("sms"),a=e.loginMethods.includes("wallet"),o=e.loginMethods.includes("google"),c=e.loginMethods.includes("twitter"),l=e.loginMethods.includes("discord"),d=e.loginMethods.includes("spotify"),f=e.loginMethods.includes("instagram"),u=e.loginMethods.includes("tiktok"),g=e.loginMethods.includes("github"),h=e.loginMethods.includes("linkedin"),m=e.loginMethods.includes("apple"),y=e.loginMethods.includes("farcaster"),b=e.loginMethods.includes("telegram")):(n=t.emailAuth,i=t.smsAuth,a=t.walletAuth||t.solanaWalletAuth,o=t.googleOAuth,c=t.twitterOAuth,l=t.discordOAuth,g=t.githubOAuth,d=t.spotifyOAuth,f=t.instagramOAuth,u=t.tiktokOAuth,h=t.linkedinOAuth,m=t.appleOAuth,y=t.farcasterAuth,b=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:t.passkeyAuth&&(s=!0);let w=[n,i].filter(Boolean),x=[o,c,l,g,d,f,u,h,m,y,b].filter(Boolean),_=[a].filter(Boolean);if(w.length+x.length+_.length===0)throw Error("You must enable at least one login method");let S=((V=e==null?void 0:e.appearance)==null?void 0:V.showWalletLoginFirst)!==void 0?(Y=e==null?void 0:e.appearance)==null?void 0:Y.showWalletLoginFirst:t.showWalletLoginFirst;S&&_.length===0?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):S||x.length+w.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let A=((ge=(K=e==null?void 0:e.externalWallets)==null?void 0:K.walletConnect)==null?void 0:ge.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let I=C_e({input:(ae=e==null?void 0:e.appearance)==null?void 0:ae.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),$=x_e({input:e==null?void 0:e.loginMethodsAndOrder}),P=((ce=e==null?void 0:e.intl)==null?void 0:ce.defaultCountry)??"US",{chains:j,defaultChain:L}=a9e({additionalChains:e==null?void 0:e.additionalChains,supportedChains:e==null?void 0:e.supportedChains,defaultChainFromConfig:e==null?void 0:e.defaultChain,hasRpcConfigDefined:Object.keys(((Q=e==null?void 0:e.rpcConfig)==null?void 0:Q.rpcUrls)??{}).length>0}),B=!!(e!=null&&e.defaultChain),k=((se=e==null?void 0:e.customAuth)==null?void 0:se.getCustomAccessToken)&&((me=e==null?void 0:e.customAuth)==null?void 0:me.enabled)!==!1,D=!(t.enforceWalletUis??1);if(E=t.legacyWalletUiConfig??1?k?((_e=e==null?void 0:e.embeddedWallets)==null?void 0:_e.noPromptOnSignature)??!0:((z=e==null?void 0:e.embeddedWallets)==null?void 0:z.noPromptOnSignature)??D:D,((R=e==null?void 0:e.embeddedWallets)==null?void 0:R.waitForTransactionConfirmation)===!1&&E!==!0)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:q,...U}=(e==null?void 0:e.embeddedWallets)??{},W=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((ee=(M=e==null?void 0:e.externalWallets)==null?void 0:M.solana)!=null&&ee.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:((ie=e==null?void 0:e.appearance)==null?void 0:ie.logo)??t.logoUrl,landingHeader:((le=e==null?void 0:e.appearance)==null?void 0:le.landingHeader)??Zs.appearance.landingHeader,loginMessage:typeof((ye=e==null?void 0:e.appearance)==null?void 0:ye.loginMessage)=="str
425ing"?(fe=e==null?void 0:e.appearance)==null?void 0:fe.loginMessage.slice(0,100):(we=e==null?void 0:e.appearance)==null?void 0:we.loginMessage,palette:i9e({backgroundTheme:((Ce=e==null?void 0:e.appearance)==null?void 0:Ce.theme)??Zs.appearance.theme,accentHex:((ne=e==null?void 0:e.appearance)==null?void 0:ne.accentColor)??t.accentColor??Zs.appearance.accentColor}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((Re=e==null?void 0:e.appearance)!=null&&Re.hideDirectWeb2Inputs),walletList:I,walletChainType:((Pe=e==null?void 0:e.appearance)==null?void 0:Pe.walletChainType)??(({evmWalletAuth:$t,solanaWalletAuth:ir})=>$t&&ir?"ethereum-and-solana":$t?"ethereum-only":ir?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:a,email:n,sms:i,passkey:s,google:o,twitter:c,discord:l,github:g,spotify:d,instagram:f,tiktok:u,linkedin:h,apple:m,farcaster:y,telegram:b},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:$,legal:{termsAndConditionsUrl:((Ae=e==null?void 0:e.legal)==null?void 0:Ae.termsAndConditionsUrl)??t.termsAndConditionsUrl,privacyPolicyUrl:((Ue=e==null?void 0:e.legal)==null?void 0:Ue.privacyPolicyUrl)??t.privacyPolicyUrl,requireUsersAcceptTerms:t.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:(e==null?void 0:e.walletConnectCloudProjectId)??t.walletConnectCloudProjectId??Zs.walletConnectCloudProjectId,rpcConfig:{rpcUrls:((He=e==null?void 0:e.rpcConfig)==null?void 0:He.rpcUrls)??Zs.rpcConfig.rpcUrls,rpcTimeouts:((Qe=e==null?void 0:e.rpcConfig)==null?void 0:Qe.rpcTimeouts)??Zs.rpcConfig.rpcTimeouts},chains:j,solanaClusters:{"mainnet-beta":((O=W.find(($t=>$t.name==="mainnet-beta")))==null?void 0:O.rpcUrl)||A_e,testnet:((T=W.find(($t=>$t.name==="testnet")))==null?void 0:T.rpcUrl)||T_e,devnet:((N=W.find(($t=>$t.name==="devnet")))==null?void 0:N.rpcUrl)||I_e},defaultChain:L,intl:{defaultCountry:P},shouldEnforceDefaultChainOnConnect:B,captchaEnabled:t.captchaEnabled??Zs.captchaEnabled,captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:((te=(G=e==null?void 0:e.externalWallets)==null?void 0:G.coinbaseWallet)==null?void 0:te.connectionOptions)??Zs.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:A},solana:{connectors:(pe=(ue=e==null?void 0:e.externalWallets)==null?void 0:ue.solana)==null?void 0:pe.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof q=="boolean"?{requireUserOwnedRecoveryOnCreate:q}:{},...k?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...U,noPromptOnSignature:E,showWalletUIs:(Ie=e==null?void 0:e.embeddedWallets)==null?void 0:Ie.showWalletUIs,extendedCalldataDecoding:(je=e==null?void 0:e.embeddedWallets)==null?void 0:je.extendedCalldataDecoding},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((Te=e==null?void 0:e.mfa)==null?void 0:Te.noPromptOnMfaRequired)??!1},customAuth:k?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration,passkeysForSignupEnabled:t.passkeysForSignupEnabled},headless:!!(e!=null&&e.headless),render:{standalone:((ve=e==null?void 0:e._render)==null?void 0:ve.standalone)??Zs._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??Zs.fundingMethodConfig,moonpay:{...((Oe=e==null?void 0:e.fundingMethodConfig)==null?void 0:Oe.moonpay)??Zs.fundingMethodConfig.moonpay,useSandbox:((at=e==null?void 0:e.fundingMethodConfig)==null?void 0:at.moonpay.useSandbox)??((gt=e==null?void 0:e.fiatOnRamp)==null?void 0:gt.useSandbox)??Zs.fundingMethodConfig.moonpay.useSandbox}}}}function s9e(t,e){var c,l;if(!t)return{legacyCreateEmbeddedWalletFlag:e};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:s,externalWallets:a,...o}=t;return{...o,...n?{additionalChains:n.map((u=>u.id))}:void 0,...i?{supportedChains:i.map((u=>u.id))}:void 0,...s?{defaultChain:s.id}:void 0,...a?{walletConnect:a.walletConnect,coinbaseWallet:a.coinbaseWallet,s
425olana:{connectors:(l=(c=a.solana)==null?void 0:c.connectors)==null?void 0:l.get().map((u=>u.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:e}}function a9e({additionalChains:t,supportedChains:e,defaultChainFromConfig:r,hasRpcConfigDefined:n}){let i;if(t&&e&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),e){if(e.length===0)throw Error("`supportedChains` must contain at least one chain");e.filter((o=>o.rpcUrls.privyWalletOverride)).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=e.map((o=>{var u;if(o.rpcUrls.privyWalletOverride)return o;let c=Jv.find((d=>d.id===o.id)),l=(u=c==null?void 0:c.rpcUrls.privy)==null?void 0:u.http[0];return l?S_e(o,l):o}))}else i=Jv.concat(t??[]);let s=e?i[0]:_c,a=r??s;if(!i.find((o=>o.id===a.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:a}}const o9e=function(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i,s=0;s<t.length;s++)r=Math.imul(r^(i=t.charCodeAt(s)),2654435761),n=Math.imul(n^i,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)};let $Q={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const NQ=kQ($Q,void 0,!1);let YA=C.createContext({appConfig:NQ,isServerConfigLoaded:!1});const c9e=({children:t,legacyCreateEmbeddedWalletFlag:e,client:r,clientConfig:n})=>{let[i,s]=C.useState(null),a=C.useMemo((()=>kQ(i??$Q,n,!!i)),[i,n]);return C.useEffect((()=>{if(!i)return;let o=s9e(n,e),c=o9e(JSON.stringify(o)).toString(),l=`privy:sent:${i.id}:${c}`;localStorage.getItem(l)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:o}),localStorage.setItem(l,"t"))}),[n,e,i]),C.useEffect((()=>{i||(async()=>{try{let o=await r.getServerConfig();o.customApiUrl&&r.updateApiUrl(o.customApiUrl),s(o)}catch(o){console.warn("Error generating app config: ",o)}})()}),[]),p.jsx(YA.Provider,{value:{appConfig:a,isServerConfigLoaded:!!i},children:t})},Jn=()=>{let{appConfig:t}=C.useContext(YA);return t},l9e=()=>{let{isServerConfigLoaded:t}=C.useContext(YA);return t},PQ=C.createContext({setAuthenticated:Fe,setUser:Fe,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:Fe,initializeWalletProxy:Fe,getAuthMeta:Fe,getAuthFlow:Fe,closePrivyModal:Fe,openPrivyModal:Fe,connectWallet:Fe,initLoginWithWallet:Fe,loginWithWallet:Fe,initLoginWithFarcaster:Fe,loginWithFarcaster:Fe,loginWithCode:Fe,initLoginWithEmail:Fe,initLoginWithSms:Fe,initUpdateEmail:Fe,initUpdatePhone:Fe,resendEmailCode:Fe,resendSmsCode:Fe,initLoginWithHeadlessOAuth:Fe,loginWithHeadlessOAuth:Fe,crossAppAuthFlow:Fe,initLoginWithOAuth:Fe,recoveryOAuthFlow:Fe,loginWithOAuth:Fe,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Fe,initSignupWithPasskey:Fe,signupWithPasskey:Fe,initLoginWithPasskey:Fe,loginWithPasskey:Fe,initLinkWithPasskey:Fe,linkWithPasskey:Fe,refreshUser:Fe,loginWithGuestAccountFlow:Fe,walletProxy:null,createAnalyticsEvent:Fe,acceptTerms:Fe,getUsdTokenPrice:Fe,getUsdPriceForSol:Fe,getSplTokenMetadata:Fe,recoverPrimaryWallet:Fe,updateWallets:Fe,fundWallet:Fe,openModal:Fe,setReadyToTrue:Fe,requestFarcasterSignerStatus:Fe,initLoginWithTelegram:Fe,loginWithTelegram:Fe,generateSiweMessage:Fe,generateSiweMessageForSmartWallet:Fe,linkWithSiwe:Fe,linkSmartWallet:Fe,delegateWallet:Fe,revokeDelegatedWallets:Fe,createEmbeddedSolanaWallet:Fe,exportSolanaWallet:Fe,solanaSignMessage:Fe,connectCoinbaseSmartWallet:Fe,initiateAccountTransfer:Fe,emailOtpState:{status:"initial"},setEmailOtpState:Fe,smsOtpState:{status:"initial"},setSmsOtpState:Fe,siweState:{status:"initial"},setSiweState:Fe,oAuthState:{status:"initial"},setOAuthState:Fe,isHeadlessOAuthLoading:!1}),bt=()=>C.useContext(PQ);function u9e({src:t,...e}){return p.jsx("img",{src:t,...e,style:{display:"none"}})}var Wt,de=((Wt={}).LANDING="LANDING",Wt.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Wt.AWAITING_CONNECTION="AWAITING_CONNECTION",Wt.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Wt.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Wt.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Wt.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Wt.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Wt.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Wt.SELECT_PASSKEY_SIGNUP_OR_LOGIN="SELECT_PASSKEY_SIGNUP_OR_LOGIN",Wt.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Wt.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Wt.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Wt.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Wt.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Wt.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Wt.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Wt.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Wt.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Wt.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Wt.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Wt.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Wt.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Wt.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Wt.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Wt.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Wt.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Wt.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Wt.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Wt.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Wt.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Wt.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Wt.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Wt.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Wt.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Wt.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Wt.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Wt.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Wt.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Wt.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",Wt.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",Wt.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Wt.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Wt.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Wt.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Wt.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Wt.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Wt.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Wt.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Wt.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Wt.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Wt.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Wt.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Wt.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Wt.ERROR_SCREEN="ERROR_SCREEN",Wt.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Wt.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Wt.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Wt);const OQ=C.createContext({ready:!1,app:NQ,currentScreen:null,lastScreen:null,navigate:Fe,navigateBack:Fe,resetNavigation:Fe,setModalData:Fe,onUserCloseViaDialogOrKeybindRef:void 0});let d9e=[de.LANDING,de.CONNECT_ONLY_LANDING_SCREEN,null];const f9e=t=>{var o;let e=Jn(),r=t.authenticated,[n,i]=C.useState(t.initialScreen);C.useEffect((()=>{r||d9e.includes(t.initialScreen)||t.setInitialScreen(null)}),[r]);let s=C.useRef(null);C.useEffect((()=>{t.open||(s.current=null)}),[t.open]),C.useEffect((()=>{s.current=null}),[t.initialScreen]);let a={ready:!!e.id,app:e,data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:n,navigate:(c,l=!0)=>{t.setInitialScreen(c),l&&i(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(n)},resetNavigation:()=>{t.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:s};return p.jsxs(OQ.Provider,{value:a,children:[(typeof e.appearance.logo=="str
425ing"||((o=e.appearance.logo)==null?void 0:o.type)==="img")&&p.jsx(u9e,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},ht=()=>C.useContext(OQ),Ly=C.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:Fe,login:Fe,connectOrCreateWallet:Fe,linkEmail:Fe,linkPhone:Fe,linkFarcaster:Fe,linkWallet:Fe,startCrossAppAuthFlow:Fe,linkGoogle:Fe,linkTwitter:Fe,linkDiscord:Fe,linkGithub:Fe,linkSpotify:Fe,linkInstagram:Fe,linkTelegram:Fe,linkTiktok:Fe,linkLinkedIn:Fe,linkApple:Fe,linkPasskey:Fe,updateEmail:Fe,updatePhone:Fe,logout:Fe,getAccessToken:Fe,getEthereumProvider:Fe,getEthersProvider:Fe,getWeb3jsProvider:Fe,unlinkEmail:Fe,unlinkPhone:Fe,unlinkWallet:Fe,unlinkGoogle:Fe,unlinkTwitter:Fe,unlinkDiscord:Fe,unlinkGithub:Fe,unlinkSpotify:Fe,unlinkInstagram:Fe,unlinkTiktok:Fe,unlinkLinkedIn:Fe,unlinkApple:Fe,unlinkCrossAppAccount:Fe,unlinkFarcaster:Fe,unlinkTelegram:Fe,unlinkPasskey:Fe,setActiveWallet:Fe,forkSession:Fe,createWallet:Fe,signMessage:Fe,signTypedData:Fe,enrollInMfa:Fe,initEnrollmentWithSms:Fe,initEnrollmentWithTotp:Fe,initEnrollmentWithPasskey:Fe,promptMfa:Fe,init:Fe,submitEnrollmentWithSms:Fe,submitEnrollmentWithTotp:Fe,submitEnrollmentWithPasskey:Fe,unenroll:Fe,submit:Fe,cancel:Fe,sendTransaction:Fe,sendSolanaTransaction:Fe,exportWallet:Fe,setWalletPassword:Fe,setWalletRecovery:Fe,requestFarcasterSignerFromWarpcast:Fe,getFarcasterSignerPublicKey:Fe,signFarcasterMessage:Fe,createGuestAccount:Fe,signMessageWithCrossAppWallet:Fe,signTypedDataWithCrossAppWallet:Fe,sendTransactionWithCrossAppWallet:Fe,isModalOpen:!1,mfaMethods:[]}),Sr=()=>C.useContext(Ly),h9e=t=>{let[e,r]=C.useState("auto");return C.useEffect((()=>{let n=new ResizeObserver((i=>{var s;r(((s=i[0])==null?void 0:s.contentRect.height)??"auto")}));return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}}),[t.current]),e},p9e={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},RQ=C.createContext(void 0);let DQ=()=>C.useContext(RQ);function ZA(t,e){if(!e)return;let r=DQ().current[t];return C.useEffect((()=>{var n;for(let[i,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,i)||console.warn(`Invalid event type "${i}" for action "${t}"`),(n=r[i])==null||n.push(s);return()=>{var i;for(let[s,a]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,s)||console.warn(`Invalid event type "${s}" for action "${t}"`),r[s]=(i=r[s])==null?void 0:i.filter((o=>o!==a))}}),[e])}function qe(t,e,r,...n){for(let i of t.current[e][r])i(...n)}function MQ(){let t=DQ();return(e,r,...n)=>qe(t,e,r,...n)}function g9e(t){ZA("configureMfa",t)}function m9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const bf=C.forwardRef(m9e),To=({success:t,fail:e})=>p.jsxs(p.Fragment,{children:[p.jsx(Fa,{className:t?"success":e?"fail":""}),p.jsx(XA,{className:t?"success":e?"fail":""})]}),Fa=oe.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],(t=>t.color??"var(--privy-color-accent)")),XA=oe(Fa).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],(t=>t.color??"var(--privy-color-accent)")),pd=t=>p.jsx(y9e,{color:t.color||"var(--privy-color-foreground-3)"});let y9e=oe(Fa).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const H3=oe.button.withConfig({displayName:"Button",componentId:"sc-e15d0508-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),Mt=({children:t,loading:e,disabled:r,success:n,loadingText:i="Loading...",...s})=>p.jsx(jQ,{disabled:e||r,success:n,...s,children:e?p.jsxs("span",{children:[p.jsx(pd,{}),i?p.jsx("span",{children:i}):null]}):t}),Fm=({children:t,loading:e,disabled:r,...n})=>p.jsx(b9e,{disabled:r,...n,children:e?p.jsx(pd,{color:"var(--privy-color-foreground-accent)"}):t});let b9e=oe(H3).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-e15d0508-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const v9e=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>p.jsx(jQ,{as:"a",disabled:e||r,...i,children:e?p.jsxs("span",{children:[p.jsx(pd,{}),n?p.jsx("span",{children:n}):null]}):t});let jQ=oe(H3).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-e15d0508-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," >
425 span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],(t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent)"),(t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"),(t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"),(t=>t.disabled?ns(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):""));const Tl=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>p.jsx(w9e,{disabled:e||r,...i,children:e?p.jsxs("span",{children:[p.jsx(pd,{}),n?p.jsx("span",{children:n}):null]}):t});let w9e=oe(H3).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-e15d0508-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],(t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"),(t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)"));const JA=oe.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-e15d0508-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],(t=>t.invisible?"0":"1"),(t=>t.invisible&&ns(["pointer-events:none;"]))),eT=({children:t,onClick:e,disabled:r,isSubmitting:n,...i})=>p.jsxs(E9e,{$isSubmitting:n,onClick:e,disabled:r,...i,children:[p.jsx("span",{children:t}),p.jsx("span",{children:p.jsx(pd,{})})]});let E9e=oe.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-e15d0508-6"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],(t=>t.$isSubmitting?0:1),(t=>t.$isSubmitting?1:0));const LQ=oe.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)"));function x9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const _9e=C.forwardRef(x9e);function C9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const S9e=C.forwardRef(C9e);function A9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18
42518 6M6 6l12 12"}))}const T9e=C.forwardRef(A9e),FQ=({backFn:t})=>p.jsx("div",{children:p.jsx(G3,{onClick:t,children:p.jsx(_9e,{height:"16px",width:"16px",strokeWidth:2})})}),I9e=({nextFn:t})=>p.jsx("div",{children:p.jsx(G3,{onClick:t,children:p.jsx(S9e,{height:"16px",width:"16px",strokeWidth:2})})}),k9e=({infoFn:t})=>p.jsx("div",{children:p.jsx(N9e,{"aria-label":"info",onClick:t,children:p.jsx(bf,{height:"22px",width:"22px",strokeWidth:2})})}),$9e=t=>p.jsx("div",{children:p.jsx(G3,{"aria-label":"close modal",onClick:t.onClose,children:p.jsx(T9e,{height:"16px",width:"16px",strokeWidth:2})})}),lt=({backFn:t,infoFn:e,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:s}=bt(),a=Jn();return p.jsxs(P9e,{children:[p.jsxs(O9e,{children:[t&&p.jsx(FQ,{backFn:t}),e&&p.jsx(k9e,{infoFn:e})]}),n&&p.jsx(D9e,{id:"privy-dialog-title",children:n}),p.jsx(R9e,{children:!a.render.standalone&&i&&p.jsx($9e,{onClose:r||(()=>s())})})]})};let G3=oe.button.withConfig({displayName:"StyledButton",componentId:"sc-f295093d-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}"]),N9e=oe(G3).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),P9e=oe.div.withConfig({displayName:"StyledHeader",componentId:"sc-f295093d-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),O9e=oe.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),R9e=oe.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),D9e=oe.div.withConfig({displayName:"TitleContainer",componentId:"sc-f295093d-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]),Us=oe.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const Il=oe.div.withConfig({displayName:"Grow",componentId:"sc-b51c7c74-0"})(["text-align:left;flex-grow:1;"]),UQ=oe.div.withConfig({displayName:"AlignBottom",componentId:"sc-b51c7c74-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),Xu=oe.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-b51c7c74-2"})(["display:flex;flex-direction:column;gap:12px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),M9e=oe(Xu).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-b51c7c74-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0));let BQ=ns(["&&{width:100%;font-size:16px;line-height:24px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;padding:12px 16px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-mdlg);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}svg{height:24px;max-height:24px;max-width:24px;}}"]);const qQ=oe.div.withConfig({displayName:"Subtitle",componentId:"sc-b51c7c74-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),In=oe.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-b51c7c74-5"})(["",""],BQ),JD=oe.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-b51c7c74-6"})(["",""],BQ),Df=oe.div.withConfig({displayName:"Hide",componentId:"sc-b51c7c74-7"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],(t=>t.$if?"display: none;":"")),j9e=oe.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-b51c7c74-8"})(["width:100%;height:100%;padding:",";"],(t=>t.$withPadding?"64px 0px":"0px")),L9e=oe.div.withConfig({displayName:"Header",componentId:"sc-b51c7c74-9"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),F9e=()=>{let{navigate:t,app:e}=ht();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),p.jsxs(U9e,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(LQ,{color:"var(--privy-color-warn-light)"}),p.jsx(bf,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),p.jsxs(B9e,{children:[p.jsx("h3",{children:"Account not found"}),p.jsxs("p",{children:["Please try logging in again or go to ",e.name," to create an account."]})]}),p.jsx(Il,{}),p.jsx(Mt,{onClick:()=>t(de.LANDING),children:"Try logging in again"})]})]})};let U9e=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-408d3d00-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;margin-top:24px;"]),B9e=oe.div.withConfig({displayName:"GappedContainer",componentId:"sc-408d3d00-1"})(["display:flex;flex-direction:column;gap:8px;"]);function q9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const zl=C.forwardRef(q9e);function W9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const Fy=C.forwardRef(W9e),tT=oe.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)"));function z9e(t){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...t,children:p.jsx("g",{fill:t.color||"var(--privy-color-foreground)",children:p.jsx("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03
425-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.
42502 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let eM=oe.div.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-c97bf02f-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);&& > a{color:var(--privy-color-accent);}"]);function rT(t){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent||!r&&!e)return p.jsx(eM,{});let i=!(!e||!r);return p.jsxs(eM,{children:["By logging in I agree to the"," ",r&&p.jsx("a",{href:r,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",e&&p.jsx("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const Ht=()=>p.jsx(vr,{children:p.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:p.jsx(z9e,{height:13,width:150})})}),vr=oe.div.withConfig({displayName:"ModalFooter",componentId:"sc-c97bf02f-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]);function V9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const H9e=C.forwardRef(V9e);function G9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))}const WQ=C.forwardRef(G9e),_i=({address:t,showCopyIcon:e,url:r,className:n})=>{let[i,s]=C.useState(!1);return C.useEffect((()=>{if(i){let a=setTimeout((()=>s(!1)),2e3);return()=>clearTimeout(a)}}),[i]),r?p.jsx("a",{title:t,className:n,href:`${r}/address/${t}`,target:"_blank",children:fs(t)}):p.jsxs("button",{title:t,className:n,onClick:a=>(a.stopPropagation(),navigator.clipboard.writeText(t).then((()=>s(!0))).catch(console.error)),children:[fs(t),e&&p.jsx(i?Q9e:K9e,{})]})};let K9e=oe(WQ).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),Q9e=oe(H9e).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);function zQ(t){return t.charAt(0).toUpperCase()+t.slice(1)}const VQ=({onTransfer:t,isTransferring:e,transferSuccess:r})=>p.jsx(Mt,{...r?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}});function Y9e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75
425a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const K3=C.forwardRef(Y9e),HQ=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-aa2e65ff-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),f7=oe.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),GQ=oe.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-aa2e65ff-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),KQ=oe(K3).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-aa2e65ff-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],(t=>`${t.iconSize}px`),(t=>`${t.iconSize}px`)),Z9e=oe(WQ).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),X9e=oe.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),tM=oe.li.withConfig({displayName:"ListItem",componentId:"sc-aa2e65ff-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),J9e=oe.div.withConfig({displayName:"CircleContainer",componentId:"sc-aa2e65ff-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let e7e=()=>p.jsx(J9e,{children:p.jsx(KQ,{iconSize:60})});const t7e=({address:t,onClose:e,onRetry:r,onTransfer:n,isTransferring:i,transferSuccess:s})=>{var c;let{defaultChain:a}=Jn(),o=((c=a.blockExplorers)==null?void 0:c.default.url)??"https://etherscan.io";return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:e,backFn:r}),p.jsxs(HQ,{children:[p.jsx(e7e,{}),p.jsxs(f7,{children:[p.jsx("h3",{children:"Check account assets before transferring"}),p.jsx("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),p.jsxs(X9e,{children:[p.jsx("p",{children:" To check your balance, you can:"}),p.jsx(tM,{children:"Log out and log back into the other account, or "}),p.jsxs(tM,{children:["Copy your wallet address and use a"," ",p.jsx("u",{children:p.jsx("a",{target:"_blank",href:o,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),p.jsxs(GQ,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[p.jsx(Fy,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),p.jsx(_i,{address:t,showCopyIcon:!1}),p.jsx(Z9e,{})]}),p.jsx(VQ,{onTransfer:n,isTransferring:i,transferSuccess:s})]})]}),p.jsx(Ht,{})]})},r7e=()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=bt(),{data:r,navigate:n,lastScreen:i,setModalData:s}=ht(),[a,o]=C.useState(void 0),[c,l]=C.useState(!1),[u,d]=C.useState(!1),f=async()=>{var h,g,m,y,b,E,v,w,x,_;try{if(!((h=r==null?void 0:r.accountTransfer)!=null&&h.nonce)||!((g=r==null?void 0:r.accountTransfer)!=null&&g.account))throw Error("missing account transfer inputs");d(!0),await t({nonce:(m=r==null?void 0:r.accountTransfer)==null?void 0:m.nonce,account:(y=r==null?void 0:r.accountTransfer)==null?void 0:y.account,accountType:(b=r==null?void 0:r.accountTransfer)==null?void 0:b.linkMethod,externalWalletMetadata:(E=r==null?void 0:r.accountTransfer)==null?void 0:E.externalWalletMetadata,telegramWebAppData:(v=r==null?void 0:r.accountTransfer)==null?void 0:v.telegramWebAppData,telegramAuthResult:(w=r==null?void 0:r.accountTransfer)==null?void 0:w.telegramAuthResult,farcasterEmbeddedAddress:(x=r==null?void 0:r.accountTransfer)==null?void 0:x.farcasterEmbeddedAddress,oAuthUserInfo:(_=r==null?void 0:r.accountTransfer)==null?void 0:_.oAuthUserInfo}),l(!0),d(!1),setTimeout(e,1e3)}
425catch(S){s({errorModalData:{error:S,previousScreen:i||de.LINK_CONFLICT_SCREEN}}),n(de.ERROR_SCREEN,!0)}};return a?p.jsx(t7e,{address:a,onClose:e,onRetry:()=>o(void 0),onTransfer:f,isTransferring:u,transferSuccess:c}):p.jsx(n7e,{onClose:e,onInfo:()=>{var h;return o((h=r==null?void 0:r.accountTransfer)==null?void 0:h.embeddedWalletAddress)},onContinue:()=>{var h;return o((h=r==null?void 0:r.accountTransfer)==null?void 0:h.embeddedWalletAddress)},onTransfer:f,isTransferring:u,transferSuccess:c,data:r})},n7e=({onClose:t,onContinue:e,onInfo:r,onTransfer:n,transferSuccess:i,isTransferring:s,data:a})=>{var c,l,u,d,f,h,g;if(!((c=a==null?void 0:a.accountTransfer)!=null&&c.linkMethod)||!((l=a==null?void 0:a.accountTransfer)!=null&&l.displayName))return;let o={method:(u=a==null?void 0:a.accountTransfer)==null?void 0:u.linkMethod,handle:(d=a==null?void 0:a.accountTransfer)==null?void 0:d.displayName,disclosedAccount:(f=a==null?void 0:a.accountTransfer)!=null&&f.embeddedWalletAddress?{type:"wallet",handle:(h=a==null?void 0:a.accountTransfer)==null?void 0:h.embeddedWalletAddress}:void 0};return p.jsxs(p.Fragment,{children:[p.jsx(lt,{closeable:!0}),p.jsxs(HQ,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(tT,{color:"var(--privy-color-error)"}),p.jsx(zl,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),p.jsxs(f7,{children:[p.jsxs("h3",{children:[(function(m){switch(m){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${zQ(m.replace("_oauth",""))} profile`;default:return m}})(o.method)," is associated with another account"]}),p.jsxs("p",{children:["Do you want to transfer",p.jsx("b",{children:o.handle?` ${o.handle}`:""})," to this account instead? This will delete your other account."]}),p.jsx(i7e,{onClick:r,disclosedAccount:o.disclosedAccount})]}),p.jsxs(f7,{style:{gap:12,marginTop:12},children:[(g=a==null?void 0:a.accountTransfer)!=null&&g.embeddedWalletAddress?p.jsx(Mt,{onClick:e,children:"Continue"}):p.jsx(VQ,{onTransfer:n,transferSuccess:i,isTransferring:s}),p.jsx(Tl,{onClick:t,children:"No thanks"})]})]}),p.jsx(Ht,{})]})};function i7e({disclosedAccount:t,onClick:e}){return t?p.jsxs(GQ,{onClick:e,children:[p.jsx(Fy,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),p.jsx(_i,{address:t.handle,showCopyIcon:!1}),p.jsx(KQ,{iconSize:15})]}):null}function s7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const h7=C.forwardRef(s7e);function a7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}),C.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const o7e=C.forwardRef(a7e),Uy=oe.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a63b1990-0"})(["display:flex;flex-direction:column;align-items:center;padding:0px 0px 30px;@media (max-width:440px){padding:10px 10px 20px;}"]),Hr=oe.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),Gr=oe.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),Mf=oe.div.withConfig({displayName:"Container",componentId:"sc-a63b1990-3"})(["display:flex;flex-direction:column;align-items:center;gap:10px;flex-grow:1;padding:20px 0;@media (max-width:440px){padding:10px 10px 20px;}"]),Q3=oe.div.withConfig({displayName:"List",componentId:"sc-a63b1990-4"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.75rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),cc=oe.div.withConfig({displayName:"ListItemIcon",componentId:"sc-a63b1990-5"})(["width:25px;display:flex;align-items:center;justify-content:flex-start;> svg{z-index:2;height:25px !important;width:25px !important;color:var(--privy-color-accent);}"]),lc=oe.div.withConfig({displayName:"ListItem",componentId:"sc-a63b1990-6"})(["display:flex;align-items:center;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;"]),Na=oe.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),QQ=oe.div.withConfig({displayName:"MethodList",componentId:"sc-a63b1990-8"})(["display:flex;flex-direction:column;align-items:stretch;gap:1rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),sE=oe.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),aE=oe.button.withConfig({displayName:"RemoveMethodButton",componentId:"sc-a63b1990-10"})(["&&{background-color:transparent;color:var(--privy-color-foreground-3);padding:0 0.75rem;display:flex;align-items:center;height:100%;> svg{z-index:2;height:20px !important;width:20px !important;}}&&:hover{color:var(--privy-color-error);}"]),oE=oe.div.withConfig({displayName:"MethodText",componentId:"sc-a63b1990-11"})(["display:flex;align-items:center;gap:0.5rem;> svg{z-index:2;height:20px !important;width:20px !important;}"]),cE=oe.div.withConfig({displayName:"ExtraText",componentId:"sc-a63b1990-12"})(["display:flex;align-items:center;gap:6px;font-weight:400 !important;color:",";> svg{z-index:2;height:18px !important;width:18px !important;display:flex !important;align-items:flex-end;}"],(t=>t.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)")),lE=oe.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),c7e=oe.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),iw=oe.button.withConfig({displayName:"PrimaryTextButton",componentId:"sc-a63b1990-15"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:0.875rem;line-height:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{color:",";background-color:transparent;padding:0.5rem 0px;}&:hover{text-decoration:underline;}"],(t=>t.theme==="dark"?"var(--privy-color-foreground-2)":"var(--privy-color-accent)")),ts=oe.div.withConfig({displayName:"IconWrapper",componentId:"sc-a63b1990-16"})(["display:flex;align-items:center;justify-content:center;color:var(--privy-color-accent);width:100%;> svg{z-index:2;width:3rem;height:3rem;}"]),YQ=oe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),l7e=()=>{let{user:t,logout:e}=Sr(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:s}=ht(),{acceptTerms:a,closePrivyModal:o,createAnalyticsEvent:c}=bt(),l=u=>{u==null||u.preventDefault(),o({shouldCallAuthOnSuccess:!1}),e()};return n.current=l,p.jsx(u7e,{termsAndConditionsUrl:r==null?void 0:r.legal.termsAndConditionsUrl,privacyPolicyUrl:r==null?void 0:r.legal.privacyPolicyUrl,onAccept:async u=>{var d;u.preventDefault(),await a(),t&&Sl(t,(d=r==null?void 0:r.embeddedWallets)==null?void 0:d.createOnLogin)?(i({createWallet:{onSuccess:()=>{},onFailure:f=>{console.error(f),c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:f,screen:"AffirmativeConsentScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),s(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):o()},onDecline:l})},u7e=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:r,onDecline:n})=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{closeable:!1}),p.jsx(o7e,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),p.jsx(Hr,{style:{marginTop:24},children:"One last step"}
425),p.jsx(Gr,{children:"By signing up, you agree to our terms and privacy policy."}),p.jsxs(Xu,{style:{marginTop:24},children:[t&&p.jsxs(JD,{target:"_blank",href:t,children:["View Terms ",p.jsx(h7,{style:{marginLeft:"auto"}})]}),e&&p.jsxs(JD,{target:"_blank",href:e,children:["View Privacy Policy ",p.jsx(h7,{style:{marginLeft:"auto"}})]})]}),p.jsxs(d7e,{style:{marginTop:24},children:[p.jsx(Tl,{onClick:n,children:"No thanks"}),p.jsx(Mt,{onClick:r,children:"Accept"})]}),p.jsx(Ht,{})]});let d7e=oe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-4aff18c8-0"})(["display:flex;gap:10px;"]);const ZQ=({style:t,...e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...e,children:p.jsx("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})}),f7e=()=>{let{navigate:t,app:e}=ht(),r=(e==null?void 0:e.allowlistConfig.errorTitle)||"You don't have access to this app",n=(e==null?void 0:e.allowlistConfig.errorDetail)||"Have you been invited?",i=(e==null?void 0:e.allowlistConfig.errorCtaText)||"Try another account";return p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),p.jsxs(h7e,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(tT,{}),p.jsx(ZQ,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),p.jsxs(p7e,{children:[p.jsx(typeof r=="string"?"h3":p.Fragment,{children:r}),p.jsx(typeof n=="string"?"p":p.Fragment,{children:n})]}),e!=null&&e.allowlistConfig.errorCtaLink?p.jsx(Mt,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):p.jsx(Mt,{onClick:()=>{t(de.LANDING)},children:i})]})]})};let h7e=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-ed4ecf-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),p7e=oe.div.withConfig({displayName:"GappedContainer",componentId:"sc-ed4ecf-1"})(["display:flex;flex-direction:column;gap:8px;"]);function g7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const m7e=C.forwardRef(g7e);function y7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))}const sh=C.forwardRef(y7e);function b7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}))}const Io=C.forwardRef(b7e),ah=oe.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),ko=oe.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),nT=oe.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),iT=oe(ko).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),Vl=oe(ko).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),Y3=oe.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),ga=oe.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),v7e=oe.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),Lr=oe.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),qr=oe.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"}
425)(["height:12px;"]),w7e=oe.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),sT=oe.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],(t=>t.height??"12")),E7e=oe.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]),Z3=({title:t,description:e,children:r,...n})=>p.jsx(XQ,{...n,children:p.jsxs(p.Fragment,{children:[p.jsx("h3",{children:t}),typeof e=="string"?p.jsx("p",{children:e}):e,r]})}),By=oe(Z3).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),wn=({title:t,description:e,icon:r,children:n,...i})=>p.jsxs(x7e,{...i,children:[r||null,p.jsx("h3",{children:t}),e&&typeof e=="string"?p.jsx("p",{children:e}):e,n]});let XQ=oe.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),x7e=oe(XQ).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]),rM=Array(6).fill("");var Mg,jg,_7e=((Mg=_7e||{})[Mg.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",Mg[Mg.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",Mg),C7e=((jg=C7e||{})[jg.EMAIL=0]="EMAIL",jg[jg.SMS=1]="SMS",jg);const S7e=()=>{var k,D,q;let{app:t,navigate:e,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=ht(),{closePrivyModal:a,resendEmailCode:o,resendSmsCode:c,getAuthMeta:l,loginWithCode:u,updateWallets:d,createAnalyticsEvent:f}=bt(),{authenticated:h,logout:g,user:m}=Sr(),[y,b]=C.useState(rM),[E,v]=C.useState(!1),[w,x]=C.useState(null),[_,S]=C.useState(null),[A,I]=C.useState(0);s.current=()=>null;let $=(k=l())!=null&&k.email?0:1,P=fn-500;C.useEffect((()=>{if(A){let U=setTimeout((()=>{I(A-1)}),1e3);return()=>clearTimeout(U)}}),[A]),C.useEffect((()=>{var U;if(h&&E&&m){if(t!=null&&t.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let W=setTimeout((()=>{e(de.AFFIRMATIVE_CONSENT_SCREEN)}),P);return()=>clearTimeout(W)}
425if(Sl(m,(U=t==null?void 0:t.embeddedWallets)==null?void 0:U.createOnLogin)){let W=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:V=>{console.error(V),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:V,screen:"AwaitingPasswordlessCodeScreen"}}),g()},callAuthOnSuccessOnClose:!0}}),e(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),P);return()=>clearTimeout(W)}{d();let W=setTimeout((()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0})),fn);return()=>clearTimeout(W)}}}),[h,E,m]),C.useEffect((()=>{if(w&&_===0){let U=setTimeout((()=>{b(rM),x(null);let W=document.querySelector("input[name=code-0]");W==null||W.focus()}),1400);return()=>clearTimeout(U)}}),[w]);let j=U=>{var ae;U.preventDefault();let W=U.currentTarget.value.replace(" ","");if(W==="")return;if(isNaN(Number(W)))return x("Code should be numeric"),void S(1);x(null),S(null);let V=Number((ae=U.currentTarget.name)==null?void 0:ae.charAt(5)),Y=[...W||[""]].slice(0,6-V),K=[...y.slice(0,V),...Y,...y.slice(V+Y.length)];b(K);let ge=Math.min(Math.max(V+Y.length,0),5);if(!isNaN(Number(U.currentTarget.value))){let ce=document.querySelector(`input[name=code-${ge}]`);ce==null||ce.focus()}if(K.every((ce=>ce&&!isNaN(+ce)))){let ce=document.querySelector(`input[name=code-${ge}]`);ce==null||ce.blur(),u(K.join("")).then((()=>v(!0))).catch((Q=>{var se,me,_e,z,R,M,ee,ie,le,ye,fe,we;if(Q instanceof $a&&Q.privyErrorCode===Se.INVALID_CREDENTIALS)x("Invalid or expired verification code");else if(Q instanceof $a&&Q.privyErrorCode===Se.CANNOT_LINK_MORE_OF_TYPE)x(Q.message);else{if(Q instanceof $a&&Q.privyErrorCode===Se.USER_LIMIT_REACHED)return console.error(new Ny(Q).toString()),void e(de.USER_LIMIT_REACHED_SCREEN);if(Q instanceof $a&&Q.privyErrorCode===Se.USER_DOES_NOT_EXIST)return void e(de.ACCOUNT_NOT_FOUND_SCREEN);if(Q instanceof $a&&Q.privyErrorCode===Se.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:Q,previousScreen:r??de.AWAITING_PASSWORDLESS_CODE}}),void e(de.ERROR_SCREEN,!1);if(Q instanceof $a&&Q.privyErrorCode===Se.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:Q}}),void e(de.CONNECT_OR_CREATE,!1);if(Q instanceof $a&&Q.privyErrorCode===Se.ACCOUNT_TRANSFER_REQUIRED&&((me=(se=Q.data)==null?void 0:se.data)!=null&&me.nonce))return i({accountTransfer:{nonce:(z=(_e=Q.data)==null?void 0:_e.data)==null?void 0:z.nonce,account:$===0?(R=l())==null?void 0:R.email:(M=l())==null?void 0:M.phoneNumber,displayName:(le=(ie=(ee=Q.data)==null?void 0:ee.data)==null?void 0:ie.account)==null?void 0:le.displayName,linkMethod:$===0?"email":"sms",embeddedWalletAddress:(we=(fe=(ye=Q.data)==null?void 0:ye.data)==null?void 0:fe.otherUser)==null?void 0:we.embeddedWalletAddress}}),void e(de.LINK_CONFLICT_SCREEN);x("Issue verifying code")}S(0)}))}},L=$==0?p.jsx(sh,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):p.jsx(Io,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),B=p.jsxs("p",$==0?{children:["Please check ",p.jsx(nM,{children:(D=l())==null?void 0:D.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",p.jsx(nM,{children:(q=l())==null?void 0:q.phoneNumber})," for a message from ",(t==null?void 0:t.name)||"Privy"," and enter your code below."]});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:()=>n()},"header"),p.jsxs(A7e,{children:[p.jsx(wn,{title:"Enter confirmation code",description:B,icon:L}),p.jsxs(nT,{children:[p.jsxs(T7e,{children:[p.jsx(I7e,{$fail:!!w,$success:E,children:p.jsx("span",{children:w||(E?"Success!":"")})}),p.jsx("div",{children:y.map(((U,W)=>p.jsx("input",{name:`code-${W}`,type:"text",value:y[W],onChange:j,onKeyUp:V=>{V.key==="Backspace"&&(Y=>{if(_===1&&(x(null),S(null)),b([...y.slice(0,Y),"",...y.slice(Y+1)]),Y>0){let K=document.querySelector(`input[name=code-${Y-1}]`);K==null||K.focus()}})(W)},inputMode:"numeric",autoFocus:W===0,pattern:"[0-9]",className:`${E?"success":""} ${w?"fail":""}`,autoComplete:An.isMobile?"one-time-code":"off"},W)))})]}),p.jsxs(k7e,{children:[p.jsxs("span",{children:["Didn't get ",$==0?"an email":"a message","?"]}
425),A?p.jsxs(N7e,{children:[p.jsx(m7e,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),p.jsx("span",{children:"Code sent"})]}):p.jsx($7e,{children:p.jsx("button",{onClick:async()=>{I(30),$==0?await o():await c()},children:"Resend code"})})]})]})]}),p.jsx(Ht,{})]})};let A7e=oe.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-463c12b2-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin:auto;gap:16px;flex-grow:1;"]),T7e=oe.div.withConfig({displayName:"CodeInput",componentId:"sc-463c12b2-1"})(["display:flex;flex-direction:column;width:100%;gap:8px;> div:last-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),I7e=oe.div.withConfig({displayName:"InputHelp",componentId:"sc-463c12b2-2"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-end;width:100%;"],(t=>t.$success?"var(--privy-color-success)":t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)")),k7e=oe.div.withConfig({displayName:"HelpText",componentId:"sc-463c12b2-3"})(["font-size:13px;color:var(--privy-color-foreground);display:flex;gap:8px;align-items:center;width:100%;margin-top:16px;padding-bottom:32px;"]),$7e=oe.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-463c12b2-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),N7e=oe.div.withConfig({displayName:"Badge",componentId:"sc-463c12b2-5"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),nM=oe.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-463c12b2-6"})(["font-weight:500;word-break:break-all;"]);function P7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const jf=C.forwardRef(P7e);function O7e({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const X3=C.forwardRef(O7e),R7e=({icon:t})=>p.jsx(p.Fragment,{children:p.jsx(D7e,{children:p.jsxs("div",{children:[p.jsx(To,{}),typeof t=="string"?p.jsx("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?p.jsx(t,{style:{width:"38px",height:"38px"}}):p.jsx("span",{})]})})});let D7e=oe.div.withConfig({displayName:"StackedContainer",componentId:"sc-26c1d9b9-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;
425left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const M7e=()=>{let{lastScreen:t,currentScreen:e,data:r,navigateBack:n,navigate:i,setModalData:s}=ht(),{status:a,token:o,waitForResult:c,reset:l,execute:u}=Vs(),d=C.useRef([]),f=j=>{d.current=[j,...d.current]},[h,g]=C.useState(!0);C.useEffect((()=>(f(setTimeout(g,1e3,!1)),()=>{d.current.forEach((j=>clearTimeout(j))),d.current=[]})),[]);let[m,y]=C.useState(""),[b,E]=C.useState("Checking that you are a human..."),[v,w]=C.useState(p.jsx(Mt,{onClick:()=>{},disabled:!0,children:"Continue"})),[x,_]=C.useState(!1),[S,A]=C.useState(3),I=r==null?void 0:r.captchaModalData,$=async j=>{try{await(I==null?void 0:I.callback(j)),I!=null&&I.onSuccessNavigateTo&&i(I==null?void 0:I.onSuccessNavigateTo,!1)}catch(L){if(L instanceof L3)return;s({errorModalData:{error:L,previousScreen:t||de.LANDING}}),i((I==null?void 0:I.onErrorNavigateTo)||de.ERROR_SCREEN,!1)}};C.useEffect((()=>{a==="success"?f(setTimeout((async()=>{let j=await c();!j||I!=null&&I.userIntentRequired||$(j)}),1e3)):a==="ready"&&f(setTimeout((()=>{a==="ready"&&u()}),500))}),[a]),C.useEffect((()=>{if(!h)switch(a){case"success":y("Success!"),E("CAPTCHA passed successfully."),w(p.jsx(Mt,{onClick:()=>{_(!0),$(o)},disabled:!(I!=null&&I.userIntentRequired),loading:x,children:I!=null&&I.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":y(""),E("Checking that you are a human..."),w(p.jsx(Mt,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":y("Something went wrong"),S<=0?(E("If you use an adblocker or VPN, try disabling and re-attempting."),w(null)):(E("You did not pass CAPTCHA. Please try again."),w(p.jsx(Mt,{onClick:P,children:"Retry"})))}}),[a,h,x]);let P=async()=>{if(S<=0)return;A((L=>L-1)),l(),u();let j=await c();!j||I!=null&&I.userIntentRequired||$(j)};return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:t&&e!==t?n:void 0}),p.jsxs(j7e,{children:[a==="success"?p.jsx(jf,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?p.jsx(X3,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):p.jsx(R7e,{}),p.jsxs(ga,{children:[m?p.jsx("h3",{children:m}):null,p.jsx("p",{children:b})]}),v]}),p.jsx(vr,{})]})};let j7e=oe.div.withConfig({displayName:"CaptchaContainer",componentId:"sc-9afcf974-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const Gb=({chainType:t,withPadding:e})=>{let r="";return r=t==="ethereum-only"||t==="ethereum-and-solana"?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",p.jsx(j9e,{$withPadding:e,children:p.jsxs(L9e,{children:[p.jsx(bf,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),p.jsx("h3",{children:"No wallets available"}),p.jsxs("p",{children:["Please download an external wallet provider, like ",r,"."]})]})},"empty-wallet-state")},JQ=({icon:t,name:e})=>typeof t=="string"?p.jsx("img",{alt:`${e||"wallet"} logo`,src:t,style:{height:24,width:24,borderRadius:4}}):t===void 0?p.jsx(Fy,{}):t?p.jsx(t,{}):null;let L7e=iy(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const eY=ns(["",""],(t=>t.$isLoading?ns(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],L7e):"")),$o=({children:t,color:e,isLoading:r,isPulsing:n,...i})=>p.jsx(F7e,{$color:e,$isLoading:r,$isPulsing:n,...i,children:t});let F7e=oe.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],(t=>{let e,r;t.$color==="green"&&(e="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),t.$color==="red"&&(e="var(--privy-color-error)",r="var(--privy-color-error-light)"),t.$color==="gray"&&(e="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let n=iy(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],r,r);return ns(["color:",";background-color:",";",";"],e,r,t.$isPulsing&&ns(["animation:"," 3s linear infinite;"],n))}),eY);const U7e=({...t})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...t,children:[p.jsx("defs",{children:p.jsxs("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{offset:"0",stopColor:"#f1562b"}),p.jsx("stop",{offset:"0.3",stopColor:"#f1542b"}),p.jsx("stop",{offset:"0.41",stopColor:"#f04d2a"}),p.jsx("stop",{offset:"0.49",stopColor:"#ef4229"}),p.jsx("stop",{offset:"0.5",stopColor:"#ef4029"}),p.jsx("stop",{offset:"0.56",stopColor:"#e83e28"}),p.jsx("stop",{offset:"0.67",stopColor:"#e13c26"}),p.jsx("stop",{offset:"1",stopColor:"#df3c26"})]})}),p.jsx("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),p.jsx("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8
425c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]}),B7e=({style:t,...e})=>p.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[p.jsx("path",{d:"M0 10.2C0 4.56669 4.5667 0 10.2 0H37.8C43.4333 0 48 4.5667 48 10.2V37.8C48 43.4333 43.4333 48 37.8 48H10.2C4.56669 48 0 43.4333 0 37.8V10.2Z",fill:"#604E93"}),p.jsx("path",{d:"M4.13353 14.6218C3.70207 13.1338 4.62517 11.5926 6.14065 11.2707L31.424 5.90036C32.6242 5.64544 33.8434 6.24236 34.3782 7.34668L45.7343 30.7995L13.7343 47.7328L4.13353 14.6218Z",fill:"url(#paint0_linear_362_37285)"}),p.jsx("path",{d:"M4.46332 16.4519C4.00953 14.8821 5.06159 13.277 6.68213 13.0669L40.1928 8.72077C41.5851 8.5402 42.879 9.47008 43.1517 10.8473L48.0004 35.333L13.467 47.5999L4.46332 16.4519Z",fill:"white"}),p.jsx("path",{d:"M0 18.6666C0 15.7211 2.38781 13.3333 5.33333 13.3333H37.3333C43.2244 13.3333 48 18.1089 48 24V37.3333C48 43.2243 43.2244 48 37.3333 48H10.6667C4.77563 48 0 43.2243 0 37.3333V18.6666Z",fill:"black"}),p.jsx("path",{d:"M31.7559 33.3796V23.3867H33.7051V33.3796H31.7559Z",fill:"#F7A600"}),p.jsx("path",{d:"M9.51303 36.362H5.33398V26.3691H9.3449C11.2941 26.3691 12.4301 27.4639 12.4301 29.176C12.4301 30.2844 11.7008 31.0006 11.1964 31.2393C11.7996 31.5201 12.5709 32.1511 12.5709 33.4846C12.5709 35.3513 11.2941 36.362 9.51303 36.362ZM9.19043 28.1096H7.28322V30.4117H9.19043C10.0174 30.4117 10.4808 29.9489 10.4808 29.2612C10.4808 28.5723 10.0185 28.1096 9.19043 28.1096ZM9.31653 32.1658H7.28322V34.6215H9.31653C10.2003 34.6215 10.6206 34.0599 10.6206 33.3868C10.6216 32.7127 10.2003 32.1658 9.31653 32.1658Z",fill:"white"}),p.jsx("path",{d:"M17.9425 32.2637V36.362H16.007V32.2637L13.0059 26.3691H15.1232L16.9884 30.3969L18.8252 26.3691H20.9426L17.9425 32.2637Z",fill:"white"}),p.jsx("path",{d:"M26.4896 36.362H22.3105V26.3691H26.3215C28.2707 26.3691 29.4066 27.4639 29.4066 29.176C29.4066 30.2844 28.6774 31.0006 28.173 31.2393C28.7761 31.5201 29.5474 32.1511 29.5474 33.4846C29.5464 35.3513 28.2696 36.362 26.4896 36.362ZM26.167 28.1096H24.2598V30.4117H26.167C26.994 30.4117 27.4574 29.9489 27.4574 29.2612C27.4563 28.5723 26.994 28.1096 26.167 28.1096ZM26.2931 32.1658H24.2598V34.6215H26.2931C27.1768 34.6215 27.5971 34.0599 27.5971 33.3868C27.5971 32.7127 27.1758 32.1658 26.2931 32.1658Z",fill:"white"}),p.jsx("path",{d:"M40.0573 28.1096V36.362H38.1081V28.1096H35.5V26.3691H42.6665V28.1096H40.0573Z",fill:"white"}),p.jsx("defs",{children:p.jsxs("linearGradient",{id:"paint0_linear_362_37285",x1:"4.00094",y1:"13.9604",x2:"46.1673",y2:"11.8482",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{"stop-color":"#FFD748"}),p.jsx("stop",{offset:"1","stop-color":"#F7A600"})]})})]}),q7e=({style:t,...e})=>p.jsxs("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),p.jsx("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),p.jsxs("g",{mask:"url(#mask0_16909_31415)",children:[p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L1
42576.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#002D72"}),p.jsx("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),p.jsxs("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),p.jsx("stop",{offset:"1",stopColor:"#002D72"})]})]})]}),tY=({style:t,...e})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),p.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),p.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),p.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),p.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),p.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),p.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),p.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),p.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),p.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),p.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),p.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),p.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),W7e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfoDAIVMQ8VNW19AAAGKUlEQVRYw+2WTWxcVxXHf+feN98Tf43j2KmduMEibZOilEjNl9KmImrCoipSkSohIQQSQkJhSdmAAEV0ka742CF11WURsEJRHSg4TWooUhPagkgcO/6IY8ffnhk/z8y9h8Wbsd/4AwEbFnCkJ7173zn/c87/nHPfhf91kcbLt892cX9RebrbcOaA4ViPoVyNvvVemfqPwMdfewyAbAI+nPbcGPfcnvYc6hCuDM0CEDSUDeAUkw54wRqW2gvmL+WHvgIwWQdCofeNqX/JaVwKnSZpZ/zTaUtbpaa/FUSbGPjOc3tRFbyyNzC809sifSf77FBvq/zKKb+rOR23ZtNoJ1a2Oq45SAQctMILk8v6heEJd3ZqRe87z4sizKkqb1x/FDGgGlXCCMe9cvj+sqbLVffyyT7z0uMd5l5gZVCVXwPDmTSL6SSUf9TsUBXWKlAOaQdOJAJe9sr5kXl/aHjCm7myIpAR4ThwVUSaSyARwxeAtACPSso7d515Zj8Dx3rMQCrgK6rcdo5rIsxvayaBmqMAfE6Ez4Q1MremPR8+cKzXou9ABriIcJU6nxsBKKSBo3HA0MHwhGO2pJzuM5lCVk54zwnVDcAmBryPEpkvKTfHPaOLHmWb7lGUNBA2BYBoiMpYU1ZRYIzMexbXlFN9hoGCadR3W81rDu7Oe96f8CyWFZHYmG3KmKoPRUwzA0R9cGunzhaBhbIyOBKxcarfUtjTrLO8BjfHHbcfeiq17QzF5FbDOUTTF5ePgPJuQaw7+NOkZ/COI6xG2QkQVmHwjuODSU/F/VPn5bqPRgvUA9Ami9qu5gq5JPS2CFYiEAWsRHu5ZAx5Z6k1NER1swQi2rAL60/LFr+oQmdWeK7fcrBdmrIUgSNdhlxC+MOYY373+jfwN2ja0kpMAbNAl2rk2EiUdXdeONlr2ZuPUtdYplqnor9dyCYsw5OOh0WlXAGv9VJF/maBB02lbby8drYLIKnws8Dw9da0sL9VeLxD6GkRkgg2xnA+C8lE9F6pQrG8CeiAKsqDFWV0QXm
425wrCyHSs3zc4FLQGXbvwDgVL+pAD/p75CXulukuyUlGAOlMoSV5vJuYyBWLgO0poT9B4TP9sLKuvJwRadH5/XHCJX3x/yG/kYAP7iYwER89AGtjbo7B0urnnBdMUJDh0RgSCejRbWqFIsRqNfoSaeEdNJgDLRlhPaMtD25jz7g44tPWK4MRThNY1g3ftErmUZWxsCenMU7KK55xpYDZouCd2zMofPwqCiMLgcUyx7vIhtjNhnySqaO3SQGYOX1g411AXh+a+vmMlBoS7AY5Hlrro+bqwWsFbTejNYIN1Y7eGuuj4VEnkJbglyGneQc0AkQvt6zWYJa6AhSABwDDm+1MkbJZoVn81UGuqdZWrMYa4CIdmMN5w+FfDFToiPhEB/Z7CCH6z4GS2uxo9iYOv2e5wWycQvntd5knkDgsaxnf6ZKpbo55QmrPNURIgLVWnTarFeis8CaptMgq3DOGgatjTVhzUVjZAwl3RJ4qayU1xxGhEK7pWWPYA0EwWZDBkHU/TUHK0VlftHhVclmLLls83EkQsl7SKdiATRUvOc6sAps/GpSKWEtFJxXqg6KJU86JcyEUK5E0eaS0JVWwnWlWhOcU4wVUilhS0Krqgxta8LC5cnG+hPg73EFa4R8zmINGBFq+QOMdFzg0rUcr75d5dW3q1y6luNexwVq+QMYI1gL+ZzZSj917E8AOi9PbTIQk0XgPeB4fDOVIHRtbQvhk5/fJ33P2kezZSZX32O1GhVyYhVmO0/R8tR5dOKPLv3X38ykKHYQXXLicgNYiG9sDQDg98A3gCXg48hIr7Pv06NLPWe+msR+K591uW9++RV8fajFCLlsmhLpUqXnzE/bFu69ycwHh0DOAKeBI0A78O5WZ7ErmSDRYTsEfAn4GzBG/X5QDfKMTdz/7r7Ozj9bY77/zNHDRzfOZgFBP1peXfnhzPzcL48EeQfcAa4STVU/8EQdu7kp44vJHe70Dbl74jKqSmAtNec+JSKngfow4VT1RmDtSM05RISB4e/tihW/0u9+d9lB3v3Fm6gooruZRbfIc6987d+B/b/8d+UfeVGT8xvC5akAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMTItMDJUMjE6NDk6MTArMDA6MDB60KjYAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI0LTEyLTAyVDIxOjQ5OjEwKzAwOjAwC40QZAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNC0xMi0wMlQyMTo0OToxNSswMDowMA6gHhwAAAAASUVORK5CYII=",J3=({style:t,...e})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}),rY="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",z7e=t=>p.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),p.jsx("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 3
4251.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),p.jsx("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"white"}),p.jsx("stop",{offset:"1",stopColor:"white"})]}),p.jsxs("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#8697FF"}),p.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),p.jsxs("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#8697FF"}),p.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),p.jsxs("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"white"}),p.jsx("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]}),V7e=({style:t,...e})=>p.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[p.jsx("g",{clipPath:"url(#clip0_5_32)",children:p.jsxs("g",{clipPath:"url(#clip1_5_32)",children:[p.jsx("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:p.jsx("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),p.jsx("g",{mask:"url(#mask0_5_32)",children:p.jsx("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),p.jsx("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),p.jsx("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),p.jsx("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),p.jsx("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),p.jsx("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),p.jsx("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),p.jsx("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),p.jsx("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}
425),p.jsx("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#174299"}),p.jsx("stop",{offset:"1",stopColor:"#001E59"})]}),p.jsxs("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[p.jsx("stop",{offset:"0.770277",stopColor:"#FF4000"}),p.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),p.jsxs("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#FF4000"}),p.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),p.jsxs("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#8754C9"}),p.jsx("stop",{offset:"1",stopColor:"#FF4000"})]}),p.jsxs("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[p.jsx("stop",{offset:"0.723929",stopColor:"#FFF700"}),p.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),p.jsxs("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#FFF700"}),p.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),p.jsxs("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#FFF700"}),p.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),p.jsxs("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[p.jsx("stop",{offset:"0.59513",stopColor:"#00AAFF"}),p.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),p.jsxs("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[p.jsx("stop",{stopColor:"#00AAFF"}),p.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),p.jsxs("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[p.jsx("stop",{stopColor:"#00AAFF"}),p.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),p.jsx("clipPath",{id:"clip0_5_32",children:p.jsx("rect",{width:"120",height:"120",fill:"white"})}),p.jsx("clipPath",{id:"clip1_5_32",children:p.jsx("rect",{width:"120",height:"120",fill:"white"})})]})]}),H7e=({style:t,...e})=>p.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),p.jsx("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),p.jsx("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),p.jsx("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]}),G7e=({style:t,...e})=>p.jsxs("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[p.jsx("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),p.jsxs("g",{children:[p.jsx("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),p.jsx("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}
425),p.jsx("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),p.jsx("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),p.jsx("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),p.jsx("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),p.jsx("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C1
4255.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]}),K7e=({style:t,...e})=>p.jsxs("svg",{fill:"none",height:"1024",width:"1024",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[p.jsxs("filter",{id:"a","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"1228",width:"1244",x:"-72",y:"-72",children:[p.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),p.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),p.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),p.jsx("feOffset",{dx:"-72",dy:"-72"}),p.jsx("feGaussianBlur",{stdDeviation:"54"}),p.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),p.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),p.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"}),p.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),p.jsx("feOffset",{dx:"152",dy:"132"}),p.jsx("feGaussianBlur",{stdDeviation:"74"}),p.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),p.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),p.jsx("feBlend",{in2:"effect1_innerShadow_3981_20791",mode:"normal",result:"effect2_innerShadow_3981_20791"}),p.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),p.jsx("feOffset",{dx:"32",dy:"20"}),p.jsx("feGaussianBlur",{stdDeviation:"50"}),p.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),p.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),p.jsx("feBlend",{in2:"effect2_innerShadow_3981_20791",mode:"normal",result:"effect3_innerShadow_3981_20791"})]}),p.jsxs("filter",{id:"b","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"352",width:"747",x:"142",y:"352",children:[p.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),p.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),p.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),p.jsx("feOffset",{dx:"8",dy:"12"}),p.jsx("feGaussianBlur",{stdDeviation:"5"}),p.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),p.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0.69 0"}),p.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"})]}),p.jsxs("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:"0",x2:"1024",y1:"0",y2:"1024",children:[p.jsx("stop",{offset:"0",stopColor:"#8992d1"}),p.jsx("stop",{offset:"1",stopColor:"#646c9f"})]}),p.jsx("clipPath",{id:"d",children:p.jsx("path",{d:"m0 0h1024v1024h-1024z"})}),p.jsxs("g",{"clip-path":"url(#d)",children:[p.jsx("g",{filter:"url(#a)",children:p.jsx("rect",{fill:"url(#c)",height:"1024",rx:"230",width:"1024"})}),p.jsxs("g",{fill:"#fff",filter:"url(#b)",children:[p.jsx("path",{d:"m212.459 354h-54.459c-8.837 0-16 7.163-16 16v203c0 66.826 54.174 121 121 121h44c66.826 0 121-54.174 121-121v-203c0-8.837-7.163-16-16-16h-56.548c-8.837 0-16 7.163-16 16v198.829c0 28.607-23.19 51.797-51.797 51.797-32.693 0-59.196-26.503-59.196-59.196v-191.43c0-8.837-7.163-16-16-16z"}),p.jsx("path",{d:"m868.426 352h-68.495c-6.98 0-12.487 5.934-11.967 12.895l14.206 190c.468 6.263 5.686 11.105 11.966 11.105h45.412c6.409 0 11.687-5.037 11.987-11.44l8.878-190c.32-6.84-5.14-12.56-11.987-12.56z"}),p.jsx("ellipse",{cx:"834",cy:"649.5",rx:"47",ry:"44.5"}),p.jsx("path",{clipRule:"evenodd",d:"m522 687h50c8.837 0 16-7.163 16-16v-80c0-8.837 7.163-16 16-16h33.5c61.58 0 111.5-49.92 111.5-111.5s-49.92-111.5-111.5-111.5h-115.5c-8.837 0-16 7.163-16 16v303c0 8.837 7.163 16 16 16zm70-252v58c0 6.627 5.373 12 12 12h14c20.987 0 38-17.013 38-38v-6c0-20.987-17.013-38-38-38h-14c-6.627 0-12 5.373-12 12z",fillRule:"evenodd"})]})]})]}),nY=({style:t,...e})=>{let{app:r}=ht();return p.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[p.jsx("rect",{width:"28",height:"28",rx:"3",fill:(r==null?void 0:r.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),p.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:p.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.54
42511 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_1765_9946",children:p.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},Q7e="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0x
425Mi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",Y7e=({style:t,...e})=>p.jsxs("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[p.jsxs("g",{clipPath:"url(#clip0_1704_1423)",children:[p.jsx("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_1704_1423",children:p.jsx("rect",{width:"176",height:"176",fill:"white"})})})]}),uc={coinbase_wallet:{logo:a7,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:a7,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:tY,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:J3,displayName:"Phantom"},rainbow:{logo:V7e,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:nY,displayName:"WalletConnect"},zerion:{logo:Y7e,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:U7e,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:q7e,displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:G7e,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:z7e,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:H7e},universal_profile:{displayName:"Universal Profile",logo:K7e},bybit_wallet:{displayName:"Bybit Wallet",logo:B7e}},j0=(t,e,r)=>{var n;return(n=uc[t])!=null&&n.displayName?t==="coinbase_wallet"?uc[r].displayName:uc[t].displayName:e==="wallet_connect_v2"&&t==="wallet_connect"?"Wallet Connect":void 0},iY=(t,e,r)=>{var n;return(n=uc[t])!=null&&n.logo?t==="coinbase_wallet"?uc[r].logo:uc[t].logo:e==="wallet_connect_v2"&&t==="wallet_connect"?nY:void 0};function p7(t){var r,n;let e=t.toLowerCase();return!!((n=(r=window==null?void 0:window.webkit)==null?void 0:r.messageHandlers)!=null&&n.ReactNativeWebView)||!!(window!=null&&window.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some((i=>e.includes(i)))}let sY=C.createContext({});const Z7e=({children:t})=>{let e=Jn(),[r,n]=C.useState({});return ZA("login",{onComplete:(i,s,a,o,c)=>{c&&c.type!=="passkey"&&c.type!=="cross_app"&&(c.type!=="wallet"||c.walletClientType!=="privy")&&(Ut.put(iM(e.id),c.type),c.type==="wallet"?(Ut.put(uE(e.id),c.walletClientType),Ut.put(dE(e.id),c.chainType),n({accountType:c.type,walletClientType:c.walletClientType,chainType:c.chainType})):(Ut.del(uE(e.id)),Ut.del(dE(e.id)),n({accountType:c.type})))}}),C.useEffect((()=>
425{if(!e.id)return;let i=Ut.get(iM(e.id)),s=Ut.get(uE(e.id)),a=Ut.get(dE(e.id));i&&n(i==="wallet"?{accountType:i,walletClientType:s,chainType:a}:{accountType:i})}),[e.id]),p.jsx(sY.Provider,{value:r,children:t})};let iM=t=>`privy:${t}:recent-login-method`,uE=t=>`privy:${t}:recent-login-wallet-client`,dE=t=>`privy:${t}:recent-login-chain-type`;const gd=()=>C.useContext(sY),Rc=({provider:t,displayName:e,logo:r,connectOnly:n,connector:i})=>{let{navigate:s}=ht(),{connectWallet:a}=bt(),o=gd(),c=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,l=window.matchMedia("(display-mode: standalone)").matches;return p.jsxs(X7e,{onClick:i.connectorType==="phantom"||i.connectorType==="solana_adapter"&&i.walletClientType==="phantom"?()=>{D3()||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(a(i,c),s(n?de.AWAITING_CONNECT_ONLY_CONNECTION:de.AWAITING_CONNECTION)):s(An.isMobile?de.PHANTOM_INTERSTITIAL_SCREEN:de.INSTALL_PHANTOM_SCREEN)}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!An.isMobile||l||eK()?()=>{(!p7(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(a(i,c),s(n?de.AWAITING_CONNECT_ONLY_CONNECTION:de.AWAITING_CONNECTION))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`},children:[p.jsx(JQ,{icon:iY(t,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),p.jsx("span",{children:j0(t,i.connectorType,i.walletClientType)||e||i.walletClientType}),p.jsxs(J7e,{id:"chip-container",children:[(o==null?void 0:o.walletClientType)===c&&(o==null?void 0:o.chainType)===i.chainType?p.jsx(sM,{color:"gray",children:"Recent"}):p.jsx("span",{id:"connect-text",children:"Connect"}),i.connectorType==="solana_adapter"&&p.jsx(sM,{color:"gray",children:"Solana"})]})]})};let X7e=oe(In).withConfig({displayName:"ConnectWalletButton",componentId:"sc-b6343d12-0"})(["> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),sM=oe($o).withConfig({displayName:"StyledChip",componentId:"sc-b6343d12-1"})(["margin-left:auto;"]),J7e=oe.div.withConfig({displayName:"ChipContainer",componentId:"sc-b6343d12-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const eCe=["coinbase_wallet"];let tCe=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];
425const rCe=["safe"],nCe=["phantom","universal_profile"],aT=({wallets:t})=>{let{app:e}=ht();return t.length===0?p.jsx(Gb,{chainType:e.appearance.walletChainType,withPadding:!0}):p.jsx(p.Fragment,{children:t})},Lf=({walletList:t,walletChainType:e,connectors:r,connectOnly:n,ignore:i,walletConnectEnabled:s,forceWallet:a})=>{var f,h;let o=[],c=[],l=[],u=r.filter((g=>e==="ethereum-only"?g.chainType==="ethereum":e!=="solana-only"||g.chainType==="solana")),d=u.find((g=>g.connectorType==="wallet_connect_v2"));for(let[g,m]of(a?[a.wallet]:t).entries()){if(m==="detected_ethereum_wallets"||m==="detected_wallets")for(let[y,b]of u.filter((({chainType:E,connectorType:v,walletClientType:w})=>E!=="solana"&&(w==="uniswap_wallet_extension"||w==="uniswap_extension"?!i.includes("uniswap"):w==="crypto.com_wallet_extension"||w==="crypto.com_onchain"?!i.includes("cryptocom"):v==="injected"&&!i.includes(w)))).entries()){let{walletClientType:E,walletBranding:v,chainType:w}=b;(E==="unknown"?c:o).push(p.jsx(Rc,{connectOnly:n,provider:E,logo:v.icon,displayName:v.name,connector:b},`${g}-${m}-${E}-${w}-${y}`))}if(m==="detected_solana_wallets"||m==="detected_wallets")for(let[y,b]of u.filter((({chainType:E,walletClientType:v})=>{if(E==="solana")return e!=="ethereum-only"&&!i.includes(v)})).entries()){let{walletClientType:E,walletBranding:v,chainType:w}=b;(E==="unknown"?c:o).push(p.jsx(Rc,{connectOnly:n,provider:E,logo:v.icon,displayName:v.name,connector:b},`${g}-${m}-${E}-${w}-${y}`))}if(nCe.includes(m)){let y=u.find((b=>b.connectorType==="injected"&&b.walletClientType===m||b.connectorType===m));if(y&&o.push(p.jsx(Rc,{connectOnly:n,provider:m,connector:y},`${g}-${m}`)),e==="solana-only"||e==="ethereum-and-solana"){let b=u.find((({chainType:E,connectorType:v,walletClientType:w})=>E==="solana"&&v==="solana_adapter"&&w===m));b&&o.push(p.jsx(Rc,{connectOnly:n,provider:m,connector:b},`${m}-solana`))}}else if(tCe.includes(m)){let y=u.find((b=>m==="uniswap"?b.walletClientType==="uniswap_wallet_extension"||b.walletClientType==="uniswap_extension":m==="cryptocom"?b.walletClientType==="crypto.com_wallet_extension"||b.walletClientType==="crypto.com_onchain":b.connectorType==="injected"&&b.walletClientType===m));s&&!y&&(y=d),y&&o.push(p.jsx(Rc,{connectOnly:n,provider:m,connector:y,logo:y.connectorType==="injected"?y.walletBranding.icon:void 0,displayName:y.connectorType==="injected"?y.walletBranding.name:void 0},`${g}-${m}`))}else if(eCe.includes(m)){let y=u.find((({connectorType:b})=>b===m));y&&o.push(p.jsx(Rc,{connectOnly:n,provider:m,connector:y},`${g}-${m}`))}else if(rCe.includes(m))d&&l.push(p.jsx(Rc,{connectOnly:n,provider:m,connector:d},`${g}-${m}`));else if(m==="wallet_connect")d&&l.push(p.jsx(Rc,{connectOnly:n,provider:m,connector:d},`${g}-${m}`));else if(m===(a==null?void 0:a.wallet)){let y=a.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),b=a.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||y||b){let E=u.find((({walletClientType:v})=>v===m));E&&o.push(p.jsx(Rc,{connectOnly:n,provider:m,displayName:(f=E.walletBranding)==null?void 0:f.name,logo:(h=E.walletBranding)==null?void 0:h.icon,connector:E},`${g}-${m}`))}}}return[...c,...o,...l]},iCe=()=>{var a,o;let{app:t,data:e}=ht(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,n=r?`Connect the wallet with address ${fs(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:i}=bt(),s=Lf({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),s.length>0&&p.jsx(By,{title:"Connect your wallet",description:n}),p.jsx(Xu,{children:p.jsx(aT,{wallets:s})}),p.jsx(Ht,{})]})},sCe=()=>{var a,o;let{app:t,data:e}=ht(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,n=r?p.jsxs("span",{children:["Connect the wallet with address ",p.jsx(_i,{showCopyIcon:!1,address:r})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Connect a wallet to your ${t==null?void 0:t.name} account`,{connectors:i}=bt(),s=Lf({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),s.length>0&&p.jsx(Z3,{title:"Connect your wallet",description:n}),p.jsx(Xu,{children:p.jsx(aT,{wallets:s})}),t&&p.jsx(rT,{app:t,alwaysShowImplicitConsent:!0}),p.jsx(Ht,{})]})},oT=({style:t,...e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),aM=t=>{var r;let e=(r=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:r.split(" ").filter((n=>xo(n,{strict:!0}))).map((n=>e0(n)));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter((n=>n.type=="wallet"&&e.includes(n.address))).length)};var ba=PA();const cT=Rl(ba);var oM=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))},aCe=(function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t})(),oCe=(function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t})(),cCe=(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})(),lCe=(function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t})(),uCe=(function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t})(),dCe=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yaho
vendor: 14,828 bytes, lines 425-438
425o!|yandex/,fCe=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,cM=3,hCe=[["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",dCe]],lM=[["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 pCe(t){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new uCe:typeof navigator<"u"?mCe(navigator.userAgent):bCe()}function gCe(t){return t!==""&&hCe.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 mCe(t){var e=gCe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new lCe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<cM&&(i=oM(oM([],i,!0),vCe(cM-i.length),!0)):i=[];var s=i.join("."),a=yCe(t),o=fCe.exec(t);return o&&o[1]?new cCe(r,s,a,o[1]):new aCe(r,s,a)}function yCe(t){for(var e=0,r=lM.length;e<r;e++){var n=lM[e],i=n[0],s=n[1],a=s.exec(t);if(a)return i}return null}function bCe(){var t=typeof process<"u"&&process.version;return t?new oCe(process.version.slice(1)):null}function vCe(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var fE={};/*! ***************************************************************************** 426Copyright (c) Microsoft Corporation. 427 428Permission to use, copy, modify, and/or distribute this software for any 429purpose with or without fee is hereby granted. 430 431THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 432REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 433AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 434INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 435LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 436OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 437PERFORMANCE OF THIS SOFTWARE. 438***************************************************************************** */var g7=function(t,e){return g7=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])},g7(t,e)};function wCe(t,e){g7(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var m7=function(){return m7=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},m7.apply(this,arguments)};function ECe(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 xCe(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function _Ce(t,e){return function(r,n){e(r,n,t)}}function CCe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function SCe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{l(n.next(u))}catch(d){a(d)}}function c(u){try{l(n.throw(u))}catch(d){a(d)}}function l(u){u.done?s(u.value):i(u.value).then(o,c)}l((n=n.apply(t,e||[])).next())})}function ACe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(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 TCe(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function ICe(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function y7(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 aY(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(o){a={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s}function kCe(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(aY(arguments[e]));return t}function $Ce(){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],a=0,o=s.length;a<o;a++,i++)n[i]=s[a];return n}function Um(t){return this instanceof Um?(this.v=t,this):new Um(t)}function NCe(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(f){n[f]&&(i[f]=function(h){return new Promise(function(g,m){s.push([f,h,g,m])>1||o(f,h)})})}function o(f,h){try{c(n[f](h))}catch(g){d(s[0][3],g)}}function c(f){f.value instanceof Um?Promise.resolve(f.value.v).then(l,u):d(s[0][2],f)}function l(f){o("next",f)}function u(f){o("throw",f)}function d(f,h){f(h),s.shift(),s.length&&o(s[0][0],s[0][1])}}function PCe(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(a){return(r=!r)?{value:Um(t[i](a)),done:i==="return"}:s?s(a):a}:s}}function OCe(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 y7=="function"?y7(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(a){return new Promise(function(o,c){a=t[s](a),i(o,c,a.done,a.value)})}}function i(s,a,o,c){Promise.resolve(c).then(function(l){s({value:l,done:o})},a)}}function RCe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function DCe(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 MCe(t){return t&&t.__esModule?t:{default:t}}function jCe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function LCe(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 FCe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return m7},__asyncDelegator:PCe,__asyncGenerator:NCe,__asyncValues:OCe,__await:Um,__awaiter:SCe,__classPrivateFieldGet:jCe,__classPrivateFieldSet:LCe,__createBinding:TCe,__decorate:xCe,__exportStar:ICe,__extends:wCe,__generator:ACe,__importDefault:MCe,__importStar:DCe,__makeTemplateObject:RCe,__metadata:CCe,__param:_Ce,__read:aY,__rest:ECe,__spread:kCe,__spreadArrays:$Ce,__values:y7},Symbol.toStringTag,{value:"Module"})),qy=m0(FCe);var hE={},Lg={},uM;function UCe(){if(uM)return Lg;uM=1,Object.defineProperty(Lg,"__esModule",{value:!0}),Lg.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Lg.delay=t,Lg}var kd={},pE={},$d={},dM;function BCe(){return dM||(dM=1,Object.defineProperty($d,"__esModule",{value:!0}),$d.ONE_THOUSAND=$d.ONE_HUNDRED=void 0,$d.ONE_HUNDRED=100,$d.ONE_THOUSAND=1e3),$d}var gE={},fM;function qCe(){return fM||(fM=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})(gE)),gE}var hM;function oY(){return hM||(hM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qy;e.__exportStar(BCe(),t),e.__exportStar(qCe(),t)})(pE)),pE}var pM;function WCe(){if(pM)return kd;pM=1,Object.defineProperty(kd,"__esModule",{value:!0}),kd.fromMiliseconds=kd.toMiliseconds=void 0;const t=oY();function e(n){return n*t.ONE_THOUSAND}kd.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return kd.fromMiliseconds=r,kd}var gM;function zCe(){return gM||(gM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qy;e.__exportStar(UCe(),t),e.__exportStar(WCe(),t)})(hE)),hE}var Th={},mM;function VCe(){if(mM)return Th;mM=1,Object.defineProperty(Th,"__esModule",{value:!0}),Th.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 Th.Watch=t,Th.default=t,Th}var mE={},Fg={},yM;function HCe(){if(yM)return Fg;yM=1,Object.defineProperty(Fg,"__esModule",{value:!0}),Fg.IWatch=void 0;class t{}return Fg.IWatch=t,Fg}var bM;function GCe(){return bM||(bM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),qy.__exportStar(HCe(),t)})(mE)),mE}var vM;function KCe(){return vM||(vM=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qy;e.__exportStar(zCe(),t),e.__exportStar(VCe(),t),e.__exportStar(GCe(),t),e.__exportStar(oY(),t)})(fE)),fE}var ot=KCe(),Yr={},wM;function cY(){if(wM)return Yr;wM=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.getLocalStorage=Yr.getLocalStorageOrThrow=Yr.getCrypto=Yr.getCryptoOrThrow=Yr.getLocation=Yr.getLocationOrThrow=Yr.getNavigator=Yr.getNavigatorOrThrow=Yr.getDocument=Yr.getDocumentOrThrow=Yr.getFromWindowOrThrow=Yr.getFromWindow=void 0;function t(f){let h;return typeof window<"u"&&typeof window[f]<"u"&&(h=window[f]),h}Yr.getFromWindow=t;function e(f){const h=t(f);if(!h)throw new Error(`${f} is not defined in Window`);return h}Yr.getFromWindowOrThrow=e;function r(){return e("document")}Yr.getDocumentOrThrow=r;function n(){return t("document")}Yr.getDocument=n;function i(){return e("navigator")}Yr.getNavigatorOrThrow=i;function s(){return t("navigator")}Yr.getNavigator=s;function a(){return e("location")}Yr.getLocationOrThrow=a;function o(){return t("location")}Yr.getLocation=o;function c(){return e("crypto")}Yr.getCryptoOrThrow=c;function l(){return t("crypto")}Yr.getCrypto=l;function u(){return e("localStorage")}Yr.getLocalStorageOrThrow=u;function d(){return t("localStorage")}return Yr.getLocalStorage=d,Yr}var kl=cY(),Ug={},EM;function QCe(){if(EM)return Ug;
vendor: 1,328 bytes, line 438
438EM=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.getWindowMetadata=void 0;const t=cY();function e(){let r,n;try{r=t.getDocumentOrThrow(),n=t.getLocationOrThrow()}catch{return null}function i(){const h=r.getElementsByTagName("link"),g=[];for(let m=0;m<h.length;m++){const y=h[m],b=y.getAttribute("rel");if(b&&b.toLowerCase().indexOf("icon")>-1){const E=y.getAttribute("href");if(E)if(E.toLowerCase().indexOf("https:")===-1&&E.toLowerCase().indexOf("http:")===-1&&E.indexOf("//")!==0){let v=n.protocol+"//"+n.host;if(E.indexOf("/")===0)v+=E;else{const w=n.pathname.split("/");w.pop();const x=w.join("/");v+=x+"/"+E}g.push(v)}else if(E.indexOf("//")===0){const v=n.protocol+E;g.push(v)}else g.push(E)}}return g}function s(...h){const g=r.getElementsByTagName("meta");for(let m=0;m<g.length;m++){const y=g[m],b=["itemprop","property","name"].map(E=>y.getAttribute(E)).filter(E=>E?h.includes(E):!1);if(b.length&&b){const E=y.getAttribute("content");if(E)return E}}return""}function a(){let h=s("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function o(){return s("description","og:description","twitter:description","keywords")}const c=a(),l=o(),u=n.origin,d=i();return{description:l,url:u,icons:d,name:c}}return Ug.getWindowMetadata=e,Ug}var YCe=QCe();const ZCe="0.1.1";function XCe(){return ZCe}
vendor: 46,011 bytes, lines 438-439
438class En extends Error{constructor(e,r={}){const n=(()=>{var c;if(r.cause instanceof En){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 En&&r.cause.docsPath||r.docsPath,a=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${a}`:void 0]:[]].filter(c=>typeof c=="string").join(` 439`);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,"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@${XCe()}`}),this.cause=r.cause,this.details=n,this.docs=a,this.docsPath=i,this.shortMessage=e}walk(e){return lY(this,e)}}function lY(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?lY(t.cause,e):e?null:t}function JCe(t,e){if(SM(t)>e)throw new wSe({givenSize:SM(t),maxSize:e})}const Dc={zero:48,nine:57,A:65,F:70,a:97,f:102};function xM(t){if(t>=Dc.zero&&t<=Dc.nine)return t-Dc.zero;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 eSe(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;if(t.length>n)throw new ESe({size:t.length,targetSize:n,type:"Bytes"});const i=new Uint8Array(n);for(let s=0;s<n;s++){const a=r==="right";i[a?s:n-s-1]=t[a?s:t.length-s-1]}return i}function uY(t,e){if(Ju(t)>e)throw new uSe({givenSize:Ju(t),maxSize:e})}function tSe(t,e){if(typeof e=="number"&&e>0&&e>Ju(t)-1)throw new hY({offset:e,position:"start",size:Ju(t)})}function rSe(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Ju(t)!==r-e)throw new hY({offset:r,position:"end",size:Ju(t)})}function dY(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 dSe({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}const nSe="#__bigint";function lT(t,e,r){return JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString()+nSe:i,r)}const iSe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function sSe(t,e={}){const{strict:r=!1}=e;if(!t)throw new _M(t);if(typeof t!="string")throw new _M(t);if(r&&!/^0x[0-9a-fA-F]*$/.test(t))throw new CM(t);if(!t.startsWith("0x"))throw new CM(t)}function aSe(...t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function uT(t){return t instanceof Uint8Array?sw(t):Array.isArray(t)?sw(new Uint8Array(t)):t}function sw(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=iSe[t[i]];const n=`0x${r}`;return typeof e.size=="number"?(uY(n,e.size),fY(n,e.size)):n}function yE(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 a=typeof s=="bigint"&&r?-s-1n:0;if(s&&i>s||i<a){const l=typeof t=="bigint"?"n":"";throw new lSe({max:s?`${s}${l}`:void 0,min:`${a}${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?oSe(c,n):c}function oSe(t,e){return dY(t,{dir:"left",size:e})}function fY(t,e){return dY(t,{dir:"right",size:e})}function Yc(t,e,r,n={}){const{strict:i}=n;tSe(t,e);const s=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return i&&rSe(s,e,r),s}function Ju(t){return Math.ceil((t.length-2)/2)}function cSe(t,e={}){const{strict:r=!1}=e;try{return sSe(t,{strict:r}),!0}catch{return!1}}class lSe extends En{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 _M extends En{constructor(e){super(`Value \`${typeof e=="object"?lT(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 CM extends En{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 uSe=class extends En{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 hY extends En{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 dSe=class extends En{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 fSe=new TextEncoder;function hSe(t){if(!(t instanceof Uint8Array)){if(!t)throw new Q2(t);if(typeof t!="object")throw new Q2(t);if(!("BYTES_PER_ELEMENT"in t))throw new Q2(t);if(t.BYTES_PER_ELEMENT!==1||t.constructor.name!=="Uint8Array")throw new Q2(t)}}function pSe(t){return t instanceof Uint8Array?t:typeof t=="string"?mSe(t):gSe(t)}function gSe(t){return t instanceof Uint8Array?t:new Uint8Array(t)}function mSe(t,e={}){const{size:r}=e;let n=t;r&&(uY(t,r),n=fY(t,r));let i=n.slice(2);i.length%2&&(i=`0${i}`);const s=i.length/2,a=new Uint8Array(s);for(let o=0,c=0;o<s;o++){const l=xM(i.charCodeAt(c++)),u=xM(i.charCodeAt(c++));if(l===void 0||u===void 0)throw new En(`Invalid byte sequence ("${i[c-2]}${i[c-1]}" in "${i}").`);a[o]=l*16+u}return a}function ySe(t,e={}){const{size:r}=e,n=fSe.encode(t);return typeof r=="number"?(JCe(n,r),bSe(n,r)):n}function bSe(t,e){return eSe(t,{dir:"right",size:e})}function SM(t){return t.length}function vSe(t){try{return hSe(t),!0}catch{return!1}}class Q2 extends En{constructor(e){super(`Value \`${typeof e=="object"?lT(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 wSe extends En{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 ESe extends En{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 pY(t,e={}){const{as:r=typeof t=="string"?"Hex":"Bytes"}=e,n=LS(pSe(t));return r==="Bytes"?n:sw(n)}class xSe 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 _Se={checksum:new xSe(8192)},bE=_Se.checksum;function gY(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 AM({prefix:n,cause:new kSe});return}if(r===!0||typeof i=="bigint"&&typeof s>"u"){if(n!==3&&n!==2)throw new AM({prefix:n,cause:new ISe});return}throw new TSe({publicKey:t})}function CSe(t){const e=(()=>{if(cSe(t))return mY(t);if(vSe(t))return SSe(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 gY(e),e}function SSe(t){return mY(sw(t))}function mY(t){if(t.length!==132&&t.length!==130&&t.length!==68)throw new $Se({publicKey:t});if(t.length===130){const n=BigInt(Yc(t,0,32)),i=BigInt(Yc(t,32,64));return{prefix:4,x:n,y:i}}if(t.length===132){const n=Number(Yc(t,0,1)),i=BigInt(Yc(t,1,33)),s=BigInt(Yc(t,33,65));return{prefix:n,x:i,y:s}}const e=Number(Yc(t,0,1)),r=BigInt(Yc(t,1,33));return{prefix:e,x:r}}function ASe(t,e={}){gY(t);const{prefix:r,x:n,y:i}=t,{includePrefix:s=!0}=e;return aSe(s?yE(r,{size:1}):"0x",yE(n,{size:32}),typeof i=="bigint"?yE(i,{size:32}):"0x")}class TSe extends En{constructor({publicKey:e}){super(`Value \`${lT(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 AM extends En{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 ISe extends En{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 kSe extends En{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let $Se=class extends En{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 ${Ju(uT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const NSe=/^0x[a-fA-F0-9]{40}$/;function yY(t,e={}){const{strict:r=!0}=e;if(!NSe.test(t))throw new TM({address:t,cause:new RSe});if(r){if(t.toLowerCase()===t)return;if(bY(t)!==t)throw new TM({address:t,cause:new DSe})}}function bY(t){if(bE.has(t))return bE.get(t);yY(t,{strict:!1});const e=t.substring(2).toLowerCase(),r=pY(ySe(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 bE.set(t,i),i}function PSe(t,e={}){const{checksum:r=!1}=e;return yY(t),r?bY(t):t}function OSe(t,e={}){const r=pY(`0x${ASe(t).slice(4)}`).substring(26);return PSe(`0x${r}`,e)}class TM extends En{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 RSe extends En{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 DSe extends En{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}function MSe(t){if(t.length!==130&&t.length!==132)throw new LSe({signature:t});const e=BigInt(Yc(t,0,32)),r=BigInt(Yc(t,32,64)),n=(()=>{const i=+`0x${t.slice(130)}`;if(!Number.isNaN(i))try{return jSe(i)}catch{throw new FSe({value:i})}})();return typeof n>"u"?{r:e,s:r}:{r:e,s:r,yParity:n}}function jSe(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 USe({value:t})}class LSe extends En{constructor({signature:e}){super(`Value \`${e}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Ju(uT(e))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class FSe extends En{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 USe extends En{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 vY(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function wY(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 aw(t,e){if(typeof e!="string")throw new Error(`${t}: string expected`);return!0}function Wy(t){if(!Number.isSafeInteger(t))throw new Error(`invalid integer: ${t}`)}function ow(t){if(!Array.isArray(t))throw new Error("array expected")}function cw(t,e){if(!wY(!0,e))throw new Error(`${t}: array of strings expected`)}function EY(t,e){if(!wY(!1,e))throw new Error(`${t}: array of numbers expected`)}function xY(...t){const e=s=>s,r=(s,a)=>o=>s(a(o)),n=t.map(s=>s.encode).reduceRight(r,e),i=t.map(s=>s.decode).reduce(r,e);return{encode:n,decode:i}}function _Y(t){const e=typeof t=="string"?t.split(""):t,r=e.length;cw("alphabet",e);const n=new Map(e.map((i,s)=>[i,s]));return{encode:i=>(ow(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=>(ow(i),i.map(s=>{aw("alphabet.decode",s);const a=n.get(s);if(a===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${t}`);return a}))}}function CY(t=""){return aw("join",t),{encode:e=>(cw("join.decode",e),e.join(t)),decode:e=>(aw("join.decode",e),e.split(t))}}function BSe(t,e="="){return Wy(t),aw("padding",e),{encode(r){for(cw("padding.encode",r);r.length*t%8;)r.push(e);return r},decode(r){cw("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 IM(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(ow(t),!t.length)return[];let n=0;const i=[],s=Array.from(t,o=>{if(Wy(o),o<0||o>=e)throw new Error(`invalid integer: ${o}`);return o}),a=s.length;for(;;){let o=0,c=!0;for(let l=n;l<a;l++){const u=s[l],d=e*o,f=d+u;if(!Number.isSafeInteger(f)||d/e!==o||f-u!==d)throw new Error("convertRadix: carry overflow");const h=f/r;o=f%r;const g=Math.floor(h);if(s[l]=g,!Number.isSafeInteger(g)||g*r+o!==f)throw new Error("convertRadix: carry overflow");if(c)g?c=!1:n=l;else continue}if(i.push(o),c)break}for(let o=0;o<t.length-1&&t[o]===0;o++)i.push(0);return i.reverse()}const SY=(t,e)=>e===0?t:SY(e,t%e),lw=(t,e)=>t+(e-SY(t,e)),vE=(()=>{let t=[];for(let e=0;e<40;e++)t.push(2**e);return t})();function kM(t,e,r,n){if(ow(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(lw(e,r)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${lw(e,r)}`);let i=0,s=0;const a=vE[e],o=vE[r]-1,c=[];for(const l of t){if(Wy(l),l>=a)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&o)>>>0);const u=vE[s];if(u===void 0)throw new Error("invalid carry");i&=u-1}if(i=i<<r-s&o,!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>>>0),c}function qSe(t){Wy(t);const e=2**8;return{encode:r=>{if(!vY(r))throw new Error("radix.encode input should be Uint8Array");return IM(Array.from(r),e,t)},decode:r=>(EY("radix.decode",r),Uint8Array.from(IM(r,t,e)))}}function WSe(t,e=!1){if(Wy(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(lw(8,t)>32||lw(t,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!vY(r))throw new Error("radix2.encode input should be Uint8Array");return kM(Array.from(r),8,t,!e)},decode:r=>(EY("radix2.decode",r),Uint8Array.from(kM(r,t,8,e)))}}const zSe=xY(WSe(5),_Y("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),BSe(5),CY("")),VSe=t=>xY(qSe(58),_Y(t),CY("")),zy=VSe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function HSe(t){return OSe(GSe(t))}function GSe(t){const{payload:e,signature:r}=t,{r:n,s:i,yParity:s}=r,o=new wA.Signature(BigInt(n),BigInt(i)).addRecoveryBit(s).recoverPublicKey(uT(e).substring(2));return CSe(o)}function KSe(t){const e=t.length;let r=0,n=0;for(;n<e;){let i=t.charCodeAt(n++);if((i&4294967168)===0){r++;continue}else if((i&4294965248)===0)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)===0?r+=3:r+=4}}return r}function QSe(t,e,r){const n=t.length;let i=r,s=0;for(;s<n;){let a=t.charCodeAt(s++);if((a&4294967168)===0){e[i++]=a;continue}else if((a&4294965248)===0)e[i++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&s<n){const o=t.charCodeAt(s);(o&64512)===56320&&(++s,a=((a&1023)<<10)+(o&1023)+65536)}(a&4294901760)===0?(e[i++]=a>>12&15|224,e[i++]=a>>6&63|128):(e[i++]=a>>18&7|240,e[i++]=a>>12&63|128,e[i++]=a>>6&63|128)}e[i++]=a&63|128}}const YSe=new TextEncoder,ZSe=50;function XSe(t,e,r){YSe.encodeInto(t,e.subarray(r))}function JSe(t,e,r){t.length>ZSe?XSe(t,e,r):QSe(t,e,r)}const eAe=4096;function AY(t,e,r){let n=e;const i=n+r,s=[];let a="";for(;n<i;){const o=t[n++];if((o&128)===0)s.push(o);else if((o&224)===192){const c=t[n++]&63;s.push((o&31)<<6|c)}else if((o&240)===224){const c=t[n++]&63,l=t[n++]&63;s.push((o&31)<<12|c<<6|l)}else if((o&248)===240){const c=t[n++]&63,l=t[n++]&63,u=t[n++]&63;let d=(o&7)<<18|c<<12|l<<6|u;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(o);s.length>=eAe&&(a+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(a+=String.fromCharCode(...s)),a}const tAe=new TextDecoder,rAe=200;function nAe(t,e,r){const n=t.subarray(e,e+r);return tAe.decode(n)}function iAe(t,e,r){return r>rAe?nAe(t,e,r):AY(t,e,r)}class Y2{constructor(e,r){Gt(this,"type");Gt(this,"data");this.type=e,this.data=r}}class ea extends Error{constructor(e){super(e);const r=Object.create(ea.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:ea.name})}}const Bg=4294967295;function sAe(t,e,r){const n=r/4294967296,i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function TY(t,e,r){const n=Math.floor(r/4294967296),i=r;t.setUint32(e,n),t.setUint32(e+4,i)}function IY(t,e){const r=t.getInt32(e),n=t.getUint32(e+4);return r*4294967296+n}function aAe(t,e){const r=t.getUint32(e),n=t.getUint32(e+4);return r*4294967296+n}const oAe=-1,cAe=4294967296-1,lAe=17179869184-1;function uAe({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=lAe)if(e===0&&t<=cAe){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),TY(n,4,t),r}}function dAe(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 fAe(t){if(t instanceof Date){const e=dAe(t);return uAe(e)}else return null}function hAe(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=IY(e,4),n=e.getUint32(0);return{sec:r,nsec:n}}default:throw new ea(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function pAe(t){const e=hAe(t);return new Date(e.sec*1e3+e.nsec/1e6)}const gAe={type:oAe,encode:fAe,decode:pAe},Mw=class Mw{constructor(){Gt(this,"__brand");Gt(this,"builtInEncoders",[]);Gt(this,"builtInDecoders",[]);Gt(this,"encoders",[]);Gt(this,"decoders",[]);this.register(gAe)}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 a=-1-n;return new Y2(a,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 a=n;return new Y2(a,s)}}}return e instanceof Y2?e:null}decode(e,r,n){const i=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return i?i(e,r,n):new Y2(r,e)}};Gt(Mw,"defaultCodec",new Mw);let uw=Mw;function mAe(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function b7(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):mAe(t)?new Uint8Array(t):Uint8Array.from(t)}const yAe=100,bAe=2048;let vAe=class kY{constructor(e){Gt(this,"extensionCodec");Gt(this,"context");Gt(this,"useBigInt64");Gt(this,"maxDepth");Gt(this,"initialBufferSize");Gt(this,"sortKeys");Gt(this,"forceFloat32");Gt(this,"ignoreUndefined");Gt(this,"forceIntegerToFloat");Gt(this,"pos");Gt(this,"view");Gt(this,"bytes");Gt(this,"entered",!1);this.extensionCodec=(e==null?void 0:e.extensionCodec)??uw.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)??yAe,this.initialBufferSize=(e==null?void 0:e.initialBufferSize)??bAe,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 kY({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=KSe(e);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),JSe(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=b7(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 a=e[s];this.ignoreUndefined&&a===void 0||(this.encodeString(s),this.doEncode(a,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),sAe(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),TY(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 wAe(t,e){return new vAe(e).encodeSharedRef(t)}function wE(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const EAe=16,xAe=16;class _Ae{constructor(e=EAe,r=xAe){Gt(this,"hit",0);Gt(this,"miss",0);Gt(this,"caches");Gt(this,"maxKeyLength");Gt(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 a=s.bytes;for(let o=0;o<n;o++)if(a[o]!==e[r+o])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=AY(e,r,n),a=Uint8Array.prototype.slice.call(e,r,r+n);return this.store(a,s),s}}const v7="array",k1="map_key",$Y="map_value",CAe=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new ea("The type of key must be string or number but "+typeof t)};class SAe{constructor(){Gt(this,"stack",[]);Gt(this,"stackHeadPosition",-1)}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const r=this.getUninitializedStateFromPool();r.type=v7,r.position=0,r.size=e,r.array=new Array(e)}pushMapState(e){const r=this.getUninitializedStateFromPool();r.type=k1,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===v7){const n=e;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(e.type===k1||e.type===$Y){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 qg=-1,dT=new DataView(new ArrayBuffer(0)),AAe=new Uint8Array(dT.buffer);try{dT.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 $M=new RangeError("Insufficient data"),TAe=new _Ae;let IAe=class NY{constructor(e){Gt(this,"extensionCodec");Gt(this,"context");Gt(this,"useBigInt64");Gt(this,"rawStrings");Gt(this,"maxStrLength");Gt(this,"maxBinLength");Gt(this,"maxArrayLength");Gt(this,"maxMapLength");Gt(this,"maxExtLength");Gt(this,"keyDecoder");Gt(this,"mapKeyConverter");Gt(this,"totalPos",0);Gt(this,"pos",0);Gt(this,"view",dT);Gt(this,"bytes",AAe);Gt(this,"headByte",qg);Gt(this,"stack",new SAe);Gt(this,"entered",!1);this.extensionCodec=(e==null?void 0:e.extensionCodec)??uw.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)??Bg,this.maxBinLength=(e==null?void 0:e.maxBinLength)??Bg,this.maxArrayLength=(e==null?void 0:e.maxArrayLength)??Bg,this.maxMapLength=(e==null?void 0:e.maxMapLength)??Bg,this.maxExtLength=(e==null?void 0:e.maxExtLength)??Bg,this.keyDecoder=(e==null?void 0:e.keyDecoder)!==void 0?e.keyDecoder:TAe,this.mapKeyConverter=(e==null?void 0:e.mapKeyConverter)??CAe}clone(){return new NY({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=qg,this.stack.reset()}setBuffer(e){const r=b7(e);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===qg&&!this.hasRemaining(1))this.setBuffer(e);else{const r=this.bytes.subarray(this.pos),n=b7(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 o of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(o);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:a}=this;throw new RangeError(`Insufficient data in parsing ${wE(i)} at ${a} (${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(a){if(!(a instanceof RangeError))throw a}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 ea(`Unrecognized type byte: ${wE(e)}`);this.complete();const n=this.stack;for(;n.length>0;){const i=n.top();if(i.type===v7)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===k1){if(r==="__proto__")throw new ea("The key __proto__ is not allowed");i.key=this.mapKeyConverter(r),i.type=$Y;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=k1;continue e}}return r}}readHeadByte(){return this.headByte===qg&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=qg}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 ea(`Unrecognized array type byte: ${wE(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new ea(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new ea(`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 ea(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+e)throw $M;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=iAe(this.bytes,n,e),this.pos+=r+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===k1:!1}decodeBinary(e,r){if(e>this.maxBinLength)throw new ea(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+r))throw $M;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 ea(`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=aAe(this.view,this.pos);return this.pos+=8,e}readI64(){const e=IY(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 kAe(t,e){return new IAe(e).decode(t)}const $Ae=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),NAe=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 Ff(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return NAe(t)}catch{return t}}function Uf(t){return typeof t=="string"?t:$Ae(t)||""}function PAe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function PY(t,...e){if(!PAe(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 NM(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 OAe(t,e){PY(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Ih=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const EE=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);function RAe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function OY(t){return typeof t=="string"&&(t=RAe(t)),PY(t),t}let DAe=class{clone(){return this._cloneInto()}};function MAe(t){const e=n=>t().update(OY(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function RY(t=32){if(Ih&&typeof Ih.getRandomValues=="function")return Ih.getRandomValues(new Uint8Array(t));if(Ih&&typeof Ih.randomBytes=="function")return Ih.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function jAe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+l,o,n)}let LAe=class extends DAe{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=EE(this.buffer)}update(e){NM(this);const{view:r,buffer:n,blockLen:i}=this;e=OY(e);const s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const c=EE(e);for(;i<=s-a;a+=i)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){NM(this),OAe(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(n,0),a=0);for(let d=a;d<i;d++)r[d]=0;jAe(n,i-8,BigInt(this.length*8),s),this.process(n,0);const o=EE(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 d=0;d<l;d++)o.setUint32(4*d,u[d],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:a,pos:o}=this;return e.length=i,e.pos=o,e.finished=s,e.destroyed=a,i%r&&e.buffer.set(n),e}};const Z2=BigInt(2**32-1),w7=BigInt(32);function DY(t,e=!1){return e?{h:Number(t&Z2),l:Number(t>>w7&Z2)}:{h:Number(t>>w7&Z2)|0,l:Number(t&Z2)|0}}function FAe(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:a}=DY(t[i],e);[r[i],n[i]]=[s,a]}return[r,n]}const UAe=(t,e)=>BigInt(t>>>0)<<w7|BigInt(e>>>0),BAe=(t,e,r)=>t>>>r,qAe=(t,e,r)=>t<<32-r|e>>>r,WAe=(t,e,r)=>t>>>r|e<<32-r,zAe=(t,e,r)=>t<<32-r|e>>>r,VAe=(t,e,r)=>t<<64-r|e>>>r-32,HAe=(t,e,r)=>t>>>r-32|e<<64-r,GAe=(t,e)=>e,KAe=(t,e)=>t,QAe=(t,e,r)=>t<<r|e>>>32-r,YAe=(t,e,r)=>e<<r|t>>>32-r,ZAe=(t,e,r)=>e<<r-32|t>>>64-r,XAe=(t,e,r)=>t<<r-32|e>>>64-r;function JAe(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const eTe=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),tTe=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,rTe=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),nTe=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,iTe=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),sTe=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,mr={fromBig:DY,split:FAe,toBig:UAe,shrSH:BAe,shrSL:qAe,rotrSH:WAe,rotrSL:zAe,rotrBH:VAe,rotrBL:HAe,rotr32H:GAe,rotr32L:KAe,rotlSH:QAe,rotlSL:YAe,rotlBH:ZAe,rotlBL:XAe,add:JAe,add3L:eTe,add3H:tTe,add4L:rTe,add4H:nTe,add5H:sTe,add5L:iTe},[aTe,oTe]=mr.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
4395771202a","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))),Xl=new Uint32Array(80),Jl=new Uint32Array(80);class cTe extends LAe{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}
vendor: 4,831 bytes, line 439
439get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:a,Dh:o,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:g,Hh:m,Hl:y}=this;return[e,r,n,i,s,a,o,c,l,u,d,f,h,g,m,y]}set(e,r,n,i,s,a,o,c,l,u,d,f,h,g,m,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=g|0,this.Hh=m|0,this.Hl=y|0}process(e,r){for(let v=0;v<16;v++,r+=4)Xl[v]=e.getUint32(r),Jl[v]=e.getUint32(r+=4);for(let v=16;v<80;v++){const w=Xl[v-15]|0,x=Jl[v-15]|0,_=mr.rotrSH(w,x,1)^mr.rotrSH(w,x,8)^mr.shrSH(w,x,7),S=mr.rotrSL(w,x,1)^mr.rotrSL(w,x,8)^mr.shrSL(w,x,7),A=Xl[v-2]|0,I=Jl[v-2]|0,$=mr.rotrSH(A,I,19)^mr.rotrBH(A,I,61)^mr.shrSH(A,I,6),P=mr.rotrSL(A,I,19)^mr.rotrBL(A,I,61)^mr.shrSL(A,I,6),j=mr.add4L(S,P,Jl[v-7],Jl[v-16]),L=mr.add4H(j,_,$,Xl[v-7],Xl[v-16]);Xl[v]=L|0,Jl[v]=j|0}let{Ah:n,Al:i,Bh:s,Bl:a,Ch:o,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:g,Gh:m,Gl:y,Hh:b,Hl:E}=this;for(let v=0;v<80;v++){const w=mr.rotrSH(d,f,14)^mr.rotrSH(d,f,18)^mr.rotrBH(d,f,41),x=mr.rotrSL(d,f,14)^mr.rotrSL(d,f,18)^mr.rotrBL(d,f,41),_=d&h^~d&m,S=f&g^~f&y,A=mr.add5L(E,x,S,oTe[v],Jl[v]),I=mr.add5H(A,b,w,_,aTe[v],Xl[v]),$=A|0,P=mr.rotrSH(n,i,28)^mr.rotrBH(n,i,34)^mr.rotrBH(n,i,39),j=mr.rotrSL(n,i,28)^mr.rotrBL(n,i,34)^mr.rotrBL(n,i,39),L=n&s^n&o^s&o,B=i&a^i&c^a&c;b=m|0,E=y|0,m=h|0,y=g|0,h=d|0,g=f|0,{h:d,l:f}=mr.add(l|0,u|0,I|0,$|0),l=o|0,u=c|0,o=s|0,c=a|0,s=n|0,a=i|0;const k=mr.add3L($,j,B);n=mr.add3H(k,I,P,L),i=k|0}({h:n,l:i}=mr.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:a}=mr.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:o,l:c}=mr.add(this.Ch|0,this.Cl|0,o|0,c|0),{h:l,l:u}=mr.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=mr.add(this.Eh|0,this.El|0,d|0,f|0),{h,l:g}=mr.add(this.Fh|0,this.Fl|0,h|0,g|0),{h:m,l:y}=mr.add(this.Gh|0,this.Gl|0,m|0,y|0),{h:b,l:E}=mr.add(this.Hh|0,this.Hl|0,b|0,E|0),this.set(n,i,s,a,o,c,l,u,d,f,h,g,m,y,b,E)}roundClean(){Xl.fill(0),Jl.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 lTe=MAe(()=>new cTe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const fT=BigInt(0),MY=BigInt(1),uTe=BigInt(2);function hT(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function pT(t){if(!hT(t))throw new Error("Uint8Array expected")}function xE(t,e){if(typeof e!="boolean")throw new Error(t+" boolean expected, got "+e)}const dTe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function gT(t){pT(t);let e="";for(let r=0;r<t.length;r++)e+=dTe[t[r]];return e}function jY(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?fT:BigInt("0x"+t)}const Mc={_0:48,_9:57,A:65,F:70,a:97,f:102};function PM(t){if(t>=Mc._0&&t<=Mc._9)return t-Mc._0;if(t>=Mc.A&&t<=Mc.F)return t-(Mc.A-10);if(t>=Mc.a&&t<=Mc.f)return t-(Mc.a-10)}function LY(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 a=PM(t.charCodeAt(s)),o=PM(t.charCodeAt(s+1));if(a===void 0||o===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]=a*16+o}return n}function fTe(t){return jY(gT(t))}function Kb(t){return pT(t),jY(gT(Uint8Array.from(t).reverse()))}function FY(t,e){return LY(t.toString(16).padStart(e*2,"0"))}function E7(t,e){return FY(t,e).reverse()}function jc(t,e,r){let n;if(typeof e=="string")try{n=LY(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(hT(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 OM(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];pT(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 _E=t=>typeof t=="bigint"&&fT<=t;function hTe(t,e,r){return _E(t)&&_E(e)&&_E(r)&&e<=t&&t<r}function Wg(t,e,r,n){if(!hTe(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function pTe(t){let e;for(e=0;t>fT;t>>=MY,e+=1);return e}const gTe=t=>(uTe<<BigInt(t-1))-MY,mTe={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"||hT(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 mT(t,e,r={}){const n=(i,s,a)=>{const o=mTe[s];if(typeof o!="function")throw new Error("invalid validator function");const c=t[i];if(!(a&&c===void 0)&&!o(c,t))throw new Error("param "+String(i)+" is invali
439d. 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 RM(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 Ci=BigInt(0),Wn=BigInt(1),Wd=BigInt(2),yTe=BigInt(3),x7=BigInt(4),DM=BigInt(5),MM=BigInt(8);function oi(t,e){const r=t%e;return r>=Ci?r:e+r}function bTe(t,e,r){if(e<Ci)throw new Error("invalid exponent, negatives unsupported");if(r<=Ci)throw new Error("invalid modulus");if(r===Wn)return Ci;let n=Wn;for(;e>Ci;)e&Wn&&(n=n*t%r),t=t*t%r,e>>=Wn;return n}function Uo(t,e,r){let n=t;for(;e-- >Ci;)n*=n,n%=r;return n}function jM(t,e){if(t===Ci)throw new Error("invert: expected non-zero number");if(e<=Ci)throw new Error("invert: expected positive modulus, got "+e);let r=oi(t,e),n=e,i=Ci,s=Wn;for(;r!==Ci;){const a=n/r,o=n%r,c=i-s*a;n=r,r=o,i=s,s=c}if(n!==Wn)throw new Error("invert: does not exist");return oi(i,e)}function vTe(t){const e=(t-Wn)/Wd;let r,n,i;for(r=t-Wn,n=0;r%Wd===Ci;r/=Wd,n++);for(i=Wd;i<t&&bTe(i,e,t)!==t-Wn;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const a=(t+Wn)/x7;return function(o,c){const l=o.pow(c,a);if(!o.eql(o.sqr(l),c))throw new Error("Cannot find square root");return l}}const s=(r+Wn)/Wd;return function(a,o){if(a.pow(o,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let c=n,l=a.pow(a.mul(a.ONE,i),r),u=a.pow(o,s),d=a.pow(o,r);for(;!a.eql(d,a.ONE);){if(a.eql(d,a.ZERO))return a.ZERO;let f=1;for(let g=a.sqr(d);f<c&&!a.eql(g,a.ONE);f++)g=a.sqr(g);const h=a.pow(l,Wn<<BigInt(c-f-1));l=a.sqr(h),u=a.mul(u,h),d=a.mul(d,l),c=f}return u}}function wTe(t){if(t%x7===yTe){const e=(t+Wn)/x7;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%MM===DM){const e=(t-DM)/MM;return function(r,n){const i=r.mul(n,Wd),s=r.pow(i,e),a=r.mul(n,s),o=r.mul(r.mul(a,Wd),s),c=r.mul(a,r.sub(o,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return vTe(t)}const ETe=(t,e)=>(oi(t,e)&Wn)===Wn,xTe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function _Te(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=xTe.reduce((n,i)=>(n[i]="function",n),e);return mT(t,r)}function CTe(t,e,r){if(r<Ci)throw new Error("invalid exponent, negatives unsupported");if(r===Ci)return t.ONE;if(r===Wn)return e;let n=t.ONE,i=e;for(;r>Ci;)r&Wn&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Wn;return n}function STe(t,e){const r=new Array(e.length),n=e.reduce((s,a,o)=>t.is0(a)?s:(r[o]=s,t.mul(s,a)),t.ONE),i=t.inv(n);return e.reduceRight((s,a,o)=>t.is0(a)?s:(r[o]=t.mul(s,r[o]),t.mul(s,a)),i),r}function UY(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function BY(t,e,r=!1,n={}){if(t<=Ci)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:s}=UY(t,e);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const o=Object.freeze({ORDER:t,isLE:r,BITS:i,BYTES:s,MASK:gTe(i),ZERO:Ci,ONE:Wn,create:c=>oi(c,t),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Ci<=c&&c<t},is0:c=>c===Ci,isOdd:c=>(c&Wn)===Wn,neg:c=>oi(-c,t),eql:(c,l)=>c===l,sqr:c=>oi(c*c,t),add:(c,l)=>oi(c+l,t),sub:(c,l)=>oi(c-l,t),mul:(c,l)=>oi(c*l,t),pow:(c,l)=>CTe(o,c,l),div:(c,l)=>oi(c*jM(l,t),t),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>jM(c,t),sqrt:n.sqrt||(c=>(a||(a=wTe(t)),a(o,c))),invertBatch:c=>STe(o,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>r?E7(c,s):FY(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?Kb(c):fTe(c)}});return Object.freeze(o)}const LM=BigInt(0),X2=BigInt(1);function CE(t,e){const r=e.negate();return t?r:e}function qY(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function SE(t,e){qY(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function ATe(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 TTe(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 AE=new WeakMap,WY=new WeakMap;function TE(t){return WY.get(t)||1}function ITe(t,e){return{constTimeNegate:CE,hasPrecomputes(r){return TE(r)!==1},unsafeLadder(r,n,i=t.ZERO){let s=r;for(;n>LM;)n&X2&&(i=i.add(s)),s=s.double(),n>>=X2;return i},precomputeWindow(r,n){const{windows:i,windowSize:s}=SE(n,e),a=[];let o=r,c=o;for(let l=0;l<i;l++){c=o,a.push(c);for(let u=1;u<s;u++)c=c.add(o),a.push(c);o=c.double()}return a},wNAF(r,n,i){const{windows:s,windowSize:a}=SE(r,e);let o=t.ZERO,c=t.BASE;const l=BigInt(2**r-1),u=2**r,d=BigInt(r);for(let f=0;f<s;f++){const h=f*a;let g=Number(i&l);i>>=d,g>a&&(g-=u,i+=X2);const m=h,y=h+Math.abs(g)-1,b=f%2!==0,E=g<0;
vendor: 5,077 bytes, line 439
439g===0?c=c.add(CE(b,n[m])):o=o.add(CE(E,n[y]))}return{p:o,f:c}},wNAFUnsafe(r,n,i,s=t.ZERO){const{windows:a,windowSize:o}=SE(r,e),c=BigInt(2**r-1),l=2**r,u=BigInt(r);for(let d=0;d<a;d++){const f=d*o;if(i===LM)break;let h=Number(i&c);if(i>>=u,h>o&&(h-=l,i+=X2),h===0)continue;let g=n[f+Math.abs(h)-1];h<0&&(g=g.negate()),s=s.add(g)}return s},getPrecomputes(r,n,i){let s=AE.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&AE.set(n,i(s))),s},wNAFCached(r,n,i){const s=TE(r);return this.wNAF(s,this.getPrecomputes(s,r,i),n)},wNAFCachedUnsafe(r,n,i,s){const a=TE(r);return a===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(a,this.getPrecomputes(a,r,i),n,s)},setWindowSize(r,n){qY(n,e),WY.set(r,n),AE.delete(r)}}}function kTe(t,e,r,n){if(ATe(r,t),TTe(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,s=pTe(BigInt(r.length)),a=s>12?s-3:s>4?s-2:s?2:1,o=(1<<a)-1,c=new Array(o+1).fill(i),l=Math.floor((e.BITS-1)/a)*a;let u=i;for(let d=l;d>=0;d-=a){c.fill(i);for(let h=0;h<n.length;h++){const g=n[h],m=Number(g>>BigInt(d)&BigInt(o));c[m]=c[m].add(r[h])}let f=i;for(let h=c.length-1,g=i;h>0;h--)g=g.add(c[h]),f=f.add(g);if(u=u.add(f),d!==0)for(let h=0;h<a;h++)u=u.double()}return u}function $Te(t){return _Te(t.Fp),mT(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...UY(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}const Ya=BigInt(0),Cs=BigInt(1),J2=BigInt(2),NTe=BigInt(8),PTe={zip215:!0};function OTe(t){const e=$Te(t);return mT(t,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...e})}function RTe(t){const e=OTe(t),{Fp:r,n,prehash:i,hash:s,randomBytes:a,nByteLength:o,h:c}=e,l=J2<<BigInt(o*8)-Cs,u=r.create,d=BY(e.n,e.nBitLength),f=e.uvRatio||((k,D)=>{try{return{isValid:!0,value:r.sqrt(k*r.inv(D))}}catch{return{isValid:!1,value:Ya}}}),h=e.adjustScalarBytes||(k=>k),g=e.domain||((k,D,q)=>{if(xE("phflag",q),D.length||q)throw new Error("Contexts/pre-hash are not supported");return k});function m(k,D){Wg("coordinate "+k,D,Ya,l)}function y(k){if(!(k instanceof v))throw new Error("ExtendedPoint expected")}const b=RM((k,D)=>{const{ex:q,ey:U,ez:W}=k,V=k.is0();D==null&&(D=V?NTe:r.inv(W));const Y=u(q*D),K=u(U*D),ge=u(W*D);if(V)return{x:Ya,y:Cs};if(ge!==Cs)throw new Error("invZ was invalid");return{x:Y,y:K}}),E=RM(k=>{const{a:D,d:q}=e;if(k.is0())throw new Error("bad point: ZERO");const{ex:U,ey:W,ez:V,et:Y}=k,K=u(U*U),ge=u(W*W),ae=u(V*V),ce=u(ae*ae),Q=u(K*D),se=u(ae*u(Q+ge)),me=u(ce+u(q*u(K*ge)));if(se!==me)throw new Error("bad point: equation left != right (1)");const _e=u(U*W),z=u(V*Y);if(_e!==z)throw new Error("bad point: equation left != right (2)");return!0});class v{constructor(D,q,U,W){this.ex=D,this.ey=q,this.ez=U,this.et=W,m("x",D),m("y",q),m("z",U),m("t",W),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(D){if(D instanceof v)throw new Error("extended point not allowed");const{x:q,y:U}=D||{};return m("x",q),m("y",U),new v(q,U,Cs,u(q*U))}static normalizeZ(D){const q=r.invertBatch(D.map(U=>U.ez));return D.map((U,W)=>U.toAffine(q[W])).map(v.fromAffine)}static msm(D,q){return kTe(v,d,D,q)}_setWindowSize(D){_.setWindowSize(this,D)}assertValidity(){E(this)}equals(D){y(D);const{ex:q,ey:U,ez:W}=this,{ex:V,ey:Y,ez:K}=D,ge=u(q*K),ae=u(V*W),ce=u(U*K),Q=u(Y*W);return ge===ae&&ce===Q}is0(){return this.equals(v.ZERO)}negate(){return new v(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:D}=e,{ex:q,ey:U,ez:W}=this,V=u(q*q),Y=u(U*U),K=u(J2*u(W*W)),ge=u(D*V),ae=q+U,ce=u(u(ae*ae)-V-Y),Q=ge+Y,se=Q-K,me=ge-Y,_e=u(ce*se),z=u(Q*me),R=u(ce*me),M=u(se*Q);return new v(_e,z,M,R)}add(D){y(D);const{a:q,d:U}=e,{ex:W,ey:V,ez:Y,et:K}=this,{ex:ge,ey:ae,ez:ce,et:Q}=D;if(q===BigInt(-1)){const Ce=u((V-W)*(ae+ge)),ne=u((V+W)*(ae-ge)),Re=u(ne-Ce);if(Re===Ya)return this.double();const Pe=u(Y*J2*Q),Ae=u(K*J2*ce),Ue=Ae+Pe,He=ne+Ce,Qe=Ae-Pe,O=u(Ue*Re),T=u(He*Qe),N=u(Ue*Qe),G=u(Re*He);return new v(O,T,G,N)}const se=u(W*ge),me=u(V*ae),_e=u(K*U*Q),z=u(Y*ce),R=u((W+V)*(ge+ae)-se-me),M=z-_e,ee=z+_e,ie=u(me-q*se),le=u(R*M),ye=u(ee*ie),fe=u(R*ie),we=u(M*ee);return new v(le,ye,we,fe)}subtract(D){return this.add(D.negate())}wNAF(D){return _.wNAFCached(this,D,v.normalizeZ)}multiply(D){const q=D;Wg("scalar",q,Cs,n);const{p:U,f:W}=this.wNAF(q);return v.normalizeZ([U,W])[0]}multiplyUnsafe(D,q=v.ZERO){const U=D;return Wg("scalar",U,Ya,n),U===Ya?x:this.is0()||U===Cs?this:_.wNAFCachedUnsafe(this,U,v.normalizeZ,q)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return _.unsafeLadder(this,n).is0()}toAffine(D){return b(this,D)}clearCofactor(){const{h:D}=e;return D===Cs?this:this.multiplyUnsafe(D)}static fromHex(D,q=!1){const{d:U,a:W}=e,V=r.BYTES;D=jc("pointHex",D,V),xE("zip215",q);const Y=D.slice(),K=D[V-1];Y[V-1]=K&-129;const ge=Kb(Y),ae=q?l:r.ORDER;Wg("pointHex.y",ge,Ya,ae);const ce=u(ge*ge),Q=u(ce-Cs),se=u(U*ce-W);let{isValid:me,value:_e}=f(Q,se);
vendor: 10,357 bytes, line 439
439if(!me)throw new Error("Point.fromHex: invalid y coordinate");const z=(_e&Cs)===Cs,R=(K&128)!==0;if(!q&&_e===Ya&&R)throw new Error("Point.fromHex: x=0 and x_0=1");return R!==z&&(_e=u(-_e)),v.fromAffine({x:_e,y:ge})}static fromPrivateKey(D){return I(D).point}toRawBytes(){const{x:D,y:q}=this.toAffine(),U=E7(q,r.BYTES);return U[U.length-1]|=D&Cs?128:0,U}toHex(){return gT(this.toRawBytes())}}v.BASE=new v(e.Gx,e.Gy,Cs,u(e.Gx*e.Gy)),v.ZERO=new v(Ya,Cs,Cs,Ya);const{BASE:w,ZERO:x}=v,_=ITe(v,o*8);function S(k){return oi(k,n)}function A(k){return S(Kb(k))}function I(k){const D=r.BYTES;k=jc("private key",k,D);const q=jc("hashed private key",s(k),2*D),U=h(q.slice(0,D)),W=q.slice(D,2*D),V=A(U),Y=w.multiply(V),K=Y.toRawBytes();return{head:U,prefix:W,scalar:V,point:Y,pointBytes:K}}function $(k){return I(k).pointBytes}function P(k=new Uint8Array,...D){const q=OM(...D);return A(s(g(q,jc("context",k),!!i)))}function j(k,D,q={}){k=jc("message",k),i&&(k=i(k));const{prefix:U,scalar:W,pointBytes:V}=I(D),Y=P(q.context,U,k),K=w.multiply(Y).toRawBytes(),ge=P(q.context,K,V,k),ae=S(Y+ge*W);Wg("signature.s",ae,Ya,n);const ce=OM(K,E7(ae,r.BYTES));return jc("result",ce,r.BYTES*2)}const L=PTe;function B(k,D,q,U=L){const{context:W,zip215:V}=U,Y=r.BYTES;k=jc("signature",k,2*Y),D=jc("message",D),q=jc("publicKey",q,Y),V!==void 0&&xE("zip215",V),i&&(D=i(D));const K=Kb(k.slice(Y,2*Y));let ge,ae,ce;try{ge=v.fromHex(q,V),ae=v.fromHex(k.slice(0,Y),V),ce=w.multiplyUnsafe(K)}catch{return!1}if(!V&&ge.isSmallOrder())return!1;const Q=P(W,ae.toRawBytes(),ge.toRawBytes(),D);return ae.add(ge.multiplyUnsafe(Q)).subtract(ce).clearCofactor().equals(v.ZERO)}return w._setWindowSize(8),{CURVE:e,getPublicKey:$,sign:j,verify:B,ExtendedPoint:v,utils:{getExtendedPublicKey:I,randomPrivateKey:()=>a(r.BYTES),precompute(k=8,D=v.BASE){return D._setWindowSize(k),D.multiply(BigInt(3)),D}}}}BigInt(0),BigInt(1);const yT=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),FM=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const DTe=BigInt(1),UM=BigInt(2);BigInt(3);const MTe=BigInt(5),jTe=BigInt(8);function LTe(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=yT,a=t*t%s*t%s,o=Uo(a,UM,s)*a%s,c=Uo(o,DTe,s)*t%s,l=Uo(c,MTe,s)*c%s,u=Uo(l,e,s)*l%s,d=Uo(u,r,s)*u%s,f=Uo(d,n,s)*d%s,h=Uo(f,i,s)*f%s,g=Uo(h,i,s)*f%s,m=Uo(g,e,s)*l%s;return{pow_p_5_8:Uo(m,UM,s)*t%s,b2:a}}function FTe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function UTe(t,e){const r=yT,n=oi(e*e*e,r),i=oi(n*n*e,r),s=LTe(t*i).pow_p_5_8;let a=oi(t*n*s,r);const o=oi(e*a*a,r),c=a,l=oi(a*FM,r),u=o===t,d=o===oi(-t,r),f=o===oi(-t*FM,r);return u&&(a=c),(d||f)&&(a=l),ETe(a,r)&&(a=oi(-a,r)),{isValid:u||d,value:a}}const BTe=BY(yT,void 0,!0),qTe={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:BTe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:jTe,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:lTe,randomBytes:RY,adjustScalarBytes:FTe,uvRatio:UTe},zY=RTe(qTe),WTe="EdDSA",zTe="JWT",dw=".",e5="base64url",VY="utf8",HY="utf8",VTe=":",HTe="did",GTe="key",BM="base58btc",KTe="z",QTe="K36",YTe=32;function bT(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function GY(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?bT(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function KY(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=GY(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return bT(r)}function ZTe(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),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=i}var o=t.length,c=t.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(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 m=0,y=0,b=0,E=g.length;b!==E&&g[b]===0;)b++,m++;for(var v=(E-b)*u+1>>>0,w=new Uint8Array(v);b!==E;){for(var x=g[b],_=0,S=v-1;(x!==0||_<y)&&S!==-1;S--,_++)x+=256*w[S]>>>0,w[S]=x%o>>>0,x=x/o>>>0;if(x!==0)throw new Error("Non-zero carry");y=_,b++}for(var A=v-y;A!==v&&w[A]===0;)A++;for(var I=c.repeat(m);A<v;++A)I+=t.charAt(w[A]);return I}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var m=0;if(g[m]!==" "){for(var y=0,b=0;g[m]===c;)y++,m++;for(var E=(g.length-m)*l+1>>>0,v=new Uint8Array(E);g[m];){var w=r[g.charCodeAt(m)];if(w===255)return;for(var x=0,_=E-1;(w!==0||x<b)&&_!==-1;_--,x++)w+=o*v[_]>>>0,v[_]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");b=x,m++}if(g[m]!==" "){for(var S=E-b;S!==E&&v[S]===0;)S++;for(var A=new Uint8Array(y+(E-S)),I=y;S!==E;)A[I++]=v[S++];return A}}}function h(g){var m=f(g);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var XTe=ZTe,JTe=XTe;const QY=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")},eIe=t=>new TextEncoder().encode(t),tIe=t=>new TextDecoder().decode(t);let rIe=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")}},nIe=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 YY(this,e)}},iIe=class{constructor(e){this.decoders=e}or(e){return YY(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 YY=(t,e)=>new iIe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});let sIe=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new rIe(e,r,n),this.decoder=new nIe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const t5=({name:t,prefix:e,encode:r,decode:n})=>new sIe(t,e,r,n),Vy=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=JTe(r,e);return t5({prefix:t,name:e,encode:n,decode:s=>QY(i(s))})},aIe=(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 a=new Uint8Array(s*r/8|0);let o=0,c=0,l=0;for(let u=0;u<s;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,o+=r,o>=8&&(o-=8,a[l++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return a},oIe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",a=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],a+=8;a>r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s},Ui=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>t5({prefix:e,name:t,encode(i){return oIe(i,n,r)},decode(i){return aIe(i,n,r,t)}}),cIe=t5({prefix:"\0",name:"identity",encode:t=>tIe(t),decode:t=>eIe(t)});var lIe=Object.freeze({__proto__:null,identity:cIe});const uIe=Ui({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var dIe=Object.freeze({__proto__:null,base2:uIe});const fIe=Ui({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var hIe=Object.freeze({__proto__:null,base8:fIe});const pIe=Vy({prefix:"9",name:"base10",alphabet:"0123456789"});var gIe=Object.freeze({__proto__:null,base10:pIe});const mIe=Ui({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),yIe=Ui({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var bIe=Object.freeze({__proto__:null,base16:mIe,base16upper:yIe});const vIe=Ui({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),wIe=Ui({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),EIe=Ui({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),xIe=Ui({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),_Ie=Ui({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),CIe=Ui({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),SIe=Ui({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),AIe=Ui({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),TIe=Ui({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var IIe=Object.freeze({__proto__:null,base32:vIe,base32upper:wIe,base32pad:EIe,base32padupper:xIe,base32hex:_Ie,base32hexupper:CIe,base32hexpad:SIe,base32hexpadupper:AIe,base32z:TIe});const kIe=Vy({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$Ie=Vy({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var NIe=Object.freeze({__proto__:null,base36:kIe,base36upper:$Ie});const PIe=Vy({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OIe=Vy({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var RIe=Object.freeze({__proto__:null,base58btc:PIe,base58flickr:OIe});const DIe=Ui({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
439+/",bitsPerChar:6}),MIe=Ui({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),jIe=Ui({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),LIe=Ui({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var FIe=Object.freeze({__proto__:null,base64:DIe,base64pad:MIe,base64url:jIe,base64urlpad:LIe});const ZY=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),UIe=ZY.reduce((t,e,r)=>(t[r]=e,t),[]),BIe=ZY.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function qIe(t){return t.reduce((e,r)=>(e+=UIe[r],e),"")}function WIe(t){const e=[];for(const r of t){const n=BIe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const zIe=t5({prefix:"ð",name:"base256emoji",encode:qIe,decode:WIe});var VIe=Object.freeze({__proto__:null,base256emoji:zIe}),HIe=XY,qM=128,GIe=-128,KIe=Math.pow(2,31);function XY(t,e,r){e=e||[],r=r||0;for(var n=r;t>=KIe;)e[r++]=t&255|qM,t/=128;for(;t&GIe;)e[r++]=t&255|qM,t>>>=7;return e[r]=t|0,XY.bytes=r-n+1,e}var QIe=_7,YIe=128,WM=127;function _7(t,n){var r=0,n=n||0,i=0,s=n,a,o=t.length;do{if(s>=o)throw _7.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=i<28?(a&WM)<<i:(a&WM)*Math.pow(2,i),i+=7}while(a>=YIe);return _7.bytes=s-n,r}var ZIe=Math.pow(2,7),XIe=Math.pow(2,14),JIe=Math.pow(2,21),eke=Math.pow(2,28),tke=Math.pow(2,35),rke=Math.pow(2,42),nke=Math.pow(2,49),ike=Math.pow(2,56),ske=Math.pow(2,63),ake=function(t){return t<ZIe?1:t<XIe?2:t<JIe?3:t<eke?4:t<tke?5:t<rke?6:t<nke?7:t<ike?8:t<ske?9:10},oke={encode:HIe,decode:QIe,encodingLength:ake},JY=oke;const zM=(t,e,r=0)=>(JY.encode(t,e,r),e),VM=t=>JY.encodingLength(t),C7=(t,e)=>{const r=e.byteLength,n=VM(t),i=n+VM(r),s=new Uint8Array(i+r);return zM(t,s,0),zM(r,s,n),s.set(e,i),new cke(t,r,e,s)};class cke{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const eZ=({name:t,code:e,encode:r})=>new lke(t,e,r);class lke{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?C7(this.code,r):r.then(n=>C7(this.code,n))}else throw Error("Unknown type, must be binary type")}}const tZ=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),uke=eZ({name:"sha2-256",code:18,encode:tZ("SHA-256")}),dke=eZ({name:"sha2-512",code:19,encode:tZ("SHA-512")});var fke=Object.freeze({__proto__:null,sha256:uke,sha512:dke});const rZ=0,hke="identity",nZ=QY,pke=t=>C7(rZ,nZ(t)),gke={code:rZ,name:hke,encode:nZ,digest:pke};var mke=Object.freeze({__proto__:null,identity:gke});new TextEncoder,new TextDecoder;const HM={...lIe,...dIe,...hIe,...gIe,...bIe,...IIe,...NIe,...RIe,...FIe,...VIe};({...fke,...mke});function iZ(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const GM=iZ("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),IE=iZ("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=GY(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),sZ={utf8:GM,"utf-8":GM,hex:HM.base16,latin1:IE,ascii:IE,binary:IE,...HM};function r5(t,e="utf8"){const r=sZ[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 L0(t,e="utf8"){const r=sZ[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?bT(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function KM(t){return Ff(r5(L0(t,e5),VY))}function fw(t){return r5(L0(Uf(t),VY),e5)}
vendor: 8,165 bytes, line 439
439function aZ(t){const e=L0(QTe,BM),r=KTe+r5(KY([e,t]),BM);return[HTe,GTe,r].join(VTe)}function yke(t){return r5(t,e5)}function bke(t){return L0(t,e5)}function vke(t){return L0([fw(t.header),fw(t.payload)].join(dw),HY)}function wke(t){return[fw(t.header),fw(t.payload),yke(t.signature)].join(dw)}function S7(t){const e=t.split(dw),r=KM(e[0]),n=KM(e[1]),i=bke(e[2]),s=L0(e.slice(0,2).join(dw),HY);return{header:r,payload:n,signature:i,data:s}}function QM(t=RY(YTe)){const e=zY.getPublicKey(t);return{secretKey:KY([t,e]),publicKey:e}}async function Eke(t,e,r,n,i=ot.fromMiliseconds(Date.now())){const s={alg:WTe,typ:zTe},a=aZ(n.publicKey),o=i+r,c={iss:a,sub:t,aud:e,iat:i,exp:o},l=vke({header:s,payload:c}),u=zY.sign(l,n.secretKey.slice(0,32));return wke({header:s,payload:c,signature:u})}function vT(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function oZ(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vT(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function $1(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=oZ(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return vT(r)}function xke(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),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=i}var o=t.length,c=t.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(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 m=0,y=0,b=0,E=g.length;b!==E&&g[b]===0;)b++,m++;for(var v=(E-b)*u+1>>>0,w=new Uint8Array(v);b!==E;){for(var x=g[b],_=0,S=v-1;(x!==0||_<y)&&S!==-1;S--,_++)x+=256*w[S]>>>0,w[S]=x%o>>>0,x=x/o>>>0;if(x!==0)throw new Error("Non-zero carry");y=_,b++}for(var A=v-y;A!==v&&w[A]===0;)A++;for(var I=c.repeat(m);A<v;++A)I+=t.charAt(w[A]);return I}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var m=0;if(g[m]!==" "){for(var y=0,b=0;g[m]===c;)y++,m++;for(var E=(g.length-m)*l+1>>>0,v=new Uint8Array(E);g[m];){var w=r[g.charCodeAt(m)];if(w===255)return;for(var x=0,_=E-1;(w!==0||x<b)&&_!==-1;_--,x++)w+=o*v[_]>>>0,v[_]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");b=x,m++}if(g[m]!==" "){for(var S=E-b;S!==E&&v[S]===0;)S++;for(var A=new Uint8Array(y+(E-S)),I=y;S!==E;)A[I++]=v[S++];return A}}}function h(g){var m=f(g);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var _ke=xke,Cke=_ke;const Ske=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")},Ake=t=>new TextEncoder().encode(t),Tke=t=>new TextDecoder().decode(t);class Ike{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 kke{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 cZ(this,e)}}class $ke{constructor(e){this.decoders=e}or(e){return cZ(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 cZ=(t,e)=>new $ke({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Nke{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ike(e,r,n),this.decoder=new kke(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const n5=({name:t,prefix:e,encode:r,decode:n})=>new Nke(t,e,r,n),Hy=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Cke(r,e);return n5({prefix:t,name:e,encode:n,decode:s=>Ske(i(s))})},Pke=(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 a=new Uint8Array(s*r/8|0);let o=0,c=0,l=0;for(let u=0;u<s;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,o+=r,o>=8&&(o-=8,a[l++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return a},Oke=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",a=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],a+=8;a>r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s},Bi=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>n5({prefix:e,name:t,encode(i){return Oke(i,n,r)},decode(i){return Pke(i,n,r,t)}}),Rke=n5({prefix:"\0",name:"identity",encode:t=>Tke(t),decode:t=>Ake(t)}),Dke=Object.freeze(Object.defineProperty({__proto__:null,identity:Rke},Symbol.toStringTag,{value:"Module"})),Mke=Bi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),jke=Object.freeze(Object.defineProperty({__proto__:null,base2:Mke},Symbol.toStringTag,{value:"Module"})),Lke=Bi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Fke=Object.freeze(Object.defineProperty({__proto__:null,base8:Lke},Symbol.toStringTag,{value:"Module"})),Uke=Hy({prefix:"9",name:"base10",alphabet:"0123456789"}),Bke=Object.freeze(Object.defineProperty({__proto__:null,base10:Uke},Symbol.toStringTag,{value:"Module"})),qke=Bi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Wke=Bi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),zke=Object.freeze(Object.defineProperty({__proto__:null,base16:qke,base16upper:Wke},Symbol.toStringTag,{value:"Module"})),Vke=Bi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Hke=Bi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gke=Bi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Kke=Bi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Qke=Bi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yke=Bi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zke=Bi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xke=Bi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Jke=Bi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),e$e=Object.freeze(Object.defineProperty({__proto__:null,base32:Vke,base32hex:Qke,base32hexpad:Zke,base32hexpadupper:Xke,base32hexupper:Yke,base32pad:Gke,base32padupper:Kke,base32upper:Hke,base32z:Jke},Symbol.toStringTag,{value:"Module"})),t$e=Hy({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),r$e=Hy({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),n$e=Object.freeze(Object.defineProperty({__proto__:null,base36:t$e,base36upper:r$e},Symbol.toStringTag,{value:"Module"})),i$e=Hy({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),s$e=Hy({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),a$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:i$e,base58flickr:s$e},Symbol.toStringTag,{value:"Module"})),o$e=Bi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
439+/",bitsPerChar:6}),c$e=Bi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),l$e=Bi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),u$e=Bi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),d$e=Object.freeze(Object.defineProperty({__proto__:null,base64:o$e,base64pad:c$e,base64url:l$e,base64urlpad:u$e},Symbol.toStringTag,{value:"Module"})),lZ=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),f$e=lZ.reduce((t,e,r)=>(t[r]=e,t),[]),h$e=lZ.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function p$e(t){return t.reduce((e,r)=>(e+=f$e[r],e),"")}function g$e(t){const e=[];for(const r of t){const n=h$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const m$e=n5({prefix:"ð",name:"base256emoji",encode:p$e,decode:g$e}),y$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:m$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const YM={...Dke,...jke,...Fke,...Bke,...zke,...e$e,...n$e,...a$e,...d$e,...y$e};function uZ(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const ZM=uZ("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),kE=uZ("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=oZ(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),dZ={utf8:ZM,"utf-8":ZM,hex:YM.base16,latin1:kE,ascii:kE,binary:kE,...YM};function Oa(t,e="utf8"){const r=dZ[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?vT(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function Ls(t,e="utf8"){const r=dZ[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 b$e={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"}};var $E,XM;function fZ(){if(XM)return $E;XM=1;const t="Input must be an string, Buffer or Uint8Array";function e(a){let o;if(a instanceof Uint8Array)o=a;
vendor: 41,173 bytes, lines 439-441
439else if(typeof a=="string")o=new TextEncoder().encode(a);else throw new Error(t);return o}function r(a){return Array.prototype.map.call(a,function(o){return(o<16?"0":"")+o.toString(16)}).join("")}function n(a){return(4294967296+a).toString(16).substring(1)}function i(a,o,c){let l=` 440`+a+" = ";for(let u=0;u<o.length;u+=2){if(c===32)l+=n(o[u]).toUpperCase(),l+=" ",l+=n(o[u+1]).toUpperCase();else if(c===64)l+=n(o[u+1]).toUpperCase(),l+=n(o[u]).toUpperCase();else throw new Error("Invalid size "+c);u%6===4?l+=` 441`+new Array(a.length+4).join(" "):u<o.length-2&&(l+=" ")}console.log(l)}function s(a,o,c){let l=new Date().getTime();const u=new Uint8Array(o);for(let f=0;f<o;f++)u[f]=f%256;const d=new Date().getTime();console.log("Generated random input in "+(d-l)+"ms"),l=d;for(let f=0;f<c;f++){const h=a(u),g=new Date().getTime(),m=g-l;l=g,console.log("Hashed in "+m+"ms: "+h.substring(0,20)+"..."),console.log(Math.round(o/(1<<20)/(m/1e3)*100)/100+" MB PER SECOND")}}return $E={normalizeInput:e,toHex:r,debugPrint:i,testSpeed:s},$E}var NE,JM;function v$e(){if(JM)return NE;JM=1;const t=fZ();function e(b,E,v){const w=b[E]+b[v];let x=b[E+1]+b[v+1];w>=4294967296&&x++,b[E]=w,b[E+1]=x}function r(b,E,v,w){let x=b[E]+v;v<0&&(x+=4294967296);let _=b[E+1]+w;x>=4294967296&&_++,b[E]=x,b[E+1]=_}function n(b,E){return b[E]^b[E+1]<<8^b[E+2]<<16^b[E+3]<<24}function i(b,E,v,w,x,_){const S=l[x],A=l[x+1],I=l[_],$=l[_+1];e(c,b,E),r(c,b,S,A);let P=c[w]^c[b],j=c[w+1]^c[b+1];c[w]=j,c[w+1]=P,e(c,v,w),P=c[E]^c[v],j=c[E+1]^c[v+1],c[E]=P>>>24^j<<8,c[E+1]=j>>>24^P<<8,e(c,b,E),r(c,b,I,$),P=c[w]^c[b],j=c[w+1]^c[b+1],c[w]=P>>>16^j<<16,c[w+1]=j>>>16^P<<16,e(c,v,w),P=c[E]^c[v],j=c[E+1]^c[v+1],c[E]=j>>>31^P<<1,c[E+1]=P>>>31^j<<1}const s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),a=[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],o=new Uint8Array(a.map(function(b){return b*2})),c=new Uint32Array(32),l=new Uint32Array(32);function u(b,E){let v=0;for(v=0;v<16;v++)c[v]=b.h[v],c[v+16]=s[v];for(c[24]=c[24]^b.t,c[25]=c[25]^b.t/4294967296,E&&(c[28]=~c[28],c[29]=~c[29]),v=0;v<32;v++)l[v]=n(b.b,4*v);for(v=0;v<12;v++)i(0,8,16,24,o[v*16+0],o[v*16+1]),i(2,10,18,26,o[v*16+2],o[v*16+3]),i(4,12,20,28,o[v*16+4],o[v*16+5]),i(6,14,22,30,o[v*16+6],o[v*16+7]),i(0,10,20,30,o[v*16+8],o[v*16+9]),i(2,12,22,24,o[v*16+10],o[v*16+11]),i(4,14,16,26,o[v*16+12],o[v*16+13]),i(6,8,18,28,o[v*16+14],o[v*16+15]);for(v=0;v<16;v++)b.h[v]=b.h[v]^c[v]^c[v+16]}const d=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 f(b,E,v,w){if(b===0||b>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(v&&v.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(w&&w.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const x={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:b};d.fill(0),d[0]=b,E&&(d[1]=E.length),d[2]=1,d[3]=1,v&&d.set(v,32),w&&d.set(w,48);for(let _=0;_<16;_++)x.h[_]=s[_]^n(d,_*4);return E&&(h(x,E),x.c=128),x}function h(b,E){for(let v=0;v<E.length;v++)b.c===128&&(b.t+=b.c,u(b,!1),b.c=0),b.b[b.c++]=E[v]}function g(b){for(b.t+=b.c;b.c<128;)b.b[b.c++]=0;u(b,!0);const E=new Uint8Array(b.outlen);for(let v=0;v<b.outlen;v++)E[v]=b.h[v>>2]>>8*(v&3);return E}function m(b,E,v,w,x){v=v||64,b=t.normalizeInput(b),w&&(w=t.normalizeInput(w)),x&&(x=t.normalizeInput(x));const _=f(v,E,w,x);return h(_,b),g(_)}function y(b,E,v,w,x){const _=m(b,E,v,w,x);return t.toHex(_)}return NE={blake2b:m,blake2bHex:y,blake2bInit:f,blake2bUpdate:h,blake2bFinal:g},NE}var PE,ej;function w$e(){if(ej)return PE;ej=1;const t=fZ();function e(g,m){return g[m]^g[m+1]<<8^g[m+2]<<16^g[m+3]<<24}function r(g,m,y,b,E,v){a[g]=a[g]+a[m]+E,a[b]=n(a[b]^a[g],16),a[y]=a[y]+a[b],a[m]=n(a[m]^a[y],12),a[g]=a[g]+a[m]+v,a[b]=n(a[b]^a[g],8),a[y]=a[y]+a[b],a[m]=n(a[m]^a[y],7)}function n(g,m){return g>>>m^g<<32-m}const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),s=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]),a=new Uint32Array(16),o=new Uint32Array(16);function c(g,m){let y=0;for(y=0;y<8;y++)a[y]=g.h[y],a[y+8]=i[y];for(a[12]^=g.t,a[13]^=g.t/4294967296,m&&(a[14]=~a[14]),y=0;y<16;y++)o[y]=e(g.b,4*y);for(y=0;y<10;y++)r(0,4,8,12,o[s[y*16+0]],o[s[y*16+1]]),r(1,5,9,13,o[s[y*16+2]],o[s[y*16+3]]),r(2,6,10,14,o[s[y*16+4]],o[s[y*16+5]]),r(3,7,11,15,o[s[y*16+6]],o[s[y*16+7]]),r(0,5,10,15,o[s[y*16+8]],o[s[y*16+9]]),r(1,6,11,12,o[s[y*16+10]],o[s[y*16+11]]),r(2,7,8,13,o[s[y*16+12]],o[s[y*16+13]]),r(3,4,9,14,o[s[y*16+14]],o[s[y*16+15]]);for(y=0;y<8;y++)g.h[y]^=a[y]^a[y+8]}function l(g,m){if(!(g>0&&g<=32))throw new Error("Incorrect output length, should be in [1, 32]");const y=m?m.length:0;if(m&&!(y>0&&y<=32))throw new Error("Incorrect key length, should be in [1, 32]");const b={h:new Uint32Array(i),b:new Uint8Array(64),c:0,t:0,outlen:g};return b.h[0]^=16842752^y<<8^g,y>0&&(u(b,m),b.c=64),b}function u(g,m){for(let y=0;y<m.length;y++)g.c===64&&(g.t+=g.c,c(g,!1),g.c=0),g.b[g.c++]=m[y]}function d(g){for(g.t+=g.c;g.c<64;)g.b[g.c++]=0;c(g,!0);const m=new Uint8Array(g.outlen);for(let y=0;y<g.outlen;y++)m[y]=g.h[y>>2]>>8*(y&3)&255;return m}function f(g,m,y){y=y||32,g=t.normalizeInput(g);const b=l(y,m);return u(b,g),d(b)}function h(g,m,y){const b=f(g,m,y);return t.toHex(b)}return PE={blake2s:f,blake2sHex:h,blake2sInit:l,blake2sUpdate:u,blake2sFinal:d},PE}var OE,tj;function E$e(){if(tj)return OE;tj=1;const t=v$e(),e=w$e();return OE={blake2b:t.blake2b,blake2bHex:t.blake2bHex,blake2bInit:t.blake2bInit,blake2bUpdate:t.blake2bUpdate,blake2bFinal:t.blake2bFinal,blake2s:e.blake2s,blake2sHex:e.blake2sHex,blake2sInit:e.blake2sInit,blake2sUpdate:e.blake2sUpdate,blake2sFinal:e.blake2sFinal},OE}var x$e=E$e(),ec={exports:{}};function _$e(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var C$e=S$e;function S$e(t,e,r){var n=r&&r.stringify||_$e,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var a=new Array(s);a[0]=n(t);for(var o=1;o<s;o++)a[o]=n(e[o]);return a.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var l="",u=1-i,d=-1,f=t&&t.length||0,h=0;h<f;){if(t.charCodeAt(h)===37&&h+1<f){switch(d=d>-1?d:0,t.charCodeAt(h+1)){case 100:case 102:if(u>=c||e[u]==null)break;d<h&&(l+=t.slice(d,h)),l+=Number(e[u]),d=h+2,h++;break;case 105:if(u>=c||e[u]==null)break;d<h&&(l+=t.slice(d,h)),l+=Math.floor(Number(e[u])),d=h+2,h++;break;case 79:case 111:case 106:if(u>=c||e[u]===void 0)break;d<h&&(l+=t.slice(d,h));var g=typeof e[u];if(g==="string"){l+="'"+e[u]+"'",d=h+2,h++;break}if(g==="function"){l+=e[u].name||"<anonymous>",d=h+2,h++;break}l+=n(e[u]),d=h+2,h++;break;case 115:if(u>=c)break;d<h&&(l+=t.slice(d,h)),l+=String(e[u]),d=h+2,h++;break;case 37:d<h&&(l+=t.slice(d,h)),l+="%",d=h+2,h++,u--;break}++u}++h}return d===-1?t:(d<f&&(l+=t.slice(d)),l)}const rj=C$e;ec.exports=pl;const Bm=U$e().console||{},A$e={mapHttpRequest:eb,mapHttpResponse:eb,wrapRequestSerializer:RE,wrapResponseSerializer:RE,wrapErrorSerializer:RE,req:eb,res:eb,err:ij,errWithCause:ij};function $u(t,e){return t==="silent"?1/0:e.levels.values[t]}const wT=Symbol("pino.logFuncs"),A7=Symbol("pino.hierarchy"),T$e={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function nj(t,e){const r={logger:e,parent:t[A7]};e[A7]=r}function I$e(t,e,r){const n={};e.forEach(i=>{n[i]=r[i]?r[i]:Bm[i]||Bm[T$e[i]||"log"]||vp}),t[wT]=n}function k$e(t,e){return Array.isArray(t)?t.filter(function(r){return r!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function pl(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||Bm;t.browser.write&&(t.browser.asObject=!0);const n=t.serializers||{},i=k$e(t.browser.serialize,n);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const a=Object.keys(t.customLevels||{}),o=["error","fatal","warn","info","debug","trace"].concat(a);typeof r=="function"&&o.forEach(function(m){r[m]=r}),(t.enabled===!1||t.browser.disabled)&&(t.level="silent");const c=t.level||"info",l=Object.create(r);l.log||(l.log=vp),I$e(l,o,r),nj({},l),Object.defineProperty(l,"levelVal",{get:d}),Object.defineProperty(l,"level",{get:f,set:h});const u={transmit:e,serialize:i,asObject:t.browser.asObject,asObjectBindingsOnly:t.browser.asObjectBindingsOnly,formatters:t.browser.formatters,levels:o,timestamp:j$e(t),messageKey:t.messageKey||"msg",onChild:t.onChild||vp};l.levels=$$e(t),l.level=c,l.isLevelEnabled=function(m){return this.levels.values[m]?this.levels.values[m]>=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=vp,l.serializers=n,l._serialize=i,l._stdErrSerialize=s,l.child=function(...m){return g.call(this,u,...m)},e&&(l._logEvent=T7());function d(){return $u(this.level,this)}function f(){return this._level}function h(m){if(m!=="silent"&&!this.levels.values[m])throw Error("unknown level "+m);this._level=m,Nd(this,u,l,"error"),Nd(this,u,l,"fatal"),Nd(this,u,l,"warn"),Nd(this,u,l,"info"),Nd(this,u,l,"debug"),Nd(this,u,l,"trace"),a.forEach(y=>{Nd(this,u,l,y)})}function g(m,y,b){if(!y)throw new Error("missing bindings for child Pino");b=b||{},i&&y.serializers&&(b.serializers=y.serializers);const E=b.serializers;if(i&&E){var v=Object.assign({},n,E),w=t.browser.serialize===!0?Object.keys(v):i;delete y.serializers,ET([y],w,v,this._stdErrSerialize)}function x(S){this._childLevel=(S._childLevel|0)+1,this.bindings=y,v&&(this.serializers=v,this._serialize=w),e&&(this._logEvent=T7([].concat(S._logEvent.bindings,y)))}x.prototype=this;const _=new x(this);return nj(this,_),_.child=function(...S){return g.call(this,m,...S)},_.level=b.level||this.level,m.onChild(_),_}return l}function $$e(t){const e=t.customLevels||{},r=Object.assign({},pl.levels.values,e),n=Object.assign({},pl.levels.labels,N$e(e));return{values:r,labels:n}}function N$e(t){const e={};return Object.keys(t).forEach(function(r){e[t[r]]=r}),e}pl.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"}},pl.stdSerializers=A$e,pl.stdTimeFunctions=Object.assign({},{nullTime:hZ,epochTime:pZ,unixTime:L$e,isoTime:F$e});function P$e(t){const e=[];t.bindings&&e.push(t.bindings);let r=t[A7];for(;r.parent;)r=r.parent,r.logger.bindings&&e.push(r.logger.bindings);return e.reverse()}function Nd(t,e,r,n){if(Object.defineProperty(t,n,{value:$u(t.level,r)>$u(n,r)?vp:r[wT][n],writable:!0,enumerable:!0,configurable:!0}),t[n]===vp){if(!e.transmit)return;const s=e.transmit.level||t.level,a=$u(s,r);if($u(n,r)<a)return}t[n]=R$e(t,e,r,n);const i=P$e(t);i.length!==0&&(t[n]=O$e(i,t[n]))}function O$e(t,e){return function(){return e.apply(this,[...t,...arguments])}}function R$e(t,e,r,n){return(function(i){return function(){const s=e.timestamp(),a=new Array(arguments.length),o=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Bm?Bm:this;for(var c=0;c<a.length;c++)a[c]=arguments[c];var l=!1;if(e.serialize&&(ET(a,this._serialize,this.serializers,this._stdErrSerialize),l=!0),e.asObject||e.formatters?i.call(o,...D$e(this,n,a,s,e)):i.apply(o,a),e.transmit){const u=e.transmit.level||t._level,d=$u(u,r),f=$u(n,r);if(f<d)return;M$e(this,{ts:s,methodLevel:n,methodValue:f,transmitValue:r.levels.values[e.transmit.level||t._level],send:e.transmit.send,val:$u(t._level,r)},a,l)}}})(t[wT][n])}function D$e(t,e,r,n,i){const{level:s,log:a=d=>d}=i.formatters||{},o=r.slice();let c=o[0];const l={};let u=(t._childLevel|0)+1;if(u<1&&(u=1),n&&(l.time=n),s){const d=s(e,t.levels.values[e]);Object.assign(l,d)}else l.level=t.levels.values[e];if(i.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;u--&&typeof o[0]=="object";)Object.assign(l,o.shift());return[a(l),...o]}else{if(c!==null&&typeof c=="object"){for(;u--&&typeof o[0]=="object";)Object.assign(l,o.shift());c=o.length?rj(o.shift(),o):void 0}else typeof c=="string"&&(c=rj(o.shift(),o));return c!==void 0&&(l[i.messageKey]=c),[a(l)]}}function ET(t,e,r,n){for(const i in t)if(n&&t[i]instanceof Error)t[i]=pl.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 M$e(t,e,r,n=!1){const i=e.send,s=e.ts,a=e.methodLevel,o=e.methodValue,c=e.val,l=t._logEvent.bindings;n||ET(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=a,t._logEvent.level.value=o,i(a,t._logEvent,c),t._logEvent=T7(l)}function T7(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function ij(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 j$e(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?hZ:pZ}function eb(){return{}}function RE(t){return t}function vp(){}function hZ(){return!1}function pZ(){return Date.now()}function L$e(){return Math.round(Date.now()/1e3)}function F$e(){return new Date(Date.now()).toISOString()}function U$e(){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)||{}}}ec.exports.default=pl;ec.exports.pino=pl;const B$e={level:"info"},i5="custom_context",xT=1e3*1024;var q$e=Object.defineProperty,W$e=(t,e,r)=>e in t?q$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wu=(t,e,r)=>W$e(t,typeof e!="symbol"?e+"":e,r);let z$e=class{constructor(e){wu(this,"nodeValue"),wu(this,"sizeInBytes"),wu(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}},sj=class{constructor(e){wu(this,"lengthInNodes"),wu(this,"sizeInBytes"),wu(this,"head"),wu(this,"tail"),wu(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new z$e(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 V$e=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r);function aj(t){return typeof t=="string"?t:V$e(t)||""}var H$e=Object.defineProperty,G$e=(t,e,r)=>e in t?H$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tb=(t,e,r)=>G$e(t,typeof e!="symbol"?e+"":e,r);let gZ=class{constructor(e,r=xT){tb(this,"logs"),tb(this,"level"),tb(this,"levelValue"),tb(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=e??"error",this.levelValue=ec.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new sj(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===ec.exports.levels.values.error?console.error(e):r===ec.exports.levels.values.warn?console.warn(e):r===ec.exports.levels.values.debug?console.debug(e):r===ec.exports.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(aj({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 sj(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(aj({extraMetadata:e})),new Blob(r,{type:"application/json"})}};var K$e=Object.defineProperty,Q$e=(t,e,r)=>e in t?K$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Y$e=(t,e,r)=>Q$e(t,e+"",r);let Z$e=class{constructor(e,r=xT){Y$e(this,"baseChunkLogger"),this.baseChunkLogger=new gZ(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 X$e=Object.defineProperty,J$e=(t,e,r)=>e in t?X$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eNe=(t,e,r)=>J$e(t,e+"",r);let tNe=class{constructor(e,r=xT){eNe(this,"baseChunkLogger"),this.baseChunkLogger=new gZ(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 rNe=Object.defineProperty,nNe=Object.defineProperties,iNe=Object.getOwnPropertyDescriptors,oj=Object.getOwnPropertySymbols,sNe=Object.prototype.hasOwnProperty,aNe=Object.prototype.propertyIsEnumerable,cj=(t,e,r)=>e in t?rNe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Lu=(t,e)=>{for(var r in e||(e={}))sNe.call(e,r)&&cj(t,r,e[r]);if(oj)for(var r of oj(e))aNe.call(e,r)&&cj(t,r,e[r]);return t},Fu=(t,e)=>nNe(t,iNe(e));function oNe(t){return Fu(Lu({},t),{level:(t==null?void 0:t.level)||B$e.level})}function cNe(t,e,r=i5){return t[r]=e,t}function Hs(t,e=i5){return t[e]||""}function lNe(t,e,r=i5){const n=Hs(t,r);return n.trim()?`${n}/${e}`:e}function va(t,e,r=i5){const n=lNe(t,e,r),i=t.child({context:n});return cNe(i,n,r)}function uNe(t){var e,r;const n=new Z$e((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:ec.exports(Fu(Lu({},t.opts),{level:"trace",browser:Fu(Lu({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function dNe(t){var e,r;const n=new tNe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:ec.exports(Fu(Lu({},t.opts),{level:"trace",browser:Fu(Lu({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})}),n),chunkLoggerController:n}}function mZ(t){var e;if(typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string")return{logger:t.loggerOverride,chunkLoggerController:null};const r=Fu(Lu({},t.opts),{level:typeof t.loggerOverride=="string"?t.loggerOverride:(e=t.opts)==null?void 0:e.level});return typeof window<"u"?uNe(Fu(Lu({},t),{opts:r})):dNe(Fu(Lu({},t),{opts:r}))}var fNe={};const hNe=":";function gl(t){const[e,r]=t.split(hNe);return{namespace:e,reference:r}}function lj(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function yZ(t,e){return t.includes(":")?[t]:e.chains||[]}const pNe={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}},gNe={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 ut(t,e){const{message:r,code:n}=gNe[t];return{message:e?`${r} ${e}`:r,code:n}}function ln(t,e){const{message:r,code:n}=pNe[t];return{message:e?`${r} ${e}`:r,code:n}}const mNe="ReactNative",aa={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},yNe="js";function hw(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function md(){return!kl.getDocument()&&!!kl.getNavigator()&&navigator.product===mNe}function bNe(){return md()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function vNe(){return md()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function F0(){return!hw()&&!!kl.getNavigator()&&!!kl.getDocument()}function Gy(){return md()?aa.reactNative:hw()?aa.node:F0()?aa.browser:aa.unknown}function uj(){var t;try{return md()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function wNe(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 ENe(t){var r,n;const e=bZ();try{return t!=null&&t.url&&e.url&&new URL(t.url).host!==new URL(e.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${t.url} differs from the actual page url:${e.url}. This is probably unintended and can lead to issues.`),t.url=e.url),(r=t==null?void 0:t.icons)!=null&&r.length&&t.icons.length>0&&(t.icons=t.icons.filter(i=>i!=="")),{...e,...t,url:(t==null?void 0:t.url)||e.url,name:(t==null?void 0:t.name)||e.name,description:(t==null?void 0:t.description)||e.description,icons:(n=t==null?void 0:t.icons)!=null&&n.length&&t.icons.length>0?t.icons:e.icons}}catch(i){return console.warn("Error populating app metadata",i),t||e}}function bZ(){return YCe.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function xNe(){if(Gy()===aa.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=pCe();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 _Ne(){var e;const t=Gy();return t===aa.browser?[t,((e=kl.getLocation())==null?void 0:e.host)||"unknown"].join(":"):t}function vZ(t,e,r){const n=xNe(),i=_Ne();return[[t,e].join("-"),[yNe,r].join("-"),n,i].join("/")}function CNe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:a,bundleId:o,packageName:c}){const l=r.split("?"),u=vZ(t,e,n),d={auth:i,ua:u,projectId:s,useOnCloseEvent:a,packageName:c||void 0,bundleId:o||void 0},f=wNe(l[1]||"",d);return l[0]+"?"+f}function Jd(t,e){return t.filter(r=>e.includes(r)).length===t.length}function I7(t){return Object.fromEntries(t.entries())}function k7(t){return new Map(Object.entries(t))}function Fd(t=ot.FIVE_MINUTES,e){const r=ot.toMiliseconds(t||ot.FIVE_MINUTES);let n,i,s,a;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o),a=Promise.resolve(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,c)=>{if(a)return o(a);s=setTimeout(()=>{const l=ut("EXPIRED"),u=new Error(e||l.message);u.code=l.code,c(u)},r),n=o,i=c})}}function nc(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const a=await t;n(a)}catch(a){i(a)}clearTimeout(s)})}function wZ(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 SNe(t){return wZ("topic",t)}function ANe(t){return wZ("id",t)}function EZ(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 Hn(t,e){return ot.fromMiliseconds(Date.now()+ot.toMiliseconds(t))}function Xo(t){return Date.now()>=ot.toMiliseconds(t)}function zr(t,e){return`${t}${e?`:${e}`:""}`}function dc(t=[],e=[]){return[...new Set([...t,...e])]}async function TNe({id:t,topic:e,wcDeepLink:r}){var n,i;try{if(!r)return;const s=(n=typeof r=="string"?JSON.parse(r):r)==null?void 0:n.href;if(typeof s!="string")return;const a=INe(s,t,e),o=Gy();if(o===aa.browser){if(!((i=kl.getDocument())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}kNe(a)}else o===aa.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(s){console.error(s)}}function INe(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}${ONe(n,!0)}`}else i=`${i}/wc?${n}`;return i}function kNe(t){let e="_self";PNe()?e="_top":(NNe()||t.startsWith("https://")||t.startsWith("http://"))&&(e="_blank"),window.open(t,e,"noreferrer noopener")}async function $Ne(t,e){let r="";try{if(F0()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function dj(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function fj(){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 _T(){return typeof process<"u"&&fNe.IS_VITEST==="true"}function NNe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function PNe(){try{return window.self!==window.top}catch{return!1}}function ONe(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function xZ(t){return Buffer.from(t,"base64").toString("utf-8")}function RNe(t){return new Promise(e=>setTimeout(e,t))}class DNe{constructor({limit:e}){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 rb=BigInt(2**32-1),hj=BigInt(32);function _Z(t,e=!1){return e?{h:Number(t&rb),l:Number(t>>hj&rb)}:{h:Number(t>>hj&rb)|0,l:Number(t&rb)|0}}function CZ(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:a,l:o}=_Z(t[s],e);[n[s],i[s]]=[a,o]}return[n,i]}const pj=(t,e,r)=>t>>>r,gj=(t,e,r)=>t<<32-r|e>>>r,pu=(t,e,r)=>t>>>r|e<<32-r,gu=(t,e,r)=>t<<32-r|e>>>r,l1=(t,e,r)=>t<<64-r|e>>>r-32,u1=(t,e,r)=>t>>>r-32|e<<64-r,MNe=(t,e)=>e,jNe=(t,e)=>t,LNe=(t,e,r)=>t<<r|e>>>32-r,FNe=(t,e,r)=>e<<r|t>>>32-r,UNe=(t,e,r)=>e<<r-32|t>>>64-r,BNe=(t,e,r)=>t<<r-32|e>>>64-r;function io(t,e,r,n){const i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}const CT=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0),ST=(t,e,r,n)=>e+r+n+(t/2**32|0)|0,qNe=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0),WNe=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0,zNe=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0),VNe=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0,kh=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function s5(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function $l(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function No(t,...e){if(!s5(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 a5(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");$l(t.outputLen),$l(t.blockLen)}function ed(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 AT(t,e){No(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function qm(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Ua(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function DE(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Bo(t,e){return t<<32-e|t>>>e}const SZ=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function AZ(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const Hc=SZ?t=>t:t=>AZ(t);function HNe(t){for(let e=0;e<t.length;e++)t[e]=AZ(t[e]);return t}const mu=SZ?t=>t:HNe,TZ=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",GNe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wp(t){if(No(t),TZ)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=GNe[t[r]];return e}const Lc={_0:48,_9:57,A:65,F:70,a:97,f:102};function mj(t){if(t>=Lc._0&&t<=Lc._9)return t-Lc._0;if(t>=Lc.A&&t<=Lc.F)return t-(Lc.A-10);if(t>=Lc.a&&t<=Lc.f)return t-(Lc.a-10)}function pw(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(TZ)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 a=mj(t.charCodeAt(s)),o=mj(t.charCodeAt(s+1));if(a===void 0||o===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]=a*16+o}return n}function IZ(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function bo(t){return typeof t=="string"&&(t=IZ(t)),No(t),t}function Eu(...t){let e=0;for(let n=0;n<t.length;n++){const i=t[n];No(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 o5=class{};function Ky(t){const e=n=>t().update(bo(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function KNe(t){const e=(n,i)=>t(i).update(bo(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function oh(t=32){if(kh&&typeof kh.getRandomValues=="function")return kh.getRandomValues(new Uint8Array(t));if(kh&&typeof kh.randomBytes=="function")return Uint8Array.from(kh.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const QNe=BigInt(0),zg=BigInt(1),YNe=BigInt(2),ZNe=BigInt(7),XNe=BigInt(256),JNe=BigInt(113),kZ=[],$Z=[],NZ=[];for(let t=0,e=zg,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],kZ.push(2*(5*n+r)),$Z.push((t+1)*(t+2)/2%64);let i=QNe;for(let s=0;s<7;s++)e=(e<<zg^(e>>ZNe)*JNe)%XNe,e&YNe&&(i^=zg<<(zg<<BigInt(s))-zg);NZ.push(i)}const PZ=CZ(NZ,!0),ePe=PZ[0],tPe=PZ[1],yj=(t,e,r)=>r>32?UNe(t,e,r):LNe(t,e,r),bj=(t,e,r)=>r>32?BNe(t,e,r):FNe(t,e,r);function rPe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){const o=(a+8)%10,c=(a+2)%10,l=r[c],u=r[c+1],d=yj(l,u,1)^r[o],f=bj(l,u,1)^r[o+1];for(let h=0;h<50;h+=10)t[a+h]^=d,t[a+h+1]^=f}let i=t[2],s=t[3];for(let a=0;a<24;a++){const o=$Z[a],c=yj(i,s,o),l=bj(i,s,o),u=kZ[a];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let a=0;a<50;a+=10){for(let o=0;o<10;o++)r[o]=t[a+o];for(let o=0;o<10;o++)t[a+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=ePe[n],t[1]^=tPe[n]}Ua(r)}class TT extends o5{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,$l(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=qm(this.state)}clone(){return this._cloneInto()}keccak(){mu(this.state32),rPe(this.state32,this.rounds),mu(this.state32),this.posOut=0,this.pos=0}update(e){ed(this),e=bo(e),No(e);const{blockLen:r,state:n}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(r-this.pos,i-s);for(let o=0;o<a;o++)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)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){ed(this,!1),No(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 a=Math.min(n-this.posOut,s-i);e.set(r.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return $l(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(AT(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Ua(this.state)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new TT(r,n,i,a,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=a,e.destroyed=this.destroyed,e}}const nPe=(t,e,r)=>Ky(()=>new TT(e,t,r)),iPe=nPe(1,136,256/8);function sPe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,a,n),t.setUint32(e+l,o,n)}function aPe(t,e,r){return t&e^~t&r}function oPe(t,e,r){return t&e^t&r^e&r}let OZ=class extends o5{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=DE(this.buffer)}update(e){ed(this),e=bo(e),No(e);const{view:r,buffer:n,blockLen:i}=this,s=e.length;for(let a=0;a<s;){const o=Math.min(i-this.pos,s-a);if(o===i){const c=DE(e);for(;i<=s-a;a+=i)this.process(c,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ed(this),AT(e,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:s}=this;let{pos:a}=this;r[a++]=128,Ua(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let d=a;d<i;d++)r[d]=0;sPe(n,i-8,BigInt(this.length*8),s),this.process(n,0);const o=DE(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 d=0;d<l;d++)o.setUint32(4*d,u[d],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:a,pos:o}=this;return e.destroyed=a,e.finished=s,e.length=i,e.pos=o,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const eu=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Vi=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Hi=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),cPe=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]),tu=new Uint32Array(64);class lPe extends OZ{constructor(e=32){super(64,e,8,!1),this.A=eu[0]|0,this.B=eu[1]|0,this.C=eu[2]|0,this.D=eu[3]|0,this.E=eu[4]|0,this.F=eu[5]|0,this.G=eu[6]|0,this.H=eu[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:a,G:o,H:c}=this;return[e,r,n,i,s,a,o,c]}set(e,r,n,i,s,a,o,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=o|0,this.H=c|0}process(e,r){for(let d=0;d<16;d++,r+=4)tu[d]=e.getUint32(r,!1);for(let d=16;d<64;d++){const f=tu[d-15],h=tu[d-2],g=Bo(f,7)^Bo(f,18)^f>>>3,m=Bo(h,17)^Bo(h,19)^h>>>10;tu[d]=m+tu[d-7]+g+tu[d-16]|0}let{A:n,B:i,C:s,D:a,E:o,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){const f=Bo(o,6)^Bo(o,11)^Bo(o,25),h=u+f+aPe(o,c,l)+cPe[d]+tu[d]|0,g=(Bo(n,2)^Bo(n,13)^Bo(n,22))+oPe(n,i,s)|0;u=l,l=c,c=o,o=a+h|0,a=s,s=i,i=n,n=h+g|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,a,o,c,l,u)}roundClean(){Ua(tu)}destroy(){this.set(0,0,0,0,0,0,0,0),Ua(this.buffer)}}const RZ=CZ(["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
4415771202a","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))),uPe=RZ[0],dPe=RZ[1],ru=new Uint32Array(80),nu=new Uint32Array(80);class IT extends OZ{constructor(e=64){super(128,e,16,!1),this.Ah=Hi[0]|0,this.Al=Hi[1]|0,this.Bh=Hi[2]|0,this.Bl=Hi[3]|0,this.Ch=Hi[4]|0,this.Cl=Hi[5]|0,this.Dh=Hi[6]|0,this.Dl=Hi[7]|0,this.Eh=Hi[8]|0,this.El=Hi[9]|0,this.Fh=Hi[10]|0,this.Fl=Hi[11]|0,this.Gh=Hi[12]|0,this.Gl=Hi[13]|0,this.Hh=Hi[14]|0,this.Hl=Hi[15]|0}
vendor: 66,254 bytes, lines 441-444
441get(){const{Ah:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:a,Dh:o,Dl:c,Eh:l,El:u,Fh:d,Fl:f,Gh:h,Gl:g,Hh:m,Hl:y}=this;return[e,r,n,i,s,a,o,c,l,u,d,f,h,g,m,y]}set(e,r,n,i,s,a,o,c,l,u,d,f,h,g,m,y){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=o|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=h|0,this.Gl=g|0,this.Hh=m|0,this.Hl=y|0}process(e,r){for(let v=0;v<16;v++,r+=4)ru[v]=e.getUint32(r),nu[v]=e.getUint32(r+=4);for(let v=16;v<80;v++){const w=ru[v-15]|0,x=nu[v-15]|0,_=pu(w,x,1)^pu(w,x,8)^pj(w,x,7),S=gu(w,x,1)^gu(w,x,8)^gj(w,x,7),A=ru[v-2]|0,I=nu[v-2]|0,$=pu(A,I,19)^l1(A,I,61)^pj(A,I,6),P=gu(A,I,19)^u1(A,I,61)^gj(A,I,6),j=qNe(S,P,nu[v-7],nu[v-16]),L=WNe(j,_,$,ru[v-7],ru[v-16]);ru[v]=L|0,nu[v]=j|0}let{Ah:n,Al:i,Bh:s,Bl:a,Ch:o,Cl:c,Dh:l,Dl:u,Eh:d,El:f,Fh:h,Fl:g,Gh:m,Gl:y,Hh:b,Hl:E}=this;for(let v=0;v<80;v++){const w=pu(d,f,14)^pu(d,f,18)^l1(d,f,41),x=gu(d,f,14)^gu(d,f,18)^u1(d,f,41),_=d&h^~d&m,S=f&g^~f&y,A=zNe(E,x,S,dPe[v],nu[v]),I=VNe(A,b,w,_,uPe[v],ru[v]),$=A|0,P=pu(n,i,28)^l1(n,i,34)^l1(n,i,39),j=gu(n,i,28)^u1(n,i,34)^u1(n,i,39),L=n&s^n&o^s&o,B=i&a^i&c^a&c;b=m|0,E=y|0,m=h|0,y=g|0,h=d|0,g=f|0,{h:d,l:f}=io(l|0,u|0,I|0,$|0),l=o|0,u=c|0,o=s|0,c=a|0,s=n|0,a=i|0;const k=CT($,j,B);n=ST(k,I,P,L),i=k|0}({h:n,l:i}=io(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:a}=io(this.Bh|0,this.Bl|0,s|0,a|0),{h:o,l:c}=io(this.Ch|0,this.Cl|0,o|0,c|0),{h:l,l:u}=io(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:f}=io(this.Eh|0,this.El|0,d|0,f|0),{h,l:g}=io(this.Fh|0,this.Fl|0,h|0,g|0),{h:m,l:y}=io(this.Gh|0,this.Gl|0,m|0,y|0),{h:b,l:E}=io(this.Hh|0,this.Hl|0,b|0,E|0),this.set(n,i,s,a,o,c,l,u,d,f,h,g,m,y,b,E)}roundClean(){Ua(ru,nu)}destroy(){Ua(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class fPe extends IT{constructor(){super(48),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}}const Gi=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class hPe extends IT{constructor(){super(32),this.Ah=Gi[0]|0,this.Al=Gi[1]|0,this.Bh=Gi[2]|0,this.Bl=Gi[3]|0,this.Ch=Gi[4]|0,this.Cl=Gi[5]|0,this.Dh=Gi[6]|0,this.Dl=Gi[7]|0,this.Eh=Gi[8]|0,this.El=Gi[9]|0,this.Fh=Gi[10]|0,this.Fl=Gi[11]|0,this.Gh=Gi[12]|0,this.Gl=Gi[13]|0,this.Hh=Gi[14]|0,this.Hl=Gi[15]|0}}const c5=Ky(()=>new lPe),pPe=Ky(()=>new IT),gPe=Ky(()=>new fPe),mPe=Ky(()=>new hPe),yPe=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]),ni=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),yt=new Uint32Array(32);function iu(t,e,r,n,i,s){const a=i[s],o=i[s+1];let c=yt[2*t],l=yt[2*t+1],u=yt[2*e],d=yt[2*e+1],f=yt[2*r],h=yt[2*r+1],g=yt[2*n],m=yt[2*n+1],y=CT(c,u,a);l=ST(y,l,d,o),c=y|0,{Dh:m,Dl:g}={Dh:m^l,Dl:g^c},{Dh:m,Dl:g}={Dh:MNe(m,g),Dl:jNe(m)},{h,l:f}=io(h,f,m,g),{Bh:d,Bl:u}={Bh:d^h,Bl:u^f},{Bh:d,Bl:u}={Bh:pu(d,u,24),Bl:gu(d,u,24)},yt[2*t]=c,yt[2*t+1]=l,yt[2*e]=u,yt[2*e+1]=d,yt[2*r]=f,yt[2*r+1]=h,yt[2*n]=g,yt[2*n+1]=m}function su(t,e,r,n,i,s){const a=i[s],o=i[s+1];let c=yt[2*t],l=yt[2*t+1],u=yt[2*e],d=yt[2*e+1],f=yt[2*r],h=yt[2*r+1],g=yt[2*n],m=yt[2*n+1],y=CT(c,u,a);l=ST(y,l,d,o),c=y|0,{Dh:m,Dl:g}={Dh:m^l,Dl:g^c},{Dh:m,Dl:g}={Dh:pu(m,g,16),Dl:gu(m,g,16)},{h,l:f}=io(h,f,m,g),{Bh:d,Bl:u}={Bh:d^h,Bl:u^f},{Bh:d,Bl:u}={Bh:l1(d,u,63),Bl:u1(d,u,63)},yt[2*t]=c,yt[2*t+1]=l,yt[2*e]=u,yt[2*e+1]=d,yt[2*r]=f,yt[2*r+1]=h,yt[2*n]=g,yt[2*n+1]=m}function bPe(t,e={},r,n,i){if($l(r),t<0||t>r)throw new Error("outputLen bigger than keyLen");const{key:s,salt:a,personalization:o}=e;if(s!==void 0&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(a!==void 0&&a.length!==n)throw new Error("salt must be undefined or "+n);if(o!==void 0&&o.length!==i)throw new Error("personalization must be undefined or "+i)}class vPe extends o5{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,$l(e),$l(r),this.blockLen=e,this.outputLen=r,this.buffer=new Uint8Array(e),this.buffer32=qm(this.buffer)}update(e){ed(this),e=bo(e),No(e);const{blockLen:r,buffer:n,buffer32:i}=this,s=e.length,a=e.byteOffset,o=e.buffer;for(let c=0;c<s;){this.pos===r&&(mu(i),this.compress(i,0,!1),mu(i),this.pos=0);const l=Math.min(r-this.pos,s-c),u=a+c;if(l===r&&!(u%4)&&c+l<s){const d=new Uint32Array(o,u,Math.floor((s-c)/4));mu(d);for(let f=0;c+r<s;f+=i.length,c+=r)this.length+=r,this.compress(d,f,!1);mu(d);continue}n.set(e.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(e){ed(this),AT(e,this);const{pos:r,buffer32:n}=this;this.finished=!0,Ua(this.buffer.subarray(r)),mu(n),this.compress(n,0,!0),mu(n);const i=qm(e);this.get().forEach((s,a)=>i[a]=Hc(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:a,pos:o}=this;return e||(e=new this.constructor({dkLen:a})),e.set(...this.get()),e.buffer.set(r),e.destroyed=s,e.finished=i,e.length=n,e.pos=o,e.outputLen=a,e}clone(){return this._cloneInto()}}class wPe extends vPe{constructor(e={}){const r=e.dkLen===void 0?64:e.dkLen;super(128,r),this.v0l=ni[0]|0,this.v0h=ni[1]|0,this.v1l=ni[2]|0,this.v1h=ni[3]|0,this.v2l=ni[4]|0,this.v2h=ni[5]|0,this.v3l=ni[6]|0,this.v3h=ni[7]|0,this.v4l=ni[8]|0,this.v4h=ni[9]|0,this.v5l=ni[10]|0,this.v5h=ni[11]|0,this.v6l=ni[12]|0,this.v6h=ni[13]|0,this.v7l=ni[14]|0,this.v7h=ni[15]|0,bPe(r,e,64,16,16);let{key:n,personalization:i,salt:s}=e,a=0;if(n!==void 0&&(n=bo(n),a=n.length),this.v0l^=this.outputLen|a<<8|65536|1<<24,s!==void 0){s=bo(s);const o=qm(s);this.v4l^=Hc(o[0]),this.v4h^=Hc(o[1]),this.v5l^=Hc(o[2]),this.v5h^=Hc(o[3])}if(i!==void 0){i=bo(i);const o=qm(i);this.v6l^=Hc(o[0]),this.v6h^=Hc(o[1]),this.v7l^=Hc(o[2]),this.v7h^=Hc(o[3])}if(n!==void 0){const o=new Uint8Array(this.blockLen);o.set(n),this.update(o)}}get(){let{v0l:e,v0h:r,v1l:n,v1h:i,v2l:s,v2h:a,v3l:o,v3h:c,v4l:l,v4h:u,v5l:d,v5h:f,v6l:h,v6h:g,v7l:m,v7h:y}=this;return[e,r,n,i,s,a,o,c,l,u,d,f,h,g,m,y]}set(e,r,n,i,s,a,o,c,l,u,d,f,h,g,m,y){this.v0l=e|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=s|0,this.v2h=a|0,this.v3l=o|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=f|0,this.v6l=h|0,this.v6h=g|0,this.v7l=m|0,this.v7h=y|0}compress(e,r,n){this.get().forEach((c,l)=>yt[l]=c),yt.set(ni,16);let{h:i,l:s}=_Z(BigInt(this.length));yt[24]=ni[8]^s,yt[25]=ni[9]^i,n&&(yt[28]=~yt[28],yt[29]=~yt[29]);let a=0;const o=yPe;for(let c=0;c<12;c++)iu(0,4,8,12,e,r+2*o[a++]),su(0,4,8,12,e,r+2*o[a++]),iu(1,5,9,13,e,r+2*o[a++]),su(1,5,9,13,e,r+2*o[a++]),iu(2,6,10,14,e,r+2*o[a++]),su(2,6,10,14,e,r+2*o[a++]),iu(3,7,11,15,e,r+2*o[a++]),su(3,7,11,15,e,r+2*o[a++]),iu(0,5,10,15,e,r+2*o[a++]),su(0,5,10,15,e,r+2*o[a++]),iu(1,6,11,12,e,r+2*o[a++]),su(1,6,11,12,e,r+2*o[a++]),iu(2,7,8,13,e,r+2*o[a++]),su(2,7,8,13,e,r+2*o[a++]),iu(3,4,9,14,e,r+2*o[a++]),su(3,4,9,14,e,r+2*o[a++]);this.v0l^=yt[0]^yt[16],this.v0h^=yt[1]^yt[17],this.v1l^=yt[2]^yt[18],this.v1h^=yt[3]^yt[19],this.v2l^=yt[4]^yt[20],this.v2h^=yt[5]^yt[21],this.v3l^=yt[6]^yt[22],this.v3h^=yt[7]^yt[23],this.v4l^=yt[8]^yt[24],this.v4h^=yt[9]^yt[25],this.v5l^=yt[10]^yt[26],this.v5h^=yt[11]^yt[27],this.v6l^=yt[12]^yt[28],this.v6h^=yt[13]^yt[29],this.v7l^=yt[14]^yt[30],this.v7h^=yt[15]^yt[31],Ua(yt)}destroy(){this.destroyed=!0,Ua(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const EPe=KNe(t=>new wPe(t)),xPe="https://rpc.walletconnect.org/v1";function DZ(t){const e=`�Ethereum Signed Message: 442${t.length}`,r=new TextEncoder().encode(e+t);return"0x"+Buffer.from(iPe(r)).toString("hex")}async function _Pe(t,e,r,n,i,s){switch(r.t){case"eip191":return await CPe(t,e,r.s);case"eip1271":return await SPe(t,e,r.s,n,i,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function CPe(t,e,r){const n=MSe(r);return HSe({payload:DZ(e),signature:n}).toLowerCase()===t.toLowerCase()}async function SPe(t,e,r,n,i,s){const a=gl(n);if(!a.namespace||!a.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const o="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l=r.substring(2),u=(l.length/2).toString(16).padStart(64,"0"),d=(e.startsWith("0x")?e:DZ(e)).substring(2),f=o+d+c+u+l,h=await fetch(`${s||xPe}/?chainId=${n}&projectId=${i}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:APe(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:f},"latest"]})}),{result:g}=await h.json();return g?g.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function APe(){return Date.now()+Math.floor(Math.random()*1e3)}function TPe(t){const e=atob(t),r=new Uint8Array(e.length);for(let a=0;a<e.length;a++)r[a]=e.charCodeAt(a);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 zy.encode(s)}function IPe(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=EPe(n,{dkLen:32});return zy.encode(i)}function vj(t){const e=new Uint8Array(c5(kPe(t)));return zy.encode(e)}function kPe(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 wj(t){const e=Buffer.from(t,"base64"),r=kAe(e).txn;if(!r)throw new Error("Invalid signed transaction: missing 'txn' field");const n=wAe(r),i=Buffer.from("TX"),s=Buffer.concat([i,Buffer.from(n)]),a=mPe(s);return zSe.encode(a).replace(/=+$/,"")}function ME(t){const e=[];let r=BigInt(t);for(;r>=0x80n;)e.push(Number(r&0x7fn|0x80n)),r>>=7n;return e.push(Number(r)),Buffer.from(e)}function $Pe(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(ME(e.length)),i.push(e),i.push(Buffer.from([18])),i.push(ME(r.length)),i.push(r),i.push(Buffer.from([26])),i.push(ME(n.length)),i.push(n);const s=Buffer.concat(i),a=c5(s);return Buffer.from(a).toString("hex").toUpperCase()}function NPe(t){var r,n;const e=[];try{if(typeof t=="string")return e.push(t),e;if(typeof t!="object")return e;t!=null&&t.id&&e.push(t.id);const i=(n=(r=t==null?void 0:t.capabilities)==null?void 0:r.caip345)==null?void 0:n.transactionHashes;i&&e.push(...i)}catch(i){console.warn("getWalletSendCallsHashes failed: ",i)}return e}const MZ="did:pkh:",PPe={eip155:"Ethereum",solana:"Solana",bip122:"Bitcoin"},OPe=t=>t?PPe[t]||t:"",l5=t=>t==null?void 0:t.split(":"),RPe=t=>{const e=t&&l5(t);if(e)return t.includes(MZ)?e[3]:e[1]},DPe=t=>{const e=t&&l5(t);if(e)return t.includes(MZ)?e[2]:e[0]},$7=t=>{const e=t&&l5(t);if(e)return e[2]+":"+e[3]},gw=t=>{const e=t&&l5(t);if(e)return e.pop()};async function Ej(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,s=jZ(i,i.iss),a=gw(i.iss);return await _Pe(a,s,n,$7(i.iss),r)}const jZ=(t,e)=>{const r=DPe(e);if(!r)throw new Error("Invalid issuer: "+e);const n=`${t.domain} wants you to sign in with your ${OPe(r)} account:`,i=gw(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 a=`URI: ${t.aud||t.uri}`,o=`Version: ${t.version}`,c=`Chain ID: ${RPe(e)}`,l=`Nonce: ${t.nonce}`,u=`Issued At: ${t.iat}`,d=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(y=>` 443- ${y}`).join("")}`:void 0,m=Qb(t.resources);if(m){const y=Wm(m);s=zPe(s,y)}return[n,i,"",s,"",a,o,c,l,u,d,f,h,g].filter(y=>y!=null).join(` 444`)};function MPe(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function jPe(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function Bf(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(a=>{if(typeof a!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${a}`)})})})}function LPe(t,e,r,n={}){return r==null||r.sort((i,s)=>i.localeCompare(s)),{att:{[t]:FPe(e,r,n)}}}function FPe(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 LZ(t){return Bf(t),`urn:recap:${MPe(t).replace(/=/g,"")}`}function Wm(t){const e=jPe(t.replace("urn:recap:",""));return Bf(e),e}function UPe(t,e,r){const n=LPe(t,e,r);return LZ(n)}function BPe(t){return t&&t.includes("urn:recap:")}function qPe(t,e){const r=Wm(t),n=Wm(e),i=WPe(r,n);return LZ(i)}function WPe(t,e){Bf(t),Bf(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,a;Object.keys(((s=t.att)==null?void 0:s[i])||{}).concat(Object.keys(((a=e.att)==null?void 0:a[i])||{})).sort((o,c)=>o.localeCompare(c)).forEach(o=>{var c,l;n.att[i]={...n.att[i],[o]:((c=t.att[i])==null?void 0:c[o])||((l=e.att[i])==null?void 0:l[o])}})}),n}function zPe(t="",e){Bf(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(o=>{const c=Object.keys(e.att[o]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,f)=>d.action.localeCompare(f.action));const l={};c.forEach(d=>{l[d.ability]||(l[d.ability]=[]),l[d.ability].push(d.action)});const u=Object.keys(l).map(d=>(i++,`(${i}) '${d}': '${l[d].join("', '")}' for '${o}'.`));n.push(u.join(", ").replace(".,","."))});const s=n.join(" "),a=`${r}${s}`;return`${t?t+" ":""}${a}`}function xj(t){var n;const e=Wm(t);Bf(e);const r=(n=e.att)==null?void 0:n.eip155;return r?Object.keys(r).map(i=>i.split("/")[1]):[]}function _j(t){const e=Wm(t);Bf(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 Qb(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return BPe(e)?e:void 0}/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function FZ(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function N7(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function jE(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Ns(t,...e){if(!FZ(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 Cj(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 VPe(t,e){Ns(t);const r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Uu(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function u0(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function HPe(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const GPe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function KPe(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function P7(t){if(typeof t=="string")t=KPe(t);else if(FZ(t))t=O7(t);else throw new Error("Uint8Array expected, got "+typeof t);return t}function QPe(t,e){if(e==null||typeof e!="object")throw new Error("options must be defined");return Object.assign(t,e)}function YPe(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 ZPe=(t,e)=>{function r(n,...i){if(Ns(n),!GPe)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?Ns(l):Ns(l,t.nonceLength)}const s=t.tagLength;s&&i[1]!==void 0&&Ns(i[1]);const a=e(n,...i),o=(l,u)=>{if(u!==void 0){if(l!==2)throw new Error("cipher output not supported");Ns(u)}};let c=!1;return{encrypt(l,u){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,Ns(l),o(a.encrypt.length,u),a.encrypt(l,u)},decrypt(l,u){if(Ns(l),s&&l.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return o(a.decrypt.length,u),a.decrypt(l,u)}}}return Object.assign(r,t),r};function Sj(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&&!JPe(e))throw new Error("invalid output, must be aligned");return e}function Aj(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),o=Number(r&s);t.setUint32(e+4,a,n),t.setUint32(e+0,o,n)}function XPe(t,e,r){N7(r);const n=new Uint8Array(16),i=HPe(n);return Aj(i,0,BigInt(e),r),Aj(i,8,BigInt(t),r),n}function JPe(t){return t.byteOffset%4===0}function O7(t){return Uint8Array.from(t)}const UZ=t=>Uint8Array.from(t.split("").map(e=>e.charCodeAt(0))),eOe=UZ("expand 16-byte k"),tOe=UZ("expand 32-byte k"),rOe=Uu(eOe),nOe=Uu(tOe);function Dr(t,e){return t<<e|t>>>32-e}function R7(t){return t.byteOffset%4===0}const nb=64,iOe=16,BZ=2**32-1,Tj=new Uint32Array;function sOe(t,e,r,n,i,s,a,o){const c=i.length,l=new Uint8Array(nb),u=Uu(l),d=R7(i)&&R7(s),f=d?Uu(i):Tj,h=d?Uu(s):Tj;for(let g=0;g<c;a++){if(t(e,r,n,u,a,o),a>=BZ)throw new Error("arx: counter overflow");const m=Math.min(nb,c-g);if(d&&m===nb){const y=g/4;if(g%4!==0)throw new Error("arx: invalid block position");for(let b=0,E;b<iOe;b++)E=y+b,h[E]=f[E]^u[b];g+=nb;continue}for(let y=0,b;y<m;y++)b=g+y,s[b]=i[b]^l[y];g+=m}}function aOe(t,e){const{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:s,rounds:a}=QPe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if(typeof t!="function")throw new Error("core must be a function");return jE(i),jE(a),N7(s),N7(r),(o,c,l,u,d=0)=>{Ns(o),Ns(c),Ns(l);const f=l.length;if(u===void 0&&(u=new Uint8Array(f)),Ns(u),jE(d),d<0||d>=BZ)throw new Error("arx: counter overflow");if(u.length<f)throw new Error(`arx: output (${u.length}) is shorter than data (${f})`);const h=[];let g=o.length,m,y;if(g===32)h.push(m=O7(o)),y=nOe;else if(g===16&&r)m=new Uint8Array(32),m.set(o),m.set(o,16),y=rOe,h.push(m);else throw new Error(`arx: invalid 32-byte key, got length=${g}`);R7(c)||h.push(c=O7(c));const b=Uu(m);if(n){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");n(y,b,Uu(c.subarray(0,16)),b),c=c.subarray(16)}const E=16-i;if(E!==c.length)throw new Error(`arx: nonce must be ${E} or 16 bytes`);if(E!==12){const w=new Uint8Array(12);w.set(c,s?0:12-c.length),c=w,h.push(c)}const v=Uu(c);return sOe(t,y,b,v,l,u,d,a),u0(...h),u}}const Oi=(t,e)=>t[e++]&255|(t[e++]&255)<<8;class oOe{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=P7(e),Ns(e,32);const r=Oi(e,0),n=Oi(e,2),i=Oi(e,4),s=Oi(e,6),a=Oi(e,8),o=Oi(e,10),c=Oi(e,12),l=Oi(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|a<<12)&255,this.r[5]=a>>>1&8190,this.r[6]=(a>>>14|o<<2)&8191,this.r[7]=(o>>>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]=Oi(e,16+2*u)}process(e,r,n=!1){const i=n?0:2048,{h:s,r:a}=this,o=a[0],c=a[1],l=a[2],u=a[3],d=a[4],f=a[5],h=a[6],g=a[7],m=a[8],y=a[9],b=Oi(e,r+0),E=Oi(e,r+2),v=Oi(e,r+4),w=Oi(e,r+6),x=Oi(e,r+8),_=Oi(e,r+10),S=Oi(e,r+12),A=Oi(e,r+14);let I=s[0]+(b&8191),$=s[1]+((b>>>13|E<<3)&8191),P=s[2]+((E>>>10|v<<6)&8191),j=s[3]+((v>>>7|w<<9)&8191),L=s[4]+((w>>>4|x<<12)&8191),B=s[5]+(x>>>1&8191),k=s[6]+((x>>>14|_<<2)&8191),D=s[7]+((_>>>11|S<<5)&8191),q=s[8]+((S>>>8|A<<8)&8191),U=s[9]+(A>>>5|i),W=0,V=W+I*o+$*(5*y)+P*(5*m)+j*(5*g)+L*(5*h);W=V>>>13,V&=8191,V+=B*(5*f)+k*(5*d)+D*(5*u)+q*(5*l)+U*(5*c),W+=V>>>13,V&=8191;let Y=W+I*c+$*o+P*(5*y)+j*(5*m)+L*(5*g);W=Y>>>13,Y&=8191,Y+=B*(5*h)+k*(5*f)+D*(5*d)+q*(5*u)+U*(5*l),W+=Y>>>13,Y&=8191;let K=W+I*l+$*c+P*o+j*(5*y)+L*(5*m);W=K>>>13,K&=8191,K+=B*(5*g)+k*(5*h)+D*(5*f)+q*(5*d)+U*(5*u),W+=K>>>13,K&=8191;let ge=W+I*u+$*l+P*c+j*o+L*(5*y);W=ge>>>13,ge&=8191,ge+=B*(5*m)+k*(5*g)+D*(5*h)+q*(5*f)+U*(5*d),W+=ge>>>13,ge&=8191;let ae=W+I*d+$*u+P*l+j*c+L*o;W=ae>>>13,ae&=8191,ae+=B*(5*y)+k*(5*m)+D*(5*g)+q*(5*h)+U*(5*f),W+=ae>>>13,ae&=8191;let ce=W+I*f+$*d+P*u+j*l+L*c;W=ce>>>13,ce&=8191,ce+=B*o+k*(5*y)+D*(5*m)+q*(5*g)+U*(5*h),W+=ce>>>13,ce&=8191;let Q=W+I*h+$*f+P*d+j*u+L*l;W=Q>>>13,Q&=8191,Q+=B*c+k*o+D*(5*y)+q*(5*m)+U*(5*g),W+=Q>>>13,Q&=8191;let se=W+I*g+$*h+P*f+j*d+L*u;W=se>>>13,se&=8191,se+=B*l+k*c+D*o+q*(5*y)+U*(5*m),W+=se>>>13,se&=8191;let me=W+I*m+$*g+P*h+j*f+L*d;W=me>>>13,me&=8191,me+=B*u+k*l+D*c+q*o+U*(5*y),W+=me>>>13,me&=8191;let _e=W+I*y+$*m+P*g+j*h+L*f;W=_e>>>13,_e&=8191,_e+=B*d+k*u+D*l+q*c+U*o,W+=_e>>>13,_e&=8191,W=(W<<2)+W|0,W=W+V|0,V=W&8191,W=W>>>13,Y+=W,s[0]=V,s[1]=Y,s[2]=K,s[3]=ge,s[4]=ae,s[5]=ce,s[6]=Q,s[7]=se,s[8]=me,s[9]=_e}finalize(){const{h:e,pad:r}=this,n=new Uint16Array(10);let i=e[1]>>>13;e[1]&=8191;for(let o=2;o<10;o++)e[o]+=i,i=e[o]>>>13,e[o]&=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 o=1;o<10;o++)n[o]=e[o]+i,i=n[o]>>>13,n[o]&=8191;n[9]-=8192;let s=(i^1)-1;for(let o=0;o<10;o++)n[o]&=s;s=~s;for(let o=0;o<10;o++)e[o]=e[o]&s|n[o];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 a=e[0]+r[0];e[0]=a&65535;for(let o=1;o<8;o++)a=(e[o]+r[o]|0)+(a>>>16)|0,e[o]=a&65535;u0(n)}update(e){Cj(this),e=P7(e),Ns(e);const{buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){const a=Math.min(n-this.pos,i-s);if(a===n){for(;n<=i-s;s+=n)this.process(e,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===n&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){u0(this.h,this.r,this.buffer,this.pad)}digestInto(e){Cj(this),VPe(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 a=0;a<8;a++)e[s++]=n[a]>>>0,e[s++]=n[a]>>>8;return e}digest(){const{buffer:e,outputLen:r}=this;this.digestInto(e);const n=e.slice(0,r);return this.destroy(),n}}function cOe(t){const e=(n,i)=>t(i).update(P7(n)).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}const lOe=cOe(t=>new oOe(t));function uOe(t,e,r,n,i,s=20){let a=t[0],o=t[1],c=t[2],l=t[3],u=e[0],d=e[1],f=e[2],h=e[3],g=e[4],m=e[5],y=e[6],b=e[7],E=i,v=r[0],w=r[1],x=r[2],_=a,S=o,A=c,I=l,$=u,P=d,j=f,L=h,B=g,k=m,D=y,q=b,U=E,W=v,V=w,Y=x;for(let ge=0;ge<s;ge+=2)_=_+$|0,U=Dr(U^_,16),B=B+U|0,$=Dr($^B,12),_=_+$|0,U=Dr(U^_,8),B=B+U|0,$=Dr($^B,7),S=S+P|0,W=Dr(W^S,16),k=k+W|0,P=Dr(P^k,12),S=S+P|0,W=Dr(W^S,8),k=k+W|0,P=Dr(P^k,7),A=A+j|0,V=Dr(V^A,16),D=D+V|0,j=Dr(j^D,12),A=A+j|0,V=Dr(V^A,8),D=D+V|0,j=Dr(j^D,7),I=I+L|0,Y=Dr(Y^I,16),q=q+Y|0,L=Dr(L^q,12),I=I+L|0,Y=Dr(Y^I,8),q=q+Y|0,L=Dr(L^q,7),_=_+P|0,Y=Dr(Y^_,16),D=D+Y|0,P=Dr(P^D,12),_=_+P|0,Y=Dr(Y^_,8),D=D+Y|0,P=Dr(P^D,7),S=S+j|0,U=Dr(U^S,16),q=q+U|0,j=Dr(j^q,12),S=S+j|0,U=Dr(U^S,8),q=q+U|0,j=Dr(j^q,7),A=A+L|0,W=Dr(W^A,16),B=B+W|0,L=Dr(L^B,12),A=A+L|0,W=Dr(W^A,8),B=B+W|0,L=Dr(L^B,7),I=I+$|0,V=Dr(V^I,16),k=k+V|0,$=Dr($^k,12),I=I+$|0,V=Dr(V^I,8),k=k+V|0,$=Dr($^k,7);let K=0;n[K++]=a+_|0,n[K++]=o+S|0,n[K++]=c+A|0,n[K++]=l+I|0,n[K++]=u+$|0,n[K++]=d+P|0,n[K++]=f+j|0,n[K++]=h+L|0,n[K++]=g+B|0,n[K++]=m+k|0,n[K++]=y+D|0,n[K++]=b+q|0,n[K++]=E+U|0,n[K++]=v+W|0,n[K++]=w+V|0,n[K++]=x+Y|0}const dOe=aOe(uOe,{counterRight:!1,counterLength:4,allowShortKeys:!1}),fOe=new Uint8Array(16),Ij=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(fOe.subarray(r))},hOe=new Uint8Array(32);function kj(t,e,r,n,i){const s=t(e,r,hOe),a=lOe.create(s);i&&Ij(a,i),Ij(a,n);const o=XPe(n.length,i?i.length:0,!0);a.update(o);const c=a.digest();return u0(s,o),c}const pOe=t=>(e,r,n)=>({encrypt(i,s){const a=i.length;s=Sj(a+16,s,!1),s.set(i);const o=s.subarray(0,-16);t(e,r,o,o,1);const c=kj(t,e,r,o,n);return s.set(c,a),u0(c),s},decrypt(i,s){s=Sj(i.length-16,s,!1);const a=i.subarray(0,-16),o=i.subarray(-16),c=kj(t,e,r,a,n);if(!YPe(o,c))throw new Error("invalid tag");return s.set(i.subarray(0,-16)),t(e,r,s,s,1),u0(c),s}}),qZ=ZPe({blockSize:64,nonceLength:12,tagLength:16},pOe(dOe));let WZ=class extends o5{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,a5(e);const n=bo(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 a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),Ua(s)}update(e){return ed(this),this.iHash.update(e),this}digestInto(e){ed(this),No(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:a,outputLen:o}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=o,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 u5=(t,e,r)=>new WZ(t,e).update(r).digest();u5.create=(t,e)=>new WZ(t,e);function gOe(t,e,r){return a5(t),r===void 0&&(r=new Uint8Array(t.outputLen)),u5(t,bo(r),bo(e))}const LE=Uint8Array.from([0]),$j=Uint8Array.of();function mOe(t,e,r,n=32){a5(t),$l(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=$j);const a=new Uint8Array(s*i),o=u5.create(t,e),c=o._cloneInto(),l=new Uint8Array(o.outputLen);for(let u=0;u<s;u++)LE[0]=u+1,c.update(u===0?$j:l).update(r).update(LE).digestInto(l),a.set(l,i*u),o._cloneInto(c);return o.destroy(),c.destroy(),Ua(l,LE),a.slice(0,n)}const yOe=(t,e,r,n,i)=>mOe(t,gOe(t,e,r),n,i),d5=c5;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const kT=BigInt(0),D7=BigInt(1);function mw(t,e=""){if(typeof t!="boolean"){const r=e&&`"${e}"`;throw new Error(r+"expected boolean, got type="+typeof t)}return t}function ef(t,e,r=""){const n=s5(t),i=t==null?void 0:t.length,s=e!==void 0;if(!n||s&&i!==e){const a=r&&`"${r}" `,o=s?` of length ${e}`:"",c=n?`length=${i}`:`type=${typeof t}`;throw new Error(a+"expected Uint8Array"+o+", got "+c)}return t}function ib(t){const e=t.toString(16);return e.length&1?"0"+e:e}function zZ(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?kT:BigInt("0x"+t)}function f5(t){return zZ(wp(t))}function yw(t){return No(t),zZ(wp(Uint8Array.from(t).reverse()))}function $T(t,e){return pw(t.toString(16).padStart(e*2,"0"))}function NT(t,e){return $T(t,e).reverse()}function Yi(t,e,r){let n;if(typeof e=="string")try{n=pw(e)}catch(s){throw new Error(t+" must be hex string or Uint8Array, cause: "+s)}else if(s5(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 FE=t=>typeof t=="bigint"&&kT<=t;function bOe(t,e,r){return FE(t)&&FE(e)&&FE(r)&&e<=t&&t<r}function M7(t,e,r,n){if(!bOe(e,r,n))throw new Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function VZ(t){let e;for(e=0;t>kT;t>>=D7,e+=1);return e}const Qy=t=>(D7<<BigInt(t))-D7;function vOe(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=f=>new Uint8Array(f),i=f=>Uint8Array.of(f);let s=n(t),a=n(t),o=0;const c=()=>{s.fill(1),a.fill(0),o=0},l=(...f)=>r(a,s,...f),u=(f=n(0))=>{a=l(i(0),f),s=l(),f.length!==0&&(a=l(i(1),f),s=l())},d=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f<e;){s=l();const g=s.slice();h.push(g),f+=s.length}return Eu(...h)};return(f,h)=>{c(),u(f);let g;for(;!(g=h(d()));)u();return c(),g}}function h5(t,e,r={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function n(i,s,a){const o=t[i];if(a&&o===void 0)return;const c=typeof o;if(c!==s||o===null)throw new Error(`param "${i}" 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 Nj(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}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Ds=BigInt(0),ms=BigInt(1),tf=BigInt(2),HZ=BigInt(3),GZ=BigInt(4),KZ=BigInt(5),wOe=BigInt(7),QZ=BigInt(8),EOe=BigInt(9),YZ=BigInt(16);function ta(t,e){const r=t%e;return r>=Ds?r:e+r}function ro(t,e,r){let n=t;for(;e-- >Ds;)n*=n,n%=r;return n}function Pj(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=ta(t,e),n=e,i=Ds,s=ms;for(;r!==Ds;){const a=n/r,o=n%r,c=i-s*a;n=r,r=o,i=s,s=c}if(n!==ms)throw new Error("invert: does not exist");return ta(i,e)}function PT(t,e,r){if(!t.eql(t.sqr(e),r))throw new Error("Cannot find square root")}function ZZ(t,e){const r=(t.ORDER+ms)/GZ,n=t.pow(e,r);return PT(t,n,e),n}function xOe(t,e){const r=(t.ORDER-KZ)/QZ,n=t.mul(e,tf),i=t.pow(n,r),s=t.mul(e,i),a=t.mul(t.mul(s,tf),i),o=t.mul(s,t.sub(a,t.ONE));return PT(t,o,e),o}function _Oe(t){const e=yd(t),r=XZ(t),n=r(e,e.neg(e.ONE)),i=r(e,n),s=r(e,e.neg(n)),a=(t+wOe)/YZ;return(o,c)=>{let l=o.pow(c,a),u=o.mul(l,n);const d=o.mul(l,i),f=o.mul(l,s),h=o.eql(o.sqr(u),c),g=o.eql(o.sqr(d),c);l=o.cmov(l,u,h),u=o.cmov(f,d,g);const m=o.eql(o.sqr(u),c),y=o.cmov(l,u,m);return PT(o,y,c),y}}function XZ(t){if(t<HZ)throw new Error("sqrt is not defined for small field");let e=t-ms,r=0;for(;e%tf===Ds;)e/=tf,r++;let n=tf;const i=yd(t);for(;Oj(i,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return ZZ;let s=i.pow(n,e);const a=(e+ms)/tf;return function(o,c){if(o.is0(c))return c;if(Oj(o,c)!==1)throw new Error("Cannot find square root");let l=r,u=o.mul(o.ONE,s),d=o.pow(c,e),f=o.pow(c,a);for(;!o.eql(d,o.ONE);){if(o.is0(d))return o.ZERO;let h=1,g=o.sqr(d);for(;!o.eql(g,o.ONE);)if(h++,g=o.sqr(g),h===l)throw new Error("Cannot find square root");const m=ms<<BigInt(l-h-1),y=o.pow(u,m);l=h,u=o.sqr(y),d=o.mul(d,u),f=o.mul(f,y)}return f}}function COe(t){return t%GZ===HZ?ZZ:t%QZ===KZ?xOe:t%YZ===EOe?_Oe(t):XZ(t)}const SOe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function AOe(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=SOe.reduce((n,i)=>(n[i]="function",n),e);return h5(t,r),t}function TOe(t,e,r){if(r<Ds)throw new Error("invalid exponent, negatives unsupported");if(r===Ds)return t.ONE;if(r===ms)return e;let n=t.ONE,i=e;for(;r>Ds;)r&ms&&(n=t.mul(n,i)),i=t.sqr(i),r>>=ms;return n}function JZ(t,e,r=!1){const n=new Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((a,o,c)=>t.is0(o)?a:(n[c]=a,t.mul(a,o)),t.ONE),s=t.inv(i);return e.reduceRight((a,o,c)=>t.is0(o)?a:(n[c]=t.mul(a,n[c]),t.mul(a,o)),s),n}function Oj(t,e){const r=(t.ORDER-ms)/tf,n=t.pow(e,r),i=t.eql(n,t.ONE),s=t.eql(n,t.ZERO),a=t.eql(n,t.neg(t.ONE));if(!i&&!s&&!a)throw new Error("invalid Legendre symbol result");return i?1:s?0:-1}function eX(t,e){e!==void 0&&$l(e);const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function yd(t,e,r=!1,n={}){if(t<=Ds)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,s,a=!1,o;if(typeof e=="object"&&e!=null){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");const f=e;f.BITS&&(i=f.BITS),f.sqrt&&(s=f.sqrt),typeof f.isLE=="boolean"&&(r=f.isLE),typeof f.modFromBytes=="boolean"&&(a=f.modFromBytes),o=f.allowedLengths}else typeof e=="number"&&(i=e),n.sqrt&&(s=n.sqrt);const{nBitLength:c,nByteLength:l}=eX(t,i);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:t,isLE:r,BITS:c,BYTES:l,MASK:Qy(c),ZERO:Ds,ONE:ms,allowedLengths:o,create:f=>ta(f,t),isValid:f=>{if(typeof f!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof f);return Ds<=f&&f<t},is0:f=>f===Ds,isValidNot0:f=>!d.is0(f)&&d.isValid(f),isOdd:f=>(f&ms)===ms,neg:f=>ta(-f,t),eql:(f,h)=>f===h,sqr:f=>ta(f*f,t),add:(f,h)=>ta(f+h,t),sub:(f,h)=>ta(f-h,t),mul:(f,h)=>ta(f*h,t),pow:(f,h)=>TOe(d,f,h),div:(f,h)=>ta(f*Pj(h,t),t),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>Pj(f,t),sqrt:s||(f=>(u||(u=COe(t)),u(d,f))),toBytes:f=>r?NT(f,l):$T(f,l),fromBytes:(f,h=!0)=>{if(o){if(!o.includes(f.length)||f.length>l)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+f.length);const m=new Uint8Array(l);m.set(f,r?0:m.length-f.length),f=m}if(f.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+f.length);let g=r?yw(f):f5(f);if(a&&(g=ta(g,t)),!h&&!d.isValid(g))throw new Error("invalid field element: outside of range 0..ORDER");return g},invertBatch:f=>JZ(d,f),cmov:(f,h,g)=>g?h:f});return Object.freeze(d)}function tX(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 rX(t){const e=tX(t);return e+Math.ceil(e/2)}function IOe(t,e,r=!1){const n=t.length,i=tX(e),s=rX(e);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);const a=r?yw(t):f5(t),o=ta(a,e-ms)+ms;return r?NT(o,i):$T(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const d0=BigInt(0),rf=BigInt(1);function bw(t,e){const r=e.negate();return t?r:e}function UE(t,e){const r=JZ(t.Fp,e.map(n=>n.Z));return e.map((n,i)=>t.fromAffine(n.toAffine(r[i])))}function nX(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function BE(t,e){nX(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t,s=Qy(t),a=BigInt(t);return{windows:r,windowSize:n,mask:s,maxNumber:i,shiftBy:a}}function Rj(t,e,r){const{windowSize:n,mask:i,maxNumber:s,shiftBy:a}=r;let o=Number(t&i),c=t>>a;o>n&&(o-=s,c+=rf);const l=e*n,u=l+Math.abs(o)-1,d=o===0,f=o<0,h=e%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:h,offsetF:l}}function kOe(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 $Oe(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 qE=new WeakMap,iX=new WeakMap;function WE(t){return iX.get(t)||1}function Dj(t){if(t!==d0)throw new Error("invalid wNAF")}class NOe{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>d0;)r&rf&&(n=n.add(i)),i=i.double(),r>>=rf;return n}precomputeWindow(e,r){const{windows:n,windowSize:i}=BE(r,this.bits),s=[];let a=e,o=a;for(let c=0;c<n;c++){o=a,s.push(o);for(let l=1;l<i;l++)o=o.add(a),s.push(o);a=o.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 a=BE(e,this.bits);for(let o=0;o<a.windows;o++){const{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:f,offsetF:h}=Rj(n,o,a);n=c,u?s=s.add(bw(f,r[h])):i=i.add(bw(d,r[l]))}return Dj(n),{p:i,f:s}}wNAFUnsafe(e,r,n,i=this.ZERO){const s=BE(e,this.bits);for(let a=0;a<s.windows&&n!==d0;a++){const{nextN:o,offset:c,isZero:l,isNeg:u}=Rj(n,a,s);if(n=o,!l){const d=r[c];i=i.add(u?d.negate():d)}}return Dj(n),i}getPrecomputes(e,r,n){let i=qE.get(r);return i||(i=this.precomputeWindow(r,e),e!==1&&(typeof n=="function"&&(i=n(i)),qE.set(r,i))),i}cached(e,r,n){const i=WE(e);return this.wNAF(i,this.getPrecomputes(i,e,n),r)}unsafe(e,r,n,i){const s=WE(e);return s===1?this._unsafeLadder(e,r,i):this.wNAFUnsafe(s,this.getPrecomputes(s,e,n),r,i)}createCache(e,r){nX(r,this.bits),iX.set(e,r),qE.delete(e)}hasCache(e){return WE(e)!==1}}function POe(t,e,r,n){let i=e,s=t.ZERO,a=t.ZERO;for(;r>d0||n>d0;)r&rf&&(s=s.add(i)),n&rf&&(a=a.add(i)),i=i.double(),r>>=rf,n>>=rf;return{p1:s,p2:a}}function OOe(t,e,r,n){kOe(r,t),$Oe(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 a=t.ZERO,o=VZ(BigInt(i));let c=1;o>12?c=o-3:o>4?c=o-2:o>0&&(c=2);const l=Qy(c),u=new Array(Number(l)+1).fill(a),d=Math.floor((e.BITS-1)/c)*c;let f=a;for(let h=d;h>=0;h-=c){u.fill(a);for(let m=0;m<s;m++){const y=n[m],b=Number(y>>BigInt(h)&l);u[b]=u[b].add(r[m])}let g=a;for(let m=u.length-1,y=a;m>0;m--)y=y.add(u[m]),g=g.add(y);if(f=f.add(g),h!==0)for(let m=0;m<c;m++)f=f.double()}return f}function Mj(t,e,r){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return AOe(e),e}else return yd(t,{isLE:r})}function ROe(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 o of["p","n","h"]){const c=e[o];if(!(typeof c=="bigint"&&c>d0))throw new Error(`CURVE.${o} must be positive bigint`)}const i=Mj(e.p,r.Fp,n),s=Mj(e.n,r.Fn,n),a=["Gx","Gy","a","b"];for(const o of a)if(!i.isValid(e[o]))throw new Error(`CURVE.${o} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:s}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0),BigInt(1),BigInt(2),BigInt(8),IZ("HashToScalar-");/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Vg=BigInt(0),$h=BigInt(1),sb=BigInt(2);function DOe(t){return h5(t,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...t})}function MOe(t){const e=DOe(t),{P:r,type:n,adjustScalarBytes:i,powPminus2:s,randomBytes:a}=e,o=n==="x25519";if(!o&&n!=="x448")throw new Error("invalid type");const c=a||oh,l=o?255:448,u=o?32:56,d=BigInt(o?9:5),f=BigInt(o?121665:39081),h=o?sb**BigInt(254):sb**BigInt(447),g=o?BigInt(8)*sb**BigInt(251)-$h:BigInt(4)*sb**BigInt(445)-$h,m=h+g+$h,y=j=>ta(j,r),b=E(d);function E(j){return NT(y(j),u)}function v(j){const L=Yi("u coordinate",j,u);return o&&(L[31]&=127),y(yw(L))}function w(j){return yw(i(Yi("scalar",j,u)))}function x(j,L){const B=A(v(L),w(j));if(B===Vg)throw new Error("invalid private or public key received");return E(B)}function _(j){return x(j,b)}function S(j,L,B){const k=y(j*(L-B));return L=y(L-k),B=y(B+k),{x_2:L,x_3:B}}function A(j,L){M7("u",j,Vg,r),M7("scalar",L,h,m);const B=L,k=j;let D=$h,q=Vg,U=j,W=$h,V=Vg;for(let K=BigInt(l-1);K>=Vg;K--){const ge=B>>K&$h;V^=ge,{x_2:D,x_3:U}=S(V,D,U),{x_2:q,x_3:W}=S(V,q,W),V=ge;const ae=D+q,ce=y(ae*ae),Q=D-q,se=y(Q*Q),me=ce-se,_e=U+W,z=U-W,R=y(z*ae),M=y(_e*Q),ee=R+M,ie=R-M;U=y(ee*ee),W=y(k*y(ie*ie)),D=y(ce*se),q=y(me*(ce+y(f*me)))}({x_2:D,x_3:U}=S(V,D,U)),{x_2:q,x_3:W}=S(V,q,W);const Y=s(q);return y(D*Y)}const I={secretKey:u,publicKey:u,seed:u},$=(j=c(u))=>(No(j,I.seed),j);function P(j){const L=$(j);return{secretKey:L,publicKey:_(L)}}return{keygen:P,getSharedSecret:(j,L)=>x(j,L),getPublicKey:j=>_(j),scalarMult:x,scalarMultBase:_,utils:{randomSecretKey:$,randomPrivateKey:$},GuBytes:b.slice(),lengths:I}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jOe=BigInt(1),jj=BigInt(2),LOe=BigInt(3),FOe=BigInt(5);BigInt(8);const sX=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),UOe={p:sX,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function BOe(t){const e=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),s=sX,a=t*t%s*t%s,o=ro(a,jj,s)*a%s,c=ro(o,jOe,s)*t%s,l=ro(c,FOe,s)*c%s,u=ro(l,e,s)*l%s,d=ro(u,r,s)*u%s,f=ro(d,n,s)*d%s,h=ro(f,i,s)*f%s,g=ro(h,i,s)*f%s,m=ro(g,e,s)*l%s;return{pow_p_5_8:ro(m,jj,s)*t%s,b2:a}}function qOe(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const WOe=yd(UOe.p,{isLE:!0}),j7=(()=>{const t=WOe.ORDER;return MOe({P:t,type:"x25519",powPminus2:e=>{const{pow_p_5_8:r,b2:n}=BOe(e);return ta(ro(r,LOe,t)*n,t)},adjustScalarBytes:qOe})})();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Lj=(t,e)=>(t+(t>=0?e:-e)/aX)/e;function zOe(t,e,r){const[[n,i],[s,a]]=e,o=Lj(a*t,r),c=Lj(-i*t,r);let l=t-o*n-c*s,u=-o*i-c*a;const d=l<al,f=u<al;d&&(l=-l),f&&(u=-u);const h=Qy(Math.ceil(VZ(r)/2))+Ep;if(l<al||l>=h||u<al||u>=h)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:d,k1:l,k2neg:f,k2:u}}function L7(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function zE(t,e){const r={};for(let n of Object.keys(e))r[n]=t[n]===void 0?e[n]:t[n];return mw(r.lowS,"lowS"),mw(r.prehash,"prehash"),r.format!==void 0&&L7(r.format),r}class VOe extends Error{constructor(e=""){super(e)}}const tl={Err:VOe,_tlv:{encode:(t,e)=>{const{Err:r}=tl;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=ib(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const s=n>127?ib(i.length/2|128):"";return ib(t)+s+i+e},decode(t,e){const{Err:r}=tl;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 a=0;if(!s)a=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)a=a<<8|u;if(n+=c,a<128)throw new r("tlv.decode(long): not minimal encoding")}const o=e.subarray(n,n+a);if(o.length!==a)throw new r("tlv.decode: wrong value length");return{v:o,l:e.subarray(n+a)}}},_int:{encode(t){const{Err:e}=tl;if(t<al)throw new e("integer: negative integers are not allowed");let r=ib(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}=tl;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 f5(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=tl,i=Yi("signature",t),{v:s,l:a}=n.decode(48,i);if(a.length)throw new e("invalid signature: left bytes after parsing");const{v:o,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(o),s:r.decode(l)}},hexFromSig(t){const{_tlv:e,_int:r}=tl,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),s=n+i;return e.encode(48,s)}},al=BigInt(0),Ep=BigInt(1),aX=BigInt(2),ab=BigInt(3),HOe=BigInt(4);function rp(t,e){const{BYTES:r}=t;let n;if(typeof e=="bigint")n=e;else{let i=Yi("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 GOe(t,e={}){const r=ROe("weierstrass",t,e),{Fp:n,Fn:i}=r;let s=r.CURVE;const{h:a,n:o}=s;h5(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=cX(n,i);function u(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(j,L,B){const{x:k,y:D}=L.toAffine(),q=n.toBytes(k);if(mw(B,"isCompressed"),B){u();const U=!n.isOdd(D);return Eu(oX(U),q)}else return Eu(Uint8Array.of(4),q,n.toBytes(D))}function f(j){ef(j,void 0,"Point");const{publicKey:L,publicKeyUncompressed:B}=l,k=j.length,D=j[0],q=j.subarray(1);if(k===L&&(D===2||D===3)){const U=n.fromBytes(q);if(!n.isValid(U))throw new Error("bad point: is not on curve, wrong x");const W=m(U);let V;try{V=n.sqrt(W)}catch(K){const ge=K instanceof Error?": "+K.message:"";throw new Error("bad point: is not on curve, sqrt error"+ge)}u();const Y=n.isOdd(V);return(D&1)===1!==Y&&(V=n.neg(V)),{x:U,y:V}}else if(k===B&&D===4){const U=n.BYTES,W=n.fromBytes(q.subarray(0,U)),V=n.fromBytes(q.subarray(U,U*2));if(!y(W,V))throw new Error("bad point: is not on curve");return{x:W,y:V}}else throw new Error(`bad point: got length ${k}, expected compressed=${L} or uncompressed=${B}`)}const h=e.toBytes||d,g=e.fromBytes||f;function m(j){const L=n.sqr(j),B=n.mul(L,j);return n.add(n.add(B,n.mul(j,s.a)),s.b)}function y(j,L){const B=n.sqr(L),k=m(j);return n.eql(B,k)}if(!y(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const b=n.mul(n.pow(s.a,ab),HOe),E=n.mul(n.sqr(s.b),BigInt(27));if(n.is0(n.add(b,E)))throw new Error("bad curve params: a or b");function v(j,L,B=!1){if(!n.isValid(L)||B&&n.is0(L))throw new Error(`bad point coordinate ${j}`);return L}function w(j){if(!(j instanceof I))throw new Error("ProjectivePoint expected")}function x(j){if(!c||!c.basises)throw new Error("no endo");return zOe(j,c.basises,i.ORDER)}const _=Nj((j,L)=>{const{X:B,Y:k,Z:D}=j;if(n.eql(D,n.ONE))return{x:B,y:k};const q=j.is0();L==null&&(L=q?n.ONE:n.inv(D));const U=n.mul(B,L),W=n.mul(k,L),V=n.mul(D,L);if(q)return{x:n.ZERO,y:n.ZERO};if(!n.eql(V,n.ONE))throw new Error("invZ was invalid");return{x:U,y:W}}),S=Nj(j=>{if(j.is0()){if(e.allowInfinityPoint&&!n.is0(j.Y))return;throw new Error("bad point: ZERO")}const{x:L,y:B}=j.toAffine();if(!n.isValid(L)||!n.isValid(B))throw new Error("bad point: x or y not field elements");if(!y(L,B))throw new Error("bad point: equation left != right");if(!j.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function A(j,L,B,k,D){return B=new I(n.mul(B.X,j),B.Y,B.Z),L=bw(k,L),B=bw(D,B),L.add(B)}class I{constructor(L,B,k){this.X=v("x",L),this.Y=v("y",B,!0),this.Z=v("z",k),Object.freeze(this)}static CURVE(){return s}static fromAffine(L){const{x:B,y:k}=L||{};if(!L||!n.isValid(B)||!n.isValid(k))throw new Error("invalid affine point");if(L instanceof I)throw new Error("projective point not allowed");return n.is0(B)&&n.is0(k)?I.ZERO:new I(B,k,n.ONE)}static fromBytes(L){const B=I.fromAffine(g(ef(L,void 0,"point")));return B.assertValidity(),B}static fromHex(L){return I.fromBytes(Yi("pointHex",L))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(L=8,B=!0){return P.createCache(this,L),B||this.multiply(ab),this}assertValidity(){S(this)}hasEvenY(){const{y:L}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(L)}equals(L){w(L);const{X:B,Y:k,Z:D}=this,{X:q,Y:U,Z:W}=L,V=n.eql(n.mul(B,W),n.mul(q,D)),Y=n.eql(n.mul(k,W),n.mul(U,D));return V&&Y}negate(){return new I(this.X,n.neg(this.Y),this.Z)}double(){const{a:L,b:B}=s,k=n.mul(B,ab),{X:D,Y:q,Z:U}=this;let W=n.ZERO,V=n.ZERO,Y=n.ZERO,K=n.mul(D,D),ge=n.mul(q,q),ae=n.mul(U,U),ce=n.mul(D,q);return ce=n.add(ce,ce),Y=n.mul(D,U),Y=n.add(Y,Y),W=n.mul(L,Y),V=n.mul(k,ae),V=n.add(W,V),W=n.sub(ge,V),V=n.add(ge,V),V=n.mul(W,V),W=n.mul(ce,W),Y=n.mul(k,Y),ae=n.mul(L,ae),ce=n.sub(K,ae),ce=n.mul(L,ce),ce=n.add(ce,Y),Y=n.add(K,K),K=n.add(Y,K),K=n.add(K,ae),K=n.mul(K,ce),V=n.add(V,K),ae=n.mul(q,U),ae=n.add(ae,ae),K=n.mul(ae,ce),W=n.sub(W,K),Y=n.mul(ae,ge),Y=n.add(Y,Y),Y=n.add(Y,Y),new I(W,V,Y)}add(L){w(L);const{X:B,Y:k,Z:D}=this,{X:q,Y:U,Z:W}=L;let V=n.ZERO,Y=n.ZERO,K=n.ZERO;const ge=s.a,ae=n.mul(s.b,ab);let ce=n.mul(B,q),Q=n.mul(k,U),se=n.mul(D,W),me=n.add(B,k),_e=n.add(q,U);me=n.mul(me,_e),_e=n.add(ce,Q),me=n.sub(me,_e),_e=n.add(B,D);let z=n.add(q,W);return _e=n.mul(_e,z),z=n.add(ce,se),_e=n.sub(_e,z),z=n.add(k,D),V=n.add(U,W),z=n.mul(z,V),V=n.add(Q,se),z=n.sub(z,V),K=n.mul(ge,_e),V=n.mul(ae,se),K=n.add(V,K),V=n.sub(Q,K),K=n.add(Q,K),Y=n.mul(V,K),Q=n.add(ce,ce),Q=n.add(Q,ce),se=n.mul(ge,se),_e=n.mul(ae,_e),Q=n.add(Q,se),se=n.sub(ce,se),se=n.mul(ge,se),_e=n.add(_e,se),ce=n.mul(Q,_e),Y=n.add(Y,ce),ce=n.mul(z,_e),V=n.mul(me,V),V=n.sub(V,ce),ce=n.mul(me,Q),K=n.mul(z,K),K=n.add(K,ce),new I(V,Y,K)}subtract(L){return this.add(L.negate())}is0(){return this.equals(I.ZERO)}multiply(L){const{endo:B}=e;if(!i.isValidNot0(L))throw new Error("invalid scalar: out of range");let k,D;const q=U=>P.cached(this,U,W=>UE(I,W));if(B){const{k1neg:U,k1:W,k2neg:V,k2:Y}=x(L),{p:K,f:ge}=q(W),{p:ae,f:ce}=q(Y);D=ge.add(ce),k=A(B.beta,K,ae,U,V)}else{const{p:U,f:W}=q(L);k=U,D=W}return UE(I,[k,D])[0]}multiplyUnsafe(L){const{endo:B}=e,k=this;if(!i.isValid(L))throw new Error("invalid scalar: out of range");if(L===al||k.is0())return I.ZERO;if(L===Ep)return k;if(P.hasCache(this))return this.multiply(L);if(B){const{k1neg:D,k1:q,k2neg:U,k2:W}=x(L),{p1:V,p2:Y}=POe(I,k,q,W);return A(B.beta,V,Y,D,U)}else return P.unsafe(k,L)}multiplyAndAddUnsafe(L,B,k){const D=this.multiplyUnsafe(B).add(L.multiplyUnsafe(k));return D.is0()?void 0:D}toAffine(L){return _(this,L)}isTorsionFree(){const{isTorsionFree:L}=e;return a===Ep?!0:L?L(I,this):P.unsafe(this,o).is0()}clearCofactor(){const{clearCofactor:L}=e;return a===Ep?this:L?L(I,this):this.multiplyUnsafe(a)}isSmallOrder(){return this.multiplyUnsafe(a).is0()}toBytes(L=!0){return mw(L,"isCompressed"),this.assertValidity(),h(I,this,L)}toHex(L=!0){return wp(this.toBytes(L))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(L=!0){return this.toBytes(L)}_setWindowSize(L){this.precompute(L)}static normalizeZ(L){return UE(I,L)}static msm(L,B){return OOe(I,i,L,B)}static fromPrivateKey(L){return I.BASE.multiply(rp(i,L))}}I.BASE=new I(s.Gx,s.Gy,n.ONE),I.ZERO=new I(n.ZERO,n.ONE,n.ZERO),I.Fp=n,I.Fn=i;const $=i.BITS,P=new NOe(I,e.endo?Math.ceil($/2):$);return I.BASE.precompute(8),I}function oX(t){return Uint8Array.of(t?2:3)}function cX(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function KOe(t,e={}){const{Fn:r}=t,n=e.randomBytes||oh,i=Object.assign(cX(t.Fp,r),{seed:rX(r.ORDER)});function s(f){try{return!!rp(r,f)}catch{return!1}}function a(f,h){const{publicKey:g,publicKeyUncompressed:m}=i;try{const y=f.length;return h===!0&&y!==g||h===!1&&y!==m?!1:!!t.fromBytes(f)}catch{return!1}}function o(f=n(i.seed)){return IOe(ef(f,i.seed,"seed"),r.ORDER)}function c(f,h=!0){return t.BASE.multiply(rp(r,f)).toBytes(h)}function l(f){const h=o(f);return{secretKey:h,publicKey:c(h)}}function u(f){if(typeof f=="bigint")return!1;if(f instanceof t)return!0;const{secretKey:h,publicKey:g,publicKeyUncompressed:m}=i;if(r.allowedLengths||h===g)return;const y=Yi("key",f).length;return y===g||y===m}function d(f,h,g=!0){if(u(f)===!0)throw new Error("first arg must be private key");if(u(h)===!1)throw new Error("second arg must be public key");const m=rp(r,f);return t.fromHex(h).multiply(m).toBytes(g)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:t,utils:{isValidSecretKey:s,isValidPublicKey:a,randomSecretKey:o,isValidPrivateKey:s,randomPrivateKey:o,normPrivateKeyToScalar:f=>rp(r,f),precompute(f=8,h=t.BASE){return h.precompute(f,!1)}},lengths:i})}function QOe(t,e,r={}){a5(e),h5(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const n=r.randomBytes||oh,i=r.hmac||((B,...k)=>u5(e,B,Eu(...k))),{Fp:s,Fn:a}=t,{ORDER:o,BITS:c}=a,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h}=KOe(t,r),g={prehash:!1,lowS:typeof r.lowS=="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},m="compact";function y(B){const k=o>>Ep;return B>k}function b(B,k){if(!a.isValidNot0(k))throw new Error(`invalid signature ${B}: out of range 1..Point.Fn.ORDER`);return k}function E(B,k){L7(k);const D=h.signature,q=k==="compact"?D:k==="recovered"?D+1:void 0;return ef(B,q,`${k} signature`)}class v{constructor(k,D,q){this.r=b("r",k),this.s=b("s",D),q!=null&&(this.recovery=q),Object.freeze(this)}static fromBytes(k,D=m){E(k,D);let q;if(D==="der"){const{r:Y,s:K}=tl.toSig(ef(k));return new v(Y,K)}D==="recovered"&&(q=k[0],D="compact",k=k.subarray(1));const U=a.BYTES,W=k.subarray(0,U),V=k.subarray(U,U*2);return new v(a.fromBytes(W),a.fromBytes(V),q)}static fromHex(k,D){return this.fromBytes(pw(k),D)}addRecoveryBit(k){return new v(this.r,this.s,k)}recoverPublicKey(k){const D=s.ORDER,{r:q,s:U,recovery:W}=this;if(W==null||![0,1,2,3].includes(W))throw new Error("recovery id invalid");if(o*aX<D&&W>1)throw new Error("recovery id is ambiguous for h>1 curve");const V=W===2||W===3?q+o:q;if(!s.isValid(V))throw new Error("recovery id 2 or 3 invalid");const Y=s.toBytes(V),K=t.fromBytes(Eu(oX((W&1)===0),Y)),ge=a.inv(V),ae=x(Yi("msgHash",k)),ce=a.create(-ae*ge),Q=a.create(U*ge),se=t.BASE.multiplyUnsafe(ce).add(K.multiplyUnsafe(Q));if(se.is0())throw new Error("point at infinify");return se.assertValidity(),se}hasHighS(){return y(this.s)}toBytes(k=m){if(L7(k),k==="der")return pw(tl.hexFromSig(this));const D=a.toBytes(this.r),q=a.toBytes(this.s);if(k==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return Eu(Uint8Array.of(this.recovery),D,q)}return Eu(D,q)}toHex(k){return wp(this.toBytes(k))}assertValidity(){}static fromCompact(k){return v.fromBytes(Yi("sig",k),"compact")}static fromDER(k){return v.fromBytes(Yi("sig",k),"der")}normalizeS(){return this.hasHighS()?new v(this.r,a.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return wp(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return wp(this.toBytes("compact"))}}const w=r.bits2int||function(B){if(B.length>8192)throw new Error("input is too large");const k=f5(B),D=B.length*8-c;return D>0?k>>BigInt(D):k},x=r.bits2int_modN||function(B){return a.create(w(B))},_=Qy(c);function S(B){return M7("num < 2^"+c,B,al,_),a.toBytes(B)}function A(B,k){return ef(B,void 0,"message"),k?ef(e(B),void 0,"prehashed message"):B}function I(B,k,D){if(["recovered","canonical"].some(Q=>Q in D))throw new Error("sign() legacy options not supported");const{lowS:q,prehash:U,extraEntropy:W}=zE(D,g);B=A(B,U);const V=x(B),Y=rp(a,k),K=[S(Y),S(V)];if(W!=null&&W!==!1){const Q=W===!0?n(h.secretKey):W;K.push(Yi("extraEntropy",Q))}const ge=Eu(...K),ae=V;function ce(Q){const se=w(Q);if(!a.isValidNot0(se))return;const me=a.inv(se),_e=t.BASE.multiply(se).toAffine(),z=a.create(_e.x);if(z===al)return;const R=a.create(me*a.create(ae+z*Y));if(R===al)return;let M=(_e.x===z?0:2)|Number(_e.y&Ep),ee=R;return q&&y(R)&&(ee=a.neg(R),M^=1),new v(z,ee,M)}return{seed:ge,k2sig:ce}}function $(B,k,D={}){B=Yi("message",B);const{seed:q,k2sig:U}=I(B,k,D);return vOe(e.outputLen,a.BYTES,i)(q,U)}function P(B){let k;const D=typeof B=="string"||s5(B),q=!D&&B!==null&&typeof B=="object"&&typeof B.r=="bigint"&&typeof B.s=="bigint";if(!D&&!q)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(q)k=new v(B.r,B.s);else if(D){try{k=v.fromBytes(Yi("sig",B),"der")}catch(U){if(!(U instanceof tl.Err))throw U}if(!k)try{k=v.fromBytes(Yi("sig",B),"compact")}catch{return!1}}return k||!1}function j(B,k,D,q={}){const{lowS:U,prehash:W,format:V}=zE(q,g);if(D=Yi("publicKey",D),k=A(Yi("message",k),W),"strict"in q)throw new Error("options.strict was renamed to lowS");const Y=V===void 0?P(B):v.fromBytes(Yi("sig",B),V);if(Y===!1)return!1;try{const K=t.fromBytes(D);if(U&&Y.hasHighS())return!1;const{r:ge,s:ae}=Y,ce=x(k),Q=a.inv(ae),se=a.create(ce*Q),me=a.create(ge*Q),_e=t.BASE.multiplyUnsafe(se).add(K.multiplyUnsafe(me));return _e.is0()?!1:a.create(_e.x)===ge}catch{return!1}}function L(B,k,D={}){const{prehash:q}=zE(D,g);return k=A(k,q),v.fromBytes(B,"recovered").recoverPublicKey(k).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:f,lengths:h,Point:t,sign:$,verify:j,recoverPublicKey:L,Signature:v,hash:e})}function YOe(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(a=>Math.ceil(a/2)))):void 0;const i=yd(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 ZOe(t){const{CURVE:e,curveOpts:r}=YOe(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 XOe(t,e){const r=e.Point;return Object.assign({},e,{ProjectivePoint:r,CURVE:Object.assign({},t,eX(r.Fn.ORDER,r.Fn.BITS))})}function JOe(t){const{CURVE:e,curveOpts:r,hash:n,ecdsaOpts:i}=ZOe(t),s=GOe(e,r),a=QOe(s,n,i);return XOe(t,a)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function F7(t,e){const r=n=>JOe({...t,hash:n});return{...r(e),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const lX={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},uX={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},dX={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},eRe=yd(lX.p),tRe=yd(uX.p),rRe=yd(dX.p),nRe=F7({...lX,Fp:eRe,lowS:!1},c5);F7({...uX,Fp:tRe,lowS:!1},gPe),F7({...dX,Fp:rRe,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},pPe);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iRe=nRe,fX="base10",ys="base16",Ps="base64pad",xu="base64url",Yy="utf8",hX=0,ml=1,Zy=2,sRe=0,Fj=1,N1=12,OT=32;function aRe(){const t=j7.utils.randomPrivateKey(),e=j7.getPublicKey(t);return{privateKey:Ls(t,ys),publicKey:Ls(e,ys)}}function U7(){const t=oh(OT);return Ls(t,ys)}function oRe(t,e){const r=j7.getSharedSecret(Oa(t,ys),Oa(e,ys)),n=yOe(d5,r,void 0,void 0,OT);return Ls(n,ys)}function Yb(t){const e=d5(Oa(t,ys));return Ls(e,ys)}function Ia(t){const e=d5(Oa(t,Yy));return Ls(e,ys)}function pX(t){return Oa(`${t}`,fX)}function qf(t){return Number(Ls(t,fX))}function gX(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function mX(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),r=(4-e.length%4)%4;return e+"=".repeat(r)}function cRe(t){const e=pX(typeof t.type<"u"?t.type:hX);if(qf(e)===ml&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Oa(t.senderPublicKey,ys):void 0,n=typeof t.iv<"u"?Oa(t.iv,ys):oh(N1),i=Oa(t.symKey,ys),s=qZ(i,n).encrypt(Oa(t.message,Yy)),a=yX({type:e,sealed:s,iv:n,senderPublicKey:r});return t.encoding===xu?gX(a):a}function lRe(t){const e=Oa(t.symKey,ys),{sealed:r,iv:n}=zm({encoded:t.encoded,encoding:t.encoding}),i=qZ(e,n).decrypt(r);if(i===null)throw new Error("Failed to decrypt");return Ls(i,Yy)}function uRe(t,e){const r=pX(Zy),n=oh(N1),i=Oa(t,Yy),s=yX({type:r,sealed:i,iv:n});return e===xu?gX(s):s}function dRe(t,e){const{sealed:r}=zm({encoded:t,encoding:e});return Ls(r,Yy)}function yX(t){if(qf(t.type)===Zy)return Ls($1([t.type,t.sealed]),Ps);if(qf(t.type)===ml){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Ls($1([t.type,t.senderPublicKey,t.iv,t.sealed]),Ps)}return Ls($1([t.type,t.iv,t.sealed]),Ps)}function zm(t){const e=(t.encoding||Ps)===xu?mX(t.encoded):t.encoded,r=Oa(e,Ps),n=r.slice(sRe,Fj),i=Fj;if(qf(n)===ml){const c=i+OT,l=c+N1,u=r.slice(i,c),d=r.slice(c,l),f=r.slice(l);return{type:n,sealed:f,iv:d,senderPublicKey:u}}if(qf(n)===Zy){const c=r.slice(i),l=oh(N1);return{type:n,sealed:c,iv:l}}const s=i+N1,a=r.slice(i,s),o=r.slice(s);return{type:n,sealed:o,iv:a}}function fRe(t,e){const r=zm({encoded:t,encoding:e==null?void 0:e.encoding});return bX({type:qf(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Ls(r.senderPublicKey,ys):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function bX(t){const e=(t==null?void 0:t.type)||hX;if(e===ml){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 Uj(t){return t.type===ml&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function Bj(t){return t.type===Zy}function hRe(t){const e=Buffer.from(t.x,"base64"),r=Buffer.from(t.y,"base64");return $1([new Uint8Array([4]),e,r])}function pRe(t,e){const[r,n,i]=t.split("."),s=Buffer.from(mX(i),"base64");if(s.length!==64)throw new Error("Invalid signature length");const a=s.slice(0,32),o=s.slice(32,64),c=`${r}.${n}`,l=d5(c),u=hRe(e);if(!iRe.verify($1([a,o]),l,u))throw new Error("Invalid signature");return S7(t).payload}const gRe="irn";function vw(t){return(t==null?void 0:t.relay)||{protocol:gRe}}function np(t){const e=b$e[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}function mRe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),a=t[i];r[s]=a}}),r}function qj(t){if(!t.includes("wc:")){const l=xZ(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):"",a=new URLSearchParams(s),o=Object.fromEntries(a.entries()),c=typeof o.methods=="str
444ing"?o.methods.split(","):void 0;return{protocol:n,topic:yRe(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:mRe(o),methods:c,expiryTimestamp:o.expiryTimestamp?parseInt(o.expiryTimestamp,10):void 0}}function yRe(t){return t.startsWith("//")?t.substring(2):t}function bRe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=i,a=r+e+s;t[s]&&(n[a]=t[s])}),n}function Wj(t){const e=new URLSearchParams,r={...bRe(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 ob(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function U0(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function vX(t){const e=[];return Object.values(t).forEach(r=>{e.push(...U0(r.accounts))}),[...new Set(e)]}function vRe(t){const e=[];return Object.values(t).forEach(r=>{e.push(...r.methods)}),[...new Set(e)]}function wRe(t){const e=[];return Object.values(t).forEach(r=>{e.push(...r.events)}),[...new Set(e)]}function ERe(t,e){const r=[];return Object.values(t).forEach(n=>{U0(n.accounts).includes(e)&&r.push(...n.methods)}),r}function xRe(t,e){const r=[];return Object.values(t).forEach(n=>{U0(n.accounts).includes(e)&&r.push(...n.events)}),r}function p5(t){return t.includes(":")}function ip(t){return p5(t)?t.split(":")[0]:t}function zj(t){var r,n,i;const e={};if(!fc(t))return e;for(const[s,a]of Object.entries(t)){const o=p5(s)?[s]:a.chains,c=a.methods||[],l=a.events||[],u=ip(s);e[u]={...e[u],chains:dc(o,(r=e[u])==null?void 0:r.chains),methods:dc(c,(n=e[u])==null?void 0:n.methods),events:dc(l,(i=e[u])==null?void 0:i.events)}}return e}function _Re(t){const e={};return t==null||t.forEach(r=>{var s;const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[],methods:[]}),e[n].accounts.push(r),(s=e[n].chains)==null||s.push(`${n}:${i}`)}),e}function Vj(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=_Re(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=dc(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}function CRe(t,e){var a,o,c,l,u,d;const r=zj(t),n=zj(e),i={},s=Object.keys(r).concat(Object.keys(n));for(const f of s)i[f]={chains:dc((a=r[f])==null?void 0:a.chains,(o=n[f])==null?void 0:o.chains),methods:dc((c=r[f])==null?void 0:c.methods,(l=n[f])==null?void 0:l.methods),events:dc((u=r[f])==null?void 0:u.events,(d=n[f])==null?void 0:d.events)};return i}function Ra(t,e){return!!Array.isArray(t)}function fc(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function ci(t){return typeof t>"u"}function Kn(t,e){return e&&ci(t)?!0:typeof t=="string"&&!!t.trim().length}function RT(t,e){return e&&ci(t)?!0:typeof t=="number"&&!isNaN(t)}function SRe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Jd(i,n)?(n.forEach(a=>{const{accounts:o,methods:c,events:l}=t.namespaces[a],u=U0(o),d=r[a];(!Jd(yZ(a,d),u)||!Jd(d.methods,c)||!Jd(d.events,l))&&(s=!1)}),s):!1}function ww(t){return Kn(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function ARe(t){if(Kn(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&ww(r)}}return!1}function TRe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(Kn(t,!1)){if(e(t))return!0;const r=xZ(t);return e(r)}}catch{}return!1}function IRe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function kRe(t){return t==null?void 0:t.topic}function $Re(t,e){let r=null;return Kn(t==null?void 0:t.publicKey,!1)||(r=ut("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Hj(t){let e=!0;return Ra(t)?t.length&&(e=t.every(r=>Kn(r,!1))):e=!1,e}function NRe(t,e,r){let n=null;return Ra(e)&&e.length?e.forEach(i=>{n||ww(i)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):ww(t)||(n=ln("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:
4445"] }`)),n}function PRe(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const a=NRe(i,yZ(i,s),`${e} ${r}`);a&&(n=a)}),n}function ORe(t,e){let r=null;return Ra(t)?t.forEach(n=>{r||ARe(n)||(r=ln("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ln("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function RRe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=ORe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function DRe(t,e){let r=null;return Hj(t==null?void 0:t.methods)?Hj(t==null?void 0:t.events)||(r=ln("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ln("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function wX(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=DRe(n,`${e}, namespace`);i&&(r=i)}),r}function MRe(t,e,r){let n=null;if(t&&fc(t)){const i=wX(t,e);i&&(n=i);const s=PRe(t,e,r);s&&(n=s)}else n=ut("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function VE(t,e){let r=null;if(t&&fc(t)){const n=wX(t,e);n&&(r=n);const i=RRe(t,e);i&&(r=i)}else r=ut("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function EX(t){return Kn(t.protocol,!0)}function jRe(t,e){let r=!1;return t?t&&Ra(t)&&t.length&&t.forEach(n=>{r=EX(n)}):r=!0,r}function LRe(t){return typeof t=="number"}function As(t){return typeof t<"u"&&typeof t!==null}function FRe(t){return!(!t||typeof t!="object"||!t.code||!RT(t.code,!1)||!t.message||!Kn(t.message,!1))}function URe(t){return!(ci(t)||!Kn(t.method,!1))}function BRe(t){return!(ci(t)||ci(t.result)&&ci(t.error)||!RT(t.id,!1)||!Kn(t.jsonrpc,!1))}function qRe(t){return!(ci(t)||!Kn(t.name,!1))}function Gj(t,e){return!(!ww(e)||!vX(t).includes(e))}function WRe(t,e,r){return Kn(r,!1)?ERe(t,e).includes(r):!1}function zRe(t,e,r){return Kn(r,!1)?xRe(t,e).includes(r):!1}function Kj(t,e,r){let n=null;const i=VRe(t),s=HRe(e),a=Object.keys(i),o=Object.keys(s),c=Qj(Object.keys(t)),l=Qj(Object.keys(e)),u=c.filter(d=>!l.includes(d));return u.length&&(n=ut("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. 445 Required: ${u.toString()} 446 Received: ${Object.keys(e).toString()}`)),Jd(a,o)||(n=ut("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. 447 Required: ${a.toString()} 448 Approved: ${o.toString()}`)),Object.keys(e).forEach(d=>{if(!d.includes(":")||n)return;const f=U0(e[d].accounts);f.includes(d)||(n=ut("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${d} 449 Required: ${d} 450 Approved: ${f.toString()}`))}),a.forEach(d=>{n||(Jd(i[d].methods,s[d].methods)?Jd(i[d].events,s[d].events)||(n=ut("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${d}`)):n=ut("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${d}`))}),n}function VRe(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 Qj(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function HRe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=U0(t[r].accounts))==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 GRe(t,e){return RT(t,!1)&&t<=e.max&&t>=e.min}function Yj(){const t=Gy();return new Promise(e=>{switch(t){case aa.browser:e(KRe());break;case aa.reactNative:e(QRe());break;case aa.node:e(YRe());break;default:e(!0)}})}function KRe(){return F0()&&(navigator==null?void 0:navigator.onLine)}async function QRe(){var t;return md()&&typeof global<"u"&&(global!=null&&global.NetInfo)?(t=await(global==null?void 0:global.NetInfo.fetch()))==null?void 0:t.isConnected:!0}function YRe(){return!0}function ZRe(t){switch(Gy()){case aa.browser:XRe(t);break;case aa.reactNative:JRe(t);break}}function XRe(t){!md()&&F0()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function JRe(t){md()&&typeof global<"u"&&(global!=null&&global.NetInfo)&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}function eDe(){var t;return F0()&&kl.getDocument()?((t=kl.getDocument())==null?void 0:t.visibilityState)==="visible":!0}const HE={};class Hg{static get(e){return HE[e]}static set(e,r){HE[e]=r}static delete(e){delete HE[e]}}function tDe(t){const e=zy.decode(t);if(e.length<33)throw new Error("Too short to contain a public key");return e.slice(1,33)}function rDe({publicKey:t,signature:e,payload:r}){var h;const n=B7(r.method),i=128|parseInt(((h=r.version)==null?void 0:h.toString())||"4"),s=sDe(r.address),a=r.era==="00"?new Uint8Array([0]):B7(r.era);if(a.length!==1&&a.length!==2)throw new Error("Invalid era length");const o=parseInt(r.nonce,16),c=new Uint8Array([o&255,o>>8&255]),l=BigInt(`0x${iDe(r.tip)}`),u=oDe(l),d=new Uint8Array([0,...t,s,...e,...a,...c,...u,...n]),f=aDe(d.length+1);return new Uint8Array([...f,i,...d])}function nDe(t){const e=B7(t),r=x$e.blake2b(e,void 0,32);return"0x"+Buffer.from(r).toString("hex")}function B7(t){return new Uint8Array(t.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function iDe(t){return t.startsWith("0x")?t.slice(2):t}function sDe(t){const e=zy.decode(t)[0];return e===42?0:e===60?2:1}function aDe(t){if(t<64)return new Uint8Array([t<<2]);if(t<16384){const e=t<<2|1;return new Uint8Array([e&255,e>>
vendor: 26,015 bytes, line 450
4508&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 oDe(t){if(t<1n<<6n)return new Uint8Array([Number(t<<2n)]);if(t<1n<<14n){const e=t<<2n|0x01n;return new Uint8Array([Number(e&0xffn),Number(e>>8n&0xffn)])}else if(t<1n<<30n){const e=t<<2n|0x02n;return new Uint8Array([Number(e&0xffn),Number(e>>8n&0xffn),Number(e>>16n&0xffn),Number(e>>24n&0xffn)])}else throw new Error("BigInt compact encoding not supported > 2^30")}function cDe(t){const e=Uint8Array.from(Buffer.from(t.signature,"hex")),r=tDe(t.transaction.address),n=rDe({publicKey:r,signature:e,payload:t.transaction}),i=Buffer.from(n).toString("hex");return nDe(i)}function DT({logger:t,name:e}){const r=typeof t=="string"?mZ({opts:{level:t,name:e}}).logger:t;return r.level=typeof t=="string"?t:t.level,r}class ch{}let lDe=class extends ch{constructor(e){super()}};const Zj=ot.FIVE_SECONDS,lh={pulse:"heartbeat_pulse"};let uDe=class xX extends lDe{constructor(e){super(e),this.events=new ba.EventEmitter,this.interval=Zj,this.interval=(e==null?void 0:e.interval)||Zj}static async init(e){const r=new xX(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(),ot.toMiliseconds(this.interval))}pulse(){this.events.emit(lh.pulse)}};function dDe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function pi(t,...e){try{return dDe(t(...e))}catch(r){return Promise.reject(r)}}function fDe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function hDe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function Zb(t){if(fDe(t))return String(t);if(hDe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Zb(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const q7="base64:";function pDe(t){return typeof t=="string"?t:q7+yDe(t)}function gDe(t){return typeof t!="string"||!t.startsWith(q7)?t:mDe(t.slice(q7.length))}function mDe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function yDe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Ss(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function bDe(...t){return Ss(t.join(":"))}function cb(t){return t=Ss(t),t?t+":":""}function vDe(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 wDe(t,e){return e?t.startsWith(e)&&t[t.length-1]!=="$":t[t.length-1]!=="$"}const EDe="memory",xDe=()=>{const t=new Map;return{name:EDe,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 _De(t={}){const e={mounts:{"":t.driver||xDe()},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(d=>d.startsWith(l)||u&&l.startsWith(d)).map(d=>({relativeBase:l.length>d.length?l.slice(d.length):void 0,mountpoint:d,driver:e.mounts[d]})),i=(l,u)=>{if(e.watching){u=Ss(u);for(const d of e.watchListeners)d(l,u)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await Xj(e.mounts[l],i,l)}},a=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},o=(l,u,d)=>{const f=new Map,h=g=>{let m=f.get(g.base);return m||(m={driver:g.driver,base:g.base,items:[]},f.set(g.base,m)),m};for(const g of l){const m=typeof g=="string",y=Ss(m?g:g.key),b=m?void 0:g.value,E=m||!g.options?u:{...u,...g.options},v=r(y);h(v).items.push({key:y,value:b,relativeKey:v.relativeKey,options:E})}return Promise.all([...f.values()].map(g=>d(g))).then(g=>g.flat())},c={hasItem(l,u={}){l=Ss(l);const{relativeKey:d,driver:f}=r(l);return pi(f.hasItem,d,u)},getItem(l,u={}){l=Ss(l);const{relativeKey:d,driver:f}=r(l);return pi(f.getItem,d,u).then(h=>s1(h))},getItems(l,u={}){return o(l,u,d=>d.driver.getItems?pi(d.driver.getItems,d.items.map(f=>({key:f.relativeKey,options:f.options})),u).then(f=>f.map(h=>({key:bDe(d.base,h.key),value:s1(h.value)}))):Promise.all(d.items.map(f=>pi(d.driver.getItem,f.relativeKey,f.options).then(h=>({key:f.key,value:s1(h)})))))},getItemRaw(l,u={}){l=Ss(l);const{relativeKey:d,driver:f}=r(l);return f.getItemRaw?pi(f.getItemRaw,d,u):pi(f.getItem,d,u).then(h=>gDe(h))},async setItem(l,u,d={}){if(u===void 0)return c.removeItem(l);l=Ss(l);const{relativeKey:f,driver:h}=r(l);h.setItem&&(await pi(h.setItem,f,Zb(u),d),h.watch||i("update",l))},async setItems(l,u){await o(l,u,async d=>{if(d.driver.setItems)return pi(d.driver.setItems,d.items.map(f=>({key:f.relativeKey,value:Zb(f.value),options:f.options})),u);d.driver.setItem&&await Promise.all(d.items.map(f=>pi(d.driver.setItem,f.relativeKey,Zb(f.value),f.options)))})},async setItemRaw(l,u,d={}){if(u===void 0)return c.removeItem(l,d);l=Ss(l);const{relativeKey:f,driver:h}=r(l);if(h.setItemRaw)await pi(h.setItemRaw,f,u,d);else if(h.setItem)await pi(h.setItem,f,pDe(u),d);else return;h.watch||i("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=Ss(l);const{relativeKey:d,driver:f}=r(l);f.removeItem&&(await pi(f.removeItem,d,u),(u.removeMeta||u.removeMata)&&await pi(f.removeItem,d+"$",u),f.watch||i("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=Ss(l);const{relativeKey:d,driver:f}=r(l),h=Object.create(null);if(f.getMeta&&Object.assign(h,await pi(f.getMeta,d,u)),!u.nativeOnly){const g=await pi(f.getItem,d+"$",u).then(m=>s1(m));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,d={}){return this.setItem(l+"$",u,d)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){var y;l=cb(l);const d=n(l,!0);let f=[];const h=[];let g=!0;for(const b of d){(y=b.driver.flags)!=null&&y.maxDepth||(g=!1);const E=await pi(b.driver.getKeys,b.relativeBase,u);for(const v of E){const w=b.mountpoint+Ss(v);f.some(x=>w.startsWith(x))||h.push(w)}f=[b.mountpoint,...f.filter(v=>!v.startsWith(b.mountpoint))]}const m=u.maxDepth!==void 0&&!g;return h.filter(b=>(!m||vDe(b,u.maxDepth))&&wDe(b,l))},async clear(l,u={}){l=cb(l),await Promise.all(n(l,!1).map(async d=>{if(d.driver.clear)return pi(d.driver.clear,d.relativeBase,u);if(d.driver.removeItem){const f=await d.driver.getKeys(d.relativeBase||"",u);return Promise.all(f.map(h=>d.driver.removeItem(h,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>Jj(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 a()}},async unwatch(){e.watchListeners=[],await a()},mount(l,u){if(l=cb(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((d,f)=>f.length-d.length)),e.mounts[l]=u,e.watching&&Promise.resolve(Xj(u,i,l)).then(d=>{e.unwatch[l]=d}).catch(console.error),c},async unmount(l,u=!0){var d,f;l=cb(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&((f=(d=e.unwatch)[l])==null||f.call(d),delete e.unwatch[l]),u&&await Jj(e.mounts[l]),e.mountpoints=e.mountpoints.filter(h=>h!==l),delete e.mounts[l])},getMount(l=""){l=Ss(l)+":";const u=r(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=Ss(l),n(l,u.parents).map(f=>({driver:f.driver,base:f.mountpoint}))},keys:(l,u={})=>c.getKeys(l,u),get:(l,u={})=>c.getItem(l,u),set:(l,u,d={})=>c.setItem(l,u,d),has:(l,u={})=>c.hasItem(l,u),del:(l,u={})=>c.removeItem(l,u),remove:(l,u={})=>c.removeItem(l,u)};return c}function Xj(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function Jj(t){typeof t.dispose=="function"&&await pi(t.dispose)}function uh(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function _X(t,e){let r;const n=()=>{if(r)return r;const i=indexedDB.open(t);return i.onupgradeneeded=()=>i.result.createObjectStore(e),r=uh(i),r.then(s=>{s.onclose=()=>r=void 0},()=>{}),r};return(i,s)=>n().then(a=>s(a.transaction(e,i).objectStore(e)))}let GE;function Xy(){return GE||(GE=_X("keyval-store","keyval")),GE}function eL(t,e=Xy()){return e("readonly",r=>uh(r.get(t)))}function CDe(t,e,r=Xy()){return r("readwrite",n=>(n.put(e,t),uh(n.transaction)))}function SDe(t,e=Xy()){return e("readwrite",r=>(r.delete(t),uh(r.transaction)))}function ADe(t=Xy()){return t("readwrite",e=>(e.clear(),uh(e.transaction)))}function TDe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},uh(t.transaction)}function IDe(t=Xy()){return t("readonly",e=>{if(e.getAllKeys)return uh(e.getAllKeys());const r=[];return TDe(e,n=>r.push(n.key)).then(()=>r)})}const kDe="idb-keyval";var $De=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=_X(t.dbName,t.storeName)),{name:kDe,options:t,async hasItem(i){return!(typeof await eL(r(i),n)>"u")},async getItem(i){return await eL(r(i),n)??null},setItem(i,s){return CDe(r(i),s,n)},removeItem(i){return SDe(r(i),n)},getKeys(){return IDe(n)},clear(){return ADe(n)}}};const NDe="WALLET_CONNECT_V2_INDEXED_DB",PDe="keyvaluestorage";let ODe=class{constructor(){this.indexedDb=_De({driver:$De({dbName:NDe,storeName:PDe})})}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,Uf(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var KE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xb={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 KE<"u"&&KE.localStorage?Xb.exports=KE.localStorage:typeof window<"u"&&window.localStorage?Xb.exports=window.localStorage:Xb.exports=new e})();function RDe(t){var e;return[t[0],Ff((e=t[1])!=null?e:"")]}let DDe=class{constructor(){this.localStorage=Xb.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(RDe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Ff(r)}async setItem(e,r){this.localStorage.setItem(e,Uf(r))}async removeItem(e){this.localStorage.removeItem(e)}};const MDe="wc_storage_version",tL=1,jDe=async(t,e,r)=>{const n=MDe,i=await e.getItem(n);if(i&&i>=tL){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const a=[];for(;s.length;){const o=s.shift();if(!o)continue;const c=o.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const l=await t.getItem(o);await e.setItem(o,l),a.push(o)}}await e.setItem(n,tL),r(e),LDe(t,a)},LDe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let FDe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new DDe;this.storage=e;try{const r=new ODe;jDe(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)})}},UDe=class extends ch{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},BDe=class extends ch{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},qDe=class{constructor(e,r){this.logger=e,this.core=r}},WDe=class extends ch{constructor(e,r){super(),this.relayer=e,this.logger=r}},zDe=class extends ch{constructor(e){super()}},VDe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},HDe=class extends ch{constructor(e,r){super(),this.relayer=e,this.logger=r}},GDe=class extends ch{constructor(e,r){super(),this.core=e,this.logger=r}},KDe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},QDe=class{constructor(e,r){this.projectId=e,this.logger=r}},YDe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},ZDe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},XDe=class{constructor(e){this.client=e}};const JDe="PARSE_ERROR",eMe="INVALID_REQUEST",tMe="METHOD_NOT_FOUND",rMe="INVALID_PARAMS",CX="INTERNAL_ERROR",MT="SERVER_ERROR",nMe=[-32700,-32600,-32601,-32602,-32603],P1={[JDe]:{code:-32700,message:"Parse error"},[eMe]:{code:-32600,message:"Invalid Request"},[tMe]:{code:-32601,message:"Method not found"},[rMe]:{code:-32602,message:"Invalid params"},[CX]:{code:-32603,message:"Internal error"},[MT]:{code:-32e3,message:"Server error"}},SX=MT;function iMe(t){return nMe.includes(t)}function rL(t){return Object.keys(P1).includes(t)?P1[t]:P1[SX]}function sMe(t){const e=Object.values(P1).find(r=>r.code===t);return e||P1[SX]}function AX(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var QE={},Fc={},nL;function aMe(){if(nL)return Fc;nL=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.isBrowserCryptoAvailable=Fc.getSubtleCrypto=Fc.getBrowerCrypto=void 0;function t(){return(Yn===null||Yn===void 0?void 0:Yn.crypto)||(Yn===null||Yn===void 0?void 0:Yn.msCrypto)||{}}Fc.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Fc.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Fc.isBrowserCryptoAvailable=r,Fc}var Uc={},iL;function oMe(){if(iL)return Uc;iL=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.isBrowser=Uc.isNode=Uc.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Uc.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Uc.isNode=e;function r(){return!t()&&!e()}return Uc.isBrowser=r,Uc}var sL;function cMe(){return sL||(sL=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qy;e.__exportStar(aMe(),t),e.__exportStar(oMe(),t)})(QE)),QE}var lMe=cMe();function Go(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Nu(t=6){return BigInt(Go(t))}function uo(t,e,r){return{id:r||Go(),jsonrpc:"2.0",method:t,params:e}}function Vm(t,e){return{id:t,jsonrpc:"2.0",result:e}}function g5(t,e,r){return{id:t,jsonrpc:"2.0",error:uMe(e)}}function uMe(t,e){return typeof t>"u"?rL(CX):(typeof t=="string"&&(t=Object.assign(Object.assign({},rL(MT)),{message:t})),iMe(t.code)&&(t=sMe(t.code)),t)}let dMe=class{},fMe=class extends dMe{constructor(){super()}},hMe=class extends fMe{constructor(e){super()}};const pMe="^https?:",gMe="^wss?:";function mMe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function TX(t,e){const r=mMe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function aL(t){return TX(t,pMe)}function oL(t){return TX(t,gMe)}function yMe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function IX(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function jT(t){return IX(t)&&"method"in t}function m5(t){return IX(t)&&(Ko(t)||ka(t))}function Ko(t){return"result"in t}function ka(t){return"error"in t}let LT=class extends hMe{constructor(e){super(e),this.events=new ba.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(uo(e.method,e.params||[],e.id||Nu().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=>{ka(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),m5(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 bMe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),vMe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",cL=t=>t.split("?")[0],lL=10,wMe=bMe();let EMe=class{constructor(e){if(this.url=e,this.events=new ba.EventEmitter,this.registering=!1,!oL(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(Uf(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!oL(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=lMe.isReactNative()?void 0:{rejectUnauthorized:!yMe(e)},s=new wMe(e,[],i);vMe()?s.onerror=a=>{const o=a;n(this.emitError(o.error))}:s.on("error",a=>{n(this.emitError(a))}),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"?Ff(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=g5(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return AX(e,cL(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>lL&&this.events.setMaxListeners(lL)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${cL(this.url)}`));return this.events.emit("register_error",r),r}};var xMe={NVM_INC:"/Users/geralt.dao/.nvm/versions/node/v18.17.1/include/node",TERM_PROGRAM:"vscode",VSCODE_GIT_IPC_AUTH_TOKEN:"bcb4b3bf72c7ae72f3903d1f04be54e95b548a98128534518bd9701ab75054bf",NODE:"/opt/homebrew/Cellar/node/24.8.0/bin/node",NVM_CD_FLAGS:"-q",ANDROID_HOME:"/Users/geralt.dao/Library/Android/sdk",GEMINI_CLI_IDE_WORKSPACE_PATH:"/Users/geralt.dao/hola-tech/botdex-interface",INIT_CWD:"/Users/geralt.dao/hola-tech/botdex-interface",SHELL:"/bin/zsh",TERM:"xterm-256color",TMPDIR:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",TERM_PROGRAM_VERSION:"2.6.19",npm_config_npm_globalconfig:"/opt/homebrew/Cellar/node/24.8.0/etc/npmrc",MallocNanoZone:"0",CURSOR_TRACE_ID:"c7e1f3f6815a4d849e5f973acf0a80f4",ZDOTDIR:"/Users/geralt.dao",npm_config_registry:"https://registry.npmjs.org/",ZSH:"/Users/geralt.dao/.oh-my-zsh",ENABLE_IDE_INTEGRATION:"true",USER:"geralt.dao",NVM_DIR:"/Users/geralt.dao/.nvm",LS_COLORS:"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/Users/geralt.dao/Library/Preferences/pnpm/rc",PNPM_SCRIPT_SRC_DIR:"/Users/geralt.dao/hola-tech/botdex-interface",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.mwgQRp7Nkf/Listeners",CLAUDE_CODE_SSE_PORT:"56099",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",VSCODE_PROFILE_INITIALIZED:"1",npm_execpath:"/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/bin/pnpm.cjs",PAGER:"less",LSCOLORS:"Gxfxcxdxbxegedabagacad",npm_config_frozen_lockfile:"",npm_config_verify_deps_before_run:"false",PATH:"/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.bin:/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/dist/node-gyp-bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/[email protected]/bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/postgresql@15/bin:/Users/geralt.dao/.amplify/bin:/Users/geralt.dao/.bun/bin:/opt/homebrew/bin:/Users/geralt.dao/.codeium/windsurf/bin:/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/postgresql@15/bin:/Users/geralt.dao/.amplify/bin:/Users/geralt.dao/.local/bin:/Users/geralt.dao/.bun/bin:/Users/geralt.dao/.codeium/windsurf/bin:/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/geralt.dao/go/bin:/Users/geralt.dao/Library/Android/sdk/emulator:/Users/geralt.dao/Library/Android/sdk/platform-tools:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/geralt.dao/go/bin:/Users/geralt.dao/Library/Android/sdk/emulator:/Users/geralt.dao/Library/Android/sdk/platform-tools",LaunchInstanceID:"B31E047D-3F24-4B63-AFE7-D9CC50F0BC74",npm_package_json:"/Users/geralt.dao/hola-tech/botdex-interface/package.json",__CFBundleIdentifier:"com.todesktop.230313mzl4w4u92",USER_ZDOTDIR:"/Users/geralt.dao",PWD:"/Users/geralt.dao/hola-tech/botdex-interface",npm_command:"run-script",JAVA_HOME:"/Users/geralt.dao/Library/Java/JavaVirtualMachines/openjdk-21.0.1/Contents/Home",npm_config__jsr_registry:"https://npm.jsr.io/",npm_lifecycle_event:"build",LANG:"C.UTF-8",npm_package_name:"universe",NODE_PATH:"/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/bin/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/node_modules",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",GEMINI_CLI_IDE_AUTH_TOKEN:"ffcaa9c2-67ff-44aa-8784-f1f830770ce9",npm_config_node_gyp:"/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",XPC_SERVICE_NAME:"0",pnpm_config_verify_deps_before_run:"false",VSCODE_INJECTION:"1",HOME:"/Users/geralt.dao",SHLVL:"2",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Cursor.a
450pp/Contents/Resources/app/extensions/git/dist/askpass-main.js",HOMEBREW_PREFIX:"/opt/homebrew",GK_GL_ADDR:"http://127.0.0.1:55023",LOGNAME:"geralt.dao",LESS:"-R",npm_lifecycle_script:"vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/vscode-git-106008ff40.sock",GK_GL_PATH:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/gitkraken/gitlens/gitlens-ipc-server-1774-55023.json",NVM_BIN:"/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin",BUN_INSTALL:"/Users/geralt.dao/.bun",GEMINI_CLI_IDE_SERVER_PORT:"55024",npm_config_user_agent:"pnpm/10.26.2 npm/? node/v24.8.0 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Cursor.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Cursor.app/Contents/Frameworks/Cursor Helper (Plugin).app/Contents/MacOS/Cursor Helper (Plugin)",OSLogRateLimit:"64",SECURITYSESSIONID:"186af",COLORTERM:"truecolor",npm_node_execpath:"/opt/homebrew/Cellar/node/24.8.0/bin/node",NODE_ENV:"production",VITE_APP_URL_API:"https://api.godex.ai/api",VITE_APP_SOCKET:"https://api.godex.ai",VITE_APP_DEFAUL_CHAIN_ID:"42161",VITE_APP_PRIVY_APP_ID:"clxlnrvzy073ll6yvy1b6lcko",VITE_APP_BLOCKPASS_CLIENT_ID:"godexai_24fd5",VITE_APP_BOT_NAME:"godex_ai_bot",VITE_APP_GET_STREAM_API_KEY:"twfjd2y6asta",VITE_APP_LEDGER_ADDRESS:"0x34EC5aC5B0074e9385d8d4d4A43a478c0FBA1f5d",VITE_APP_SECRET_KEY:"http://localhost:3456/api",VITE_APP_AWS_API_ENDPOINT:"https://gateway-arbitrum.network.thegraph.com/api/d762176fa97a19cbfec853f321540d1f/subgraphs/id/35AYsvtJ7SjD93JZcjHK7KTSFyC8h74YHkg2hTxRsRer",VITE_APP_AWS_REALTIME_ENDPOINT:"wss://beta.realtime.gateway.uniswap.org/graphql",VITE_APP_AWS_REALTIME_TOKEN:"realtime-3DDE0DA0-3408-4FD0-9DC3-5E285D70D29C",VITE_APP_GODEX_SUBGRAPH:"https://api.studio.thegraph.com/query/69483/godex-trading/version/latest",VITE_APP_SUBGRAPH_API_KEY:"0bdfb5369a3f673c2f4d7b07fdc47356 6d1aad6c2bd525626fe78c662c0b99b1 f2182b8d85650307efdc7ee5f5e928d5 d762176fa97a19cbfec853f321540d1f 4d180b6f0318804bca6bad7a412df4e3",VITE_APP_IS_UNISWAP_INTERFACE:"true",VITE_APP_VAPID_KEY:"BEaejLMlaWDuAcFbg_J0Lxj3-32rU8dl9MiGmE58mW1DmNxZrIwPwUQSS6vMYdpjG1x7DUBNI83Y5Rz2pO4SulU",VITE_FIREBASE_APIKEY:"AIzaSyBg8UnAtHTYw0EI1F6L_6awN5c7tkekWE4",VITE_FIREBASE_AUTH_DOMAIN:"notifi-e7ddc.firebaseapp.com",VITE_FIREBASE_PJ_ID:"notifi-e7ddc",VITE_FIREBASE_STORAGE_BUCKET:"notifi-e7ddc.appspot.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"595100990974",VITE_FIREBASE_APP_ID:"1:595100990974:web:8de8a14f57642af6c154af",VITE_APP_INTERGRATOR_ID:"btcw.tech-fd0e21e7-dc58-45ef-aabc-3141ed135e65",VITE_COINGECKO_API_KEY:"CG-C457Em1XmWjRS2d2gXUBBJ5V"};const kX="wc",$X=2,W7="core",Ec=`${kX}@2:${W7}:`,_Me={logger:"error"},CMe={database:":memory:"},SMe="crypto",uL="client_ed25519_seed",AMe=ot.ONE_DAY,TMe="keychain",IMe="0.3",kMe="messages",$Me="0.3",NMe=ot.SIX_HOURS,PMe="publisher",NX="irn",OMe="error",PX="wss://relay.walletconnect.org",RMe="relayer",qn={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"},DMe="_subscription",xa={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},MMe=.1,z7="2.23.8",on={link_mode:"link_mode",relay:"relay"}
vendor: 11,197 bytes, line 450
450,Jb={inbound:"inbound",outbound:"outbound"},jMe="0.3",LMe="WALLETCONNECT_CLIENT_ID",dL="WALLETCONNECT_LINK_MODE_APPS",Js={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},FMe="subscription",UMe="0.3",BMe="pairing",qMe="0.3",Gg={wc_pairingDelete:{req:{ttl:ot.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ot.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ot.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ot.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ot.ONE_DAY,prompt:!1,tag:0},res:{ttl:ot.ONE_DAY,prompt:!1,tag:0}}},zd={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Za={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},WMe="history",zMe="0.3",VMe="expirer",Sa={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},HMe="0.3",GMe="verify-api",KMe="https://verify.walletconnect.com",OX="https://verify.walletconnect.org",O1=OX,QMe=`${O1}/v3`,YMe=[KMe,OX],ZMe="echo",XMe="https://echo.walletconnect.com",zo={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"},Gc={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"},Xa={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"},Pd={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"},Od={authenticated_session_approve_started:"authenticated_session_approve_started",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"},Kg={no_internet_connection:"no_internet_connection",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"},JMe=.1,eje="event-client",tje=86400,rje="https://pulse.walletconnect.org/batch";function nje(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),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=i}var o=t.length,c=t.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function d(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 m=0,y=0,b=0,E=g.length;b!==E&&g[b]===0;)b++,m++;for(var v=(E-b)*u+1>>>0,w=new Uint8Array(v);b!==E;){for(var x=g[b],_=0,S=v-1;(x!==0||_<y)&&S!==-1;S--,_++)x+=256*w[S]>>>0,w[S]=x%o>>>0,x=x/o>>>0;if(x!==0)throw new Error("Non-zero carry");y=_,b++}for(var A=v-y;A!==v&&w[A]===0;)A++;for(var I=c.repeat(m);A<v;++A)I+=t.charAt(w[A]);return I}function f(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var m=0;if(g[m]!==" "){for(var y=0,b=0;g[m]===c;)y++,m++;for(var E=(g.length-m)*l+1>>>0,v=new Uint8Array(E);g[m];){var w=r[g.charCodeAt(m)];if(w===255)return;for(var x=0,_=E-1;(w!==0||x<b)&&_!==-1;_--,x++)w+=o*v[_]>>>0,v[_]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");b=x,m++}if(g[m]!==" "){for(var S=E-b;S!==E&&v[S]===0;)S++;for(var A=new Uint8Array(y+(E-S)),I=y;S!==E;)A[I++]=v[S++];return A}}}function h(g){var m=f(g);if(m)return m;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:f,decode:h}}var ije=nje,sje=ije;const aje=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")},oje=t=>new TextEncoder().encode(t),cje=t=>new TextDecoder().decode(t);class lje{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 uje{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 RX(this,e)}}class dje{constructor(e){this.decoders=e}or(e){return RX(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 RX=(t,e)=>new dje({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class fje{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new lje(e,r,n),this.decoder=new uje(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const y5=({name:t,prefix:e,encode:r,decode:n})=>new fje(t,e,r,n),Jy=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=sje(r,e);return y5({prefix:t,name:e,encode:n,decode:s=>aje(i(s))})},hje=(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 a=new Uint8Array(s*r/8|0);let o=0,c=0,l=0;for(let u=0;u<s;++u){const d=i[t[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,o+=r,o>=8&&(o-=8,a[l++]=255&c>>o)}if(o>=r||255&c<<8-o)throw new SyntaxError("Unexpected end of data");return a},pje=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let s="",a=0,o=0;for(let c=0;c<t.length;++c)for(o=o<<8|t[c],a+=8;a>r;)a-=r,s+=e[i&o>>a];if(a&&(s+=e[i&o<<r-a]),n)for(;s.length*r&7;)s+="=";return s},qi=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>y5({prefix:e,name:t,encode(i){return pje(i,n,r)},decode(i){return hje(i,n,r,t)}}),gje=y5({prefix:"\0",name:"identity",encode:t=>cje(t),decode:t=>oje(t)});var mje=Object.freeze({__proto__:null,identity:gje});const yje=qi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var bje=Object.freeze({__proto__:null,base2:yje});const vje=qi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var wje=Object.freeze({__proto__:null,base8:vje});const Eje=Jy({prefix:"9",name:"base10",alphabet:"0123456789"});var xje=Object.freeze({__proto__:null,base10:Eje});const _je=qi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Cje=qi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Sje=Object.freeze({__proto__:null,base16:_je,base16upper:Cje});const Aje=qi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Tje=qi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ije=qi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),kje=qi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),$je=qi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Nje=qi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pje=qi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Oje=qi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Rje=qi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Dje=Object.freeze({__proto__:null,base32:Aje,base32hex:$je,base32hexpad:Pje,base32hexpadupper:Oje,base32hexupper:Nje,base32pad:Ije,base32padupper:kje,base32upper:Tje,base32z:Rje});const Mje=Jy({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),jje=Jy({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Lje=Object.freeze({__proto__:null,base36:Mje,base36upper:jje});const Fje=Jy({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Uje=Jy({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bje=Object.freeze({__proto__:null,base58btc:Fje,base58flickr:Uje});const qje=qi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
450+/",bitsPerChar:6}),Wje=qi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),zje=qi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Vje=qi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Hje=Object.freeze({__proto__:null,base64:qje,base64pad:Wje,base64url:zje,base64urlpad:Vje});const DX=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),Gje=DX.reduce((t,e,r)=>(t[r]=e,t),[]),Kje=DX.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Qje(t){return t.reduce((e,r)=>(e+=Gje[r],e),"")}function Yje(t){const e=[];for(const r of t){const n=Kje[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Zje=y5({prefix:"ð",name:"base256emoji",encode:Qje,decode:Yje});var Xje=Object.freeze({__proto__:null,base256emoji:Zje});new TextEncoder,new TextDecoder;const fL={...mje,...bje,...wje,...xje,...Sje,...Dje,...Lje,...Bje,...Hje,...Xje};function MX(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Jje(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?MX(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function jX(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const hL=jX("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),YE=jX("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=Jje(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),eLe={utf8:hL,"utf-8":hL,hex:fL.base16,latin1:YE,ascii:YE,binary:YE,...fL};function tLe(t,e="utf8"){const r=eLe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?MX(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}let rLe=class{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=TMe,this.version=IMe,this.initialized=!1,this.storagePrefix=Ec,this.init=async()=>{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=ut("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=va(r,this.name)}get context(){return Hs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,I7(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?k7(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}},nLe=class{constructor(e,r,n){this.core=e,this.logger=r,this.name=SMe,this.randomSessionIdentifier=U7(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>
vendor: 3,216 bytes, line 450
450{if(this.isInitialized(),this.clientId)return this.clientId;const i=await this.getClientSeed(),s=QM(i),a=aZ(s.publicKey);return this.clientId=a,a},this.generateKeyPair=()=>{this.isInitialized();const i=aRe();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),a=QM(s),o=this.randomSessionIdentifier;return await Eke(o,i,AMe,a)},this.generateSharedKey=(i,s,a)=>{this.isInitialized();const o=this.getPrivateKey(i),c=oRe(o,s);return this.setSymKey(c,a)},this.setSymKey=async(i,s)=>{this.isInitialized();const a=s||Yb(i);return await this.keychain.set(a,i),a},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,a)=>{this.isInitialized();const o=bX(a),c=Uf(s);if(Bj(o))return uRe(c,a==null?void 0:a.encoding);if(Uj(o)){const f=o.senderPublicKey,h=o.receiverPublicKey;i=await this.generateSharedKey(f,h)}const l=this.getSymKey(i),{type:u,senderPublicKey:d}=o;return cRe({type:u,symKey:l,message:c,senderPublicKey:d,encoding:a==null?void 0:a.encoding})},this.decode=async(i,s,a)=>{this.isInitialized();const o=fRe(s,a);if(Bj(o)){const c=dRe(s,a==null?void 0:a.encoding);return Ff(c)}if(Uj(o)){const c=o.receiverPublicKey,l=o.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=lRe({symKey:c,encoded:s,encoding:a==null?void 0:a.encoding});return Ff(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(i,s=Ps)=>{const a=zm({encoded:i,encoding:s});return qf(a.type)},this.getPayloadSenderPublicKey=(i,s=Ps)=>{const a=zm({encoded:i,encoding:s});return a.senderPublicKey?Ls(a.senderPublicKey,ys):void 0},this.core=e,this.logger=va(r,this.name),this.keychain=n||new rLe(this.core,this.logger)}get context(){return Hs(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(uL)}catch{e=U7(),await this.keychain.set(uL,e)}return tLe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}},iLe=class extends qDe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.messagesWithoutClientAck=new Map,this.name=kMe,this.version=$Me,this.initialized=!1,this.storagePrefix=Ec,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}}},this.set=async(n,i,s)=>{this.isInitialized();const a=Ia(i);let o=this.messages.get(n);if(typeof o>"u"&&(o={}),typeof o[a]<"u")return a;
450if(o[a]=i,this.messages.set(n,o),s===Jb.inbound){const c=this.messagesWithoutClientAck.get(n)||{};this.messagesWithoutClientAck.set(n,{...c,[a]:i})}return await this.persist(),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.getWithoutAck=n=>{this.isInitialized();const i={};for(const s of n){const a=this.messagesWithoutClientAck.get(s)||{};i[s]=Object.values(a)}return i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),a=Ia(i);return typeof s[a]<"u"},this.ack=async(n,i)=>{this.isInitialized();const s=this.messagesWithoutClientAck.get(n);if(typeof s>"u")return;const a=Ia(i);delete s[a],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(n):this.messagesWithoutClientAck.set(n,s),await this.persist()},this.del=async n=>{this.isInitialized(),this.messages.delete(n),this.messagesWithoutClientAck.delete(n),await this.persist()},this.logger=va(e,this.name),this.core=r}get context(){return Hs(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,I7(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,I7(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?k7(e):void 0}async getRelayerMessagesWithoutClientAck(){const e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof e<"u"?k7(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){const{message:e}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}};class sLe extends WDe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ba.EventEmitter,this.name=PMe,this.queue=new Map,this.publishTimeout=ot.toMiliseconds(ot.ONE_MINUTE),this.initialPublishTimeout=ot.toMiliseconds(ot.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var h,g,m,y,b;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});const a=(s==null?void 0:s.ttl)||NMe,o=(s==null?void 0:s.prompt)||!1,c=(s==null?void 0:s.tag)||0,l=(s==null?void 0:s.id)||Nu().toString(),u=np(vw().protocol),d={id:l,method:(s==null?void 0:s.publishMethod)||u.publish,params:{topic:n,message:i,ttl:a,prompt:o,tag:c,attestation:s==null?void 0:s.attestation,...s==null?void 0:s.tvf}},f=`Failed to publish payload, please try again. id:${l} tag:${c}`;try{ci((h=d.params)==null?void 0:h.prompt)&&((g=d.params)==null||delete g.prompt),ci((m=d.params)==null?void 0:m.tag)&&((y=d.params)==null||delete y.tag);const E=new Promise(async v=>{const w=({id:_})=>{var S;((S=d.id)==null?void 0:S.toString())===_.toString()&&(this.removeRequestFromQueue(_),this.relayer.events.removeListener(qn.publish,w),v())};this.relayer.events.on(qn.publish,w);const x=nc(new Promise((_,S)=>{this.rpcPublish(d,s).then(_).catch(A=>{this.logger.warn(A,A==null?void 0:A.message),S(A)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${l} tag:${c}`);try{await x,this.events.removeListener(qn.publish,w)}catch(_){this.queue.set(l,{request:d,opts:s,attempt:1}),this.logger.warn(_,_==null?void 0:_.message)}});this.logger.trace({type:"method",method:"publish",params:{id:l,topic:n,message:i,opts:s}}),await nc(E,this.publishTimeout,f)}catch(E){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(E),(b=s==null?void 0:s.internal)==null?void 0:b.throwOnFailedPublish)throw E}finally{this.queue.delete(l)}},this.publishCustom=async n=>{var b,E,v,w,x;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:n});const{payload:i,opts:s={}}=n,{attestation:a,tvf:o,publishMethod:c,prompt:l,tag:u,ttl:d=ot.FIVE_MINUTES}=s,f=s.id||Nu().toString(),h=np(vw().protocol),g=c||h.publish,m={id:f,method:g,params:{...i,ttl:d,prompt:l,tag:u,attestation:a,...o}},y=`Failed to publish custom payload, please try again. id:${f} tag:${u}`;try{ci((b=m.params)==null?void 0:b.prompt)&&((E=m.params)==null||delete E.prompt),ci((v=m.params)==null?void 0:v.tag)&&((w=m.params)==null||delete w.tag);const _=new Promise(async S=>{const A=({id:$})=>{var P;((P=m.id)==null?void 0:P.toString())===$.toString()&&(this.removeRequestFromQueue($),this.relayer.events.removeListener(qn.publish,A),S())};this.relayer.events.on(qn.publish,A);const I=nc(new Promise(($,P)=>
vendor: 56,286 bytes, line 450
450{this.rpcPublish(m,s).then($).catch(j=>{this.logger.warn(j,j==null?void 0:j.message),P(j)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${g} id:${f} tag:${u}`);try{await I,this.events.removeListener(qn.publish,A)}catch($){this.queue.set(f,{request:m,opts:s,attempt:1}),this.logger.warn($,$==null?void 0:$.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,payload:i,opts:s}}),await nc(_,this.publishTimeout,y)}catch(_){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(_),(x=s==null?void 0:s.internal)==null?void 0:x.throwOnFailedPublish)throw _}finally{this.queue.delete(f)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=va(r,this.name),this.registerEventListeners()}get context(){return Hs(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(qn.publish,{...e,...r}),this.logger.debug("Successfully Published Payload"),n}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,r)=>{var i;const n=e.attempt+1;this.queue.set(r,{...e,attempt:n}),this.logger.warn({},`Publisher: queue->publishing: ${e.request.id}, tag: ${(i=e.request.params)==null?void 0:i.tag}, attempt: ${n}`),await this.rpcPublish(e.request,e.opts),this.logger.warn({},`Publisher: queue->published: ${e.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(lh.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(qn.connection_stalled);return}this.checkQueue()}),this.relayer.on(qn.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class aLe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),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)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}let oLe=class extends HDe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new aLe,this.events=new ba.EventEmitter,this.name=FMe,this.version=UMe,this.pending=new Map,this.cached=[],this.initialized=!1,this.storagePrefix=Ec,this.subscribeTimeout=ot.toMiliseconds(ot.ONE_MINUTE),this.initialSubscribeTimeout=ot.toMiliseconds(ot.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0},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 a=vw(i),o={topic:n,relay:a,transportType:i==null?void 0:i.transportType};(s=i==null?void 0:i.internal)!=null&&s.skipSubscribe||this.pending.set(n,o);const c=await this.rpcSubscribe(n,a,i);return typeof c=="string"&&(this.onSubscribe(c,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),c}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},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)},this.isSubscribed=n=>new Promise(i=>{i(this.topicMap.topics.includes(n))}),this.isKnownTopic=n=>new Promise(i=>{i(this.topicMap.topics.includes(n)||this.pending.has(n)||this.cached.some(s=>s.topic===n))}),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},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)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(lh.pulse,async()=>{await this.checkPending()}),this.events.on(Js.created,async n=>{const i=Js.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(Js.deleted,async n=>{const i=Js.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})},this.relayer=e,this.logger=va(r,this.name),this.clientId=""}get context(){return Hs(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=vw(n);await this.restartToComplete({topic:e,id:r,relay:i}),await this.rpcUnsubscribe(e,r,i);const s=ln("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 o,c;const i=await this.getSubscriptionId(e);if((o=n==null?void 0:n.internal)!=null&&o.skipSubscribe)return i;(!n||(n==null?void 0:n.transportType)===on.relay)&&await this.restartToComplete({topic:e,id:e,relay:r});const s={method:np(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});const a=(c=n==null?void 0:n.internal)==null?void 0:c.throwOnFailedPublish;try{if((n==null?void 0:n.transportType)===on.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(d=>this.logger.warn(d))},ot.toMiliseconds(ot.ONE_SECOND)),i;const l=new Promise(async d=>{const f=h=>{h.topic===e&&(this.events.removeListener(Js.created,f),d(h.id))};this.events.on(Js.created,f);try{const h=await nc(new Promise((g,m)=>{this.relayer.request(s).catch(y=>{this.logger.warn(y,y==null?void 0:y.message),m(y)}).then(g)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(Js.created,f),d(h)}catch{}}),u=await nc(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!u&&a)throw new Error(`Subscribing to ${e} failed, please try again`);return u?i:null}catch(l){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(qn.connection_stalled),a)throw l}return null}async rpcBatchSubscribe(e){if(!e.length)return!0;const r=e[0].relay,n={method:np(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 nc(new Promise((i,s)=>{this.relayer.request(n).then(i).catch(a=>{this.logger.warn(a),s(a)})}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again"),!0}catch{return this.relayer.events.emit(qn.connection_stalled),!1}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:np(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 nc(new Promise((s,a)=>{this.relayer.request(n).catch(o=>{this.logger.warn(o),a(o)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(qn.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:np(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,{...r,id:e}),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,{...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,{...r}),this.topicMap.set(r.topic,e),this.events.emit(Js.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}=ut("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(Js.deleted,{...n,reason:r})}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Js.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(Js.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}=ut("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=>({...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 RNe(ot.toMiliseconds(ot.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}=ut("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 Ia(e+await this.getClientId())}},cLe=class extends zDe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ba.EventEmitter,this.name=RMe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=ot.toMiliseconds(ot.THIRTY_SECONDS+ot.FIVE_SECONDS),this.reconnectInProgress=!1,this.requestsInFlight=[],this.connectTimeout=ot.toMiliseconds(ot.ONE_SECOND*15),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,this.stalledRestartBaseInterval=ot.toMiliseconds(ot.ONE_SECOND*2),this.stalledRestartMaxInterval=ot.toMiliseconds(ot.THIRTY_SECONDS),this.request=async r=>{var i,s;this.logger.debug("Publishing Request Payload");const n=r.id||Nu().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - publishing...");const a=`${n}:${((s=r.params)==null?void 0:s.tag)||""}`;this.requestsInFlight.push(a);const o=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(c=>c!==a),o}catch(a){throw this.logger.debug(`Failed to Publish Request: ${n}`),a}},this.resetPingTimeout=()=>{hw()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i,s;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(s=(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null?void 0:i.terminate)==null||s.call(i)}catch(a){this.logger.warn(a,a==null?void 0:a.message)}},this.heartBeatTimeout))},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},"Relayer connected ð"),this.startPingTimeout(),this.events.emit(qn.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},"Relayer disconnected ð"),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.fatal(`Fatal socket error: ${r.message}`),this.events.emit(qn.error,r),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(n=>this.logger.warn(n))},this.registerProviderListeners=()=>{this.provider.on(xa.payload,this.onPayloadHandler),this.provider.on(xa.connect,this.onConnectHandler),this.provider.on(xa.disconnect,this.onDisconnectHandler),this.provider.on(xa.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=DT({logger:e.logger??OMe,name:this.name}),this.messages=new iLe(this.logger,e.core),this.subscriber=new oLe(this,this.logger),this.publisher=new sLe(this,this.logger),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||PX,bNe()?this.packageName=uj():vNe()&&(this.bundleId=uj()),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 Hs(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:on.relay},Jb.outbound)}async publishCustom(e){this.isInitialized(),await this.publisher.publishCustom(e)}async subscribe(e,r){var o,c,l;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const n=typeof((o=r==null?void 0:r.internal)==null?void 0:o.throwOnFailedPublish)>"u"?!0:(c=r==null?void 0:r.internal)==null?void 0:c.throwOnFailedPublish;let i=((l=this.subscriber.topicMap.get(e))==null?void 0:l[0])||"",s;const a=u=>{u.topic===e&&(this.subscriber.off(Js.created,a),s())};return await Promise.all([new Promise(u=>{s=u,this.subscriber.on(Js.created,a)}),new Promise(async(u,d)=>{i=await this.subscriber.subscribe(e,{internal:{throwOnFailedPublish:n},...r}).catch(f=>{n&&d(f)})||i,u()})]),i}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 nc(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 Yj())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=Hn(ot.FIVE_MINUTES),s={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(qn.message,e),await this.recordMessageEvent(e,Jb.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(xa.disconnect,s),await nc(new Promise((a,o)=>{this.provider.connect().then(a).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{this.provider.off(xa.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(a,o)=>{const c=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(xa.disconnect,c),await this.subscriber.start().then(a).catch(o).finally(()=>{this.provider.off(xa.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,ot.toMiliseconds(r*1))),r++}}startPingTimeout(){var e,r,n,i,s;if(hw())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(a){this.logger.warn(a,a==null?void 0:a.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new LT(new EMe(CNe({sdkVersion:z7,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}),jT(e)){if(!e.method.endsWith(DMe))return;const r=e.params,{topic:n,message:i,publishedAt:s,attestation:a}=r.data,o={topic:n,message:i,publishedAt:s,transportType:on.relay,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace({type:"event",event:r.id,...o}),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else m5(e)&&this.events.emit(qn.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,Jb.inbound),this.events.emit(qn.message,e))}async acknowledgePayload(e){const r=Vm(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(xa.payload,this.onPayloadHandler),this.provider.off(xa.connect,this.onConnectHandler),this.provider.off(xa.disconnect,this.onDisconnectHandler),this.provider.off(xa.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Yj();ZRe(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(lh.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&eDe())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(r){this.logger.warn(r,r==null?void 0:r.message)}}),this.events.on(qn.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(qn.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},ot.toMiliseconds(MMe)))))}isInitialized(){if(!this.initialized){const{message:e}=ut("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 lLe(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function pL(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function gL(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const uLe="[object RegExp]",dLe="[object String]",fLe="[object Number]",hLe="[object Boolean]",mL="[object Arguments]",pLe="[object Symbol]",gLe="[object Date]",mLe="[object Map]",yLe="[object Set]",bLe="[object Array]",vLe="[object Function]",wLe="[object ArrayBuffer]",ZE="[object Object]",ELe="[object Error]",xLe="[object DataView]",_Le="[object Uint8Array]",CLe="[object Uint8ClampedArray]",SLe="[object Uint16Array]",ALe="[object Uint32Array]",TLe="[object BigUint64Array]",ILe="[object Int8Array]",kLe="[object Int16Array]",$Le="[object Int32Array]",NLe="[object BigInt64Array]",PLe="[object Float32Array]",OLe="[object Float64Array]";function yL(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 RLe(t,e,r){return d1(t,e,void 0,void 0,void 0,void 0,r)}function d1(t,e,r,n,i,s,a){const o=a(t,e,r,n,i,s);if(o!==void 0)return o;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 R1(t,e,s,a)}return R1(t,e,s,a)}function R1(t,e,r,n){if(Object.is(t,e))return!0;let i=gL(t),s=gL(e);if(i===mL&&(i=ZE),s===mL&&(s=ZE),i!==s)return!1;switch(i){case dLe:return t.toString()===e.toString();case fLe:{const c=t.valueOf(),l=e.valueOf();return lLe(c,l)}case hLe:case gLe:case pLe:return Object.is(t.valueOf(),e.valueOf());case uLe:return t.source===e.source&&t.flags===e.flags;case vLe:return t===e}r=r??new Map;const a=r.get(t),o=r.get(e);if(a!=null&&o!=null)return a===e;r.set(t,e),r.set(e,t);try{switch(i){case mLe:{if(t.size!==e.size)return!1;for(const[c,l]of t.entries())if(!e.has(c)||!d1(l,e.get(c),c,t,e,r,n))return!1;return!0}case yLe:{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 d=c[u],f=l.findIndex(h=>d1(d,h,void 0,t,e,r,n));if(f===-1)return!1;l.splice(f,1)}return!0}case bLe:case _Le:case CLe:case SLe:case ALe:case TLe:case ILe:case kLe:case $Le:case NLe:case PLe:case OLe:{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(!d1(t[c],e[c],c,t,e,r,n))return!1;return!0}case wLe:return t.byteLength!==e.byteLength?!1:R1(new Uint8Array(t),new Uint8Array(e),r,n);case xLe:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:R1(new Uint8Array(t),new Uint8Array(e),r,n);case ELe:return t.name===e.name&&t.message===e.message;case ZE:{if(!(R1(t.constructor,e.constructor,r,n)||yL(t)&&yL(e)))return!1;const c=[...Object.keys(t),...pL(t)],l=[...Object.keys(e),...pL(e)];if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++){const d=c[u],f=t[d];if(!Object.hasOwn(e,d))return!1;const h=e[d];if(!d1(f,h,d,t,e,r,n))return!1}return!0}default:return!1}}finally{r.delete(t),r.delete(e)}}function DLe(){}function MLe(t,e){return RLe(t,e,DLe)}let dh=class extends VDe{constructor(e,r,n,i=Ec,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=jMe,this.cached=[],this.initialized=!1,this.storagePrefix=Ec,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!ci(a)?this.map.set(this.getKey(a),a):IRe(a)?this.map.set(a.id,a):kRe(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)},this.set=async(a,o)=>{this.isInitialized(),this.map.has(a)?await this.update(a,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:o}),this.map.set(a,o),await this.persist())},this.get=a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a)),this.getAll=a=>(this.isInitialized(),a?this.values.filter(o=>Object.keys(a).every(c=>MLe(o[c],a[c]))):this.values),this.update=async(a,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:o});const c={...this.getData(a),...o};this.map.set(a,c),await this.persist()},this.delete=async(a,o)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:o}),this.map.delete(a),this.addToRecentlyDeleted(a),await this.persist())},this.logger=va(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return Hs(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}=ut("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=ut("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}=ut("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}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}},jLe=class{constructor(e,r){this.core=e,this.logger=r,this.name=BMe,this.version=qMe,this.events=new cT,this.initialized=!1,this.storagePrefix=Ec,this.ignoredPayloadTypes=[ml],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=U7(),s=await this.core.crypto.setSymKey(i),a=Hn(ot.FIVE_MINUTES),o={protocol:NX},c={topic:s,expiry:a,relay:o,active:!1,methods:n==null?void 0:n.methods},l=Wj({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:i,relay:o,expiryTimestamp:a,methods:n==null?void 0:n.methods});return this.events.emit(zd.create,c),this.core.expirer.set(s,a),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}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[zo.pairing_started]}});this.isValidPair(n,i);const{topic:s,symKey:a,relay:o,expiryTimestamp:c,methods:l}=qj(n.uri);i.props.properties.topic=s,i.addTrace(zo.pairing_uri_validation_success),i.addTrace(zo.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),i.addTrace(zo.existing_pairing),u.active)throw i.setError(Gc.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);i.addTrace(zo.pairing_not_expired)}const d=c||Hn(ot.FIVE_MINUTES),f={topic:s,relay:o,expiry:d,active:!1,methods:l};this.core.expirer.set(s,d),await this.pairings.set(s,f),i.addTrace(zo.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(zd.create,f),i.addTrace(zo.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(a,s),i.addTrace(zo.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(Gc.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:o})}catch(h){throw i.setError(Gc.subscribe_pairing_topic_failure),h}return i.addTrace(zo.subscribe_pairing_topic_success),f},this.activate=async({topic:n})=>{this.isInitialized();const i=Hn(ot.FIVE_MINUTES);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},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:a,resolve:o,reject:c}=Fd();this.events.once(zr("pairing_ping",s),({error:l})=>{l?c(l):o()}),await a()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),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",ln("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:s,expiry:a,methods:o}=n,c=this.core.crypto.keychain.get(i);return Wj({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:c,relay:s,expiryTimestamp:a,methods:o})},this.sendRequest=async(n,i,s)=>{const a=uo(i,s),o=await this.core.crypto.encode(n,a),c=Gg[i].req;return this.core.history.set(n,a),this.core.relayer.publish(n,o,c),a.id},this.sendResult=async(n,i,s)=>{const a=Vm(n,s),o=await this.core.crypto.encode(i,a),c=(await this.core.history.get(i,n)).request.method,l=Gg[c].res;await this.core.relayer.publish(i,o,l),await this.core.history.resolve(a)},this.sendError=async(n,i,s)=>{const a=g5(n,s),o=await this.core.crypto.encode(i,a),c=(await this.core.history.get(i,n)).request.method,l=Gg[c]?Gg[c].res:Gg.unregistered_method.res;await this.core.relayer.publish(i,o,l),await this.core.history.resolve(a)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,ln("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>Xo(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},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)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,a=(await this.core.history.get(i,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(i,s);default:return this.onUnknownRpcMethodResponse(a)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(zd.ping,{id:s,topic:n})}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{Ko(i)?this.events.emit(zr("pairing_ping",s),{}):ka(i)&&this.events.emit(zr("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(zd.delete,{id:s,topic:n})}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:a}=i;try{if(this.registeredMethods.includes(a))return;const o=ln("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,n,o),this.logger.error(o)}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(ln("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var a;if(!As(n)){const{message:o}=ut("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(Gc.malformed_pairing_uri),new Error(o)}if(!TRe(n.uri)){const{message:o}=ut("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(Gc.malformed_pairing_uri),new Error(o)}const s=qj(n==null?void 0:n.uri);if(!((a=s==null?void 0:s.relay)!=null&&a.protocol)){const{message:o}=ut("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(Gc.malformed_pairing_uri),new Error(o)}if(!(s!=null&&s.symKey)){const{message:o}=ut("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(Gc.malformed_pairing_uri),new Error(o)}if(s!=null&&s.expiryTimestamp&&ot.toMiliseconds(s==null?void 0:s.expiryTimestamp)<Date.now()){i.setError(Gc.pairing_expired);const{message:o}=ut("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(o)}},this.isValidPing=async n=>{if(!As(n)){const{message:s}=ut("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!As(n)){const{message:s}=ut("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Kn(n,!1)){const{message:i}=ut("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ut("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(Xo(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ut("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=va(r,this.name),this.pairings=new dh(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Hs(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(qn.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(this.pairings.keys.includes(r)&&i!==on.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{const s=await this.core.crypto.decode(r,n);jT(s)?(this.core.history.set(r,s),await this.onRelayEventRequest({topic:r,payload:s})):m5(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(Sa.expired,async e=>{const{topic:r}=EZ(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(zd.expire,{topic:r}))})}},LLe=class extends BDe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ba.EventEmitter,this.name=WMe,this.version=zMe,this.cached=[],this.initialized=!1,this.storagePrefix=Ec,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)},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 a={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:Hn(ot.THIRTY_DAYS)};this.records.set(a.id,a),this.persist(),this.events.emit(Za.created,a)},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=ka(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Za.updated,i))},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)),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(Za.deleted,s)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=va(r,this.name)}get context(){return Hs(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:uo(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}=ut("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Za.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ut("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(Za.created,e=>{const r=Za.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Za.updated,e=>{const r=Za.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Za.deleted,e=>{const r=Za.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(lh.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ot.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Za.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}},FLe=class extends GDe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ba.EventEmitter,this.name=VMe,this.version=HMe,this.cached=[],this.initialized=!1,this.storagePrefix=Ec,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)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),a={target:s,expiry:i};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(Sa.created,{target:s,expiration:a})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},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(Sa.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=va(r,this.name)}get context(){return Hs(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 SNe(e);if(typeof e=="number")return ANe(e);const{message:r}=ut("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(Sa.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ut("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}=ut("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ot.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Sa.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(lh.pulse,()=>this.checkExpirations()),this.events.on(Sa.created,e=>{const r=Sa.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Sa.expired,e=>{const r=Sa.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Sa.deleted,e=>{const r=Sa.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}},ULe=class extends KDe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=GMe,this.verifyUrlV3=QMe,this.storagePrefix=Ec,this.version=$X,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&ot.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async i=>{if(!F0()||this.isDevEnv)return;const s=window.location.origin,{id:a,decryptedId:o}=i,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${a}&decryptedId=${o}`;try{const l=kl.getDocument(),u=this.startAbortTimer(ot.ONE_SECOND*5),d=await new Promise((f,h)=>{const g=()=>{window.removeEventListener("message",y),l.body.removeChild(m),h("attestation aborted")};this.abortController.signal.addEventListener("abort",g);const m=l.createElement("iframe");m.src=c,m.style.display="none",m.addEventListener("error",g,{signal:this.abortController.signal});const y=b=>{if(b.data&&typeof b.data=="string")try{const E=JSON.parse(b.data);if(E.type==="verify_attestation"){if(S7(E.attestation).payload.id!==a)return;clearInterval(u),l.body.removeChild(m),this.abortController.signal.removeEventListener("abort",g),window.removeEventListener("message",y),f(E.attestation===null?"":E.attestation)}}catch(E){this.logger.warn(E)}};l.body.appendChild(m),window.addEventListener("message",y,{signal:this.abortController.signal})});return this.logger.debug(d,"jwt attestation"),d}catch(l){this.logger.warn(l)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:s,hash:a,encryptedId:o}=i;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(S7(s).payload.id!==o)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(!a)return;const c=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(a,c)},this.fetchAttestation=async(i,s)=>{this.logger.debug(`resolving attestation: ${i} from url: ${s}`);const a=this.startAbortTimer(ot.ONE_SECOND*5),o=await fetch(`${s}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(a),o.status===200?await o.json():void 0},this.getVerifyUrl=i=>{let s=i||O1;return YMe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${O1}`),s=O1),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ot.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)}},this.persistPublicKey=async i=>{this.logger.debug(i,"persisting public key to local storage"),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const a=await this.fetchAndPersistPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const a=await this.fetchPublicKey();a&&(await this.persistPublicKey(a),s(a))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,s)=>{const a=pRe(i,s.publicKey),o={hasExpired:ot.toMiliseconds(a.exp)<Date.now(),payload:a};if(o.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:o.payload.origin,isScam:o.payload.isScam,isVerified:o.payload.isVerified}},this.logger=va(r,this.name),this.abortController=new AbortController,this.isDevEnv=_T(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return Hs(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ot.toMiliseconds(e))}},BLe=class extends QDe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=ZMe,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:a,enableEncrypted:o=!1}=n,c=`${XMe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:a,token:s,always_raw:o})})},this.logger=va(r,this.context)}},qLe=class extends YDe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=eje,this.storagePrefix=Ec,this.storageVersion=JMe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!_T())try{const i={eventId:fj(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:vZ(this.core.relayer.protocol,this.core.relayer.version,z7)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:s="ERROR",type:a="",properties:{topic:o,trace:c}}=i,l=fj(),u=this.core.projectId||"",d=Date.now(),f={eventId:l,timestamp:d,props:{event:s,type:a,properties:{topic:o,trace:c}},bundleId:u,domain:this.getAppDomain(),...this.setMethods(l)};return this.telemetryEnabled&&(this.events.set(l,f),this.shouldPersist=!0),f},this.getEvent=i=>{const{eventId:s,topic:a}=i;if(s)return this.events.get(s);const o=Array.from(this.events.values()).find(c=>c.props.properties.topic===a);if(o)return{...o,...this.setMethods(o.eventId)}},this.deleteEvent=i=>{const{eventId:s}=i;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(lh.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ot.fromMiliseconds(Date.now())-ot.fromMiliseconds(i.timestamp)>tje&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:s=>this.addTrace(i,s),setError:s=>this.setError(i,s)}),this.addTrace=(i,s)=>{const a=this.events.get(i);a&&(a.props.properties.trace.push(s),this.events.set(i,a),this.shouldPersist=!0)},this.setError=(i,s)=>{const a=this.events.get(i);a&&(a.props.type=s,a.timestamp=Date.now(),this.events.set(i,a),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},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,{...s,...this.setMethods(s.eventId)})})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[s,a]of this.events)a.props.type&&i.push(a);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)}},this.sendEvent=async i=>{const s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${rje}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${z7}${s}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>bZ().url,this.logger=va(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}},WLe=class LX extends UDe{constructor(e){var a;super(e),this.protocol=kX,this.version=$X,this.name=W7,this.events=new ba.EventEmitter,this.initialized=!1,this.on=(o,c)=>this.events.on(o,c),this.once=(o,c)=>this.events.once(o,c),this.off=(o,c)=>this.events.off(o,c),this.removeListener=(o,c)=>this.events.removeListener(o,c),this.dispatchEnvelope=({topic:o,message:c,sessionExists:l})=>
450{if(!o||!c)return;const u={topic:o,message:c,publishedAt:Date.now(),transportType:on.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:l})};const r=this.getGlobalCore(e==null?void 0:e.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(o){console.warn("Failed to copy global core",o)}this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||PX,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=oNe({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:_Me.logger,name:W7}),{logger:i,chunkLoggerController:s}=mZ({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=s,(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var o,c;(o=this.logChunkController)!=null&&o.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=va(i,this.name),this.heartbeat=new uDe,this.crypto=new nLe(this,this.logger,e==null?void 0:e.keychain),this.history=new LLe(this,this.logger),this.expirer=new FLe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new FDe({...CMe,...e==null?void 0:e.storageOptions}),this.relayer=new cLe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new jLe(this,this.logger),this.verify=new ULe(this,this.logger,this.storage),this.echoClient=new BLe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new qLe(this,this.logger,e==null?void 0:e.telemetryEnabled),this.setGlobalCore(this)}static async init(e){const r=new LX(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(LMe,n),r}get context(){return Hs(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(dL,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(dL)||[],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"&&xMe.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}};const zLe=WLe,FX="wc",UX=2,BX="client",FT=`${FX}@${UX}:${BX}:`,XE={name:BX,logger:"error"},bL="WALLETCONNECT_DEEPLINK_CHOICE",VLe="proposal",vL="Proposal expired",HLe="session",Nh=ot.SEVEN_DAYS,GLe="engine",Ri={wc_sessionPropose:{req:{ttl:ot.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ot.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ot.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ot.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ot.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ot.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:ot.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ot.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ot.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ot.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ot.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ot.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ot.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ot.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ot.FIVE_MINUTES,prompt:!1,tag:1119}}},JE={min:ot.FIVE_MINUTES,max:ot.SEVEN_DAYS},qo={idle:"IDLE",active:"ACTIVE"},KLe={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: 58,421 bytes, line 450
450,cosmos_signDirect:{key:""}},QLe="request",YLe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],ZLe="wc",XLe="auth",JLe="authKeys",eFe="pairingTopics",tFe="requests",b5=`${ZLe}@${1.5}:${XLe}:`,ev=`${b5}:PUB_KEY`;class rFe extends XDe{constructor(e){super(e),this.name=GLe,this.events=new cT,this.initialized=!1,this.requestQueue={state:qo.idle,queue:[]},this.sessionRequestQueue={state:qo.idle,queue:[]},this.emittedSessionRequests=new DNe({limit:500}),this.requestQueueDelay=ot.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.pendingSessions=new Map,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(Ri)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ot.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{var A;this.isInitialized(),await this.confirmOnlineStateOrThrow();const n={...r,requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}};await this.isValidConnect(n),n.optionalNamespaces=CRe(n.requiredNamespaces,n.optionalNamespaces),n.requiredNamespaces={};const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:o,scopedProperties:c,relays:l,authentication:u,walletPay:d}=n,f=((A=u==null?void 0:u[0])==null?void 0:A.ttl)||Ri.wc_sessionPropose.req.ttl||ot.FIVE_MINUTES;this.validateRequestExpiry(f);let h=i,g,m=!1;try{if(h){const I=this.client.core.pairing.pairings.get(h);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),m=I.active}}catch(I){throw this.client.logger.error(`connect() -> pairing.get(${h}) failed`),I}if(!h||!m){const{topic:I,uri:$}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});h=I,g=$}if(!h){const{message:I}=ut("NO_MATCHING_KEY",`connect() pairing topic: ${h}`);throw new Error(I)}const y=await this.client.core.crypto.generateKeyPair(),b=Hn(f),E={requiredNamespaces:s,optionalNamespaces:a,relays:l??[{protocol:NX}],proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:b,pairingTopic:h,...o&&{sessionProperties:o},...c&&{scopedProperties:c},id:Go(),...(u||d)&&{requests:{authentication:u==null?void 0:u.map(I=>{const{domain:$,chains:P,nonce:j,uri:L,exp:B,nbf:k,type:D,statement:q,requestId:U,resources:W,signatureTypes:V}=I;return{domain:$,chains:P,nonce:j,type:D??"caip122",aud:L,version:"1",iat:new Date().toISOString(),exp:B,nbf:k,statement:q,requestId:U,resources:W,signatureTypes:V}}),walletPay:d}}},v=zr("session_connect",E.id),{reject:w,resolve:x,done:_}=Fd(f,vL),S=({id:I})=>{I===E.id&&(this.client.events.off("proposal_expire",S),this.pendingSessions.delete(E.id),this.events.emit(v,{error:{message:vL,code:0}}))};return this.client.events.on("proposal_expire",S),this.events.once(v,({error:I,session:$})=>{this.client.events.off("proposal_expire",S),I?w(I):$&&x($)}),await this.setProposal(E.id,E),await this.sendProposeSession({proposal:E,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:E.id}}}).catch(I=>{throw this.deleteProposal(E.id),I}),{uri:g,approval:_}},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}},this.approve=async r=>{var S,A,I;const n=this.client.core.eventClient.createEvent({properties:{topic:(S=r==null?void 0:r.id)==null?void 0:S.toString(),trace:[Xa.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch($){throw n.setError(Pd.no_internet_connection),$}try{await this.isValidProposalId(r==null?void 0:r.id)}catch($){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),n.setError(Pd.proposal_not_found),$}try{await this.isValidApprove(r)}catch($){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError(Pd.session_approve_namespace_validation_failure),$}const{id:i,relayProtocol:s,namespaces:a,sessionProperties:o,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=r,d=this.client.proposal.get(i);this.client.core.eventClient.deleteEvent({eventId:n.eventId});const{pairingTopic:f,proposer:h,requiredNamespaces:g,optionalNamespaces:m}=d;let y=(A=this.client.core.eventClient)==null?void 0:A.getEvent({topic:f});y||(y=(I=this.client.core.eventClient)==null?void 0:I.createEvent({type:Xa.session_approve_started,properties:{topic:f,trace:[Xa.session_approve_started,Xa.session_namespaces_validation_success]}}));const b=await this.client.core.crypto.generateKeyPair(),E=h.publicKey,v=await this.client.core.crypto.generateSharedKey(b,E),w={relay:{protocol:s??"irn"},namespaces:a,controller:{publicKey:b,metadata:this.client.metadata},expiry:Hn(Nh),...o&&{sessionProperties:o},...c&&{scopedProperties:c},...l&&{sessionConfig:l},proposalRequestsResponses:u},x=on.relay;y.addTrace(Xa.subscribing_session_topic);try{await this.client.core.relayer.subscribe(v,{transportType:x,internal:{skipSubscribe:!0}})}catch($){throw y.setError(Pd.subscribe_session_topic_failure),$}y.addTrace(Xa.subscribe_session_topic_success);const _={...w,topic:v,requiredNamespaces:g,optionalNamespaces:m,pairingTopic:f,acknowledged:!1,self:w.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:b,transportType:on.relay,authentication:u==null?void 0:u.authentication,walletPayResult:u==null?void 0:u.walletPay};await this.client.session.set(v,_),y.addTrace(Xa.store_session);try{await this.sendApproveSession({sessionTopic:v,proposal:d,pairingProposalResponse:{relay:{protocol:s??"irn"},responderPublicKey:b},sessionSettleRequest:w,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:i,...this.getTVFApproveParams(_)}}}),y.addTrace(Xa.session_approve_publish_success)}catch($){throw this.client.logger.error($),this.client.session.delete(v,ln("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(v),$}return this.client.core.eventClient.deleteEvent({eventId:y.eventId}),await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.deleteProposal(i),await this.client.core.pairing.activate({topic:f}),await this.setExpiry(v,Hn(Nh)),{topic:v,acknowledged:()=>Promise.resolve(this.client.session.get(v))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(a){throw this.client.logger.error("reject() -> isValidReject() failed"),a}const{id:n,reason:i}=r;let s;try{s=this.client.proposal.get(n).pairingTopic}catch(a){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),a}s&&await this.sendError({id:n,topic:s,error:i,rpcOpts:Ri.wc_sessionPropose.reject}),await this.deleteProposal(n)},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(d){throw this.client.logger.error("update() -> isValidUpdate() failed"),d}const{topic:n,namespaces:i}=r,{done:s,resolve:a,reject:o}=Fd(ot.FIVE_MINUTES,"Session update request expired without receiving any acknowledgement"),c=Go(),l=Nu().toString(),u=this.client.session.get(n).namespaces;return this.events.once(zr("session_update",c),({error:d})=>{d?o(d):a()}),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(d=>{this.client.logger.error(d),this.client.session.update(n,{namespaces:u}),o(d)}),{acknowledged:s}},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=Go(),{done:s,resolve:a,reject:o}=Fd(ot.FIVE_MINUTES,"Session extend request expired without receiving any acknowledgement");return this.events.once(zr("session_extend",i),({error:c})=>{c?o(c):a()}),await this.setExpiry(n,Hn(Nh)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(c=>{o(c)}),{acknowledged:s}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}const{chainId:n,request:i,topic:s,expiry:a=Ri.wc_sessionRequest.req.ttl}=r,o=this.client.session.get(s);(o==null?void 0:o.transportType)===on.relay&&await this.confirmOnlineStateOrThrow();const c=Go(),l=Nu().toString(),{done:u,resolve:d,reject:f}=Fd(a,"Request expired. Please try again.");this.events.once(zr("session_request",c),({error:y,result:b})=>{y?f(y):d(b)});const h="wc_sessionRequest",g=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);if(g)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:h,params:{request:{...i,expiryTimestamp:Hn(a)},chainId:n},expiry:a,throwOnFailedPublish:!0,appLink:g}).catch(y=>f(y)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),await u();const m={request:{...i,expiryTimestamp:Hn(a)},chainId:n};return await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:h,params:m,expiry:a,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,m)}).catch(b=>f(b)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:c}),y()}),new Promise(async y=>{var b;if(!((b=o.sessionConfig)!=null&&b.disableDeepLink)){const E=await $Ne(this.client.core.storage,bL);await TNe({id:c,topic:s,wcDeepLink:E})}y()}),u()]).then(y=>y[2])},this.respond=async r=>{var l,u;this.isInitialized();const n=this.client.core.eventClient.createEvent({properties:{topic:(r==null?void 0:r.topic)||((u=(l=r==null?void 0:r.response)==null?void 0:l.id)==null?void 0:u.toString()),trace:[Xa.session_request_response_started]}});try{await this.isValidRespond(r)}catch(d){throw n.addTrace(d==null?void 0:d.message),n.setError(Pd.session_request_response_validation_failure),d}n.addTrace(Xa.session_request_response_validation_success);const{topic:i,response:s}=r,{id:a}=s,o=this.client.session.get(i);o.transportType===on.relay&&await this.confirmOnlineStateOrThrow();const c=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);try{n.addTrace(Xa.session_request_response_publish_started),Ko(s)?await this.sendResult({id:a,topic:i,result:s.result,throwOnFailedPublish:!0,appLink:c}):ka(s)&&await this.sendError({id:a,topic:i,error:s.error,appLink:c}),this.cleanupAfterResponse(r)}catch(d){throw n.addTrace(d==null?void 0:d.message),n.setError(Pd.session_request_response_publish_failure),d}},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=Go(),s=Nu().toString(),{done:a,resolve:o,reject:c}=Fd(ot.FIVE_MINUTES,"Ping request expired without receiving any acknowledgement");this.events.once(zr("session_ping",i),({error:l})=>{l?c(l):o()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:s}),a()])}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}))},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r,a=Nu().toString(),o=Go();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s},throwOnFailedPublish:!0,relayRpcId:a,clientRpcId:o})},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:ln("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}=ut("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>SRe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var U;this.isInitialized(),this.isValidAuthenticate(r);const i=n&&this.client.core.linkModeSupportedApps.includes(n)&&((U=this.client.metadata.redirect)==null?void 0:U.linkMode),s=i?on.link_mode:on.relay;s===on.relay&&await this.confirmOnlineStateOrThrow();const{chains:a,statement:o="",uri:c,domain:l,nonce:u,type:d,exp:f,nbf:h,methods:g=[],expiry:m}=r,y=[...r.resources||[]],{topic:b,uri:E}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:E}});const v=await this.client.core.crypto.generateKeyPair(),w=Yb(v);if(await Promise.all([this.client.auth.authKeys.set(ev,{responseTopic:w,publicKey:v}),this.client.auth.pairingTopics.set(w,{topic:w,pairingTopic:b})]),await this.client.core.relayer.subscribe(w,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${b}`),g.length>0){const{namespace:W}=gl(a[0]);let V=UPe(W,"request",g);Qb(y)&&(V=qPe(V,y.pop())),y.push(V)}const x=m&&m>Ri.wc_sessionAuthenticate.req.ttl?m:Ri.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:d??"caip122",chains:a,statement:o,aud:c,domain:l,version:"1",nonce:u,iat:new Date().toISOString(),exp:f,nbf:h,resources:y},requester:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:Hn(x)},S={eip155:{chains:a,methods:[...new Set(["personal_sign",...g])],events:["chainChanged","accountsChanged"]}},A={requiredNamespaces:{},optionalNamespaces:S,relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:Hn(Ri.wc_sessionPropose.req.ttl),id:Go()},{done:I,resolve:$,reject:P}=Fd(x,"Request expired"),j=Go(),L=zr("session_connect",A.id),B=zr("session_request",j),k=async({error:W,session:V})=>{this.events.off(B,D),W?P(W):V&&$({session:V})},D=async W=>{var Q,se,me;if(await this.deletePendingAuthRequest(j,{message:"fulfilled",code:0}),W.error){const _e=ln("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return W.error.code===_e.code?void 0:(this.events.off(L,k),P(W.error.message))}await this.deleteProposal(A.id),this.events.off(L,k);const{cacaos:V,responder:Y}=W.result,K=[],ge=[];for(const _e of V){await Ej({cacao:_e,projectId:this.client.core.projectId})||(this.client.logger.error(_e,"Signature verification failed"),P(ln("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:z}=_e,R=Qb(z.resources),M=[$7(z.iss)],ee=gw(z.iss);if(R){const ie=xj(R),le=_j(R);K.push(...ie),M.push(...le)}for(const ie of M)ge.push(`${ie}:${ee}`)}const ae=await this.client.core.crypto.generateSharedKey(v,Y.publicKey);let ce;K.length>0&&(ce={topic:ae,acknowledged:!0,self:{publicKey:v,metadata:this.client.metadata},peer:Y,controller:Y.publicKey,expiry:Hn(Nh),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:Vj([...new Set(K)],[...new Set(ge)]),transportType:s},await this.client.core.relayer.subscribe(ae,{transportType:s}),await this.client.session.set(ae,ce),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:Y.metadata}),ce=this.client.session.get(ae)),(Q=this.client.metadata.redirect)!=null&&Q.linkMode&&((se=Y.metadata.redirect)!=null&&se.linkMode)&&((me=Y.metadata.redirect)!=null&&me.universal)&&n&&(this.client.core.addLinkModeSupportedApp(Y.metadata.redirect.universal),this.client.session.update(ae,{transportType:on.link_mode})),$({auths:V,session:ce})};this.events.once(L,k),this.events.once(B,D);let q;try{if(i){const W=uo("wc_sessionAuthenticate",_,j);this.client.core.history.set(b,W);const V=await this.client.core.crypto.encode("",W,{type:Zy,encoding:xu});q=ob(n,b,V)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:_,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:j}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:A,expiry:Ri.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:A.id})])}catch(W){throw this.events.off(L,k),this.events.off(B,D),W}return await this.setProposal(A.id,A),await this.setAuthRequest(j,{request:{..._,verifyContext:{}},pairingTopic:b,transportType:s}),{uri:q??E,response:I}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[Od.authenticated_session_approve_started]}});try{this.isInitialized()}catch(y){throw s.setError(Kg.no_internet_connection),y}const a=this.getPendingAuthRequest(n);if(!a)throw s.setError(Kg.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const o=a.transportType||on.relay;o===on.relay&&await this.confirmOnlineStateOrThrow();const c=a.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=Yb(c),d={type:ml,receiverPublicKey:c,senderPublicKey:l},f=[],h=[];for(const y of i){if(!await Ej({cacao:y,projectId:this.client.core.projectId})){s.setError(Kg.invalid_cacao);const x=ln("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:x,encodeOpts:d}),new Error(x.message)}s.addTrace(Od.cacaos_verified);const{p:b}=y,E=Qb(b.resources),v=[$7(b.iss)],w=gw(b.iss);if(E){const x=xj(E),_=_j(E);f.push(...x),v.push(..._)}for(const x of v)h.push(`${x}:${w}`)}const g=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(Od.create_authenticated_session_topic);let m;if((f==null?void 0:f.length)>0){m={topic:g,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:a.requester.metadata},controller:c,expiry:Hn(Nh),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:a.pairingTopic,namespaces:Vj([...new Set(f)],[...new Set(h)]),transportType:o},s.addTrace(Od.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(g,{transportType:o})}catch(y){throw s.setError(Kg.subscribe_authenticated_session_topic_failure),y}s.addTrace(Od.subscribe_authenticated_session_topic_success),await this.client.session.set(g,m),s.addTrace(Od.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:a.pairingTopic,metadata:a.requester.metadata})}s.addTrace(Od.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:i,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(a.requester.metadata,o)})}catch(y){throw s.setError(Kg.authenticated_session_approve_publish_failure),y}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:a.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:m}},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===on.relay&&await this.confirmOnlineStateOrThrow();const a=s.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),c=Yb(a),l={type:ml,receiverPublicKey:a,senderPublicKey:o};await this.sendError({id:n,topic:c,error:i,encodeOpts:l,rpcOpts:Ri.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)},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return jZ(n,i)},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)},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 a,o;return((a=s.peerMetadata)==null?void 0:a.url)&&((o=s.peerMetadata)==null?void 0:o.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)}},this.deleteSession=async r=>{var c;const{topic:n,expirerHasDeleted:i=!1,emitEvent:s=!0,id:a=0}=r,{self:o}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,ln("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),i||this.client.core.expirer.del(n),this.client.core.storage.removeItem(bL).catch(l=>this.client.logger.warn(l)),n===((c=this.sessionRequestQueue.queue[0])==null?void 0:c.topic)&&(this.sessionRequestQueue.state=qo.idle),await Promise.all(this.getPendingSessionRequests().filter(l=>l.topic===n).map(l=>this.deletePendingSessionRequest(l.id,ln("USER_DISCONNECTED")))),s&&this.client.events.emit("session_delete",{id:a,topic:n})},this.deleteProposal=async(r,n)=>{var i;if(n)try{const s=this.client.proposal.get(r);(i=this.client.core.eventClient.getEvent({topic:s.pairingTopic}))==null||i.setError(Pd.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,ln("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},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=qo.idle,this.client.events.emit("session_request_expire",{id:r}))},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)])},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}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Hn(Ri.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:s,transportType:a=on.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:a})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:s,verifyContext:a}=r,o=s.request.expiryTimestamp||Hn(Ri.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,o),await this.client.pendingRequest.set(n,{id:n,topic:i,params:s,verifyContext:a})},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:a,relayRpcId:o,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:d,publishOpts:f={}}=r,h=uo(i,s,c);let g;const m=!!u;try{const E=m?xu:Ps;g=await this.client.core.crypto.encode(n,h,{encoding:E})}catch(E){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),E}let y;if(YLe.includes(i)){const E=Ia(JSON.stringify(h)),v=Ia(g);y=await this.client.core.verify.register({id:v,decryptedId:E})}const b={...Ri[i].req,...f};if(b.attestation=y,a&&(b.ttl=a),o&&(b.id=o),this.client.core.history.set(n,h),m){const E=ob(u,n,g);await global.Linking.openURL(E,this.client.name)}else b.tvf={...d,correlationId:h.id},l?(b.internal={...b.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(n,g,b)):this.client.core.relayer.publish(n,g,b).catch(E=>this.client.logger.error(E));return h.id},this.sendProposeSession=async r=>{const{proposal:n,publishOpts:i}=r,s=uo("wc_sessionPropose",n,n.id);this.client.core.history.set(n.pairingTopic,s);const a=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:Ps}),o=Ia(JSON.stringify(s)),c=Ia(a),l=await this.client.core.verify.register({id:c,decryptedId:o});await this.client.core.relayer.publishCustom({payload:{pairingTopic:n.pairingTopic,sessionProposal:a},opts:{...i,publishMethod:"wc_proposeSession",attestation:l}})},this.sendApproveSession=async r=>{const{sessionTopic:n,pairingProposalResponse:i,proposal:s,sessionSettleRequest:a,publishOpts:o}=r,c=Vm(s.id,i),l=await this.client.core.crypto.encode(s.pairingTopic,c,{encoding:Ps}),u=uo("wc_sessionSettle",a,o==null?void 0:o.id),d=await this.client.core.crypto.encode(n,u,{encoding:Ps});this.client.core.history.set(n,u),await this.client.core.relayer.publishCustom({payload:{sessionTopic:n,pairingTopic:s.pairingTopic,sessionProposalResponse:l,sessionSettlementRequest:d},opts:{...o,publishMethod:"wc_approveSession"}})},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:a,encodeOpts:o,appLink:c}=r,l=Vm(n,s);let u;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const g=d?xu:Ps;u=await this.client.core.crypto.encode(i,l,{...o||{},encoding:g})}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let f,h;try{f=await this.client.core.history.get(i,n);const g=f.request;try{h=this.getTVFParams(n,g.params,s)}catch(m){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${m==null?void 0:m.message}`)}}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(d){const g=ob(c,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=f.request.method,m=Ri[g].res;m.tvf={...h,correlationId:n},a?(m.internal={...m.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(i,u,m)):this.client.core.relayer.publish(i,u,m).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:n,topic:i,error:s,encodeOpts:a,rpcOpts:o,appLink:c}=r,l=g5(n,s);let u;const d=c&&typeof(global==null?void 0:global.Linking)<"u";try{const h=d?xu:Ps;u=await this.client.core.crypto.encode(i,l,{...a||{},encoding:h})}catch(h){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),h}let f;try{f=await this.client.core.history.get(i,n)}catch(h){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),h}if(d){const h=ob(c,i,u);await global.Linking.openURL(h,this.client.name)}else{const h=f.request.method,g=o||Ri[h].res;this.client.core.relayer.publish(i,u,g)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let s=!1;Xo(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=>{Xo(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onProviderMessageEvent=async r=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(r):await this.onRelayMessage(r)},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===qo.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=qo.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=qo.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:s,transportType:a,encryptedId:o}=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:o});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:o,transportType:a});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:s,encryptedId:o,transportType:a});default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:s}=r,a=(await this.client.core.history.get(n,i.id)).request.method;switch(a){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 ${a}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=ut("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},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)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:s,encryptedId:a}=r,{params:o,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(Gc.proposal_listener_not_found)),this.isValidConnect({...i.params});const u=o.expiryTimestamp||Hn(Ri.wc_sessionPropose.req.ttl),d={id:c,pairingTopic:n,expiryTimestamp:u,attestation:s,encryptedId:a,...o};await this.setProposal(c,d);const f=await this.getVerifyContext({attestationId:s,hash:Ia(JSON.stringify(i)),encryptedId:a,metadata:d.proposer.metadata});l==null||l.addTrace(zo.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:f})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:Ri.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:s}=n;if(Ko(n)){const{result:a}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:a});const o=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const c=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});const l=a.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 d=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:r})}else if(ka(n)){await this.deleteProposal(s);const a=zr("session_connect",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners, 954`);this.events.emit(a,{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:o,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:f,proposalRequestsResponses:h}=n.params,g=[...this.pendingSessions.values()].find(b=>b.sessionTopic===r);if(!g)return this.client.logger.error(`Pending session not found for topic ${r}`);const m=this.client.proposal.get(g.proposalId),y={topic:r,relay:a,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:g.pairingTopic,requiredNamespaces:m.requiredNamespaces,optionalNamespaces:m.optionalNamespaces,controller:o.publicKey,self:{publicKey:g.publicKey,metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata},...u&&{sessionProperties:u},...d&&{scopedProperties:d},...f&&{sessionConfig:f},transportType:on.relay,authentication:h==null?void 0:h.authentication,walletPayResult:h==null?void 0:h.walletPay};await this.client.session.set(y.topic,y),await this.setExpiry(y.topic,y.expiry),await this.client.core.pairing.updateMetadata({topic:g.pairingTopic,metadata:y.peer.metadata}),this.pendingSessions.delete(g.proposalId),this.deleteProposal(g.proposalId,!1),this.cleanupDuplicatePairings(y),await this.sendResult({id:n.id,topic:r,throwOnFailedPublish:!0,result:!0}),this.client.events.emit("session_connect",{session:y}),this.events.emit(zr("session_connect",g.proposalId),{session:y})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Ko(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(zr("session_approve",i),{})):ka(n)&&(await this.client.session.delete(r,ln("USER_DISCONNECTED")),this.events.emit(zr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const a=`${r}_session_update`,o=Hg.get(a);if(o&&this.isRequestOutOfSync(o,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:ln("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate({topic:r,...i});try{Hg.set(a,s),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0})}catch(c){throw Hg.delete(a),c}this.client.events.emit("session_update",{id:s,topic:r,params:i})}catch(a){await this.sendError({id:s,topic:r,error:a}),this.client.logger.error(a)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3)<r.toString().slice(0,-3),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n,s=zr("session_update",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ko(n)?this.events.emit(zr("session_update",i),{}):ka(n)&&this.events.emit(zr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Hn(Nh)),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)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,s=zr("session_extend",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ko(n)?this.events.emit(zr("session_extend",i),{}):ka(n)&&this.events.emit(zr("session_extend",i),{error:n.error})},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)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,s=zr("session_ping",i);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);Ko(n)?this.events.emit(zr("session_ping",i),{}):ka(n)&&this.events.emit(zr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{await this.isValidDisconnect({topic:r,reason:n.params}),this.cleanupPendingSentRequestsForTopic({topic:r,error:ln("USER_DISCONNECTED")}),await this.deleteSession({topic:r,id:i})}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var u,d,f;const{topic:n,payload:i,attestation:s,encryptedId:a,transportType:o}=r,{id:c,params:l}=i;try{await this.isValidRequest({topic:n,...l});const h=this.client.session.get(n),g=await this.getVerifyContext({attestationId:s,hash:Ia(JSON.stringify(uo("wc_sessionRequest",l,c))),encryptedId:a,metadata:h.peer.metadata,transportType:o}),m={id:c,topic:n,params:l,verifyContext:g};await this.setPendingSessionRequest(m),o===on.link_mode&&((u=h.peer.metadata.redirect)!=null&&u.universal)&&this.client.core.addLinkModeSupportedApp((d=h.peer.metadata.redirect)==null?void 0:d.universal),(f=this.client.signConfig)!=null&&f.disableRequestQueue?this.emitSessionRequest(m):(this.addSessionRequestToSessionRequestQueue(m),this.processSessionRequestQueue())}catch(h){await this.sendError({id:c,topic:n,error:h}),this.client.logger.error(h)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,s=zr("session_request",i);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Ko(n)?this.events.emit(zr("session_request",i),{result:n.result}):ka(n)&&this.events.emit(zr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const a=`${r}_session_event_${s.event.name}`,o=Hg.get(a);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit({topic:r,...s}),this.client.events.emit("session_event",{id:i,topic:r,params:s}),Hg.set(a,i)}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Ko(n)?this.events.emit(zr("session_request",i),{result:n.result}):ka(n)&&this.events.emit(zr("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var c;const{topic:n,payload:i,attestation:s,encryptedId:a,transportType:o}=r;try{const{requester:l,authPayload:u,expiryTimestamp:d}=i.params,f=await this.getVerifyContext({attestationId:s,hash:Ia(JSON.stringify(i)),encryptedId:a,metadata:l.metadata,transportType:o}),h={requester:l,pairingTopic:n,id:i.id,authPayload:u,verifyContext:f,expiryTimestamp:d};await this.setAuthRequest(i.id,{request:h,pairingTopic:n,transportType:o}),o===on.link_mode&&((c=l.metadata.redirect)!=null&&c.universal)&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:n,params:i.params,id:i.id,verifyContext:f})}catch(l){this.client.logger.error(l);const u=i.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),f=this.getAppLinkIfEnabled(i.params.requester.metadata,o),h={type:ml,receiverPublicKey:u,senderPublicKey:d};await this.sendError({id:i.id,topic:n,error:l,encodeOpts:h,rpcOpts:Ri.wc_sessionAuthenticate.autoReject,appLink:f})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=qo.idle,this.processSessionRequestQueue()},ot.toMiliseconds(this.requestQueueDelay))},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(zr("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===qo.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)}},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=qo.active,this.emittedSessionRequests.add(r.id),this.client.events.emit("session_request",r)},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:uo("wc_sessionPropose",{...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})},this.isValidConnect=async r=>{if(!As(r)){const{message:l}=ut("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:a,scopedProperties:o,relays:c}=r;if(ci(n)||await this.isValidPairingTopic(n),!jRe(c)){const{message:l}=ut("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(i&&!ci(i)&&fc(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&&!ci(s)&&fc(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),a&&!ci(a)&&this.validateSessionProps(a,"sessionProperties"),o&&!ci(o)){this.validateSessionProps(o,"scopedProperties");const l=Object.keys(i||{}).concat(Object.keys(s||{}));if(!Object.keys(o).every(u=>l.includes(u.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(o)}, required/optional namespaces: ${JSON.stringify(l)}`)}},this.validateNamespaces=(r,n)=>{const i=MRe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!As(r))throw new Error(ut("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:a,scopedProperties:o}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const c=this.client.proposal.get(n),l=VE(i,"approve()");if(l)throw new Error(l.message);const u=Kj(c.requiredNamespaces,i,"approve()");if(u)throw new Error(u.message);if(!Kn(s,!0)){const{message:d}=ut("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}if(a&&!ci(a)&&this.validateSessionProps(a,"sessionProperties"),o&&!ci(o)){this.validateSessionProps(o,"scopedProperties");const d=new Set(Object.keys(i));if(!Object.keys(o).every(f=>d.has(f.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(o)}, approved namespaces: ${Array.from(d).join(", ")}`)}},this.isValidReject=async r=>{if(!As(r)){const{message:s}=ut("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!FRe(i)){const{message:s}=ut("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!As(r)){const{message:l}=ut("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:a}=r;if(!EX(n)){const{message:l}=ut("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const o=$Re(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const c=VE(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Xo(a)){const{message:l}=ut("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!As(r)){const{message:c}=ut("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),a=VE(i,"update()");if(a)throw new Error(a.message);const o=Kj(s.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async r=>{if(!As(r)){const{message:i}=ut("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!As(r)){const{message:c}=ut("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:a}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!Gj(o,s)){const{message:c}=ut("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!URe(i)){const{message:c}=ut("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!WRe(o,s,i.method)){const{message:c}=ut("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}this.validateRequestExpiry(a)},this.isValidRespond=async r=>{var a;if(!As(r)){const{message:o}=ut("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:n,response:i}=r;try{await this.isValidSessionTopic(n)}catch(o){throw(a=r==null?void 0:r.response)!=null&&a.id&&this.cleanupAfterResponse(r),o}if(!BRe(i)){const{message:o}=ut("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(i)}`);throw new Error(o)}const s=this.client.pendingRequest.get(i.id);if(s.topic!==n){const{message:o}=ut("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${i.id}, expected topic: ${s.topic}, received topic: ${n}`);throw new Error(o)}},this.isValidPing=async r=>{if(!As(r)){const{message:i}=ut("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!As(r)){const{message:o}=ut("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(o)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!Gj(a,s)){const{message:o}=ut("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(o)}if(!qRe(i)){const{message:o}=ut("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!zRe(a,s,i.name)){const{message:o}=ut("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidDisconnect=async r=>{if(!As(r)){const{message:i}=ut("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:s,nonce:a}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!Kn(i,!1))throw new Error("uri is required parameter");if(!Kn(s,!1))throw new Error("domain is required parameter");if(!Kn(a,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>gl(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=gl(n[0]);if(o!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:s,metadata:a,transportType:o}=r,c={verified:{verifyUrl:a.verifyUrl||O1,validation:"UNKNOWN",origin:a.url||""}};try{if(o===on.link_mode){const u=this.getAppLinkIfEnabled(a,o);return c.verified.validation=u&&new URL(u).origin===new URL(a.url).origin?"VALID":"INVALID",c}const l=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:s,verifyUrl:a.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(a.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c},this.validateSessionProps=(r,n)=>{Object.values(r).forEach((i,s)=>{if(i==null){const{message:a}=ut("MISSING_OR_INVALID",`${n} must contain an existing value for each key. Received: ${i} for key ${Object.keys(r)[s]}`);throw new Error(a)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},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 a of this.recentlyDeletedMap.keys()){if(i++>=s)break;this.recentlyDeletedMap.delete(a)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=ut("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,s,a,o,c,l,u,d,f;return!r||n!==on.link_mode?!1:((s=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:s.linkMode)===!0&&((o=(a=this.client.metadata)==null?void 0:a.redirect)==null?void 0:o.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&&((d=r==null?void 0:r.redirect)==null?void 0:d.universal)!==""&&((f=r==null?void 0:r.redirect)==null?void 0:f.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},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},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=dj(r,"topic")||"",i=decodeURIComponent(dj(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:on.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:s})},this.registerLinkModeListeners=async()=>{var r;if(_T()||md()&&((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)}}},this.getTVFApproveParams=r=>{try{const n=vX(r.namespaces),i=vRe(r.namespaces),s=wRe(r.namespaces),a=r.sessionProperties,o=r.scopedProperties;return{approvedChains:n,approvedMethods:i,approvedEvents:s,sessionProperties:a,scopedProperties:o}}catch(n){return this.client.logger.warn(n,"Error getting TVF approve params"),{}}},this.getTVFParams=(r,n,i)=>{var a,o,c;if(!((a=n.request)!=null&&a.method))return{};const s={correlationId:r,rpcMethods:[n.request.method],chainId:n.chainId};try{const l=this.extractTxHashesFromResult(n.request,i);s.txHashes=l,s.contractAddresses=this.isValidContractData(n.request.params)?[(c=(o=n.request.params)==null?void 0:o[0])==null?void 0:c.to]:[]}catch(l){this.client.logger.warn(l,"Error getting TVF params")}return s},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},this.extractTxHashesFromResult=(r,n)=>{var i;try{if(!n)return[];const s=r.method,a=KLe[s];if(s==="sui_signTransaction")return[IPe(n.transactionBytes)];if(s==="near_signTransaction")return[vj(n)];if(s==="near_signTransactions")return n.map(c=>vj(c));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(i=n.tx_json)==null?void 0:i.hash];if(s==="polkadot_signTransaction")return[cDe({transaction:r.params.transactionPayload,signature:n.signature})];if(s==="algo_signTxn")return Ra(n)?n.map(c=>wj(c)):[wj(n)];if(s==="cosmos_signDirect")return[$Pe(n)];if(s==="wallet_sendCalls")return NPe(n);if(typeof n=="string")return[n];const o=n[a.key];if(Ra(o))return s==="solana_signAllTransactions"?o.map(c=>TPe(c)):o;if(typeof o=="string")return[o]}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}=ut("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(qn.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:s}=e,{publicKey:a}=this.client.auth.authKeys.keys.includes(ev)?this.client.auth.authKeys.get(ev):{publicKey:void 0};try{const o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:a,encoding:s===on.link_mode?xu:Ps});jT(o)?(this.client.core.history.set(r,o),await this.onRelayEventRequest({topic:r,payload:o,attestation:i,transportType:s,encryptedId:Ia(n)})):m5(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o,transportType:s}),this.client.core.history.delete(r,o.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(o)}`),await this.onRelayEventUnknownPayload({topic:r,payload:o,transportType:s})),await this.client.core.relayer.messages.ack(r,n)}catch(o){this.client.logger.error(`onRelayMessage() -> failed to process an inbound message: ${n}`),this.client.logger.error(o)}}registerExpirerEvents(){this.client.core.expirer.on(Sa.expired,async e=>{const{topic:r,id:n}=EZ(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ut("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,ut("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(zd.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(zd.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!Kn(e,!1)){const{message:r}=ut("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}=ut("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(Xo(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ut("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Kn(e,!1)){const{message:r}=ut("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}=ut("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(Xo(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=ut("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=ut("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(Kn(e,!1)){const{message:r}=ut("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ut("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!LRe(e)){const{message:r}=ut("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ut("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(Xo(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=ut("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}validateRequestExpiry(e){if(e&&!GRe(e,JE)){const{message:r}=ut("MISSING_OR_INVALID",`request() expiry: ${e}. Expiry must be a number (in seconds) between ${JE.min} and ${JE.max}`);throw new Error(r)}}}class nFe extends dh{constructor(e,r){super(e,r,VLe,FT),this.core=e,this.logger=r}}let iFe=class extends dh{constructor(e,r){super(e,r,HLe,FT),this.core=e,this.logger=r}};class sFe extends dh{constructor(e,r){super(e,r,QLe,FT,n=>n.id),this.core=e,this.logger=r}}class aFe extends dh{constructor(e,r){super(e,r,JLe,b5,()=>ev),this.core=e,this.logger=r}}class oFe extends dh{constructor(e,r){super(e,r,eFe,b5),this.core=e,this.logger=r}}class cFe extends dh{constructor(e,r){super(e,r,tFe,b5,n=>n.id),this.core=e,this.logger=r}}class lFe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new aFe(this.core,this.logger),this.pairingTopics=new oFe(this.core,this.logger),this.requests=new cFe(this.core,this.logger)}
450async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let uFe=class qX extends ZDe{constructor(e){super(e),this.protocol=FX,this.version=UX,this.name=XE.name,this.events=new ba.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},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)||XE.name,this.metadata=ENe(e==null?void 0:e.metadata),this.signConfig=e==null?void 0:e.signConfig;const r=DT({logger:(e==null?void 0:e.logger)||XE.logger,name:this.name});this.logger=r,this.core=(e==null?void 0:e.core)||new zLe(e),this.session=new iFe(this.core,this.logger),this.proposal=new nFe(this.core,this.logger),this.pendingRequest=new sFe(this.core,this.logger),this.engine=new rFe(this),this.auth=new lFe(this.core,this.logger)}static async init(e){const r=new qX(e);return await r.initialize(),r}get context(){return Hs(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 dFe=uFe;var lb={exports:{}},wL;function fFe(){return wL||(wL=1,(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Yn<"u"&&Yn,n=(function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s})();(function(s){(function(a){var o=typeof s<"u"&&s||typeof self<"u"&&self||typeof Yn<"u"&&Yn||{},c={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
450]"],d=ArrayBuffer.isView||function(k){return k&&u.indexOf(Object.prototype.toString.call(k))>-1};function f(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function h(k){return typeof k!="string"&&(k=String(k)),k}function g(k){var D={next:function(){var q=k.shift();return{done:q===void 0,value:q}}};return c.iterable&&(D[Symbol.iterator]=function(){return D}),D}function m(k){this.map={},k instanceof m?k.forEach(function(D,q){this.append(q,D)},this):Array.isArray(k)?k.forEach(function(D){if(D.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+D.length);this.append(D[0],D[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(D){this.append(D,k[D])},this)}m.prototype.append=function(k,D){k=f(k),D=h(D);var q=this.map[k];this.map[k]=q?q+", "+D:D},m.prototype.delete=function(k){delete this.map[f(k)]},m.prototype.get=function(k){return k=f(k),this.has(k)?this.map[k]:null},m.prototype.has=function(k){return this.map.hasOwnProperty(f(k))},m.prototype.set=function(k,D){this.map[f(k)]=h(D)},m.prototype.forEach=function(k,D){for(var q in this.map)this.map.hasOwnProperty(q)&&k.call(D,this.map[q],q,this)},m.prototype.keys=function(){var k=[];return this.forEach(function(D,q){k.push(q)}),g(k)},m.prototype.values=function(){var k=[];return this.forEach(function(D){k.push(D)}),g(k)},m.prototype.entries=function(){var k=[];return this.forEach(function(D,q){k.push([q,D])}),g(k)},c.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function y(k){if(!k._noBody){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}}function b(k){return new Promise(function(D,q){k.onload=function(){D(k.result)},k.onerror=function(){q(k.error)}})}function E(k){var D=new FileReader,q=b(D);return D.readAsArrayBuffer(k),q}function v(k){var D=new FileReader,q=b(D),U=/charset=([A-Za-z0-9_-]+)/.exec(k.type),W=U?U[
vendor: 4,237 bytes, lines 450-451
4501]:"utf-8";return D.readAsText(k,W),q}function w(k){for(var D=new Uint8Array(k),q=new Array(D.length),U=0;U<D.length;U++)q[U]=String.fromCharCode(D[U]);return q.join("")}function x(k){if(k.slice)return k.slice(0);var D=new Uint8Array(k.byteLength);return D.set(new Uint8Array(k)),D.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&l(k)?(this._bodyArrayBuffer=x(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||d(k))?this._bodyArrayBuffer=x(k):this._bodyText=k=Object.prototype.toString.call(k):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof k=="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(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=y(this);if(k)return k;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 k=y(this);return k||(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(E);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var k=y(this);if(k)return k;if(this._bodyBlob)return v(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(w(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($)}),this.json=function(){return this.text().then(JSON.parse)},this}var S=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function A(k){var D=k.toUpperCase();return S.indexOf(D)>-1?D:k}function I(k,D){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');D=D||{};var q=D.body;if(k instanceof I){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,D.headers||(this.headers=new m(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!q&&k._bodyInit!=null&&(q=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=D.credentials||this.credentials||"same-origin",(D.headers||!this.headers)&&(this.headers=new m(D.headers)),this.method=A(D.method||this.method||"GET"),this.mode=D.mode||this.mode||null,this.signal=D.signal||this.signal||(function(){if("AbortController"in o){var V=new AbortController;return V.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&q)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(q),(this.method==="GET"||this.method==="HEAD")&&(D.cache==="no-store"||D.cache==="no-cache")){var U=/([?&])_=[^&]*/;if(U.test(this.url))this.url=this.url.replace(U,"$1_="+new Date().getTime());else{var W=/\?/;this.url+=(W.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function $(k){var D=new FormData;return k.trim().split("&").forEach(function(q){if(q){var U=q.split("="),W=U.shift().replace(/\+/g," "),V=U.join("=").replace(/\+/g," ");D.append(decodeURIComponent(W),decodeURIComponent(V))}}),D}function P(k){var D=new m,q=k.replace(/\r?\n[\t ]+/g," ");return q.split("\r").map(function(U){return U.indexOf(` 451`)===0?U.substr(1,U.length):U}
vendor: 15,616 bytes, line 451
451).forEach(function(U){var W=U.split(":"),V=W.shift().trim();if(V){var Y=W.join(":").trim();try{D.append(V,Y)}catch(K){console.warn("Response "+K.message)}}}),D}_.call(I.prototype);function j(k,D){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(D||(D={}),this.type="default",this.status=D.status===void 0?200:D.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=D.statusText===void 0?"":""+D.statusText,this.headers=new m(D.headers),this.url=D.url||"",this._initBody(k)}_.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},j.error=function(){var k=new j(null,{status:200,statusText:""});return k.ok=!1,k.status=0,k.type="error",k};var L=[301,302,303,307,308];j.redirect=function(k,D){if(L.indexOf(D)===-1)throw new RangeError("Invalid status code");return new j(null,{status:D,headers:{location:k}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(D,q){this.message=D,this.name=q;var U=Error(D);this.stack=U.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function B(k,D){return new Promise(function(q,U){var W=new I(k,D);if(W.signal&&W.signal.aborted)return U(new a.DOMException("Aborted","AbortError"));var V=new XMLHttpRequest;function Y(){V.abort()}V.onload=function(){var ae={statusText:V.statusText,headers:P(V.getAllResponseHeaders()||"")};W.url.indexOf("file://")===0&&(V.status<200||V.status>599)?ae.status=200:ae.status=V.status,ae.url="responseURL"in V?V.responseURL:ae.headers.get("X-Request-URL");var ce="response"in V?V.response:V.responseText;setTimeout(function(){q(new j(ce,ae))},0)},V.onerror=function(){setTimeout(function(){U(new TypeError("Network request failed"))},0)},V.ontimeout=function(){setTimeout(function(){U(new TypeError("Network request timed out"))},0)},V.onabort=function(){setTimeout(function(){U(new a.DOMException("Aborted","AbortError"))},0)};function K(ae){try{return ae===""&&o.location.href?o.location.href:ae}catch{return ae}}if(V.open(W.method,K(W.url),!0),W.credentials==="include"?V.withCredentials=!0:W.credentials==="omit"&&(V.withCredentials=!1),"responseType"in V&&(c.blob?V.responseType="blob":c.arrayBuffer&&(V.responseType="arraybuffer")),D&&typeof D.headers=="object"&&!(D.headers instanceof m||o.Headers&&D.headers instanceof o.Headers)){var ge=[];Object.getOwnPropertyNames(D.headers).forEach(function(ae){ge.push(f(ae)),V.setRequestHeader(ae,h(D.headers[ae]))}),W.headers.forEach(function(ae,ce){ge.indexOf(ce)===-1&&V.setRequestHeader(ce,ae)})}else W.headers.forEach(function(ae,ce){V.setRequestHeader(ce,ae)});W.signal&&(W.signal.addEventListener("abort",Y),V.onreadystatechange=function(){V.readyState===4&&W.signal.removeEventListener("abort",Y)}),V.send(typeof W._bodyInit>"u"?null:W._bodyInit)})}return B.polyfill=!0,o.fetch||(o.fetch=B,o.Headers=m,o.Request=I,o.Response=j),a.Headers=m,a.Request=I,a.Response=j,a.fetch=B,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(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})(lb,lb.exports)),lb.exports}var hFe=fFe();const EL=Rl(hFe);var pFe=Object.defineProperty,gFe=Object.defineProperties,mFe=Object.getOwnPropertyDescriptors,xL=Object.getOwnPropertySymbols,yFe=Object.prototype.hasOwnProperty,bFe=Object.prototype.propertyIsEnumerable,_L=(t,e,r)=>e in t?pFe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,CL=(t,e)=>{for(var r in e||(e={}))yFe.call(e,r)&&_L(t,r,e[r]);if(xL)for(var r of xL(e))bFe.call(e,r)&&_L(t,r,e[r]);return t},SL=(t,e)=>gFe(t,mFe(e));const vFe={Accept:"application/json","Content-Type":"application/json"},wFe="POST",AL={headers:vFe,method:wFe},TL=10;let WX=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ba.EventEmitter,this.isAvailable=!1,this.registering=!1,!aL(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=Uf(e),n=await(await EL(this.url,SL(CL({},AL),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!aL(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=Uf({id:1,jsonrpc:"2.0",method:"test",params:[]});await EL(e,SL(CL({},AL),{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"?Ff(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=g5(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return AX(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>TL&&this.events.setMaxListeners(TL)}};function EFe(t){return Number.isSafeInteger(t)&&t>=0}function xFe(t){return t!=null&&typeof t!="function"&&EFe(t.length)}function _Fe(t){return t==="__proto__"}function UT(t){return t==null||typeof t!="object"&&typeof t!="function"}function zX(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function BT(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const CFe="[object RegExp]",VX="[object String]",HX="[object Number]",GX="[object Boolean]",KX="[object Arguments]",SFe="[object Symbol]",AFe="[object Date]",TFe="[object Map]",IFe="[object Set]",kFe="[object Array]",$Fe="[object ArrayBuffer]",QX="[object Object]",NFe="[object DataView]",PFe="[object Uint8Array]",OFe="[object Uint8ClampedArray]",RFe="[object Uint16Array]",DFe="[object Uint32Array]",MFe="[object Int8Array]",jFe="[object Int16Array]",LFe="[object Int32Array]",FFe="[object Float32Array]",UFe="[object Float64Array]";function qT(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function BFe(t,e){return sp(t,void 0,t,new Map,e)}function sp(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(UT(t))return t;if(n.has(t))return n.get(t);if(Array.isArray(t)){const a=new Array(t.length);n.set(t,a);for(let o=0;o<t.length;o++)a[o]=sp(t[o],o,r,n,i);return Object.hasOwn(t,"index")&&(a.index=t.index),Object.hasOwn(t,"input")&&(a.input=t.input),a}if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const a=new RegExp(t.source,t.flags);return a.lastIndex=t.lastIndex,a}if(t instanceof Map){const a=new Map;n.set(t,a);for(const[o,c]of t)a.set(o,sp(c,o,r,n,i));return a}if(t instanceof Set){const a=new Set;n.set(t,a);for(const o of t)a.add(sp(o,void 0,r,n,i));return a}if(typeof Buffer<"u"&&Buffer.isBuffer(t))return t.subarray();if(qT(t)){const a=new(Object.getPrototypeOf(t)).constructor(t.length);n.set(t,a);for(let o=0;o<t.length;o++)a[o]=sp(t[o],o,r,n,i);return a}if(t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer)return t.slice(0);if(t instanceof DataView){const a=new DataView(t.buffer.slice(0),t.byteOffset,t.byteLength);return n.set(t,a),ao(a,t,r,n,i),a}if(typeof File<"u"&&t instanceof File){const a=new File([t],t.name,{type:t.type});return n.set(t,a),ao(a,t,r,n,i),a}if(typeof Blob<"u"&&t instanceof Blob){const a=new Blob([t],{type:t.type});return n.set(t,a),ao(a,t,r,n,i),a}if(t instanceof Error){const a=new t.constructor;return n.set(t,a),a.message=t.message,a.name=t.name,a.stack=t.stack,a.cause=t.cause,ao(a,t,r,n,i),a}if(t instanceof Boolean){const a=new Boolean(t.valueOf());return n.set(t,a),ao(a,t,r,n,i),a}if(t instanceof Number){const a=new Number(t.valueOf());return n.set(t,a),ao(a,t,r,n,i),a}if(t instanceof String){const a=new String(t.valueOf());return n.set(t,a),ao(a,t,r,n,i),a}if(typeof t=="object"&&qFe(t)){const a=Object.create(Object.getPrototypeOf(t));return n.set(t,a),ao(a,t,r,n,i),a}return t}function ao(t,e,r=t,n,i){const s=[...Object.keys(e),...zX(e)];for(let a=0;a<s.length;a++){const o=s[a],c=Object.getOwnPropertyDescriptor(t,o);(c==null||c.writable)&&(t[o]=sp(e[o],o,r,n,i))}}function qFe(t){switch(BT(t)){case KX:case kFe:case $Fe:case NFe:case GX:case AFe:case FFe:case UFe:case MFe:case jFe:case LFe:case TFe:case HX:case QX:case CFe:case IFe:case VX:case SFe:case PFe:case OFe:case RFe:case DFe:return!0;default:return!1}}function WFe(t,e){return BFe(t,(r,n,i,s)=>{if(typeof t=="object"){if(BT(t)===QX&&typeof t.constructor!="function"){const a={};return s.set(t,a),ao(a,t,i,s),a}switch(Object.prototype.toString.call(t)){case HX:case VX:case GX:{const a=new t.constructor(t==null?void 0:t.valueOf());return ao(a,t),a}case KX:{const a={};return ao(a,t),a.length=t.length,a[Symbol.iterator]=t[Symbol.iterator],a}default:return}}})}function IL(t){return WFe(t)}function kL(t){return t!==null&&typeof t=="object"&&BT(t)==="[object Arguments]"}function V7(t){return typeof t=="object"&&t!==null}function zFe(t){return V7(t)&&xFe(t)}function VFe(){}function ex(t){return qT(t)}function tx(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 HFe(t){if(UT(t))return t;if(Array.isArray(t)||qT(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 GFe(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 a=r[s];i=H7(i,a,n,new Map)}return i}function H7(t,e,r,n){if(UT(t)&&(t=Object(t)),e==null||typeof e!="object")return t;if(n.has(e))return HFe(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),...zX(e)];for(let s=0;s<i.length;s++){const a=i[s];if(_Fe(a))continue;let o=e[a],c=t[a];if(kL(o)&&(o={...o}),kL(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(o)&&(o=IL(o)),Array.isArray(o))if(Array.isArray(c)){const u=[],d=Reflect.ownKeys(c);for(let f=0;f<d.length;f++){const h=d[f];u[h]=c[h]}c=u}else if(zFe(c)){const u=[];for(let d=0;d<c.length;d++)u[d]=c[d];c=u}else c=[];const l=r(c,o,a,t,e,n);l!==void 0?t[a]=l:Array.isArray(o)||V7(c)&&V7(o)&&(tx(c)||tx(o)||ex(c)||ex(o))?t[a]=H7(c,o,r,n):c==null&&tx(o)?t[a]=H7({},o,r,n):c==null&&ex(o)?t[a]=IL(o):(c===void 0||o!==void 0)&&(t[a]=o)}return t}function KFe(t,...e){return GFe(t,...e,VFe)}const $L="error",QFe="wss://relay.walletconnect.org",YFe="wc",YX="universal_provider",ub=`${YFe}@2:${YX}:`,ZX="https://rpc.walletconnect.org/v1/",XX="generic",ZFe=`${ZX}bundler`,xp="call_status",XFe=86400,WT={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function JX(t,e,r){var i;const n=gl(t);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${ZX}?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function JFe(t){return t.includes(":")?t.split(":")[1]:t}function eJ(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function eUe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function NL(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 db(t={},e={}){const r=NL(PL(t)),n=NL(PL(e));return KFe(r,n)}function PL(t){var r,n,i,s,a;const e={};if(!fc(t))return e;for(const[o,c]of Object.entries(t)){const l=p5(o)?[o]:c.chains,u=c.methods||[],d=c.events||[],f=c.rpcMap||{},h=ip(o);e[h]={...e[h],...c,chains:dc(l,(r=e[h])==null?void 0:r.chains),methods:dc(u,(n=e[h])==null?void 0:n.methods),events:dc(d,(i=e[h])==null?void 0:i.events)},(fc(f)||fc(((s=e[h])==null?void 0:s.rpcMap)||{}))&&(e[h].rpcMap={...f,...(a=e[h])==null?void 0:a.rpcMap})}return e}function OL(t){return t.includes(":")?t.split(":")[2]:t}function RL(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],a=n.accounts||[],o=p5(r)?[r]:n.chains?n.chains:eJ(n.accounts);e[r]={chains:o,methods:i,events:s,accounts:a}}return e}function rx(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 tUe(t){try{const e=JSON.parse(t);return typeof e=="object"&&e!==null&&!Array.isArray(e)}catch{return!1}}const tJ={},_p=t=>tJ[t],nx=(t,e)=>{tJ[t]=e},DL="eip155",rUe=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],nUe=t=>t&&t.startsWith("0x")?BigInt(t).toString(10):t,ix=t=>t&&t.startsWith("0x")?t:`0x${BigInt(t).toString(16)}`,ML=t=>Object.keys(t).filter(e=>rUe.includes(e)).reduce((e,r)=>(e[r]=iUe(t[r]),e),{}),iUe=t=>typeof t=="string"&&tUe(t)?JSON.parse(t):t,sUe=(t,e,r)=>{const{sessionProperties:n={},scopedProperties:i={}}=t,s={};if(!fc(i)&&!fc(n))return;const a=ML(n);for(const o of r){const c=nUe(o);if(!c)continue;s[ix(c)]=a;const l=i==null?void 0:i[`${DL}:${c}`];if(l){const u=l==null?void 0:l[`${DL}:${c}:${e}`];s[ix(c)]={...s[ix(c)],...ML(u||l)}}}for(const[o,c]of Object.entries(s))Object.keys(c).length===0&&delete s[o];return Object.keys(s).length>0?s:void 0};let sx,aUe=class rJ{constructor(e){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)}
451static getStorage(e){return sx||(sx=new rJ(e)),sx}};async function oUe(t,e){const r=gl(t.result.capabilities.caip345.caip2),n=t.result.capabilities.caip345.transactionHashes,i=await Promise.allSettled(n.map(d=>cUe(r.reference,d,e))),s=i.filter(d=>d.status==="fulfilled").map(d=>d.value).filter(d=>d);i.filter(d=>d.status==="rejected").forEach(d=>console.warn("Failed to fetch transaction receipt:",d.reason));const a=!s.length||s.some(d=>!d),o=s.every(d=>(d==null?void 0:d.status)==="0x1"),c=s.every(d=>(d==null?void 0:d.status)==="0x0"),l=s.some(d=>(d==null?void 0:d.status)==="0x0");let u;return a?u=100:o?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 cUe(t,e,r){return await r(parseInt(t)).request(uo("eth_getTransactionReceipt",[e]))}async function lUe({sendCalls:t,storage:e}){const r=await e.getItem(xp);await e.setItem(xp,{...r,[t.result.id]:{request:t.request,result:t.result,expiry:Hn(XFe)}})}async function uUe({resultId:t,storage:e}){const r=await e.getItem(xp);if(r){delete r[t],await e.setItem(xp,r);for(const n in r)Xo(r[n].expiry)&&delete r[n];await e.setItem(xp,r)}}async function dUe({resultId:t,storage:e}){var n;const r=(n=await e.getItem(xp))==null?void 0:n[t];if(r&&!Xo(r.expiry))return r;await uUe({resultId:t,storage:e})}
vendor: 20,922 bytes, line 451
451class fUe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=_p("events"),this.client=_p("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=aUe.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(WT.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||JX(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new LT(new WX(n,_p("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 i;const n=parseInt(JFe(r));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[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={...this.httpProviders,[r]:this.createHttpProvider(r)},this.httpProviders[r])}async handleSwitchChain(e){var i,s;let r=e.request.params?(i=e.request.params[0])==null?void 0:i.chainId:"0x0";r=r.startsWith("0x")?r:`0x${r}`;const n=parseInt(r,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${n}`);else throw new Error(`Failed to switch to chain 'eip155:${n}'. 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 d,f,h,g,m;const r=(f=(d=e.request)==null?void 0:d.params)==null?void 0:f[0],n=((g=(h=e.request)==null?void 0:h.params)==null?void 0:g[1])||[];if(!r)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const i=this.client.session.get(e.topic),s=((m=i==null?void 0:i.sessionProperties)==null?void 0:m.capabilities)||{},a=n.length>0?n.join(","):`0x${this.chainId.toString(16)}`,o=`${r}${a}`,c=s==null?void 0:s[o];if(c)return c;let l;try{l=sUe(i,r,n)}catch(y){console.warn("Failed to extract capabilities from session",y)}if(l)return l;const u=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:{...i.sessionProperties||{},capabilities:{...s||{},[o]:u}}})}catch(y){console.warn("Failed to update session with capabilities",y)}return u}async getCallStatus(e){var a,o,c;const r=this.client.session.get(e.topic),n=(a=r.sessionProperties)==null?void 0:a.bundler_name;if(n){const l=this.getBundlerUrl(e.chainId,n);try{return await this.getUserOperationReceipt(l,e)}catch(u){console.warn("Failed to fetch call status from bundler",u,l)}}const i=(o=r.sessionProperties)==null?void 0:o.bundler_url;if(i)try{return await this.getUserOperationReceipt(i,e)}catch(l){console.warn("Failed to fetch call status from custom bundler",l,i)}const s=await dUe({resultId:(c=e.request.params)==null?void 0:c[0],storage:this.storage});if(s)try{return await oUe(s,this.getHttpProvider.bind(this))}catch(l){console.warn("Failed to fetch call status from stored send calls",l,s)}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 s;const n=new URL(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(uo("eth_getUserOperationReceipt",[(s=r.request.params)==null?void 0:s[0]]))});if(!i.ok)throw new Error(`Failed to fetch user operation receipt - ${i.status}`);return await i.json()}getBundlerUrl(e,r){return`${ZFe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}async sendCalls(e){var c,l,u;const r=await this.client.request(e),n=(c=e.request.params)==null?void 0:c[0],i=r==null?void 0:r.id,s=(r==null?void 0:r.capabilities)||{},a=(l=s==null?void 0:s.caip345)==null?void 0:l.caip2,o=(u=s==null?void 0:s.caip345)==null?void 0:u.transactionHashes;return!i||!a||!(o!=null&&o.length)||await lUe({sendCalls:{request:n,result:r},storage:this.storage}),r}}class hUe{constructor(e){this.name=XX,this.namespace=e.namespace,this.events=_p("events"),this.client=_p("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(WT.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 gl(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 r,n;const e={};return(n=(r=this.namespace)==null?void 0:r.accounts)==null||n.forEach(i=>{var o,c;const s=gl(i),a=(c=(o=this.namespace)==null?void 0:o.rpcMap)==null?void 0:c[`${s.namespace}:${s.reference}`];e[s.reference]=this.createHttpProvider(i,a)}),e}getHttpProvider(e){const r=gl(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||JX(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new LT(new WX(n,_p("disableProviderPing")))}}let pUe=class nJ{constructor(e){this.events=new cT,this.rpcProviders={},this.disableProviderPing=!1,this.providerOpts=e,this.logger=DT({logger:e.logger??$L,name:this.providerOpts.name??YX}),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new nJ(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:{...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(a=>r(null,Vm(s,a))).catch(a=>r(a,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:ln("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 a=RL(this.session.namespaces);this.namespaces=db(this.namespaces,a),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 a,o;const{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties,authentication:(a=this.connectParams)==null?void 0:a.authentication,walletPay:(o=this.connectParams)==null?void 0:o.walletPay});r&&(this.uri=r,this.events.emit("display_uri",r));const i=await n();this.session=i;const s=RL(i.namespaces);return this.namespaces=db(this.namespaces,s),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(!Ra(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 dFe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||$L,relayUrl:this.providerOpts.relayUrl||QFe,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=>ip(r)))];nx("client",this.client),nx("events",this.events),nx("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=eUe(r,this.session);if((n==null?void 0:n.length)===0)return;const i=eJ(n),s={...db(this.namespaces,this.optionalNamespaces)[r],accounts:n,chains:i};switch(r){case"eip155":this.rpcProviders[r]=new fUe({namespace:s});break;default:this.rpcProviders[r]=new hUe({namespace:s})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{var n;const{topic:r}=e;r===((n=this.session)==null?void 0:n.topic)&&this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{var s;const{params:r,topic:n}=e;if(n!==((s=this.session)==null?void 0:s.topic))return;const{event:i}=r;if(i.name==="accountsChanged"){const a=i.data;a&&Ra(a)&&this.events.emit("accountsChanged",a.map(OL))}else if(i.name==="chainChanged"){const a=r.chainId,o=r.event.data,c=ip(a),l=rx(a)!==rx(o)?`${c}:${rx(o)}`:a;this.onChainChanged({currentCaipChainId:l})}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var s,a;if(e!==((s=this.session)==null?void 0:s.topic))return;const{namespaces:n}=r,i=(a=this.client)==null?void 0:a.session.get(e);this.session={...i,namespaces:n},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",{...ln("USER_DISCONNECTED"),data:e.topic}))}),this.on(WT.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged({...e,internal:!0})})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[XX]}onSessionUpdate(){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=db(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(a=>ip(a)).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=ip(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 a=this.getProvider(i);a?a.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 a=(s=(i=this.session)==null?void 0:i.namespaces[e])==null?void 0:s.accounts;if(!a)return;const o=a.filter(c=>c.includes(`${r}:`)).map(OL);if(!Ra(o))return;this.events.emit("accountsChanged",o)}catch(a){this.logger.warn(a,"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 i;const n=((i=this.session)==null?void 0:i.topic)||"";await this.client.core.storage.setItem(`${ub}/${e}${n}`,r)}async getFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";return await this.client.core.storage.getItem(`${ub}/${e}${r}`)}async deleteFromStore(e){var n;const r=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.removeItem(`${ub}/${e}${r}`)}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(ub)&&await this.client.core.storage.removeItem(n)}catch(r){this.logger.warn(r,"Failed to cleanup storage")}}};const gUe=pUe,mUe="wc",yUe="ethereum_provider",bUe=`${mUe}@2:${yUe}:`,vUe="https://rpc.walletconnect.org/v1/",G7=["eth_sendTransaction","personal_sign"],iJ=["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_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],K7=["chainChanged","accountsChanged"],sJ=["chainChanged","accountsChanged","message","disconnect","connect"],wUe=async()=>{const{createAppKit:t}=await sc(()=>import("./core-Cxhdc57_.js").then(e=>e.a7),__vite__mapDeps([4,1,3]));return t};function Ew(t){return Number(t[0].split(":")[1])}function fb(t){return`0x${t.toString(16)}`}function EUe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:a,rpcMap:o}=t;if(!Ra(e))throw new Error("Invalid chains");const c={chains:e,methods:n||G7,events:s||K7,rpcMap:{...e.length?{[Ew(e)]:o[Ew(e)]}:{}}},l=s==null?void 0:s.filter(h=>!K7.includes(h)),u=n==null?void 0:n.filter(h=>!G7.includes(h));if(!r&&!a&&!i&&!(l!=null&&l.length)&&!(u!=null&&u.length))return{required:e.length?c:void 0};const d=(l==null?void 0:l.length)&&(u==null?void 0:u.length)||!r,f={chains:[...new Set(d?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:iJ))],events:[...new Set(c.events.concat(a!=null&&a.length?a:sJ))],rpcMap:o};return{required:e.length?c:void 0,optional:r.length?f:void 0}}let xUe=class aJ{constructor(){this.events=new ba.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=bUe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new aJ;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){var i;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=EUe(this.rpc);try{const s=await new Promise(async(o,c)=>{var u,d;this.rpc.showQrModal&&((u=this.modal)==null||u.open(),(d=this.modal)==null||d.subscribeState(f=>{!f.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),c(new Error("Connection request reset. Please try again.")))}));const l=e!=null&&e.scopedProperties?{[this.namespace]:e.scopedProperties}:void 0;
451await this.signer.connect({namespaces:{...r&&{[this.namespace]:r}},...n&&{optionalNamespaces:{[this.namespace]:n}},pairingTopic:e==null?void 0:e.pairingTopic,scopedProperties:l}).then(f=>{o(f)}).catch(f=>{var h;(h=this.modal)==null||h.showErrorMessage("Unable to connect"),c(new Error(f.message))})});if(!s)return;const a=lj(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:fb(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{(i=this.modal)==null||i.close()}}async authenticate(e,r){var n;if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(a,o)=>{var c,l;this.rpc.showQrModal&&((c=this.modal)==null||c.open(),(l=this.modal)==null||l.subscribeState(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate({...e,chains:this.rpc.chains},r).then(u=>{a(u)}).catch(u=>{var d;(d=this.modal)==null||d.showErrorMessage("Unable to connect"),o(new Error(u.message))})}),s=i.session;if(s){const a=lj(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:fb(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{(n=this.modal)==null||n.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("accountsChanged",e=>{this.accounts=this.parseAccounts(e),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",fb(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",{...ln("USER_DISCONNECTED"),data:e.topic,name:"USER_DISCONNECTED"})}),this.signer.on("display_uri",e=>{this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",fb(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){const r=(e==null?void 0:e.chains)??[],n=(e==null?void 0:e.optionalChains)??[],i=r.concat(n);if(!i.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const s=r.length?(e==null?void 0:e.methods)||G7:[],a=r.length?(e==null?void 0:e.events)||K7:[],o=(e==null?void 0:e.optionalMethods)||[],c=(e==null?void 0:e.optionalEvents)||[],l=(e==null?void 0:e.rpcMap)||this.buildRpcMap(i,e.projectId),u=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:r==null?void 0:r.map(d=>this.formatChainId(d)),optionalChains:n.map(d=>this.formatChainId(d)),methods:s,events:a,optionalMethods:o,optionalEvents:c,rpcMap:l,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:u,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>
451{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){var r;if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Ew(this.rpc.chains):Ew(this.rpc.optionalChains),this.signer=await gUe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storage:e.storage,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let n;try{const i=await wUe(),{convertWCMToAppKitOptions:s}=await Promise.resolve().then(function(){return TUe}),a=s({...this.rpc.qrModalOptions,chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId});if(!a.networks.length)throw new Error("No networks found for WalletConnect");n=i({...a,universalProvider:this.signer,manualWCControl:!0,enableMobileFullScreen:((r=this.rpc.qrModalOptions)==null?void 0:r.enableMobileFullScreen)===!0})}catch(i){throw console.warn(i),new Error("To use QR modal, please install @reown/appkit package")}if(n)try{this.modal=n}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Ra(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&Ra(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${vUe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};const _Ue=xUe;function CUe(t){if(t)return{"--w3m-font-family":t["--wcm-font-family"],"--w3m-accent":t["--wcm-accent-color"],"--w3m-color-mix":t["--wcm-background-color"],"--w3m-z-index":t["--wcm-z-index"]?Number(t["--wcm-z-index"]):void 0,"--w3m-qr-color":t["--wcm-accent-color"],"--w3m-font-size-master":t["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":t["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}const SUe=t=>{const[e,r]=t.split(":");return oJ({id:r,caipNetworkId:t,chainNamespace:e,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function AUe(t){var i,s,a,o,c,l,u;const e=(i=t.chains)==null?void 0:i.map(SUe).filter(Boolean);if(e.length===0)throw new Error("At least one chain must be specified");const r=e.find(d=>{var f;return d.id===((f=t.defaultChain)==null?void 0:f.id)}),n={projectId:t.projectId,networks:e,themeMode:t.themeMode,themeVariables:CUe(t.themeVariables),chainImages:t.chainImages,connectorImages:t.walletImages,defaultNetwork:r,metadata:{...t.metadata,name:((s=t.metadata)==null?void 0:s.name)||"WalletConnect",description:((a=t.metadata)==null?void 0:a.description)||"Connect to WalletConnect-compatible wallets",url:((o=t.metadata)==null?void 0:o.url)||"https://walletconnect.org",icons:((c=t.metadata)==null?void 0:c.icons)||["https://walletconnect.org/walletconnect-logo.png"]},showWallets:!0,featuredWalletIds:t.explorerRecommendedWalletIds==="NONE"?[]:Array.isArray(t.explorerRecommendedWalletIds)?t.explorerRecommendedWalletIds:[],excludeWalletIds:t.explorerExcludedWalletIds==="ALL"?[]:Array.isArray(t.explorerExcludedWalletIds)?t.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if((l=t.mobileWallets)!=null&&l.length||(u=t.desktopWallets)!=null&&u.length){const d=[...(t.mobileWallets||[]).map(g=>({id:g.id,name:g.name,links:g.links})),...(t.desktopWallets||[]).map(g=>({id:g.id,name:g.name,links:{native:g.links.native,universal:g.links.universal}}))],f=[...n.featuredWalletIds||[],...n.excludeWalletIds||[]],h=d.filter(g=>!f.includes(g.id));h.length&&(n.customWallets=h)}return n}function oJ(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}var TUe=Object.freeze({__proto__:null,convertWCMToAppKitOptions:AUe,defineChain:oJ});let Cp=class extends M0{async initialize(){var n,i,s,a;let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if((i=(n=this.walletProvider)==null?void 0:n.session)!=null&&i.peer.metadata.url){let o=E4((a=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:a.peer.metadata.url);this.walletEntry=o==null?void 0:o.entry,this.walletClientType=(o==null?void 0:o.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts()}
451this.initialized=!0,this.emit("initialized");let{WalletConnectModal:r}=await sc(()=>import("./index-CbqKx0Y3.js").then(o=>o.i),__vite__mapDeps([5,1]));this.modal=new r({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal((o=>{var c;o.open||(c=this.walletProvider)!=null&&c.session||!this.onQrModalClosed||this.onQrModalClosed()}))}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){var e;return!!((e=this.walletProvider)!=null&&e.connected)}get walletBranding(){var r,n,i,s,a,o,c;if(this.walletClientType==="metamask")return{name:"MetaMask",icon:W7e,id:"io.metamask"};let e=(i=(n=(r=this.walletProvider)==null?void 0:r.session)==null?void 0:n.peer.metadata.icons)==null?void 0:i[0];return{name:N8e(((a=(s=this.walletProvider)==null?void 0:s.session)==null?void 0:a.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:Q7e,id:((c=(o=this.walletProvider)==null?void 0:o.session)==null?void 0:c.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){var r;this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,(r=this.walletEntry)!=null&&r.isWalletEntryOverriden||(this.walletEntry=V9[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,L8e(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,r)=>{this.onQrModalClosed=()=>{r(new xQ)},(async()=>{var s,a,o,c,l;let n="",i=await Promise.race([(s=this.walletProvider)==null?void 0:s.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(n=i[0]),!n||n==="")throw new un("Unable to retrieve address");if((o=(a=this.walletProvider)==null?void 0:a.session)!=null&&o.peer.metadata.url){let u=E4((l=(c=this.walletProvider)==null?void 0:c.session)==null?void 0:l.peer.metadata.url);this.walletEntry=u==null?void 0:u.entry,this.walletClientType=(u==null?void 0:u.walletClientType)||"unknown",this.proxyProvider.rpcTimeoutDuration=KA(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(i),e()})().catch((n=>{r(n?ih(n):new un("Unknown error during connection"))})).finally((()=>{var n;return(n=this.modal)==null?void 0:n.closeModal()}))}))}disconnect(){var e;(e=this.walletProvider)==null||e.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect Wallet Connect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let s of this.chains){let a=O8e(s.id,this.chains,this.rpcConfig,this.privyAppId);a&&(e[s.id]=a)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map((s=>s.id)),i=await _Ue.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:sJ,optionalMethods:iJ,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",(s=>{var a,o;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:c,href:l}=M8e(s,this.walletEntry);F8e({href:l,name:this.walletEntry.displayName}),this.redirectUri=c;let u=j8e(s,this.walletEntry);u!=null&&u.redirect&&(this.fallbackUniversalRedirectUri=u.redirect),An.isMobile&&cK(c,"_self"),(a=this.showPrivyQrModal)==null||a.call(this,{native:c,universal:this.fallbackUniversalRedirectUri})}else(o=this.modal)==null||o.openModal({uri:s,chains:[this.defaultChain.id]})})),i.on("connect",(()=>{var s,a,o;if((s=this.modal)==null||s.closeModal(),(a=i.session)==null?void 0:a.peer.metadata.url){let c=E4((o=i.session)==null?void 0:o.peer.metadata.url);this.walletEntry=c==null?void 0:c.entry,this.walletClientType=(c==null?void 0:c.walletClientType)||"unknown"}})),i}async enableProvider(){var e,r;return(e=this.walletProvider)!=null&&e.connected?Promise.resolve(this.walletProvider.accounts):await((r=this.walletProvider)==null?void 0:r.enable())}setWalletEntry(e,r){this.walletEntry=e,this.showPrivyQrModal=r}constructor(e,r,n,i,s,a,o,c){super(c||"unknown",n,i,r),this.connectorType="wallet_connect_v2",this.privyAppId=a,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=s,this.proxyProvider=new us(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=V9[c],this.walletClientType=c)}};var IUe=(t,e)=>{let r=C.useRef((()=>{}));C.useEffect((()=>{r.current=t})),C.useEffect((()=>
451{if(e!==null){let n=setInterval((()=>r.current()),e||0);return()=>clearInterval(n)}}),[e])};function kUe(){let[t,e]=C.useState(!1),r=C.useCallback((()=>{document.hidden&&e(!0)}),[]);return C.useEffect((()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r))),[r]),{hasTabbedAway:t,reset:()=>e(!1)}}const cJ=t=>(t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER?vu.ERROR_USER_EXISTS:t instanceof yo&&!t.details.default?t.details:t instanceof EQ?vu.ERROR_TIMED_OUT:t instanceof xQ?vu.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE?vu.ERROR_USER_LIMIT_REACHED:vu.ERROR_WALLET_CONNECTION,$Ue=()=>{var ie,le,ye,fe,we,Ce,ne,Re,Pe,Ae,Ue;let t,[e,r]=C.useState(!1),[n,i]=C.useState(!1),[s,a]=C.useState(void 0),{authenticated:o,logout:c}=Sr(),{app:l,navigate:u,navigateBack:d,lastScreen:f,currentScreen:h,setModalData:g,data:m}=ht(),{getAuthFlow:y,walletConnectionStatus:b,closePrivyModal:E,initLoginWithWallet:v,loginWithWallet:w,updateWallets:x,createAnalyticsEvent:_}=bt(),{walletConnectors:S}=Sr(),[A,I]=C.useState(0),{user:$}=Sr(),[P]=C.useState(($==null?void 0:$.linkedAccounts.length)||0),[j,L]=C.useState(""),[B,k]=C.useState(""),[D,q]=C.useState(!1),{hasTabbedAway:U}=kUe(),{enabled:W,token:V}=Vs(),Y=An.isMobile&&((ie=b==null?void 0:b.connector)==null?void 0:ie.connectorType)==="wallet_connect_v2"||An.isMobile&&((le=b==null?void 0:b.connector)==null?void 0:le.connectorType)==="coinbase_wallet"||An.isMobile&&((ye=b==null?void 0:b.connector)==null?void 0:ye.connectorType)==="injected"&&((fe=b==null?void 0:b.connector)==null?void 0:fe.walletClientType)==="phantom",K=(b==null?void 0:b.status)==="connected",ge=(b==null?void 0:b.status)==="switching_to_supported_chain";C.useEffect((()=>{var O;let He=y(),Qe=He instanceof Kv||He instanceof Z9?He:void 0;K&&!Qe&&(!W||V||o?v(b.connectedWallet,V,(O=m==null?void 0:m.login)==null?void 0:O.disableSignup).then((()=>{q(!0)})):(g({captchaModalData:{callback:T=>{var N;return v(b.connectedWallet,T,(N=m==null?void 0:m.login)==null?void 0:N.disableSignup).then((()=>{q(!0)}))},userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_CONNECTION,onErrorNavigateTo:de.ERROR_SCREEN}}),u(de.CAPTCHA_SCREEN,!1))),Qe&&Y&&K&&!Qe.preparedMessage?Qe.buildMessage():Qe&&!Y&&K&&(n||(async()=>{var T,N;i(!0),a(void 0);try{((T=b==null?void 0:b.connector)==null?void 0:T.connectorType)==="wallet_connect_v2"&&((N=b==null?void 0:b.connector)==null?void 0:N.walletClientType)==="metamask"&&await rK(2500),await ce()}catch(G){console.warn("Auto-prompted signature failed",G)}finally{i(!1)}})())}),[A,K,D]),C.useEffect((()=>{var He;if($&&e){let Qe=fn-500;if(l!=null&&l.legal.requireUsersAcceptTerms&&!$.hasAcceptedTerms){let T=setTimeout((()=>{u(de.AFFIRMATIVE_CONSENT_SCREEN)}),Qe);return()=>clearTimeout(T)}if(Sl($,(He=l==null?void 0:l.embeddedWallets)==null?void 0:He.createOnLogin)){let T=setTimeout((()=>{g({createWallet:{onSuccess:()=>{},onFailure:N=>{console.error(N),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:N,screen:"ConnectionStatusScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),u(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),Qe);return()=>clearTimeout(T)}x();let O=setTimeout((()=>E({shouldCallAuthOnSuccess:!0,isSuccess:!0})),fn);return()=>clearTimeout(O)}}),[$,e]);let ae=He=>{var Qe,O,T,N,G,te,ue,pe,Ie,je,Te,ve,Oe,at;if((He==null?void 0:He.privyErrorCode)!==Se.ALLOWLIST_REJECTED){if((He==null?void 0:He.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Ny(He).toString()),void u(de.USER_LIMIT_REACHED_SCREEN);if((He==null?void 0:He.privyErrorCode)!==Se.USER_DOES_NOT_EXIST)return(He==null?void 0:He.privyErrorCode)===Se.ACCOUNT_TRANSFER_REQUIRED&&((O=(Qe=He.data)==null?void 0:Qe.data)!=null&&O.nonce)?(g({accountTransfer:{nonce:(N=(T=He.data)==null?void 0:T.data)==null?void 0:N.nonce,account:(G=y())==null?void 0:G.meta.address,displayName:(pe=(ue=(te=He.data)==null?void 0:te.data)==null?void 0:ue.account)==null?void 0:pe.displayName,externalWalletMetadata:{walletClientType:(Ie=y())==null?void 0:Ie.meta.walletClientType,chainId:(je=y())==null?void 0:je.meta.chainId,connectorType:(Te=y())==null?void 0:Te.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(at=(Oe=(ve=He.data)==null?void 0:ve.data)==null?void 0:Oe.otherUser)==null?void 0:at.embeddedWalletAddress}}),void u(de.LINK_CONFLICT_SCREEN)):void a(cJ(He));u(de.ACCOUNT_NOT_FOUND_SCREEN)}else u(de.ALLOWLIST_REJECTION_SCREEN)};async function ce(){try{await w(),r(!0)}catch(He){ae(He)}finally{i(!1)}}C.useEffect((()=>{b!=null&&b.connectError&&ae(b==null?void 0:b.connectError)}),[b]),IUe((()=>{let He=Q==="wallet_connect_v2"&&(b==null?void 0:b.connector)instanceof Cp?b.connector.redirectUri:void 0;He&&L(He);let Qe=Q==="wallet_connect_v2"&&(b==null?void 0:b.connector)instanceof Cp?b.connector.fallbackUniversalRedirectUri:void 0;Qe&&k(Qe)}
451),(b==null?void 0:b.connector)instanceof Cp&&!j?500:null);let Q=((we=b==null?void 0:b.connector)==null?void 0:we.connectorType)||"injected",se=((Ce=b==null?void 0:b.connector)==null?void 0:Ce.walletClientType)||"unknown",me=((ne=uc[se])==null?void 0:ne.displayName)||((Re=b==null?void 0:b.connector)==null?void 0:Re.walletBranding.name)||"Browser Extension",_e=((Pe=uc[se])==null?void 0:Pe.logo)||((Ae=b==null?void 0:b.connector)==null?void 0:Ae.walletBranding.icon)||(He=>p.jsx(oT,{...He})),z=me==="Browser Extension"?me.toLowerCase():me;t=e?`Successfully connected with ${z}`:s?s.message:ge?"Switching networks":K?n&&Y?"Signing":"Sign to verify":`Waiting for ${z}`;let R="Donât see your wallet? Check your other browser windows.";e?R=P===(($==null?void 0:$.linkedAccounts.length)||0)?"Wallet was already linked.":"Youâre good to go!":A>=2&&s?R="Unable to connect wallet":s?R=s.detail:ge?R="Switch your wallet to the requested network.":K&&Y?R="Sign the message in your wallet to verify it belongs to you.":se==="metamask"&&An.isMobile?R="Click continue to open and connect MetaMask.":se==="metamask"?R="For the best experience, connect only one wallet at a time.":Q==="wallet_connect"?R="Open your mobile wallet app to continue":Q!=="coinbase_wallet"||eK()||(R=aM($)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let M=(Ue=S==null?void 0:S.walletConnectors)==null?void 0:Ue.find((He=>He.walletClientType==="coinbase_wallet")),ee=se==="coinbase_wallet"&&(aM($)||s===vu.ERROR_USER_EXISTS);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:f&&h!==f?d:void 0}),p.jsxs(NUe,{children:[p.jsx(lJ,{walletLogo:_e,success:e,fail:!!s}),p.jsxs(ga,{children:[p.jsx("h3",{children:t}),p.jsx("p",{children:R}),K||!j||U?null:p.jsxs("p",{children:["Still here?"," ",p.jsx("a",{href:j,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),B&&p.jsxs(p.Fragment,{children:[" ","or"," ",p.jsx("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),ee?p.jsx(Mt,{onClick:()=>M&&(M==null?void 0:M.disconnect()),disabled:e,children:"Use a different wallet"}):s==vu.ERROR_USER_EXISTS&&h!==f?p.jsx(Mt,{onClick:d,children:"Use a different wallet"}):K&&!e&&Y?p.jsx(Mt,{onClick:()=>{i(!0),ce()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!e&&(s!=null&&s.retryable)&&A<2?p.jsx(Mt,{onClick:()=>{I(A+1),a(void 0),K?(i(!0),ce()):b==null||b.connectRetry()},disabled:!e&&(!(s!=null&&s.retryable)||A>=2),children:"Retry"}):e||s?null:p.jsx(Mt,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),p.jsx(vr,{})]})};let NUe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-afad057-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),PUe=oe.div.withConfig({displayName:"StackedContainer",componentId:"sc-afad057-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const lJ=t=>{let e=t.walletLogo;return p.jsx(p.Fragment,{children:p.jsx(PUe,{children:p.jsxs("div",{children:[p.jsx(To,{success:t.success,fail:t.fail}),typeof e=="string"?p.jsx("span",{style:{background:`url('${e}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):p.jsx(e,{style:{width:"38px",height:"38px"}})]})})})},OUe=()=>{var x,_,S,A,I,$;let t,{navigateBack:e,navigate:r,lastScreen:n,currentScreen:i,data:s,setModalData:a}=ht(),{walletConnectionStatus:o,closePrivyModal:c}=bt(),[l,u]=C.useState(void 0),[d,f]=C.useState(0),h=(o==null?void 0:o.status)==="connected",g=(o==null?void 0:o.status)==="switching_to_supported_chain";C.useEffect((()=>{var P,j;if(h){let L;if((P=s==null?void 0:s.externalConnectWallet)!=null&&P.onCompleteNavigateTo){let B=s.externalConnectWallet.onCompleteNavigateTo,k=(j=o.connectedWallet)==null?void 0:j.address;L=setTimeout((()=>{var D;s.funding&&a({...s,funding:{...s.funding,connectedWalletAddress:k}}),r(B({walletChainType:(D=o.connector)==null?void 0:D.chainType}))}),fn)}else L=setTimeout(c,fn);return()=>clearTimeout(L)}}),[h]),C.useEffect((()=>{var P;o!=null&&o.connectError&&(P=o==null?void 0:o.connectError,u(cJ(P)))}),[o]);let m=((x=o==null?void 0:o.connector)==null?void 0:x.connectorType)||"injected",y=((_=o==null?void 0:o.connector)==null?void 0:_.walletClientType)||"unknown",b=((S=uc[y])==null?void 0:S.displayName)||((A=o==null?void 0:o.connector)==null?void 0:A.walletBranding.name)||"Browser Extension",E=((I=uc[y])==null?void 0:I.logo)||(($=o==null?void 0:o.connector)==null?void 0:$.walletBranding.icon)||(P=>p.jsx(oT,{...P})),v=b==="Browser Extension"?b.toLowerCase():b;t=h?`Successfully connected with ${v}`:l?l.message:g?"Switching networks":`Waiting for ${v}`;let w="Donât see your wallet? Check your other browser windows.";return h?w="Youâre good to go!":d>=2&&l?w="Unable to connect wallet":l?w=l.detail:g?w="Switch your wallet to the requested network.":y==="metamask"&&An.isMobile?w="Click to continue to open and connect MetaMask.":y==="metamask"?w="For the best experience, connect only one wallet at a time.":m==="wallet_connect_v2"?w="Open your mobile wallet app to continue":m==="coinbase_wallet"&&(w="Open the C
451oinbase app on your phone to continue."),p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:i===n?void 0:e}),p.jsxs(RUe,{children:[p.jsx(lJ,{walletLogo:E,success:h,fail:!!l}),p.jsxs(ga,{children:[p.jsx("h3",{children:t}),p.jsx("p",{children:w})]}),l==vu.ERROR_USER_EXISTS?p.jsx(Mt,{onClick:e,children:"Use a different wallet"}):!h&&(l!=null&&l.retryable)&&d<2?p.jsx(Mt,{onClick:()=>{f(d+1),u(void 0),o==null||o.connectRetry()},disabled:!h&&(!(l!=null&&l.retryable)||d>=2),children:"Retry"}):!h&&l&&d>=2?p.jsx(Mt,{onClick:e,children:"Use a different wallet"}):null]}),p.jsx(vr,{})]})};let RUe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1346f57-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const uJ=({name:t,logoUrl:e,size:r="38px"})=>typeof e=="string"?p.jsx("img",{src:e,alt:`${t??"Provider app"} logo`,style:{width:r,height:r,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):p.jsx("span",{});function DUe(t){let{logout:e}=C.useContext(Ly);return ZA("logout",t),{logout:e}}const MUe=()=>{let t=Jn(),{data:e,navigate:r,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=ht(),{crossAppAuthFlow:s,updateWallets:a,closePrivyModal:o,createAnalyticsEvent:c}=bt(),{logout:l}=DUe(),[u,d]=C.useState({}),f=e==null?void 0:e.crossAppAuth,h={id:f.appId,name:f.name,logoUrl:f.logoUrl},g=new xe(`There was an issue connecting your ${h.name} account. Please try again.`),m=new es((async v=>{if(f.popup)try{let w=await s({appId:v,popup:f.popup,action:f.action});d({data:w})}catch(w){w instanceof xe?d({error:w}):(w instanceof $a&&f.popup&&f.popup.close(),d({error:g}))}else d({error:g})})),y=()=>{u.data&&(a(),f.onSuccess(u.data),o({shouldCallAuthOnSuccess:!0,isSuccess:!0})),f.onError(u.error??new xe("User canceled flow")),o({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=y,C.useEffect((()=>{h.id.length&&m.execute(h.id)}),[h.id]),C.useEffect((()=>{var x;if(!u.data)return;let v=u.data;if(t.legal.requireUsersAcceptTerms&&!v.hasAcceptedTerms){let _=setTimeout((()=>{r(de.AFFIRMATIVE_CONSENT_SCREEN)}),fn);return()=>clearTimeout(_)}if(Sl(v,(x=t.embeddedWallets)==null?void 0:x.createOnLogin)){let _=setTimeout((()=>{n({createWallet:{onSuccess:()=>{},onFailure:S=>{console.error(S),c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:S,provider:`privy:${h.id}`,screen:"CrossAppAuthScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),r(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),fn);return()=>clearTimeout(_)}let w=setTimeout(y,fn);return()=>clearTimeout(w)}),[u.data]);let{title:b,subtitle:E}=C.useMemo((()=>u.data?{title:`Successfully connected with ${h.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${h.name}`,subtitle:`Please check the pop-up from ${h.name} to continue`}),[u,h.name]);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:y}),p.jsx(Lr,{}),p.jsxs(jUe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:!!u.data,fail:!!u.error}),p.jsx(uJ,{name:h.name,logoUrl:h.logoUrl})]})}),p.jsxs(ga,{children:[p.jsx("h3",{children:b}),p.jsx("p",{children:E})]})]}),p.jsx(qr,{}),p.jsx(vr,{})]})};let jUe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-2ae0702a-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);function LUe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Mo=C.forwardRef(LUe);function FUe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const UUe=C.forwardRef(FUe),BUe=oe.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),Nl=oe.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]),qUe=oe.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),dJ=ns(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],(t=>t.$state==="error"?"border-color: var(--privy-color-error);":"")),zT=oe.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],dJ),v5=({errMsg:t,balance:e,address:r,isLoading:n,className:i,title:s,isPulsing:a,showIcon:o,statusColor:c="green"})=>{let l;return l=c||(t?"red":"green"),p.jsxs(p.Fragment,{children:[p.jsxs(zT,{className:i,$state:t?"error":void 0,children:[p.jsxs(BUe,{children:[p.jsx(qUe,{children:s||"Pay with"}),p.jsx(_i,{address:r,showCopyIcon:o||!!t})]}
451),e!==void 0&&p.jsx($o,{isLoading:n,isPulsing:a,color:l,children:e})]}),t&&p.jsx(Nl,{style:{marginTop:"0.25rem"},children:t})]})},WUe=()=>{let{app:t,data:e}=ht(),{closePrivyModal:r}=bt(),[n,i]=C.useState(!1),[s,a]=C.useState(),{address:o,onDelegate:c,onSuccess:l,onError:u}=e.delegatedActions.consent,d=async()=>{n?l():u(s??new xe("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return C.useEffect((()=>{if(!n&&!s)return;let f=setTimeout(d,IA);return()=>clearTimeout(f)}),[n,s]),p.jsxs(p.Fragment,n||s?{children:[p.jsx(lt,{onClose:d}),p.jsx(Lr,{}),p.jsxs(nT,{children:[s?p.jsx(K3,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):p.jsx(Mo,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(sT,{height:20}),p.jsx(wn,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":`Youâve successfully granted delegated action permissions to ${t.name}.`})]}),p.jsx(qr,{}),p.jsx(Ht,{})]}:{children:[p.jsx(lt,{closeable:!0,onClose:d}),p.jsx(UUe,{width:56,height:56,style:{margin:"auto"}}),p.jsx(Hr,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),p.jsxs(Gr,{style:{marginBottom:24,textWrap:"pretty"},children:["By confirming, ",t.name," will be able to use your wallet for you even when you're not around. You can revoke this later."]}),p.jsx(VUe,{showIcon:!0,address:o,title:"Wallet",isLoading:!1}),p.jsxs(zUe,{style:{marginTop:24},children:[p.jsx(Tl,{onClick:d,children:"Not now"}),p.jsx(Mt,{onClick:async()=>{try{await c(),i(!0)}catch(f){a(f)}},children:"Accept"})]}),p.jsx(Ht,{})]})};let zUe=oe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-b99bc0c0-0"})(["display:flex;gap:10px;"]),VUe=oe(v5).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-b99bc0c0-1"})(["margin-top:1.5rem;"]);function HUe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const GUe=C.forwardRef(HUe),KUe=()=>{let{app:t,data:e}=ht(),{closePrivyModal:r}=bt(),[n,i]=C.useState(!1),[s,a]=C.useState(),{onRevoke:o,onSuccess:c,onError:l}=e.delegatedActions.revoke,u=async()=>{n?c():l(s??new xe("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return C.useEffect((()=>{if(!n&&!s)return;let d=setTimeout(u,IA);return()=>clearTimeout(d)}),[n,s]),p.jsxs(p.Fragment,n||s?{children:[p.jsx(lt,{onClose:u}),p.jsx(Lr,{}),p.jsxs(nT,{children:[s?p.jsx(K3,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):p.jsx(Mo,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(sT,{height:20}),p.jsx(wn,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":"You've successfully revoked permissions."})]}),p.jsx(qr,{}),p.jsx(Ht,{})]}:{children:[p.jsx(lt,{closeable:!0,onClose:u}),p.jsx(GUe,{width:56,height:56,style:{margin:"auto"}}),p.jsx(Hr,{style:{marginTop:24},children:"Revoke offline access to wallet"}),p.jsxs(Gr,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),p.jsxs(QUe,{style:{marginTop:24},children:[p.jsx(Tl,{onClick:u,children:"Deny"}),p.jsx(Mt,{onClick:async()=>{try{await o(),i(!0)}catch(d){a(d)}},children:"Confirm"})]}),p.jsx(Ht,{})]})};let QUe=oe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-8ff214d7-0"})(["display:flex;gap:10px;"]);const fJ=()=>p.jsx(YUe,{children:p.jsxs(ZUe,{children:[p.jsx(XUe,{}),p.jsx(JUe,{})]})});let YUe=oe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-85b54ede-0"})(["display:flex;justify-content:center;align-items:center;flex-grow:1;margin:12px;padding:16px;@media all and (display-mode:standalone){margin-bottom:30px;}"]),ZUe=oe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),XUe=oe.div.withConfig({displayName:"CircleFixed",componentId:"sc-85b54ede-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;&&{border:4px solid var(--privy-color-accent-light);border-radius:50%;}"]),JUe=oe.div.withConfig({displayName:"CircleRotate",componentId:"sc-85b54ede-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-accent) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);
451const eBe=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];let On=class extends Error{constructor(e,r){super(r),this.type=e}};function B0(t){let e=t.type;return typeof e=="string"&&eBe.includes(e)}function xw(t){return B0(t)&&t.type==="wallet_not_on_device"}function tBe(t){return B0(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function VT(t){return!!B0(t)&&t.type==="mfa_timeout"}function HT(t){return!!B0(t)&&t.type==="missing_or_invalid_mfa"}function rBe(t){return!!B0(t)&&t.type==="mfa_verification_max_attempts_reached"}function hJ(t){return!(!B0(t)||!t.message.includes("code 429"))}function pJ(t){return!!(function(e){let r=e.type;return typeof r=="string"&&r==="client_error"})(t)&&t.message==="MFA canceled"}function w5(){return Pv(Q9(36))}function GT(){return w5()}async function KT(t,e="S256"){if(e!="S256")return t;{let r=await Q8e(t);return Pv(r)}}function nBe(){let t=Ut.get(o1);if(!t)throw new xe("Authentication error.");return t}function gJ({isCreatingWallet:t,skipSplashScreen:e}){return t?de.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:e?de.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:de.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function mJ({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?de.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||e.length===1?gJ({isCreatingWallet:t==="create",skipSplashScreen:n}):de.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function yJ(t){switch(t){case"user-passcode":return de.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return de.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function jL({api:t,provider:e}){let r=w5(),n=GT(),i=await KT(r);try{return e==="icloud"?{url:(await t.post(n8e,{client_type:"web"})).url}:{url:(await t.post(r8e,{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:e}}
451catch(s){throw $r(s)}}async function iBe({api:t,provider:e,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new xe("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new xe("User denied confirmation during OAuth flow");try{return(await t.post(i8e,{authorization_code:i,state_code:r,code_verifier:n,provider:e})).access_token}catch(s){let a=$r(s);throw a.privyErrorCode?new xe(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new xe("Invalid code during oauth flow.",void 0,Se.OAUTH_USER_DENIED):new xe("Invalid code during OAuth flow.",void 0,Se.UNKNOWN_AUTH_ERROR)}}const sBe=()=>{let{authenticated:t,user:e,getAccessToken:r}=Sr(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:s}=bt(),{navigate:a,data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:l}=ht(),u=C.useMemo((()=>Date.now()),[]),[d,f]=C.useState(!1),{onCompleteNavigateTo:h,onFailure:g,shouldForceMFA:m,entropyId:y,entropyIdVerifier:b}=o==null?void 0:o.connectWallet,E=w=>{d||(f(!0),g(typeof w=="string"?Error(w):w))};C.useEffect((()=>{let w,x=Qv(e,y);return t&&x?s?((async()=>{let _=await r();if(!_)return E("User must be authenticated and have a Privy wallet before it can be connected");try{await s.connect({accessToken:_,entropyId:y,entropyIdVerifier:b}),m&&await s.verifyMfa({accessToken:_});let S=(Date.now()-u)/1e3;h===de.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&S<1?w=setTimeout((()=>{a(h,!1)}),1e3*(1-S)):a(h,!1)}catch(S){if(xw(S)&&x.recoveryMethod==="privy"){let A=await r();if(!A)return E("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:x.address}});let I=await(s==null?void 0:s.recover({accessToken:A,entropyId:y,entropyIdVerifier:b}));I!=null&&I.entropyId||E(Error("Unable to recover wallet")),h?a(h):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:x.address}}),a(h)}catch{E("An error has occurred, please try again.")}}else xw(S)&&x.recoveryMethod!=="privy"?(c({...o,recoverWallet:{entropyId:y,entropyIdVerifier:b,onCompleteNavigateTo:h,onFailure:g},recoveryOAuthStatus:{provider:x.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),a(yJ(x.recoveryMethod))):E(S)}})(),()=>clearTimeout(w)):void 0:E("User must be authenticated and have a Privy wallet before it can be connected")}),[t,e,s]);let v=()=>{E("User exited before wallet could be connected"),n({shouldCallAuthOnSuccess:!1})};return l.current=v,p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:v}),d?p.jsxs(p.Fragment,{children:[p.jsxs(Vl,{children:[p.jsx(X3,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Something went wrong",description:"Weâre on it. Please try again later."})]}),p.jsx(Mt,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):p.jsx(fJ,{}),p.jsx(aBe,{})]})};let aBe=oe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-124dbb1c-0"})(["height:44px;"]);const oBe=()=>{let{user:t}=Sr(),{closePrivyModal:e,isNewUserThisSession:r,updateWallets:n}=bt(),{app:i,data:s,onUserCloseViaDialogOrKeybindRef:a}=ht(),{onSuccess:o,onFailure:c,callAuthOnSuccessOnClose:l}=s.createWallet,u=()=>{let d=Is(t);d?(n(),o(d)):c(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:l})};return C.useEffect((()=>{let d=setTimeout(u,IA);return()=>clearTimeout(d)}),[]),a.current=u,p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:u}),p.jsx(Lr,{}),p.jsxs(Vl,{children:[p.jsx(jf,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),p.jsx(wn,{title:r?"Welcome"+(i!=null&&i.name?` to ${i==null?void 0:i.name}`:""):"All set!",description:r?"Youâve successfully created an account.":"Your account is secured."})]}),p.jsx(qr,{}),p.jsx(Ht,{})]})},cBe=({children:t,theme:e})=>p.jsxs(lBe,{$theme:e,children:[p.jsx(zl,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let lBe=oe.div.withConfig({displayName:"Container",componentId:"sc-97f152b3-0"})(["display:flex;gap:0.5rem;background-color:",";"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);}"],(t=>t.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)"),(t=>t.$theme==="dark"?"color: #FDE68A;":""));const bd=oe.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),Pl=oe.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),uBe=()=>{let[t,e]=C.useState(null),{authenticated:r,user:n,getAccessToken:i}=Sr(),{closePrivyModal:s,createAnalyticsEvent:a,clientAnalyticsId:o}=bt(),c=Jn(),{data:l,onUserCloseViaDialogOrKeybindRef:u}=ht(),{onFailure:d,onSuccess:f,origin:h,appId:g,appClientId:m,walletToExport:y,primaryWallet:b}=l.keyExport,E=w=>{s({shouldCallAuthOnSuccess:!1}),d(typeof w=="string"?Error(w):w)},v=()=>{s({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:y.address}})};return C.useEffect((()=>
451{if(!r||!y)return E("User must be authenticated before exporting their wallet");i().then(e,E)}),[r,n]),u.current=v,p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:v}),p.jsxs(fBe,{children:[p.jsx(Pl,{children:"Transfer wallet"}),p.jsxs(bd,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",p.jsx("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),p.jsx(cBe,{theme:c.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),p.jsx(v5,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:y.address,showIcon:!0}),p.jsx("div",{style:{width:"100%"},children:t&&p.jsx(dBe,{origin:h,appId:g,appClientId:m,accessToken:t,clientAnalyticsId:o,walletToExport:y,primaryWallet:b,dimensions:{height:"44px"}})})]}),p.jsx(Ht,{})]})};function dBe(t){let[e,r]=C.useState(t.dimensions.width),[n,i]=C.useState(void 0),s=C.useRef(null);C.useEffect((()=>{if(s.current&&e===void 0){let{width:c}=s.current.getBoundingClientRect();r(c)}let o=getComputedStyle(document.documentElement);i({background:o.getPropertyValue("--privy-color-background"),background2:o.getPropertyValue("--privy-color-background-2"),foreground3:o.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:o.getPropertyValue("--privy-color-foreground-accent"),accent:o.getPropertyValue("--privy-color-accent"),accentDark:o.getPropertyValue("--privy-color-accent-dark"),success:o.getPropertyValue("--privy-color-success")})}),[]);let a=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return p.jsx("div",{ref:s,children:e&&p.jsxs(hBe,{children:[p.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:nK(t.origin,`/apps/${t.appId}/embedded-wallets/export`,{client_id:t.appClientId,primaryAddress:t.primaryWallet.address,address:t.walletToExport.address,walletIndex:t.walletToExport.walletIndex,width:`${e}px`,caid:t.clientAnalyticsId,phrase_export:a,...n},{token:t.accessToken})}),p.jsx(LL,{children:"Loading..."}),a&&p.jsx(LL,{children:"Loading..."})]})})}let fBe=oe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-eaab13a9-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),hBe=oe.div.withConfig({displayName:"ButtonContainer",componentId:"sc-eaab13a9-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),LL=oe.div.withConfig({displayName:"LoadingButton",componentId:"sc-eaab13a9-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function bJ(){let{getAccessToken:t}=Sr(),{refreshUser:e,createAnalyticsEvent:r,initializeWalletProxy:n}=bt(),i=C.useRef(!1);return{createWallet:C.useCallback((async({user:s,recoveryPassword:a})=>{let o=await t();if(!o)throw r({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{r({eventName:"embedded_wallet_creation_started"});let c=await n(kA);if(!c)throw Error("walletProxy does not exist.");let l=new Promise(((h,g)=>{setTimeout((()=>{g(Error("walletProxy.create timed out."))}),2e4)})),u=Jo(s);if(!await Promise.race([c.create({accessToken:o,recoveryPassword:a,recoveryMethod:a?"user-passcode":void 0,solanaAddress:u==null?void 0:u.address}),l]))throw Error("walletProxy.create did not send a response.");let d=await e();if(!d)throw Error("Failed to refresh user.");let f=Is(d);if(!f)throw Error("Updated user is missing embedded wallet.");return r({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:f.address}}),i.current=!0,f}catch(c){if(i.current)return;throw r({eventName:"embedded_wallet_creation_failed",payload:{error:c.toString()}}),console.warn(c),c}}),[])}}const pBe=()=>{let{app:t,setModalData:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=ht(),[s,a]=C.useState(""),{embeddedWallets:o}=Jn(),{authenticated:c,user:l}=Sr(),{closePrivyModal:u}=bt(),{onSuccess:d,onFailure:f,callAuthOnSuccessOnClose:h}=n.createWallet,g=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:m}=bJ(),[y,b]=C.useState(null),E=new es((async()=>{try{let v=await m({user:l});if(!v)return;b(v),r(de.EMBEDDED_WALLET_CREATED_SCREEN)}catch(v){a(v.message)}}));return C.useEffect((()=>c&&l?g?(e({...n,recoverySelection:{...n==null?void 0:n.recoverySelection,isInAccountCreateFlow:!0}}
451),r(mJ({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:o.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void E.execute():(r(de.LANDING),void f(Error("User must be authenticated before creating a Privy wallet")))),[g,c]),i.current=()=>null,s?p.jsxs(p.Fragment,{children:[p.jsx(lt,{closeable:!1}),p.jsxs(Vl,{children:[p.jsx(X3,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Something went wrong",description:s})]}),p.jsx(Mt,{onClick:()=>{y?(d(y),u({shouldCallAuthOnSuccess:h})):(f(new ju("User wallet creation failed")),u({shouldCallAuthOnSuccess:!1}))},children:"Close"}),p.jsx(gBe,{})]}):p.jsx(fJ,{})};let gBe=oe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-eabafbf4-0"})(["height:44px;"]);var ax,FL;function mBe(){if(FL)return ax;FL=1;var t=function(a,o){return Math.round(o*Math.log(a)/Math.LN2)},e=[{name:"lowercase",re:/[a-z]/,length:26},{name:"uppercase",re:/[A-Z]/,length:26},{name:"numbers",re:/[0-9]/,length:10},{name:"symbols",re:/[^a-zA-Z0-9]/,length:33}],r=function(a){return function(o){return a.reduce(function(c,l){return c+(l.re.test(o)?l.length:0)},0)}},n=r(e),i=function(a){return a?t(n(a),a.length):0};return ax=i,ax}var yBe=mBe();const bBe=Rl(yBe);function vJ(t){return crypto.getRandomValues(new Uint8Array(t))}const vBe=256,D1=65536;function wBe(){const[t]=vJ(1);return t}function EBe(){const[t,e]=vJ(2);return(t<<8)+e}function xBe(t){if(typeof t!="number"||t<2||t>D1)throw new Error(`Invalid number: number must be at least two and at most ${D1}`);const e=t>256,r=e?D1:vBe,n=e?EBe:wBe,i=t*Math.floor(r/t);for(;;){const s=n();if(s<i)return s%t}}function _Be(t,e,r){if(typeof r!="number"||r>D1)throw new Error(`Invalid argument: end must be a number less than or equal to ${D1}`);if(r-e<2)throw new Error("Invalid range: range must contain at least two values");const n=[];for(let i=0;i<t;i++)n[i]=e+xBe(r-e);return n}function CBe(t,e,r="-"){if(!Array.isArray(e)||e.length<2)throw new Error("Invalid argument: wordlist argument must be an array with length greater than or equal to 2");if(typeof r!="string")throw new Error("Invalid argument: sep argument must be a string");return _Be(t,0,e.length).reduce((n,i,s)=>{const a=e[i];return n+(s===0?a:r+a)},"")}const SBe=Object.freeze(["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","am
451igo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","co
451astline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dis
451h","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","eup
451hemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","gi
451ddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungr
451ily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","
451junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasse
451s","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastram
451i","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","re
451cycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","
451sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","
451shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","
451sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","t
451ingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unus
451able","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]),ABe=Object.freeze(SBe.filter(t=>!t.includes("-")));let TBe=/[a-z]/,IBe=/[A-Z]/,kBe=/[0-9]/,wJ="!@#$%^&*()\\-_+.",EJ=`a-zA-Z0-9${wJ}`,$Be=RegExp(`[${wJ}]`),NBe=RegExp(`[${EJ}]`);const PBe=RegExp(`^[${EJ}]{6,}$`),OBe=(t="")=>[...new Set(t.split("").filter((e=>!NBe.test(e))).map((e=>e.replace(" ","SPACE"))))],xJ=()=>CBe(4,ABe);function RBe(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function DBe(t){if(t.length<8)return 0;let e=0;return TBe.test(t)&&(e+=1),IBe.test(t)&&(e+=1),kBe.test(t)&&(e+=1),$Be.test(t)&&(e+=1),Math.max(0,Math.min(1,e/3))}function MBe(t=""){return(.3*DBe(t)+bBe(t)/95)/2}function jBe(t=""){let e=MBe(t);return{value:e,label:RBe(e)}}function LBe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const FBe=C.forwardRef(LBe);function UBe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const BBe=C.forwardRef(UBe);function qBe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const WBe=C.forwardRef(qBe);let zBe=ns(["font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;text-align:left;transition:color 0.1s ease-in;"]);const _J=oe.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],zBe,(({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),(({error:t})=>t?"":"capitalize")),E5=oe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),x5=oe(Mt).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],(t=>t.hideAnimations&&ns(["&&{transition:none;}"])));let CJ=ns(["&&{width:100%;border-width:1px;border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);background:var(--privy-color-background);color:var(--privy-color-foreground);padding:12px;font-size:16px;font-style:normal;font-weight:300;line-height:22px;}"]);const QT=oe.input.withConfig({displayName:"PasswordInput",componentId:"sc-3f6866a9-3"})([""," &::placeholder{color:var(--privy-color-foreground-3);font-style:italic;font-size:14px;}overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],CJ),VBe=oe.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],CJ),_5=oe.div.withConfig({displayName:"PasswordContainer",componentId:"sc-3f6866a9-5"})(["position:relative;width:100%;display:flex;align-items:center;justify-content:",";"],(({centered:t})=>t?"center":"space-between")),C5=oe.div.withConfig({displayName:"Header",componentId:"sc-3f6866a9-6"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:32px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),YT=oe.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),Q7=oe.div.withConfig({displayName:"DetailItem",componentId:"sc-3f6866a9-8"})(["display:flex;text-align:left;align-items:center;gap:8px;max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;margin:0 8px;color:var(--privy-color-foreground-2);> :first-child{min-width:24px;}"]),UL=oe(H3).withConfig({displayName:"ExportButton",componentId:"sc-3f6866a9-10"})(["display:flex;flex:1;gap:4px;justify-content:center;&&{background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);border-width:1px;}"]),ZT=oe.div.withConfig({displayName:"InputRightIcons",componentId:"sc-3f6866a9-11"})(["position:absolute;right:0.5rem;display:flex;flex-direction:row;justify-content:space-around;align-items:center;"]),HBe=oe(FBe).withConfig({displayName:"RegenerateIcon",componentId:"sc-3f6866a9-12"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),XT=oe(WBe).withConfig({displayName:"HiddenIcon",componentId:"sc-3f6866a9-13"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),JT=oe(BBe).withConfig({displayName:"ShownIcon",componentId:"sc-3f6866a9-14"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),GBe=oe.progress.withConfig({displayName:"StrengthMeter",componentId:"sc-3f6866a9-15"}
451)(["height:4px;width:100%;margin:8px 0;::-webkit-progress-bar{border-radius:8px;background:var(--privy-color-foreground-4);}::-webkit-progress-value{border-radius:8px;transition:all 0.1s ease-out;background:",";}"],(({label:t})=>(t==="Strong"?"#78dca6":t==="Medium"&&"var(--privy-color-warn)")||"var(--privy-color-error)")),KBe=({buttonHideAnimations:t,buttonLoading:e,password:r,onSubmit:n,onBack:i})=>{let[s,a]=C.useState(!0),[o,c]=C.useState(!1),[l,u]=C.useState(""),d=r===l;return C.useEffect((()=>{l&&!o&&c(!0)}),[l]),p.jsxs(p.Fragment,{children:[p.jsx(lt,{closeable:!1,backFn:i}),p.jsx(Lr,{}),p.jsxs(E5,{children:[p.jsxs(C5,{children:[p.jsx(zl,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),p.jsxs(_5,{children:[p.jsx(QT,{value:l,onChange:f=>u(f.target.value),onKeyUp:f=>{f.key==="Enter"&&n()},onBlur:()=>c(!0),placeholder:"confirm your password",type:s?"password":"text",style:{paddingRight:"2.3rem"}}),p.jsx(ZT,{style:{right:"0.75rem"},children:s?p.jsx(XT,{onClick:()=>a(!1)}):p.jsx(JT,{onClick:()=>a(!0)})})]}),p.jsx(_J,{"aria-hidden":!o||d,error:!0,children:"Passwords do not match"})]}),p.jsx(x5,{onClick:n,loading:e,disabled:!d,hideAnimations:t,children:"Continue"}),p.jsx(qr,{}),p.jsx(Ht,{})]})},QBe=({className:t,checked:e,color:r="var(--privy-color-accent)",...n})=>p.jsx("label",{children:p.jsxs(YBe,{className:t,children:[p.jsx(AJ,{checked:e,...n}),p.jsx(ZBe,{color:r,checked:e,children:p.jsx(SJ,{viewBox:"0 0 24 24",children:p.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let YBe=oe.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),SJ=oe.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),AJ=oe.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),ZBe=oe.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],(t=>t.color),(t=>t.checked?t.color:"var(--privy-color-background)"),AJ,(t=>t.color),SJ,(t=>t.checked?"visible":"hidden"));const XBe=({buttonHideAnimations:t,buttonLoading:e,onSubmit:r,onBack:n,config:i})=>{let[s,a]=C.useState(!1);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{closeable:!1,backFn:n}),p.jsx(Lr,{}),p.jsxs(E5,{children:[p.jsxs(C5,{children:[p.jsx(zl,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),p.jsx(YT,{children:p.jsxs(Q7,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:o=>{o.preventDefault(),a((c=>!c))},children:[p.jsx(QBe,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),p.jsx(p.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),p.jsxs(JBe,{children:[i.initiatedBy==="user"&&p.jsx(Tl,{onClick:i.onCancel,disabled:e,children:"Cancel"}),p.jsx(x5,{onClick:r,loading:e,hideAnimations:t,disabled:!s,children:"Set Password"})]}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let JBe=oe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]);function eqe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const tqe=C.forwardRef(eqe),rqe=({buttonHideAnimations:t,buttonLoading:e,password:r="",config:n,isResettingPassword:i,onSubmit:s,onClose:a,onBack:o,onPasswordChange:c,onPasswordGenerate:l})=>{let[u,d]=C.useState(!1),[f,h]=C.useState(!1);C.useEffect((()=>{r&&!f&&h(!0)}),[r]);let g=C.useMemo((()=>f?6>((r==null?void 0:r.length)||0)?"Password must be at least 6 characters":PBe.test(r||"")?null:`Invalid characters used ( ${OBe(r).join(" ")} )`:null),[r,f]),m=C.useMemo((()=>g?{value:0,label:"Weak"}:jBe(r)),[r,g]),y=C.useMemo((()=>!(r!=null&&r.length)||!!g),[g,r]);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:a,closeable:n.initiatedBy==="user",backFn:o}),p.jsx(Lr,{}),p.jsxs(E5,{children:[p.jsxs(C5,{children:[p.jsx(tqe,{height:48,width:48,stroke:"var(--privy-color-accent)"}),p.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[i?"Reset":"Set"," your password"]}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),p.jsxs(_5,{children:[p.jsx(QT,{value:r,onChange:b=>c(b.target.value),onKeyUp:b=>{b.key==="Enter"&&s()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),p.jsxs(ZT,{style:{width:"3.5rem"},children:[u?p.jsx(XT,{onClick:()=>d(!1)}):p.jsx(JT,{onClick:()=>d(!0)}),p.jsx(HBe,{onClick:l})]})]}),p.jsx(GBe,{value:m.value===0?.01:m.value,label:m.label}),p.jsx(_J,{error:!!g,children:g||`Password Strength: ${f?m.label:"--"}`}),p.jsxs(iqe,{children:[p.jsx(nqe,{children:p.jsxs(YT,{children:[p.jsxs(Q7,{children:[p.jsx(jf,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),p.jsxs(Q7,{children:[p.jsx(jf,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),p.jsx(x5,{onClick:s,loading:e,disabled:y,hideAnimations:t,children:"Continue"})]})]}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let nqe=oe(YT).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),iqe=oe.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);function sqe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const aqe=C.forwardRef(sqe);function oqe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))}const TJ=C.forwardRef(oqe);function cqe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.7
4515"}))}const lqe=C.forwardRef(cqe),uqe=({buttonHideAnimations:t,buttonLoading:e,appName:r,password:n,onSubmit:i,onBack:s})=>{let[a,o]=C.useState(!1),c=C.useCallback((()=>{o(!0),n&&navigator.clipboard.writeText(n)}),[n]),l=C.useCallback((()=>{let u=document.createElement("a"),d=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([dqe(r,n)],{type:"text/plain"}),h=URL.createObjectURL(f);u.href=h,u.target="_blank",u.download=`${d}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout((()=>{u.remove(),URL.revokeObjectURL(h)}),5e3)}),[n]);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:s,closeable:!1}),p.jsx(Lr,{}),p.jsxs(E5,{children:[p.jsxs(C5,{children:[p.jsx(zl,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),p.jsx(_5,{centered:!0,children:p.jsx(VBe,{children:n})}),p.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[p.jsx(UL,{onClick:c,children:p.jsxs(p.Fragment,a?{children:[p.jsx(TJ,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[p.jsx(lqe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),p.jsxs(UL,{onClick:l,children:[p.jsx(aqe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),p.jsx(x5,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let dqe=(t,e)=>`Your wallet recovery password for ${t} is 452 453${e} 454 455You will need this password to access your ${t} wallet on a new device. Please keep it somewhere safe.`;const fqe=({error:t,onClose:e})=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{closeable:!1}),p.jsx(Lr,{}),p.jsxs(Vl,t?{children:[p.jsx(X3,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Something went wrong",description:t})]}:{children:[p.jsx(jf,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Success"})]}),p.jsx(Mt,{onClick:e,children:"Close"}),p.jsx(qr,{}),p.jsx(Ht,{})]});let hqe=(t,e)=>{switch(t){case"creating":return e==="back"?t:"saving";case"saving":return e==="back"?"creating":"confirming";case"confirming":return e==="back"?"saving":"finalizing";case"finalizing":return e==="back"?"confirming":"done";default:return t}};const pqe=()=>{let[t,e]=C.useReducer(hqe,"creating");return{send:e,state:t}},IJ=({onSubmit:t,...e})=>{let{lastScreen:r,navigate:n}=ht(),{send:i,state:s}=pqe(),a=C.useCallback((async()=>{s==="finalizing"&&await t(),i("next")}),[s,i,t]);C.useEffect((()=>{let l;return s==="done"&&e.config.initiatedBy==="automatic"&&(l=setTimeout((()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)}),fn)),()=>{l&&clearTimeout(l)}}),[s,e.config.initiatedBy,e.onClose]);let o=C.useCallback((()=>{i("back")}),[i]),c=C.useCallback((()=>{n(de.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)}),[r,n]);return s==="creating"?p.jsx(rqe,{...e,onSubmit:a,onBack:r===de.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?c:void 0}):s==="saving"?p.jsx(uqe,{...e,onSubmit:a,onBack:o}):s==="confirming"?p.jsx(KBe,{...e,onSubmit:a,onBack:o}):s==="finalizing"?p.jsx(XBe,{...e,onSubmit:a,onBack:o}):s==="done"?p.jsx(fqe,{...e,onSubmit:a}):null},gqe=()=>{let[t,e]=C.useState(null),[r,n]=C.useState(!1),[i,s]=C.useState(null),[a,o]=C.useState(""),{authenticated:c,getAccessToken:l,user:u}=Sr(),{walletProxy:d,refreshUser:f,closePrivyModal:h,createAnalyticsEvent:g}=bt(),{app:m,navigate:y,data:b,onUserCloseViaDialogOrKeybindRef:E}=ht(),{onSuccess:v,onFailure:w}=b.createWallet,x=Ts(u),_=(t==null?void 0:t.recoveryMethod)==="user-passcode",S=(x==null?void 0:x.recoveryMethod)==="user-passcode";C.useEffect((()=>{c||(y(de.LANDING),w(new C4e("User must be authenticated before setting a password on a Privy wallet")))}),[c]);let A=()=>i?(w(i),void h({shouldCallAuthOnSuccess:!1})):_?(v(t),void h({shouldCallAuthOnSuccess:!1})):(w(new ju("Exited before password was added to wallet")),void h({shouldCallAuthOnSuccess:!1}));return E.current=A,p.jsx(IJ,{appName:(m==null?void 0:m.name)||"privy",config:{initiatedBy:"user",onCancel:A},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:S,onPasswordGenerate:()=>o(xJ()),onPasswordChange:o,onSubmit:async()=>{_?(v(t),h({shouldCallAuthOnSuccess:!1})):(n(!0),s(null),await(async()=>{let I=await l();if(I&&(x!=null&&x.address)&&a&&d)try{g({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S}});let{entropyId:$,entropyIdVerifier:P}=_n(x);if(!(await d.setRecovery({accessToken:I,entropyId:$,entropyIdVerifier:P,recoveryPassword:a,recoveryMethod:"user-passcode"})).entropyId)return s(new ju("Error setting password on privy wallet")),void g({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S,reason:"error setting password"}});let j=await f(),L=Ts(j);if(!L)return s(new ju("Error setting password on privy wallet")),void g({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S,reason:"wallet disconnected"}});e(L),g({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:x.address,existingRecoveryMethod:x.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:S}})}catch($){console.warn($),s($ instanceof Error?$:Error("Error setting password on privy wallet")),g({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:x.address,reason:$}})}})(),n(!1))},onClose:A})};function mqe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const eI=C.forwardRef(mqe);function yqe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"
455currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))}const kJ=C.forwardRef(yqe),bqe=()=>{let{closePrivyModal:t}=bt(),{data:e,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=ht(),{onSuccess:s,onFailure:a}=e.setWalletPassword,o=()=>{a(new ju("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=o,p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:o}),p.jsx(Lr,{}),p.jsxs(Vl,{children:[p.jsxs(w7e,{children:[p.jsx(eI,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),p.jsx(E7e,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:p.jsx(kJ,{width:"12px",height:"12px",fill:"white"})})]}),p.jsxs(wn,{title:"Secure Your Account",children:["Please set a password to secure your account.",p.jsx("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),p.jsx(Mt,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n(de.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let vqe=(t,e)=>{let r=p.jsx(zl,{height:38,width:38,stroke:"var(--privy-color-error)"});if(t instanceof xe)switch(t.privyErrorCode){case Se.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:t.message,ctaText:"Try again",icon:r};case Se.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:t.message,ctaText:"Try again",icon:r};case Se.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:t.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(t instanceof On&&t.type==="twilio_verification_failed")return{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:p.jsx(Io,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(t instanceof Fs))return t instanceof $a&&t.status&&[400,422].includes(t.status)?{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r};switch(t.privyErrorCode){case Se.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case Se.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:t.message,ctaText:"Try another method",icon:r};case Se.ALLOWLIST_REJECTED:return{title:e.errorTitle||"You don't have access to this app",detail:e.errorDetail||"Have you been invited?",ctaText:e.errorCtaText||"Try another account",icon:p.jsx(ZQ,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Se.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:p.jsx("span",{})};case Se.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:p.jsx("span",{})};case Se.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case Se.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case Se.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}}};const wqe=()=>{var a,o;let{navigate:t,navigateBack:e,data:r,lastScreen:n,currentScreen:i}=ht(),s=((a=r==null?void 0:r.errorModalData)==null?void 0:a.previousScreen)||(n===i?void 0:n);
455return p.jsx(e2,{error:((o=r==null?void 0:r.errorModalData)==null?void 0:o.error)||Error(),backFn:()=>s?t(s,!1):e(),onClick:()=>t(s||de.LANDING,!1)})},e2=({error:t,backFn:e,onClick:r})=>{let{reset:n}=Vs(),{app:i}=ht(),s=vqe(t,i.allowlistConfig);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:e}),p.jsxs(Eqe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(tT,{color:"var(--privy-color-error)"}),s.icon]})}),p.jsxs(xqe,{children:[p.jsx("h3",{children:s.title}),p.jsx("p",{children:s.detail})]}),p.jsx(Mt,{color:"var(--privy-color-error)",onClick:()=>{t instanceof Fs&&(t.privyErrorCode===Se.INVALID_CAPTCHA&&n(),t.privyErrorCode===Se.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:r==null||r()},children:s.ctaText})]})]})};let Eqe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1d84a574-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),xqe=oe.div.withConfig({displayName:"GappedContainer",componentId:"sc-1d84a574-1"})(["display:flex;flex-direction:column;gap:8px;"]);const $J=({style:t,color:e,...r})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:e||"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...r,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),_qe=({color:t,...e})=>p.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:p.jsx("g",{children:p.jsx("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),S5=t=>{let[e,r]=C.useState(!1);return p.jsxs(Cqe,{color:t.color,onClick:()=>{r(!0),navigator.clipboard.writeText(t.text),setTimeout((()=>r(!1)),1500)},justCopied:e,children:[e?p.jsx($J,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):p.jsx(_qe,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let Cqe=oe.button.withConfig({displayName:"StyledCopytoClipboardButton",componentId:"sc-9c2ee64b-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],(t=>t.justCopied?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)"),(t=>t.justCopied?"medium":"normal"),(t=>t.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"));const NJ=t=>{let[e,r]=C.useState(!1);return p.jsx(Sqe,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout((()=>r(!1)),1500)},justOpened:e,children:t.text})};let Sqe=oe.a.withConfig({displayName:"StyledOpenLinkButton",componentId:"sc-4e695c83-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;
455height:14px;}"],(t=>t.justOpened?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)"),(t=>t.justOpened?"medium":"normal"),(t=>t.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"));var Ph={},ox,BL;function Aqe(){return BL||(BL=1,ox=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),ox}var cx={},au={},qL;function fh(){if(qL)return au;qL=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return au.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},au.getSymbolTotalCodewords=function(n){return e[n]},au.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},au.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');t=n},au.isKanjiModeEnabled=function(){return typeof t<"u"},au.toSJIS=function(n){return t(n)},au}var lx={},WL;function tI(){return WL||(WL=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(lx)),lx}var ux,zL;function Tqe(){if(zL)return ux;zL=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const r=Math.floor(e/8);return(this.buffer[r]>>>7-e%8&1)===1},put:function(e,r){for(let n=0;n<r;n++)this.putBit((e>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),e&&(this.buffer[r]|=128>>>this.length%8),this.length++}},ux=t,ux}var dx,VL;function Iqe(){if(VL)return dx;VL=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,r,n,i){const s=e*this.size+r;this.data[s]=n,i&&(this.reservedBit[s]=!0)},t.prototype.get=function(e,r){return this.data[e*this.size+r]},t.prototype.xor=function(e,r,n){this.data[e*this.size+r]^=n},t.prototype.isReserved=function(e,r){return this.reservedBit[e*this.size+r]},dx=t,dx}var fx={},HL;function kqe(){return HL||(HL=1,(function(t){const e=fh().getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,s=e(n),a=s===145?26:Math.ceil((s-13)/(2*i-2))*2,o=[s-7];for(let c=1;c<i-1;c++)o[c]=o[c-1]-a;return o.push(6),o.reverse()},t.getPositions=function(n){const i=[],s=t.getRowColCoords(n),a=s.length;for(let o=0;o<a;o++)for(let c=0;c<a;
vendor: 15,587 bytes, lines 455-458
455c++)o===0&&c===0||o===0&&c===a-1||o===a-1&&c===0||i.push([s[o],s[c]]);return i}})(fx)),fx}var hx={},GL;function $qe(){if(GL)return hx;GL=1;const t=fh().getSymbolSize,e=7;return hx.getPositions=function(n){const i=t(n);return[[0,0],[i-e,0],[0,i-e]]},hx}var px={},KL;function Nqe(){return KL||(KL=1,(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const s=i.size;let a=0,o=0,c=0,l=null,u=null;for(let d=0;d<s;d++){o=c=0,l=u=null;for(let f=0;f<s;f++){let h=i.get(d,f);h===l?o++:(o>=5&&(a+=e.N1+(o-5)),l=h,o=1),h=i.get(f,d),h===u?c++:(c>=5&&(a+=e.N1+(c-5)),u=h,c=1)}o>=5&&(a+=e.N1+(o-5)),c>=5&&(a+=e.N1+(c-5))}return a},t.getPenaltyN2=function(i){const s=i.size;let a=0;for(let o=0;o<s-1;o++)for(let c=0;c<s-1;c++){const l=i.get(o,c)+i.get(o,c+1)+i.get(o+1,c)+i.get(o+1,c+1);(l===4||l===0)&&a++}return a*e.N2},t.getPenaltyN3=function(i){const s=i.size;let a=0,o=0,c=0;for(let l=0;l<s;l++){o=c=0;for(let u=0;u<s;u++)o=o<<1&2047|i.get(l,u),u>=10&&(o===1488||o===93)&&a++,c=c<<1&2047|i.get(u,l),u>=10&&(c===1488||c===93)&&a++}return a*e.N3},t.getPenaltyN4=function(i){let s=0;const a=i.data.length;for(let c=0;c<a;c++)s+=i.data[c];return Math.abs(Math.ceil(s*100/a/5)-10)*e.N4};function r(n,i,s){switch(n){case t.Patterns.PATTERN000:return(i+s)%2===0;case t.Patterns.PATTERN001:return i%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(i+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return i*s%2+i*s%3===0;case t.Patterns.PATTERN110:return(i*s%2+i*s%3)%2===0;case t.Patterns.PATTERN111:return(i*s%3+(i+s)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(i,s){const a=s.size;for(let o=0;o<a;o++)for(let c=0;c<a;c++)s.isReserved(c,o)||s.xor(c,o,r(i,c,o))},t.getBestMask=function(i,s){const a=Object.keys(t.Patterns).length;let o=0,c=1/0;for(let l=0;l<a;l++){s(l),t.applyMask(l,i);const u=t.getPenaltyN1(i)+t.getPenaltyN2(i)+t.getPenaltyN3(i)+t.getPenaltyN4(i);t.applyMask(l,i),u<c&&(c=u,o=l)}return o}})(px)),px}var hb={},QL;function PJ(){if(QL)return hb;QL=1;const t=tI(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return hb.getBlocksCount=function(i,s){switch(s){case t.L:return e[(i-1)*4+0];case t.M:return e[(i-1)*4+1];case t.Q:return e[(i-1)*4+2];case t.H:return e[(i-1)*4+3];default:return}},hb.getTotalCodewordsCount=function(i,s){switch(s){case t.L:return r[(i-1)*4+0];case t.M:return r[(i-1)*4+1];case t.Q:return r[(i-1)*4+2];case t.H:return r[(i-1)*4+3];default:return}},hb}var gx={},Qg={},YL;function Pqe(){if(YL)return Qg;YL=1;const t=new Uint8Array(512),e=new Uint8Array(256);return(function(){let n=1;for(let i=0;i<255;i++)t[i]=n,e[n]=i,n<<=1,n&256&&(n^=285);for(let i=255;i<512;i++)t[i]=t[i-255]})(),Qg.log=function(n){if(n<1)throw new Error("log("+n+")");return e[n]},Qg.exp=function(n){return t[n]},Qg.mul=function(n,i){return n===0||i===0?0:t[e[n]+e[i]]},Qg}var ZL;function Oqe(){return ZL||(ZL=1,(function(t){const e=Pqe();t.mul=function(n,i){const s=new Uint8Array(n.length+i.length-1);for(let a=0;a<n.length;a++)for(let o=0;o<i.length;o++)s[a+o]^=e.mul(n[a],i[o]);return s},t.mod=function(n,i){let s=new Uint8Array(n);for(;s.length-i.length>=0;){const a=s[0];for(let c=0;c<i.length;c++)s[c]^=e.mul(i[c],a);let o=0;for(;o<s.length&&s[o]===0;)o++;s=s.slice(o)}return s},t.generateECPolynomial=function(n){let i=new Uint8Array([1]);for(let s=0;s<n;s++)i=t.mul(i,new Uint8Array([1,e.exp(s)]));return i}})(gx)),gx}var mx,XL;function Rqe(){if(XL)return mx;XL=1;const t=Oqe();function e(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(n.length+this.degree);i.set(n);const s=t.mod(i,this.genPoly),a=this.degree-s.length;if(a>0){const o=new Uint8Array(this.degree);return o.set(s,a),o}return s},mx=e,mx}var yx={},bx={},vx={},JL;function OJ(){return JL||(JL=1,vx.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),vx}var Wo={},eF;function RJ(){if(eF)return Wo;eF=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r 456]))+`;Wo.KANJI=new RegExp(r,"g"),Wo.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Wo.BYTE=new RegExp(n,"g"),Wo.NUMERIC=new RegExp(t,"g"),Wo.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+r+"$"),s=new RegExp("^"+t+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Wo.testKanji=function(c){return i.test(c)},Wo.testNumeric=function(c){return s.test(c)},Wo.testAlphanumeric=function(c){return a.test(c)},Wo}var tF;function hh(){return tF||(tF=1,(function(t){const e=OJ(),r=RJ();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(s,a){if(t.isValid(s))return s;try{return n(s)}catch{return a}}})(bx)),bx}var rF;function Dqe(){return rF||(rF=1,(function(t){const e=fh(),r=PJ(),n=tI(),i=hh(),s=OJ(),a=7973,o=e.getBCHDigit(a);function c(f,h,g){for(let m=1;m<=40;m++)if(h<=t.getCapacity(m,g,f))return m}function l(f,h){return i.getCharCountIndicator(f,h)+4}function u(f,h){let g=0;return f.forEach(function(m){const y=l(m.mode,h);g+=y+m.getBitsLength()}),g}function d(f,h){for(let g=1;g<=40;g++)if(u(f,g)<=t.getCapacity(g,h,i.MIXED))return g}t.from=function(h,g){return s.isValid(h)?parseInt(h,10):g},t.getCapacity=function(h,g,m){if(!s.isValid(h))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=i.BYTE);const y=e.getSymbolTotalCodewords(h),b=r.getTotalCodewordsCount(h,g),E=(y-b)*8;if(m===i.MIXED)return E;const v=E-l(m,h);switch(m){case i.NUMERIC:return Math.floor(v/10*3);case i.ALPHANUMERIC:return Math.floor(v/11*2);case i.KANJI:return Math.floor(v/13);case i.BYTE:default:return Math.floor(v/8)}},t.getBestVersionForData=function(h,g){let m;const y=n.from(g,n.M);if(Array.isArray(h)){if(h.length>1)return d(h,y);if(h.length===0)return 1;m=h[0]}else m=h;return c(m.mode,m.getLength(),y)},t.getEncodedBits=function(h){if(!s.isValid(h)||h<7)throw new Error("Invalid QR Code version");let g=h<<12;for(;e.getBCHDigit(g)-o>=0;)g^=a<<e.getBCHDigit(g)-o;return h<<12|g}})(yx)),yx}var wx={},nF;function Mqe(){if(nF)return wx;nF=1;const t=fh(),e=1335,r=21522,n=t.getBCHDigit(e);return wx.getEncodedBits=function(s,a){const o=s.bit<<3|a;let c=o<<10;for(;t.getBCHDigit(c)-n>=0;)c^=e<<t.getBCHDigit(c)-n;return(o<<10|c)^r},wx}var Ex={},xx,iF;function jqe(){if(iF)return xx;iF=1;const t=hh();function e(r){this.mode=t.NUMERIC,this.data=r.toString()}return e.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){let i,s,a;for(i=0;i+3<=this.data.length;i+=3)s=this.data.substr(i,3),a=parseInt(s,10),n.put(a,10);const o=this.data.length-i;o>0&&(s=this.data.substr(i),a=parseInt(s,10),n.put(a,o*3+1))},xx=e,xx}var _x,sF;function Lqe(){if(sF)return _x;sF=1;const t=hh(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){let s;for(s=0;s+2<=this.data.length;s+=2){let a=e.indexOf(this.data[s])*45;a+=e.indexOf(this.data[s+1]),i.put(a,11)}this.data.length%2&&i.put(e.indexOf(this.data[s]),6)},_x=r,_x}var Cx,aF;function Fqe(){if(aF)return Cx;aF=1;const t=hh();function e(r){this.mode=t.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return e.getBitsLength=function(n){return n*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(r){for(let n=0,i=this.data.length;n<i;n++)r.put(this.data[n],8)},Cx=e,Cx}var Sx,oF;function Uqe(){if(oF)return Sx;oF=1;const t=hh(),e=fh();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(i){return i*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let i;for(i=0;i<this.data.length;i++){let s=e.toSJIS(this.data[i]);if(s>=33088&&s<=40956)s-=33088;else if(s>=57408&&s<=60351)s-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+` 457Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),n.put(s,13)}},Sx=r,Sx}var Ax={exports:{}},cF;function Bqe(){return cF||(cF=1,(function(t){var e={single_source_shortest_paths:function(r,n,i){var s={},a={};a[n]=0;var o=e.PriorityQueue.make();o.push(n,0);for(var c,l,u,d,f,h,g,m,y;!o.empty();){c=o.pop(),l=c.value,d=c.cost,f=r[l]||{};for(u in f)f.hasOwnProperty(u)&&(h=f[u],g=d+h,m=a[u],y=typeof a[u]>"u",(y||m>g)&&(a[u]=g,o.push(u,g),s[u]=l))}if(typeof i<"u"&&typeof a[i]>"u"){var b=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(b)}return s},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],s=n;s;)i.push(s),r[s],s=r[s];return i.reverse(),i},find_path:function(r,n,i){var s=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(s,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},s;r=r||{};for(s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Ax)),Ax.exports}var lF;function qqe(){return lF||(lF=1,(function(t){const e=hh(),r=jqe(),n=Lqe(),i=Fqe(),s=Uqe(),a=RJ(),o=fh(),c=Bqe();function l(b){return unescape(encodeURIComponent(b)).length}function u(b,E,v){const w=[];let x;for(;(x=b.exec(v))!==null;)w.push({data:x[0],index:x.index,mode:E,length:x[0].length});return w}function d(b){const E=u(a.NUMERIC,e.NUMERIC,b),v=u(a.ALPHANUMERIC,e.ALPHANUMERIC,b);let w,x;return o.isKanjiModeEnabled()?(w=u(a.BYTE,e.BYTE,b),x=u(a.KANJI,e.KANJI,b)):(w=u(a.BYTE_KANJI,e.BYTE,b),x=[]),E.concat(v,w,x).sort(function(S,A){return S.index-A.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function f(b,E){switch(E){case e.NUMERIC:return r.getBitsLength(b);case e.ALPHANUMERIC:return n.getBitsLength(b);case e.KANJI:return s.getBitsLength(b);case e.BYTE:return i.getBitsLength(b)}}function h(b){return b.reduce(function(E,v){const w=E.length-1>=0?E[E.length-1]:null;return w&&w.mode===v.mode?(E[E.length-1].data+=v.data,E):(E.push(v),E)},[])}function g(b){const E=[];for(let v=0;v<b.length;v++){const w=b[v];switch(w.mode){case e.NUMERIC:E.push([w,{data:w.data,mode:e.ALPHANUMERIC,length:w.length},{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.ALPHANUMERIC:E.push([w,{data:w.data,mode:e.BYTE,length:w.length}]);break;case e.KANJI:E.push([w,{data:w.data,mode:e.BYTE,length:l(w.data)}]);break;case e.BYTE:E.push([{data:w.data,mode:e.BYTE,length:l(w.data)}])}}return E}function m(b,E){const v={},w={start:{}};let x=["start"];for(let _=0;_<b.length;_++){const S=b[_],A=[];for(let I=0;I<S.length;I++){const $=S[I],P=""+_+I;A.push(P),v[P]={node:$,lastCount:0},w[P]={};for(let j=0;j<x.length;j++){const L=x[j];v[L]&&v[L].node.mode===$.mode?(w[L][P]=f(v[L].lastCount+$.length,$.mode)-f(v[L].lastCount,$.mode),v[L].lastCount+=$.length):(v[L]&&(v[L].lastCount=$.length),w[L][P]=f($.length,$.mode)+4+e.getCharCountIndicator($.mode,E))}}x=A}for(let _=0;_<x.length;_++)w[x[_]].end=0;return{map:w,table:v}}function y(b,E){let v;const w=e.getBestModeForData(b);if(v=e.from(E,w),v!==e.BYTE&&v.bit<w.bit)throw new Error('"'+b+'" cannot be encoded with mode '+e.toString(v)+`. 458 Suggested mode is: `+e.toString(w));switch(v===e.KANJI&&!o.isKanjiModeEnabled()&&(v=e.BYTE),v){case e.NUMERIC:return new r(b);case e.ALPHANUMERIC:return new n(b);case e.KANJI:return new s(b);case e.BYTE:return new i(b)}}t.fromArray=function(E){return E.reduce(function(v,w){return typeof w=="string"?v.push(y(w,null)):w.data&&v.push(y(w.data,w.mode)),v},[])},t.fromString=function(E,v){const w=d(E,o.isKanjiModeEnabled()),x=g(w),_=m(x,v),S=c.find_path(_.map,"start","end"),A=[];for(let I=1;I<S.length-1;I++)A.push(_.table[S[I]].node);return t.fromArray(h(A))},t.rawSplit=function(E){return t.fromArray(d(E,o.isKanjiModeEnabled()))}})(Ex)),Ex}var uF;function Wqe(){if(uF)return cx;uF=1;const t=fh(),e=tI(),r=Tqe(),n=Iqe(),i=kqe(),s=$qe(),a=Nqe(),o=PJ(),c=Rqe(),l=Dqe(),u=Mqe(),d=hh(),f=qqe();function h(_,S){const A=_.size,I=s.getPositions(S);for(let $=0;$<I.length;$++){const P=I[$][0],j=I[$][1];for(let L=-1;L<=7;L++)if(!(P+L<=-1||A<=P+L))for(let B=-1;B<=7;B++)j+B<=-1||A<=j+B||(L>=0&&L<=6&&(B===0||B===6)||B>=0&&B<=6&&(L===0||L===6)||L>=2&&L<=4&&B>=2&&B<=4?_.set(P+L,j+B,!0,!0):_.set(P+L,j+B,!1,!0))}}function g(_){const S=_.size;
vendor: 2,855 bytes, lines 458-461
458for(let A=8;A<S-8;A++){const I=A%2===0;_.set(A,6,I,!0),_.set(6,A,I,!0)}}function m(_,S){const A=i.getPositions(S);for(let I=0;I<A.length;I++){const $=A[I][0],P=A[I][1];for(let j=-2;j<=2;j++)for(let L=-2;L<=2;L++)j===-2||j===2||L===-2||L===2||j===0&&L===0?_.set($+j,P+L,!0,!0):_.set($+j,P+L,!1,!0)}}function y(_,S){const A=_.size,I=l.getEncodedBits(S);let $,P,j;for(let L=0;L<18;L++)$=Math.floor(L/3),P=L%3+A-8-3,j=(I>>L&1)===1,_.set($,P,j,!0),_.set(P,$,j,!0)}function b(_,S,A){const I=_.size,$=u.getEncodedBits(S,A);let P,j;for(P=0;P<15;P++)j=($>>P&1)===1,P<6?_.set(P,8,j,!0):P<8?_.set(P+1,8,j,!0):_.set(I-15+P,8,j,!0),P<8?_.set(8,I-P-1,j,!0):P<9?_.set(8,15-P-1+1,j,!0):_.set(8,15-P-1,j,!0);_.set(I-8,8,1,!0)}function E(_,S){const A=_.size;let I=-1,$=A-1,P=7,j=0;for(let L=A-1;L>0;L-=2)for(L===6&&L--;;){for(let B=0;B<2;B++)if(!_.isReserved($,L-B)){let k=!1;j<S.length&&(k=(S[j]>>>P&1)===1),_.set($,L-B,k),P--,P===-1&&(j++,P=7)}if($+=I,$<0||A<=$){$-=I,I=-I;break}}}function v(_,S,A){const I=new r;A.forEach(function(B){I.put(B.mode.bit,4),I.put(B.getLength(),d.getCharCountIndicator(B.mode,_)),B.write(I)});const $=t.getSymbolTotalCodewords(_),P=o.getTotalCodewordsCount(_,S),j=($-P)*8;for(I.getLengthInBits()+4<=j&&I.put(0,4);I.getLengthInBits()%8!==0;)I.putBit(0);const L=(j-I.getLengthInBits())/8;for(let B=0;B<L;B++)I.put(B%2?17:236,8);return w(I,_,S)}function w(_,S,A){const I=t.getSymbolTotalCodewords(S),$=o.getTotalCodewordsCount(S,A),P=I-$,j=o.getBlocksCount(S,A),L=I%j,B=j-L,k=Math.floor(I/j),D=Math.floor(P/j),q=D+1,U=k-D,W=new c(U);let V=0;const Y=new Array(j),K=new Array(j);let ge=0;const ae=new Uint8Array(_.buffer);for(let _e=0;_e<j;_e++){const z=_e<B?D:q;Y[_e]=ae.slice(V,V+z),K[_e]=W.encode(Y[_e]),V+=z,ge=Math.max(ge,z)}const ce=new Uint8Array(I);let Q=0,se,me;for(se=0;se<ge;se++)for(me=0;me<j;me++)se<Y[me].length&&(ce[Q++]=Y[me][se]);for(se=0;se<U;se++)for(me=0;me<j;me++)ce[Q++]=K[me][se];return ce}function x(_,S,A,I){let $;if(Array.isArray(_))$=f.fromArray(_);else if(typeof _=="string"){let k=S;if(!k){const D=f.rawSplit(_);k=l.getBestVersionForData(D,A)}$=f.fromString(_,k||40)}else throw new Error("Invalid data");const P=l.getBestVersionForData($,A);if(!P)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=P;else if(S<P)throw new Error(` 459The chosen QR Code version cannot contain this amount of data. 460Minimum version required to store current data is: `+P+`. 461`);const j=v(S,A,$),L=t.getSymbolSize(S),B=new n(L);return h(B,S),g(B),m(B,S),b(B,A,0),S>=7&&y(B,S),E(B,j),isNaN(I)&&(I=a.getBestMask(B,b.bind(null,B,A))),a.applyMask(I,B),b(B,A,I),{modules:B,version:S,errorCorrectionLevel:A,maskPattern:I,segments:$}}return cx.create=function(S,A){if(typeof S>"u"||S==="")throw new Error("No input text");let I=e.M,$,P;return typeof A<"u"&&(I=e.from(A.errorCorrectionLevel,e.M),$=l.from(A.version),P=
461a.from(A.maskPattern),A.toSJISFunc&&t.setToSJISFunction(A.toSJISFunc)),x(S,$,I,P)},cx}var Tx={},Ix={},dF;function DJ(){return dF||(dF=1,(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(s){return[s,s]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,s=n.width&&n.width>=21?n.width:void 0,a=n.scale||4;return{width:s,scale:s?4:a,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const s=t.getScale(n,i);return Math.floor((n+i.margin*2)*s)},t.qrToImageData=function(n,i,s){const a=i.modules.size,o=i.modules.data,c=t.getScale(a,s),l=Math.floor((a+s.margin*2)*c),u=s.margin*c,d=[s.color.light,s.color.dark];for(let f=0;f<l;f++)for(let h=0;h<l;h++){let g=(f*l+h)*4,m=s.color.light;if(f>=u&&h>=u&&f<l-u&&h<l-u){const y=Math.floor((f-u)/c),b=Math.floor((h-u)/c);m=d[o[y*a+b]?1:0]}n[g++]=m.r,n[g++]=m.g,n[g++]=m.b,n[g]=m.a}}})(Ix)),Ix}var fF;function zqe(){return fF||(fF=1,(function(t){const e=DJ();function r(i,s,a){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,a,o){let c=o,l=a;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),a||(l=n()),c=e.getOptions(c);const u=e.getImageWidth(s.modules.size,c),d=l.getContext("2d"),f=d.createImageData(u,u);return e.qrToImageData(f.data,s,c),r(d,l,u),d.putImageData(f,0,0),l},t.renderToDataURL=function(s,a,o){let c=o;typeof c>"u"&&(!a||!a.getContext)&&(c=a,a=void 0),c||(c={});const l=t.render(s,a,c),u=c.type||"image/png",d=c.rendererOpts||{};return l.toDataURL(u,d.quality)}})(Tx)),Tx}var kx={},hF;function Vqe(){if(hF)return kx;hF=1;const t=DJ();function e(i,s){const a=i.a/255,o=s+'="'+i.hex+'"';return a<1?o+" "+s+'-opacity="'+a.toFixed(2).slice(1)+'"':o}function r(i,s,a){let o=i+s;return typeof a<"u"&&(o+=" "+a),o}function n(i,s,a){let o="",c=0,l=!1,u=0;for(let d=0;d<i.length;d++){const f=Math.floor(d%s),h=Math.floor(d/s);!f&&!l&&(l=!0),i[d]?(u++,d>0&&f>0&&i[d-1]||(o+=l?r("M",f+a,.5+h+a):r("m",c,0),c=0,l=!1),f+1<s&&i[d+1]||(o+=r("h",u),u=0)):c++}return o}return kx.render=function(s,a,o){const c=t.getOptions(a),l=s.modules.size,u=s.modules.data,d=l+c.margin*2,f=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+d+"v"+d+'H0z"/>':"",h="<path "+e(c.color.dark,"stroke")+' d="'+n(u,l,c.margin)+'"/>',g='viewBox="0 0 '+d+" "+d+'"',y='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+g+' shape-rendering="crispEdges">'+f+h+`</svg> 462`;return typeof o=="function"&&o(null,y),y},kx}var pF;function Hqe(){if(pF)return Ph;pF=1;const t=Aqe(),e=Wqe(),r=zqe(),n=Vqe();function i(s,a,o,c,l){const u=[].slice.call(arguments,1),d=u.length,f=typeof u[d-1]=="function";if(!f&&!t())throw new Error("Callback required as last argument");if(f){if(d<2)throw new Error("Too few arguments provided");d===2?(l=o,o=a,a=c=void 0):d===3&&(a.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=o,o=a,a=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(o=a,a=c=void 0):d===2&&!a.getContext&&(c=o,o=a,a=void 0),new Promise(function(h,g){try{const m=e.create(o,c);h(s(m,a,c))}catch(m){g(m)}})}try{const h=e.create(o,c);l(null,s(h,a,c))}catch(h){l(h)}}return Ph.create=e.create,Ph.toCanvas=i.bind(null,r.render),Ph.toDataURL=i.bind(null,r.renderToDataURL),Ph.toString=i.bind(null,function(s,a,o){return n.render(s,o)}),Ph}var Gqe=Hqe();const Kqe=Rl(Gqe),Qqe=()=>p.jsx("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:p.jsx("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let $x=(t,e,r,n,i)=>{for(let s=e;s<e+n;s++)for(let a=r;a<r+i;a++){let o=t==null?void 0:t[a];o&&o[s]&&(o[s]=0)}return t},Yqe=(t,e)=>{let r=Kqe.create(t,{errorCorrectionLevel:e}).modules,n=k8e(Array.from(r.data),r.size);return n=$x(n,0,0,7,7),n=$x(n,n.length-7,0,7,7),$x(n,0,n.length-7,7,7)},Zqe=({x:t,y:e,cellSize:r,bgColor:n,fgColor:i})=>p.jsx(p.Fragment,{children:[0,1,2].map((s=>p.jsx("circle",{r:r*(7-2*s)/2,cx:t+7*r/2,cy:e+7*r/2,fill:s%2!=0?n:i},`finder-${t}-${e}-${s}`)))}),Xqe=({cellSize:t,matrixSize:e,bgColor:r,fgColor:n})=>p.jsx(p.Fragment,{children:[[0,0],[(e-7)*t,0],[0,(e-7)*t]].map((([i,s])=>p.jsx(Zqe,{x:i,y:s,cellSize:t,bgColor:r,fgColor:n},`finder-${i}-${s}`)))}),Jqe=({matrix:t,cellSize:e,color:r})=>p.jsx(p.Fragment,{children:t.map(((n,i)=>n.map(((s,a)=>s?p.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:a*e+.1*e,rx:.5*e,ry:.5*e,fill:r},`cell-${i}-${a}`):p.jsx(Rt.Fragment,{},`circle-${i}-${a}`)))))}),eWe=({cellSize:t,matrixSize:e,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return p.jsx(p.Fragment,{});let s=e*(n||.14),a=Math.floor(e/2-s/2),o=Math.floor(e/2+s/2);(o-a)%2!=e%2&&(o+=1);let c=(o-a)*t,l=c-.2*c,u=a*t;return p.jsxs(p.Fragment,{children:[p.jsx("rect",{x:a*t,y:a*t,width:c,height:c,fill:i}),p.jsx(r,{x:u+.1*c,y:u+.1*c,height:l,width:l})]})},tWe=t=>{var s;let e=t.outputSize,r=Yqe(t.url,t.errorCorrectionLevel),n=e/r.length,i=D8e(2*n,{min:.025*e,max:.036*e});return p.jsxs("svg",{height:t.outputSize,width:t.outputSize,viewBox:`0 0 ${t.outputSize} ${t.outputSize}`,style:{height:"100%",width:"100%",padding:`${i}px`},children:[p.jsx(Jqe,{matrix:r,cellSize:n,color:t.fgColor}),p.jsx(Xqe,{cellSize:n,matrixSize:r.length,fgColor:t.fgColor,bgColor:t.bgColor}),p.jsx(eWe,{cellSize:n,element:(s=t.logo)==null?void 0:s.element,bgColor:t.bgColor,matrixSize:r.length})]})},rWe=oe.div.withConfig({displayName:"QrContainer",componentId:"sc-aa6883ae-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],(t=>`${t.$size}px`),(t=>`${t.$size}px`),(t=>t.$bgColor),(t=>t.$borderColor));const A5=t=>{let{appearance:e}=Jn(),r=t.bgColor||"#FFFFFF",n=t.fgColor||"#000000",i=t.size||160,s=e.palette.colorScheme==="dark"?r
462:n;return p.jsx(rWe,{$size:i,$bgColor:r,$fgColor:n,$borderColor:s,children:p.jsx(tWe,{url:t.url,logo:{element:t.squareLogoElement??Qqe},outputSize:i,bgColor:r,fgColor:n,errorCorrectionLevel:t.errorCorrectionLevel||"Q"})})},vf=({style:t,...e})=>p.jsxs("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...t},...e,children:[p.jsx("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),p.jsx("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),p.jsx("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),p.jsx("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});let gF="#8a63d2";const nWe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=Sr(),{lastScreen:i,navigate:s,navigateBack:a,setModalData:o,app:c}=ht(),{getAuthFlow:l,loginWithFarcaster:u,closePrivyModal:d,createAnalyticsEvent:f}=bt(),[h,g]=C.useState(void 0),[m,y]=C.useState(!1),[b,E]=C.useState(!1),v=C.useRef([]),w=l(),x=w==null?void 0:w.meta.connectUri;return C.useEffect((()=>{let _=Date.now(),S=setInterval((async()=>{var $,P,j,L,B,k,D,q,U,W,V,Y,K,ge,ae;let A=await w.pollForReady.execute(),I=Date.now()-_;if(A){clearInterval(S),y(!0);try{await u(),E(!0)}catch(ce){let Q={retryable:!1,message:"Authentication failed"};if((ce==null?void 0:ce.privyErrorCode)===Se.ALLOWLIST_REJECTED)return void s(de.ALLOWLIST_REJECTION_SCREEN);if((ce==null?void 0:ce.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Ny(ce).toString()),void s(de.USER_LIMIT_REACHED_SCREEN);if((ce==null?void 0:ce.privyErrorCode)===Se.USER_DOES_NOT_EXIST)return void s(de.ACCOUNT_NOT_FOUND_SCREEN);if((ce==null?void 0:ce.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER)Q.detail=ce.message??"This account has already been linked to another user.";else{if((ce==null?void 0:ce.privyErrorCode)===Se.ACCOUNT_TRANSFER_REQUIRED&&((P=($=ce.data)==null?void 0:$.data)!=null&&P.nonce))return o({accountTransfer:{nonce:(L=(j=ce.data)==null?void 0:j.data)==null?void 0:L.nonce,account:(k=(B=ce.data)==null?void 0:B.data)==null?void 0:k.subject,displayName:(U=(q=(D=ce.data)==null?void 0:D.data)==null?void 0:q.account)==null?void 0:U.displayName,linkMethod:"farcaster",embeddedWalletAddress:(Y=(V=(W=ce.data)==null?void 0:W.data)==null?void 0:V.otherUser)==null?void 0:Y.embeddedWalletAddress,farcasterEmbeddedAddress:(ae=(ge=(K=ce.data)==null?void 0:K.data)==null?void 0:ge.otherUser)==null?void 0:ae.farcasterEmbeddedAddress}}),void s(de.LINK_CONFLICT_SCREEN);(ce==null?void 0:ce.privyErrorCode)===Se.INVALID_CREDENTIALS?(Q.retryable=!0,Q.detail="Something went wrong. Try again."):(ce==null?void 0:ce.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(Q.detail="Too many requests. Please wait before trying again.")}g(Q)}}else I>12e4&&(clearInterval(S),g({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(S),v.current.forEach((A=>clearTimeout(A)))}}),[]),C.useEffect((()=>{if(r&&t&&b&&n){if(c!=null&&c.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let _=setTimeout((()=>{s(de.AFFIRMATIVE_CONSENT_SCREEN)}),fn);return()=>clearTimeout(_)}
462b&&(Sl(n,c==null?void 0:c.embeddedWallets.createOnLogin)?v.current.push(setTimeout((()=>{o({createWallet:{onSuccess:()=>{},onFailure:_=>{console.error(_),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:_,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),s(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),fn)):v.current.push(setTimeout((()=>d({shouldCallAuthOnSuccess:!0,isSuccess:!0})),fn)))}}),[b,r,t,n]),p.jsxs(p.Fragment,An.isMobile||m?{children:[p.jsx(lt,{backFn:i?a:void 0,onClose:d},"header"),p.jsx(Lr,{}),p.jsx(p.Fragment,An.isIOS?{children:p.jsxs(iWe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:b,fail:!!h}),p.jsx(vf,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx(Hr,{children:h?h.message:"Sign in with Farcaster"}),p.jsx(Gr,{children:h?h.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),x&&p.jsx(Mt,{onClick:_=>{_.preventDefault(),window.location.href=x},children:"Open Warpcast app"})]})}:{children:p.jsxs(mF,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:b,fail:!!h}),p.jsx(vf,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx(Hr,{children:h?h.message:"Signing in with Farcaster"}),p.jsx(Gr,{children:h?h.detail:"This should only take a moment"}),p.jsx(ko,{children:x&&An.isMobile&&p.jsx(NJ,{text:"Take me to Warpcast",url:x,color:gF})})]})]})}),p.jsx(vr,{})]}:{children:[p.jsx(lt,{backFn:i?a:void 0,onClose:d},"header"),p.jsx(Lr,{}),p.jsx(mF,{children:p.jsxs("div",{children:[p.jsx(Hr,{children:"Sign in with Farcaster"}),p.jsx(Gr,{children:"Scan with your phone's camera to continue."}),p.jsx(iT,{children:x?p.jsx(A5,{url:x,size:275,squareLogoElement:vf}):p.jsx(Fa,{})}),p.jsxs(ko,{children:[p.jsx(Gr,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),x&&p.jsx(S5,{text:x,itemName:"link",color:gF})]})]})}),p.jsx(vr,{})]})};let mF=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-5a361367-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),iWe=oe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-5a361367-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),yF="#8a63d2";const sWe=()=>{let{lastScreen:t,navigateBack:e,data:r,app:n}=ht(),{requestFarcasterSignerStatus:i,closePrivyModal:s}=bt(),[a,o]=C.useState(void 0),[c,l]=C.useState(!1),[u,d]=C.useState(!1),f=C.useRef([]),h=r==null?void 0:r.farcasterSigner;C.useEffect((()=>{let m=Date.now(),y=setInterval((async()=>{if(!(h!=null&&h.public_key))return clearInterval(y),void o({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});h.status==="approved"&&(clearInterval(y),l(!1),d(!0),f.current.push(setTimeout((()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0})),fn)));let b=await i(h==null?void 0:h.public_key),E=Date.now()-m;b.status==="approved"?(clearInterval(y),l(!1),d(!0),f.current.push(setTimeout((()=>s({shouldCallAuthOnSuccess:!1,isSuccess:!0})),fn))):E>3e5?(clearInterval(y),o({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):b.status==="revoked"&&(clearInterval(y),o({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(y),f.current.forEach((b=>clearTimeout(b)))}}),[]);let g=(h==null?void 0:h.status)==="pending_approval"?h.signer_approval_url:void 0;return p.jsxs(p.Fragment,An.isMobile||c?{children:[p.jsx(lt,{backFn:t?e:void 0,onClose:s},"header"),p.jsx(Lr,{}),p.jsx(p.Fragment,An.isIOS?{children:p.jsxs(aWe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:u,fail:!!a}),p.jsx(vf,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx(Hr,{children:a?a.message:"Add a signer to Farcaster"}),p.jsx(Gr,{children:a?a.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&p.jsx(Mt,{onClick:m=>{m.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}:{children:p.jsxs(bF,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:u,fail:!!a}),p.jsx(vf,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx(Hr,{children:a?a.message:"Requesting signer from Farcaster"}),p.jsx(Gr,{children:a?a.detail:"This should only take a moment"}),p.jsx(ko,{children:g&&An.isMobile&&p.jsx(NJ,{text:"Take me to Warpcast",url:g,color:yF})})]})]})}),p.jsx(vr,{})]}:{children:[p.jsx(lt,{backFn:t?e:void 0,onClose:s},"header"),p.jsx(Lr,{}),p.jsx(bF,{children:p.jsxs("div",{children:[p.jsx(Hr,{children:"Add a signer to Farcaster"}),p.jsxs(Gr,{children:["This will allow ",n.name," to add casts, like
462s, follows, and more on your behalf."]}),p.jsx(iT,{children:(h==null?void 0:h.status)==="pending_approval"?p.jsx(A5,{url:h.signer_approval_url,size:275,squareLogoElement:vf}):p.jsx(Fa,{})}),p.jsxs(ko,{children:[p.jsx(Gr,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),(h==null?void 0:h.status)==="pending_approval"&&p.jsx(S5,{text:h.signer_approval_url,itemName:"link",color:yF})]})]})}),p.jsx(vr,{})]})};let bF=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-6e2c96cd-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),aWe=oe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-6e2c96cd-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);function Bs({title:t}){var a,o;let{currentScreen:e,navigateBack:r,navigate:n,data:i,setModalData:s}=ht();return p.jsx(lt,{title:t,backFn:e===de.FUNDING_MANUAL_TRANSFER_SCREEN?r:e===((a=i==null?void 0:i.funding)==null?void 0:a.methodScreen)?i.funding.comingFromSendTransactionScreen?()=>n(de.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN):void 0:(o=i==null?void 0:i.funding)!=null&&o.methodScreen?()=>{let c=i.funding;c.usingDefaultFundingMethod&&(c.usingDefaultFundingMethod=!1),s({funding:c}),n(c.methodScreen)}:void 0})}const q0=({size:t})=>p.jsx(oWe,{$size:t,children:p.jsxs(cWe,{children:[p.jsx(lWe,{}),p.jsx(uWe,{})]})});let oWe=oe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-3ddaba1c-0"})(["--spinner-size:",";display:flex;justify-content:center;align-items:center;flex-grow:1;@media all and (display-mode:standalone){margin-bottom:30px;}"],(t=>t.$size?t.$size:"96px")),cWe=oe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-3ddaba1c-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),lWe=oe.div.withConfig({displayName:"CircleFixed",componentId:"sc-3ddaba1c-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid #f1f2f9;border-radius:50%;}"]),uWe=oe.div.withConfig({displayName:"CircleRotate",componentId:"sc-3ddaba1c-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:#cbcde1 transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const MJ=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:r}=bt(),[n,i]=C.useState(!0),[s,a]=C.useState(void 0),[o,c]=C.useState(void 0);return C.useEffect((()=>{(async()=>{if(e&&t)try{i(!0);let l=await r();l?c(l):a(Error("Unable to fetch SOL price"))}catch(l){a(l)}finally{i(!1)}else i(!1)})()}
462),[]),{solPrice:o,isSolPriceLoading:n,solPriceError:s}};function W0(t){let{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}=(o=>{let{showFiatPrices:c,getUsdTokenPrice:l,chains:u}=bt(),[d,f]=C.useState(!0),[h,g]=C.useState(void 0),[m,y]=C.useState(void 0);return C.useEffect((()=>{o||(o=Lm);let b=QA(u).find((E=>E.id===Number(o)));(async()=>{if(c){if(!b)return f(!1),void g(Error(`Unable to fetch token price on chain id ${o}`));try{f(!0);let E=await l(b);E?y(E):g(Error(`Unable to fetch token price on chain id ${b.id}`))}catch(E){g(E)}finally{f(!1)}}else f(!1)})()}),[o]),{tokenPrice:m,isTokenPriceLoading:d,tokenPriceError:h}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:s,solPriceError:a}=MJ({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:s,tokenPriceError:a}:{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}}const jJ=C.createContext(null);function ph(){let t=C.useContext(jJ);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}const Ol="sdk_fiat_on_ramp_completed_with_status";let vF="0x0000000000000000000000000000000000000000";const Hm=({destinationCurrency:t,...e})=>({tradeType:"EXACT_OUTPUT",originCurrency:vF,destinationCurrency:t??vF,...e}),Gm=async({input:t,isTestnet:e})=>{let r=await fetch(e?"https://api.testnets.relay.link/execute/swap":"https://api.relay.link/execute/swap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json();if(!(r.ok||typeof n.message=="string"&&n.message.startsWith("Invalid address")))throw console.error("Relay error:",n),Error(n.message??"Error fetching quote from relay");return n},_w=t=>{var r,n;let e=(n=(r=t.steps[0])==null?void 0:r.items)==null?void 0:n[0];if(e)return{from:e.data.from,to:e.data.to,value:Number(e.data.value),chainId:Number(e.data.chainId),data:e.data.data}},dWe=(t,e=0)=>{let r=t[e],n=t[e+7];if(!r||!n)throw Error(`Buffer offset out of range: first: ${r}, last: ${n}.`);return(BigInt(t[e+4]+256*t[e+5]+65536*t[e+6]+(n<<24))<<32n)+BigInt(r+256*t[++e]+65536*t[++e]+16777216*t[++e])};function fWe(t,e=0){let r=0n;for(let n=0;n<8;n++)r|=BigInt(t[e+n])<<BigInt(8*n);return r}let hWe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function Bu(t,e=6,r=!1,n=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),s=n?"":" SOL";return r?`${i}${s}`:`${i==="0"?"<0.001":i}${s}`}function M1(t,e){let r=parseFloat(t.toString())/1e9,n=hWe.format(e*r);return n==="$0.00"?"<$0.01":n}function LJ({amount:t,fee:e,tokenPrice:r}){let n=BigInt(1e9*parseFloat(t)),i=n+e;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?M1(n,r):void 0,totalPriceInUsd:r?M1(i,r):void 0,totalPriceInNativeCurrency:Bu(i),feePriceInNativeCurrency:Bu(e),feePriceInUsd:r?M1(e,r):void 0}}function t2(t){return"version"in t}function pWe(t,e){let r=(t2(t)?t.message:t.compileMessage()).staticAccountKeys.find((n=>n.toBase58()===e));if(!r)throw Error(`Transaction does not contain public key ${e}`);return r}async function gWe(t,e){return BigInt((t2(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e))??0)}function FJ(t,e){var r;return{signature:t,parsedTransaction:e,fees:BigInt(((r=e==null?void 0:e.meta)==null?void 0:r.fee)||0)}}async function mWe(t,e){var n;let{value:r}=await e.simulateTransaction(t);return r.err==null&&((n=r.logs)==null?void 0:n.every((i=>!/insufficient funds/gi.test(i))))}async function yWe({tx:t,connection:e,client:r}){var c,l;let n=t2(t)?t.message:t.compileMessage(),i=((c=n.staticAccountKeys[0])==null?void 0:c.toBase58())??"",s=await gWe(t,e),a={},o=[];for(let u of n.compiledInstructions){let d=((l=n.staticAccountKeys[u.programIdIndex])==null?void 0:l.toBase58())||"";if(d!=="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"&&d!=="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb")d!=="11111111111111111111111111111111"?o.push({type:"unknown",program:d}):o.push(await vWe(u,n));else{let f=await bWe(u,n,e,r,a);o.push(f),a[f.token.address]=f.token}}return{spender:i,fee:s,instructions:o}}function UJ(t,e){try{return fWe(t,e)}catch{}try{return t.readBigInt64LE(e)}catch{}let r=Buffer.from(t);try{return dWe(r)}catch{}try{return r.subarray(e).readBigInt64LE()}catch{}try{return r.readBigInt64LE(e)}catch{}return 0n}async function bWe(t,e,r,n,i){var y,b,E,v,w,x,_,S;let[s,a,o]=t.accountKeyIndexes.map((A=>e.staticAccountKeys[A]));if(!s||!a||!o)throw Error("Invalid instruction");let c=await r.getParsedAccountInfo(a,"confirmed"),l=(y=c.value)==null?void 0:y.data,u=(E=(b=l==null?void 0:l.parsed)==null?void 0:b.info)==null?void 0:E.owner,d=((w=(v=l==null?void 0:l.parsed)==null?void 0:v.info)==null?void 0:w.mint)??"",f=i[d];if(!f){let A=await n.getSplTokenMetadata({mintAddress:d,cluster:z3(r.rpcEndpoint)});A&&(f={address:d,symbol:A.symbol,decimals:A.decimals})}let h=(f==null?void 0:f.symbol)??"",g=(f==null?void 0:f.decimals)??((S=(_=(x=l==null?void 0:l.parsed)==null?void 0:x.info)==null?void 0:_.tokenAmount)==null?void 0:S.decimals)??9,m=UJ(t.data,1);return{type:"spl-transfer",fromAta:s.toBase58(),fromAccount:o.toBase58(),toAta:a.toBase58(),toAccount:u,value:m,token:{symbol
462:h,decimals:g,address:d}}}async function vWe(t,e){let[r,n]=t.accountKeyIndexes.map((s=>e.staticAccountKeys[s]));if(!r||!n)throw Error("Invalid instruction");let i=UJ(t.data,4);return{type:"sol-transfer",fromAccount:r.toBase58(),toAccount:n.toBase58(),value:i,token:{symbol:"SOL",decimals:9}}}const BJ=({chains:t,appId:e,address:r,rpcConfig:n})=>Promise.all(t.map((async i=>({balance:await Of({chain:i,transport:Rf(Zu(i,n,e))}).getBalance({address:r}).catch((()=>0n)),chain:i}))));let qJ=C.createContext({plugins:{current:{}}});const wWe=({children:t})=>{let e=C.useRef({});return p.jsx(qJ.Provider,{value:{plugins:e},children:t})},r2=()=>{let{plugins:t}=C.useContext(qJ);return C.useCallback((e=>t.current[e]),[t])},n2=Symbol("solana-funding-plugin"),z0=oe.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),pr=oe.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),hr=oe.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),EWe=oe(hr).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),yr=oe.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],eY);function xWe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const WJ=C.forwardRef(xWe),_We=t=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...t,children:p.jsx("g",{id:"Layer_x0020_1",children:p.jsxs("g",{id:"_2405588477232",children:[p.jsx("rect",{fill:"none",width:"2500",height:"2500"}),p.jsx("g",{children:p.jsxs("g",{children:[p.jsx("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),p.jsx("g",{children:p.jsxs("g",{children:[p.jsx("g",{children:p.jsx("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),p.jsx("g",{children:p.jsx("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),p.jsx("g",{children:p.jsx("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),p.jsx("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),p.jsxs("g",{children:[p.jsx("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),p.jsx("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),CWe=t=>p.jsxs("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),SWe=t=>p.jsxs("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),p.jsx("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),AWe=t=>p.jsxs("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),p.jsx("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),TWe=t=>p.jsxs("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{width:"199.4",height:"207.623",fill:"#121212"}),p.jsxs("g",{"clip-path":"url(#clip0_2303_643)",children:[p.jsx("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),p.jsx("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2303_643",children:p.jsx("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),IWe=t=>p.jsxs("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackgroun
462d:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...t,children:[p.jsx("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),p.jsx("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),p.jsx("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),p.jsx("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),p.jsx("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),kWe=t=>p.jsxs("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),p.jsx("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),p.jsx("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),$We=t=>p.jsxs("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[p.jsx("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),p.jsx("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),NWe=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...t,children:[p.jsxs("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[p.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),p.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),p.jsx("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),p.jsxs("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[p.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),p.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),p.jsx("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),p.jsxs("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[p.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),p.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),p.jsx("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]}),PWe=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...t,children:[p.jsx("g",{clipPath:"url(#clip0)",children:p.jsx("g",{clipPath:"url(#clip1)",children:p.jsx("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),p.jsxs("defs",{children:[p.jsxs("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[p.jsx("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),p.jsx("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),p.jsx("stop",{offset:"0.4982",stopColor:"#4281D3"}),p.jsx("stop",{offset:"0.666667",stopColor:"#2E427D"}),p.jsx("stop",{offset:"0.822917",stopColor:"#230101"}),p.jsx("stop",{offset:"1",stopColor:"#8F6B40"})]}),p.jsx("clipPath",{id:"clip0",children:p.jsx("rect",{width:"30",height:"30",fill:"white"})}),p.jsx("clipPath",{id:"clip1",children:p.jsx("rect",{width:"30",height:"30",fill:"white"})})]})]});let OWe={[hd.id]:_We,[HA.id]:CWe,[ql.id]:SWe,[GA.id]:AWe,[gQ.id]:TWe,[_c.id]:IWe,[nh.id]:kWe,[Wl.i
462d]:$We,[vQ.id]:PWe};const zJ=({chainId:t,...e})=>{if(t==="solana")return p.jsx(NWe,{...e});let r=OWe[t];return p.jsx(r||WJ,{...e})},RWe=({balance:t,className:e,chain:r})=>p.jsx(zT,{className:e,$state:void 0,children:p.jsx(Y7,{balance:t,chain:r})}),Y7=({balance:t,chain:e})=>p.jsxs(p.Fragment,{children:[p.jsxs(DWe,{children:[p.jsx(jWe,{chainId:"id"in e?e.id:"solana"}),p.jsx(yr,{children:e.name})]}),p.jsxs($o,{isLoading:!1,isPulsing:!1,color:"gray",children:[p.jsx(MWe,{children:p.jsx(Fy,{})}),t]})]});let DWe=oe.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),MWe=oe.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),jWe=oe(zJ).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);var LWe=Object.defineProperty,FWe=(t,e,r)=>e in t?LWe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Nx=(t,e,r)=>(FWe(t,typeof e!="symbol"?e+"":e,r),r);let UWe=class{constructor(){Nx(this,"current",this.detect()),Nx(this,"handoffState","pending"),Nx(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hc=new UWe;function gh(t){var e;return hc.isServer?null:t==null?document:(e=t==null?void 0:t.ownerDocument)!=null?e:document}function Cw(t){var e,r;return hc.isServer?null:t==null?document:(r=(e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))!=null?r:document}function rI(t){var e,r;return(r=(e=Cw(t))==null?void 0:e.activeElement)!=null?r:null}function VJ(t){return rI(t)===t}function T5(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Gs(){let t=[],e={addEventListener(r,n,i,s){return r.addEventListener(n,i,s),e.add(()=>r.removeEventListener(n,i,s))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return e.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return T5(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let s=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:s})})},group(r){let n=Gs();return r(n),this.add(()=>n.dispose())},add(r){return t.includes(r)||t.push(r),()=>{let n=t.indexOf(r);if(n>=0)for(let i of t.splice(n,1))i()}},dispose(){for(let r of t.splice(0))r()}};return e}function mh(){let[t]=C.useState(Gs);return C.useEffect(()=>()=>t.dispose(),[t]),t}let hn=(t,e)=>{hc.isServer?C.useEffect(t,e):C.useLayoutEffect(t,e)};function yh(t){let e=C.useRef(t);return hn(()=>{e.current=t},[t]),e}let rr=function(t){let e=yh(t);return Rt.useCallback((...r)=>e.current(...r),[e])};function BWe(t){let e=t.width/2,r=t.height/2;return{top:t.clientY-r,right:t.clientX+e,bottom:t.clientY+r,left:t.clientX-e}}function qWe(t,e){return!(!t||!e||t.right<e.left||t.left>e.right||t.bottom<e.top||t.top>e.bottom)}function WWe({disabled:t=!1}={}){let e=C.useRef(null),[r,n]=C.useState(!1),i=mh(),s=rr(()=>{e.current=null,n(!1),i.dispose()}),a=rr(o=>{if(i.dispose(),e.current===null){e.current=o.currentTarget,n(!0);{let c=gh(o.currentTarget);i.addEventListener(c,"pointerup",s,!1),i.addEventListener(c,"pointermove",l=>{if(e.current){let u=BWe(l);n(qWe(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(c,"pointercancel",s,!1)}}});return{pressed:r,pressProps:t?{}:{onPointerDown:a,onPointerUp:s,onClick:s}}}function Cc(t){return C.useMemo(()=>t,Object.values(t))}let zWe=C.createContext(void 0);function HJ(){return C.useContext(zWe)}function Z7(...t){return Array.from(new Set(t.flatMap(e=>
vendor: 7,830 bytes, lines 462-465
462typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Po(t,e,...r){if(t in e){let i=e[t];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Po),n}var f0=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(f0||{}),Pu=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Pu||{});function ei(){let t=HWe();return C.useCallback(e=>VWe({mergeRefs:t,...e}),[t])}function VWe({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:s=!0,name:a,mergeRefs:o}){o=o??GWe;let c=GJ(e,t);if(s)return pb(c,r,n,a,o);let l=i??0;if(l&2){let{static:u=!1,...d}=c;if(u)return pb(d,r,n,a,o)}if(l&1){let{unmount:u=!0,...d}=c;return Po(u?0:1,{0(){return null},1(){return pb({...d,hidden:!0,style:{display:"none"}},r,n,a,o)}})}return pb(c,r,n,a,o)}function pb(t,e={},r,n,i){let{as:s=r,children:a,refName:o="ref",...c}=Px(t,["unmount","static"]),l=t.ref!==void 0?{[o]:t.ref}:{},u=typeof a=="function"?a(e):a;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(e)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let d={};if(e){let f=!1,h=[];for(let[g,m]of Object.entries(e))typeof m=="boolean"&&(f=!0),m===!0&&h.push(g.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(f){d["data-headlessui-state"]=h.join(" ");for(let g of h)d[`data-${g}`]=""}}if(j1(s)&&(Object.keys(Ud(c)).length>0||Object.keys(Ud(d)).length>0))if(!C.isValidElement(u)||Array.isArray(u)&&u.length>1||QWe(u)){if(Object.keys(Ud(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(Ud(c)).concat(Object.keys(Ud(d))).map(f=>` - ${f}`).join(` 463`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(f=>` - ${f}`).join(` 464`)].join(` 465`))}else{let f=u.props,h=f==null?void 0:f.className,g=typeof h=="function"?(...b)=>Z7(h(...b),c.className):Z7(h,c.className),m=g?{className:g}:{},y=GJ(u.props,Ud(Px(c,["ref"])));for(let b in d)b in y&&delete d[b];return C.cloneElement(u,Object.assign({},y,d,l,{ref:i(KWe(u),l.ref)},m))}return C.createElement(s,Object.assign({},Px(c,["ref"]),!j1(s)&&l,!j1(s)&&d),u)}function HWe(){let t=C.useRef([]),e=C.useCallback(r=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return t.current=r,e}}function GWe(...t){return t.every(e=>e==null)?void 0:e=>{for(let r of t)r!=null&&(typeof r=="function"?r(e):r.current=e)}}function GJ(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];if(e.disabled||e["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[i=>{var s;return(s=i==null?void 0:i.preventDefault)==null?void 0:s.call(i)}]);for(let n in r)Object.assign(e,{[n](i,...s){let a=r[n];for(let o of a){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;o(i,...s)}}});return e}function KJ(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];for(let n in r)Object.assign(e,{[n](...i){let s=r[n];for(let a of s)a==null||a(...i)}});return e}function jn(t){var e;return Object.assign(C.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function Ud(t){let e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}function Px(t,e=[]){let r=Object.assign({},t);for(let n of e)n in r&&delete r[n];return r}function KWe(t){return Rt.version.split(".")[0]>="19"?t.props.ref:t.ref}function j1(t){return t===C.Fragment||t===Symbol.for("react.fragment")}function QWe(t){return j1(t.type)}let YWe="span";var Sw=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(Sw||{});function ZWe(t,e){var r;let{features:n=1,...i}=t,s={ref:e,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ei()({ourProps:s,theirProps:i,slot:{},defaultTag:YWe,name:"Hidden"})}let X7=jn(ZWe),XWe=C.createContext(void 0);function JWe(){return C.useContext(XWe)}function QJ(t){return typeof t!="object"||t===null?!1:"nodeType"in t}function yl(t){return QJ(t)&&"tagName"in t}function ma(t){return yl(t)&&"accessKey"in t}function ic(t){return yl(t)&&"tabIndex"in t}function eze(t){return yl(t)&&"style"in t}function tze(t){return ma(t)&&t.nodeName==="IFRAME"}function YJ(t){return ma(t)&&t.nodeName==="INPUT"}function wF(t){return ma(t)&&t.nodeName==="LABEL"}function rze(t){return ma(t)&&t.nodeName==="FIELDSET"}function ZJ(t){return ma(t)&&t.nodeName==="LEGEND"}function nze(t){return yl(t)?t.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function EF(t){let e=t.parentElement,r=null;for(;e&&!rze(e);)ZJ(e)&&(r=e),e=e.parentElement;let n=(e==null?void 0:e.getAttribute("disabled"))==="";return n&&ize(r)?!1:n}function ize(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(ZJ(e))return!1;e=e.previousElementSibling}return!0}let XJ=Symbol();function sze(t,e=!0){return Object.assign(t,{[XJ]:e})}function Es(...t){let e=C.useRef(t);C.useEffect(()=>{e.current=t},[t]);let r=rr(n=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return t.every(n=>n==null||(n==null?void 0:n[XJ]))?void 0:r}let nI=C.createContext(null);nI.displayName="DescriptionContext";function JJ(){let t=C.useContext(nI);if(t===null){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,JJ),e}return t}function eee(){let[t,e]=C.useState([]);return[t.length>0?t.join(" "):void 0,C.useMemo(()=>function(r){let n=rr(s=>(e(a=>[...a,s]),()=>e(a=>{let o=a.slice(),c=o.indexOf(s);return c!==-1&&o.splice(c,1),o}))),i=C.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return Rt.createElement(nI.Provider,{value:i},r.children)},[e])]}let aze="p";function oze(t,e){let r=C.useId(),n=HJ(),{id:i=`headlessui-description-${r}`,...s}=t,a=JJ(),o=Es(e);hn(()=>a.register(i),[i,a.register]);let c=Cc({...a.slot,disabled:n||!1}),l={ref:o,...a.props,id:i};return ei()({ourProps:l,theirProps:s,slot:c,defaultTag:aze,name:a.name||"Description"})}let cze=jn(oze),lze=Object.assign(cze,{});var yi=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(yi||{});let I5=C.createContext(null);I5.displayName="LabelContext";function iI(){let t=C.useContext(I5);if(t===null){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,iI),e}return t}function uze(t){var e,r,n;let i=(r=(e=C.useContext(I5))==null?void 0:e.value)!=null?r:void 0;return((n=void 0)!=null?n:0)>
4650?[i,...t].filter(Boolean).join(" "):i}function tee({inherit:t=!1}={}){let e=uze(),[r,n]=C.useState([]),i=t?[e,...r].filter(Boolean):r;return[i.length>0?i.join(" "):void 0,C.useMemo(()=>function(s){let a=rr(c=>(n(l=>[...l,c]),()=>n(l=>{let u=l.slice(),d=u.indexOf(c);return d!==-1&&u.splice(d,1),u}))),o=C.useMemo(()=>({register:a,slot:s.slot,name:s.name,props:s.props,value:s.value}),[a,s.slot,s.name,s.props,s.value]);return Rt.createElement(I5.Provider,{value:o},s.children)},[n])]}let dze="label";function fze(t,e){var r;let n=C.useId(),i=iI(),s=JWe(),a=HJ(),{id:o=`headlessui-label-${n}`,htmlFor:c=s??((r=i.props)==null?void 0:r.htmlFor),passive:l=!1,...u}=t,d=Es(e);hn(()=>i.register(o),[o,i.register]);let f=rr(m=>{let y=m.currentTarget;if(!(m.target!==m.currentTarget&&nze(m.target))&&(wF(y)&&m.preventDefault(),i.props&&"onClick"in i.props&&typeof i.props.onClick=="function"&&i.props.onClick(m),wF(y))){let b=document.getElementById(y.htmlFor);if(b){let E=b.getAttribute("disabled");if(E==="true"||E==="")return;let v=b.getAttribute("aria-disabled");if(v==="true"||v==="")return;(YJ(b)&&(b.type==="file"||b.type==="radio"||b.type==="checkbox")||b.role==="radio"||b.role==="checkbox"||b.role==="switch")&&b.click(),b.focus({preventScroll:!0})}}}),h=Cc({...i.slot,disabled:a||!1}),g={ref:d,...i.props,id:o,htmlFor:c,onClick:f};return l&&("onClick"in g&&(delete g.htmlFor,delete g.onClick),"onClick"in u&&delete u.onClick),ei()({ourProps:g,theirProps:u,slot:h,defaultTag:c?dze:"div",name:i.name||"Label"})}let hze=jn(fze);Object.assign(hze,{});let pze=C.createContext(()=>{});function gze({value:t,children:e}){return Rt.createElement(pze.Provider,{value:t},e)}function xF(t){if(t===null)return{width:0,height:0};let{width:e,height:r}=t.getBoundingClientRect();return{width:e,height:r}}function mze(t,e,r=!1){let[n,i]=C.useState(()=>xF(e));return hn(()=>{if(!e||!t)return;let s=Gs();return s.requestAnimationFrame(function a(){s.requestAnimationFrame(a),i(o=>{let c=xF(e);return c.width===o.width&&c.height===o.height?o:c})}),()=>{s.dispose()}},[e,t]),r?{width:`${n.width}px`,height:`${n.height}px`}:n}var ree=(t=>(t[t.Left=0]="Left",t[t.Right=2]="Right",t))(ree||{});function yze(t){let e=C.useRef(null),r=rr(i=>{e.current=i.pointerType,!EF(i.currentTarget)&&i.pointerType==="mouse"&&i.button===ree.Left&&(i.preventDefault(),t(i))}),n=rr(i=>{e.current!=="mouse"&&(EF(i.currentTarget)||t(i))});return{onPointerDown:r,onClick:n}}let nee=class extends Map{constructor(e){super(),this.factory=e}get(e){let r=super.get(e);return r===void 0&&(r=this.factory(e),this.set(e,r)),r}};var bze=Object.defineProperty,vze=(t,e,r)=>e in t?bze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wze=(t,e,r)=>(vze(t,e+"",r),r),iee=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},_a=(t,e,r)=>(iee(t,e,"read from private field"),r?r.call(t):e.get(t)),Ox=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},_F=(t,e,r,n)=>(iee(t,e,"write to private field"),e.set(t,r),r),Vo,f1,h1;let see=class{constructor(e){Ox(this,Vo,{}),Ox(this,f1,new nee(()=>new Set)),Ox(this,h1,new Set),wze(this,"disposables",Gs()),_F(this,Vo,e),hc.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return _a(this,Vo)}subscribe(e,r){if(hc.isServer)return()=>{};let n={selector:e,callback:r,current:e(_a(this,Vo))};return _a(this,h1).add(n),this.disposables.add(()=>{_a(this,h1).delete(n)})}on(e,r){return hc.isServer?()=>{}:(_a(this,f1).get(e).add(r),this.disposables.add(()=>{_a(this,f1).get(e).delete(r)}))}send(e){let r=this.reduce(_a(this,Vo),e);if(r!==_a(this,Vo)){_F(this,Vo,r);for(let n of _a(this,h1)){let i=n.selector(_a(this,Vo));aee(n.current,i)||(n.current=i,n.callback(i))}for(let n of _a(this,f1).get(e.type))n(_a(this,Vo),e)}}};Vo=new WeakMap,f1=new WeakMap,h1=new WeakMap;function aee(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null?!1:Array.isArray(t)&&Array.isArray(e)?t.length!==e.length?!1:Rx(t[Symbol.iterator](),e[Symbol.iterator]()):t instanceof Map&&e instanceof Map||t instanceof Set&&e instanceof Set?t.size!==e.size?!1:Rx(t.entries(),e.entries()):CF(t)&&CF(e)?Rx(Object.entries(t)[Symbol.iterator](),Object.entries(e)[Symbol.iterator]()):!1}function Rx(t,e){do{let r=t.next(),n=e.next();if(r.done&&n.done)return!0;
vendor: 4,951 bytes, lines 465-473
465if(r.done||n.done||!Object.is(r.value,n.value))return!1}while(!0)}function CF(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||Object.getPrototypeOf(e)===null}function SF(t){let[e,r]=t(),n=Gs();return(...i)=>{e(...i),n.dispose(),n.microTask(r)}}var Eze=Object.defineProperty,xze=(t,e,r)=>e in t?Eze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,AF=(t,e,r)=>(xze(t,typeof e!="symbol"?e+"":e,r),r),oee=(t=>(t[t.Push=0]="Push",t[t.Pop=1]="Pop",t))(oee||{});let _ze={0(t,e){let r=e.id,n=t.stack,i=t.stack.indexOf(r);if(i!==-1){let s=t.stack.slice();return s.splice(i,1),s.push(r),n=s,{...t,stack:n}}return{...t,stack:[...t.stack,r]}},1(t,e){let r=e.id,n=t.stack.indexOf(r);if(n===-1)return t;let i=t.stack.slice();return i.splice(n,1),{...t,stack:i}}},Cze=class cee extends see{constructor(){super(...arguments),AF(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),AF(this,"selectors",{isTop:(e,r)=>e.stack[e.stack.length-1]===r,inStack:(e,r)=>e.stack.includes(r)})}static new(){return new cee({stack:[]})}reduce(e,r){return Po(r.type,_ze,e,r)}};const k5=new nee(()=>Cze.new());var Dx={exports:{}},Mx={};/** 466 * @license React 467 * use-sync-external-store-with-selector.production.js 468 * 469 * Copyright (c) Meta Platforms, Inc. and affiliates. 470 * 471 * This source code is licensed under the MIT license found in the 472 * LICENSE file in the root directory of this source tree. 473 */var TF;function Sze(){if(TF)return Mx;TF=1;var t=CC();function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,o=t.useDebugValue;return Mx.useSyncExternalStoreWithSelector=function(c,l,u,d,f){var h=i(null);if(h.current===null){var g={hasValue:!1,value:null};h.current=g}else g=h.current;h=a(function(){function y(x){if(!b){if(b=!0,E=x,x=d(x),f!==void 0&&g.hasValue){var _=g.value;if(f(_,x))return v=_}return v=x}if(_=v,r(E,x))return _;var S=d(x);return f!==void 0&&f(_,S)?(E=x,_):(E=x,v=S)}var b=!1,E,v,w=u===void 0?null:u;return[function(){return y(l())},w===null?void 0:function(){return y(w())}]},[l,u,d,f]);var m=n(c,h[0],h[1]);return s(function(){g.hasValue=!0,g.value=m},[m]),o(m),m},Mx}var IF;function Aze(){return IF||(IF=1,Dx.exports=Sze()),Dx.exports}var Tze=Aze();function Pa(t,e,r=aee){return Tze.useSyncExternalStoreWithSelector(rr(n=>t.subscribe(Ize,n)),rr(()=>t.state),rr(()=>t.state),rr(e),r)}function Ize(t){return t}function i2(t,e){let r=C.useId(),n=k5.get(e),[i,s]=Pa(n,C.useCallback(a=>[n.selectors.isTop(a,r),n.selectors.inStack(a,r)],[n,r]));return hn(()=>{if(t)return n.actions.push(r),()=>n.actions.pop(r)},[n,t,r]),t?s?i:!0:!1}let J7=new Map,L1=new Map;function kF(t){var e;let r=(e=L1.get(t))!=null?e:0;return L1.set(t,r+1),r!==0?()=>$F(t):(J7.set(t,{"aria-hidden":t.getAttribute("aria-hidden"),inert:t.inert}),t.setAttribute("aria-hidden","true"),t.inert=!0,()=>$F(t))}function $F(t){var e;let r=(e=L1.get(t))!=null?e:1;if(r===1?L1.delete(t):L1.set(t,r-1),r!==1)return;let n=J7.get(t);n&&(n["aria-hidden"]===null?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",n["aria-hidden"]),t.inert=n.inert,J7.delete(t))}function lee(t,{allowed:e,disallowed:r}={}){let n=i2(t,"inert-others");hn(()=>{var i,s;if(!n)return;let a=Gs();for(let c of(i=r==null?void 0:r())!=null?i:[])c&&a.add(kF(c));let o=(s=e==null?void 0:e())!=null?s:[];for(let c of o){if(!c)continue;let l=gh(c);if(!l)continue;let u=c.parentElement;for(;u&&u!==l.body;){for(let d of u.children)o.some(f=>d.contains(f))||a.add(kF(d));u=u.parentElement}}return a.dispose},[n,e,r])}function uee(t,e,r){let n=yh(i=>{let s=i.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&r()});C.useEffect(()=>{if(!t)return;let i=e===null?null:ma(e)?e:e.current;if(!i)return;let s=Gs();if(typeof ResizeObserver<"u"){let a=new ResizeObserver(()=>n.current(i));a.observe(i),s.add(()=>a.disconnect())}if(typeof IntersectionObserver<"u"){let a=new IntersectionObserver(()=>n.current(i));a.observe(i),s.add(()=>a.disconnect())}return()=>s.dispose()},[e,n,t])}let Aw=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(t=>`${t}:not([tabindex='-1'])`).join(","),kze=["[data-autofocus]"].map(t=>`${t}:not([tabindex='-1'])`).join(",");var fo=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t[t.AutoFocus=64]="AutoFocus",t))(fo||{}),eC=(t=>(t[t.Error=0]="Error",t[t.Overflow=1]="Overflow",t[t.Success=2]="Success",t[t.Underflow=3]="Underflow",t))(eC||{}),$ze=(t=>(t[t.Previous=-1]="Previous",t[t.Next=1]="Next",t))($ze||{});function dee(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(Aw)).sort((e,r)=>
473Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}function Nze(t=document.body){return t==null?[]:Array.from(t.querySelectorAll(kze)).sort((e,r)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var sI=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(sI||{});function aI(t,e=0){var r;return t===((r=gh(t))==null?void 0:r.body)?!1:Po(e,{0(){return t.matches(Aw)},1(){let n=t;for(;n!==null;){if(n.matches(Aw))return!0;n=n.parentElement}return!1}})}function fee(t){Gs().nextFrame(()=>{let e=rI(t);e&&ic(e)&&!aI(e,0)&&pc(t)})}var Pze=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(Pze||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",t=>{t.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:t.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function pc(t){t==null||t.focus({preventScroll:!0})}let Oze=["textarea","input"].join(",");function Rze(t){var e,r;return(r=(e=t==null?void 0:t.matches)==null?void 0:e.call(t,Oze))!=null?r:!1}function hee(t,e=r=>r){return t.slice().sort((r,n)=>{let i=e(r),s=e(n);if(i===null||s===null)return 0;let a=i.compareDocumentPosition(s);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Dze(t,e,r=t===null?document.body:Cw(t)){return Sp(dee(r),e,{relativeTo:t})}function Sp(t,e,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let s=Array.isArray(t)?t.length>0?Cw(t[0]):document:Cw(t),a=Array.isArray(t)?r?hee(t):t:e&64?Nze(t):dee(t);i.length>0&&a.length>1&&(a=a.filter(h=>!i.some(g=>g!=null&&"current"in g?(g==null?void 0:g.current)===h:g===h))),n=n??(s==null?void 0:s.activeElement);let o=(()=>{if(e&5)return 1;if(e&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(e&1)return 0;if(e&2)return Math.max(0,a.indexOf(n))-1;if(e&4)return Math.max(0,a.indexOf(n))+1;if(e&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=e&32?{preventScroll:!0}:{},u=0,d=a.length,f;do{if(u>=d||u+d<=0)return 0;let h=c+u;if(e&16)h=(h+d)%d;else{if(h<0)return 3;if(h>=d)return 1}f=a[h],f==null||f.focus(l),u+=o}while(f!==rI(f));return e&6&&Rze(f)&&f.select(),2}function pee(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Mze(){return/Android/gi.test(window.navigator.userAgent)}function NF(){return pee()||Mze()}function ap(t,e,r,n){let i=yh(r);C.useEffect(()=>{if(!t)return;function s(a){i.current(a)}return document.addEventListener(e,s,n),()=>document.removeEventListener(e,s,n)},[t,e,n])}function gee(t,e,r,n){let i=yh(r);C.useEffect(()=>{if(!t)return;function s(a){i.current(a)}return window.addEventListener(e,s,n),()=>window.removeEventListener(e,s,n)},[t,e,n])}const PF=30;function mee(t,e,r){let n=yh(r),i=C.useCallback(function(o,c){if(o.defaultPrevented)return;let l=c(o);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=(function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]})(e);for(let d of u)if(d!==null&&(d.contains(l)||o.composed&&o.composedPath().includes(d)))return;return!aI(l,sI.Loose)&&l.tabIndex!==-1&&o.preventDefault(),n.current(o,l)},[n,e]),s=C.useRef(null);ap(t,"pointerdown",o=>{var c,l;NF()||(s.current=((l=(c=o.composedPath)==null?void 0:c.call(o))==null?void 0:l[0])||o.target)},!0),ap(t,"pointerup",o=>{if(NF()||!s.current)return;let c=s.current;return s.current=null,i(o,()=>c)},!0);let a=C.useRef({x:0,y:0});ap(t,"touchstart",o=>{a.current.x=o.touches[0].clientX,a.current.y=o.touches[0].clientY},!0),ap(t,"touchend",o=>{let c={x:o.changedTouches[0].clientX,y:o.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=PF||Math.abs(c.y-a.current.y)>=PF))return i(o,()=>ic(o.target)?o.target:null)},!0),gee(t,"blur",o=>i(o,()=>tze(window.document.activeElement)?window.document.activeElement:null),!0)}function Km(...t){return C.useMemo(()=>gh(...t),[...t])}var jze=(t=>(t[t.Ignore=0]="Ignore",t[t.Select=1]="Select",t[t.Close=2]="Close",t))(jze||{});const gb={Ignore:{kind:0},Select:t=>({kind:1,target:t}),Close:{kind:2}},Lze=200,OF=5;function Fze(t,{trigger:e,action:r,close:n,select:i}){let s=C.useRef(null),a=C.useRef(null),o=C.useRef(null);ap(t&&e!==null,"pointerdown",c=>{QJ(c==null?void 0:c.target)&&e!=null&&e.contains(c.target)&&(a.current=c.x,o.current=c.y,s.current=c.timeStamp)}),ap(t&&e!==null,"pointerup",c=>{var l,u;let d=s.current;if(d===null||(s.current=null,!ic(c.target))||Math.abs(c.x-((l=a.current)!=null?l:c.x))<OF&&Math.abs(c.y-((u=o.current)!=null?u:c.y)
vendor: 4,139 bytes, line 473
473)<OF)return;let f=r(c);switch(f.kind){case 0:return;case 1:{c.timeStamp-d>Lze&&(i(f.target),n());break}case 2:{n();break}}},{capture:!0})}function yee(t,e,r,n){let i=yh(r);C.useEffect(()=>{t=t??window;function s(a){i.current(a)}return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s,n)},[t,e,n])}function Uze(t,e){return C.useMemo(()=>{var r;if(t.type)return t.type;let n=(r=t.as)!=null?r:"button";if(typeof n=="string"&&n.toLowerCase()==="button"||(e==null?void 0:e.tagName)==="BUTTON"&&!e.hasAttribute("type"))return"button"},[t.type,t.as,e])}function Bze(t){return C.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}function qze(t,e){let r=t(),n=new Set;return{getSnapshot(){return r},subscribe(i){return n.add(i),()=>n.delete(i)},dispatch(i,...s){let a=e[i].call(r,...s);a&&(r=a,n.forEach(o=>o()))}}}function Wze(){let t;return{before({doc:e}){var r;let n=e.documentElement,i=(r=e.defaultView)!=null?r:window;t=Math.max(0,i.innerWidth-n.clientWidth)},after({doc:e,d:r}){let n=e.documentElement,i=Math.max(0,n.clientWidth-n.offsetWidth),s=Math.max(0,t-i);r.style(n,"paddingRight",`${s}px`)}}}function zze(){return pee()?{before({doc:t,d:e,meta:r}){function n(i){for(let s of r().containers)for(let a of s())if(a.contains(i))return!0;return!1}e.microTask(()=>{var i;if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let o=Gs();o.style(t.documentElement,"scrollBehavior","auto"),e.add(()=>e.microTask(()=>o.dispose()))}let s=(i=window.scrollY)!=null?i:window.pageYOffset,a=null;e.addEventListener(t,"click",o=>{if(ic(o.target))try{let c=o.target.closest("a");if(!c)return;let{hash:l}=new URL(c.href),u=t.querySelector(l);ic(u)&&!n(u)&&(a=u)}catch{}},!0),e.group(o=>{e.addEventListener(t,"touchstart",c=>{if(o.dispose(),ic(c.target)&&eze(c.target))if(n(c.target)){let l=c.target;for(;l.parentElement&&n(l.parentElement);)l=l.parentElement;o.style(l,"overscrollBehavior","contain")}else o.style(c.target,"touchAction","none")})}),e.addEventListener(t,"touchmove",o=>{if(ic(o.target)){if(YJ(o.target))return;if(n(o.target)){let c=o.target;for(;c.parentElement&&c.dataset.headlessuiPortal!==""&&!(c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth);)c=c.parentElement;c.dataset.headlessuiPortal===""&&o.preventDefault()}else o.preventDefault()}},{passive:!1}),e.add(()=>{var o;let c=(o=window.scrollY)!=null?o:window.pageYOffset;s!==c&&window.scrollTo(0,s),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Vze(){return{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}}function RF(t){let e={};for(let r of t)Object.assign(e,r(e));return e}let nf=qze(()=>new Map,{PUSH(t,e){var r;let n=(r=this.get(t))!=null?r:{doc:t,count:0,d:Gs(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(e),n.computedMeta=RF(n.meta),this.set(t,n),this},POP(t,e){let r=this.get(t);return r&&(r.count--,r.meta.delete(e),r.computedMeta=RF(r.meta)),this},SCROLL_PREVENT(t){let e={doc:t.doc,d:t.d,meta(){return t.computedMeta}},r=[zze(),Wze(),Vze()];r.forEach(({before:n})=>n==null?void 0:n(e)),r.forEach(({after:n})=>n==null?void 0:n(e))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});nf.subscribe(()=>{let t=nf.getSnapshot(),e=new Map;for(let[r]of t)e.set(r,r.documentElement.style.overflow);for(let r of t.values()){let n=e.get(r.doc)==="hidden",i=r.count!==0;(i&&!n||!i&&n)&&nf.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&nf.dispatch("TEARDOWN",r)}});function Hze(t,e,r=()=>({containers:[]})){let n=Bze(nf),i=e?n.get(e):void 0,s=i?i.count>0:!1;return hn(()=>{if(!(!e||!t))return nf.dispatch("PUSH",e,r),()=>nf.dispatch("POP",e,r)},[t,e]),s}function bee(t,e,r=()=>[document.body]){let n=i2(t,"scroll-lock");Hze(n,e,i=>{var s;return{containers:[...(s=i.containers)!=null?s:[],r]}})}function DF(t){return[t.screenX,t.screenY]}function Gze(){let t=C.useRef([-1,-1]);return{wasMoved(e){let r=DF(e);return t.current[0]===r[0]&&t.current[1]===r[1]?!1:(t.current=r,!0)},update(e){t.current=DF(e)}}}function Kze(t=0){let[e,r]=C.useState(t),n=C.useCallback(c=>r(c),[]),i=C.useCallback(c=>r(l=>l|c),[]),s=C.useCallback(c=>
473(e&c)===c,[e]),a=C.useCallback(c=>r(l=>l&~c),[]),o=C.useCallback(c=>r(l=>l^c),[]);return{flags:e,setFlag:n,addFlag:i,hasFlag:s,removeFlag:a,toggleFlag:o}}var Qze={NVM_INC:"/Users/geralt.dao/.nvm/versions/node/v18.17.1/include/node",TERM_PROGRAM:"vscode",VSCODE_GIT_IPC_AUTH_TOKEN:"bcb4b3bf72c7ae72f3903d1f04be54e95b548a98128534518bd9701ab75054bf",NODE:"/opt/homebrew/Cellar/node/24.8.0/bin/node",NVM_CD_FLAGS:"-q",ANDROID_HOME:"/Users/geralt.dao/Library/Android/sdk",GEMINI_CLI_IDE_WORKSPACE_PATH:"/Users/geralt.dao/hola-tech/botdex-interface",INIT_CWD:"/Users/geralt.dao/hola-tech/botdex-interface",SHELL:"/bin/zsh",TERM:"xterm-256color",TMPDIR:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",TERM_PROGRAM_VERSION:"2.6.19",npm_config_npm_globalconfig:"/opt/homebrew/Cellar/node/24.8.0/etc/npmrc",MallocNanoZone:"0",CURSOR_TRACE_ID:"c7e1f3f6815a4d849e5f973acf0a80f4",ZDOTDIR:"/Users/geralt.dao",npm_config_registry:"https://registry.npmjs.org/",ZSH:"/Users/geralt.dao/.oh-my-zsh",ENABLE_IDE_INTEGRATION:"true",USER:"geralt.dao",NVM_DIR:"/Users/geralt.dao/.nvm",LS_COLORS:"di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43",COMMAND_MODE:"unix2003",npm_config_globalconfig:"/Users/geralt.dao/Library/Preferences/pnpm/rc",PNPM_SCRIPT_SRC_DIR:"/Users/geralt.dao/hola-tech/botdex-interface",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.mwgQRp7Nkf/Listeners",CLAUDE_CODE_SSE_PORT:"56099",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",VSCODE_PROFILE_INITIALIZED:"1",npm_execpath:"/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/bin/pnpm.cjs",PAGER:"less",LSCOLORS:"Gxfxcxdxbxegedabagacad",npm_config_frozen_lockfile:"",npm_config_verify_deps_before_run:"false",PATH:"/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.bin:/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/dist/node-gyp-bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/[email protected]/bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/postgresql@15/bin:/Users/geralt.dao/.amplify/bin:/Users/geralt.dao/.bun/bin:/opt/homebrew/bin:/Users/geralt.dao/.codeium/windsurf/bin:/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/pmk/env/global/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Users/geralt.dao/.antigravity/antigravity/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/postgresql@15/bin:/Users/geralt.dao/.amplify/bin:/Users/geralt.dao/.local/bin:/Users/geralt.dao/.bun/bin:/Users/geralt.dao/.codeium/windsurf/bin:/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/geralt.dao/go/bin:/Users/geralt.dao/Library/Android/sdk/emulator:/Users/geralt.dao/Library/Android/sdk/platform-tools:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/geralt.dao/go/bin:/Users/geralt.dao/Library/Android/sdk/emulator:/Users/geralt.dao/Library/Android/sdk/platform-tools",LaunchInstanceID:"B31E047D-3F24-4B63-AFE7-D9CC50F0BC74",npm_package_json:"/Users/geralt.dao/hola-tech/botdex-interface/package.json",__CFBundleIdentifier:"com.todesktop.230313mzl4w4u92",USER_ZDOTDIR:"/Users/geralt.dao",PWD:"/Users/geralt.dao/hola-tech/botdex-interface",npm_command:"run-script",JAVA_HOME:"/Users/geralt.dao/Library/Java/JavaVirtualMachines/openjdk-21.0.1/Contents/Home",npm_config__jsr_registry:"https://npm.jsr.io/",npm_lifecycle_event:"build",LANG:"C.UTF-8",npm_package_name:"universe",NODE_PATH:"/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/bin/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/vite/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules:/Users/geralt.dao/hola-tech/botdex-interface/node_modules/.pnpm/node_modules",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",GEMINI_CLI_IDE_AUTH_TOKEN:"ffcaa9c2-67ff-44aa-8784-f1f830770ce9",npm_config_node_gyp:"/opt/homebrew/Cellar/pnpm/10.26.2/libexec/lib/node_modules/pnpm/dist/node_modules/node-gyp/bin/node-gyp.js",XPC_SERVICE_NAME:"0",pnpm_config_verify_deps_before_run:"false",VSCODE_INJECTION:"1",HOME:"/Users/geralt.dao",SHLVL:"2",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Cursor.a
473pp/Contents/Resources/app/extensions/git/dist/askpass-main.js",HOMEBREW_PREFIX:"/opt/homebrew",GK_GL_ADDR:"http://127.0.0.1:55023",LOGNAME:"geralt.dao",LESS:"-R",npm_lifecycle_script:"vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/vscode-git-106008ff40.sock",GK_GL_PATH:"/var/folders/dx/x7nyh6pn20l3lthw9fm0__r00000gn/T/gitkraken/gitlens/gitlens-ipc-server-1774-55023.json",NVM_BIN:"/Users/geralt.dao/.nvm/versions/node/v18.17.1/bin",BUN_INSTALL:"/Users/geralt.dao/.bun",GEMINI_CLI_IDE_SERVER_PORT:"55024",npm_config_user_agent:"pnpm/10.26.2 npm/? node/v24.8.0 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Cursor.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Cursor.app/Contents/Frameworks/Cursor Helper (Plugin).app/Contents/MacOS/Cursor Helper (Plugin)",OSLogRateLimit:"64",SECURITYSESSIONID:"186af",COLORTERM:"truecolor",npm_node_execpath:"/opt/homebrew/Cellar/node/24.8.0/bin/node",NODE_ENV:"production",VITE_APP_URL_API:"https://api.godex.ai/api",VITE_APP_SOCKET:"https://api.godex.ai",VITE_APP_DEFAUL_CHAIN_ID:"42161",VITE_APP_PRIVY_APP_ID:"clxlnrvzy073ll6yvy1b6lcko",VITE_APP_BLOCKPASS_CLIENT_ID:"godexai_24fd5",VITE_APP_BOT_NAME:"godex_ai_bot",VITE_APP_GET_STREAM_API_KEY:"twfjd2y6asta",VITE_APP_LEDGER_ADDRESS:"0x34EC5aC5B0074e9385d8d4d4A43a478c0FBA1f5d",VITE_APP_SECRET_KEY:"http://localhost:3456/api",VITE_APP_AWS_API_ENDPOINT:"https://gateway-arbitrum.network.thegraph.com/api/d762176fa97a19cbfec853f321540d1f/subgraphs/id/35AYsvtJ7SjD93JZcjHK7KTSFyC8h74YHkg2hTxRsRer",VITE_APP_AWS_REALTIME_ENDPOINT:"wss://beta.realtime.gateway.uniswap.org/graphql",VITE_APP_AWS_REALTIME_TOKEN:"realtime-3DDE0DA0-3408-4FD0-9DC3-5E285D70D29C",VITE_APP_GODEX_SUBGRAPH:"https://api.studio.thegraph.com/query/69483/godex-trading/version/latest",VITE_APP_SUBGRAPH_API_KEY:"0bdfb5369a3f673c2f4d7b07fdc47356 6d1aad6c2bd525626fe78c662c0b99b1 f2182b8d85650307efdc7ee5f5e928d5 d762176fa97a19cbfec853f321540d1f 4d180b6f0318804bca6bad7a412df4e3",VITE_APP_IS_UNISWAP_INTERFACE:"true",VITE_APP_VAPID_KEY:"BEaejLMlaWDuAcFbg_J0Lxj3-32rU8dl9MiGmE58mW1DmNxZrIwPwUQSS6vMYdpjG1x7DUBNI83Y5Rz2pO4SulU",VITE_FIREBASE_APIKEY:"AIzaSyBg8UnAtHTYw0EI1F6L_6awN5c7tkekWE4",VITE_FIREBASE_AUTH_DOMAIN:"notifi-e7ddc.firebaseapp.com",VITE_FIREBASE_PJ_ID:"notifi-e7ddc",VITE_FIREBASE_STORAGE_BUCKET:"notifi-e7ddc.appspot.com",VITE_FIREBASE_MESSAGING_SENDER_ID:"595100990974",VITE_FIREBASE_APP_ID:"1:595100990974:web:8de8a14f57642af6c154af",VITE_APP_INTERGRATOR_ID:"btcw.tech-fd0e21e7-dc58-45ef-aabc-3141ed135e65",VITE_COINGECKO_API_KEY:"CG-C457Em1XmWjRS2d2gXUBBJ5V"},MF,jF;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((MF=process==null?void 0:Qze)==null?void 0:MF.NODE_ENV)==="test"&&typeof((jF=Element==null?void 0:Element.prototype)==null?void 0:jF.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(` 474`)),[]});var Yze=(t=>(t[t.None=0]="None",t[t.Closed=1]="Closed",t[t.Enter=2]="Enter",t[t.Leave=4]="Leave",t))(Yze||{});function vee(t){let e={};for(let r in t)t[r]===!0&&(e[`data-${r}`]="");return e}function wee(t,e,r,n){let[i,s]=C.useState(r),{hasFlag:a,addFlag:o,removeFlag:c}=Kze(t&&i?3:0),l=C.useRef(!1),u=C.useRef(!1),d=mh();return hn(()=>{var f;if(t){if(r&&s(!0),!e){r&&o(3);return}return(f=n==null?void 0:n.start)==null||f.call(n,r),Zze(e,{inFlight:l,prepare(){u.current?u.current=!1:u.current=l.current,l.current=!0,!u.current&&(r?(o(3),c(4)):(o(4),c(2)))},run(){u.current?r?(c(3),o(4)):(c(4),o(3)):r?c(1):o(1)},done(){var h;u.current&&eVe(e)||(l.current=!1,c(7),r||s(!1),(h=n==null?void 0:n.end)==null||h.call(n,r))}})}},[t,r,e,d]),t?[i,{closed:a(1),enter:a(2),leave:a(4),transition:a(2)||a(4)}]:[r,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Zze(t,{prepare:e,run:r,done:n,inFlight:i}){let s=Gs();return Jze(t,{prepare:e,inFlight:i}),s.nextFrame(()=>{r(),s.requestAnimationFrame(()=>{s.add(Xze(t,n))})}),s.dispose}function Xze(t,e){var r,n;let i=Gs();if(!t)return i.dispose;let s=!1;i.add(()=>{s=!0});let a=(n=(r=t.getAnimations)==null?void 0:r.call(t).filter(o=>o instanceof CSSTransition))!=null?n:[];return a.length===0?(e(),i.dispose):(Promise.allSettled(a.map(o=>o.finished)).then(()=>{s||e()}),i.dispose)}function Jze(t,{inFlight:e,prepare:r}){if(e!=null&&e.current){r();return}let n=t.style.transition;t.style.transition="none",r(),t.offsetHeight,t.style.transition=n}function eVe(t){var e,r;return((r=(e=t.getAnimations)==null?void 0:e.call(t))!=null?r:[]).some(n=>n instanceof CSSTransition&&n.playState!=="finished")}function tVe(t,{container:e,accept:r,walk:n}){let i=C.useRef(r),s=C.useRef(n);C.useEffect(()=>{i.current=r,s.current=n},[r,n]),hn(()=>
474{if(!e||!t)return;let a=gh(e);if(!a)return;let o=i.current,c=s.current,l=Object.assign(d=>o(d),{acceptNode:o}),u=a.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,l,!1);for(;u.nextNode();)c(u.currentNode)},[e,t,i,s])}function oI(t,e){let r=C.useRef([]),n=rr(t);C.useEffect(()=>{let i=[...r.current];for(let[s,a]of e.entries())if(r.current[s]!==a){let o=n(e,i);return r.current=e,o}},[n,...e])}function $5(){return typeof window<"u"}function V0(t){return Eee(t)?(t.nodeName||"").toLowerCase():"#document"}function la(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sc(t){var e;return(e=(Eee(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Eee(t){return $5()?t instanceof Node||t instanceof la(t).Node:!1}function hs(t){return $5()?t instanceof Element||t instanceof la(t).Element:!1}function Hl(t){return $5()?t instanceof HTMLElement||t instanceof la(t).HTMLElement:!1}function LF(t){return!$5()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof la(t).ShadowRoot}function s2(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Oo(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&i!=="inline"&&i!=="contents"}function rVe(t){return/^(table|td|th)$/.test(V0(t))}function N5(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const nVe=/transform|translate|scale|rotate|perspective|filter/,iVe=/paint|layout|strict|content/,Rd=t=>!!t&&t!=="none";let jx;function cI(t){const e=hs(t)?Oo(t):t;return Rd(e.transform)||Rd(e.translate)||Rd(e.scale)||Rd(e.rotate)||Rd(e.perspective)||!lI()&&(Rd(e.backdropFilter)||Rd(e.filter))||nVe.test(e.willChange||"")||iVe.test(e.contain||"")}function sVe(t){let e=td(t);for(;Hl(e)&&!h0(e);){if(cI(e))return e;if(N5(e))return null;e=td(e)}return null}function lI(){return jx==null&&(jx=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),jx}function h0(t){return/^(html|body|#document)$/.test(V0(t))}function Oo(t){return la(t).getComputedStyle(t)}function P5(t){return hs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function td(t){if(V0(t)==="html")return t;const e=t.assignedSlot||t.parentNode||LF(t)&&t.host||Sc(t);return LF(e)?e.host:e}function xee(t){const e=td(t);return h0(e)?t.ownerDocument?t.ownerDocument.body:t.body:Hl(e)&&s2(e)?e:xee(e)}function Qm(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=xee(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),a=la(i);if(s){const o=tC(a);return e.concat(a,a.visualViewport||[],s2(i)?i:[],o&&r?Qm(o):[])}else return e.concat(i,Qm(i,[],r))}function tC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function aVe(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:r,version:n}=e;return r+"/"+n}).join(" "):navigator.userAgent}const Wf=Math.min,Ji=Math.max,Ym=Math.round,mb=Math.floor,gc=t=>({x:t,y:t}),oVe={left:"right",right:"left",bottom:"top",top:"bottom"};function FF(t,e,r){return Ji(t,Wf(e,r))}function H0(t,e){return typeof t=="function"?t(e):t}function rd(t){return t.split("-")[0]}function a2(t){return t.split("-")[1]}function _ee(t){return t==="x"?"y":"x"}function Cee(t){return t==="y"?"height":"width"}function ol(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function See(t){return _ee(ol(t))}function cVe(t,e,r){r===void 0&&(r=!1);const n=a2(t),i=See(t),s=Cee(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(a=Tw(a)),[a,Tw(a)]}function lVe(t){const e=Tw(t);return[rC(t),e,rC(e)]}function rC(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const UF=["left","right"],BF=["right","left"],uVe=["top","bottom"],dVe=["bottom","top"];function fVe(t,e,r){switch(t){case"top":case"bottom":return r?e?BF:UF:e?UF:BF;case"left":case"right":return e?uVe:dVe;default:return[]}}function hVe(t,e,r,n){const i=a2(t);let s=fVe(rd(t),r==="start",n);return i&&(s=s.map(a=>a+"-"+i),e&&(s=s.concat(s.map(rC)))),s}function Tw(t){const e=rd(t);return oVe[e]+t.slice(e.length)}function pVe(t){return{top:0,right:0,bottom:0,left:0,...t}}function gVe(t){return typeof t!="number"?pVe(t):{top:t,right:t,bottom:t,left:t}}function Iw(t){const{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function qF(t,e,r){let{reference:n,floating:i}=t;const s=ol(e),a=See(e),o=Cee(a),c=rd(e),l=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[o]/2-i[o]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-i.width,y:d};break;default:h={x:n.x,y:n.y}}switch(a2(e)){case"start":h[a]-=f*(r&&l?-1:1);break;case"end":h[a]+=f*(r&&l?-1:1);break}return h}async function Aee(t,e){var r;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:a,elements:o,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=H0(e,t),g=gVe(h),y=o[f?d==="floating"?"reference":"floating":d],b=Iw(await s.getClippingRect
vendor: 5,475 bytes, line 474
474({element:(r=await(s.isElement==null?void 0:s.isElement(y)))==null||r?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),E=d==="floating"?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),w=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},x=Iw(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:E,offsetParent:v,strategy:c}):E);return{top:(b.top-x.top+g.top)/w.y,bottom:(x.bottom-b.bottom+g.bottom)/w.y,left:(b.left-x.left+g.left)/w.x,right:(x.right-b.right+g.right)/w.x}}const mVe=50,yVe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a}=r,o=a.detectOverflow?a:{...a,detectOverflow:Aee},c=await(a.isRTL==null?void 0:a.isRTL(e));let l=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=qF(l,n,c),f=n,h=0;const g={};for(let m=0;m<s.length;m++){const y=s[m];if(!y)continue;const{name:b,fn:E}=y,{x:v,y:w,data:x,reset:_}=await E({x:u,y:d,initialPlacement:n,placement:f,strategy:i,middlewareData:g,rects:l,platform:o,elements:{reference:t,floating:e}});u=v??u,d=w??d,g[b]={...g[b],...x},_&&h<mVe&&(h++,typeof _=="object"&&(_.placement&&(f=_.placement),_.rects&&(l=_.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:i}):_.rects),{x:u,y:d}=qF(l,f,c)),m=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:g}},bVe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:c,elements:l}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...y}=H0(t,e);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const b=rd(i),E=ol(o),v=rd(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(v||!m?[Tw(o)]:lVe(o)),_=g!=="none";!f&&_&&x.push(...hVe(o,m,g,w));const S=[o,...x],A=await c.detectOverflow(e,y),I=[];let $=((n=s.flip)==null?void 0:n.overflows)||[];if(u&&I.push(A[b]),d){const B=cVe(i,a,w);I.push(A[B[0]],A[B[1]])}if($=[...$,{placement:i,overflows:I}],!I.every(B=>B<=0)){var P,j;const B=(((P=s.flip)==null?void 0:P.index)||0)+1,k=S[B];if(k&&(!(d==="alignment"?E!==ol(k):!1)||$.every(U=>ol(U.placement)===E?U.overflows[0]>0:!0)))return{data:{index:B,overflows:$},reset:{placement:k}};let D=(j=$.filter(q=>q.overflows[0]<=0).sort((q,U)=>q.overflows[1]-U.overflows[1])[0])==null?void 0:j.placement;if(!D)switch(h){case"bestFit":{var L;const q=(L=$.filter(U=>{if(_){const W=ol(U.placement);return W===E||W==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(W=>W>0).reduce((W,V)=>W+V,0)]).sort((U,W)=>U[1]-W[1])[0])==null?void 0:L[0];q&&(D=q);break}case"initialPlacement":D=o;break}if(i!==D)return{reset:{placement:D}}}return{}}}},vVe=new Set(["left","top"]);async function wVe(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=rd(r),o=a2(r),c=ol(r)==="y",l=vVe.has(a)?-1:1,u=s&&c?-1:1,d=H0(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof g=="number"&&(h=o==="end"?g*-1:g),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const EVe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:i,y:s,placement:a,middlewareData:o}=e,c=await wVe(e,t);return a===((r=o.offset)==null?void 0:r.placement)&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},xVe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i,platform:s}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:c={fn:b=>{let{x:E,y:v}=b;return{x:E,y:v}}},...l}=H0(t,e),u={x:r,y:n},d=await s.detectOverflow(e,l),f=ol(rd(i)),h=_ee(f);let g=u[h],m=u[f];if(a){const b=h==="y"?"top":"left",E=h==="y"?"bottom":"right",v=g+d[b],w=g-d[E];g=FF(v,g,w)}if(o){const b=f==="y"?"top":"left",E=f==="y"?"bottom":"right",v=m+d[b],w=m-d[E];m=FF(v,m,w)}const y=c.fn({...e,[h]:g,[f]:m});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[h]:a,[f]:o}}}}}},_Ve=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:i,rects:s,platform:a,elements:o}=e,{apply:c=()=>{},...l}=H0(t,e),u=await a.detectOverflow(e,l),d=rd(i),f=a2(i),h=ol(i)==="y",{width:g,height:m}=s.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,y=f==="end"?"top":"bottom");const E=m-u.top-u.bottom,v=g-u.left-u.right,w=Wf(m-u[y],E),x=Wf(g-u[b],v),_=!e.middlewareData.shift;let S=w,A=x;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(A=v),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(S=E),_&&!f){const $=Ji(u.left,0),P=Ji(u.right,0),j=Ji(u.top,0),L=Ji(u.bottom,0);h?A=g-2*($!==0||P!==0?$+P:Ji(u.left,u.right)):S=m-2*(j!==0||L!==0?j+L:Ji(u.top,u.bottom))}await c({...e,availableWidth:A,availableHeight:S});const I=await a.getDimensions(o.floating);return g!==I.width||m!==I.height?{reset:{rects:!0}}:{}}}};function Tee(t){const e=Oo(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Hl(t),s=i?t.offsetWidth:r,a=i?t.offsetHeight:n,o=Ym(r)!==s||Ym(n)!==a;
vendor: 5,279 bytes, line 474
474return o&&(r=s,n=a),{width:r,height:n,$:o}}function uI(t){return hs(t)?t:t.contextElement}function Ap(t){const e=uI(t);if(!Hl(e))return gc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=Tee(e);let a=(s?Ym(r.width):r.width)/n,o=(s?Ym(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const CVe=gc(0);function Iee(t){const e=la(t);return!lI()||!e.visualViewport?CVe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function SVe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==la(t)?!1:e}function zf(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=uI(t);let a=gc(1);e&&(n?hs(n)&&(a=Ap(n)):a=Ap(t));const o=SVe(s,r,n)?Iee(s):gc(0);let c=(i.left+o.x)/a.x,l=(i.top+o.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(s){const f=la(s),h=n&&hs(n)?la(n):n;let g=f,m=tC(g);for(;m&&n&&h!==g;){const y=Ap(m),b=m.getBoundingClientRect(),E=Oo(m),v=b.left+(m.clientLeft+parseFloat(E.paddingLeft))*y.x,w=b.top+(m.clientTop+parseFloat(E.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=v,l+=w,g=la(m),m=tC(g)}}return Iw({width:u,height:d,x:c,y:l})}function O5(t,e){const r=P5(t).scrollLeft;return e?e.left+r:zf(Sc(t)).left+r}function kee(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-O5(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function AVe(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t;const s=i==="fixed",a=Sc(n),o=e?N5(e.floating):!1;if(n===a||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=gc(1);const u=gc(0),d=Hl(n);if((d||!d&&!s)&&((V0(n)!=="body"||s2(a))&&(c=P5(n)),d)){const h=zf(n);l=Ap(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const f=a&&!d&&!s?kee(a,c):gc(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:r.y*l.y-c.scrollTop*l.y+u.y+f.y}}function TVe(t){return Array.from(t.getClientRects())}function IVe(t){const e=Sc(t),r=P5(t),n=t.ownerDocument.body,i=Ji(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Ji(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+O5(t);const o=-r.scrollTop;return Oo(n).direction==="rtl"&&(a+=Ji(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:a,y:o}}const WF=25;function kVe(t,e){const r=la(t),n=Sc(t),i=r.visualViewport;let s=n.clientWidth,a=n.clientHeight,o=0,c=0;if(i){s=i.width,a=i.height;const u=lI();(!u||u&&e==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}const l=O5(n);if(l<=0){const u=n.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(n.clientWidth-d.clientWidth-h);g<=WF&&(s-=g)}else l<=WF&&(s+=l);return{width:s,height:a,x:o,y:c}}function $Ve(t,e){const r=zf(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Hl(t)?Ap(t):gc(1),a=t.clientWidth*s.x,o=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:a,height:o,x:c,y:l}}function zF(t,e,r){let n;if(e==="viewport")n=kVe(t,r);else if(e==="document")n=IVe(Sc(t));else if(hs(e))n=$Ve(e,r);else{const i=Iee(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Iw(n)}function $ee(t,e){const r=td(t);return r===e||!hs(r)||h0(r)?!1:Oo(r).position==="fixed"||$ee(r,e)}function NVe(t,e){const r=e.get(t);if(r)return r;let n=Qm(t,[],!1).filter(o=>hs(o)&&V0(o)!=="body"),i=null;const s=Oo(t).position==="fixed";let a=s?td(t):t;for(;hs(a)&&!h0(a);){const o=Oo(a),c=cI(a);!c&&o.position==="fixed"&&(i=null),(s?!c&&!i:!c&&o.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||s2(a)&&!c&&$ee(t,a))?n=n.filter(u=>u!==a):i=o,a=td(a)}return e.set(t,n),n}function PVe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const a=[...r==="clippingAncestors"?N5(e)?[]:NVe(e,this._c):[].concat(r),n],o=zF(e,a[0],i);let c=o.top,l=o.right,u=o.bottom,d=o.left;for(let f=1;f<a.length;f++){const h=zF(e,a[f],i);c=Ji(h.top,c),l=Wf(h.right,l),u=Wf(h.bottom,u),d=Ji(h.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function OVe(t){const{width:e,height:r}=Tee(t);return{width:e,height:r}}function RVe(t,e,r){const n=Hl(e),i=Sc(e),s=r==="fixed",a=zf(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=gc(0);function l(){c.x=O5(i)}if(n||!n&&!s)if((V0(e)!=="body"||s2(i))&&(o=P5(e)),n){const h=zf(e,!0,s,e);c.x=h.x+e.clientLeft,c.y=h.y+e.clientTop}else i&&l();s&&!n&&i&&l();const u=i&&!n&&!s?kee(i,o):gc(0),d=a.left+o.scrollLeft-c.x-u.x,f=a.top+o.scrollTop-c.y-u.y;return{x:d,y:f,width:a.width,height:a.height}}function Lx(t){return Oo(t).position==="static"}function VF(t,e){if(!Hl(t)||Oo(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Sc(t)===r&&(r=r.ownerDocument.body),r}function Nee(t,e){const r=la(t);if(N5(t))return r;if(!Hl(t)){let i=td(t);for(;i&&!h0(i);){if(hs(i)&&!Lx(i))return i;i=td(i)}return r}let n=VF(t,e);for(;n&&rVe(n)&&Lx(n);)n=VF(n,e);return n&&h0(n)&&Lx(n)&&!cI(n)?r:n||sVe(t)||r}const DVe=async function(t){const e=this.getOffsetParent||Nee,r=this.getDimensions,n=await r(t.floating);return{reference:RVe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function MVe(t){return Oo(t).direction==="rtl"}const jVe={convertOffsetParentRelativeRectToViewportRelativeRect:AVe,getDocumentElement:Sc,getClippingRect:PVe,getOffsetParent:Nee,getElementRects:DVe,getClientRects:TVe,getDimensions:O
vendor: 5,298 bytes, line 474
474Ve,getScale:Ap,isElement:hs,isRTL:MVe};function Pee(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function LVe(t,e){let r=null,n;const i=Sc(t);function s(){var o;clearTimeout(n),(o=r)==null||o.disconnect(),r=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),s();const l=t.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(o||e(),!f||!h)return;const g=mb(d),m=mb(i.clientWidth-(u+f)),y=mb(i.clientHeight-(d+h)),b=mb(u),v={rootMargin:-g+"px "+-m+"px "+-y+"px "+-b+"px",threshold:Ji(0,Wf(1,c))||1};let w=!0;function x(_){const S=_[0].intersectionRatio;if(S!==c){if(!w)return a();S?a(!1,S):n=setTimeout(()=>{a(!1,1e-7)},1e3)}S===1&&!Pee(l,t.getBoundingClientRect())&&a(),w=!1}try{r=new IntersectionObserver(x,{...v,root:i.ownerDocument})}catch{r=new IntersectionObserver(x,v)}r.observe(t)}return a(!0),s}function FVe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=uI(t),u=i||s?[...l?Qm(l):[],...e?Qm(e):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});const d=l&&o?LVe(l,r):null;let f=-1,h=null;a&&(h=new ResizeObserver(b=>{let[E]=b;E&&E.target===l&&h&&e&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),r()}),l&&!c&&h.observe(l),e&&h.observe(e));let g,m=c?zf(t):null;c&&y();function y(){const b=zf(t);m&&!Pee(m,b)&&r(),m=b,g=requestAnimationFrame(y)}return r(),()=>{var b;u.forEach(E=>{i&&E.removeEventListener("scroll",r),s&&E.removeEventListener("resize",r)}),d==null||d(),(b=h)==null||b.disconnect(),h=null,c&&cancelAnimationFrame(g)}}const Fx=Aee,UVe=EVe,BVe=xVe,qVe=bVe,WVe=_Ve,zVe=(t,e,r)=>{const n=new Map,i={platform:jVe,...r},s={...i.platform,_c:n};return yVe(t,e,{...i,platform:s})};var VVe=typeof document<"u",HVe=function(){},tv=VVe?C.useLayoutEffect:HVe;function kw(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!kw(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!kw(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function Oee(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function HF(t,e){const r=Oee(t);return Math.round(e*r)/r}function Ux(t){const e=C.useRef(t);return tv(()=>{e.current=t}),e}function GVe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:c,open:l}=t,[u,d]=C.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=C.useState(n);kw(f,n)||h(n);const[g,m]=C.useState(null),[y,b]=C.useState(null),E=C.useCallback(U=>{U!==_.current&&(_.current=U,m(U))},[]),v=C.useCallback(U=>{U!==S.current&&(S.current=U,b(U))},[]),w=s||g,x=a||y,_=C.useRef(null),S=C.useRef(null),A=C.useRef(u),I=c!=null,$=Ux(c),P=Ux(i),j=Ux(l),L=C.useCallback(()=>{if(!_.current||!S.current)return;const U={placement:e,strategy:r,middleware:f};P.current&&(U.platform=P.current),zVe(_.current,S.current,U).then(W=>{const V={...W,isPositioned:j.current!==!1};B.current&&!kw(A.current,V)&&(A.current=V,bl.flushSync(()=>{d(V)}))})},[f,e,r,P,j]);tv(()=>{l===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[l]);const B=C.useRef(!1);tv(()=>(B.current=!0,()=>{B.current=!1}),[]),tv(()=>{if(w&&(_.current=w),x&&(S.current=x),w&&x){if($.current)return $.current(w,x,L);L()}},[w,x,L,$,I]);const k=C.useMemo(()=>({reference:_,floating:S,setReference:E,setFloating:v}),[E,v]),D=C.useMemo(()=>({reference:w,floating:x}),[w,x]),q=C.useMemo(()=>{const U={position:r,left:0,top:0};if(!D.floating)return U;const W=HF(D.floating,u.x),V=HF(D.floating,u.y);return o?{...U,transform:"translate("+W+"px, "+V+"px)",...Oee(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:W,top:V}},[r,o,D.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:L,refs:k,elements:D,floatingStyles:q}),[u,L,k,D,q])}const Ree=(t,e)=>{const r=UVe(t);return{name:r.name,fn:r.fn,options:[t,e]}},KVe=(t,e)=>{const r=BVe(t);return{name:r.name,fn:r.fn,options:[t,e]}},QVe=(t,e)=>{const r=qVe(t);return{name:r.name,fn:r.fn,options:[t,e]}},YVe=(t,e)=>{const r=WVe(t);return{name:r.name,fn:r.fn,options:[t,e]}},Dee={...s_},ZVe=Dee.useInsertionEffect,XVe=ZVe||(t=>t());function Mee(t){const e=C.useRef(()=>{});return XVe(()=>{e.current=t}),C.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return e.current==null?void 0:e.current(...n)},[])}var nC=typeof document<"u"?C.useLayoutEffect:C.useEffect;let GF=!1,JVe=0;const KF=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+JVe++;function eHe(){const[t,e]=C.useState(()=>GF?KF():void 0);return nC(()=>{t==null&&e(KF())},[]),C.useEffect(()=>{GF=!0},[]),t}const tHe=Dee.useId,rHe=tHe||eHe;function nHe(){const t=new Map;return{emit(e,r){var n;
vendor: 12,125 bytes, line 474
474(n=t.get(e))==null||n.forEach(i=>i(r))},on(e,r){t.set(e,[...t.get(e)||[],r])},off(e,r){var n;t.set(e,((n=t.get(e))==null?void 0:n.filter(i=>i!==r))||[])}}}const iHe=C.createContext(null),sHe=C.createContext(null),aHe=()=>{var t;return((t=C.useContext(iHe))==null?void 0:t.id)||null},oHe=()=>C.useContext(sHe),cHe="data-floating-ui-focusable";function lHe(t){const{open:e=!1,onOpenChange:r,elements:n}=t,i=rHe(),s=C.useRef({}),[a]=C.useState(()=>nHe()),o=aHe()!=null,[c,l]=C.useState(n.reference),u=Mee((h,g,m)=>{s.current.openEvent=h?g:void 0,a.emit("openchange",{open:h,event:g,reason:m,nested:o}),r==null||r(h,g,m)}),d=C.useMemo(()=>({setPositionReference:l}),[]),f=C.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return C.useMemo(()=>({dataRef:s,open:e,onOpenChange:u,elements:f,events:a,floatingId:i,refs:d}),[e,u,f,a,i,d])}function uHe(t){t===void 0&&(t={});const{nodeId:e}=t,r=lHe({...t,elements:{reference:null,floating:null,...t.elements}}),n=t.rootContext||r,i=n.elements,[s,a]=C.useState(null),[o,c]=C.useState(null),u=(i==null?void 0:i.domReference)||s,d=C.useRef(null),f=oHe();nC(()=>{u&&(d.current=u)},[u]);const h=GVe({...t,elements:{...i,...o&&{reference:o}}}),g=C.useCallback(v=>{const w=hs(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),contextElement:v}:v;c(w),h.refs.setReference(w)},[h.refs]),m=C.useCallback(v=>{(hs(v)||v===null)&&(d.current=v,a(v)),(hs(h.refs.reference.current)||h.refs.reference.current===null||v!==null&&!hs(v))&&h.refs.setReference(v)},[h.refs]),y=C.useMemo(()=>({...h.refs,setReference:m,setPositionReference:g,domReference:d}),[h.refs,m,g]),b=C.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),E=C.useMemo(()=>({...h,...n,refs:y,elements:b,nodeId:e}),[h,y,b,e,n]);return nC(()=>{n.dataRef.current.floatingContext=E;const v=f==null?void 0:f.nodesRef.current.find(w=>w.id===e);v&&(v.context=E)}),C.useMemo(()=>({...h,context:E,refs:y,elements:b}),[h,y,b,E])}const QF="active",YF="selected";function Bx(t,e,r){const n=new Map,i=r==="item";let s=t;if(i&&t){const{[QF]:a,[YF]:o,...c}=t;s=c}return{...r==="floating"&&{tabIndex:-1,[cHe]:""},...s,...e.map(a=>{const o=a?a[r]:null;return typeof o=="function"?t?o(t):null:o}).concat(t).reduce((a,o)=>(o&&Object.entries(o).forEach(c=>{let[l,u]=c;if(!(i&&[QF,YF].includes(l)))if(l.indexOf("on")===0){if(n.has(l)||n.set(l,[]),typeof u=="function"){var d;(d=n.get(l))==null||d.push(u),a[l]=function(){for(var f,h=arguments.length,g=new Array(h),m=0;m<h;m++)g[m]=arguments[m];return(f=n.get(l))==null?void 0:f.map(y=>y(...g)).find(y=>y!==void 0)}}}else a[l]=u}),a),{})}}function dHe(t){t===void 0&&(t=[]);const e=t.map(o=>o==null?void 0:o.reference),r=t.map(o=>o==null?void 0:o.floating),n=t.map(o=>o==null?void 0:o.item),i=C.useCallback(o=>Bx(o,t,"reference"),e),s=C.useCallback(o=>Bx(o,t,"floating"),r),a=C.useCallback(o=>Bx(o,t,"item"),n);return C.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:a}),[i,s,a])}function ZF(t,e){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:e}}}}const fHe=t=>({name:"inner",options:t,async fn(e){const{listRef:r,overflowRef:n,onFallbackChange:i,offset:s=0,index:a=0,minItemsVisible:o=4,referenceOverflowThreshold:c=0,scrollRef:l,...u}=H0(t,e),{rects:d,elements:{floating:f}}=e,h=r.current[a],g=(l==null?void 0:l.current)||f,m=f.clientTop||g.clientTop,y=f.clientTop!==0,b=g.clientTop!==0,E=f===g;if(!h)return{};const v={...e,...await Ree(-h.offsetTop-f.clientTop-d.reference.height/2-h.offsetHeight/2-s).fn(e)},w=await Fx(ZF(v,g.scrollHeight+m+f.clientTop),u),x=await Fx(v,{...u,elementContext:"reference"}),_=Ji(0,w.top),S=v.y+_,$=(g.scrollHeight>g.clientHeight?P=>P:Ym)(Ji(0,g.scrollHeight+(y&&E||b?m*2:0)-_-Ji(0,w.bottom)));if(g.style.maxHeight=$+"px",g.scrollTop=_,i){const P=g.offsetHeight<h.offsetHeight*Wf(o,r.current.length)-1||x.top>=-c||x.bottom>=-c;bl.flushSync(()=>i(P))}return n&&(n.current=await Fx(ZF({...v,y:S},g.offsetHeight+m+f.clientTop),u)),{y:S}}});function hHe(t,e){const{open:r,elements:n}=t,{enabled:i=!0,overflowRef:s,scrollRef:a,onChange:o}=e,c=Mee(o),l=C.useRef(!1),u=C.useRef(null),d=C.useRef(null);C.useEffect(()=>{if(!i)return;function h(m){if(m.ctrlKey||!g||s.current==null)return;const y=m.deltaY,b=s.current.top>=-.5,E=s.current.bottom>=-.5,v=g.scrollHeight-g.clientHeight,w=y<0?-1:1,x=y<0?"max":"min";g.scrollHeight<=g.clientHeight||(!b&&y>0||!E&&y<0?(m.preventDefault(),bl.flushSync(()=>{c(_=>_+Math[x](y,v*w))})):/firefox/i.test(aVe())&&(g.scrollTop+=y))}const g=(a==null?void 0:a.current)||n.floating;if(r&&g)return g.addEventListener("wheel",h),requestAnimationFrame(()=>{u.current=g.scrollTop,s.current!=null&&(d.current={...s.current})}),()=>{u.current=null,d.current=null,g.removeEventListener("wheel",h)}},[i,r,n.floating,s,a,c]);const f=C.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const h=(a==null?void 0:a.current)||n.floating;if(!(!s.current||!h||!l.current)){if(u.current!==null){const g=h.scrollTop-u.current;(s.current.bottom<-.5&&g<-1||s.current.top<-.5&&g>1)&&bl.flushSync(()=>c(m=>m+g))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[n.floating,c,s,a]);return C.useMemo(()=>i?{floating:f}:{},[i,f])}let G0=C.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});G0.displayName="FloatingContext";let dI=C.createContext(null);dI.displayName="PlacementContext";function pHe(t){return C.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function gHe(){return C.useContext(G0).setReference}function mHe(){return C.useContext(G0).getReferenceProps}function yHe(){let{getFloatingProps:t,slot:e}=C.useContext(G0);return C.useCallback((...r)=>Object.assign({},t(...r),{"data-anchor":e.anchor}),[t,e])}function bHe(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=C.useContext(dI),r=C.useMemo(()=>t,[JSON.stringify(t,(i,s)=>{var a;return(a=s==null?void 0:s.outerHTML)!=null?a:s})]);hn(()=>{e==null||e(r??null)},[e,r]);let n=C.useContext(G0);return C.useMemo(()=>[n.setFloating,t?n.styles:{}],[n.setFloating,t,n.styles])}let XF=4;function vHe({children:t,enabled:e=!0}){let[r,n]=C.useState(null),[i,s]=C.useState(0),a=C.useRef(null),[o,c]=C.useState(null);wHe(o);let l=e&&r!==null&&o!==null,{to:u="bottom",gap:d=0,offset:f=0,padding:h=0,inner:g}=EHe(r,o),[m,y="center"]=u.split(" ");hn(()=>{l&&s(0)},[l]);let{refs:b,floatingStyles:E,context:v}=uHe({open:l,placement:m==="selection"?y==="center"?"bottom":`bottom-${y}`:y==="center"?`${m}`:`${m}-${y}`,strategy:"absolute",transform:!1,middleware:[Ree({mainAxis:m==="selection"?0:d,crossAxis:f}),KVe({padding:h}),m!=="selection"&&QVe({padding:h}),m==="selection"&&g?fHe({...g,padding:h,overflowRef:a,offset:i,minItemsVisible:XF,referenceOverflowThreshold:h,onFallbackChange(P){var j,L;if(!P)return;let B=v.elements.floating;if(!B)return;let k=parseFloat(getComputedStyle(B).scrollPaddingBottom)||0,D=Math.min(XF,B.childElementCount),q=0,U=0;for(let W of(L=(j=v.elements.floating)==null?void 0:j.childNodes)!=null?L:[])if(ma(W)){let V=W.offsetTop,Y=V+W.clientHeight+k,K=B.scrollTop,ge=K+B.clientHeight;if(V>=K&&Y<=ge)D--;else{U=Math.max(0,Math.min(Y,ge)-Math.max(V,K)),q=W.clientHeight;break}}D>=1&&s(W=>{let V=q*D-U+k;return W>=V?W:V})}}):null,YVe({padding:h,apply({availableWidth:P,availableHeight:j,elements:L}){Object.assign(L.floating.style,{overflow:"auto",maxWidth:`${P}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${j}px)`})}})].filter(Boolean),whileElementsMounted:FVe}),[w=m,x=y]=v.placement.split("-");m==="selection"&&(w="selection");let _=C.useMemo(()=>({anchor:[w,x].filter(Boolean).join(" ")}),[w,x]),S=hHe(v,{overflowRef:a,onChange:s}),{getReferenceProps:A,getFloatingProps:I}=dHe([S]),$=rr(P=>{c(P),b.setFloating(P)});return C.createElement(dI.Provider,{value:n},C.createElement(G0.Provider,{value:{setFloating:$,setReference:b.setReference,styles:E,getReferenceProps:A,getFloatingProps:I,slot:_}},t))}function wHe(t){hn(()=>{if(!t)return;let e=new MutationObserver(()=>{let r=window.getComputedStyle(t).maxHeight,n=parseFloat(r);if(isNaN(n))return;let i=parseInt(r);isNaN(i)||n!==i&&(t.style.maxHeight=`${Math.ceil(n)}px`)});return e.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[t])}function EHe(t,e){var r,n,i;let s=qx((r=t==null?void 0:t.gap)!=null?r:"var(--anchor-gap, 0)",e),a=qx((n=t==null?void 0:t.offset)!=null?n:"var(--anchor-offset, 0)",e),o=qx((i=t==null?void 0:t.padding)!=null?i:"var(--anchor-padding, 0)",e);return{...t,gap:s,offset:a,padding:o}}function qx(t,e,r=void 0){let n=mh(),i=rr((c,l)=>{if(c==null)return[r,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!l)return[r,null];let u=JF(c,l);return[u,d=>{let f=jee(c);{let h=f.map(g=>window.getComputedStyle(l).getPropertyValue(g));n.requestAnimationFrame(function g(){n.nextFrame(g);let m=!1;for(let[b,E]of f.entries()){let v=window.getComputedStyle(l).getPropertyValue(E);if(h[b]!==v){h[b]=v,m=!0;break}}if(!m)return;let y=JF(c,l);u!==y&&(d(y),u=y)})}return n.dispose}]}return[r,null]}),s=C.useMemo(()=>i(t,e)[0],[t,e]),[a=s,o]=C.useState();return hn(()=>{let[c,l]=i(t,e);if(o(c),!!l)return l(o)},[t,e]),a}function jee(t){let e=/var\((.*)\)/.exec(t);if(e){let r=e[1].indexOf(",");if(r===-1)return[e[1]];let n=e[1].slice(0,r).trim(),i=e[1].slice(r+1).trim();return i?[n,...jee(i)]:[n]}return[]}function JF(t,e){let r=document.createElement("div");e.appendChild(r),r.style.setProperty("margin-top","0px","important"),r.style.setProperty("margin-top",t,"important");let n=parseFloat(window.getComputedStyle(r).marginTop)||0;return e.removeChild(r),n}let R5=C.createContext(null);R5.displayName="OpenClosedContext";var ps=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(ps||{});function o2(){return C.useContext(R5)}function Lee({value:t,children:e}){return Rt.createElement(R5.Provider,{value:t},e)}function xHe({children:t}){return Rt.createElement(R5.Provider,{value:null},t)}function _He(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}let _u=[];_He(()=>{function t(e){if(!ic(e.target)||e.target===document.body||_u[0]===e.target)return;let r=e.target;r=r.closest(Aw),_u.unshift(r??e.target),_u=_u.filter(n=>n!=null&&n.isConnected),_u.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});function CHe(t){throw new Error("Unexpected object: "+t)}var Qn=(t=>(t[t.First=0]="First",t[t.Previous=1]="Previous",t[t.Next=2]="Next",t[t.Last=3]="Last",t[t.Specific=4]="Specific",t[t.Nothing=5]="Nothing",t))(Qn||{});function yb(t,e){let r=e.resolveItems();if(r.length<=0)return null;let n=e.resolveActiveIndex(),i=n??-1;switch(t.focus){case 0:{for(let s=0;s<r.length;++s)if(!e.resolveDisabled(r[s],s,r))return s;return n}case 1:{i===-1&&(i=r.length);for(let s=i-1;s>=0;--s)if(!e.resolveDisabled(r[s],s,r))return s;return n}case 2:{for(let s=i+1;s<r.length;++s)if(!e.resolveDisabled(r[s],s,r))return s;return n}case 3:{for(let s=r.length-1;s>=0;--s)if(!e.resolveDisabled(r[s],s,r))return s;return n}case 4:{for(let s=0;s<r.length;++s)if(e.resolveId(r[s],s,r)===t.id)return s;return n}case 5:return null;default:CHe(t)}}function fI(t){let e=rr(t),r=C.useRef(!1);C.useEffect(()=>(r.current=!1,()=>{r.current=!0,T5(()=>{r.current&&e()})}),[e])}let Fee=C.createContext(!1);function SHe(){return C.useContext(Fee)}function eU(t){return Rt.createElement(Fee.Provider,{value:t.force},t.children)}function AHe(t){let e=SHe(),r=C.useContext(Bee),[n,i]=C.useState(()=>{var s;if(!e&&r!==null)return(s=r.current)!=null?s:null;if(hc.isServer)return null;let a=t==null?void 0:t.getElementById("headlessui-portal-root");
474if(a)return a;if(t===null)return null;let o=t.createElement("div");return o.setAttribute("id","headlessui-portal-root"),t.body.appendChild(o)});return C.useEffect(()=>{n!==null&&(t!=null&&t.body.contains(n)||t==null||t.body.appendChild(n))},[n,t]),C.useEffect(()=>{e||r!==null&&i(r.current)},[r,i,e]),n}let Uee=C.Fragment,THe=jn(function(t,e){let{ownerDocument:r=null,...n}=t,i=C.useRef(null),s=Es(sze(f=>{i.current=f}),e),a=Km(i.current),o=r??a,c=AHe(o),l=C.useContext(iC),u=mh(),d=ei();return fI(()=>{var f;c&&c.childNodes.length<=0&&((f=c.parentElement)==null||f.removeChild(c))}),c?bl.createPortal(Rt.createElement("div",{"data-headlessui-portal":"",ref:f=>{u.dispose(),l&&f&&u.add(l.register(f))}},d({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:Uee,name:"Portal"})),c):null});function IHe(t,e){let r=Es(e),{enabled:n=!0,ownerDocument:i,...s}=t,a=ei();return n?Rt.createElement(THe,{...s,ownerDocument:i,ref:r}):a({ourProps:{ref:r},theirProps:s,slot:{},defaultTag:Uee,name:"Portal"})}let kHe=C.Fragment,Bee=C.createContext(null);function $He(t,e){let{target:r,...n}=t,i={ref:Es(e)},s=ei();return Rt.createElement(Bee.Provider,{value:r},s({ourProps:i,theirProps:n,defaultTag:kHe,name:"Popover.Group"}))}let iC=C.createContext(null);function NHe(){let t=C.useContext(iC),e=C.useRef([]),r=rr(s=>(e.current.push(s),t&&t.register(s),()=>n(s))),n=rr(s=>{let a=e.current.indexOf(s);a!==-1&&e.current.splice(a,1),t&&t.unregister(s)}),i=C.useMemo(()=>({register:r,unregister:n,portals:e}),[r,n,e]);return[e,C.useMemo(()=>function({children:s}){return Rt.createElement(iC.Provider,{value:i},s)},[i])]}let PHe=jn(IHe),qee=jn($He),Wee=Object.assign(PHe,{Group:qee});const rv={Idle:{kind:"Idle"},Tracked:t=>({kind:"Tracked",position:t}),Moved:{kind:"Moved"}};function zee(t){let e=t.getBoundingClientRect();return`${e.x},${e.y}`}function OHe(t,e,r){let n=Gs();if(e.kind==="Tracked"){let i=function(){s!==zee(t)&&(n.dispose(),r())},{position:s}=e,a=new ResizeObserver(i);a.observe(t),n.add(()=>a.disconnect()),n.addEventListener(window,"scroll",i,{passive:!0}),n.addEventListener(window,"resize",i)}return()=>n.dispose()}function RHe(t,e=typeof document<"u"?document.defaultView:null,r){let n=i2(t,"escape");yee(e,"keydown",i=>{n&&(i.defaultPrevented||i.key===yi.Escape&&r(i))})}function DHe(){var t;let[e]=C.useState(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(pointer: coarse)"):null),[r,n]=C.useState((t=e==null?void 0:e.matches)!=null?t:!1);return hn(()=>{if(!e)return;function i(s){n(s.matches)}return e.addEventListener("change",i),()=>e.removeEventListener("change",i)},[e]),r}function MHe({defaultContainers:t=[],portals:e,mainTreeNode:r}={}){let n=rr(()=>{var i,s;let a=gh(r),o=[];for(let c of t)c!==null&&(yl(c)?o.push(c):"current"in c&&yl(c.current)&&o.push(c.current));if(e!=null&&e.current)for(let c of e.current)o.push(c);for(let c of(i=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?i:[])c!==document.body&&c!==document.head&&yl(c)&&c.id!=="headlessui-portal-root"&&(r&&(c.contains(r)||c.contains((s=r==null?void 0:r.getRootNode())==null?void 0:s.host))||o.some(l=>c.contains(l))||o.push(c));return o});
vendor: 7,039 bytes, line 474
474return{resolveContainers:n,contains:rr(i=>n().some(s=>s.contains(i)))}}let Vee=C.createContext(null);function tU({children:t,node:e}){let[r,n]=C.useState(null),i=Hee(e??r);return Rt.createElement(Vee.Provider,{value:i},t,i===null&&Rt.createElement(X7,{features:Sw.Hidden,ref:s=>{var a,o;if(s){for(let c of(o=(a=gh(s))==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?o:[])if(c!==document.body&&c!==document.head&&yl(c)&&c!=null&&c.contains(s)){n(c);break}}}}))}function Hee(t=null){var e;return(e=C.useContext(Vee))!=null?e:t}function jHe(){let t=typeof document>"u";return"useSyncExternalStore"in s_?(e=>e.useSyncExternalStore)(s_)(()=>()=>{},()=>!1,()=>!t):!1}function D5(){let t=jHe(),[e,r]=C.useState(hc.isHandoffComplete);return e&&hc.isHandoffComplete===!1&&r(!1),C.useEffect(()=>{e!==!0&&r(!0)},[e]),C.useEffect(()=>hc.handoff(),[]),t?!1:e}function hI(){let t=C.useRef(!1);return hn(()=>(t.current=!0,()=>{t.current=!1}),[]),t}var p1=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(p1||{});function LHe(){let t=C.useRef(0);return gee(!0,"keydown",e=>{e.key==="Tab"&&(t.current=e.shiftKey?1:0)},!0),t}function Gee(t){if(!t)return new Set;if(typeof t=="function")return new Set(t());let e=new Set;for(let r of t.current)yl(r.current)&&e.add(r.current);return e}let FHe="div";var Vd=(t=>(t[t.None=0]="None",t[t.InitialFocus=1]="InitialFocus",t[t.TabLock=2]="TabLock",t[t.FocusLock=4]="FocusLock",t[t.RestoreFocus=8]="RestoreFocus",t[t.AutoFocus=16]="AutoFocus",t))(Vd||{});function UHe(t,e){let r=C.useRef(null),n=Es(r,e),{initialFocus:i,initialFocusFallback:s,containers:a,features:o=15,...c}=t;D5()||(o=0);let l=Km(r.current);zHe(o,{ownerDocument:l});let u=VHe(o,{ownerDocument:l,container:r,initialFocus:i,initialFocusFallback:s});HHe(o,{ownerDocument:l,container:r,containers:a,previousActiveElement:u});let d=LHe(),f=rr(E=>{if(!ma(r.current))return;let v=r.current;(w=>w())(()=>{Po(d.current,{[p1.Forwards]:()=>{Sp(v,fo.First,{skipElements:[E.relatedTarget,s]})},[p1.Backwards]:()=>{Sp(v,fo.Last,{skipElements:[E.relatedTarget,s]})}})})}),h=i2(!!(o&2),"focus-trap#tab-lock"),g=mh(),m=C.useRef(!1),y={ref:n,onKeyDown(E){E.key=="Tab"&&(m.current=!0,g.requestAnimationFrame(()=>{m.current=!1}))},onBlur(E){if(!(o&4))return;let v=Gee(a);ma(r.current)&&v.add(r.current);let w=E.relatedTarget;ic(w)&&w.dataset.headlessuiFocusGuard!=="true"&&(Kee(v,w)||(m.current?Sp(r.current,Po(d.current,{[p1.Forwards]:()=>fo.Next,[p1.Backwards]:()=>fo.Previous})|fo.WrapAround,{relativeTo:E.target}):ic(E.target)&&pc(E.target)))}},b=ei();return Rt.createElement(Rt.Fragment,null,h&&Rt.createElement(X7,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Sw.Focusable}),b({ourProps:y,theirProps:c,defaultTag:FHe,name:"FocusTrap"}),h&&Rt.createElement(X7,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Sw.Focusable}))}let BHe=jn(UHe),qHe=Object.assign(BHe,{features:Vd});function WHe(t=!0){let e=C.useRef(_u.slice());return oI(([r],[n])=>{n===!0&&r===!1&&T5(()=>{e.current.splice(0)}),n===!1&&r===!0&&(e.current=_u.slice())},[t,_u,e]),rr(()=>{var r;return(r=e.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function zHe(t,{ownerDocument:e}){let r=!!(t&8),n=WHe(r);oI(()=>{r||VJ(e==null?void 0:e.body)&&pc(n())},[r]),fI(()=>{r&&pc(n())})}function VHe(t,{ownerDocument:e,container:r,initialFocus:n,initialFocusFallback:i}){let s=C.useRef(null),a=i2(!!(t&1),"focus-trap#initial-focus"),o=hI();return oI(()=>{if(t===0)return;if(!a){i!=null&&i.current&&pc(i.current);return}let c=r.current;c&&T5(()=>{if(!o.current)return;let l=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===l){s.current=l;return}}else if(c.contains(l)){s.current=l;return}if(n!=null&&n.current)pc(n.current);else{if(t&16){if(Sp(c,fo.First|fo.AutoFocus)!==eC.Error)return}else if(Sp(c,fo.First)!==eC.Error)return;if(i!=null&&i.current&&(pc(i.current),(e==null?void 0:e.activeElement)===i.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}s.current=e==null?void 0:e.activeElement})},[i,a,t]),s}function HHe(t,{ownerDocument:e,container:r,containers:n,previousActiveElement:i}){let s=hI(),a=!!(t&4);yee(e==null?void 0:e.defaultView,"focus",o=>{if(!a||!s.current)return;let c=Gee(n);ma(r.current)&&c.add(r.current);let l=i.current;if(!l)return;let u=o.target;ma(u)?Kee(c,u)?(i.current=u,pc(u)):(o.preventDefault(),o.stopPropagation(),pc(l)):pc(i.current)},!0)}function Kee(t,e){for(let r of t)if(r.contains(e))return!0;return!1}function Qee(t){var e;return!!(t.enter||t.enterFrom||t.enterTo||t.leave||t.leaveFrom||t.leaveTo)||!j1((e=t.as)!=null?e:Zee)||Rt.Children.count(t.children)===1}let M5=C.createContext(null);M5.displayName="TransitionContext";var GHe=(t=>(t.Visible="visible",t.Hidden="hidden",t))(GHe||{});function KHe(){let t=C.useContext(M5);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}function QHe(){let t=C.useContext(j5);if(t===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return t}let j5=C.createContext(null);j5.displayName="NestingContext";function L5(t){return"children"in t?L5(t.children):t.current.filter(({el:e})=>e.current!==null).filter(({state:e})=>e==="visible").length>0}function Yee(t,e){let r=yh(t),n=C.useRef([]),i=hI(),s=mh(),a=rr((h,g=Pu.Hidden)=>{let m=n.current.findIndex(({el:y})=>y===h);m!==-1&&(Po(g,{[Pu.Unmount](){n.current.splice(m,1)},[Pu.Hidden](){n.current[m].state="hidden"}}),s.microTask(()=>{var y;!L5(n)&&i.current&&((y=r.current)==null||y.call(r))}))}),o=rr(h=>{let g=n.current.find(({el:m})=>m===h);return g?g.state!=="visible"&&(g.state="visible"):n.current.push({el:h,state:"visible"}),()=>a(h,Pu.Unmount)}),c=C.useRef([]),l=C.useRef(Promise.resolve()),u=C.useRef({enter:[],leave:[]}),d=rr((h,g,m)=>{c.current.splice(0),e&&(e.chains.current[g]=e.chains.current[g].filter(([y])=>y!==h)),e==null||e.chains.current[g].push([h,new Promise(y=>{c.current.push(y)})]),e==null||e.chains.current[g].push([h,new Promise(y=>{Promise.all(u.current[g].map(([b,E])=>E)).then(()=>y())})]),g==="enter"?l.current=l.current.then(()=>e==null?void 0:e.wait.current).then(()=>m(g)):m(g)}),f=rr((h,g,m)=>{Promise.all(u.current[g].splice(0).map(([y,b])=>b)).then(()=>{var y;(y=c.current.shift())==null||y()}).then(()=>m(g))});return C.useMemo(()=>({children:n,register:o,unregister:a,onStart:d,onStop:f,wait:l,chains:u}),[o,a,n,d,f,u,l])}let Zee=C.Fragment,Xee=f0.RenderStrategy;function YHe(t,e){var r,n;let{transition:i=!0,beforeEnter:s,afterEnter:a,beforeLeave:o,afterLeave:c,enter:l,enterFrom:u,enterTo:d,entered:f,leave:h,leaveFrom:g,leaveTo:m,...y}=t,[b,E]=C.useState(null),v=C.useRef(null),w=Qee(t),x=Es(...w?[v,e,E]:e===null?[]:[e]),_=(r=y.unmount)==null||r?Pu.Unmount:Pu.Hidden,{show:S,appear:A,initial:I}=KHe(),[$,P]=C.useState(S?"visible":"hidden"),j=QHe(),{register:L,unregister:B}=j;hn(()=>L(v),[L,v]),hn(()=>
vendor: 4,295 bytes, line 474
474{if(_===Pu.Hidden&&v.current){if(S&&$!=="visible"){P("visible");return}return Po($,{hidden:()=>B(v),visible:()=>L(v)})}},[$,v,L,B,S,_]);let k=D5();hn(()=>{if(w&&k&&$==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,$,k,w]);let D=I&&!A,q=A&&S&&I,U=C.useRef(!1),W=Yee(()=>{U.current||(P("hidden"),B(v))},j),V=rr(se=>{U.current=!0;let me=se?"enter":"leave";W.onStart(v,me,_e=>{_e==="enter"?s==null||s():_e==="leave"&&(o==null||o())})}),Y=rr(se=>{let me=se?"enter":"leave";U.current=!1,W.onStop(v,me,_e=>{_e==="enter"?a==null||a():_e==="leave"&&(c==null||c())}),me==="leave"&&!L5(W)&&(P("hidden"),B(v))});C.useEffect(()=>{w&&i||(V(S),Y(S))},[S,w,i]);let K=!(!i||!w||!k||D),[,ge]=wee(K,b,S,{start:V,end:Y}),ae=Ud({ref:x,className:((n=Z7(y.className,q&&l,q&&u,ge.enter&&l,ge.enter&&ge.closed&&u,ge.enter&&!ge.closed&&d,ge.leave&&h,ge.leave&&!ge.closed&&g,ge.leave&&ge.closed&&m,!ge.transition&&S&&f))==null?void 0:n.trim())||void 0,...vee(ge)}),ce=0;$==="visible"&&(ce|=ps.Open),$==="hidden"&&(ce|=ps.Closed),S&&$==="hidden"&&(ce|=ps.Opening),!S&&$==="visible"&&(ce|=ps.Closing);let Q=ei();return Rt.createElement(j5.Provider,{value:W},Rt.createElement(Lee,{value:ce},Q({ourProps:ae,theirProps:y,defaultTag:Zee,features:Xee,visible:$==="visible",name:"Transition.Child"})))}function ZHe(t,e){let{show:r,appear:n=!1,unmount:i=!0,...s}=t,a=C.useRef(null),o=Qee(t),c=Es(...o?[a,e]:e===null?[]:[e]);D5();let l=o2();if(r===void 0&&l!==null&&(r=(l&ps.Open)===ps.Open),r===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=C.useState(r?"visible":"hidden"),f=Yee(()=>{r||d("hidden")}),[h,g]=C.useState(!0),m=C.useRef([r]);hn(()=>{h!==!1&&m.current[m.current.length-1]!==r&&(m.current.push(r),g(!1))},[m,r]);let y=C.useMemo(()=>({show:r,appear:n,initial:h}),[r,n,h]);hn(()=>{r?d("visible"):!L5(f)&&a.current!==null&&d("hidden")},[r,f]);let b={unmount:i},E=rr(()=>{var x;h&&g(!1),(x=t.beforeEnter)==null||x.call(t)}),v=rr(()=>{var x;h&&g(!1),(x=t.beforeLeave)==null||x.call(t)}),w=ei();return Rt.createElement(j5.Provider,{value:f},Rt.createElement(M5.Provider,{value:y},w({ourProps:{...b,as:C.Fragment,children:Rt.createElement(Jee,{ref:c,...b,...s,beforeEnter:E,beforeLeave:v})},theirProps:{},defaultTag:C.Fragment,features:Xee,visible:u==="visible",name:"Transition"})))}function XHe(t,e){let r=C.useContext(M5)!==null,n=o2()!==null;return Rt.createElement(Rt.Fragment,null,!r&&n?Rt.createElement(sC,{ref:e,...t}):Rt.createElement(Jee,{ref:e,...t}))}let sC=jn(ZHe),Jee=jn(YHe),Zm=jn(XHe),ete=Object.assign(sC,{Child:Zm,Root:sC});var JHe=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(JHe||{}),eGe=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(eGe||{});let tGe={0(t,e){return t.titleId===e.id?t:{...t,titleId:e.id}}},pI=C.createContext(null);pI.displayName="DialogContext";function F5(t){let e=C.useContext(pI);if(e===null){let r=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,F5),r}return e}function rGe(t,e){return Po(e.type,tGe,t,e)}let rU=jn(function(t,e){let r=C.useId(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:s,initialFocus:a,role:o="dialog",autoFocus:c=!0,__demoMode:l=!1,unmount:u=!1,...d}=t,f=C.useRef(!1);o=(function(){return o==="dialog"||o==="alertdialog"?o:(f.current||(f.current=!0,console.warn(`Invalid role [${o}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")})();let h=o2();i===void 0&&h!==null&&(i=(h&ps.Open)===ps.Open);let g=C.useRef(null),m=Es(g,e),y=Km(g.current),b=i?0:1,[E,v]=C.useReducer(rGe,{titleId:null,descriptionId:null,panelRef:C.createRef()}),w=rr(()=>s(!1)),x=rr(ge=>v({type:0,id:ge})),_=D5()?b===0:!1,[S,A]=NHe(),I={get current(){var ge;return(ge=E.panelRef.current)!=null?ge:g.current}},$=Hee(),{resolveContainers:P}=MHe({mainTreeNode:$,portals:S,defaultContainers:[I]}),j=h!==null?(h&ps.Closing)===ps.Closing:!1;lee(l||j?!1:_,{allowed:rr(()=>{var ge,ae;return[(ae=(ge=g.current)==null?void 0:ge.closest("[data-headlessui-portal]"))!=null?ae:null]}),disallowed:rr(()=>{var ge;return[(ge=$==null?void 0:$.closest("body > *:not(#headlessui-portal-root)"))!=null?ge:null]})});let L=k5.get(null);hn(()=>
vendor: 7,597 bytes, line 474
474{if(_)return L.actions.push(n),()=>L.actions.pop(n)},[L,n,_]);let B=Pa(L,C.useCallback(ge=>L.selectors.isTop(ge,n),[L,n]));mee(B,P,ge=>{ge.preventDefault(),w()}),RHe(B,y==null?void 0:y.defaultView,ge=>{ge.preventDefault(),ge.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur(),w()}),bee(l||j?!1:_,y,P),uee(_,g,w);let[k,D]=eee(),q=C.useMemo(()=>[{dialogState:b,close:w,setTitleId:x,unmount:u},E],[b,w,x,u,E]),U=Cc({open:b===0}),W={ref:m,id:n,role:o,tabIndex:-1,"aria-modal":l?void 0:b===0?!0:void 0,"aria-labelledby":E.titleId,"aria-describedby":k,unmount:u},V=!DHe(),Y=Vd.None;_&&!l&&(Y|=Vd.RestoreFocus,Y|=Vd.TabLock,c&&(Y|=Vd.AutoFocus),V&&(Y|=Vd.InitialFocus));let K=ei();return Rt.createElement(xHe,null,Rt.createElement(eU,{force:!0},Rt.createElement(Wee,null,Rt.createElement(pI.Provider,{value:q},Rt.createElement(qee,{target:g},Rt.createElement(eU,{force:!1},Rt.createElement(D,{slot:U},Rt.createElement(A,null,Rt.createElement(qHe,{initialFocus:a,initialFocusFallback:g,containers:P,features:Y},Rt.createElement(gze,{value:w},K({ourProps:W,theirProps:d,slot:U,defaultTag:nGe,features:iGe,visible:b===0,name:"Dialog"})))))))))))}),nGe="div",iGe=f0.RenderStrategy|f0.Static;function sGe(t,e){let{transition:r=!1,open:n,...i}=t,s=o2(),a=t.hasOwnProperty("open")||s!==null,o=t.hasOwnProperty("onClose");if(!a&&!o)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!o)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!s&&typeof t.open!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${t.open}`);if(typeof t.onClose!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${t.onClose}`);return(n!==void 0||r)&&!i.static?Rt.createElement(tU,null,Rt.createElement(ete,{show:n,transition:r,unmount:i.unmount},Rt.createElement(rU,{ref:e,...i}))):Rt.createElement(tU,null,Rt.createElement(rU,{ref:e,open:n,...i}))}let aGe="div";function oGe(t,e){let r=C.useId(),{id:n=`headlessui-dialog-panel-${r}`,transition:i=!1,...s}=t,[{dialogState:a,unmount:o},c]=F5("Dialog.Panel"),l=Es(e,c.panelRef),u=Cc({open:a===0}),d=rr(y=>{y.stopPropagation()}),f={ref:l,id:n,onClick:d},h=i?Zm:C.Fragment,g=i?{unmount:o}:{},m=ei();return Rt.createElement(h,{...g},m({ourProps:f,theirProps:s,slot:u,defaultTag:aGe,name:"Dialog.Panel"}))}let cGe="div";function lGe(t,e){let{transition:r=!1,...n}=t,[{dialogState:i,unmount:s}]=F5("Dialog.Backdrop"),a=Cc({open:i===0}),o={ref:e,"aria-hidden":!0},c=r?Zm:C.Fragment,l=r?{unmount:s}:{},u=ei();return Rt.createElement(c,{...l},u({ourProps:o,theirProps:n,slot:a,defaultTag:cGe,name:"Dialog.Backdrop"}))}let uGe="h2";function dGe(t,e){let r=C.useId(),{id:n=`headlessui-dialog-title-${r}`,...i}=t,[{dialogState:s,setTitleId:a}]=F5("Dialog.Title"),o=Es(e);C.useEffect(()=>(a(n),()=>a(null)),[n,a]);let c=Cc({open:s===0}),l={ref:o,id:n};return ei()({ourProps:l,theirProps:i,slot:c,defaultTag:uGe,name:"Dialog.Title"})}let fGe=jn(sGe),tte=jn(oGe);jn(lGe);let hGe=jn(dGe),pGe=Object.assign(fGe,{Panel:tte,Title:hGe,Description:lze}),nU=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function iU(t){var e,r;let n=(e=t.innerText)!=null?e:"",i=t.cloneNode(!0);if(!ma(i))return n;let s=!1;for(let o of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))o.remove(),s=!0;let a=s?(r=i.innerText)!=null?r:"":n;return nU.test(a)&&(a=a.replace(nU,"")),a}function gGe(t){let e=t.getAttribute("aria-label");if(typeof e=="string")return e.trim();let r=t.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(i=>{let s=document.getElementById(i);if(s){let a=s.getAttribute("aria-label");return typeof a=="string"?a.trim():iU(s).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return iU(t).trim()}function mGe(t){let e=C.useRef(""),r=C.useRef("");return rr(()=>{let n=t.current;if(!n)return"";let i=n.innerText;if(e.current===i)return r.current;let s=gGe(n).trim().toLowerCase();return e.current=i,r.current=s,s})}var yGe=Object.defineProperty,bGe=(t,e,r)=>e in t?yGe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sU=(t,e,r)=>(bGe(t,typeof e!="symbol"?e+"":e,r),r),Zi=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(Zi||{}),$w=(t=>(t[t.Pointer=0]="Pointer",t[t.Other=1]="Other",t))($w||{}),Zr=(t=>(t[t.OpenMenu=0]="OpenMenu",t[t.CloseMenu=1]="CloseMenu",t[t.GoToItem=2]="GoToItem",t[t.Search=3]="Search",t[t.ClearSearch=4]="ClearSearch",t[t.RegisterItems=5]="RegisterItems",t[t.UnregisterItems=6]="UnregisterItems",t[t.SetButtonElement=7]="SetButtonElement",t[t.SetItemsElement=8]="SetItemsElement",t[t.SortItems=9]="SortItems",t[t.MarkButtonAsMoved=10]="MarkButtonAsMoved",t))(Zr||{});function aU(t,e=r=>r){let r=t.activeItemIndex!==null?t.items[t.activeItemIndex]:null,n=hee(e(t.items.slice()),s=>s.dataRef.current.domRef.current),i=r?n.indexOf(r):null;return i===-1&&(i=null),{items:n,activeItemIndex:i}}let vGe={1(t){if(t.menuState===1)return t;let e=t.buttonElement?rv.Tracked(zee(t.buttonElement)):t.buttonPositionState;return{...t,activeItemIndex:null,pendingFocus:{focus:Qn.Nothing},menuState:1,buttonPositionState:e}},0(t,e){return t.menuState===0?t:{...t,__demoMode:!1,pendingFocus:e.focus,menuState:0,buttonPositionState:rv.Idle}},2:(t,e)=>{var r,n,i,s,a;if(t.menuState===1)return t;let o={...t,searchQuery:"",activationTrigger:(r=e.trigger)!=null?r:1,__demoMode:!1};if(e.focus===Qn.Nothing)return{...o,activeItemIndex:null};if(e.focus===Qn.Specific)return{...o,activeItemIndex:t.items.findIndex(u=>u.id===e.id)};if(e.focus===Qn.Previous){let u=t.activeItemIndex;if(u!==null){let d=t.items[u].dataRef.current.domRef,f=yb(e,{resolveItems:()=>t.items,resolveActiveIndex:()=>t.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(f!==null){let h=t.items[f].dataRef.current.domRef;if(((n=d.current)==null?void 0:n.previousElementSibling)===h.current||((i=h.current)==null?void 0:i.previousElementSibling)===null)return{...o,activeItemIndex:f}}}}else if(e.focus===Qn.Next){let u=t.activeItemIndex;if(u!==null){let d=t.items[u].dataRef.current.domRef,f=yb(e,{resolveItems:()=>t.items,resolveActiveIndex:()=>t.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(f!==null){let h=t.items[f].dataRef.current.domRef;if(((s=d.current)==null?void 0:s.nextElementSibling)===h.current||((a=h.current)==null?void 0:a.nextElementSibling)===null)return{...o,activeItemIndex:f}}}}let c=aU(t),l=yb(e,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled});return{...o,...c,activeItemIndex:l}},3:(t,e)=>{let r=t.searchQuery!==""?0:1,n=t.searchQuery+e.value.toLowerCase(),i=(t.activeItemIndex!==null?t.items.slice(t.activeItemIndex+r).concat(t.items.slice(0,t.activeItemIndex+r)):t.items).find(a=>{var o;return((o=a.dataRef.current.textValue)==null?void 0:o.startsWith(n))&&!a.dataRef.current.disabled}),s=i?t.items.indexOf(i):-1;return s===-1||s===t.activeItemIndex?{...t,searchQuery:n}:{...t,searchQuery:n,activeItemIndex:s,activationTrigger:1}},4(t){return t.searchQuery===""?t:{...t,searchQuery:"",searchActiveItemIndex:null}},5:(t,e)=>{let r=t.items.concat(e.items.map(i=>i)),n=t.activeItemIndex;
474return t.pendingFocus.focus!==Qn.Nothing&&(n=yb(t.pendingFocus,{resolveItems:()=>r,resolveActiveIndex:()=>t.activeItemIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled})),{...t,items:r,activeItemIndex:n,pendingFocus:{focus:Qn.Nothing},pendingShouldSort:!0}},6:(t,e)=>{let r=t.items,n=[],i=new Set(e.items);for(let[s,a]of r.entries())if(i.has(a.id)&&(n.push(s),i.delete(a.id),i.size===0))break;if(n.length>0){r=r.slice();for(let s of n.reverse())r.splice(s,1)}return{...t,items:r,activationTrigger:1}},7:(t,e)=>t.buttonElement===e.element?t:{...t,buttonElement:e.element},8:(t,e)=>t.itemsElement===e.element?t:{...t,itemsElement:e.element},9:t=>t.pendingShouldSort?{...t,...aU(t),pendingShouldSort:!1}:t,10(t){return t.buttonPositionState.kind!=="Tracked"?t:{...t,buttonPositionState:rv.Moved}}},wGe=class rte extends see{constructor(e){super(e),sU(this,"actions",{registerItem:SF(()=>{let r=[],n=new Set;return[(i,s)=>{n.has(s)||(n.add(s),r.push({id:i,dataRef:s}))},()=>(n.clear(),this.send({type:5,items:r.splice(0)}))]}),unregisterItem:SF(()=>{let r=[];return[n=>r.push(n),()=>this.send({type:6,items:r.splice(0)})]})}),sU(this,"selectors",{activeDescendantId(r){var n;let i=r.activeItemIndex,s=r.items;return i===null||(n=s[i])==null?void 0:n.id},isActive(r,n){var i;let s=r.activeItemIndex,a=r.items;return s!==null?((i=a[s])==null?void 0:i.id)===n:!1},shouldScrollIntoView(r,n){return r.__demoMode||r.menuState!==0||r.activationTrigger===0?!1:this.isActive(r,n)},didButtonMove(r){return r.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let r=this.state.id,n=k5.get(null);this.disposables.add(n.on(oee.Push,i=>{!n.selectors.isTop(i,r)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>n.actions.push(r)),this.on(1,()=>n.actions.pop(r))}this.disposables.group(r=>{this.on(1,n=>{n.buttonElement&&(r.dispose(),r.add(OHe(n.buttonElement,n.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:e,__demoMode:r=!1}){return new rte({id:e,__demoMode:r,menuState:r?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:Qn.Nothing},buttonPositionState:rv.Idle})}reduce(e,r){return Po(r.type,vGe,e,r)}};const nte=C.createContext(null);function gI(t){let e=C.useContext(nte);if(e===null){let r=new Error(`<${t} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ite),r}return e}function ite({id:t,__demoMode:e=!1}){let r=C.useMemo(()=>wGe.new({id:t,__demoMode:e}),[]);return fI(()=>r.dispose()),r}let EGe=C.Fragment;function xGe(t,e){let r=C.useId(),{__demoMode:n=!1,...i}=t,s=ite({id:r,__demoMode:n}),[a,o,c]=Pa(s,y=>[y.menuState,y.itemsElement,y.buttonElement]),l=Es(e),u=k5.get(null),d=Pa(u,C.useCallback(y=>u.selectors.isTop(y,r),[u,r]));mee(d,[c,o],(y,b)=>{var E;s.send({type:Zr.CloseMenu}),aI(b,sI.Loose)||(y.preventDefault(),(E=s.state.buttonElement)==null||E.focus())});let f=rr(()=>{s.send({type:Zr.CloseMenu})}),h=Cc({open:a===Zi.Open,close:f}),g={ref:l},m=ei();return Rt.createElement(vHe,null,Rt.createElement(nte.Provider,{value:s},Rt.createElement(Lee,{value:Po(a,{[Zi.Open]:ps.Open,[Zi.Closed]:ps.Closed})},m({ourProps:g,theirProps:i,slot:h,defaultTag:EGe,name:"Menu"}))))}let _Ge="button";function CGe(t,e){let r=gI("Menu.Button"),n=C.useId(),{id:i=`headlessui-menu-button-${n}`,disabled:s=!1,autoFocus:a=!1,...o}=t,c=C.useRef(null),l=mHe(),u=Es(e,c,gHe(),rr($=>r.send({type:Zr.SetButtonElement,element:$}))),d=rr($=>{switch($.key){case yi.Space:case yi.Enter:case yi.ArrowDown:$.preventDefault(),$.stopPropagation(),r.send({type:Zr.OpenMenu,focus:{focus:Qn.First}});break;case yi.ArrowUp:$.preventDefault(),$.stopPropagation(),r.send({type:Zr.OpenMenu,focus:{focus:Qn.Last}});break}}),f=rr($=>{switch($.key){case yi.Space:$.preventDefault();break}}),[h,g,m]=Pa(r,$=>[$.menuState,$.buttonElement,$.itemsElement]),y=h===Zi.Open;Fze(y,{trigger:g,action:C.useCallback($=>{if(g!=null&&g.contains($.target))return gb.Ignore;let P=$.target.closest('[role="menuitem"]:not([data-disabled])');return ma(P)?gb.Select(P):m!=null&&m.contains($.target)?gb.Ignore:gb.Close},[g,m]),close:C.useCallback(()=>r.send({type:Zr.CloseMenu}),[]),select:C.useCallback($=>$.click(),[])});let b=yze($=>{var P;s||(h===Zi.Open?(bl.flushSync(()=>r.send({type:Zr.CloseMenu})),(P=c.current)==null||P.focus({preventScroll:!0})):($.preventDefault(),r.send({type:Zr.OpenMenu,focus:{focus:Qn.Nothing},trigger:$w.Pointer})))}),{isFocusVisible:E,focusProps:v}
474=cne({autoFocus:a}),{isHovered:w,hoverProps:x}=lne({isDisabled:s}),{pressed:_,pressProps:S}=WWe({disabled:s}),A=Cc({open:h===Zi.Open,active:_||h===Zi.Open,disabled:s,hover:w,focus:E,autofocus:a}),I=KJ(l(),{ref:u,id:i,type:Uze(t,c.current),"aria-haspopup":"menu","aria-controls":m==null?void 0:m.id,"aria-expanded":h===Zi.Open,disabled:s||void 0,autoFocus:a,onKeyDown:d,onKeyUp:f},b,v,x,S);return ei()({ourProps:I,theirProps:o,slot:A,defaultTag:_Ge,name:"Menu.Button"})}let SGe="div",AGe=f0.RenderStrategy|f0.Static;function TGe(t,e){let r=C.useId(),{id:n=`headlessui-menu-items-${r}`,anchor:i,portal:s=!1,modal:a=!0,transition:o=!1,...c}=t,l=pHe(i),u=gI("Menu.Items"),[d,f]=bHe(l),h=yHe(),[g,m]=C.useState(null),y=Es(e,l?d:null,rr(U=>u.send({type:Zr.SetItemsElement,element:U})),m),[b,E]=Pa(u,U=>[U.menuState,U.buttonElement]),v=Km(E),w=Km(g);l&&(s=!0);let x=o2(),[_,S]=wee(o,g,x!==null?(x&ps.Open)===ps.Open:b===Zi.Open);uee(_,E,()=>{u.send({type:Zr.CloseMenu})});let A=Pa(u,U=>U.__demoMode),I=A?!1:a&&b===Zi.Open;bee(I,w);let $=A?!1:a&&b===Zi.Open;lee($,{allowed:C.useCallback(()=>[E,g],[E,g])});let P=Pa(u,u.selectors.didButtonMove)?!1:_;C.useEffect(()=>{let U=g;U&&b===Zi.Open&&(VJ(U)||U.focus({preventScroll:!0}))},[b,g]),tVe(b===Zi.Open,{container:g,accept(U){return U.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:U.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(U){U.setAttribute("role","none")}});let j=mh(),L=rr(U=>{var W,V,Y;switch(j.dispose(),U.key){case yi.Space:if(u.state.searchQuery!=="")return U.preventDefault(),U.stopPropagation(),u.send({type:Zr.Search,value:U.key});case yi.Enter:if(U.preventDefault(),U.stopPropagation(),u.state.activeItemIndex!==null){let{dataRef:K}=u.state.items[u.state.activeItemIndex];(V=(W=K.current)==null?void 0:W.domRef.current)==null||V.click()}u.send({type:Zr.CloseMenu}),fee(u.state.buttonElement);break;case yi.ArrowDown:return U.preventDefault(),U.stopPropagation(),u.send({type:Zr.GoToItem,focus:Qn.Next});case yi.ArrowUp:return U.preventDefault(),U.stopPropagation(),u.send({type:Zr.GoToItem,focus:Qn.Previous});case yi.Home:case yi.PageUp:return U.preventDefault(),U.stopPropagation(),u.send({type:Zr.GoToItem,focus:Qn.First});case yi.End:case yi.PageDown:return U.preventDefault(),U.stopPropagation(),u.send({type:Zr.GoToItem,focus:Qn.Last});case yi.Escape:U.preventDefault(),U.stopPropagation(),bl.flushSync(()=>u.send({type:Zr.CloseMenu})),(Y=u.state.buttonElement)==null||Y.focus({preventScroll:!0});break;case yi.Tab:U.preventDefault(),U.stopPropagation(),bl.flushSync(()=>u.send({type:Zr.CloseMenu})),Dze(u.state.buttonElement,U.shiftKey?fo.Previous:fo.Next);break;default:U.key.length===1&&(u.send({type:Zr.Search,value:U.key}),j.setTimeout(()=>u.send({type:Zr.ClearSearch}),350));break}}),B=rr(U=>{switch(U.key){case yi.Space:U.preventDefault();break}}),k=Cc({open:b===Zi.Open}),D=KJ(l?h():{},{"aria-activedescendant":Pa(u,u.selectors.activeDescendantId),"aria-labelledby":Pa(u,U=>{var W;return(W=U.buttonElement)==null?void 0:W.id}),id:n,onKeyDown:L,onKeyUp:B,role:"menu",tabIndex:b===Zi.Open?0:void 0,ref:y,style:{...c.style,...f,"--button-width":mze(_,E,!0).width},...vee(S)}),q=ei();return Rt.createElement(Wee,{enabled:s?t.static||_:!1,ownerDocument:v},q({ourProps:D,theirProps:c,slot:k,defaultTag:SGe,features:AGe,visible:P,name:"Menu.Items"}))}let IGe=C.Fragment;function kGe(t,e){let r=C.useId(),{id:n=`headlessui-menu-item-${r}`,disabled:i=!1,...s}=t,a=gI("Menu.Item"),o=Pa(a,P=>a.selectors.isActive(P,n)),c=C.useRef(null),l=Es(e,c),u=Pa(a,P=>a.selectors.shouldScrollIntoView(P,n));hn(()=>{if(u)return Gs().requestAnimationFrame(()=>{var P,j;(j=(P=c.current)==null?void 0:P.scrollIntoView)==null||j.call(P,{block:"nearest"})})},[u,c]);let d=mGe(c),f=C.useRef({disabled:i,domRef:c,get textValue(){return d()}});hn(()=>{f.current.disabled=i},[f,i]),hn(()=>(a.actions.registerItem(n,f),()=>a.actions.unregisterItem(n)),[f,n]);let h=rr(()=>{a.send({type:Zr.CloseMenu})}),g=rr(P=>{if(i)return P.preventDefault();a.send({type:Zr.CloseMenu}),fee(a.state.buttonElement)}),m=rr(()=>{if(i)return a.send({type:Zr.GoToItem,focus:Qn.Nothing});a.send({type:Zr.GoToItem,focus:Qn.Specific,id:n})}),y=Gze(),b=rr(P=>y.update(P)),E=rr(P=>{y.wasMoved(P)&&(i||o||a.send({type:Zr.GoToItem,focus:Qn.Specific,id:n,trigger:$w.Pointer}))}),v=rr(P=>{y.wasMoved(P)&&(i||o&&a.state.activationTrigger===$w.Pointer&&a.send({type:Zr.GoToItem,focus:Qn.Nothing}))}),[w,x]=tee(),[_,S]=eee(),A=Cc({active:o,focus:o,disabled:i,close:h}),I={id:n,ref:l,role:"menuitem",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-labelledby":w,"aria-describedby":_,disabled:void 0,onClick:g,onFocus:m,onPointerEnter:b,onMouseEnter:b,onPointerMove:E,onMouseMove:E,onPointerLeave:v,onMouseLeave:v},$=ei();return Rt.createElement(x,null,Rt.createElement(S,null,$({ourProps:I,theirProps:s,slot:A,defaultTag:IGe,name:"Menu.Item"})))}let $Ge="div";function NGe(t,e){let[r,n]=tee(),i=t,s={ref:e,"aria-labelledby":r,role:"group"},a=ei();return Rt.createElement(n,null,a({ourProps:s,theirProps:i,slot:{},defaultTag:$Ge,name:"Menu.Section"}))}let PGe="header";function OGe(t,e){let r=C.useId(),{id:n=`headlessui-menu-heading-${r}`,...i}=t,s=iI();hn(()=>s.register(n),[n,s.register]);let a={id:n,ref:e,role:"presentation",...s.props};return ei()({ourProps:a,theirProps:i,slot:{},defaultTag:PGe,name:"Menu.Heading"})}let RGe="div";function DGe(t,e){let r=t,n={ref:e,role:"separator"};return ei()({ourProps:n,theirProps:r,slot:{},defaultTag:RGe,name:"Menu.Separator"})}let MGe=jn(xGe),ste=jn(CGe),ate=jn(TGe),ote=jn(kGe),jGe=jn(NGe),LGe=jn(OGe),FGe=jn(DGe),UGe=Object.assign(MGe,{Button:ste,Items:ate,Item:ote,Section:jGe,Heading:LGe,Separator:FGe});function BGe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const U5=C.forwardRef(BGe),qGe=({options:t,onSelect:e,selected:r,className:n})=>p.jsxs(UGe,{as:WGe,children:[p.jsxs(ste,{as:HGe,children:[p.jsx(Y7,{balance:r.balance,chain:r.chain}),p.jsx(aC,{height:16})]}),p.jsx(ate,{as:zGe,className:n,children:t.map(((i,s)=>p.jsx(ote,{as:VGe,onClick:()=>e(s),children:p.jsx(Y7,{balance:i.balance,chain:i.chain})}
474,s)))})]});let WGe=oe.div.withConfig({displayName:"Wrapper",componentId:"sc-7924b61-0"})(["width:100%;position:relative;"]),zGe=oe.div.withConfig({displayName:"Popover",componentId:"sc-7924b61-1"})(["width:100%;margin-top:0.5rem;position:absolute;background-color:var(--privy-color-background);border-radius:var(--privy-border-radius-md);overflow-x:hidden;overflow-y:auto;box-shadow:0px 1px 2px 0px rgba(16,24,40,0.05);max-height:11.75rem;&&{border:solid 1px var(--privy-color-foreground-4);}z-index:1;"]),VGe=oe.button.withConfig({displayName:"Button",componentId:"sc-7924b61-2"})(["width:100%;display:flex;justify-content:space-between;&&{padding:1rem;}:not(:last-child){border-bottom:solid 1px var(--privy-color-foreground-4);}:hover{background:var(--privy-color-background-2);}"]),aC=oe(U5).withConfig({displayName:"StyledChevronIcon",componentId:"sc-7924b61-3"})(["height:1rem;margin-left:0.5rem;"]),HGe=oe.button.withConfig({displayName:"StyledMenuButton",componentId:"sc-7924b61-4"})([""," span{margin-left:auto;}","{transition:rotate 100ms ease-in;}&[aria-expanded='true']{","{rotate:-180deg;}}"],dJ,aC,aC),GGe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),cte=t=>GGe.format(t);const lte=(t,e)=>{let r=cte(e*parseFloat(t));return r!=="$0.00"?r:"<$0.01"},wf=(t,e)=>{let r=cte(e*parseFloat(Tq(t)));return r==="$0.00"?"<$0.01":r},Da=(t,e,r=6,n=!1)=>{let i=parseFloat(Tq(t)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return n?`${i} ${e}`:`${i==="0"?"<0.001":i} ${e}`},mI=t=>t.map(cs).reduce(((e,r)=>e.add(r)),zt.from(0)).toHexString(),KGe=(t,e)=>{let{chains:r}=bt(),n=`https://etherscan.io/address/${e}`,i=`${R8e(t,r)}/address/${e}`;if(!i)return n;try{new URL(i)}catch{return n}return i};function QGe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const ute=C.forwardRef(QGe);function YGe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const ZGe=C.forwardRef(YGe);function XGe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const dte=C.forwardRef(XGe),c2=({style:t,...e})=>p.jsx("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...t},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H1
4747.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})}),l2=({style:t,...e})=>p.jsxs("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...t},xmlns:"http://www.w3.org/2000/svg",...e,children:[p.jsxs("g",{clipPath:"url(#clip0_113_33841)",children:[p.jsx("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),p.jsx("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),p.jsx("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),p.jsx("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642
47417.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),p.jsx("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),p.jsx("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),p.jsx("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),p.jsx("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),p.jsx("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),p.jsx("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),p.jsx("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),p.jsx("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),p.jsx("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),p.jsx("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),p.jsx("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),p.jsx("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),p.jsx("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),p.jsx("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.43
47401C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),p.jsx("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),p.jsx("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),p.jsx("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),p.jsx("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_113_33841",children:p.jsx("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});let oU=({passkeys:t,expanded:e,onUnlink:r,onExpand:n})=>{let[i,s]=C.useState([]),a=e?t.length:2;return p.jsxs("div",{children:[p.jsx(aKe,{children:"Your passkeys"}),p.jsxs(fte,{children:[t.slice(0,a).map((o=>{return p.jsxs(lKe,{children:[p.jsxs("div",{children:[p.jsx(oKe,{children:(c=o,c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device")}),p.jsxs(cKe,{children:["Last used: ",(o.latestVerifiedAt??o.verifiedAt).toLocaleString()]})]}),p.jsx(dKe,{disabled:i.includes(o.credentialId),onClick:()=>(async l=>{s((u=>u.concat([l]))),await r(l),s((u=>u.filter((d=>d!==l))))})(o.credentialId),children:i.includes(o.credentialId)?p.jsx(pd,{}):p.jsx(ZGe,{height:"1.6em"})})]},o.credentialId);var c})),t.length>2&&!e&&p.jsx(nKe,{onClick:n,children:"View all"})]})]})},JGe=()=>p.jsxs(fte,{children:[p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(dte,{})}),"Log in with Touch ID, Face ID, or a security key."]}),p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(kJ,{})}),"More secure than a password."]}),p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(ute,{})}),"Takes seconds to set up and use."]})]});const eKe=()=>{let{user:t,unlinkPasskey:e}=Sr(),{linkWithPasskey:r,closePrivyModal:n}=bt(),i=t==null?void 0:t.linkedAccounts.filter((g=>g.type==="passkey")),[s,a]=C.useState(!1),[o,c]=C.useState(""),[l,u]=C.useState(!1),[d,f]=C.useState(!1);C.useEffect((()=>{i.length===0&&f(!1)}),[i.length]);let h=async g=>(a(!0),await e(g).then((()=>u(!0))).catch((m=>{m instanceof Fs&&m.privyErrorCode===Se.MISSING_MFA_CREDENTIALS?c("Cannot unlink a passkey enrolled in MFA"):c("Unknown error occurred.")})).finally((()=>{a(!1)})));return p.jsxs(p.Fragment,l?{children:[p.jsx(lt,{onClose:()=>n()},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Mo,{})}),p.jsx(cU,{style:{marginBottom:"1.5rem"},children:"Passkeys updated"}),p.jsx(iKe,{children:" "}),p.jsx(Na,{children:p.jsx(Mt,{onClick:()=>n(),children:"Done"})}),p.jsx(vr,{})]}:d?{children:[p.jsx(lt,{backFn:()=>f(!1),onClose:()=>n()}
474,"header"),p.jsx(oU,{passkeys:i,expanded:d,onUnlink:h,onExpand:()=>f(!0)}),p.jsx(vr,{})]}:{children:[p.jsx(lt,{onClose:()=>n()},"header"),p.jsx(Uy,{children:p.jsxs(yI,{children:[p.jsx(c2,{}),p.jsx(l2,{})]})}),p.jsx(cU,{children:"Secure your account with a passkey"}),p.jsx(sKe,{}),i.length===0?p.jsx(JGe,{}):p.jsx(oU,{passkeys:i,expanded:d,onUnlink:h,onExpand:()=>f(!0)}),p.jsxs(Na,{style:{marginTop:"12px"},children:[o&&p.jsx(tKe,{$fail:!0,children:o}),p.jsx(Mt,{onClick:()=>{a(!0),r().then((()=>u(!0))).catch((g=>{if(g instanceof Fs){if(g.privyErrorCode===Se.CANNOT_LINK_MORE_OF_TYPE)return void c("Cannot link more passkeys to account.");if(g.privyErrorCode===Se.PASSKEY_NOT_ALLOWED)return void c("Passkey request timed out or rejected by user.")}c("Unknown error occurred.")})).finally((()=>{a(!1)}))},loading:s,children:"Add new passkey"})]}),p.jsx(vr,{})]})},yI=oe.div.withConfig({displayName:"DoubleIconWrapper",componentId:"sc-302702bc-0"})(["display:flex;align-items:center;justify-content:center;width:180px;height:90px;border-radius:50%;svg + svg{margin-left:12px;}> svg{z-index:2;color:var(--privy-color-accent) !important;stroke:var(--privy-color-accent) !important;fill:var(--privy-color-accent) !important;}"]);let tKe=oe.div.withConfig({displayName:"InputHelp",componentId:"sc-302702bc-1"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-beginngin;width:100%;"],(t=>t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)")),rKe=ns(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:6px 8px;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent) !important;:focus{outline:none;box-shadow:none;}}"]);const nKe=oe.button.withConfig({displayName:"LinkButton",componentId:"sc-302702bc-2"})(["",""],rKe);let fte=oe.div.withConfig({displayName:"List",componentId:"sc-302702bc-3"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.8rem;padding:0.5rem 0rem 0rem;flex-grow:1;width:100%;"]),cU=oe.div.withConfig({displayName:"ModalTitle",componentId:"sc-302702bc-4"})(["font-size:18px;line-height:18px;text-align:center;font-weight:600;"]),iKe=oe.div.withConfig({displayName:"ModalSubTitle",componentId:"sc-302702bc-5"})(["font-size:0.875rem;text-align:center;margin-top:10px;"]),sKe=oe.div.withConfig({displayName:"SectionSpacer",componentId:"sc-302702bc-6"})(["height:32px;"]),aKe=oe.div.withConfig({displayName:"PasskeyListTitle",componentId:"sc-302702bc-7"})(["line-height:20px;height:20px;font-size:1em;font-weight:450;display:flex;justify-content:flex-beginning;width:100%;"]),oKe=oe.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-302702bc-8"})(["font-size:1em;line-height:1.3em;font-weight:500;color:var(--privy-color-foreground-2);padding:0.2em 0;"]),cKe=oe.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-302702bc-9"})(["font-size:0.875rem;line-height:1rem;color:#64668b;padding:0.2em 0;"]),lKe=oe.div.withConfig({displayName:"PasskeyListItem",componentId:"sc-302702bc-10"})(["display:flex;align-items:center;justify-content:space-between;padding:1em;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;border-radius:8px;border:1px solid #e2e3f0 !important;width:100%;height:5em;"]),uKe=ns([":focus,:hover,:active{outline:none;}display:flex;width:2em;height:2em;justify-content:center;align-items:center;svg{color:var(--privy-color-error);}svg:hover{color:var(--privy-color-foreground-3);}"]),dKe=oe.button.withConfig({displayName:"PasskeyItemUnlinkButton",componentId:"sc-302702bc-11"})(["",""],uKe);const fKe=oe.div.withConfig({displayName:"FundingMethodContainer",componentId:"sc-eaaa12a-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),g1=oe.div.withConfig({displayName:"IconContainer",componentId:"sc-eaaa12a-1"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;svg{border-radius:var(--privy-border-radius-sm);}
474"]),hte=oe.div.withConfig({displayName:"FundingQuantityWrapper",componentId:"sc-eaaa12a-2"})(["display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px;"]),pte=oe.div.withConfig({displayName:"FundingQuantity",componentId:"sc-eaaa12a-3"})(["display:flex;align-items:center;gap:4px;width:100%;padding:0 16px;border-width:1px !important;border-radius:12px;cursor:text;&:focus-within{border-color:var(--privy-color-accent);}"]),gte=oe.input.withConfig({displayName:"FundingAmountInput",componentId:"sc-eaaa12a-5"})(["background-color:var(--privy-color-background);width:100%;&:focus{outline:none !important;border:none !important;box-shadow:none !important;}&&{font-size:26px;}"]),hKe=oe(gte).withConfig({displayName:"FundingAmountInputLarge",componentId:"sc-eaaa12a-6"})(["&&{font-size:42px;}"]),mte=oe.div.withConfig({displayName:"FundingCurrency",componentId:"sc-eaaa12a-8"})(["font-size:18px;"]),yte=oe.div.withConfig({displayName:"FundingDollars",componentId:"sc-eaaa12a-9"})(["font-size:12px;color:var(--privy-color-foreground-3);height:20px;"]),pKe=oe.div.withConfig({displayName:"InfoButtonText",componentId:"sc-eaaa12a-13"})([""]),gKe=oe.a.withConfig({displayName:"InfoButtonLink",componentId:"sc-eaaa12a-14"})(["&&{color:var(--privy-color-accent);}cursor:pointer;"]),bte=({displayName:t,errorMessage:e,configuredFundingChain:r,formattedBalance:n,fundingAmount:i,fundingCurrency:s,fundingAmountInUsd:a,options:o,selectedOption:c,isPreparing:l,isSubmitting:u,addressToFund:d,fundingWalletAddress:f,onSubmit:h,onSelect:g,onAmountChange:m})=>{let y=C.useRef(null);return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(Lr,{}),p.jsx(Pl,{children:"Transfer from another network"}),p.jsxs(bd,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),p.jsxs(hte,{style:{marginTop:"2rem"},children:[p.jsxs(pte,{onClick:()=>{var b;return(b=y.current)==null?void 0:b.focus()},children:[p.jsx(gte,{ref:y,value:i,onChange:b=>{let E=b.target.value;/^[0-9.]*$/.test(E)&&E.split(".").length-1<=1&&m(E)}}),p.jsx(mte,{children:s})]}),a&&p.jsx(yte,{children:a})]}),p.jsxs(pr,{style:{marginTop:"1.5rem"},children:[p.jsx(hr,{children:"From"}),p.jsx(hr,{children:QP(f)})]}),p.jsx(qGe,{selected:{chain:c.chain,balance:Da(c.balance,c.chain.nativeCurrency.symbol,3,!0)},options:o.map((({chain:b,balance:E})=>({chain:b,balance:Da(E,b.nativeCurrency.symbol,3,!0)}))),onSelect:g}),p.jsxs(pr,{style:{marginTop:"1.5rem"},children:[p.jsx(hr,{children:"To"}),p.jsx(hr,{children:QP(d)})]}),p.jsx(RWe,{chain:r,balance:n}),p.jsx(Nl,{style:{marginTop:"1rem"},children:e}),p.jsxs(Fm,{style:{marginTop:"1rem"},loading:u||l,disabled:l||u,onClick:h,children:["Confirm with ",t]}),p.jsx(qr,{}),p.jsx(Ht,{})]})},B5=({wallet:t,displayName:e,addressToFund:r,chainId:n,chainName:i,isBridging:s,isErc20Flow:a,totalPriceInNativeCurrency:o,totalPriceInUsd:c,gasPriceInNativeCurrency:l,gasPriceInUsd:u})=>p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(q0,{}),p.jsx(ko,{style:{marginTop:"16px"},children:p.jsx(JQ,{icon:iY(t.walletClientType,t.connectorType,t.walletClientType),name:t.walletClientType})}),p.jsx(wn,{style:{marginTop:"8px",marginBottom:"12px"},title:`${s?"Bridging":"Confirming"} with ${e}`}),!s&&!a&&p.jsxs(z0,{children:[p.jsxs(pr,{children:[p.jsx(hr,{children:"Total"}),p.jsx(yr,{children:c||o})]}),p.jsxs(pr,{children:[p.jsx(hr,{children:"To"}),p.jsx(yr,{children:p.jsx(_i,{address:r,showCopyIcon:!1})})]}),p.jsxs(pr,{children:[p.jsx(hr,{children:"Network"}),p.jsx(yr,{children:p.jsxs(mKe,{children:[p.jsx(zJ,{chainId:n,height:16,width:16})," ",i]})})]}),l&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Estimated fee"}),p.jsx(yr,{children:u||l})]})]}),p.jsx(sT,{height:24}),p.jsx(Ht,{})]});let mKe=oe.div.withConfig({displayName:"NetworkColumn",componentId:"sc-67160e5-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);const yKe=()=>{let{rpcConfig:t,appId:e,closePrivyModal:r,createAnalyticsEvent:n}=bt(),{navigate:i,setModalData:s,app:a,data:o}=ht(),{wallets:c}=ph(),l=r2(),[u,d]=C.useState(null),[f,h]=C.useState(null),[g,m]=C.useState([]),[y,b]=C.useState(0),[E,v]=C.useState(!1),[w,x]=C.useState(!1),[_,S]=C.useState(!1),[A,I]=C.useState(!1);if(!(o!=null&&o.funding)||o.funding.chainType!=="solana")throw Error("Invalid funding data");let{address:$,cluster:P,connectedWalletAddress:j}=o.funding,[L,B]=C.useState(o.funding.amount),k=j?c.find((({address:me})=>me===j)):c[0],[D,q]=C.useState(null);C.useEffect((()=>{(async()=>
474{if(!k)return;let me=await k.getEthereumProvider();q(RG({account:k.address,transport:MG(me)}).extend(SA))})().catch(console.error)}),[k]);let[U,W]=C.useState(0n),V=Bu(U);C.useEffect((()=>{let me=l(n2);me?me.getBalance({address:$,cluster:P}).then((_e=>W(BigInt(_e)))):console.warn("Unable to load solana plugin, skipping balance")}),[]);let[Y,K]=C.useState(),{tokenPrice:ge}=W0("solana"),{fundingAmountInBaseUnit:ae,fundingAmountInUsd:ce}=LJ({amount:L,fee:0n,tokenPrice:ge});C.useEffect((()=>{(async()=>{if(!D||!k)return;let me=["testnet","devnet"].includes(P.name);me&&console.warn("Solana testnets are not supported for bridging");let _e=QA(a.chains).filter((({testnet:ie})=>!!ie===me)),z=(await BJ({chains:_e,address:k.address,appId:e,rpcConfig:t})).filter((ie=>ie.balance>0n));if(z.length<1)return void d(new xe(`Wallet ${fs(k.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE));z.sort(((ie,le)=>Number(le.balance-ie.balance)));let R=(await Promise.allSettled(z.map((async ie=>({...ie,quote:await Gm({isTestnet:!1,input:Hm({amount:ae.toString(),user:k.address,recipient:$,destinationChainId:l7,destinationCurrency:u7,originChainId:ie.chain.id})})}))))).filter((ie=>ie.status==="fulfilled")).map((ie=>ie.value));if(R.length<1)return void d(new xe(`Unable to fetch quotes for bridging. Wallet ${fs(k.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE));let M=R.map((({quote:ie,balance:le,chain:ye})=>({bridgeTx:_w(ie),balance:le,chain:ye}))).filter((({bridgeTx:ie})=>!!ie));if(M.length>1)return void m(M);let ee=M.at(0);ee?(x(!0),K({data:ee.bridgeTx.data,to:ee.bridgeTx.to,value:ee.bridgeTx.value,chain:ee.chain})):d(new xe(`Unable to select bridge option from quotes. Wallet ${fs(k.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE))})().catch(console.error)}),[D]),C.useEffect((()=>{(async()=>{var R;let me,_e;if(!D||!k||E||_||!Y)return;v(!0);let z=Of({chain:Y.chain,transport:Rf(Zu(Y.chain,t,e))});try{me=await z.prepareTransactionRequest({account:k.address,to:Y.to,chain:Y.chain,data:Y.data,value:BigInt(Y.value??0)})}catch(M){console.error(M),g.length>1&&h(M.shortMessage??"Something went wrong")}if(me){v(!1),S(!0);try{await D.switchChain({id:Y.chain.id})}catch{await D.addChain({chain:Y.chain}),await D.switchChain({id:Y.chain.id})}try{_e=await D.sendTransaction(me),n({eventName:Ol,payload:{provider:"external",status:"success",address:k.address,chainId:Y.chain.id,value:(R=Y.value)==null?void 0:R.toString(),txHash:_e}})}catch(M){console.error(M),M.name==="TransactionExecutionError"&&(g.length<1?d(new xe(M.shortMessage,void 0,Se.TRANSACTION_FAILURE)):h(M.shortMessage??"Something went wrong"))}_e?(await D.waitForTransactionReceipt({hash:_e}),S(!1),I(!0)):S(!1)}else v(!1)})().catch(console.error)}),[D,Y]),C.useEffect((()=>{if(!u)return;let me={error:u,previousScreen:de.FUNDING_TRANSFER_FROM_WALLET_SCREEN};s({funding:o==null?void 0:o.funding,sendTransaction:o==null?void 0:o.sendTransaction,errorModalData:me}),i(de.ERROR_SCREEN,!1)}),[u]);let Q=k?j0(k.walletClientType,k.connectorType,k.walletClientType)||"wallet":null;if(C.useEffect((()=>{if(!A)return;let me=setTimeout(r,M3);return()=>clearTimeout(me)}),[A]),A)return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(Lr,{}),p.jsxs(Vl,{children:[p.jsx(Mo,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Success!",description:`Youâve successfully added ${L} SOL to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(qr,{}),p.jsx(Ht,{})]});let se=g[y];return g.length>1&&se?p.jsx(bte,{displayName:Q,configuredFundingChain:P,formattedBalance:V,fundingAmount:L,fundingCurrency:"SOL",fundingAmountInUsd:ce,options:g,selectedOption:se,isPreparing:E,isSubmitting:_,addressToFund:$,fundingWalletAddress:(k==null?void 0:k.address)||"",errorMessage:f,onSubmit:()=>{var me;((me=o.funding)==null?void 0:me.amount)!==L?(async function(){if(k&&se)try{let _e=await Gm({isTestnet:!1,input:Hm({amount:ae.toString(),user:k.address,recipient:$,destinationChainId:l7,destinationCurrency:u7,originChainId:se.chain.id})}),z=_w(_e);if(!z)throw Error("Invalid transaction request");x(!0),K({data:z.data,to:z.to,value:z.value,chain:se.chain})}catch(_e){console.error(_e),d(new xe("Unable to fetch quotes for bridging",_e,Se.INSUFFICIENT_BALANCE))}})().catch(console.error):K({to:se.bridgeTx.to,data:se.bridgeTx.data,value:se.bridgeTx.value,chain:se.chain})},onSelect:me=>{me!==y&&(h(null),b(me))},onAmountChange:B}):_&&k?p.jsx(B5,{wallet:k,displayName:Q,addressToFund:$,isBridging:w,isErc20Flow:!1,chainId:"solana",chainName:P.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(q0,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(Ht,{})]})},u2=()=>{let{exportSolanaWallet:t,createEmbeddedSolanaWallet:e,solanaWallets:r,delegateWallet:n}=bt(),{ready:i}=ph(),{user:s}=Sr();return{ready:i,createWallet:e,exportWallet:t,delegateWalletAction:async()=>{let a=Jo(s);if(!a)throw new xe("User must have a solana wallet in order to delegate actions");return await n({address:a.address,chainType:"solana"})},wallets:r}},bKe=()=>{let{closePrivyModal:t,createAnalyticsEvent:e}=bt(),{navigate:r,setModalData:n,app:i,data:s}=ht(),{wallets:a}=u2(),o=r2(),[c,l]=C.useState(0n),[u,d]=C.useState(null),[f,h]=C.useState(!1),[g,m]=C.useState(!1),y=C.useRef(!1);if(!(s!=null&&s.funding)||s.funding.chainType!=="solana")throw Error("Invalid funding data");
474let{address:b,amount:E,cluster:v,connectedWalletAddress:w}=s.funding,x=P_e(v),{tokenPrice:_}=W0("solana"),{fundingAmountInBaseUnit:S,totalPriceInUsd:A,totalPriceInNativeCurrency:I,feePriceInNativeCurrency:$,feePriceInUsd:P}=LJ({amount:E,fee:c,tokenPrice:_}),j=w?a.find((({address:B})=>B===w)):a[0];if(C.useEffect((()=>{(async()=>{var B;if((j==null?void 0:j.type)==="solana"&&j.sendTransaction&&!f&&!y.current){y.current=!0;try{let k=o(n2);if(!k)throw new xe("Unable to load solana plugin");let{connection:D,transaction:q}=await k.createTransferTransaction({from:j.address,to:b,amount:S,cluster:v}),U=await q.getEstimatedFee(D);U!=null&&l(BigInt(U)),h(!0);let W=await D.simulateTransaction(q);if(W.value.err)return(B=W.value.logs)!=null&&B.find((Y=>/insufficient (lamports|funds)/gi.test(Y)))?void d(new xe(`Wallet ${fs(j.address,void 0,void 0,"solana")} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE)):(console.error("Transaction failed:",W.value.err),void d(new xe("Something went wrong",void 0,Se.TRANSACTION_FAILURE)));let V=await j.sendTransaction(q,D);e({eventName:Ol,payload:{provider:"external",status:"success",address:j.address,value:S.toString(),txHash:V,chainType:"solana",rpcEndpoint:x}}),h(!1),m(!0)}catch(k){if(console.error(k),h(!1),/user rejected the request/gi.test(k.message||""))return void d(new xe("Transaction was rejected by the user",void 0,Se.TRANSACTION_FAILURE));d(new xe("Something went wrong",void 0,Se.TRANSACTION_FAILURE))}}})().catch(console.error).finally((()=>y.current=!1))}),[]),C.useEffect((()=>{if(!u)return;let B={error:u,previousScreen:de.FUNDING_TRANSFER_FROM_WALLET_SCREEN};n({funding:s==null?void 0:s.funding,sendTransaction:s==null?void 0:s.sendTransaction,errorModalData:B}),r(de.ERROR_SCREEN,!1)}),[u]),C.useEffect((()=>{if(!g)return;let B=setTimeout(t,M3);return()=>clearTimeout(B)}),[g]),g)return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(Lr,{}),p.jsxs(Vl,{children:[p.jsx(Mo,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Success!",description:`Youâve successfully added ${E} SOL to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(qr,{}),p.jsx(Ht,{})]});let L=j?j0(j.walletClientType,j.connectorType,j.walletClientType)||"wallet":null;return j&&f?p.jsx(B5,{wallet:j,displayName:L,addressToFund:b,isBridging:!1,isErc20Flow:!1,totalPriceInUsd:A,totalPriceInNativeCurrency:I,gasPriceInUsd:P,gasPriceInNativeCurrency:$,chainId:"solana",chainName:v.name}):p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(q0,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(Ht,{})]})},oC=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];let vKe=2n**256n-1n;const vte=({amount:t,decimals:e})=>t===vKe?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:e}).format(Number(t)/10**e),wte=async({chain:t,address:e,appId:r,rpcConfig:n,erc20Address:i})=>({balance:await Of({chain:t,transport:Rf(Zu(t,n,r))}).readContract({address:i,abi:wKe,functionName:"balanceOf",args:[e]}).catch((()=>0n)),chain:t});let wKe=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];const EKe=()=>{let{rpcConfig:t,appId:e,closePrivyModal:r,createAnalyticsEvent:n}=bt(),{navigate:i,setModalData:s,app:a,data:o}=ht(),{wallets:c}=ph(),[l,u]=C.useState(!1),[d,f]=C.useState(0n),[h,g]=C.useState(!1),[m,y]=C.useState(null),[b,E]=C.useState(null),[v,w]=C.useState([]),[x,_]=C.useState(0),[S,A]=C.useState(!1),[I,$]=C.useState(!1),[P,j]=C.useState(!1),[L,B]=C.useState(!1);if(!(o!=null&&o.funding)||o.funding.chainType!=="ethereum")throw Error("Invalid funding data");let{erc20ContractInfo:k,chain:D,connectedWalletAddress:q}=o.funding,U=o.funding.address,W=o.funding.erc20Address,[V,Y]=C.useState(o.funding.amount);C.useEffect((()=>{W&&!k&&y(Error("Unable to fetch token details"))}),[]);let K=!!W&&!!k,ge=K?BigInt(parseFloat(V)*10**k.decimals):SG(V),ae=q?c.find((({address:Ae})=>Ae===q)):c[0],[ce,Q]=C.useState(null);C.useEffect((()=>{(async()=>
474{if(!ae)return;let Ae=await ae.getEthereumProvider();Q(RG({account:ae.address,transport:MG(Ae)}).extend(SA))})().catch(console.error)}),[ae]);let[se,me]=C.useState(0n);C.useEffect((()=>{Of({chain:D,transport:Rf(Zu(D,t,e))}).getBalance({address:U}).then(me).catch(console.error)}),[]);let[_e,z]=C.useState(0n);C.useEffect((()=>{K&&wte({chain:D,address:U,appId:e,rpcConfig:t,erc20Address:W}).then((Ae=>z(Ae.balance))).catch(console.error)}),[]);let{tokenPrice:R}=W0(D.id),[M,ee]=C.useState({to:U,chain:D,value:ge,data:void 0});C.useEffect((()=>{(async()=>{var Qe;let Ae,Ue;if(!ce||!ae||S||P)return;A(!0);let He=Of({chain:M.chain,transport:Rf(Zu(M.chain,t,e))});if(K&&!M.data)return await He.simulateContract({address:W,chain:M.chain,abi:oC,functionName:"transfer",args:[U,ge],account:ae.address}).catch((O=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",O)}))?(A(!1),void ee({to:W,chain:M.chain,data:ws({abi:oC,functionName:"transfer",args:[U,ge]}),value:"0x0"})):(A(!1),void g(!0));try{Ae=await He.prepareTransactionRequest({account:ae.address,to:M.to,chain:M.chain,data:M.data,value:BigInt(M.value??0)})}catch(O){if(console.error(O),v.length>1)E(O.shortMessage??"Something went wrong");else if(I&&v.length===0)return void y(new xe(`Wallet ${fs(ae.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE))}if(!Ae)return A(!1),void g(!0);A(!1),j(!0),u(!0),f(Ae.gas);try{await ce.switchChain({id:M.chain.id})}catch{await ce.addChain({chain:M.chain}),await ce.switchChain({id:M.chain.id})}try{Ue=await ce.sendTransaction(Ae),n({eventName:Ol,payload:{provider:"external",status:"success",address:ae.address,chainId:M.chain.id,value:(Qe=M.value)==null?void 0:Qe.toString(),txHash:Ue}})}catch(O){if(console.error(O),O.name==="TransactionExecutionError")if(v.length<1){let T=O.shortMessage;(O.shortMessage.includes("rejected the request")||O.details.includes("rejected the request"))&&(T="User rejected the request."),y(new xe(T,void 0,Se.TRANSACTION_FAILURE))}else E(O.shortMessage??"Something went wrong")}Ue?(await ce.waitForTransactionReceipt({hash:Ue}),j(!1),B(!0)):j(!1)})().catch(console.error)}),[ce,M]),C.useEffect((()=>{(async()=>{if(!h||!ce||!ae)return;let Ae=QA(a.chains).filter((N=>N.id!==D.id&&!!N.testnet==!!D.testnet));K&&Ae.unshift(D);let Ue=await BJ({chains:Ae,address:ae.address,appId:e,rpcConfig:t}),He=K?Ue.filter((N=>N.balance>0n)):Ue.filter((N=>N.balance>ge));if(He.length<1)return void y(new xe(`Wallet ${fs(ae.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE));He.sort(((N,G)=>Number(G.balance-N.balance)));let Qe=(await Promise.allSettled(He.map((async N=>({quote:await Gm({isTestnet:!!D.testnet,input:Hm({amount:ge.toString(),user:ae.address,recipient:U,destinationChainId:D.id,destinationCurrency:W,originChainId:N.chain.id})}),...N}))))).filter((N=>N.status==="fulfilled")).map((N=>N.value));if(Qe.length<1)return void y(new xe(`Wallet ${fs(ae.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE));let O=Qe.map((N=>({bridgeTx:_w(N.quote),balance:N.balance,chain:N.chain}))).filter((N=>!!N.bridgeTx));if(O.length>1)return void w(O);let T=O[0];T?($(!0),ee({data:T.bridgeTx.data,to:T.bridgeTx.to,value:T.bridgeTx.value,chain:T.chain})):y(new xe(`Wallet ${fs(ae.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE))})().catch(console.error)}),[h]),C.useEffect((()=>{if(!m)return;let Ae={error:m,previousScreen:de.FUNDING_TRANSFER_FROM_WALLET_SCREEN};s({funding:o==null?void 0:o.funding,sendTransaction:o==null?void 0:o.sendTransaction,errorModalData:Ae}),i(de.ERROR_SCREEN,!1)}),[m]);let ie=ae?j0(ae.walletClientType,ae.connectorType,ae.walletClientType)||"wallet":null,le=!K&&R?lte(V??"0",R):void 0,ye=K?d:mI([d,ge]),fe=ye&&R?wf(ye,R):void 0,we=ye?Da(ye,"ETH"):void 0,Ce=d&&R?wf(d,R):void 0,ne=d?Da(d,"ETH"):void 0;if(C.useEffect((()=>{if(!L)return;let Ae=setTimeout(r,M3);return()=>clearTimeout(Ae)}),[L]),L)return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(Lr,{}),p.jsxs(Vl,{children:[p.jsx(Mo,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Success!",description:`Youâve successfully added ${V} ${K?k.symbol:D.nativeCurrency.symbol} to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(qr,{}),p.jsx(Ht,{})]});let Re=K?`${vte({amount:_e,decimals:k.decimals})} ${k.symbol}`:Da(se,D.nativeCurrency.symbol,3,!0),Pe=v[x];return v.length>1&&Pe?p.jsx(bte,{displayName:ie,configuredFundingChain:D,formattedBalance:Re,fundingAmount:V,fundingCurrency:K?k.symbol:D.nativeCurrency.symbol,fundingAmountInUsd:le,options:v,selectedOption:Pe,isPreparing:S,isSubmitting:P,addressToFund:U,fundingWalletAddress:(ae==null?void 0:ae.address)||"",errorMessage:b,onSubmit:()=>{var Ae;((Ae=o.funding)==null?void 0:Ae.amount)!==V?(async function(){if(ae&&Pe)try{let Ue=await Gm({isTestnet:!!D.testnet,input:Hm({amount:ge.toString(),user:ae.address,recipient:U,destinationChainId:D.id,destinationCurrency:W,originChainId:Pe.chain.id})}),He=_w(Ue);if(!He)throw Error("Invalid transaction request");$(!0),ee({data:He.data,to:He.to,value:He.value,chain:Pe.chain})}catch(Ue){console.error(Ue),y(new xe("Unable to fetch quotes for bridging",Ue,Se.INSUFFICIENT_BALANCE))}})().catch(console.error):ee({to:Pe.bridgeTx.to,data:Pe.bridgeTx.data,value:Pe.bridgeTx.value,chain:Pe.chain})},onSelect:Ae=>{Ae!==x&&(E(null),_(Ae))},onAmountChange:Y}):l&&d&&ae&&(o!=null&&o.funding)?p.jsx(B5,{wallet:ae,displayName:ie,addressToFund:U,isBridging:I,isErc20Flow:K,totalPriceInUsd:fe,totalPriceInNativeCurrency:we,gasPriceInUsd:Ce,gasPriceInNativeCurrency:ne,chainId:D.id,chainName:
474D.name}):p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(q0,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(Ht,{})]})};function xKe(){let{closePrivyModal:t,createAnalyticsEvent:e}=bt(),{navigate:r,setModalData:n,app:i,data:s}=ht(),{wallets:a}=u2(),o=C.useRef(!1),c=r2(),[l,u]=C.useState(!1),[d,f]=C.useState(!1),[h,g]=C.useState(null);if(!(s!=null&&s.funding)||s.funding.chainType!=="ethereum")throw Error("Invalid funding data");let{amount:m,connectedWalletAddress:y,chain:b,cluster:E,isUSDC:v}=s.funding,w=s.funding.address,x=s.funding.erc20Address,_=s.funding.isUSDC?"USDC":b.nativeCurrency.symbol,S=E??{name:"mainnet-beta"},A=y?a.find((({address:I})=>I===y)):a[0];if(C.useEffect((()=>{(async function(){var L;if(!A||!b||o.current)return;let I=c(n2);if(!I)return void g(new xe("Unable to solana plugin"));o.current=!0,b!=null&&b.testnet&&console.warn("Solana testnets are not supported for bridging");let $=v?1e6*parseFloat(m):SG(m),P=await Gm({isTestnet:!!b.testnet,input:Hm({amount:$.toString(),user:A.address,recipient:w,destinationChainId:b.id,originChainId:l7,originCurrency:v?k_e:u7,destinationCurrency:v?x:void 0})}).catch(console.error);if(!P)return void g(new xe(`Unable to fetch quotes for bridging. Wallet ${w4(A.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE));let j=await I.createBridgeTransactionFromRelayQuote({quote:P,from:A.address,cluster:S});if(j)try{u(!0);let{connection:B,transaction:k}=j,D=await B.simulateTransaction(k);if(D.value.err)return(L=D.value.logs)!=null&&L.find((W=>/insufficient (lamports|funds)/gi.test(W)))?void g(new xe(`Wallet ${w4(A==null?void 0:A.address)} does not have enough funds. ${P.details.currencyIn.amountFormatted} ${_} are needed to complete the transaction.`,void 0,Se.INSUFFICIENT_BALANCE)):(console.error("Transaction failed:",D.value.err),void g(new xe("Something went wrong",void 0,Se.TRANSACTION_FAILURE)));let q=await A.sendTransaction(k,B),U=await B.confirmTransaction(q);
474if(U.value.err)return console.error("Transaction failed:",U.value.err),void g(new xe("Something went wrong",void 0,Se.TRANSACTION_FAILURE));e({eventName:Ol,payload:{provider:"external",status:"success",address:A.address,chainId:b.id,value:$.toString(),txHash:q}}),f(!0)}catch(B){if(console.error(B),/user rejected the request/gi.test(B.message||""))return void g(new xe("Transaction was rejected by the user",void 0,Se.TRANSACTION_FAILURE));g(new xe("Something went wrong",void 0,Se.TRANSACTION_FAILURE))}else g(new xe(`Unable to select bridge option from quotes. Wallet ${w4(A.address)} does not have enough funds.`,void 0,Se.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),C.useEffect((()=>{if(!d)return;let I=setTimeout(t,M3);return()=>clearTimeout(I)}),[d]),C.useEffect((()=>{if(!h)return;let I={error:h,previousScreen:de.FUNDING_TRANSFER_FROM_WALLET_SCREEN};n({funding:s==null?void 0:s.funding,sendTransaction:s==null?void 0:s.sendTransaction,errorModalData:I}),r(de.ERROR_SCREEN,!1)}),[h]),d)return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(Lr,{}),p.jsxs(Vl,{children:[p.jsx(Mo,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),p.jsx(wn,{title:"Success!",description:`Youâve successfully added ${m} ${_} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),p.jsx(qr,{}),p.jsx(Ht,{})]});if(l&&A){let I=A?j0(A.walletClientType,A.connectorType,A.walletClientType)||"wallet":null;return p.jsx(B5,{wallet:A,displayName:I,addressToFund:w,isBridging:l,isErc20Flow:!1,chainId:b.id,chainName:b.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0})}return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(q0,{}),p.jsx("div",{style:{marginTop:"1rem"}}),p.jsx(Ht,{})]})}function _Ke({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M15.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H7.5a.75.75 0 0 1 0-1.5h11.69l-3.22-3.22a.75.75 0 0 1 0-1.06Zm-7.94 9a.75.75 0 0 1 0 1.06l-3.22 3.22H16.5a.75.75 0 0 1 0 1.5H4.81l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const bI=C.forwardRef(_Ke),CKe=()=>{let{data:t,setModalData:e,navigate:r,navigateBack:n}=ht(),{closePrivyModal:i,createAnalyticsEvent:s,client:a}=bt(),[o,c]=C.useState("pending-in-flow"),l=C.useRef(0),u={...t==null?void 0:t.funding,showAlternateFundingMethod:!0};u.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1);let{partnerUserId:d,popup:f}=(t==null?void 0:t.coinbaseOnrampStatus)??{};return C.useEffect((()=>{if(o==="pending-in-flow"||o==="pending-after-flow"){let h=setInterval((async()=>{if(d)try{let{status:g}=await a.getCoinbaseOnRampStatus({partnerUserId:d});if(g==="success")return void c("success");if(g==="failure")throw Error("There was an error completing Coinbase Onramp flow.");if(l.current>=3)return e({funding:u}),void r(de.FUNDING_METHOD_SELECTION_SCREEN);f!=null&&f.closed&&(l.current=l.current+1,c("pending-after-flow"))}catch(g){console.error(g),c("error"),s({eventName:Ol,payload:{status:"failure",provider:"coinbase-onramp",error:g.message}}),e({funding:{...u,errorMessage:"Something went wrong adding funds. Please try again or use another method."}}),r(de.FUNDING_METHOD_SELECTION_SCREEN)}}),1500);return()=>clearInterval(h)}}),[d,f,o]),p.jsxs(p.Fragment,{children:[p.jsx(lt,{title:"Fund account",backFn:()=>{e({funding:u}),n()}},"header"),p.jsx(SKe,{status:o,onClickCta:i}),p.jsx(Ht,{})]})};let SKe=({status:t,onClickCta:e})=>{let{title:r,body:n,cta:i}=C.useMemo((()=>(s=>{switch(s){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from C
474oinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(t)),[t]);return p.jsxs(p.Fragment,{children:[p.jsxs(kKe,{children:[p.jsx(TKe,{isSucccess:t==="success"}),p.jsxs(ga,{children:[p.jsx("h3",{children:r}),p.jsx(IKe,{children:n})]})]}),i&&p.jsx(Mt,{onClick:e,children:i})]})},AKe=t=>t?jf:()=>p.jsx(bI,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),TKe=({isSucccess:t})=>{if(!t){let n="var(--privy-color-foreground-4)";return p.jsxs("div",{style:{position:"relative"},children:[p.jsx(Fa,{color:n,style:{position:"absolute"}}),p.jsx(XA,{color:n}),p.jsx(a7,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let e=AKe(t),r=t?"var(--privy-color-success)":"var(--privy-color-foreground-4)";return p.jsx("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:e&&p.jsx(e,{width:"4rem",height:"4rem",color:r})})},IKe=oe.p.withConfig({displayName:"StatusBody",componentId:"sc-96ef1540-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),kKe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-96ef1540-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);const $Ke=()=>{var f;let{data:t,setModalData:e}=ht(),r=t==null?void 0:t.funding,n=r.chainType==="solana",i=C.useRef(null),{tokenPrice:s}=W0(n?"solana":r.chain.id),a=n?void 0:r,o=!(!(a!=null&&a.erc20Address)||a!=null&&a.erc20ContractInfo),c=n?"SOL":r.erc20Address?(f=r.erc20ContractInfo)==null?void 0:f.symbol:r.chain.nativeCurrency.symbol||"ETH",l=parseFloat(r.amount),u=!isNaN(l)&&l>0,d=s?lte(r.amount,s):void 0;return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsx(Pl,{children:"Confirm or edit amount"}),p.jsxs(Y3,{style:{marginTop:"32px"},children:[p.jsx(hte,{children:o?p.jsx(q0,{size:"50px"}):p.jsxs(p.Fragment,{children:[p.jsxs(pte,{onClick:()=>{var h;return(h=i.current)==null?void 0:h.focus()},children:[p.jsx(hKe,{ref:i,value:r.amount,onChange:h=>{let g=h.target.value;/^[0-9.]*$/.test(g)&&g.split(".").length-1<=1&&e({...t,funding:{...r,amount:g}})}}),p.jsx(mte,{children:c})]}),!(a!=null&&a.erc20Address)&&p.jsx(yte,{children:d&&u?`${d} USD`:""})]})}),p.jsx(Fm,{style:{marginTop:"1rem"},disabled:!u,onClick:r.onContinueWithExternalWallet,children:"Continue"})]}),p.jsx(Ht,{})]})};function NKe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"}))}const PKe=C.forwardRef(NKe);function OKe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"}))}const RKe=C.forwardRef(OKe),DKe=({children:t,theme:e})=>p.jsxs(MKe,{$theme:e,children:[p.jsx(zl,{width:"3rem",color:"var(--privy-color-error)"}),t]});let MKe=oe.div.withConfig({displayName:"Container",componentId:"sc-5400b18f-0"})(["display:flex;gap:0.5rem;"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.75rem;font-weight:400;line-height:1.125rem;padding:0.5rem 0.75rem;&&{border:1px solid var(--privy-color-error);border-radius:var(--privy-border-radius-sm);}"],(t=>t.$theme==="dark"?"color: var(--privy-color-error);":"background-color: var(--privy-color-error-light);"));function jKe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const LKe=C.forwardRef(jKe),Ete=({children:t,theme:e})=>p.jsxs(FKe,{$theme:e,children:[p.jsx(LKe,{width:"1.25rem",color:e==="dark"?"var(--privy-color-accent-light)":"var(--privy-color-accent-dark)",style:{minWidth:"1.25rem"}}),t]});let FKe=oe.div.withConfig({displayName:"Container",componentId:"sc-dc8a0871-0"})(["display:flex;gap:0.5rem;background-color:",";color:var(--privy-color-foreground);align-items:flex-start;text-align:left;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);border:1px solid var(--privy-color-accent);}"],(t=>t.$theme==="dark"?"var(--privy-color-accent-darkest)":"var(--privy-color-accent-lightest)"));const UKe=t=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...t,children:p.jsx("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,
47416.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),BKe=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[p.jsx("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),p.jsx("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),p.jsx("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),p.jsx("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),p.jsx("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),p.jsx("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),p.jsx("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),lU=t=>{let[e,r]=C.useState();return C.useEffect((()=>{t().then((n=>{r(n)})).catch((()=>{}))}),[]),e},qKe=({...t})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...t,children:[p.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),p.jsx("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),p.jsx("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]}),xte=async({address:t,chain:e,rpcConfig:r,privyAppId:n})=>{try{let i=Of({chain:e,transport:Rf(Zu(e,r,n))}),[s,a]=await Promise.all([i.readContract({abi:uU,address:t,functionName:"symbol"}),i.readContract({abi:uU,address:t,functionName:"decimals"})]);return{decimals:a,symbol:s}}catch(i){return console.log(i),null}};let uU=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],WKe=new Set([_c.id,ql.id,nh.id,Wl.id,hd.id]),zKe=new Set([_c.id,ql.id,Wl.id,nh.id]);const VKe=(t,e)=>{switch(e){case"native-currency":return WKe.has(t);case"USDC":return zKe.has(t);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}},q5=()=>window.open(void 0,void 0,HKe({w:440,h:680}));let HKe=({w:t,h:e})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,n=window.screenTop!==void 0?window.screenTop:window.screenY,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,s=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;return`toolbar=0,location=0,menubar=0,height=${e},width=${t},popup=1,left=${(i-t)/2/(i/window.screen.availWidth)+r},top=${(s-e)/2/(s/window.screen.availHeight)+n}`};function GKe(t){let e=KKe[t];if(!e)throw new xe(`Unsupported chainId: ${t} for Coinbase Onramp`);return e}let KKe={[_c.id]:"ethereum",[ql.id]:"base",[nh.id]:"optimism",[Wl.id]:"polygon",[hd.id]:"arbitrum"};const dU=(t,e,r,n,i,s)=>new Promise((async(a,o)=>{let c=q5();if(!c)return void o(Error("Unable to initialize flow"));let l=e.chainType==="ethereum"?GKe(e.chain.id):"solana",u=e.isUSDC?"USDC":e.chainType==="ethereum"?"ETH":"SOL",d=await t.initCoinbaseOnRamp({addresses:[{address:e.address,blockchains:[l]}],assets:[u]}),{url:f}=uye({input:d,amount:e.amount,blockchain:l,asset:u,experience:s});c.location=f.toString();let h={...i==null?void 0:i.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(h.usingDefaultFundingMethod=!1),r({funding:h,coinbaseOnrampStatus:{popup:c}}),n(de.COINBASE_ONRAMP_STATUS_SCREEN),t.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:e.amount,chainType:e.chainType,chainId:e.chainType==="ethereum"?e.chain.id:e.cluster.name}}),setTimeout((()=>{r({funding:h,coinbaseOnrampStatus:{partnerUserId:d.partner_user_id,popup:c}})}),5e3),a()})),fU="moonpay";let QKe=new Set([_c.id,hd.id,ql.id,Wl.id]),YKe=new Set([_c.id,hd.id,nh.id,ql.id,Wl.id]);function ZKe(t,e){switch(t){case hd.id:return e==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case ql.id:return e==="native-currency"?"ETH_BASE":"USDC_BASE";case GA.id:return"CELO_CELO";case Wl.id:return e==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case _c.id:return e==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${t} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function XKe(t){return parseFloat(t)}function JKe(t){return!!t&&t.config!==void 0&&t.provider!==void 0}function Wx(t){return!!t&&(t.chain!==void 0||t.amount!==void 0)}async function eQe(t,e){return qG(`${e?V8e:z8e}/transactions/ext/${t}`,{query:{apiKey:e?G8e:H8e}})}function tQe(t,e=!1){let[r,n]=C.useState(null),{createAnalyticsEvent:i}=bt(),{data:s,navigate:a,setModalData:o}=ht(),c=s==null?void 0:s.funding,l=C.useRef(0);return C.useEffect((()=>{let u=setInterval((async()=>{var d,f;if(t)try{let[h]=await eQe(t,e),g=h.status==="waitingAuthorization"&&h.paymentMethod==="credit_debit_card"?"pending":h.status;if(["failed","completed","awaitingAuthorization"].includes(g)&&(i({eventName:Ol,payload:{status:g,provider:fU,paymentMethod:h.paymentMethod,cardPaymentType:h.cardPaymentType,currency:(d=h.currency)==null?void 0:d.code,baseCurrencyAmount:h.baseCurrencyAmount,quoteCurrencyAmount:h.quoteCurrencyAmount,feeAmount:h.feeAmount,extraFeeAmount:h.extraFeeAmount,networkFeeAmount:h.networkFeeAmount,isSandbox:e}}),clearInterval(u)),g==="failed"||g==="serviceFailure")return o({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),void a(de.FUNDING_METHOD_SELECTION_SCREEN);n(g)}catch(h){((f=h.response)==null?void 0:f.status)!==404&&(l.current+=1),l.current>=3&&(i({eventName:Ol,payload:{status:"serviceFailure",provider:fU}}),clearInterval(u),o({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a(de.FUNDING_METHOD_SELECTION_SCREEN))}}),3e3);return()=>clearInterval(u)}),[t,l]),r}const rQe=(t,e)=>{switch(e){case"native-currency":return QKe.has(t);case"USDC":return YKe.has(t);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}},nQe=async(t,e,r,n,i,s,a,o)=>{var h,g;let c=q5();if(!c)throw Error("Unable to initialize flow");let l=e.chainType==="ethereum"?((h=e.moonpayConfigOverride)==null?void 0:h.currencyCode)??ZKe(e.chain.id,n):"SOL",{signedUrl:u,externalTransactionId:d}=await t.signMoonpayOnRampUrl({address:e.address,useSandbox:r.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:r.appearance.palette.accent,theme:r.appearance.palette.colorScheme},...e.moonpayConfigOverride,paymentMethod:o,currencyCode:l,quoteCurrencyAmount:((g=e.moonpayConfigOverride)==null?void 0:g.quoteCurrencyAmount)??XKe(e.amount)}});t.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:e.amount,chainType:e.chainType,chainId:e.chainType==="ethereum"?e.chain.id:e.cluster.name}}),c.location=u;let f={...a==null?void 0:a.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(f.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:f}),s(de.MOONPAY_STATUS_SCREEN),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:d},funding:f})}),8e3)},iQe=(t,e,r,n,i,s)=>{var g;let a,o,c=r.chainType==="solana",l=c?void 0:r,u=r.isUSDC?"USDC":l!=null&&l.erc20Address?void 0:"native-currency",d=!!c||u&&rQe(Number(r.chain.id),u),f=!!c||u&&VKe(Number(r.chain.id),u),h=[];for(let m of(r.preferredCardProvider&&r.supportedOptions.sort((y=>y.provider===r.preferredCardProvider?-1:1)),r.supportedOptions))m.method==="card"&&m.provider==="coinbase"&&f&&h.push((()=>dU(e,r,n,i,s,"buy"))),m.method==="card"&&m.provider==="moonpay"&&d&&u&&h.push((()=>nQe(e,r,t,u,n,i,s,"credit_debit_card")));for(let m of r.supportedOptions)m.method==="exchange"&&m.provider==="coinbase"&&f&&(a=()=>dU(e,r,n,i,s,"buy"));for(let m of((g=s==null?void 0:s.funding)==null?void 0:g.supportedOptions)??[])m.method==="wallets"&&(o=()=>i(de.FUNDING_TRANSFER_FROM_WALLET_SCREEN));return{onFundWithCard:h,onFundWithExchange:a,onFundWithWallet:o}};let _te=async t=>typeof window<"u"&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:t}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const sQe=()=>_te("https://apple.com/apple-pay"),aQe=()=>_te("https://google.com/pay"),oQe=()=>{var y,b;let{wallets:t}=ph(),{wallets:e}=u2(),{navigate:r,data:n,setModalData:i}=ht(),{client:s}=bt(),a=Jn(),o=n==null?void 0:n.funding,c=lU(sQe),l=lU(aQe),u=o.chainType==="solana",d=u?void 0:o,f=C.useMemo((()=>
474iQe(a,s,o,i,r,n)),[a,s,o,n,i,r]);C.useEffect((()=>{if(o!=null&&o.defaultFundingMethod&&o.usingDefaultFundingMethod)switch(i({funding:{...o,usingDefaultFundingMethod:!1}}),o==null?void 0:o.defaultFundingMethod){case"card":f.onFundWithCard[0]&&f.onFundWithCard[0]();break;case"exchange":f.onFundWithExchange&&f.onFundWithExchange();break;case"wallet":f.onFundWithWallet&&f.onFundWithWallet();break;case"manual":r(de.FUNDING_MANUAL_TRANSFER_SCREEN)}}),[]),C.useEffect((()=>{d!=null&&d.erc20Address&&!d.erc20ContractInfo&&xte({address:d.erc20Address,chain:d.chain,rpcConfig:a.rpcConfig,privyAppId:a.id}).then((E=>{i({...n,funding:{...d,erc20ContractInfo:E?{symbol:E.symbol,decimals:E.decimals}:void 0}})})).catch(console.error)}),[d==null?void 0:d.erc20Address,d==null?void 0:d.chain]);let h=u?e.find((({address:E})=>E===o.address)):t.find((({address:E})=>jr(E)===jr(o.address))),g=h&&h.walletClientType!=="privy"?j0(h.walletClientType,h.connectorType,h.walletClientType):a.name,m=!(!(d!=null&&d.erc20Address)||d!=null&&d.erc20ContractInfo);return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsxs("h3",{children:["Add funds to your"," ",g!=null&&g.toLowerCase().endsWith("wallet")?g:g+" wallet"]}),p.jsxs(fKe,{children:[o.errorMessage&&p.jsx(DKe,{theme:a.appearance.palette.colorScheme,children:o.errorMessage}),((y=f.onFundWithCard)==null?void 0:y[0])&&p.jsxs(In,{disabled:m,onClick:f.onFundWithCard[0],children:[p.jsx(g1,{children:p.jsx(PKe,{style:{width:24}})}),"Pay with card",c?p.jsx(UKe,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):l?p.jsx(BKe,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),f.onFundWithExchange&&p.jsxs(In,{disabled:m,onClick:f.onFundWithExchange,children:[p.jsx(g1,{children:p.jsx(bI,{style:{width:24}})}),"Transfer from an exchange"]}),f.onFundWithWallet&&p.jsxs(In,{disabled:m,onClick:f.onFundWithWallet,children:[p.jsx(g1,{children:p.jsx(qKe,{style:{width:24}})}),"Transfer from wallet"]}),p.jsxs(In,{disabled:m,onClick:()=>r(de.FUNDING_MANUAL_TRANSFER_SCREEN),children:[p.jsx(g1,{children:p.jsx(RKe,{style:{width:24}})}),"Receive funds"]}),(o==null?void 0:o.showAlternateFundingMethod)&&((b=f.onFundWithCard)==null?void 0:b[1])&&p.jsx(Ete,{theme:a.appearance.palette.colorScheme,children:p.jsxs(pKe,{children:["Having trouble or facing location restrictions?"," ",p.jsx(gKe,{onClick:f.onFundWithCard[1],children:"Try a different provider."})]})})]}),p.jsx(Ht,{})]})};function cQe({rpcConfig:t,appId:e,address:r,chain:n}){let{chains:i}=bt(),[s,a]=C.useState(0n),[o,c]=C.useState(!1),l=C.useMemo((()=>{let d=n||i[0];if(d)return Of({chain:n,transport:Rf(Zu(d,t,e))})}),[n,t,e]),u=C.useCallback((async()=>{if(!r||!l)return;c(!0);let d=await l.getBalance({address:r}).catch(console.error);return d?(a(d),c(!1),d):void 0}),[l,r,a]);return C.useEffect((()=>{u().catch(console.error)}),[]),{balance:s,isLoading:o,reloadBalance:u}}const lQe=()=>{var A;let{wallets:t}=ph(),{wallets:e}=u2(),{data:r,setModalData:n,navigate:i,lastScreen:s}=ht(),{rpcConfig:a,appId:o,createAnalyticsEvent:c,closePrivyModal:l}=bt(),u=Jn(),[d,f]=C.useState(void 0),[h,g]=C.useState(!1),m=r2(),y=r==null?void 0:r.funding,{reloadBalance:b}=cQe({rpcConfig:a,appId:o,address:y.chainType==="ethereum"?y.address:void 0,chain:y.chainType==="ethereum"?y.chain:void 0}),E=y.chainType==="solana",v=E?"SOL":y.erc20Address?(A=y.erc20ContractInfo)==null?void 0:A.symbol:y.chain.nativeCurrency.symbol,w=E?e.find((({address:I})=>I===y.address)):t.find((({address:I})=>fs(I)===fs(y.address)));if(!y)return n({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:s||de.FUNDING_METHOD_SELECTION_SCREEN},funding:r==null?void 0:r.funding,sendTransaction:r==null?void 0:r.sendTransaction}),i(de.ERROR_SCREEN),p.jsx(p.Fragment,{});C.useEffect((()=>{let I=E?async function(){if(y.chainType!=="solana")return;let P=m(n2);P?P.getBalance({address:y.address,cluster:y.cluster}).then((j=>{let L=BigInt(j);d&&L>d&&(g(!0),c({eventName:Ol,payload:{provider:"manual",status:"success",chainType:"solana",address:w==null?void 0:w.address,value:(L-d).toString()}})),f(L)})):console.warn("Unable to load solana plugin, skipping balance")}:async function(){y.chainType==="ethereum"&&(async()=>
474{if(!y.erc20Address)return await b()??BigInt(0);{let{balance:P}=await wte({chain:y.chain,address:y.address,erc20Address:y.erc20Address,rpcConfig:a,appId:o});return P}})().then((P=>{d&&P>d&&(g(!0),c({eventName:Ol,payload:{provider:"manual",status:"success",chainType:"ethereum",address:w==null?void 0:w.address,value:(P-d).toString()}})),f(P)})).catch((()=>f(void 0)))},$=setInterval(I,2e3);return I(),()=>clearInterval($)}),[d]);let x=C.useMemo((()=>d!==void 0&&d>=parseFloat(y.amount)),[d,y.amount]),_=C.useMemo((()=>{var I;return d==null?"":y.isUSDC?YP({amount:d,decimals:6}):E?Bu(d,3,!0,!0):((I=y.erc20ContractInfo)==null?void 0:I.decimals)!=null?YP({amount:d,decimals:y.erc20ContractInfo.decimals}):$6e({wei:d})}),[d,E,y]),S=y.chainType==="ethereum"?y.chain.name:dQe[y.cluster.name];return p.jsxs(p.Fragment,{children:[p.jsx(Bs,{}),p.jsxs(Pl,{children:["Receive ",y.amount," ",v]}),p.jsxs(bd,{children:["Scan this code or copy your wallet address to receive funds on ",S,"."]}),p.jsxs(Y3,{style:{gap:"1rem",margin:"1rem 0"},children:[p.jsx(A5,{url:y.address,size:200,squareLogoElement:uQe}),p.jsxs(Ete,{theme:u.appearance.palette.colorScheme,children:["Make sure to send funds on ",S,"."]}),p.jsx(v5,{title:"Your wallet",errMsg:void 0,showIcon:!0,isLoading:!y||d===void 0,isPulsing:!x,balance:`${_} ${v}`,address:y.address,statusColor:x?"green":"gray"}),h&&p.jsx(Mt,{onClick:()=>l({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),p.jsx(Ht,{})]})};let uQe=({...t})=>p.jsx(CQ,{color:"black",...t}),dQe={devnet:"Devnet","mainnet-beta":"Solana",testnet:"Testnet"};const fQe=({size:t=61,...e})=>p.jsx("svg",{width:t,height:t,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:p.jsxs("g",{id:"moonpay_symbol_wht 2",children:[p.jsx("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),p.jsx("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})}),hQe=()=>{let{app:t,data:e,setModalData:r,navigateBack:n}=ht(),{closePrivyModal:i}=bt(),{externalTransactionId:s}=e==null?void 0:e.moonpayStatus,a=tQe(s||null,t.fundingMethodConfig.moonpay.useSandbox??!1);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{title:"Fund account",backFn:()=>{let o={...e==null?void 0:e.funding,showAlternateFundingMethod:!0};o.usingDefaultFundingMethod&&(o.usingDefaultFundingMethod=!1),r({funding:o}),n()}}),p.jsx(pQe,{status:a,onClickCta:i}),p.jsx(Ht,{})]})};let pQe=({status:t,onClickCta:e})=>{let{title:r,body:n,cta:i}=C.useMemo((()=>(s=>{switch(s){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(t)),[t]);return p.jsxs(p.Fragment,{children:[p.jsxs(bQe,{children:[p.jsx(mQe,{status:t}),p.jsxs(ga,{children:[p.jsx("h3",{children:r}),p.jsx(yQe,{children:n})]})]}),i&&p.jsx(Mt,{onClick:e,children:i})]})},gQe=t=>{switch(t){case"completed":return jf;case"waitingAuthorization":return()=>p.jsx(bI,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},mQe=({status:t})=>{if(!t||t==="pending"){let i="var(--privy-color-foreground-4)";return p.jsxs("div",{style:{position:"relative"},children:[p.jsx(Fa,{color:i,style:{position:"absolute"}}),p.jsx(XA,{color:i}),p.jsx(fQe,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let e=gQe(t),r=(n=t)?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[n]:"var(--privy-color-foreground-4)";var n;return p.jsx("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:e&&p.jsx(e,{width:"4rem",height:"4rem",color:r})})},yQe=oe.p.withConfig({displayName:"StatusBody",componentId:"sc-56bea42a-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),bQe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-56bea42a-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);function vQe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const vI=C.forwardRef(vQe),Cte=({onClick:t,text:e})=>p.jsxs(In,{onClick:t,children:[p.jsx(Fy,{}),p.jsx(Il,{children:e}),p.jsx(vI,{})]}),wQe=()=>{var x,_,S;let t,{connectors:e}=bt(),{app:r,setModalData:n,data:i,navigate:s}=ht(),{wallets:a}=ph(),{wallets:o}=u2(),[c,l]=C.useState("default"),u=((x=i==null?void 0:i.funding)==null?void 0:x.chainType)==="solana",d=!!((_=i==null?void 0:i.funding)!=null&&_.crossChainBridgingEnabled);t=((S=i==null?void 0:i.funding)==null?void 0:S.chainType)==="ethereum"?i.funding.erc20Address&&!i.funding.isUSDC?"ethereum-only":d&&!i.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":d?"ethereum-and-solana":"solana-only";let f=a.filter((A=>A.walletClientType!=="privy")),h=f.map((A=>
474A.walletClientType)),g=o.filter((A=>A.walletClientType!=="privy")),m=g.map((A=>A.walletClientType)),y=[],b={...i.funding};b.usingDefaultFundingMethod&&(b.usingDefaultFundingMethod=!1);let E=({address:A,walletChainType:I})=>{n({...i,funding:{...b,connectedWalletAddress:A,onContinueWithExternalWallet:()=>s(w({destChainType:u?"solana":"ethereum",sourceChainType:I}))}}),s(de.FUNDING_EDIT_AMOUNT_SCREEN)};t!=="solana-only"&&y.push(...f.map(((A,I)=>p.jsx(hU,{onClick:()=>E({address:A.address,walletChainType:"ethereum"}),icon:A.meta.icon,name:A.meta.name,chainType:A.type},I)))),t!=="ethereum-only"&&y.push(...g.map(((A,I)=>p.jsx(hU,{onClick:()=>E({address:A.address,walletChainType:"solana"}),icon:A.meta.icon,name:A.meta.name,chainType:A.type},I)))),y.push(...Lf({walletList:r.appearance.walletList.filter((A=>!f.some((I=>I.walletClientType===A))&&!g.some((I=>I.walletClientType===A)))),walletChainType:t,connectors:e,connectOnly:!0,ignore:[...r.appearance.walletList,...h,...m],walletConnectEnabled:r.externalWallets.walletConnect.enabled}));let v=p.jsx(Cte,{text:"More wallets",onClick:()=>l("overflow")}),w=({sourceChainType:A,destChainType:I})=>A==="ethereum"&&I==="solana"?de.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN:A==="ethereum"&&I==="ethereum"?de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN:A==="solana"&&I==="ethereum"?de.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN:de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN;return C.useEffect((()=>{n({...i,externalConnectWallet:{onCompleteNavigateTo:({walletChainType:A})=>(n({...i,funding:{...b,onContinueWithExternalWallet:()=>{s(w({destChainType:u?"solana":"ethereum",sourceChainType:A??"ethereum"}))}}}),de.FUNDING_EDIT_AMOUNT_SCREEN)}})}),[]),p.jsxs(p.Fragment,c==="overflow"?{children:[p.jsx(lt,{backFn:()=>l("default")},"header"),p.jsxs(Xu,{children:[p.jsx(bd,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),y]}),p.jsx(Ht,{})]}:{children:[p.jsx(Bs,{}),p.jsx(wn,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),p.jsxs(Xu,{children:[y.length>4?y.slice(0,3):y,y.length>4&&v]}),p.jsx(Ht,{})]})};let hU=({onClick:t,icon:e,name:r,chainType:n})=>p.jsxs(In,{onClick:t,children:[p.jsx(g1,{style:{width:20},children:p.jsx("img",{src:e})}),r,p.jsx($o,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),n==="solana"&&p.jsx($o,{color:"gray",children:"Solana"})]});const EQe=()=>{let{closePrivyModal:t}=bt();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(xQe,{children:p.jsx(h7,{style:{width:32,height:32}})}),p.jsx(By,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),p.jsx(ah,{children:p.jsx(Mt,{onClick:()=>t(),children:"Close"})}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let xQe=oe.div.withConfig({displayName:"StyledCircle",componentId:"sc-30eca48b-0"})(["border-radius:50%;height:68px;width:68px;display:flex;align-items:center;justify-content:center;background-color:var(--privy-color-accent);color:white;margin:0 auto 24px auto;"]);const _Qe=({style:t,...e})=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...t},...e,children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932
47410.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})}),CQe=oe.div.withConfig({displayName:"TodoList",componentId:"sc-491785d-0"})(["display:flex;flex-direction:column;justify-content:flex-start;gap:4px;"]),pU=oe.div.withConfig({displayName:"TodoSpacer",componentId:"sc-491785d-1"})(["&&&{margin-left:7px;border-left:2px solid var(--privy-color-foreground-4);height:12px;}"]),zx=({children:t})=>p.jsxs(SQe,{children:[p.jsx(_Qe,{style:{width:"16px",height:"16px"}}),t]});let SQe=oe.div.withConfig({displayName:"TodoItemWrapper",componentId:"sc-491785d-2"})(["display:flex;justify-content:flex-start;justify-items:center;text-align:left;gap:8px;&&{a{text-decoration:underline;color:var(--privy-color-accent);}svg{margin-top:auto;margin-bottom:auto;}}"]),AQe=()=>{let t=An.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return p.jsxs(IQe,{children:[p.jsx(Z3,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),p.jsx(ko,{children:p.jsx(J3,{style:{width:"152px",height:"152px"}})}),p.jsxs(CQe,{children:[p.jsx(zx,{children:p.jsxs("div",{children:[p.jsx("span",{children:"Install the "}),p.jsx("a",{href:t,target:"_blank",children:"Phantom browser extension"})]})}),p.jsx(pU,{}),p.jsx(zx,{children:"Set up your first wallet"}),p.jsx(pU,{}),p.jsx(zx,{children:"Store your recovery phrase in a safe place!"})]}),p.jsx(JA,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]})};const TQe=()=>{let{navigateBack:t}=ht();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:t},"header"),p.jsx(Lr,{}),p.jsx(AQe,{}),p.jsx(qr,{}),p.jsxs(vr,{children:[p.jsx("span",{children:"Still not sure? "}),p.jsx("a",{target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]})]})};let IQe=oe(ko).withConfig({displayName:"CreateWalletContainer",componentId:"sc-8f484e26-0"})(["gap:30px;> :first-child > svg{margin-top:20px;}"]),kQe={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:",guest:"guest"};const W5=t=>{let e=kQe[t];return t==="wallet"||t==="phone"?{displayName:t,loginMethod:e}:{displayName:e,loginMethod:e}},$Qe=()=>{var i;let{app:t}=ht(),e=(i=t==null?void 0:t.appearance)==null?void 0:i.logo,r=`${t==null?void 0:t.name} logo`,n={maxHeight:"90px",maxWidth:"180px"};return e?typeof e=="string"?p.jsx("img",{src:e,alt:r,style:n}):e.type==="svg"||e.type==="img"?Rt.cloneElement(e,{alt:r,style:n}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},Ste=t=>{let{app:e}=ht();return e!=null&&e.appearance.logo?p.jsx(NQe,{...t,children:p.jsx($Qe,{})}):null},NQe=oe.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a206bd44-0"})(["display:flex;flex-direction:column;align-items:center;padding:24px 0;flex-grow:1;justify-content:center;"]),PQe=({appId:t})=>{let[e,r]=C.useState(void 0),{startCrossAppAuthFlow:n,authenticated:i}=Sr(),{client:s}=bt();return C.useEffect((()=>{(async()=>s&&r(await s.getCrossAppProviderDetails(t)))()}),[s]),p.jsx(In,{onClick:()=>n({appId:t,action:i?"link":"login"}),disabled:!e,children:e?p.jsxs(p.Fragment,{children:[p.jsx(uJ,{name:e.name,logoUrl:e.icon_url||void 0,size:"24px"})," ",e.name]}):p.jsx(pd,{})})};
474let Ate=oe.label.withConfig({displayName:"BaseEmailForm",componentId:"sc-d081b0e2-0"})(["display:block;position:relative;width:100%;> svg{position:absolute;margin:13px 17px;height:24px;width:24px;color:var(--privy-color-foreground-3);}&& > input{background-color:#f00;font-size:16px;line-height:24px;padding:12px 88px 12px 52px;flex-grow:1;background:var(--privy-color-background);border:1px solid ",";border-radius:var(--privy-border-radius-mdlg);width:100%;@media (min-width:441px){font-size:14px;padding-right:78px;}:focus{outline:none;border-color:",";box-shadow:",";}:autofill,:-webkit-autofill{background:var(--privy-color-background);}&& > input::placeholder{color:var(--privy-color-foreground-3);}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}"],(({$error:t})=>t?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"),(({$error:t})=>t?"var(--privy-color-error) !important":"var(--privy-color-accent-light)"),(({$error:t})=>t?"none":"0 0 0 1px var(--privy-color-accent-light)"));const OQe=oe(Ate).withConfig({displayName:"EmailUpdateForm",componentId:"sc-d081b0e2-1"})(["background-color:var(--privy-color-background);transition:background-color 200ms ease;&& > button{right:0;line-height:24px;position:absolute;padding:13px 17px;background-color:#090;:focus{outline:none;border-color:var(--privy-color-accent);}}"]),RQe=oe(Ate).withConfig({displayName:"EmailInputForm",componentId:"sc-d081b0e2-2"})(["&& > input{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:",";border:1px solid ",";&& > input::placeholder{color:var(--privy-color-foreground-3);}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}}"],(t=>t.stacked?"16px":"88px"),(({$error:t})=>t?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)")),Tte=oe.div.withConfig({displayName:"InputContainerForm",componentId:"sc-d081b0e2-3"})(["width:100%;&& > ","{display:block;text-align:left;padding-left:var(--privy-border-radius-mdlg);padding-bottom:5px;}"],Nl),Ite=C.forwardRef(((t,e)=>{let[r,n]=C.useState(t.defaultValue||""),[i,s]=C.useState(""),[a,o]=C.useState(!1),{authenticated:c}=Sr(),{initLoginWithEmail:l}=bt(),{navigate:u,setModalData:d,currentScreen:f,data:h}=ht(),{enabled:g,token:m}=Vs(),[y,b]=C.useState(!1),{accountType:E}=gd(),v=Jn();C.useEffect((()=>{var S,A;!r&&v.disablePlusEmails&&((S=h==null?void 0:h.inlineError)==null?void 0:S.error)instanceof Fs&&((A=h==null?void 0:h.inlineError)==null?void 0:A.error.privyErrorCode)===Se.DISALLOWED_PLUS_EMAIL&&!i&&s("Please enter a valid email address without a '+'."),i&&s("")}),[r]);let w=tK(r),x=a||!w,_=()=>{var A;var S;d({inlineError:void 0}),!g||m||c?(S=m,o(!0),l({email:r,captchaToken:S,disableSignup:(A=h==null?void 0:h.login)==null?void 0:A.disableSignup,withPrivyUi:!0}).then((()=>{u(de.AWAITING_PASSWORDLESS_CODE)})).catch((I=>{d({errorModalData:{error:I,previousScreen:f||de.LANDING}}),u(de.ERROR_SCREEN)})).finally((()=>{o(!1)}))):(d({captchaModalData:{callback:I=>l({email:r,captchaToken:I,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:de.ERROR_SCREEN}}),u(de.CAPTCHA_SCREEN))};return p.jsxs(p.Fragment,{children:[p.jsxs(DQe,{children:[i&&p.jsx(Nl,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:i}),p.jsxs(MQe,{stacked:t.stacked,$error:!!i,children:[p.jsx(sh,{}),p.jsx("input",{ref:e,id:"email-input",className:"login-method-button",type:"email",placeholder:"[email protected]",onFocus:()=>b(!0),onChange:S=>n(S.target.value),onKeyUp:S=>{S.key==="Enter"&&_()},value:r,autoComplete:"email"}),E!=="email"||y?t.stacked?p.jsx("span",{}):p.jsx(eT,{isSubmitting:a,onClick:_,disabled:x,children:"Submit"}):p.jsx($o,{color:"gray",children:"Recent"})]})]}),t.stacked?p.jsx(Mt,{loadingText:null,loading:a,disabled:x,onClick:_,children:"Submit"}):null]})}));let DQe=Tte,MQe=RQe;const kte=({isEditable:t,setIsEditable:e,defaultValue:r})=>{let n=C.useRef(null);return p.jsxs(p.Fragment,{children:[p.jsx(Df,{$if:!t,children:p.jsx(Ite,{ref:n,defaultValue:r})}),p.jsx(Df,{$if:t,children:p.jsxs(In,{onClick:()=>{e(),setTimeout((()=>{var i;(i=n.current)==null||i.focus()}),0)},children:[p.jsx(sh,{})," Continue with Email"]})})]})},$te=()=>{let[t,e]=C.useState(!1),{currentScreen:r,navigate:n,setModalData:i,data:s}=ht(),{enabled:a,token:o}=Vs(),{initLoginWithFarcaster:c}=bt(),{accountType:l}=gd();return p.jsxs(In,{onClick:async()=>{var u;e(!0);try{a&&!o?(i({captchaModalData:{callback:d=>{var f;return c(d,(f=s==null?void 0:s.login)==null?void 0:f.disableSignup)},userIntentRequired:!0,onSuccessNavigateTo:de.AWAITING_FARCASTER_CONNECTION,onErrorNavigateTo:de.ER
474ROR_SCREEN}}),n(de.CAPTCHA_SCREEN)):(await c(o,(u=s==null?void 0:s.login)==null?void 0:u.disableSignup),n(de.AWAITING_FARCASTER_CONNECTION))}catch(d){i({errorModalData:{error:d,previousScreen:r||de.LANDING}}),n(de.ERROR_SCREEN)}finally{e(!1)}},disabled:!1,children:[p.jsx(vf,{})," Farcaster",t&&p.jsx(pd,{}),l==="farcaster"&&p.jsx(jQe,{color:"gray",children:"Recent"})]})};let jQe=oe($o).withConfig({displayName:"StyledChip",componentId:"sc-19f52850-0"})(["margin-left:auto;"]);const Nte=()=>{let{enabled:t,token:e}=Vs(),{navigate:r,setModalData:n,app:i}=ht(),{initLoginWithPasskey:s}=bt();return p.jsx(FQe,{onClick:()=>{i.loginConfig.passkeysForSignupEnabled?r(de.SELECT_PASSKEY_SIGNUP_OR_LOGIN):(async()=>t&&!e?(n({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:a=>s({captchaToken:a,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_PASSKEY_SYSTEM_DIALOGUE,onErrorNavigateTo:de.ERROR_SCREEN}}),r(de.CAPTCHA_SCREEN)):(await s({withPrivyUi:!0}),n({passkeyAuthModalData:{passkeySignupFlow:!1}}),r(de.AWAITING_PASSKEY_SYSTEM_DIALOGUE)))()},children:"I have a passkey"})};let LQe=ns(["&&{width:100%;font-size:0.875rem;line-height:1rem;display:flex;gap:0.5rem;justify-content:center;align-items:center;padding:6px 8px;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent) !important;:focus{outline:none;box-shadow:none;}}"]);const FQe=oe.button.withConfig({displayName:"StyledLink",componentId:"sc-9521c74b-0"})(["",""],LQe),UQe=({value:t,onChange:e})=>p.jsx("select",{value:t,onChange:e,children:iye.map((r=>p.jsxs("option",{value:r.code,children:[r.code," +",r.callCode]},r.code)))}),z5=C.forwardRef(((t,e)=>{let{app:r}=ht(),[n,i]=C.useState(!1),{accountType:s}=gd(),[a,o]=C.useState(""),[c,l]=C.useState((r==null?void 0:r.intl.defaultCountry)??"US"),u=$2(a,c),d=nye(c),f=sye(c),h=PS(c),g=!u,[m,y]=C.useState(!1),b=h.length,E=x=>{let _=x.target.value;l(_),o(""),t.onChange&&t.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:Q6(a,_),countryCode:_,isValid:$2(a,c)})},v=(x,_)=>{try{let S=x.replace(/\D/g,"")===a.replace(/\D/g,"")?x:d.input(x);o(S),t.onChange&&t.onChange({rawPhoneNumber:S,qualifiedPhoneNumber:Q6(x,_),countryCode:_,isValid:$2(x,_)})}catch(S){console.error("Error processing phone number:",S)}},w=()=>{y(!0);let x=Q6(a,c);t.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:x,countryCode:c,isValid:$2(a,c)}).finally((()=>y(!1)))};return C.useEffect((()=>{if(t.defaultValue){let x=aye(t.defaultValue);d.reset(),E({target:{value:x.countryCode}}),v(x.phone,x.countryCode)}}),[t.defaultValue]),p.jsxs(p.Fragment,{children:[p.jsx(BQe,{children:p.jsxs(qQe,{$callingCodeLength:b,$stacked:t.stacked,children:[p.jsx(UQe,{value:c,onChange:E}),p.jsx("input",{ref:e,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:f,onFocus:()=>i(!0),onChange:x=>{v(x.target.value,c)},onKeyUp:x=>{x.key==="Enter"&&w()},value:a,autoComplete:"tel"}),s!=="phone"||n||t.hideRecent?t.stacked||t.noIncludeSubmitButton?p.jsx("span",{}):p.jsx(eT,{isSubmitting:m,onClick:w,disabled:g,children:"Submit"}):p.jsx($o,{color:"gray",children:"Recent"})]})}),t.stacked&&!t.noIncludeSubmitButton?p.jsx(Mt,{loading:m,loadingText:null,onClick:w,disabled:g,children:"Submit"}):null]})}));let BQe=oe.div.withConfig({displayName:"InputContainer",componentId:"sc-2a729487-0"})(["width:100%;"]),qQe=oe.label.withConfig({displayName:"PhoneNumberInput",componentId:"sc-2a729487-1"})(["--country-code-dropdown-width:calc(54px + calc(12 * ","px));--phone-input-extra-padding-left:calc(12px + calc(3 * ","px));display:block;position:relative;width:100%;@media (min-width:441px){--country-code-dropdown-width:calc(52px + calc(10 * ","px));}&& > select{font-size:16px;height:24px;position:absolute;margin:13px calc(var(--country-code-dropdown-width) / 4);line-height:24px;width:var(--country-code-dropdown-width);background-color:var(--privy-color-background);background-size:auto;background-position-x:right;cursor:pointer;@media (min-width:441px){font-size:14px;width:var(--country-code-dropdown-width);}:focus{outline:none;box-shadow:none;}}&& > input{font-size:16px;line-height:24px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:calc(100% - var(--country-code-dropdown-width));padding:12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));padding-right:",";flex-grow:1;background:var(--privy-color-background);border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-mdlg);width:100%;:focus{outline:none;border-color:var(--privy-color-accent);}:autofill,:-webkit-autofill{background:var(--privy-color-background);}@media (min-width:441px){font-size:14px;padding-right:78px;}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;border-color:var(--privy-color-accent);}}&& > input::placeholder{color:var(--privy-color-foreground-3);}"],(t=>t.$callingCodeLength),(t=>t.$callingCodeLength),(t=>t.$callingCodeLength),(t=>t.$stacked?"16px":"88px"));const Pte=({isEditable:t,setIsEditable:e,defaultValue:r})=>{let n=C.useRef(null),{authenticated:i}=Sr(),{navigate:s,setModalData:a,currentScreen:o,data:c}=ht(),{initLoginWithSms:l}=bt(),{enabled:u,token:d}=Vs();return p.jsxs(p.Fragment,{children:[p.jsx(Df,{$if:!t,children:p.jsx(z5,{ref:n,onSubmit:async function({qualifiedPhoneNumber:f}){var h;if(!u||d||i)try{await l({phoneNumber:f,captchaToken:d,withPrivyUi:!0,disableSignup:(h=c==null?void 0:c.login)==null?void 0:h.disableSignup}),s(de.AWAITING_PASSWORDLESS_CODE)}
474catch(g){a({errorModalData:{error:g,previousScreen:o||de.LANDING}}),s(de.ERROR_SCREEN)}else a({captchaModalData:{callback:g=>{var m;return l({phoneNumber:f,captchaToken:g,withPrivyUi:!0,disableSignup:(m=c==null?void 0:c.login)==null?void 0:m.disableSignup})},userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:de.ERROR_SCREEN}}),s(de.CAPTCHA_SCREEN)},defaultValue:r})}),p.jsx(Df,{$if:t,children:p.jsxs(In,{onClick:()=>{e(),setTimeout((()=>{var f;(f=n.current)==null||f.focus()}),0)},children:[p.jsx(Io,{})," Continue with SMS"]})})]})},Ote=({style:t,...e})=>p.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...t},...e,children:[p.jsx("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),p.jsx("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]}),Rte=({style:t,...e})=>p.jsxs("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...t},...e,children:[p.jsx("g",{clipPath:"url(#clip0)",children:p.jsx("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0",children:p.jsx("rect",{width:"71",height:"55",fill:"white"})})})]}),Dte=({style:t,...e})=>p.jsx("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...t},...e,children:p.jsx("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.3
47462 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})}),Mte=({style:t,...e})=>p.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...t},...e,children:[p.jsx("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),p.jsx("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),p.jsx("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),p.jsx("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});function jte(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...t,children:[p.jsxs("defs",{children:[p.jsxs("linearGradient",{id:"b",children:[p.jsx("stop",{offset:"0",stopColor:"#3771c8"}),p.jsx("stop",{stopColor:"#3771c8",offset:".128"}),p.jsx("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),p.jsxs("linearGradient",{id:"a",children:[p.jsx("stop",{offset:"0",stopColor:"#fd5"}),p.jsx("stop",{offset:".1",stopColor:"#fd5"}),p.jsx("stop",{offset:".5",stopColor:"#ff543e"}),p.jsx("stop",{offset:"1",stopColor:"#c837ab"})]}),p.jsx("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),p.jsx("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),p.jsx("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),p.jsx("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.
474004 1)"}),p.jsx("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function Lte({style:t,...e}){return p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...t},...e,children:p.jsx("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:p.jsx("g",{transform:"scale(5.12,5.12)",children:p.jsx("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}function Fte(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...t,children:[p.jsx("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),p.jsx("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function Ute(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...t,children:[p.jsx("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),p.jsx("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259
474-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),p.jsx("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}const Bte=({style:t,...e})=>p.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...t},...e,children:p.jsx("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});let WQe={apple:{logo:p.jsx(Ote,{}),displayName:"Apple"},discord:{logo:p.jsx(Rte,{}),displayName:"Discord"},github:{logo:p.jsx(Dte,{}),displayName:"GitHub"},google:{logo:p.jsx(Mte,{}),displayName:"Google"},linkedin:{logo:p.jsx(Lte,{}),displayName:"LinkedIn"},spotify:{logo:p.jsx(Fte,{}),displayName:"Spotify"},instagram:{logo:p.jsx(jte,{}),displayName:"Instagram"},twitter:{logo:p.jsx(Bte,{}),displayName:"Twitter"},tiktok:{logo:p.jsx(Ute,{}),displayName:"TikTok"}};const vi=({provider:t})=>{let{enabled:e,token:r}=Vs(),{navigate:n,setModalData:i,data:s}=ht(),[a,o]=C.useState(!1),{initLoginWithOAuth:c}=bt(),{accountType:l}=gd(),u=l?W5(l):null,{displayName:d,logo:f}=WQe[t];return p.jsxs(In,{onClick:()=>{var h;o(!0),e&&!r?(i({captchaModalData:{callback:g=>{var m;return c(t,g,(m=s==null?void 0:s.login)==null?void 0:m.disableSignup)},userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:de.ERROR_SCREEN}}),n(de.CAPTCHA_SCREEN)):c(t,void 0,(h=s==null?void 0:s.login)==null?void 0:h.disableSignup)},disabled:a,children:[f," ",d,(u==null?void 0:u.loginMethod)===t&&p.jsx(zQe,{color:"gray",children:"Recent"})]})};let zQe=oe($o).withConfig({displayName:"StyledChip",componentId:"sc-7d3bb993-0"})(["margin-left:auto;"]);function qte(t){return p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...t,children:[p.jsx("defs",{children:p.jsxs("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[p.jsx("stop",{offset:"0",stopColor:"#1d93d2"}),p.jsx("stop",{offset:"1",stopColor:"#38b0e3"})]})}),p.jsx("title",{children:"Telegram_logo"}),p.jsx("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),p.jsx("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),p.jsx("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),p.jsx("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}const Wte=()=>{let{enabled:t,token:e}=Vs(),{navigate:r,setModalData:n,data:i}=ht(),[s,a]=C.useState(!1),{initLoginWithTelegram:o}=bt(),{accountType:c}=gd();async function l(u){var d;try{await o(u,(d=i==null?void 0:i.login)==null?void 0:d.disableSignup),n({telegramAuthModalData:{seamlessAuth:!1}}),r(de.TELEGRAM_AUTH_SCREEN)}catch(f){console.error(f),a(!1)}}return p.jsxs(In,{onClick:async function(){if(a(!0),t&&!e)return n({captchaModalData:{callback:l,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:de.ER
474ROR_SCREEN}}),void r(de.CAPTCHA_SCREEN);await l(e)},disabled:s,children:[p.jsx(qte,{}),"Telegram",c==="telegram"&&p.jsx(VQe,{color:"gray",children:"Recent"})]})};let VQe=oe($o).withConfig({displayName:"StyledChip",componentId:"sc-f716a3a1-0"})(["margin-left:auto;"]);const zte=({onClick:t,text:e,icon:r})=>p.jsxs(In,{onClick:t,children:[r,p.jsx(Il,{children:e}),p.jsx(vI,{})]});let gU=t=>`${t.props.provider}:${t.props.displayName}`;const Vte=({connectOnly:t})=>{var L,B;let{closePrivyModal:e,connectors:r}=bt(),{app:n,onUserCloseViaDialogOrKeybindRef:i,data:s}=ht(),{appearance:{palette:{colorScheme:a}}}=Jn(),{accountType:o,walletClientType:c,chainType:l}=gd(),u=o?W5(o):null,d=((L=n.loginMethodsAndOrder)==null?void 0:L.primary)??[],f=((B=n.loginMethodsAndOrder)==null?void 0:B.overflow)??[],h=[...d,...f],g=n.loginMethods.passkey,m=s==null?void 0:s.login,y=[];c&&h.includes(c)?y.push(c):o&&h.includes(u==null?void 0:u.loginMethod)&&y.push(u==null?void 0:u.loginMethod);let[b,E]=C.useState("default"),[v,w]=C.useState(o==="phone"?"sms":"email");C.useEffect((()=>{o==="phone"&&w("sms");let k=h.indexOf("sms"),D=h.indexOf("email");k>-1&&k<D&&w("sms")}),[o,d,f]);let x=()=>{e({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{E("default")}),150)};i.current=x;let _=k=>{var D,q;return k==="email"?p.jsx(kte,{isEditable:v==="email",setIsEditable:()=>{w("email")},defaultValue:((D=m==null?void 0:m.prefill)==null?void 0:D.type)==="email"?m.prefill.value:void 0},k):k==="sms"?p.jsx(Pte,{isEditable:v==="sms",setIsEditable:()=>{w("sms")},defaultValue:((q=m==null?void 0:m.prefill)==null?void 0:q.type)==="phone"?m.prefill.value:void 0},k):k==="apple"?p.jsx(vi,{provider:"apple"},k):k==="discord"?p.jsx(vi,{provider:"discord"},k):k==="farcaster"?p.jsx($te,{},k):k==="github"?p.jsx(vi,{provider:"github"},k):k==="google"?p.jsx(vi,{provider:"google"},k):k==="linkedin"?p.jsx(vi,{provider:"linkedin"},k):k==="spotify"?p.jsx(vi,{provider:"spotify"},k):k==="instagram"?p.jsx(vi,{provider:"instagram"},k):k==="tiktok"?p.jsx(vi,{provider:"tiktok"},k):k==="twitter"?p.jsx(vi,{provider:"twitter"},k):k==="telegram"?p.jsx(Wte,{},k):k.startsWith("privy:")?p.jsx(PQe,{appId:k.replace("privy:","")},k):Lf({walletList:n.appearance.walletList,walletChainType:n.appearance.walletChainType,connectors:r,connectOnly:t,ignore:[],walletConnectEnabled:n.externalWallets.walletConnect.enabled,forceWallet:{wallet:k,chainType:l??"ethereum"}})},S=y.flatMap(_),A=d.filter((k=>k!==c&&k!==(u==null?void 0:u.loginMethod))).flatMap(_),I=f.filter((k=>k!==c&&k!==(u==null?void 0:u.loginMethod))).flatMap(_),$=I.filter((k=>!A.map(gU).includes(gU(k)))),[P,j]=I8e([...S,...A,...$],HQe({primary:A.length+S.length,overflow:I.length}));return p.jsxs(p.Fragment,{children:[p.jsx(lt,{title:n.appearance.landingHeader,onClose:x,backFn:b==="default"?void 0:()=>{E("default")}}),b==="default"&&p.jsx(GQe,{}),b==="default"&&(typeof n.appearance.loginMessage=="string"?p.jsx(qQ,{children:n.appearance.loginMessage}):n.appearance.loginMessage),p.jsx(UQ,{style:{overflow:"hidden"},children:p.jsxs(M9e,{$colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[b==="default"&&p.jsxs(p.Fragment,{children:[P,j.length>0&&p.jsx(zte,{text:"More options",icon:p.jsx(eI,{}),onClick:()=>E("overflow")})]}),b==="overflow"&&p.jsx(p.Fragment,{children:j}),g&&b==="default"&&p.jsx(Nte,{})]})}),n&&p.jsx(rT,{app:n}),p.jsx(Ht,{})]})};let HQe=({primary:t,overflow:e})=>t<5?t:t===5&&e===0?5:4,GQe=oe(Ste).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-5bf511fb-0"})(["margin-bottom:16px;"]);const KQe=({...t})=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...t,children:[p.jsxs("g",{clipPath:"url(#clip0_2856_1743)",children:[p.jsx("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),p.jsx("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2856_1743",children:p.jsx("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),Hte=({connectOnly:t})=>{var ie;let{closePrivyModal:e,connectors:r}=bt(),{data:n,onUserCloseViaDialogOrKeybindRef:i}=ht(),s=Jn(),{accountType:a,walletClientType:o,chainType:c}=gd(),l=a?W5(a):null,u=n==null?void 0:n.login,{email:d,sms:f,google:h,twitter:g,discord:m,github:y,spotify:b,instagram:E,tiktok:v,linkedin:w,apple:x,wallet:_,farcaster:S,telegram:A}=C.useMemo((()=>u!=null&&u.loginMethods?oye(u.loginMethods,!0):null),[u])??s.loginMethods,{passkey:I}=s.loginMethods,$=[d&&"email",f&&"sms",h&&"google",g&&"twitter",m&&"discord",y&&"github",b&&"spotify",E&&"instagram",v&&"tiktok",w&&"linkedin",x&&"apple",
474S&&"farcaster",A&&"telegram"].filter((le=>!!le)),P=$.length>0,j=C.useMemo((()=>_&&!P?"web3-first":_&&(s==null?void 0:s.appearance.loginGroupPriority)||"web2-first"),[_,P,s==null?void 0:s.appearance.loginGroupPriority]),L=s==null?void 0:s.appearance.hideDirectWeb2Inputs,[B,k]=C.useState("default"),[D,q]=C.useState(mU({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:d,prefilledType:(ie=u==null?void 0:u.prefill)==null?void 0:ie.type}));C.useEffect((()=>{var le;q(mU({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:d,prefilledType:(le=u==null?void 0:u.prefill)==null?void 0:le.type}))}),[d,f,a]);let U=()=>{e({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{k("default")}),150)};i.current=U;let W=[];o&&_?W.push(o):l!=null&&l.loginMethod&&$.includes(l.loginMethod)&&W.push(l.loginMethod);let V=le=>{var ye,fe;return le==="email"?p.jsx(kte,{isEditable:D==="email",setIsEditable:()=>{q("email")},defaultValue:((ye=u==null?void 0:u.prefill)==null?void 0:ye.type)==="email"?u.prefill.value:void 0},le):le==="sms"?p.jsx(Pte,{isEditable:D==="sms",setIsEditable:()=>{q("sms")},defaultValue:((fe=u==null?void 0:u.prefill)==null?void 0:fe.type)==="phone"?u.prefill.value:void 0},le):le==="apple"?p.jsx(vi,{provider:"apple"},le):le==="discord"?p.jsx(vi,{provider:"discord"},le):le==="farcaster"?p.jsx($te,{},le):le==="github"?p.jsx(vi,{provider:"github"},le):le==="google"?p.jsx(vi,{provider:"google"},le):le==="linkedin"?p.jsx(vi,{provider:"linkedin"},le):le==="tiktok"?p.jsx(vi,{provider:"tiktok"},le):le==="spotify"?p.jsx(vi,{provider:"spotify"},le):le==="instagram"?p.jsx(vi,{provider:"instagram"},le):le==="twitter"?p.jsx(vi,{provider:"twitter"},le):le==="telegram"?p.jsx(Wte,{},le):Lf({walletList:s.appearance.walletList,walletChainType:s.appearance.walletChainType,connectors:r,connectOnly:t,ignore:[],walletConnectEnabled:s.externalWallets.walletConnect.enabled,forceWallet:{wallet:le,chainType:c??"ethereum"}})},Y=Lf({walletList:s.appearance.walletList.filter((le=>le!==o)),walletChainType:s.appearance.walletChainType,connectors:r,connectOnly:t,ignore:[...s.appearance.walletList,o],walletConnectEnabled:s.externalWallets.walletConnect.enabled}),K=$.filter((le=>le!==(l==null?void 0:l.loginMethod))).flatMap(V),ge=W.flatMap(V);j==="web3-first"&&B==="default"?Y.unshift(...ge):j==="web2-first"&&K.unshift(...ge);let ae=$.filter((le=>le!=="email"&&le!=="sms")),ce=YQe({priority:j,email:d,sms:f,social:ae}),Q=ZQe({priority:j,email:d,sms:f,social:ae}),se=p.jsx(Cte,{text:XQe({priority:j}),onClick:()=>k("web3-overflow")}),me=p.jsx(zte,{text:ce,icon:Q,onClick:()=>k("web2-overflow")}),_e=L?0:1,z=_&&Y.length>0,R=K.length===0&&_&&Y.length===0,M=5-(z?1:0),ee=Y.length>0?Y:p.jsx(Gb,{chainType:s.appearance.walletChainType,withPadding:!0});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{title:s.appearance.landingHeader,onClose:U,backFn:B==="default"?void 0:()=>{k("default")}}),B==="default"&&p.jsx(QQe,{}),B==="default"&&(typeof s.appearance.loginMessage=="string"?p.jsx(qQ,{children:s.appearance.loginMessage}):s.appearance.loginMessage),p.jsx(UQ,{style:{overflow:"hidden",padding:2},children:p.jsxs(Xu,{children:[B==="default"&&j==="web2-first"&&p.jsxs(p.Fragment,{children:[K.length>M?K.slice(0,M-1):K,K.length>M&&me,z&&se,R&&p.jsx(Gb,{chainType:s.appearance.walletChainType})]}),B==="default"&&j==="web3-first"&&p.jsxs(p.Fragment,{children:[_&&p.jsxs(p.Fragment,{children:[Y.length>M?Y.slice(0,M-1):Y,Y.length>M&&se]}),K.length>_e&&me,K.length===_e&&K[0],R&&p.jsx(Gb,{chainType:s.appearance.walletChainType})]}),B==="web2-overflow"&&p.jsx(p.Fragment,{children:j==="web3-first"?K:K.slice(3)}),B==="web3-overflow"?ee:[],I&&B==="default"&&p.jsx(Nte,{})]})}),s&&p.jsx(rT,{app:s}),p.jsx(Ht,{})]})};let QQe=oe(Ste).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-4938a02-0"})(["margin-bottom:16px;"]),YQe=({priority:t,email:e,sms:r,social:n})=>t==="web2-first"?"Other socials":e&&r&&n.length>0||e&&n.length>0?"Log in with email or socials":r&&n.length>0?"Log in with sms or socials":e&&r?"Continue with email or sms":e?"Continue with email":r?"Continue with sms":"Log in with a social account",ZQe=({priority:t,email:e,sms:r,social:n})=>t==="web2-first"||n.length>0?p.jsx(eI,{}):e&&r?p.jsx(KQe,{}):e?p.jsx(sh,{}):r?p.jsx(Io,{}):null,XQe=({priority:t})=>t==="web2-first"?"Continue with a wallet":"Other wallets",mU=({mostRecentlyUsedAccountType:t,smsAvailable:e,emailAvailable:r,prefilledType:n})=>r&&(t==="email"&&n!=="phone"||n==="email")||!e||t!=="phone"&&n!=="phone"?"email":"sms";
474const JQe=()=>{let{app:t}=ht();return t.loginMethodsAndOrder&&t.loginMethodsAndOrder.primary.length>0?p.jsx(Vte,{connectOnly:!0}):p.jsx(Hte,{connectOnly:!0})},eYe=()=>{let{app:t}=ht();return t.loginMethodsAndOrder&&t.loginMethodsAndOrder.primary.length>0?p.jsx(Vte,{connectOnly:!1}):p.jsx(Hte,{connectOnly:!1})},tYe=()=>{let{app:t}=ht();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(Lr,{}),p.jsx(wn,{title:"Connect your email",description:`Add your email to your ${t==null?void 0:t.name} account`,icon:p.jsx(sh,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),p.jsx(ah,{children:p.jsx(Ite,{stacked:!0})}),p.jsx(qr,{}),p.jsx(Ht,{})]})},rYe=()=>{let{app:t,currentScreen:e,data:r,navigate:n,setModalData:i}=ht(),{initLoginWithSms:s}=bt();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(Lr,{}),p.jsx(wn,{title:"Connect your phone",description:`Add your number to your ${t==null?void 0:t.name} account`,icon:p.jsx(Io,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),p.jsx(ah,{children:p.jsx(z5,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:a}){var o;try{await s({phoneNumber:a,withPrivyUi:!0}),n(de.AWAITING_PASSWORDLESS_CODE)}catch(c){i({errorModalData:{error:c,previousScreen:((o=r==null?void 0:r.errorModalData)==null?void 0:o.previousScreen)||e||de.LINK_PHONE_SCREEN}}),n(de.ERROR_SCREEN)}},hideRecent:!0})}),p.jsx(qr,{}),p.jsx(Ht,{})]})},nYe=()=>{var a,o;let{app:t,data:e}=ht(),r=(a=e==null?void 0:e.externalConnectWallet)==null?void 0:a.suggestedAddress,n=r?p.jsxs("span",{children:["Link the wallet with address ",p.jsx(_i,{showCopyIcon:!1,address:r})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Link a wallet to your ${t==null?void 0:t.name} account`,{connectors:i}=bt(),s=Lf({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!1,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),s.length>0&&p.jsx(By,{title:"Link your wallet",description:n}),p.jsx(Xu,{children:p.jsx(aT,{wallets:s})}),p.jsx(Ht,{})]})},iYe=({style:t,...e})=>p.jsxs("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...t},...e,children:[p.jsx("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]}),sYe=()=>{let{closePrivyModal:t}=bt(),{navigate:e}=ht();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(Lr,{}),p.jsx(iYe,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),p.jsx(By,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),p.jsxs(ah,{children:[p.jsx(Mt,{onClick:()=>e(de.LANDING),children:"Try again"}),p.jsx(Tl,{onClick:()=>t(),children:"Cancel"})]}),p.jsx(qr,{}),p.jsx(Ht,{})]})};function aYe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749
474c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))}const Vf=C.forwardRef(aYe);function oYe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z",clipRule:"evenodd"}))}const cYe=C.forwardRef(oYe);function Gte(){let{promptMfa:t,init:e,submit:r,cancel:n,mfaMethods:i}=C.useContext(Ly);return{promptMfa:t,init:e,submit:r,cancel:n,mfaMethods:i}}function Tp(){let{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenroll:a,enrollInMfa:o}=C.useContext(Ly);return{initEnrollmentWithSms:t,initEnrollmentWithTotp:e,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:s,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>o(!0),closeMfaEnrollmentModal:()=>o(!1)}}const lYe=t=>p.jsxs(uYe,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...t,children:[p.jsx("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),p.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let uYe=oe.svg.withConfig({displayName:"StyledSvg",componentId:"sc-59fa943f-0"}
474)(["height:90px;width:90px;> rect{","}> path{fill:white;}"],(t=>t.color==="success"?"fill: var(--privy-color-success);":"fill: var(--privy-color-accent);"));function dYe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}))}const V5=C.forwardRef(dYe);function fYe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.864 4.243A7.5 7.5 0 0 1 19.5 10.5c0 2.92-.556 5.709-1.568 8.268M5.742 6.364A7.465 7.465 0 0 0 4.5 10.5a7.464 7.464 0 0 1-1.15 3.993m1.989 3.559A11.209 11.209 0 0 0 8.25 10.5a3.75 3.75 0 1 1 7.5 0c0 .527-.021 1.049-.064 1.565M12 10.5a14.94 14.94 0 0 1-3.6 9.75m6.633-4.596a18.666 18.666 0 0 1-2.485 5.33"}))}const Kte=C.forwardRef(fYe);function hYe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Vx=C.forwardRef(hYe),pYe=({showIntro:t,userMfaMethods:e,appMfaMethods:r,userHasAuthSms:n,isTotpLoading:i,isPasskeyLoading:s,error:a,onClose:o,onBackToIntro:c,handleSelectMethod:l,setRemovingMfaMethod:u})=>{let d=e.reduce(((h,g)=>({...h,[g]:!0})),{}),f=r.reduce(((h,g)=>({...h,[g]:!0})),{});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:t?c:void 0,onClose:o},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Vf,{})}),p.jsx(Hr,{children:"Choose a verification method"}),e.length>0?p.jsx(Gr,{children:"To add or delete verification methods, verification is required."}):p.jsx(Gr,{children:"How would you like to verify your identity? You can change this later."}),a&&p.jsx(YQ,{style:{marginTop:"1.25rem"},children:a.message}),p.jsxs(QQ,{children:[(f.totp||d.totp)&&p.jsxs(sE,{children:[p.jsx(In,{style:{justifyContent:"center"},disabled:d.totp||i,onClick:()=>l("totp"),children:i?p.jsx(Fa,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):p.jsxs(lE,{children:[p.jsxs(oE,{children:[p.jsx(V5,{}),"Authenticator app"]}),d.totp?p.jsx(Hx,{color:"green",children:"Enabled"}):p.jsx(cE,{children:"Recommended"})]})}),d.totp&&p.jsx(aE,{style:{position:"absolute",right:0},onClick:()=>u("totp"),children:p.jsx(Vx,{})})]},"totp"),(f.sms||d.sms)&&p.jsxs(sE,{children:[p.jsx(In,{disabled:d.sms||n,onClick:()=>l("sms"),children:p.jsxs(lE,{children:[p.jsxs(oE,{children:[p.jsx(Io,{}),"SMS"]}),d.sms&&p.jsx(Hx,{color:"green",children:"Enabled"}),n&&p.jsx(cE,{children:"Disabled"})]})}),d.sms&&p.jsx(aE,{style:{position:"absolute",right:0},onClick:()=>u("sms"),children:p.jsx(Vx,{})})]},"sms"),(f.passkey||d.passkey)&&p.jsxs(sE,{children:[p.jsx(In,{style:{justifyContent:"center"},onClick:()=>l("passkey"),disabled:d.passkey||s,children:s?p.jsx(Fa,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):p.jsxs(lE,{children:[p.jsxs(oE,{children:[p.jsx(Kte,{}),"Passkey"]}),d.passkey?p.jsx(Hx,{color:"green",children:"Enabled"}):p.jsx(cE,{isAccent:!0,children:p.jsx(vI,{})})]})}),d.passkey&&p.jsx(aE,{style:{position:"absolute",right:0},onClick:()=>u("passkey"),children:p.jsx(Vx,{})})]},"passkey")]}),p.jsx(vr,{})]})};let Hx=oe($o).withConfig({displayName:"StyledChip",componentId:"sc-998ca5bc-0"})(["margin-right:1.5rem;"]);function gYe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"}))}const mYe=C.forwardRef(gYe),yYe=({onComplete:t,onClose:e,onReset:r})=>{let{user:n}=Sr(),{data:i}=ht(),{initLinkWithPasskey:s,linkWithPasskey:a}=bt(),{initEnrollmentWithPasskey:o,submitEnrollmentWithPasskey:c}=Tp(),[l,u]=C.useState(!1),[d,f]=C.useState(!1),[h,g]=C.useState(!1),[m,y]=C.useState(null),b=C.useMemo((()=>(n==null?void 0:n.linkedAccounts.filter((x=>x.type==="passkey")))??[]),[n]),E=()=>{var x;(x=i==null?void 0:i.mfaEnrollmentFlow)==null||x.onSuccess(),t()},v=async x=>{u(!0);try{await o(),await c({credentialIds:x}),g(!0)}catch(_){y(_)}finally{u(!1)}},w=async()=>{f(!0),y(null);try{await s();let x=await a(),_=(x==null?void 0:x.linkedAccounts.filter((S=>S.type==="passkey")).map((S=>S.credentialId)))??[];await v(_)}catch(x){y(x)}finally{f(!1)}};return b.length===0||d?p.jsx(bYe,{onReset:r,onClose:e,onClick:w,isCreating:d}):h?p.jsx(wYe,{onClick:E,onClose:E}):m?p.jsx(e2,{error:m,backFn:()=>y(null),onClick:()=>y(null)}):p.jsx(vYe,{passkeys:b,isSubmitting:l,isCreating:d,onReset:r,onClose:e,onSubmitEnrollment:()=>v(b.map((x=>x.credentialId))),onAddPasskey:w})};let bYe=({onReset:t,onClose:e,onClick:r,isCreating:n})=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:t,onClose:e},"header"),p.jsx(Uy,{children:p.jsxs(yI,{children:[p.jsx(c2,{}),p.jsx(l2,{})]})}),p.jsx(Hr,{children:"Set up passkey verification"}),p.jsxs(Q3,{children:[p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(Vf,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(ute,{})}),"Takes seconds to set up and use"]}),p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(mYe,{})}),"Use your passkey to verify transactions and login to your account"]})]}),p.jsx(Mt,{style:{marginTop:"2.25rem"},onClick:r,loading:n,children:"Add a new passkey"}),p.jsx(vr,{})]}),vYe=({onReset:t,onClose:e,onAddPasskey:r,onSubmitEnrollment:n,passkeys:i,isSubmitting:s,isCreating:a})=>{let[o,c]=C.useState(!1),l=o?i.length:i.length>3?2:3;return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:o?()=>c(!1):t,onClose:e},"header"),!o&&p.jsx(Uy,{children:p.jsxs(yI,{children:[p.jsx(c2,{}),p.jsx(l2,{})]})}),p.jsx(Hr,{children:"Enable your passkeys for verification"}),p.jsxs(Q3,{children:[i.slice(0,l).map((u=>{var d;return p.jsxs(EYe,{children:[p.jsx(xYe,{children:CYe(u)}),p.jsxs(_Ye,{children:["Last used: ",(d=u.latestVerifiedAt)==null?void 0:d.toLocaleStr
474ing()]})]},u.credentialId)})),!o&&i.length>3&&p.jsx(yU,{onClick:()=>c(!0),children:"View All"})]}),p.jsx(Mt,{style:{marginTop:"1.5rem"},onClick:n,loading:s,children:"Enable passkeys"}),i.length<5&&p.jsx(yU,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?p.jsx(Fa,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),p.jsx(vr,{})]})},wYe=({onClick:t,onClose:e})=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:e},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Mo,{})}),p.jsx(Hr,{children:"Passkey verification added"}),p.jsx(Gr,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),p.jsx(Na,{children:p.jsx(Mt,{onClick:t,children:"Done"})}),p.jsx(vr,{})]}),EYe=oe.div.withConfig({displayName:"PasskeyItem",componentId:"sc-926c6706-0"})(["&&{padding:0.75rem 1rem;text-align:left;border-radius:0.5rem;border:1px solid var(--privy-color-foreground-4);width:100%;}"]),xYe=oe.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-926c6706-1"})(["font-size:0.875rem;line-height:1.375rem;font-weight:500;color:var(--privy-color-foreground-1);"]),_Ye=oe.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-926c6706-2"})(["font-size:0.75rem;font-weight:400;line-height:1.125rem;color:var(--privy-color-foreground-2);"]),CYe=t=>t.authenticatorName?t.createdWithBrowser?`${t.authenticatorName} on ${t.createdWithBrowser}`:t.authenticatorName:t.createdWithBrowser?t.createdWithOs?`${t.createdWithBrowser} on ${t.createdWithOs}`:`${t.createdWithBrowser}`:"Unknown device";const yU=oe.button.withConfig({displayName:"StyledLink",componentId:"sc-926c6706-3"})(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:0.75rem 1rem;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent);:focus{outline:none;box-shadow:none;}}"]);let SYe=Array(6).fill("");var Yg,AYe=((Yg=AYe||{})[Yg.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",Yg[Yg.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",Yg);function cC(t){return/^[0-9]{1}$/.test(t)}function bU(t){return t.length===6&&t.every(cC)}const Nw=({onChange:t,disabled:e,errorReasonOverride:r,success:n})=>{let[i,s]=C.useState(SYe),[a,o]=C.useState(null),[c,l]=C.useState(null),u=async f=>{var S;f.preventDefault();let h=f.currentTarget.value.replace(/\s+/g,"");if(h==="")return;let g=i.reduce(((A,I)=>A+Number(cC(I))),0),m=h.split(""),y=!m.every(cC),b=m.length+g>6;if(y)return o("Passcode can only be numbers"),void l(1);if(b)return o("Passcode must be exactly 6 numbers"),void l(1);o(null),l(null);let E=Number((S=f.currentTarget.name)==null?void 0:S.charAt(4)),v=[...h||[""]].slice(0,6-E),w=[...i.slice(0,E),...v,...i.slice(E+v.length)];s(w);let x=Math.min(Math.max(E+v.length,0),5),_=document.querySelector(`input[name=pin-${x}]`);if(_==null||_.focus(),bU(w))try{await t(w.join(""));let A=document.querySelector(`input[name=pin-${x}]`);A==null||A.blur()}catch(A){l(1),o(A.message)}else try{await t(null)}catch(A){l(1),o(A.message)}},d=n?"success":!r&&!a?"":"fail";return p.jsx(p.Fragment,{children:p.jsxs(TYe,{children:[p.jsx("div",{children:i.map(((f,h)=>p.jsx("input",{name:`pin-${h}`,type:"text",value:i[h],onChange:u,onKeyUp:g=>{g.key==="Backspace"&&(m=>{c===1&&(o(null),l(null));let y=[...i.slice(0,m),"",...i.slice(m+1)];if(s(y),m>0){let b=document.querySelector(`input[name=pin-${m-1}]`);b==null||b.focus()}bU(y)?t(y.join("")):t(null)})(h)},inputMode:"numeric",autoFocus:h===0,pattern:"[0-9]",className:d,autoComplete:An.isMobile?"one-time-code":"off",disabled:e},h)))}),p.jsx("div",{children:p.jsx(IYe,{$fail:!!r||!!a,children:r||a})})]})})};let TYe=oe.div.withConfig({displayName:"PinInputContainer",componentId:"sc-7a171f6-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;@media (max-width:440px){margin-top:8px;margin-bottom:8px;}> div:nth-child(1){display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:disabled{background:var(--privy-color-background-2);}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),IYe=oe.div.withConfig({displayName:"InputHelp",componentId:"sc-7a171f6-1"})(["line-height:20px;font-size:13px;display:flex;justify-content:flex-start;width:100%;color:",";"],(t=>t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"));const kYe=({onComplete:t,onReset:e,onClose:r})=>{let[n,i]=C.useState(""),[s,a]=C.useState(!1),[o,c]=C.useState(null),[l,u]=C.useState("enroll"),{initEnrollmentWithSms:d,submitEnrollmentWithSms:f}=Tp(),{app:h,data:g}=ht();function m(){var y;(y=g==null?void 0:g.mfaEnrollmentFlow)==null||y.onSuccess(),t()}return o?p.jsx(e2,{error:o,backFn:()=>c(null),onClick:()=>c(null)}):p.jsxs(p.Fragment,l==="enroll"?{children:[p.jsx(lt,{backFn:e,onClose:r},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Io,{})}),p.jsx(Hr,{children:"Set up SMS verification"}),p.jsx(Gr,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),p.jsxs(Mf,{children:[p.jsx(z5,{onSubmit:async function({qualifiedPhoneNumber:y}){try{await d({phoneNumber:y}),i(y),u("verify")}catch(b){c(b)}},hideRecent:!0}),p.jsxs(c7e,{children:["By providing your mobile number, you agree to re
474ceive text messages from ",h==null?void 0:h.name,". Some carrier charges may apply"]})]}),p.jsx(vr,{})]}:s?{children:[p.jsx(lt,{onClose:m},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Mo,{})}),p.jsx(Hr,{children:"SMS verification added"}),p.jsx(Gr,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),p.jsx(Na,{children:p.jsx(Mt,{onClick:m,children:"Done"})}),p.jsx(vr,{})]}:{children:[p.jsx(lt,{backFn:function(){l==="verify"?u("enroll"):e()},onClose:r},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Io,{})}),p.jsx(Hr,{children:"Enter enrollment code"}),p.jsxs(Mf,{children:[p.jsx(Nw,{onChange:async function(y){try{if(!y)return;await f({phoneNumber:n,mfaCode:y}),a(!0)}catch(b){throw hJ(b)?Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):HT(b)?Error("The code you entered is not valid"):VT(b)?Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):pJ(b)?Error("Verification canceled"):Error("Unknown error")}}}),p.jsxs(Gr,{children:["To continue, enter the 6-digit code sent to ",p.jsx("strong",{children:rye(n)})]})]}),p.jsx(vr,{})]})};function $Ye({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M12.516 2.17a.75.75 0 0 0-1.032 0 11.209 11.209 0 0 1-7.877 3.08.75.75 0 0 0-.722.515A12.74 12.74 0 0 0 2.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 0 0 .374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 0 0-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08Zm3.094 8.016a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const NYe=C.forwardRef($Ye),PYe=({size:t,authUrl:e})=>p.jsx(A5,{url:e,squareLogoElement:NYe,size:t,fgColor:"#1F1F1F"}),OYe=({onComplete:t,onClose:e,onReset:r,totpInfo:n})=>{let[i,s]=C.useState("enroll"),[a,o]=C.useState(!1),{submitEnrollmentWithTotp:c}=Tp(),{data:l}=ht();function u(){var d;(d=l==null?void 0:l.mfaEnrollmentFlow)==null||d.onSuccess(),t()}return p.jsxs(p.Fragment,i==="enroll"?{children:[p.jsx(lt,{backFn:r,onClose:e},"header"),p.jsx(Hr,{children:"Scan QR code"}),p.jsx(Gr,{children:"Open your authenticator app and scan the QR code to continue."}),p.jsx(iT,{children:p.jsx(PYe,{authUrl:n.authUrl,size:200})}),p.jsxs(Na,{children:[p.jsx(ko,{children:p.jsx(S5,{itemName:"secret",text:n.secret})}),p.jsx(Mt,{onClick:function(){s("verify")},children:"Continue"})]}),p.jsx(vr,{})]}:a?{children:[p.jsx(lt,{onClose:u},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Mo,{})}),p.jsx(Hr,{children:"Authenticator app verification added"}),p.jsx(Gr,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),p.jsx(Na,{children:p.jsx(Mt,{onClick:u,children:"Done"})}),p.jsx(vr,{})]}:{children:[p.jsx(lt,{backFn:function(){i==="verify"?s("enroll"):r()},onClose:e},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(V5,{})}),p.jsx(Hr,{children:"Enter enrollment code"}),p.jsx(Mf,{children:p.jsx(Nw,{onChange:async function(d){try{if(!d)return;await c({mfaCode:d}),o(!0)}catch(f){throw hJ(f)?Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):HT(f)?Error("The code you entered is not valid"):VT(f)?Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):pJ(f)?Error("Verification canceled"):Error("Unknown error")}}})}),p.jsxs(Gr,{children:["To continue, enter the 6-digit code generated from your ",p.jsx("strong",{children:"authenticator app"})]}),p.jsx(vr,{})]})},RYe=()=>{let{user:t,enrollInMfa:e}=Sr(),[r,n]=C.useState(null),{unenrollWithSms:i,unenrollWithTotp:s,unenrollWithPasskey:a}=Tp(),{app:o,ready:c,data:l,onUserCloseViaDialogOrKeybindRef:u}=ht(),{closePrivyModal:d}=bt(),{promptMfa:f}=Gte(),{initEnrollmentWithTotp:h}=Tp(),[g,m]=C.useState(!1),[y,b]=C.useState(null),[E,v]=C.useState(null),w=()=>{d({shouldCallAuthOnSuccess:!0}),e(!1),setTimeout((()=>{n(null),b(null)}),500)},{initEnrollmentWithPasskey:x,submitEnrollmentWithPasskey:_}=Tp(),[S,A]=C.useState(!1),[I,$]=C.useState(null);u.current=w;let P=t==null?void 0:t.mfaMethods.includes("sms"),j=!!(t!=null&&t.phone),L=t==null?void 0:t.mfaMethods.includes("totp"),B=t==null?void 0:t.mfaMethods.includes("passkey"),k=P||L||B,D=(t==null?void 0:t.linkedAccounts.filter((W=>W.type==="passkey")).map((W=>W.credentialId)))??[];function q(){n(null),b(null)}if(C.useEffect((()=>{k&&m(!0)}),[k]),!c||!t||!o)return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:w},"header"),p.jsx(Uy,{children:p.jsx(lYe,{})}),p.jsx(Mf,{children:p.jsx(Fa,{})}),p.jsx(vr,{})]});if(r==="sms")return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:q,onClose:w},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(bf,{})}),p.jsx(Hr,{children:"Remove SMS verification?"}),p.jsxs(Gr,{children:["MFA adds an extra layer of security to your ",o==null?void 0:o.name," account. Make sure you have other methods to secure your account."]}),p.jsx(Na,{children:p.jsx(Mt,{warn:!0,onClick:async function(){n(null);try{await i()}catch{n(null)}},children:"Remove SMS for MFA"})}),p.jsx(vr,{})]});if(r==="totp")return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:q,onClose:w},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(bf,{})}),p.jsx(Hr,{children:"Remove Authenticator App verification?"}),p.jsxs(Gr,{children:["MFA adds an extra layer of security to your ",o==null?void 0:o.name," account. Make sure you have other methods to secure your account."]}),p.jsx(Na,{children:p.jsx(Mt,{warn:!0,onClick:async function(){n(null);try{await s()}catch{n(null)}},children:"Remove Authenticator App for MFA"})}),p.jsx(vr,{})]});if(r==="passkey")return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:q,onClose:w},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(bf,{})}),p.jsx(Hr,{children:"Are you sure you want to remove passkey verification?"}),p.jsx(Gr,{children:"This will disable any passkeys you have set up for verification. Youâll still be able to login with your passkeys if youâve set up passkey login."}),p.jsx(Na,{children:p.jsx(Mt,{warn:!0,onClick:async function(){n(null);try{await f(),await a()}catch{n(null)}},children:"Yes, remove"})}),p.jsx(vr,{})]});if(l.mfaEnrollmentFlow.mfaMethods.length===0&&!k)return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:w},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Vf,{})}),p.jsx(Hr,{children:"Add more security"}),p.jsxs(Gr,{children:[o==null?void 0:o.name," does not have any verification methods enabled."]}),p.jsx(Na,{children:p.jsx(Mt,{onClick:w,children:"Close"})}),p.jsx(vr,{})]});let U=!k&&!g;return U?p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:w},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Vf,{})}),p.jsx(Hr,{children:"Transaction Protection"}),p.jsx(Gr,{children:"Set up transaction protection to add an extra layer of security to your account"}),p.jsxs(Q3,{children:[p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(dte,{})}),"Enable 2-Step verification for your ",o==null?void 0:o.name," wallet."]}
474),p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(cYe,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),p.jsxs(Na,{children:[p.jsx(Mt,{onClick:()=>m(!0),children:"Continue"}),p.jsx(Tl,{onClick:w,children:"Not now"})]}),p.jsx(vr,{})]}):y==="sms"?p.jsx(kYe,{onComplete:w,onReset:q,onClose:w}):y==="totp"&&E?p.jsx(OYe,{onComplete:w,onClose:w,onReset:q,totpInfo:E}):y==="passkey"?p.jsx(yYe,{onComplete:w,onReset:q,onClose:w}):p.jsx(pYe,{showIntro:U,userMfaMethods:t.mfaMethods,appMfaMethods:o.mfa.methods,userHasAuthSms:j,onBackToIntro:function(){m(!1)},handleSelectMethod:async function(W){return await f().catch($),W==="totp"?(b(W),v(null),void h().then((V=>{v(V)})).catch((()=>{v(null),q()}))):W==="passkey"&&D.length===1?await(async function(){A(!0);try{await x(),await _({credentialIds:D})}catch(V){$(V)}finally{A(!1)}})():void b(W)},isTotpLoading:y==="totp"&&!E,isPasskeyLoading:S,error:I,onClose:w,setRemovingMfaMethod:n})},Gx=({label:t,children:e,valueStyles:r})=>p.jsxs(DYe,{children:[p.jsx("div",{children:t}),p.jsx(MYe,{style:{...r},children:e})]});let DYe=oe.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),MYe=oe.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const jYe=({weiQuantities:t,tokenPrice:e,tokenSymbol:r})=>{let n=mI(t),i=e?wf(n,e):void 0,s=Da(n,r);return p.jsx(wI,{children:i||s})},Qte=({weiQuantities:t,tokenPrice:e,tokenSymbol:r})=>{let n=mI(t),i=e?wf(n,e):void 0,s=Da(n,r);return p.jsx(wI,{children:i?p.jsxs(p.Fragment,{children:[p.jsx(LYe,{children:"USD"}),i==="<$0.01"?p.jsxs(Zte,{children:[p.jsx(Yte,{children:"<"}),"$0.01"]}):i]}):s})},lC=({quantities:t,tokenPrice:e,tokenSymbol:r="SOL",tokenDecimals:n=9})=>{let i=t.reduce(((o,c)=>o+c),0n),s=e&&r==="SOL"&&n===9?M1(i,e):void 0,a=r==="SOL"&&n===9?Bu(i):`${LC(i,n)} ${r}`;return p.jsx(wI,{children:s?p.jsx(p.Fragment,{children:s==="<$0.01"?p.jsxs(Zte,{children:[p.jsx(Yte,{children:"<"}),"$0.01"]}):s}):a})};let wI=oe.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-50ba8926-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),LYe=oe.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-50ba8926-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),Yte=oe.span.withConfig({displayName:"TinyLessThan",componentId:"sc-50ba8926-2"})(["font-size:10px;"]),Zte=oe.span.withConfig({displayName:"FlexCenter",componentId:"sc-50ba8926-3"})(["display:flex;align-items:center;"]);const FYe=({gas:t,tokenPrice:e,tokenSymbol:r})=>p.jsxs(Y3,{style:{paddingBottom:"12px"},children:[p.jsxs(Xte,{children:[p.jsx(ere,{children:"Est. Fees"}),p.jsx("div",{children:p.jsx(Qte,{weiQuantities:[t],tokenPrice:e,tokenSymbol:r})})]}),e&&p.jsx(Jte,{children:`${Da(t,r)}`})]}),UYe=({transactionData:t,gas:e,tokenPrice:r,tokenSymbol:n})=>{let i=cs(t.value||0).add(cs(e)).toHexString();return p.jsxs(Y3,{children:[p.jsxs(Xte,{children:[p.jsx(ere,{children:"Total (including fees)"}),p.jsx("div",{children:p.jsx(Qte,{weiQuantities:[t.value||0,e],tokenPrice:r,tokenSymbol:n})})]}),r&&p.jsx(Jte,{children:Da(i,n)})]})};let Xte=oe.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-57dfeccd-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),Jte=oe.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-57dfeccd-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),ere=oe.div.withConfig({displayName:"TotalText",componentId:"sc-57dfeccd-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const d2=C.createContext(void 0),H5=C.createContext(void 0),BYe=({defaultValue:t,children:e})=>{let[r,n]=C.useState(t||null);return p.jsx(d2.Provider,{value:{activePanel:r,togglePanel:i=>{n(r===i?null:i)}},children:p.jsx(HYe,{children:e})})},qYe=({value:t,children:e})=>{let{activePanel:r,togglePanel:n}=C.useContext(d2),i=r===t;return p.jsx(H5.Provider,{value:{onToggle:()=>n(t),value:t},children:p.jsx(YYe,{isActive:i,"data-open":i,children:e})})},WYe=({children:t})=>{let{activePanel:e}=C.useContext(d2),{onToggle:r,value:n}=C.useContext(H5),i=e===n;return p.jsxs(p.Fragment,{children:[p.jsxs(GYe,{onClick:r,"data-open":i,children:[p.jsx(QYe,{children:t}),p.jsx(XYe,{isactive:i,children:p.jsx(U5,{height:"16px",width:"16px",strokeWidth:"2"})})]}),p.jsx(KYe,{})]})},zYe=({children:t})=>{let{activePanel:e}=C.useContext(d2),{value:r}=C.useContext(H5);return p.jsx(ZYe,{"data-open":e===r,children:p.jsx(tre,{children:t})})},VYe=({children:t})=>{let{activePanel:e}=C.useContext(d2),{value:r}=C.useContext(H5);return p.jsx(tre,{children:typeof t=="function"?t({isActive:e===r}):t})};
474let HYe=oe.div.withConfig({displayName:"AccordionRoot",componentId:"sc-281bf545-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),GYe=oe.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-281bf545-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),KYe=oe.div.withConfig({displayName:"AccordionDivider",componentId:"sc-281bf545-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),QYe=oe.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-281bf545-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),YYe=oe.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-281bf545-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),ZYe=oe.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-281bf545-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),tre=oe.div.withConfig({displayName:"ContentWrapper",componentId:"sc-281bf545-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),XYe=oe.div.withConfig({displayName:"IconWrapper",componentId:"sc-281bf545-7"})(["transform:",";"],(t=>t.isactive?"rotate(180deg)":"rotate(0deg)"));const Pw=({walletAddress:t,chainId:e=Lm,network:r,rpcEndpoint:n})=>p.jsx(JYe,{href:r==="ethereum"?KGe(e,t):N_e(t,z3(n||"")),target:"_blank",children:fs(t)});let JYe=oe.a.withConfig({displayName:"StyledLink",componentId:"sc-adda23e5-0"})(["&:hover{text-decoration:underline;}"]);const rre=({from:t,to:e,txn:r,transactionInfo:n,tokenPrice:i,gas:s,tokenSymbol:a})=>{let o=(r==null?void 0:r.value)||0;return p.jsx(BYe,{...Jn().render.standalone?{defaultValue:"details"}:{},children:p.jsxs(qYe,{value:"details",children:[p.jsx(WYe,{children:p.jsxs(eZe,{children:[p.jsx("div",{children:(n==null?void 0:n.title)||(n==null?void 0:n.actionDescription)||"Details"}),p.jsx(tZe,{children:p.jsx(jYe,{weiQuantities:[o],tokenPrice:i,tokenSymbol:a})})]})}),p.jsxs(zYe,{children:[p.jsx(Gx,{label:"From",children:p.jsx(Pw,{walletAddress:t,chainId:r.chainId||Lm,network:"ethereum"})}),p.jsx(Gx,{label:"To",children:p.jsx(Pw,{walletAddress:e,chainId:r.chainId||Lm,network:"ethereum"})}),n&&n.action&&p.jsx(Gx,{label:"Action",children:n.action}),s&&p.jsx(FYe,{transactionData:r,gas:s,tokenPrice:i,tokenSymbol:a})]}),p.jsx(VYe,{children:({isActive:c})=>p.jsx(UYe,{transactionData:r,displayFee:c,gas:s||"0x0",tokenPrice:i,tokenSymbol:a})})]})})};let eZe=oe.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-f5e43b51-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),tZe=oe.div.withConfig({displayName:"TotalText",componentId:"sc-f5e43b51-1"})(["flex-shrink:0;padding-left:8px;"]);const uC=({pendingTransaction:t})=>{let{getAccessToken:e}=Sr(),{wallets:r}=ph(),{walletProxy:n,rpcConfig:i,chains:s,appId:a,nativeTokenSymbolForChainId:o}=bt(),[c,l]=C.useState(null),[u,d]=C.useState(t),{tokenPrice:f}=W0(u.chainId),h=o(t.chainId)||"ETH",g=C.useMemo((()=>r.find((m=>m.walletClientType==="privy"))),[r]);return C.useEffect((()=>{(async function(){if(!await e()||!n||!g)return u;let m=a0(u.chainId,s,i,{appId:a}),y=await $S(g.address,u,m),{totalGasEstimate:b}=await kS(y,m);return l(b.toHexString()),y})().then(d).catch(console.error)}),[n]),g?p.jsx(rZe,{children:p.jsx(rre,{from:g.address,to:u.to,txn:u,gas:c??void 0,tokenPrice:f,tokenSymbol:h})}):null};let rZe=oe.div.withConfig({displayName:"TransactionInfoWrapper",componentId:"sc-d00f06ba-0"})(["width:100%;padding:1rem 0;"]);function nZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))}const iZe=C.forwardRef(nZe),sZe=({hasBlockingError:t,error:e,onClose:r,onBack:n,handleSubmit:i,account:s,submitSuccess:a})=>{var c;let{pendingTransaction:o}=bt();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:r},"header"),p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:a,fail:!!e}),p.jsx(e?zl:c2,{style:{width:"38px",height:"38px"}})]})}),p.jsx(Hr,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),p.jsxs(Q3,{children:[p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(Vf,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),p.jsxs(lc,{children:[p.jsx(cc,{children:p.jsx(iZe,{})}
474),"You last added a passkey on"," ",(c=s==null?void 0:s.firstVerifiedAt)==null?void 0:c.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),o&&p.jsx(Mf,{children:p.jsx(uC,{pendingTransaction:o})}),e&&p.jsxs(p.Fragment,{children:[p.jsx(YQ,{style:{marginTop:"1.25rem"},children:e.message}),p.jsx(Mt,{disabled:t,onClick:i,style:{marginTop:"1.25rem"},children:"Try again"})]}),n&&p.jsx(iw,{style:{marginTop:"1rem"},onClick:n,children:"Choose another method"}),p.jsx(vr,{})]})},vU=({open:t,onClose:e})=>{let{user:r}=Sr(),[n,i]=C.useState((r==null?void 0:r.mfaMethods[0])??null),{init:s,cancel:a,submit:o}=Gte(),[c,l]=C.useState(!1),[u,d]=C.useState(!1),[f,h]=C.useState(null),[g,m]=C.useState(null);C.useEffect((()=>{i((r==null?void 0:r.mfaMethods[0])??null)}),[r==null?void 0:r.mfaMethods]);let y=C.useRef(!1);C.useEffect((()=>{!y.current&&n&&t&&(y.current=!0,v(n).finally((()=>{y.current=!1})))}),[t]);let b=x=>rBe(x)?(l(!0),Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):HT(x)?(l(!1),Error("The code you entered is not valid")):VT(x)?(l(!0),Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(x),l(!1),Error("Something went wrong."));async function E(x){m(null);try{if(!x||!n)return;await o(n,x),d(!0),l(!1),e()}catch(_){throw b(_)}}async function v(x){if(x!=="passkey")try{i(x),await s(x)}catch(_){console.error(_)}else try{i(x);let _=await s(x);if(!_)throw Error("something went wrong");h(_),await o(x,_),d(!0),l(!1),e()}catch(_){m(b(_))}}let w=()=>{i(null),m(null),a(),e()};return t&&r?n==="passkey"?p.jsx(sZe,{account:r.linkedAccounts.filter((x=>x.type==="passkey"&&x.enrolledInMfa)).sort(((x,_)=>_.firstVerifiedAt.valueOf()-x.firstVerifiedAt.valueOf()))[0],selectedMethod:n,submitSuccess:u,hasBlockingError:c,error:g,onClose:w,onBack:()=>{i(null),m(null)},handleSubmit:()=>E(f).catch(m)}):n?p.jsx(aZe,{submitSuccess:u,hasBlockingError:c,handleSubmitCode:E,selectedMethod:n,onClose:w,onBack:r.mfaMethods.length>1?()=>i(null):void 0}):p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:w},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Vf,{})}),p.jsx(Hr,{children:"Verify your identity"}),p.jsx(Gr,{children:"Choose a verification method"}),p.jsxs(QQ,{children:[r.mfaMethods.includes("totp")&&p.jsxs(In,{onClick:()=>v("totp"),children:[p.jsx(V5,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&p.jsxs(In,{onClick:()=>v("sms"),children:[p.jsx(Io,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&p.jsxs(In,{onClick:()=>v("passkey"),children:[p.jsx(Kte,{}),"Passkey"]},"passkey")]}),p.jsx(vr,{})]}):null};let aZe=({selectedMethod:t,submitSuccess:e,hasBlockingError:r,onClose:n,onBack:i,handleSubmitCode:s})=>{let{app:a}=ht(),{pendingTransaction:o}=bt();switch(t){case"sms":return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:n},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(Io,{})}),p.jsx(Hr,{children:"Enter verification code"}),p.jsxs(Mf,{children:[p.jsx(Nw,{success:e,disabled:r,onChange:s}),p.jsxs(Gr,{children:["To continue, please enter the 6-digit code sent to your ",p.jsx("strong",{children:"mobile device"})]}),o&&p.jsx(uC,{pendingTransaction:o})]}),i&&p.jsx(iw,{theme:a==null?void 0:a.appearance.palette.colorScheme,onClick:i,children:"Choose another method"}),p.jsx(Tl,{onClick:n,children:"Not now"}),p.jsx(vr,{})]});case"totp":return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:n},"header"),p.jsx(ts,{style:{marginBottom:"1.5rem"},children:p.jsx(V5,{})}),p.jsx(Hr,{children:"Enter verification code"}),p.jsxs(Mf,{children:[p.jsx(Nw,{success:e,disabled:r,onChange:s}),p.jsxs(Gr,{children:["To continue, please enter the 6-digit code generated from your"," ",p.jsx("strong",{children:"authenticator app"})]}),o&&p.jsx(uC,{pendingTransaction:o})]}),i&&p.jsx(iw,{theme:a==null?void 0:a.appearance.palette.colorScheme,onClick:i,children:"Choose another method"}),p.jsx(Tl,{onClick:n,children:"Not now"}),p.jsx(vr,{})]});default:return null}};const oZe=({style:t})=>p.jsx(WJ,{style:{color:"var(--privy-color-error)",...t}});let wU={google:{name:"Google",component:Mte},discord:{name:"Discord",component:Rte},github:{name:"Github",component:Dte},linkedin:{name:"LinkedIn",component:Lte},twitter:{name:"Twitter",component:Bte},spotify:{name:"Spotify",component:Fte},instagram:{name:"Instagram",component:jte},tiktok:{name:"Tiktok",component:Ute},apple:{name:"Apple",component:Ote}};const dC=t=>t in wU?wU[t]:{name:"Unknown",component:oZe};
474function cZe(t,e){let r={detail:"",retryable:!1},n=zQ(e);if((t==null?void 0:t.privyErrorCode)===Se.LINKED_TO_ANOTHER_USER&&(r.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Se.INVALID_CREDENTIALS&&(r.retryable=!0,r.detail="Something went wrong. Try again."),t.privyErrorCode===Se.OAUTH_USER_DENIED&&(r.detail=`Retry and check ${n} to finish connecting your account.`,r.retryable=!0),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&(r.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Se.TOO_MANY_REQUESTS&&t.message.includes("provider rate limit")){let i=dC(e).name;r.detail=`Request limit reached for ${i}. Please wait a moment and try again.`}if((t==null?void 0:t.privyErrorCode)===Se.OAUTH_ACCOUNT_SUSPENDED){let i=dC(e).name;r.detail=`Your ${i} account is suspended. Please try another login method.`}return(t==null?void 0:t.privyErrorCode)===Se.CANNOT_LINK_MORE_OF_TYPE&&(r.detail="You cannot authorize more than one account for this user."),(t==null?void 0:t.privyErrorCode)===Se.OAUTH_UNEXPECTED&&e.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function fC(){let t=new URL(window.location.href);t.searchParams.delete("privy_oauth_code"),t.searchParams.delete("privy_oauth_provider"),t.searchParams.delete("privy_oauth_state"),Ut.del(Vv),window.history.replaceState({},"",t)}const lZe=()=>{var I;let{authenticated:t,logout:e,ready:r,user:n}=Sr(),{app:i,setModalData:s,navigate:a,resetNavigation:o}=ht(),{getAuthMeta:c,initLoginWithOAuth:l,loginWithOAuth:u,updateWallets:d,setReadyToTrue:f,closePrivyModal:h,createAnalyticsEvent:g}=bt(),[m,y]=C.useState(!1),[b,E]=C.useState(void 0),v=((I=c())==null?void 0:I.provider)||"google",{name:w,component:x}=dC(v),_=MQ();C.useEffect((()=>{u(v).then(($=>{y(!0),f(!0),$&&_("login","onOAuthLoginComplete",$)})).catch(($=>{var L,B,k,D,q,U,W,V,Y,K,ge,ae,ce,Q,se,me;if(f(!1),($==null?void 0:$.privyErrorCode)===Se.ALLOWLIST_REJECTED)return E(void 0),o(),void a(de.ALLOWLIST_REJECTION_SCREEN);if(($==null?void 0:$.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Ny($).toString()),E(void 0),o(),void a(de.USER_LIMIT_REACHED_SCREEN);if(($==null?void 0:$.privyErrorCode)===Se.USER_DOES_NOT_EXIST)return E(void 0),o(),void a(de.ACCOUNT_NOT_FOUND_SCREEN);if(($==null?void 0:$.privyErrorCode)===Se.ACCOUNT_TRANSFER_REQUIRED&&((B=(L=$.data)==null?void 0:L.data)!=null&&B.nonce))return E(void 0),o(),s({accountTransfer:{nonce:(D=(k=$.data)==null?void 0:k.data)==null?void 0:D.nonce,account:(U=(q=$.data)==null?void 0:q.data)==null?void 0:U.subject,displayName:(Y=(V=(W=$.data)==null?void 0:W.data)==null?void 0:V.account)==null?void 0:Y.displayName,linkMethod:(K=c())==null?void 0:K.provider,embeddedWalletAddress:(ce=(ae=(ge=$.data)==null?void 0:ge.data)==null?void 0:ae.otherUser)==null?void 0:ce.embeddedWalletAddress,oAuthUserInfo:(me=(se=(Q=$.data)==null?void 0:Q.data)==null?void 0:se.otherUser)==null?void 0:me.oAuthUserInfo}}),void a(de.LINK_CONFLICT_SCREEN);let{retryable:P,detail:j}=cZe($,v);E({retryable:P,detail:j,message:"Authentication failed"})})).finally((()=>{fC()}))}),[w,v]),C.useEffect((()=>{var $;if(r&&t&&m&&n){if(i!=null&&i.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let P=setTimeout((()=>{a(de.AFFIRMATIVE_CONSENT_SCREEN)}),fn);return()=>clearTimeout(P)}if(Sl(n,($=i==null?void 0:i.embeddedWallets)==null?void 0:$.createOnLogin)){let P=setTimeout((()=>{s({createWallet:{onSuccess:()=>{},onFailure:j=>{console.error(j),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:j,provider:v,screen:"OAuthStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),fn);return()=>clearTimeout(P)}{let P=setTimeout((()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0})),fn);return d(),()=>clearTimeout(P)}}}),[r,t,m,n]);let S=m?`Successfully connected with ${w}`:b?b.message:`Verifying connection to ${w}`,A="";return A=m?"Youâre good to go!":b?b.detail:"Just a few moments more",p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),p.jsx(Lr,{}),p.jsxs(uZe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:m,fail:!!b}),p.jsx(x,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx("h3",{children:S}),p.jsx("p",{children:A})]}),b&&(b!=null&&b.retryable)?p.jsx(JA,{onClick:()=>{fC(),l(v),E(void 0)},disabled:!m&&!(b!=null&&b.retryable),children:"Retry"}):null]}),p.jsx(qr,{}),p.jsx(vr,{})]})};let uZe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-83de42aa-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);const dZe=()=>{let{enabled:t,token:e}=Vs(),{lastScreen:r,currentScreen:n,navigateBack:i,navigate:s,setModalData:a}=ht(),{initSignupWithPasskey:o,initLoginWithPasskey:c}=bt();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:r&&n!==r?i:void 0}),p.jsx(Uy,{children:p.jsxs(fZe,{children:[p.jsx(c2,{}),p.jsx(l2,{})]})}),p.jsx(Hr,{children:"Log in or create a new account?"}),p.jsx(Gr,{children:"Create a new account with a passkey or use a passkey to log in to an existing account."}),p.jsxs(Na,{children:[p.jsx(Mt,{onClick:async()=>{t&&!e?(a({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:l=>o({captchaToken:l,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_PASSKEY_SYSTEM_DIALOGUE,onErrorNavigateTo:de.ER
474ROR_SCREEN}}),s(de.CAPTCHA_SCREEN)):(await o({withPrivyUi:!0}),a({passkeyAuthModalData:{passkeySignupFlow:!0}}),s(de.AWAITING_PASSKEY_SYSTEM_DIALOGUE))},children:"Create new account"}),p.jsx(iw,{onClick:async()=>{t&&!e?(a({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:l=>c({captchaToken:l,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_PASSKEY_SYSTEM_DIALOGUE,onErrorNavigateTo:de.ERROR_SCREEN}}),s(de.CAPTCHA_SCREEN)):(await c({withPrivyUi:!0}),a({passkeyAuthModalData:{passkeySignupFlow:!1}}),s(de.AWAITING_PASSKEY_SYSTEM_DIALOGUE))},children:"Log in with a passkey"})]}),p.jsx(Ht,{})]})},fZe=oe.div.withConfig({displayName:"DoubleIconWrapper",componentId:"sc-fd7f30b7-0"})(["display:flex;align-items:center;justify-content:center;width:180px;height:90px;border-radius:50%;svg + svg{margin-left:12px;}> svg{z-index:2;color:var(--privy-color-accent);stroke:var(--privy-color-accent);fill:var(--privy-color-accent);}"]),hZe=()=>{let{lastScreen:t,currentScreen:e,navigateBack:r,data:n}=ht(),{loginWithPasskey:i,signupWithPasskey:s,closePrivyModal:a}=bt(),{passkeySignupFlow:o}=(n==null?void 0:n.passkeyAuthModalData)??{},[c,l]=C.useState("loading"),[u,d]=C.useState(null),f=C.useRef([]);C.useEffect((()=>()=>{f.current.forEach((g=>clearTimeout(g))),f.current=[]}),[]);let h=async()=>{l("loading");try{o?await s():await i(),l("success")}catch(g){d(g),l("error")}};return C.useEffect((()=>{var g;c==="success"&&(g=setTimeout((()=>{a({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),fn),f.current=[g,...f.current])}),[c]),C.useEffect((()=>{h()}),[]),p.jsxs(p.Fragment,{children:[p.jsx(lt,{backFn:t&&e!==t?r:void 0}),p.jsxs(pZe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:c==="success",fail:c==="error"}),p.jsx(l2,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx("h3",{children:(()=>{switch(c){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})()}),p.jsx("p",{style:{whiteSpace:"pre-wrap"},children:(()=>{switch(c){case"loading":return o?"Please follow prompts to register your passkey.":`Please follow prompts to verify your passkey. 475You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(u instanceof Fs){if(u.privyErrorCode===Se.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(u.privyErrorCode===Se.PASSKEY_NOT_ALLOWED)return`Passkey request timed out or rejected by user. 476You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred. 477You will have to sign up with another method first to register a passkey for your account.`}})()})]}),(()=>{switch(c){case"loading":case"success":return p.jsx(Mt,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return p.jsx(Mt,{onClick:h,disabled:!1,children:"Retry"})}})()]}),p.jsx(vr,{})]})};let pZe=oe.div.withConfig({displayName:"Container",componentId:"sc-aab4a512-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const gZe=(t,e,r)=>{let n=encodeURIComponent(new URL(window.location.href).href.replace(/\/$/g,"")+`?privy_token=${t}&privy_connector=${r?"solana_adapter":"injected"}&privy_wallet_client=${r?"phantom_solana":"phantom"}`);if(!D3()&&An.isMobile)return`${e?"phantom://":"https://phantom.app/ul/"}browse/${n}?ref=${n}`},mZe=()=>{var u;let{forkSession:t,ready:e,authenticated:r}=Sr(),{walletConnectionStatus:n}=bt(),[i,s]=C.useState(""),[a,o]=C.useState(!1);C.useEffect((()=>{e&&r&&t().then(s)}),[e,r]);let c=gZe(i,!a,((u=n==null?void 0:n.connector)==null?void 0:u.chainType)==="solana"),l={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return e&&(l.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",l.footnote="Once you're done, you can always return here and refresh to view your updated account."),a&&(l.title="Still here?",l.description="You may need to install the Phantom mobile app.",l.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(Lr,{}
477),p.jsx(By,{title:l.title,description:l.description}),p.jsxs(ah,{children:[p.jsx(yZe,{children:p.jsx(J3,{style:{width:"72px",height:"72px"}})}),p.jsx(v9e,{href:c,onClick:()=>{setTimeout((()=>o(!0)),1e3)},loading:e&&!c,children:a?"Go to App Store":"Continue"}),l.footnote?p.jsx("p",{children:l.footnote}):null]}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let yZe=oe(ko).withConfig({displayName:"LogoContainer",componentId:"sc-18369828-0"})(["margin:16px auto;"]);const bZe=()=>{let[t,e]=C.useState(!0),{authenticated:r,getAccessToken:n,user:i}=Sr(),{walletProxy:s,closePrivyModal:a,createAnalyticsEvent:o}=bt(),{navigate:c,data:l,onUserCloseViaDialogOrKeybindRef:u}=ht(),[d,f]=C.useState(void 0),[h,g]=C.useState(""),[m,y]=C.useState(!1),{entropyId:b,entropyIdVerifier:E,onCompleteNavigateTo:v,onSuccess:w,onFailure:x}=l.recoverWallet,_=(S="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),x(typeof S=="string"?new ju(S):S)};return u.current=_,C.useEffect((()=>{if(!r)return _("User must be authenticated and have a Privy wallet before it can be recovered")}),[r]),p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:_}),p.jsx(Lr,{}),p.jsxs(wZe,{children:[p.jsxs(vZe,{children:[p.jsx(Vf,{height:48,width:48,stroke:"var(--privy-color-accent)"}),p.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),p.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),p.jsxs("div",{children:[p.jsxs(_5,{children:[p.jsx(QT,{type:t?"password":"text",onChange:S=>(A=>{A&&f(A)})(S.target.value),disabled:m,style:{paddingRight:"2.3rem"}}),p.jsx(ZT,{style:{right:"0.75rem"},children:t?p.jsx(XT,{onClick:()=>e(!1)}):p.jsx(JT,{onClick:()=>e(!0)})})]}),!!h&&p.jsx(EZe,{children:h})]}),p.jsxs("div",{children:[p.jsxs(v7e,{children:[p.jsx("h4",{children:"Why is this necessary?"}),p.jsx("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),p.jsx(xZe,{loading:m||!s,disabled:!d,onClick:async()=>{y(!0);let S=await n(),A=Qv(i,b);if(!S||!A||d===null)return _("User must be authenticated and have a Privy wallet before it can be recovered");try{o({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:A.address}}),await(s==null?void 0:s.recover({accessToken:S,entropyId:b,entropyIdVerifier:E,recoveryPassword:d})),g(""),v?c(v):a({shouldCallAuthOnSuccess:!1}),w==null||w(A),o({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:A.address}})}catch(I){tBe(I)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{y(!1)}},warn:!1,hideAnimations:!b&&m,children:"Recover your account"})]})]}),p.jsx(qr,{}),p.jsx(Ht,{})]})},vZe=oe.div.withConfig({displayName:"Header",componentId:"sc-858d1103-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:20px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]);let wZe=oe.div.withConfig({displayName:"Content",componentId:"sc-858d1103-1"})(["display:flex;flex-direction:column;justify-content:space-between;"]),EZe=oe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-858d1103-2"})(["line-height:20px;height:20px;font-size:13px;color:var(--privy-color-error);text-align:left;margin-top:0.5rem;"]),xZe=oe(Mt).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-858d1103-3"})(["",""],(t=>t.hideAnimations&&ns(["&&{transition:none;}"])));const nre=t=>p.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...t,children:[p.jsx("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992
4770 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),p.jsx("defs",{children:p.jsxs("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[p.jsx("stop",{stopColor:"#3E82F4"}),p.jsx("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),ire=({style:t,...e})=>p.jsxs("svg",{width:"16",height:"14",style:t,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[p.jsxs("g",{clipPath:"url(#clip0_2115_829)",children:[p.jsx("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),p.jsx("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),p.jsx("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),p.jsx("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),p.jsx("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),p.jsx("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),p.jsx("defs",{children:p.jsx("clipPath",{id:"clip0_2115_829",children:p.jsx("rect",{width:"16",height:"14",fill:"white"})})})]}),hC=oe.div.withConfig({displayName:"RecoveryContainer",componentId:"sc-12b46968-0"})(["display:flex;flex-direction:column;gap:12px;padding-top:24px;padding-bottom:24px;"]),_Ze=oe.div.withConfig({displayName:"RecoveryExplainerContainer",componentId:"sc-12b46968-1"})(["padding-bottom:24px;"]);let EU={"google-drive":{name:"Google Drive",component:ire},icloud:{name:"iCloud",component:nre}};const CZe=()=>{var A;let{logout:t}=Sr(),{navigate:e,setModalData:r,data:n}=ht(),{recoveryOAuthFlow:i,closePrivyModal:s,createAnalyticsEvent:a}=bt(),[o,c]=C.useState(!1),{provider:l,action:u,isInAccountCreateFlow:d}=n==null?void 0:n.recoveryOAuthStatus,[f,h]=C.useState(void 0),[g,m]=C.useState(u==="create-wallet");if(l==="user-passcode")throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let y=EU[l].name,b=EU[l].component,E=(A=n==null?void 0:n.recoverWallet)==null?void 0:A.onCompleteNavigateTo,v=new es((async(I="create-wallet")=>(m(!0),new Promise((($,P)=>{setTimeout((async()=>{try{let j=window.open();await i(l,I,j),c(!0),$()}catch{h({message:`${I==="recover"?"Recovery":"Back up"} with ${y} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${y} account associated with your backup.`:"",retryable:!0}),P()}}),0)})))));C.useEffect((()=>{u!=="recover"&&v.execute(d?"create-wallet":"set-recovery")}),[]),C.useEffect((()=>{if(!o)return;let I=setTimeout((()=>{d?(r({createWallet:{onSuccess:()=>{},onFailure:$=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:$,screen:"RecoveryOAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),e(de.EMBEDDED_WALLET_CREATED_SCREEN)):s({shouldCallAuthOnSuccess:!1})}),fn);return()=>clearTimeout(I)}),[o]);let w=C.useCallback((async()=>{await v.execute("recover"),E?e(E):c(!0)}),[]),x=l==="google-drive"?"Google Drive":"Apple iCloud",_=o&&`Successfully ${u==="recover"?"recovered":"backed up"} with ${x}.`||f&&f.message||`${u==="recover"?"Recovering":"Backing up"} with ${x}...`,S=f?f.detail:"";return p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),g?p.jsx(p.Fragment,{children:p.jsxs(hC,{children:[p.jsx(wn,{title:_,icon:p.jsx(b,{style:{width:"38px",height:"38px"}}),description:S}),f&&(f!=null&&f.retryable)?p.jsx(Mt,{onClick:()=>{fC(),h(void 0),u==="create-wallet"?v.execute("create-wallet"):w()},disabled:!o&&!(f!=null&&f.retryable),children:"Try again"}):null]})}):p.jsxs(hC,{children:[p.jsx(wn,{title:"Confirm it's really you",icon:p.jsx(b,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${x} where your account is backed up.`}),p.jsxs(Mt,{onClick:w,children:["Confirm with ",x]})]}),p.jsx(Ht,{})]})},SZe=()=>{let{app:t,navigate:e,data:r,onUserCloseViaDialogOrKeybindRef:n}=ht(),[i,s]=C.useState(""),[a,o]=C.useState(!1),[c,l]=C.useState(),[u,d]=C.useState(null),{authenticated:f,user:h}=Sr(),{closePrivyModal:g,isNewUserThisSession:m,initializeWalletProxy:y}=bt(),{onSuccess:b,onFailure:E,callAuthOnSuccessOnClose:v}=r.createWallet,{createWallet:w}=bJ(),[x,_]=C.useState(null),S=new es((async()=>{try{let A=await w({recoveryPassword:c,user:h});if(!A)return;_(A),m?e(de.EMBEDDED_WALLET_CREATED_SCREEN):(b(A),g({shouldCallAuthOnSuccess:v}))}catch(A){s(A.message)}}));return C.useEffect((()=>{u||y(3e4).then((A=>d(A)))}),[u]),C.useEffect((()=>
477{if(!f||!h)return e(de.LANDING),void E(Error("User must be authenticated before creating a Privy wallet"))}),[f]),n.current=()=>null,p.jsx(IJ,{config:{initiatedBy:"automatic"},appName:(t==null?void 0:t.name)||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!x&&a,isResettingPassword:!1,error:i,password:c||"",onClose:()=>{x&&(x==null?void 0:x.recoveryMethod)!=="user-passcode"?(E(new ju("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):x?(b(x),g({shouldCallAuthOnSuccess:v})):(E(new ju("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))},onPasswordChange:l,onPasswordGenerate:()=>l(xJ()),onSubmit:async()=>(o(!0),S.execute().then((()=>new Promise((A=>setTimeout(A,250))))).finally((()=>o(!1))))})};function AZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))}const sre=C.forwardRef(AZe);function TZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const IZe=C.forwardRef(TZe);let Kx=oe.div.withConfig({displayName:"IconContainer",componentId:"sc-6716a2fa-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),kZe={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},$Ze=({onClose:t})=>p.jsxs(_Ze,{children:[p.jsx(wn,{title:"Why do I need to secure my account?",icon:p.jsx(bf,{width:48}),description:p.jsxs(p.Fragment,{children:[p.jsx("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),p.jsx("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. Itâs important you donât lose access to the method you choose."})]})}),p.jsx(Mt,{onClick:t,children:"Select backup method"})]});const NZe=()=>{let[t,e]=C.useState(!1),{navigate:r,lastScreen:n,navigateBack:i,setModalData:s,data:a,onUserCloseViaDialogOrKeybindRef:o}=ht(),{user:c}=Sr(),{embeddedWallets:l}=Jn(),{closePrivyModal:u}=bt(),d=Ts(c),f=d===null,{isInAccountCreateFlow:h,isResettingPassword:g}=a.recoverySelection,m=d&&d.recoveryMethod!=="privy",y=m?p.jsxs("span",{children:["Your account is currently secured using"," ",p.jsx("strong",{children:kZe[(d==null?void 0:d.recoveryMethod)||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(v){s({recoveryOAuthStatus:{provider:v,action:f?"create-wallet":"set-recovery",isInAccountCreateFlow:h}}),r(de.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN)}function E(){var v,w;(v=a==null?void 0:a.setWalletPassword)==null||v.onFailure(Error("User exited set recovery flow")),u({shouldCallAuthOnSuccess:((w=a==null?void 0:a.setWalletPassword)==null?void 0:w.callAuthOnSuccessOnClose)??!1})}return o.current=E,p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:E,backFn:t?()=>e(!1):n?i:void 0,infoFn:n||t?void 0:()=>e(!0)},"header"),t?p.jsx($Ze,{onClose:()=>e(!1)}):p.jsxs(p.Fragment,{children:[p.jsx(wn,{title:m?"Update backup method":"Secure your account",icon:p.jsx(sre,{width:48}),description:y}),p.jsx(hC,{children:l.userOwnedRecoveryOptions.filter((v=>!["icloud","google-drive"].includes((d==null?void 0:d.recoveryMethod)||"")||v!==(d==null?void 0:d.recoveryMethod))).sort().map((v=>{switch(v){case"google-drive":return p.jsxs(In,{onClick:()=>b("google-drive"),children:[p.jsx(Kx,{children:p.jsx(ire,{style:{width:18}})}),"Back up to Google Drive"]},v);case"icloud":return p.jsxs(In,{onClick:()=>b("icloud"),children:[p.jsx(Kx,{children:p.jsx(nre,{style:{width:24}})}),"Back up to Apple iCloud"]},v);case"user-passcode":return p.jsxs(In,{onClick:()=>{r(gJ({isCreatingWallet:f,skipSplashScreen:!0}))},children:[p.jsx(Kx,{children:p.jsx(IZe,{style:{width:18}})}),g?"Reset your":"Set a"," password"]},v);default:return null}}))})]}),p.jsx(Ht,{})]})},PZe=oe.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(t=>t.$color??"var(--privy-color-accent)")),OZe=()=>{var y;let{user:t,getAccessToken:e}=Sr(),{walletProxy:r,refreshUser:n,closePrivyModal:i}=bt(),s=ht(),{entropyId:a,entropyIdVerifier:o}=(y=s.data)==null?void 0:y.recoverWallet,[c,l]=C.useState(!1),[u,d]=C.useState(null),[f,h]=C.useState(null);function g(){var b,E,v,w;if(!c){if(f)return(E=(b=s.data)==null?void 0:b.setWalletPassword)==null||E.onF
477ailure(f),void i();if(!u)return(w=(v=s.data)==null?void 0:v.setWalletPassword)==null||w.onFailure(Error("User exited set recovery flow")),void i()}}s.onUserCloseViaDialogOrKeybindRef.current=g;let m=!(!c&&!u);return p.jsxs(p.Fragment,f?{children:[p.jsx(lt,{onClose:g},"header"),p.jsx(PZe,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:p.jsx(zl,{height:38,width:38,stroke:"var(--privy-color-error)"})}),p.jsx(Pl,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),p.jsx(Il,{style:{minHeight:"2rem"}}),p.jsx(Fm,{onClick:()=>h(null),children:"Try again"}),p.jsx(Ht,{})]}:{children:[p.jsx(lt,{onClose:g},"header"),p.jsx(sre,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),p.jsx(Pl,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),p.jsx(bd,{style:{marginTop:"1rem"},children:"When you log into a new device, youâll only need to authenticate to access your account. Never get logged out if you forget your password."}),p.jsx(Il,{style:{minHeight:"2rem"}}),p.jsx(Fm,{loading:c,disabled:m,onClick:()=>(async function(){l(!0);try{let b=await e(),E=Qv(t,a);if(!b||!r||!E)return;if(!(await r.setRecovery({accessToken:b,entropyId:a,entropyIdVerifier:o,existingRecoveryMethod:E.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let v=await n();if(!v)throw Error("Unable to set recovery on wallet");let w=Qv(v,E.address);if(!w)throw Error("Unabled to set recovery on wallet");d(!!v),setTimeout((()=>{var x,_;(_=(x=s.data)==null?void 0:x.setWalletPassword)==null||_.onSuccess(w),i()}),fn)}catch(b){h(b)}finally{l(!1)}})(),children:u?"Success":"Confirm"}),p.jsx(Ht,{})]})};async function are({tx:t,accessToken:e,walletProxy:r,entropyId:n,entropyIdVerifier:i,transactingWalletAddress:s,transactingWalletIndex:a}){let o=pWe(t,s),c=t2(t)?Buffer.from(t.message.serialize()):t.serializeMessage(),{response:l}=await r.rpc({accessToken:e,entropyId:n,entropyIdVerifier:i,chainType:"solana",hdWalletIndex:a,request:{method:"signMessage",params:{message:c.toString("base64")}}}),u=l.data.signature;t.addSignature(o,Buffer.from(u,"base64"))}async function ore({tx:t,connection:e,accessToken:r,walletProxy:n,entropyId:i,entropyIdVerifier:s,transactingWalletAddress:a,transactingWalletIndex:o,transactionOptions:c}){let l;try{await are({tx:t,accessToken:r,walletProxy:n,entropyId:i,entropyIdVerifier:s,transactingWalletAddress:a,transactingWalletIndex:o});let u=t.serialize();l=await e.sendRawTransaction(u,c);let d=await e.confirmTransaction(l);if(d.value.err||d.value.err){let f=d.value.err||d.value.err;throw typeof f=="string"?Error(f):f}return{signature:l,receipt:await e.getParsedTransaction(l,{maxSupportedTransactionVersion:0})}}catch(u){throw u.txSignature=l,u}}function RZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"}))}const DZe=C.forwardRef(RZe),MZe=t=>{var o,c,l,u,d,f,h,g;let{chain:e,transactionDetails:r,isTokenContractInfoLoading:n,symbol:i}=t,{action:s,functionName:a}=r;return p.jsx(zT,{children:p.jsxs(z0,{children:[s!=="transaction"&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Action"}),p.jsx(yr,{children:a})]}),a==="mint"&&"args"in r&&r.args.filter((m=>m)).map(((m,y)=>{var b,E;return p.jsxs(pr,{children:[p.jsx(hr,{children:`Param ${y}`}),p.jsx(yr,{children:typeof m=="string"&&Pne(m)?p.jsx(_i,{address:m,url:(E=(b=e==null?void 0:e.blockExplorers)==null?void 0:b.default)==null?void 0:E.url,showCopyIcon:!1}):m==null?void 0:m.toString()})]},y)})),a==="setApprovalForAll"&&r.operator&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Operator"}),p.jsx(yr,{children:p.jsx(_i,{address:r.operator,url:(c=(o=e==null?void 0:e.blockExplorers)==null?void 0:o.default)==null?void 0:c.url,showCopyIcon:!1})})]}),a==="setApprovalForAll"&&r.approved!==void 0&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Set approval to"}),p.jsx(yr,{children:r.approved?"true":"false"})]}),a==="transfer"||a==="transferFrom"||a==="safeTransferFrom"||a==="approve"?p.jsxs(p.Fragment,{children:["formattedAmount"in r&&r.formattedAmount&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Amount"}),p.jsxs(yr,{$isLoading:n,children:[r.formattedAmount," ",i]})]}),"tokenId"in r&&r.tokenId&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Token ID"}),p.jsx(yr,{children:r.tokenId.toString()})]})]}):null,a==="safeBatchTransferFrom"&&p.jsxs(p.Fragment,{children:["amounts"in r&&r.amounts&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Amounts"}),p.jsx(yr,{children:r.amounts.join(", ")})]}),"tokenIds"in r&&r.tokenIds&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Token IDs"}),p.jsx(yr,{children:r.tokenIds.join(", ")})]})]}),a==="approve"&&r.spender&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Spender"}),p.jsx(yr,{children:p.jsx(_i,{address:r.spender,url:(u=(l=e==null?void 0:e.blockExplorers)==null?void 0:l.default)==null?void 0:u.url,showCopyIcon:!1})})]}),(a==="transferFrom"||a==="safeTransferFrom"||a==="safeBatchTransferFrom")&&r.transferFrom&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Transferring from"}),p.jsx(yr,{children:p.jsx(_i,{address:r.transferFrom,url:(f=(d=e==null?void 0:e.blockExplorers)==null?void 0:d.default)==null?void 0:f.url,showCopyIcon:!1})})]}),(a==="transferFrom"||a==="safeTransferFrom"||a==="safeBatchTransferFrom")&&r.transferTo&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Transferring to"}),p.jsx(yr,{children:p.jsx(_i,{address:r.transferTo,url:(g=(h=e==null?void 0:e.blockExplorers)==null?void 0:h.default)==null?void 0:g.url,showCopyIcon:!1})})]})]})})},jZe=t=>{let[e,r]=C.useState(!1),n=!0,i=!1;return(!t||t.isErc20Ish||t.action==="transaction")&&(n=!1),n&&(i=Object.entries(t||{}).some((([s,a])=>a&&!["action","isErc20Ish","isNFTIsh"].includes(s)))),{showTransactionDetail
477s:e,setShowTransactionDetails:r,hasMoreDetails:n&&i,isErc20Ish:t==null?void 0:t.isErc20Ish}},cre=({transactionIndex:t,maxIndex:e})=>typeof t!="number"||e===0?"":` (${t+1} / ${e+1})`,LZe=({img:t,submitError:e,prepareError:r,onClose:n,action:i,title:s,subtitle:a,total:o,txValue:c,to:l,tokenAddress:u,network:d,missingFunds:f,fee:h,from:g,cta:m,disabled:y,chain:b,isSubmitting:E,isPreparing:v,isTokenPriceLoading:w,isTokenContractInfoLoading:x,isSponsored:_,symbol:S,balance:A,onClick:I,transactionDetails:$,transactionIndex:P,maxIndex:j,onBack:L,chainName:B})=>{var W,V,Y,K,ge,ae;let{showTransactionDetails:k,setShowTransactionDetails:D,hasMoreDetails:q,isErc20Ish:U}=jZe($);return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:n,backFn:L}),t&&p.jsx(dre,{children:t}),p.jsxs(Pl,{style:{marginTop:t?"1.5rem":0},children:[s,p.jsx(cre,{maxIndex:j,transactionIndex:P})]}),p.jsx(bd,{children:a}),p.jsxs(z0,{style:{marginTop:"2rem"},children:[U&&p.jsxs(p.Fragment,{children:[i==="approve"&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Action"}),p.jsx(yr,{children:$==null?void 0:$.action})]}),p.jsxs(pr,{children:[p.jsx(hr,{children:"Amount"}),p.jsxs(yr,{$isLoading:U&&x,children:[$==null?void 0:$.formattedAmount," ",S]})]})]}),o&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Total"}),p.jsx(yr,{$isLoading:v||w,children:o})]}),$&&"spender"in $&&($!=null&&$.spender)?p.jsxs(pr,{children:[p.jsx(hr,{children:"Spender"}),p.jsx(yr,{children:p.jsx(_i,{address:$.spender,url:(V=(W=b==null?void 0:b.blockExplorers)==null?void 0:W.default)==null?void 0:V.url,showCopyIcon:!1})})]}):null,l&&p.jsxs(pr,{children:[p.jsx(hr,{children:"To"}),p.jsx(yr,{children:p.jsx(_i,{address:l,url:(K=(Y=b==null?void 0:b.blockExplorers)==null?void 0:Y.default)==null?void 0:K.url,showCopyIcon:!1})})]}),u&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Token address"}),p.jsx(yr,{children:p.jsx(_i,{address:u,url:(ae=(ge=b==null?void 0:b.blockExplorers)==null?void 0:ge.default)==null?void 0:ae.url,showCopyIcon:!1})})]}),p.jsxs(pr,{children:[p.jsx(hr,{children:"Network"}),p.jsx(yr,{children:d})]}),p.jsxs(pr,{children:[p.jsx(hr,{children:"Estimated fee"}),p.jsx(yr,{$isLoading:v||w||_===void 0,children:_?"Sponsored":h})]}),q&&p.jsxs(p.Fragment,{children:[p.jsx(pr,{className:"cursor-pointer",onClick:()=>D(!k),children:p.jsxs(EWe,{className:"flex items-center gap-x-1",children:["Details"," ",p.jsx(U5,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:k?"rotate(180deg)":void 0}})]})}),k&&$&&p.jsx(MZe,{action:i,chain:b,transactionDetails:$,isTokenContractInfoLoading:x,symbol:S})]})]}),p.jsx(Il,{}),e?p.jsx(Nl,{style:{marginTop:"2rem"},children:e.message}):r?p.jsx(Nl,{style:{marginTop:"2rem"},children:ure}):null,p.jsx(lre,{$useSmallMargins:!(!r&&!e),title:Number(c)>0?void 0:_!==!1?"Your wallet":void 0,address:g,balance:A,isLoading:v||w,errMsg:v||r||e||!f?void 0:`Add funds on ${(b==null?void 0:b.name)??B} to complete transaction.`}),p.jsx(Mt,{style:{marginTop:"1rem"},loading:E,disabled:y||v,onClick:I,children:m}),p.jsx(Ht,{})]})},FZe=({img:t,title:e,subtitle:r,cta:n,network:i,blockExplorerUrl:s,transactionIndex:a,maxIndex:o,isMissingFunds:c,submitError:l,parseError:u,total:d,amount:f,fee:h,balance:g,from:m,to:y,tokenAddress:b,programAddress:E,transactingWalletAddress:v,disabled:w,isSubmitting:x,isPreparing:_,isTokenPriceLoading:S,onClick:A,onClose:I,onBack:$})=>{let P=_||S;return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:I,backFn:$}),t&&p.jsx(dre,{children:t}),p.jsxs(Pl,{style:{marginTop:t?"1.5rem":0},children:[e,p.jsx(cre,{maxIndex:o,transactionIndex:a})]}),p.jsx(bd,{children:r}),p.jsxs(z0,{style:{marginTop:"2rem"},children:[(d||P)&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Total"}),p.jsx(yr,{$isLoading:P,children:d})]}),m&&m!==v&&p.jsxs(pr,{children:[p.jsx(hr,{children:"From"}),p.jsx(yr,{children:p.jsx(_i,{address:m,url:s,showCopyIcon:!1})})]}),y&&p.jsxs(pr,{children:[p.jsx(hr,{children:"To"}),p.jsx(yr,{children:p.jsx(_i,{address:y,url:s,showCopyIcon:!1})})]}),b&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Token address"}),p.jsx(yr,{children:p.jsx(_i,{address:b,url:s,showCopyIcon:!1})})]}),E&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Program address"}),p.jsx(yr,{children:p.jsx(_i,{address:E,url:s,showCopyIcon:!1})})]}),i&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Network"}),p.jsx(yr,{children:i})]}),(f||P)&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Amount"}),p.jsx(yr,{children:p.jsx(yr,{$isLoading:P,children:f})})]}),(h||P)&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Estimated fee"}),p.jsx(yr,{$isLoading:P,children:h})]})]}),p.jsx(Il,{}),l?p.jsx(Nl,{style:{marginTop:"2rem"},children:l.message}):u?p.jsx(Nl,{style:{marginTop:"2rem"},children:ure}):null,p.jsx(lre,{$useSmallMargins:!(!u&&!l),title:"Your wallet",address:v,balance:g,
477isLoading:_||S,errMsg:_||u||l||!c?void 0:"Add funds on Solana to complete transaction."}),p.jsx(Mt,{style:{marginTop:"1rem"},loading:x,disabled:w||_,onClick:A,children:n}),p.jsx(Ht,{})]})};let lre=oe(v5).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-67aab208-0"})(["",""],(t=>t.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),ure="There was an error preparing your transaction. Your transaction request will likely fail.",dre=oe.div.withConfig({displayName:"ImageContainer",componentId:"sc-67aab208-1"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),UZe=new Set([Xg.CALL_EXCEPTION,Xg.NONCE_EXPIRED,Xg.REPLACEMENT_UNDERPRICED,Xg.TRANSACTION_REPLACED]);const BZe=t=>{let e;return t.code&&t.code!==-32e3&&UZe.has(t.code)&&(e=t.transactionHash),e},qZe=t=>{var e,r,n,i;return t.code==="SERVER_ERROR"?((e=t.error)==null?void 0:e.message)??t.reason??t.message??"unknown error":((r=t.error)==null?void 0:r.code)==="SERVER_ERROR"?((i=(n=t.error)==null?void 0:n.error)==null?void 0:i.message)??t.reason??t.message??"unknown error":t.reason??t.message??"unknown error"};let WZe=()=>p.jsxs(GZe,{children:[p.jsx(QZe,{}),p.jsx(KZe,{})]});const fre=({transactionError:t,chainId:e,onClose:r,onRetry:n,network:i,connection:s})=>{let{chains:a}=bt(),[o,c]=C.useState(!1),{errorCode:l,transactionHash:u,errorMessage:d}=((h,g)=>{var b,E;if(g==="ethereum")return{errorCode:h.code?((b=h.code)==null?void 0:b.toString().charAt(0))+((E=h.code)==null?void 0:E.toString().slice(1).replace("_"," ").toLowerCase()):"Something went wrong.",transactionHash:BZe(h),errorMessage:qZe(h)};let m=h.txSignature,y=(h==null?void 0:h.transactionMessage)||"Something went wrong.";if(Array.isArray(h.logs)){let v=h.logs.find((w=>/insufficient (lamports|funds)/gi.test(w)));v&&(y=v)}return{transactionHash:m,errorMessage:y}})(t,i),f=(({chains:h,chainId:g,network:m,connection:y,transactionHash:b})=>{var E,v;return m==="ethereum"?((v=(E=h.find((w=>w.id===g)))==null?void 0:E.blockExplorers)==null?void 0:v.default.url)??"https://etherscan.io":$_e(b||"",z3((y==null?void 0:y.rpcEndpoint)||""))})({chains:a,chainId:e,network:i,connection:s,transactionHash:u});return p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:r}),p.jsxs(zZe,{children:[p.jsx(WZe,{}),p.jsx(VZe,{children:l}),p.jsx(HZe,{children:"Please try again."}),p.jsxs(_U,{children:[p.jsx(xU,{children:"Error message"}),p.jsx(CU,{$clickable:!1,children:d})]}),u&&p.jsxs(_U,{children:[p.jsx(xU,{children:"Transaction hash"}),p.jsxs(ZZe,{children:["Copy this hash to view details about the transaction on a"," ",p.jsx("u",{children:p.jsx("a",{href:f,children:"block explorer"})}),"."]}),p.jsxs(CU,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(u),c(!0)},children:[u,p.jsx(eXe,{clicked:o})]})]}),p.jsx(YZe,{onClick:()=>n({resetNonce:!!u}),children:"Retry transaction"})]}),p.jsx(vr,{})]})};let zZe=oe.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-6f98d2f2-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),VZe=oe.span.withConfig({displayName:"ErrorCode",componentId:"sc-6f98d2f2-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),HZe=oe.span.withConfig({displayName:"Subtitle",componentId:"sc-6f98d2f2-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),GZe=oe.div.withConfig({displayName:"CircleContainer",componentId:"sc-6f98d2f2-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),KZe=oe(K3).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-6f98d2f2-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),QZe=oe.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-6f98d2f2-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),YZe=oe(Mt).withConfig({displayName:"RetryButton",componentId:"sc-6f98d2f2-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),xU=oe.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-6f98d2f2-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),_U=oe.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-6f98d2f2-8"})(["width:100%;margin:5px;
477display:flex;flex-direction:column;justify-content:center;align-items:center;"]),ZZe=oe.text.withConfig({displayName:"HelperText",componentId:"sc-6f98d2f2-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),CU=oe.span.withConfig({displayName:"TextBox",componentId:"sc-6f98d2f2-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(t=>t.$clickable&&`cursor: pointer; 478 transition: background-color 0.3s; 479 padding-right: 45px; 480 481 &:hover { 482 background-color: var(--privy-color-foreground-4); 483 }`)),XZe=oe(DZe).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-6f98d2f2-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),JZe=oe(TJ).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-6f98d2f2-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),eXe=({clicked:t})=>p.jsx(t?JZe:XZe,{});const tXe=({instructions:t,fees:e,transactionInfo:r,solPrice:n,rpcEndpoint:i})=>{let s=t.reduce(((d,{amount:f,token:h})=>f&&(h==null?void 0:h.symbol)==="SOL"?d+f:d),0n),[a,o]=C.useState(0),[c,l]=C.useState(!1),u=t[a];return C.useEffect((()=>{o(0)}),[t]),p.jsxs(z0,{children:[p.jsxs(pr,{children:[p.jsx(hr,{children:"Total"}),p.jsx(yr,{children:p.jsx(lC,{quantities:[s,e],tokenPrice:n})})]}),r&&r.action&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Action"}),p.jsx(yr,{children:r.action})]}),p.jsxs(pr,{children:[p.jsx(hr,{children:"Fees"}),p.jsx(yr,{children:p.jsx(lC,{quantities:[e||0n],tokenPrice:n})})]}),t.length>1?p.jsxs(p.Fragment,{children:[p.jsx(pr,{children:p.jsxs(oXe,{onClick:()=>l((d=>!d)),children:[p.jsx("span",{children:"Details"}),p.jsx(U5,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:c?"rotate(180deg)":void 0}})]})}),c&&p.jsx(pr,{children:p.jsxs(rXe,{children:[p.jsxs(nXe,{children:[p.jsxs(iXe,{children:[a+1," of ",t.length," instructions"]}),p.jsxs(aXe,{children:[a>0&&p.jsx(FQ,{backFn:()=>o((d=>d-1))}),a<t.length-1&&p.jsx(I9e,{nextFn:()=>o((d=>d+1))})]})]}),p.jsx(sXe,{children:p.jsx(SU,{instruction:u,rpcEndpoint:i,solPrice:n})})]})})]}):p.jsx(SU,{instruction:u,rpcEndpoint:i,solPrice:n,hideAmount:!0})]})};function SU({instruction:t,rpcEndpoint:e,solPrice:r,hideAmount:n}){var i,s;return t?p.jsxs(z0,{children:[!n&&!!t.amount&&p.jsxs(pr,{children:[p.jsx(hr,{children:"Amount"}),p.jsx(yr,{children:p.jsx(lC,{quantities:[t.amount],tokenPrice:r,tokenSymbol:((i=t.token)==null?void 0:i.symbol)??"SOL",tokenDecimals:((s=t.token)==null?void 0:s.decimals)??9})})]}),t.to&&p.jsxs(pr,{children:[p.jsx(hr,{children:"To"}),p.jsx(yr,{children:p.jsx(Pw,{walletAddress:t.to,rpcEndpoint:e,network:"solana"})})]}),t.from&&p.jsxs(pr,{children:[p.jsx(hr,{children:"From"}),p.jsx(yr,{children:p.jsx(Pw,{walletAddress:t.from,rpcEndpoint:e,network:"solana"})})]})]}):null}let rXe=oe.div.withConfig({displayName:"InstructionsBox",componentId:"sc-3551ef3c-0"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),nXe=oe.header.withConfig({displayName:"InstructionsBoxHeader",componentId:"sc-3551ef3c-1"})(["display:flex;justify-content:space-between;align-items:center;padding:12px;background-color:var(--privy-color-background-2);"]),iXe=oe.h4.withConfig({displayName:"HeaderTitle",componentId:"sc-3551ef3c-2"})(["font-size:14px;font-weight:500;line-height:19.6px;"]),sXe=oe.div.withConfig({displayName:"InstructionsBoxContent",componentId:"sc-3551ef3c-3"})(["padding:12px;"]),aXe=oe.div.withConfig({displayName:"NavigationButtonsConatiner",componentId:"sc-3551ef3c-4"})(["display:flex;gap:8px;align-items:center;"]),oXe=oe(hr).withConfig({displayName:"InteractiveLabel",componentId:"sc-3551ef3c-5"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;"]);const cXe=({instructions:t,fees:e,onClose:r,receiptHeader:n,receiptDescription:i,transactionInfo:s,solPrice:a,rpcEndpoint:o})=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:r}
483),p.jsx(Us,{style:{marginBottom:"16px"},children:p.jsxs("div",{children:[p.jsx(LQ,{color:"var(--privy-color-success-light)"}),p.jsx(Mo,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),p.jsx(wn,{title:n??"Transaction completed successfully.",description:i??""}),p.jsx(tXe,{solPrice:a,instructions:t,fees:e,transactionInfo:s,rpcEndpoint:o}),p.jsx(Il,{}),p.jsx(lXe,{loading:!1,onClick:r,children:"Close"}),p.jsx(qr,{}),p.jsx(Ht,{})]});let lXe=oe(Mt).withConfig({displayName:"SubmitButton",componentId:"sc-d56ba196-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);const uXe=()=>{var ce,Q,se,me,_e,z,R,M,ee,ie,le,ye,fe,we,Ce,ne,Re;let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:r,navigate:n}=ht(),{client:i,closePrivyModal:s,walletProxy:a}=bt(),o=Jn(),{user:c,getAccessToken:l}=Sr(),[u,d]=C.useState((ce=t==null?void 0:t.sendSolanaTransaction)==null?void 0:ce.transactionRequest),[f,h]=C.useState(),[g,m]=C.useState(),[y,b]=C.useState(0),[E,v]=C.useState({value:0n,isLoading:!1}),[w,x]=C.useState(!1),[_,S]=C.useState(),[A,I]=C.useState(),$=(Q=t==null?void 0:t.sendSolanaTransaction)==null?void 0:Q.connection,P=(se=t==null?void 0:t.sendSolanaTransaction)==null?void 0:se.transactingWallet,j=(f==null?void 0:f.instructions.length)??1,L=P!=null&&P.imported?zb(c):Ts(c),B=z3(($==null?void 0:$.rpcEndpoint)||""),k=o.embeddedWallets.priceDisplay.primary==="fiat-currency",{solPrice:D,isSolPriceLoa
483ding:q}=MJ({enabled:k}),U=C.useMemo((()=>{let Pe,Ae;if(!f)return;let Ue=f.spender;y===0&&(P==null?void 0:P.address)===Ue&&(Pe=Bu(f.fee));let He=Bu(E.value,3,!0),Qe=f.instructions[y];if(!Qe)return{fee:Pe,spender:Ue,balance:He};if(Qe.type==="unknown")return{fee:Pe,spender:Ue,program:Qe.program,balance:He};let O=Qe.fromAccount,T=Qe.type==="sol-transfer"?Qe.toAccount:Qe.toAccount||Qe.toAta,N=Qe.type==="spl-transfer"?Qe.token.address:void 0;return Pe!=null&&Qe.token.symbol==="SOL"&&(Ae=Bu(Qe.value+f.fee)),{fee:Pe,spender:Ue,from:O,to:T,tokenAddress:N,amount:`${hm(Qe.value,Qe.token.decimals)} ${Qe.token.symbol}`.trim(),total:Ae,balance:He}}),[f,y,P==null?void 0:P.address,E]),W=C.useMemo((()=>{let Pe,Ae;if(!f||!k||!D||q)return;function Ue(...O){return M1(O.reduce(((T,N)=>T+N),0n),D??0)}y===0&&(P==null?void 0:P.address)===f.spender&&(Pe=Ue(f.fee));let He=Ue(E.value),Qe=f.instructions[y];return Qe&&Qe.type!=="unknown"?(Pe!=null&&Qe.token.symbol==="SOL"&&(Ae=Ue(Qe.value,f.fee)),{fee:Pe,amount:Qe.token.symbol==="SOL"?Ue(Qe.value):`${hm(Qe.value,Qe.token.decimals)} ${Qe.token.symbol}`.trim(),total:Ae,balance:He}):{fee:Pe,balance:He}}),[f,k,D,q,P==null?void 0:P.address,y,E]),V=C.useMemo((()=>{if(!f||E.isLoading||y>0)return!1;let Pe=f.instructions[y];if(!Pe)return!1;let Ae=0n;return(P==null?void 0:P.address)===f.spender&&(Ae+=f.fee),Pe.type!=="unknown"&&(P==null?void 0:P.address)===Pe.fromAccount&&Pe.token.symbol==="SOL"&&(Ae+=Pe.value),E.value<Ae}),[f,E,y]);if(C.useEffect((()=>{(async function(){if(u&&$&&i)try{m(void 0);let Pe=await yWe({tx:u,connection:$,client:i});h(Pe),b(0)}catch(Pe){console.error("Failed to prepare transaction",Pe),m(Pe)}})()}),[u,$,i]),C.useEffect((()=>{(async function(){if(!P||!$)return;v({value:E.value,isLoading:!0});let Pe=new dye({name:"mainnet-beta",rpcUrl:$.rpcEndpoint});v({value:await Pe.getBalance(P.address).catch((()=>0n))??0n,isLoading:!1})})().catch(console.error)}),[f,$]),!(u&&(t!=null&&t.sendSolanaTransaction)&&P&&$)){let Pe=Error("Invalid transaction request");return p.jsx(e2,{error:Pe,onClick:()=>{var Ae;(Ae=t==null?void 0:t.sendSolanaTransaction)==null||Ae.onFailure(Pe),s({shouldCallAuthOnSuccess:!1})}})}let Y=()=>{var Pe,Ae;if(!w)return _?(Pe=t==null?void 0:t.sendSolanaTransaction)==null||Pe.onSuccess(_):((Ae=t==null?void 0:t.sendSolanaTransaction)==null||Ae.onFailure(A??g??Error("User exited the modal before submitting the transaction")),b(0)),s({shouldCallAuthOnSuccess:!1})};e.current=Y;let K=(R=(z=(_e=(me=t.sendTransaction)==null?void 0:me.uiOptions)==null?void 0:_e.transactionInfo)==null?void 0:z.contractInfo)!=null&&R.imgUrl?p.jsx("img",{src:t.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ge=!!(t.funding&&t.funding.supportedOptions.length>0),ae=V&≥return _?p.jsx(cXe,{instructions:(f==null?void 0:f.instructions.map((Pe=>Pe.type==="unknown"?{}:Pe.type==="spl-transfer"?{from:Pe.fromAccount,to:Pe.toAccount||Pe.toAta,amount:Pe.value,token:Pe.token}:{from:Pe.fromAccount,to:Pe.toAccount,amount:Pe.value,token:Pe.token})))??[],fees:y===0?_.fees:0n,onClose:Y,transactionInfo:(M=t.sendTransaction)==null?void 0:M.uiOptions.transactionInfo,solPrice:D,receiptHeader:(ee=t.sendTransaction)==null?void 0:ee.uiOptions.successHeader,receiptDescription:(ie=t.sendTransaction)==null?void 0:ie.uiOptions.successDescription,rpcEndpoint:$.rpcEndpoint}):A?p.jsx(fre,{transactionError:A,connection:$,onClose:Y,network:"solana",onRetry:async()=>{I(void 0);let{blockhash:Pe}=await $.getLatestBlockhash();t2(u)?u.message.recentBlockhash=Pe:u.recentBlockhash=Pe,d(u)}}):p.jsx(FZe,{img:K,title:((fe=(ye=(le=t.sendTransaction)==null?void 0:le.uiOptions)==null?void 0:ye.transactionInfo)==null?void 0:fe.title)||"Confirm transaction",subtitle:((Ce=(we=t.sendTransaction)==null?void 0:we.uiOptions)==null?void 0:Ce.description)||`${o.name} wants your permission to approve the following transaction.`,cta:ae?"Add funds":((Re=(ne=t.sendTransaction)==null?void 0:ne.uiOptions)==null?void 0:Re.buttonText)||"Approve",transactionIndex:y,maxIndex:j-1,network:B=="mainnet-beta"?"Solana":B,blockExplorerUrl:"https://explorer.solana.com",total:k?W==null?void 0:W.total:U==null?void 0:U.total,amount:k?W==null?void 0:W.amount:U==null?void 0:U.amount,fee:k?W==null?void 0:W.fee:U==null?void 0:U.fee,balance:k?W==null?void 0:W.balance:U==null?void 0:U.balance,from:U==null?void 0:U.from,to:U==null?void 0:U.to,tokenAddress:U==null?void 0:U.tokenAddress,transactingWalletAddress:P.address,programAddress:U==null?void 0:U.program,disabled:V&&!ge,isSubmitting:w,isPreparing:!f||E.isLoading,isTokenPriceLoading:k&&q,isMissingFunds:V,submitError:A??void 0,parseError:g,onClick:ae?async()=>
483{if(!P)return;if(!ge)throw Error("Funding wallet is not enabled");let Pe=de.FUNDING_METHOD_SELECTION_SCREEN;r({...t,funding:{...t.funding,methodScreen:Pe}}),n(Pe)}:async()=>{var Pe;if(y<((f==null?void 0:f.instructions.length)??1)-1)b(y+1);else try{x(!0);let Ae=await l();if(w||!Ae||!P||!a||!c||!L)return;let{rootWallet:Ue}=Vb(c,P.address);if(!Ue)throw Error("No root wallet for transacting wallet found");let{entropyId:He,entropyIdVerifier:Qe}=_n(Ue),{signature:O,receipt:T}=await ore({tx:u,accessToken:Ae,connection:$,walletProxy:a,entropyId:He,entropyIdVerifier:Qe,transactingWalletAddress:P.address,transactingWalletIndex:P.walletIndex??0,transactionOptions:(Pe=t.sendSolanaTransaction)==null?void 0:Pe.transactionOptions});S(FJ(O,T))}catch(Ae){console.warn({transaction:u,error:Ae}),I(Ae)}finally{x(!1)}},onClose:Y,onBack:y>0&&j>1?()=>b(y-1):void 0})};async function hre({accessToken:t,entropyId:e,entropyIdVerifier:r,transactingWallet:n,walletProxy:i,transactionRequest:s,provider:a,requesterAppId:o}){(function(l){for(let u of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let d=l[u];if(d!==void 0&&!(function(f){let h=typeof f=="number",g=typeof f=="bigint",m=typeof f=="string"&&/^-?0x[a-f0-9]+$/i.test(f);return h||g||m})(d))throw Error(`Transaction request property '${u}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof l.chainId!="number")throw Error("Transaction request property 'chainId' must be a number")})(s=Object.assign({chainId:Lm},s));let c=(await i.rpc({entropyId:e,entropyIdVerifier:r,hdWalletIndex:n.walletIndex??0,chainType:"ethereum",accessToken:t,requesterAppId:o,request:{method:"eth_signTransaction",params:[s]}})).response.data;return await a.sendTransaction(c)}async function pre(t,e,r,n){let i=await n.getBalance(t),s=e.value||0,a=!i.sub(cs(s)).sub(r).isNegative();return{balance:i,hasSufficientFunds:a}}function gre(t){return{to:t.to,from:t.from,contractAddress:t.contractAddress,transactionIndex:t.transactionIndex,root:t.root,logsBloom:t.logsBloom,blockHash:t.blockHash,transactionHash:t.transactionHash,logs:t.logs,blockNumber:t.blockNumber,confirmations:t.confirmations,byzantium:t.byzantium,type:t.type,status:t.status,gasUsed:t.gasUsed.toHexString(),cumulativeGasUsed:t.cumulativeGasUsed.toHexString(),effectiveGasPrice:t.effectiveGasPrice?t.effectiveGasPrice.toHexString():void 0}}let dXe=(t,e)=>{if(t.gasUsed&&t.effectiveGasPrice)try{let r=zt.from(t.gasUsed),n=zt.from(t.effectiveGasPrice),i=r.mul(n);if(e){let s=zt.from(e);i=i.add(s)}return i.toString()}catch{return}};const fXe=({txn:t,receipt:e,transactionInfo:r,onClose:n,tokenPrice:i,tokenSymbol:s,l1GasEstimate:a,receiptHeader:o,receiptDescription:c})=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:n}),p.jsx(Z3,{title:o??"Transaction complete!",description:c??"You're all set."}),p.jsx(rre,{tokenPrice:i,from:e.from,to:e.to,gas:dXe(e,a),txn:t,transactionInfo:r,tokenSymbol:s}),p.jsx(Il,{}),p.jsx(hXe,{loading:!1,onClick:n,children:"All Done"}),p.jsx(qr,{}),p.jsx(Ht,{})]});let hXe=oe(Mt).withConfig({displayName:"SubmitButton",componentId:"sc-12af0541-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);const pXe=[{constant:!1,inputs:[{name:"_salt",type:"bytes32"},{name:"_initializer",type:"bytes"}],name:"deployAccount",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],gXe=[{name:"from",type:"address"},{name:"param2",type:"address"},{name:"param3",type:"bytes"},{name:"param4",type:"tuple",components:[]},{type:"tuple",components:[{name:"param5",type:"address"},{name:"param6",type:"uint256"},{name:"param7",type:"uint256"},{name:"encodedInitData",type:"bytes"}]}],mXe=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],yXe=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"payable",type:"function"}],bXe=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],vXe=[{constant:!1,inputs:[{name:"_operator",type:"address"},{name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],wXe=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],EXe=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenIds",type:"uint256[]"},{name:"_amounts",type:"uint256[]"},{name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],xXe=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"},{name:"_amount",type:"uint256"},{name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],mre=(t,e)=>{let r=Bc(mXe,t);if(r)return{action:"approve",functionName:"approve",isErc20Ish:!0,isNFTIsh:!1,spender:r.args[0],amount:r.args[1]};let n=Bc(oC,t);if(n)return{action:"transfer",functionName:"transfer",isErc20Ish:!0,isNFTIsh:!1,transferTo:n.args[0],amount:n.args[
4831]};if(!e)return{action:"transaction",functionName:"",isErc20Ish:!1,isNFTIsh:!1};let i=Bc(pXe,t);if(i&&typeof i.args[1]=="string"){let d=_Xe(i.args[1]);if(d&&d[4].encodedInitData)return mre(d[4].encodedInitData,e)}let s=Bc(vXe,t);if(s)return{action:"approve",functionName:"setApprovalForAll",isNFTIsh:!0,isErc20Ish:!1,operator:s.args[0],approved:s.args[1]};let a=Bc(wXe,t);if(a)return{action:"transfer",functionName:"transferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:a.args[0],transferTo:a.args[1],tokenId:a.args[2]};let o=Bc(bXe,t);if(o)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:o.args[0],transferTo:o.args[1],tokenId:o.args[2]};let c=Bc(xXe,t);if(c)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:c.args[0],transferTo:c.args[1],tokenId:c.args[2],amount:c.args[3]};let l=Bc(EXe,t);if(l)return{action:"batch transfer",functionName:"safeBatchTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:l.args[0],transferTo:l.args[1],tokenIds:l.args[2],amounts:l.args[3]};let u=Bc(yXe,t);return u?{action:"mint",functionName:u.functionName,isNFTIsh:!0,isErc20Ish:!1,args:u.args}:{action:"transaction",isErc20Ish:!1,isNFTIsh:!1}};let Bc=(t,e)=>{try{let r=BH({abi:t,data:e});return{functionName:r.functionName,args:r.args||[]}}catch{return null}},_Xe=t=>{try{if(typeof t=="string")return $0(gXe,`0x${t.slice(10)}`)}catch{return null}};const CXe=(t,e,r)=>{let[n,i]=C.useState(null),{getAccessToken:s}=Sr(),{walletProxy:a}=bt();return C.useEffect((()=>{n&&i(null),(async()=>{if(!await s()||!a||!e)return null;let o=[],c=await $S(e.address,t,r).catch((h=>(o.push(h),t))),{totalGasEstimate:l,l1ExecutionFeeEstimate:u}=await kS(c,r).catch((h=>(o.push(h),{totalGasEstimate:null,l1ExecutionFeeEstimate:null}))),{balance:d,hasSufficientFunds:f}=await pre(e.address,c,l??zt.from(0),r).catch((h=>(o.push(h),{balance:null,hasSufficientFunds:!1})));return{tx:c,totalGasEstimate:l,l1ExecutionFeeEstimate:u,balance:d,hasFunds:f,errors:o}})().then(i)}),[t]),n};let AU=new yo(new yf("There was an issue preparing your transaction",xi.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),TU=(t,e)=>t!=null&&t.sendTransaction?"transactionRequest"in t.sendTransaction?t.sendTransaction.transactionRequest:t.sendTransaction.transactionRequests[e]:void 0;const SXe=()=>{var Ue,He,Qe,O,T,N,G,te,ue,pe,Ie,je,Te,ve,Oe,at,gt,$t,ir,_r,Ar;let t,{data:e,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:i}=ht(),{rpcConfig:s,chains:a,closePrivyModal:o,walletProxy:c}=bt(),{getAccessToken:l,user:u}=Sr(),d=Jn(),[f,h]=C.useState(0),g=(P=e,P!=null&&P.sendTransaction?"transactionRequest"in P.sendTransaction?0:P.sendTransaction.transactionRequests.length-1:0),[m,y]=C.useState(TU(e,f)),[b,E]=C.useState(null),[v,w]=C.useState(),[x,_]=C.useState(!1),[S,A]=C.useState(null),[I,$]=C.useState(null);var P;if(!m||!(e!=null&&e.sendTransaction)||!(e!=null&&e.sendTransaction.transactingWallet))return p.jsx(e2,{error:Error("Invalid transaction request"),onClick:()=>{var Zt;(Zt=e==null?void 0:e.sendTransaction)==null||Zt.onFailure(AU),o({shouldCallAuthOnSuccess:!1})}});let{entropyId:j,entropyIdVerifier:L,transactingWallet:B}=e.sendTransaction,k=C.useMemo((()=>a.find((Zt=>Number(Zt.id)===Number(m.chainId)))),[m.chainId]),D=(k==null?void 0:k.nativeCurrency.symbol)??"ETH",q=C.useMemo((()=>mre(m.data,!!d.embeddedWallets.extendedCalldataDecoding)),[m.data]),{action:U,isErc20Ish:W,isNFTIsh:V}=q,{toAddress:Y,tokenAddress:K}=C.useMemo((()=>({toAddress:q.isErc20Ish?q.transferTo:m.to,tokenAddress:q.isErc20Ish?m.to:void 0})),[q]);C.useEffect((()=>{m.to&&k&&W&&xte({address:m.to,chain:k,rpcConfig:d.rpcConfig,privyAppId:d.id}).then(E).catch(console.error)}),[m.to,k]);let{tokenPrice:ge,isTokenPriceLoading:ae}=W0(m.chainId),ce=C.useMemo((()=>a0(Number(m.chainId),a,s,{appId:d.id})),[m.chainId,s]),Q=CXe(m,B,ce);C.useEffect((()=>{y(TU(e,f))}),[f]),C.useEffect((()=>{var Zt;(Zt=e.sendTransaction)!=null&&Zt.getIsSponsored?e.sendTransaction.getIsSponsored().then(w).catch(console.error):w(!1)}),[e.sendTransaction.getIsSponsored]);let se=()=>{var Zt,dr,gn;if(!x)return S?(Zt=e==null?void 0:e.sendTransaction)==null||Zt.onSuccess(S.response):I||Q!=null&&Q.errors[0]?(dr=e==null?void 0:e.sendTransaction)==null||dr.onFailure(I??(Q==null?void 0:Q.errors[0])??AU):(gn=e==null?void 0:e.sendTransaction)==null||gn.onFailure(new yo(new yf("The user rejected the request",xi.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1})};r.current=se;let me=!!(e.funding&&e.funding.supportedOptions.length>0),_e=d.embeddedWallets.priceDisplay.primary==="fiat-currency",z=cs((Q==null?void 0:Q.tx.value)??0).add(cs(((Ue
483=Q==null?void 0:Q.totalGasEstimate)==null?void 0:Ue.toBigInt())??0)).toHexString(),R=Da(z,D),M=_e&&ge?wf(z,ge):void 0,ee=Da(((He=Q==null?void 0:Q.totalGasEstimate)==null?void 0:He.toString())??0,D),ie=_e&&ge?wf(((Qe=Q==null?void 0:Q.totalGasEstimate)==null?void 0:Qe.toString())??0,ge):void 0,le=Da(((O=Q==null?void 0:Q.balance)==null?void 0:O.toString())??0,D,void 0,!0),ye=_e&&ge?wf(((T=Q==null?void 0:Q.balance)==null?void 0:T.toString())??0,ge):void 0,fe=(te=(G=(N=e.sendTransaction)==null?void 0:N.uiOptions)==null?void 0:G.transactionInfo)==null?void 0:te.title;fe||(fe=U==="approve"?W?"Confirm address":"Confirm action":`Approve ${U}`);let we=((pe=(ue=e.sendTransaction)==null?void 0:ue.uiOptions)==null?void 0:pe.description)||`${d.name} wants your permission to approve the following transaction.`,Ce=(ve=(Te=(je=(Ie=e.sendTransaction)==null?void 0:Ie.uiOptions)==null?void 0:je.transactionInfo)==null?void 0:Te.contractInfo)!=null&&ve.imgUrl?p.jsx("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ne=!(!Q||Q.errors[0]||Q.hasFunds||v!==!1),Re=ne&&me,Pe=Re?"Add funds":((at=(Oe=e.sendTransaction)==null?void 0:Oe.uiOptions)==null?void 0:at.buttonText)||(f<g?"Continue":"Approve");if(S!=null&&S.receipt)return p.jsx(fXe,{txn:(Q==null?void 0:Q.tx)??m,onClose:se,receipt:S.receipt,transactionInfo:(gt=e.sendTransaction)==null?void 0:gt.uiOptions.transactionInfo,tokenPrice:ge,tokenSymbol:D,l1GasEstimate:($t=Q==null?void 0:Q.l1ExecutionFeeEstimate)==null?void 0:$t.toString(),receiptHeader:(ir=e.sendTransaction)==null?void 0:ir.uiOptions.successHeader,receiptDescription:(_r=e.sendTransaction)==null?void 0:_r.uiOptions.successDescription});if(I)return p.jsx(fre,{transactionError:I,network:"ethereum",chainId:(Q==null?void 0:Q.tx.chainId)??m.chainId,onClose:se,onRetry:({resetNonce:Zt})=>{$(null);let dr={...(Q==null?void 0:Q.tx)??m};Zt&&(dr.nonce=void 0),y(dr)}});let Ae=g!==0&&typeof f=="number"&&f!==0?()=>{h(f-1)}:void 0;return"amount"in q&&q.amount&&(q.isNFTIsh?t=q.amount.toString():b&&(t=vte({amount:q.amount,decimals:b.decimals}))),p.jsx(LZe,{transactionIndex:f,onBack:Ae,maxIndex:g,disabled:ne&&!me,isSubmitting:x,submitError:I,isPreparing:!Q,isTokenPriceLoading:ae,isTokenContractInfoLoading:!V&&!b,prepareError:Q==null?void 0:Q.errors[0],symbol:b==null?void 0:b.symbol,chain:k,img:Ce,title:fe,subtitle:we,total:m.value?M??R:void 0,txValue:m.value,fee:ie??ee,isSponsored:v,from:(B==null?void 0:B.address)??"",to:Y,tokenAddress:K,network:((Ar=d.chains.find((Zt=>Zt.id===m.chainId)))==null?void 0:Ar.name)??"",transactionDetails:{...q,formattedAmount:t},cta:Pe,missingFunds:ne,action:U,balance:ye??le,onClose:se,onClick:Re?async()=>{var dr;if(!B)return;if(!me)throw Error("Funding wallet is not enabled");let Zt=de.FUNDING_METHOD_SELECTION_SCREEN;n({...e,funding:{...e.funding,methodScreen:Zt,chainType:"ethereum",amount:xy(BigInt((Q==null?void 0:Q.tx.value)??0)+BigInt(((dr=Q==null?void 0:Q.totalGasEstimate)==null?void 0:dr.toString())??0)),chain:k}}),i(Zt)}:async()=>{var Zt,dr;if(f<g)h(f+1);else{_(!0);try{let gn=await l();if(x||!gn||!B||!c||!u)return;let Ti=(Zt=e==null?void 0:e.sendTransaction)!=null&&Zt.onConfirm?await e.sendTransaction.onConfirm().then((ti=>ce.getTransaction(ti))):await hre({accessToken:gn,transactingWallet:B,entropyId:j,entropyIdVerifier:L,walletProxy:c,transactionRequest:(Q==null?void 0:Q.tx)??m,provider:ce,requesterAppId:(dr=e.sendTransaction)==null?void 0:dr.requesterAppId}),Ks=await Ti.wait();A({receipt:gre(Ks),response:Ti})}catch(gn){console.warn({transaction:(Q==null?void 0:Q.tx)??m,error:gn}),$(gn)}finally{_(!1)}}}})},AXe=oe.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(t=>t.size==="sm"?"65px":"140px"),(t=>t.size==="sm"?"65px":"140px"));let TXe=t=>{if(!ia(t))return t;try{return sy(t)}catch{return t}},IXe=({data:t})=>{let e=r=>typeof r=="object"&&r!==null?p.jsx(NXe,{children:Object.entries(r).map((([n,i])=>p.jsxs("li",{children:[p.jsxs("strong",{children:[n,":"]})," ",e(i)]},n)))}):p.jsx("span",{children:String(r)});return p.jsx("div",{children:e(t)})},kXe=t=>{let{types:e,primaryType:r,...n}=t.typedData;return p.jsxs(p.Fragment,{children:[p.jsx(pC,{children:p.jsx(IXe,{data:n})}),p.jsx(S5,{text:(i=t.typedData,JSON.stringify(i,null,2)),itemName:"full payload to clipboard"})," "]});var i};const $Xe=()=>{let{authenticated:t}=Sr(),{initializeWalletProxy:e,closePrivyModal:r}=bt(),{navigate:n,data:i,onUserCloseViaDialogOrKeybindRef:s}=ht(),[a,o]=C.useState(!0),[c,l]=C.useState(""),[u,d]=C.useState(),[f,h]=C.useState(null),[g,m]=C.useState(!1),y=f!==null;C.useEffect((()=>{t||n(de.LANDING)}),[t]),C.useEffect((()=>{e(kA).then((I=>{o(!1),I||(l("An error has occurred, please try again."),d(new yo(new yf(c,xi.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:b,data:E,confirmAndSign:v,onSuccess:w,onFailure:x,uiOptions:_}=i.signMessage,S={title:_.title||"Sign message",description:_.description||"Signing this message will not cost you any fees.",buttonText:_.buttonText||"Sign and continue"},A=I=>{I?w(I):x(u||new yo(new yf("The user rejected the request.",xi.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{h(null),l(""),d(void 0)}),200)};return s.current=()=>{A(f)},p.jsxs(p.Fragment,{children:[p.jsx(lt,{onClose:()=>A(f)}),p.jsx(Lr,{}),_.iconUrl&&typeof _.iconUrl=="string"?p.jsx(RXe,{children:p.jsx(AXe,{size:"sm",src:_.iconUrl,alt:"app image"})}):null,p.jsx(Pl,{children:S.title}),p.jsx(bd,{children:S.description}),b==="personal_sign"&&p.jsx(pC,{children:TXe(E)}),b==="eth_signTypedData_v4"&&p.jsx(kXe,{typedData:E}),b==="solana_signMessage"&&p.jsx(pC,{children:E}),p.jsx(DXe,{}
483),p.jsx(PXe,{$fail:!0,children:c}),p.jsx(Fm,{disabled:g||y||a,loading:g,onClick:async()=>{m(!0),l("");try{let I=await v();h(I),m(!1),setTimeout((()=>{A(I)}),fn)}catch(I){console.error(I),l("An error has occurred, please try again."),d(new yo(new yf(c,xi.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),m(!1)}},children:g?"Signing...":y?p.jsxs(OXe,{children:[p.jsx($J,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",p.jsx("span",{children:"Success"})]}):S.buttonText}),p.jsx(qr,{}),p.jsx(Ht,{})]})};let pC=oe.div.withConfig({displayName:"Message",componentId:"sc-8f49c712-0"})(["margin-top:1.5rem;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);padding:12px;text-align:left;max-height:310px;overflow:scroll;white-space:pre-wrap;width:100%;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}}"]),NXe=oe.ul.withConfig({displayName:"MessageList",componentId:"sc-8f49c712-1"})(["margin-left:12px !important;white-space:nowrap;&:first-child{margin-left:0 !important;}strong{font-weight:500 !important;}}"]),PXe=oe.div.withConfig({displayName:"InputHelp",componentId:"sc-8f49c712-2"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-start;width:100%;margin-top:16px;margin-bottom:4px;"],(t=>t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)")),OXe=oe.span.withConfig({displayName:"ContentWithIcon",componentId:"sc-8f49c712-3"})(["display:flex;align-items:center;gap:8px;"]),RXe=oe.div.withConfig({displayName:"IconContainer",componentId:"sc-8f49c712-4"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;"]),DXe=oe.div.withConfig({displayName:"Grow",componentId:"sc-8f49c712-5"})(["flex-grow:1;"]);const MXe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=Sr(),{app:i,setModalData:s,navigate:a,resetNavigation:o,data:c}=ht(),{initLoginWithTelegram:l,loginWithTelegram:u,updateWallets:d,setReadyToTrue:f,closePrivyModal:h,createAnalyticsEvent:g,getAuthMeta:m}=bt(),[y,b]=C.useState(!1),[E,v]=C.useState(void 0),w=Vs();async function x(){var A,I,$,P,j,L,B,k,D,q,U,W,V,Y;try{let K=await(async function(){let ge;if(w.enabled&&w.status==="error")throw new L3(w.error,null,Se.CAPTCHA_FAILURE);return w.enabled&&w.status!=="success"&&(w.execute(),ge=await w.waitForResult()),ge})();await u(K),b(!0),f(!0)}catch(K){if((K==null?void 0:K.privyErrorCode)===Se.ALLOWLIST_REJECTED)return v(void 0),o(),void a(de.ALLOWLIST_REJECTION_SCREEN);if((K==null?void 0:K.privyErrorCode)===Se.USER_LIMIT_REACHED)return console.error(new Ny(K).toString()),v(void 0),o(),void a(de.USER_LIMIT_REACHED_SCREEN);if((K==null?void 0:K.privyErrorCode)===Se.USER_DOES_NOT_EXIST)return v(void 0),o(),void a(de.ACCOUNT_NOT_FOUND_SCREEN);if((K==null?void 0:K.privyErrorCode)===Se.ACCOUNT_TRANSFER_REQUIRED&&((I=(A=K.data)==null?void 0:A.data)!=null&&I.nonce))return v(void 0),o(),s({accountTransfer:{nonce:(P=($=K.data)==null?void 0:$.data)==null?void 0:P.nonce,account:(L=(j=K.data)==null?void 0:j.data)==null?void 0:L.subject,telegramAuthResult:(B=m())==null?void 0:B.telegramAuthResult,telegramWebAppData:(k=m())==null?void 0:k.telegramWebAppData,displayName:(U=(q=(D=K.data)==null?void 0:D.data)==null?void 0:q.account)==null?void 0:U.displayName,linkMethod:"telegram",embeddedWalletAddress:(Y=(V=(W=K.data)==null?void 0:W.data)==null?void 0:V.otherUser)==null?void 0:Y.embeddedWalletAddress}}),void a(de.LINK_CONFLICT_SCREEN);let{retryable:ge,detail:ae}=sO(K);v({retryable:ge,detail:ae,message:"Authentication failed"})}}C.useEffect((()=>{x()}),[]),C.useEffect((()=>{var I;if(!(r&&t&&y&&n))return;if(i!=null&&i.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let $=setTimeout((()=>{a(de.AFFIRMATIVE_CONSENT_SCREEN)}),fn);return()=>clearTimeout($)}if(Sl(n,(I=i==null?void 0:i.embeddedWallets)==null?void 0:I.createOnLogin)){let $=setTimeout((()=>{s({createWallet:{onSuccess:()=>{},onFailure:P=>{console.error(P),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:P,provider:"telegram",screen:"TelegramAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),fn);return()=>clearTimeout($)}d();let A=setTimeout((()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0})),fn);return()=>clearTimeout(A)}),[r,t,y,n]);let _=y?"Successfully connected with Telegram":E?E.message:"Verifying connection to Telegram",S="";return S=y?"Youâre good to go!":E?E.detail:"Just a few moments more",p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),p.jsx(Lr,{}),p.jsxs(jXe,{children:[p.jsx(Us,{children:p.jsxs("div",{children:[p.jsx(To,{success:y,fail:!!E}),p.jsx(qte,{style:{width:"38px",height:"38px"}})]})}),p.jsxs(ga,{children:[p.jsx("h3",{children:_}),p.jsx("p",{children:S})]}),E&&(E!=null&&E.retryable)?p.jsx(JA,{onClick:async()=>{var A,I;try{v(void 0),(A=c==null?void 0:c.telegramAuthModalData)!=null&&A.seamlessAuth||await l(void 0,(I=c==null?void 0:c.login)==null?void 0:I.disableSignup),await x()}
483catch($){let{retryable:P,detail:j}=sO($);v({retryable:P,detail:j,message:"Authentication failed"})}},disabled:!y&&!(E!=null&&E.retryable),children:"Retry"}):null]}),p.jsx(qr,{}),p.jsx(vr,{})]})};let jXe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-7ee9073f-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);const LXe=C.forwardRef(((t,e)=>{let[r,n]=C.useState(""),[i,s]=C.useState(""),[a,o]=C.useState(!1),{authenticated:c,user:l}=Sr(),{initUpdateEmail:u}=bt(),{navigate:d,setModalData:f,currentScreen:h}=ht(),{enabled:g,token:m}=Vs(),y=Jn(),b=tK(r)&&(y.disablePlusEmails&&r.includes("+")?(i||s("Please enter a valid email address without a '+'."),!1):(i&&s(""),!0)),E=a||!b,v=()=>{!g||m||c?(async w=>{if(!(l!=null&&l.email))throw Error("User is required to have an email address to update it.");o(!0);try{await u(l.email.address,r,w),d(de.AWAITING_PASSWORDLESS_CODE)}catch(x){f({errorModalData:{error:x,previousScreen:h||de.LANDING}})}o(!1)})(m):(f({captchaModalData:{callback:w=>{if(!(l!=null&&l.email))throw Error("User is required to have an email address to update it.");return u(l.email.address,r,w)},userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:de.ERROR_SCREEN}}),d(de.CAPTCHA_SCREEN))};return p.jsxs(p.Fragment,{children:[p.jsxs(FXe,{children:[i&&p.jsx(Nl,{style:{marginTop:"0.25rem",textAlign:"left"},children:i}),p.jsxs(UXe,{$error:!!i,children:[p.jsx(sh,{}),p.jsx("input",{ref:e,id:"email-input",type:"email",placeholder:"[email protected]",onChange:w=>n(w.target.value),onKeyUp:w=>{w.key==="Enter"&&v()},value:r,autoComplete:"email"}),t.stacked?null:p.jsx(eT,{isSubmitting:a,onClick:v,disabled:E,children:"Submit"})]})]}),t.stacked?p.jsx(Mt,{loadingText:null,loading:a,disabled:E,onClick:v,children:"Submit"}):null]})}));let FXe=Tte,UXe=OQe;const BXe=()=>p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(Lr,{}),p.jsx(wn,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:p.jsx(sh,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),p.jsx(ah,{children:p.jsx(LXe,{stacked:!0})}),p.jsx(qr,{}),p.jsx(Ht,{})]}),qXe=()=>{let{currentScreen:t,data:e,navigate:r,setModalData:n}=ht(),{user:i}=Sr(),{initUpdatePhone:s}=bt();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{},"header"),p.jsx(Lr,{}),p.jsx(wn,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:p.jsx(Io,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),p.jsx(ah,{children:p.jsx(z5,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:a}){var o,c,l;try{if(!((o=i==null?void 0:i.phone)!=null&&o.number))throw Error("User is required to have an phone number to update it.");await s((c=i==null?void 0:i.phone)==null?void 0:c.number,a),r(de.AWAITING_PASSWORDLESS_CODE)}catch(u){n({errorModalData:{error:u,previousScreen:((l=e==null?void 0:e.errorModalData)==null?void 0:l.previousScreen)||t||de.LINK_PHONE_SCREEN}}),r(de.ERROR_SCREEN)}},hideRecent:!0})}),p.jsx(qr,{}),p.jsx(Ht,{})]})},WXe=({style:t,...e})=>p.jsx("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...t},...e,children:p.jsx("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),zXe=()=>{let{navigate:t}=ht();return p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),p.jsxs(VXe,{children:[p.jsx(HXe,{children:p.jsx(WXe,{})}),p.jsxs(GXe,{children:[p.jsx("h3",{children:"Unable to sign in"}),p.jsx("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),p.jsx(Mt,{onClick:()=>{t(de.LANDING)},children:"Go back"})]}),p.jsx(Ht,{})]})};let VXe=oe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-fc448c87-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-top:8px;padding-bottom:32px;"]),HXe=oe.div.withConfig({displayName:"IconContainer",componentId:"sc-fc448c87-1"})(["display:flex;align-items:center;justify-content:center;height:72px;aspect-ratio:1;color:var(--privy-color-error);background-color:var(--privy-color-error-light);border-radius:50%;"]),GXe=oe.div.withConfig({displayName:"GappedContainer",componentId:"sc-fc448c87-2"})(["display:flex;flex-direction:column;gap:8px;"]),KXe=` 484 *, 485 ::before, 486 ::after { 487 box-sizing: border-box; 488 border-width: 0; 489 border-style: solid; 490 } 491 492 line-height: 1.15; 493 -webkit-text-size-adjust: 100%; 494 -moz-tab-size: 4; 495 tab-size: 4; 496 font-feature-settings: normal; 497 498 margin: 0; 499 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 500 'Apple Color Emoji', 'Segoe UI Emoji'; 501 502 hr { 503 height: 0; 504 color: inherit; 505 border-top-width: 1px; 506 } 507 508 abbr:where([title]) { 509 text-decoration: underline dotted; 510 } 511 512 h1, 513 h2, 514 h3, 515 h4, 516 h5, 517 h6 { 518 font-size: inherit; 519 font-weight: inherit; 520 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 521 'Apple Color Emoji', 'Segoe UI Emoji'; 522 display: inline; 523 } 524 525 a { 526 color: inherit; 527 text-decoration: inherit; 528 } 529 530 b, 531 strong { 532 font-weight: bolder; 533 } 534 535 code, 536 kbd, 537 samp, 538 pre {
539 font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; 540 font-size: 1em; 541 } 542 543 small { 544 font-size: 80%; 545 } 546 547 sub, 548 sup { 549 font-size: 75%; 550 line-height: 0; 551 position: relative; 552 vertical-align: baseline; 553 } 554 555 sub { 556 bottom: -0.25em; 557 } 558 559 sup { 560 top: -0.5em; 561 } 562 563 table { 564 text-indent: 0; 565 border-color: inherit; 566 border-collapse: collapse; 567 } 568 569 button, 570 input, 571 optgroup, 572 select, 573 textarea { 574 font-family: inherit; 575 font-size: 100%; 576 font-weight: inherit; 577 line-height: inherit; 578 color: inherit; 579 margin: 0; 580 padding: 0; 581 } 582 583 button, 584 select { 585 text-transform: none; 586 } 587 588 button, 589 [type='button'], 590 [type='reset'], 591 [type='submit'] { 592 -webkit-appearance: button; 593 background-color: transparent; 594 background-image: none; 595 } 596 597 ::-moz-focus-inner { 598 border-style: none; 599 padding: 0; 600 } 601 602 :-moz-focusring { 603 outline: 1px dotted ButtonText; 604 } 605 606 :-moz-ui-invalid { 607 box-shadow: none; 608 } 609 610 legend { 611 padding: 0; 612 } 613 614 progress { 615 vertical-align: baseline; 616 } 617 618 ::-webkit-inner-spin-button, 619 ::-webkit-outer-spin-button { 620 height: auto; 621 } 622 623 [type='search'] { 624 -webkit-appearance: textfield; 625 outline-offset: -2px; 626 } 627 628 ::-webkit-search-decoration { 629 -webkit-appearance: none; 630 } 631 632 ::-webkit-file-upload-button { 633 -webkit-appearance: button; 634 font: inherit; 635 } 636 637 summary { 638 display: list-item; 639 } 640 641 blockquote, 642 dl, 643 dd, 644 h1, 645 h2, 646 h3, 647 h4, 648 h5, 649 h6, 650 hr, 651 figure, 652 p, 653 pre { 654 margin: 0; 655 } 656 657 fieldset { 658 margin: 0; 659 padding: 0; 660 } 661 662 legend { 663 padding: 0; 664 } 665 666 ol, 667 ul, 668 menu { 669 list-style: none; 670 margin: 0; 671 padding: 0; 672 } 673 674 textarea { 675 resize: vertical; 676 } 677 678 input::placeholder, 679 textarea::placeholder { 680 opacity: 1; 681 color: #9ca3af; 682 } 683 684 button, 685 [role='button'] { 686 cursor: pointer; 687 } 688 689 :disabled { 690 cursor: default; 691 } 692 693 img, 694 svg, 695 video, 696 canvas, 697 audio, 698 iframe, 699 embed, 700 object { 701 display: block; 702 } 703 704 img, 705 video { 706 max-width: 100%; 707 height: auto; 708 } 709 710 [hidden] { 711 display: none; 712 } 713`;const QXe=une([":root{--privy-border-radius-sm:6px;--privy-border-radius-md:12px;--privy-border-radius-mdlg:16px;--privy-border-radius-lg:24px;--privy-border-radius-full:9999px;--privy-color-background:",";--privy-color-background-2:",";--privy-color-background-3:",";--privy-color-foreground:",";--privy-color-foreground-2:",";--privy-color-foreground-3:",";--privy-color-foreground-4:",";--privy-color-foreground-accent:",";--privy-color-accent:",";--privy-color-accent-light:",";--privy-color-accent-lightest:",";--privy-color-accent-dark:",";--privy-color-accent-darkest:",";--privy-color-success:",";--privy-color-success-dark:",";--privy-color-success-light:",";--privy-color-error:",";--privy-color-error-light:",";--privy-color-warn:",";--privy-color-warn-light:",";--privy-height-modal-full:620px;--privy-height-modal-compact:480px;};"],(t=>t.theme.background),(t=>t.theme.background2),(t=>t.theme.background3),(t=>t.theme.foreground),(t=>t.theme.foreground2),(t=>t.theme.foreground3),(t=>t.theme.foreground4),(t=>t.theme.foregroundAccent),(t=>t.theme.accent),(t=>t.theme.accentLight),(t=>t.theme.accentLightest),(t=>t.theme.accentDark),(t=>t.theme.accentDarkest),(t=>t.theme.success),(t=>t.theme.successDark),(t=>t.theme.successLight),(t=>t.theme.error),(t=>t.theme.errorLight),(t=>t.theme.warn),(t=>t.theme.warnLight)),IU=oe.div.withConfig({displayName:"StylesWrapper",componentId:"sc-bc1e45b4-0"})([""," color:var(--privy-color-foreground-2);h3{font-size:16px;line-height:24px;font-weight:500;color:var(--privy-color-foreground-2);}h4{font-size:14px;line-height:20px;font-weight:500;color:var(--privy-color-foreground);}p{font-size:13px;line-height:20px;color:var(--privy-color-foreground-2);}button:focus,input:focus,optgroup:focus,select:focus,textarea:focus{outline:none;border-color:var(--privy-color-accent-light);box-shadow:0 0 0 1px var(--privy-color-accent-light);}.mobile-only{@media (min-width:441px){display:none;}}@keyframes fadein{0%{opacity:0;}100%{opacity:1;}}"],KXe),YXe=({children:t,open:e,onClick:r,...n})=>p.jsx(ete,{show:e,as:Rt.Fragment,children:p.jsxs(pGe,{onClose:r,...n,as:XXe,children:[p.jsx(Zm,{as:Rt.Fragment,enterFrom:"entering",leaveTo:"leaving",children:p.jsx(ZXe,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),p.jsx(JXe,{children:p.jsx(Zm,{as:Rt.Fragment,enterFrom:"entering",leaveTo:"leaving",children:p.jsx(tte,{as:eJe,children:t})})})]})});let ZXe=oe.div.withConfig({displayName:"Backdrop",componentId:"sc-28ab5e6b-0"})(["position:fixed;inset:0;transition:backdrop-filter 100ms ease;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);&.entering,&.leaving{backdrop-filter:unset;-webkit-backdrop-filter:unset;}"]),XXe=oe.div.withConfig({displayName:"DialogWrapper",componentId:"sc-28ab5e6b-1"})(["position:relative;z-index:999999;"]),JXe=oe.div.withConfig({displayName:"DialogContainer",componentId:"sc-28ab5e6b-2"})(["position:fixed;inset:0;display:flex;align-items:center;justify-content:center;width:100vw;min-height:100vh;"]);const eJe=oe.div.withConfig({displayName:"Panel",componentId:"sc-28ab5e6b-3"})(["padding:0;background:transparent;border:none;width:100%;pointer-events:auto;outline:none;display:block;@media (max-width:440px){opacity:1;
713transform:translate3d(0,0,0);transition:transform 200ms ease-in;position:fixed;bottom:0;&.entering,&.leaving{opacity:0;transform:translate3d(0,100%,0);transition:transform 150ms ease-in 0ms,opacity 0ms ease 150ms;}}@media (min-width:441px){opacity:1;transition:opacity 100ms ease-in;&.entering,&.leaving{opacity:0;transition-delay:5ms;}margin:auto;width:360px;box-shadow:0px 8px 36px rgba(55,65,81,0.15);border-radius:var(--privy-border-radius-lg);}"]),tJe=oe.div.withConfig({displayName:"CenterItem",componentId:"sc-28ab5e6b-4"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;"]);let rJe={[de.LANDING]:eYe,[de.CONNECT_OR_CREATE]:JQe,[de.AWAITING_PASSWORDLESS_CODE]:S7e,[de.AWAITING_CONNECTION]:$Ue,[de.AWAITING_CONNECT_ONLY_CONNECTION]:OUe,[de.AWAITING_FARCASTER_CONNECTION]:nWe,[de.AWAITING_FARCASTER_SIGNER]:sWe,[de.SELECT_PASSKEY_SIGNUP_OR_LOGIN]:dZe,[de.AWAITING_PASSKEY_SYSTEM_DIALOGUE]:hZe,[de.PHANTOM_INTERSTITIAL_SCREEN]:mZe,[de.LOGIN_FAILED_SCREEN]:sYe,[de.AWAITING_OAUTH_SCREEN]:lZe,[de.CROSS_APP_AUTH_SCREEN]:MUe,[de.ALLOWLIST_REJECTION_SCREEN]:f7e,[de.ACCOUNT_NOT_FOUND_SCREEN]:F9e,[de.USER_LIMIT_REACHED_SCREEN]:zXe,[de.INSTALL_PHANTOM_SCREEN]:TQe,[de.LINK_EMAIL_SCREEN]:tYe,[de.LINK_PHONE_SCREEN]:rYe,[de.LINK_WALLET_SCREEN]:nYe,[de.LINK_PASSKEY_SCREEN]:eKe,[de.UPDATE_EMAIL_SCREEN]:BXe,[de.UPDATE_PHONE_SCREEN]:qXe,[de.CONNECT_ONLY_LANDING_SCREEN]:sCe,[de.CONNECT_ONLY_AUTHENTICATED_SCREEN]:iCe,[de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN]:pBe,[de.EMBEDDED_WALLET_CREATED_SCREEN]:oBe,[de.EMBEDDED_WALLET_CONNECTING_SCREEN]:sBe,[de.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN]:bZe,[de.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN]:NZe,[de.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN]:OZe,[de.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN]:CZe,[de.EMBEDDED_WALLET_KEY_EXPORT_SCREEN]:uBe,[de.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN]:$Xe,[de.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN]:SXe,[de.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN]:uXe,[de.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN]:WUe,[de.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN]:KUe,[de.FUNDING_METHOD_SELECTION_SCREEN]:oQe,[de.MOONPAY_STATUS_SCREEN]:hQe,[de.COINBASE_ONRAMP_STATUS_SCREEN]:CKe,[de.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:wQe,[de.FUNDING_EDIT_AMOUNT_SCREEN]:$Ke,[de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:EKe,[de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN]:bKe,[de.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN]:yKe,[de.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN]:xKe,[de.FUNDING_MANUAL_TRANSFER_SCREEN]:lQe,[de.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN]:bqe,[de.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN]:gqe,[de.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN]:SZe,[de.MFA_ENROLLMENT_FLOW_SCREEN]:RYe,[de.CAPTCHA_SCREEN]:M7e,[de.ERROR_SCREEN]:wqe,[de.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE]:EQe,[de.AFFIRMATIVE_CONSENT_SCREEN]:l7e,[de.TELEGRAM_AUTH_SCREEN]:MXe,[de.LINK_CONFLICT_SCREEN]:r7e},nJe=[de.LANDING,de.AWAITING_CONNECTION],yre=({isMfaVerifying:t,onMfaVerificationComplete:e})=>{let{ready:r,isModalOpen:n}=Sr(),{headless:i}=Jn(),{ready:s,currentScreen:a}=ht(),{status:o,execute:c,reset:l,enabled:u}=Vs(),d=n&&a&&nJe.includes(a)&&!i&&o==="ready";return C.useEffect((()=>{d&&c()}),[d]),C.useEffect((()=>{!n&&u&&l()}),[n,u]),r&&s||a===de.AWAITING_OAUTH_SCREEN||a===de.CROSS_APP_AUTH_SCREEN||a===de.TELEGRAM_AUTH_SCREEN?!a&&t?p.jsx(vU,{open:t,onClose:e}):a?p.jsxs(p.Fragment,{children:[p.jsx(Df,{$if:!!t,children:p.jsx(rJe[a],{})}),p.jsx(Df,{$if:!t,children:p.jsx(vU,{open:t,onClose:e})})]}):null:p.jsxs(p.Fragment,{children:[p.jsx(lt,{}),p.jsx(Lr,{}),p.jsx(tJe,{children:p.jsx(Fa,{})}),p.jsx(qr,{}),p.jsx(vr,{})]})},iJe=({isMfaVerifying:t,onMfaVerificationComplete:e})=>{let r=C.useRef(null);return p.jsx(aJe,{style:{height:h9e(r)},id:"privy-modal-content",children:p.jsx("div",{ref:r,children:p.jsx(yre,{isMfaVerifying:t,onMfaVerificationComplete:e})})})};const sJe=({open:t})=>{let{app:e}=ht(),{gracefulClosePrivyModal:r}=(()=>{let{closePrivyModal:a}=bt(),{onUserCloseViaDialogOrKeybindRef:o}=ht();return{gracefulClosePrivyModal:C.useCallback((()=>
713{if(!(o!=null&&o.current))return a({shouldCallAuthOnSuccess:!1});o.current()}),[a])}})(),[n,i]=C.useState(!1);g9e({onMfaRequired:()=>{e!=null&&e.mfa.noPromptOnMfaRequired||i(!0)}});let s=t||n;return e.render.standalone?p.jsx(IU,{children:p.jsx(bre,{id:"privy-modal-content",children:p.jsx(yre,{isMfaVerifying:n,onMfaVerificationComplete:()=>i(!1)})})}):p.jsx(YXe,{open:s,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:p.jsx(IU,{children:p.jsx(iJe,{isMfaVerifying:n,onMfaVerificationComplete:()=>i(!1)})})})};let bre=oe.div.withConfig({displayName:"ContentWrapper",componentId:"sc-5c971bfb-0"})(["display:flex;flex-direction:column;text-align:center;font-size:14px;line-height:20px;width:100%;background:var(--privy-color-background);padding:0 16px;"]),aJe=oe(bre).withConfig({displayName:"BaseModal",componentId:"sc-5c971bfb-1"})(["transition:height 150ms ease-out;overflow:hidden;max-height:calc(100svh - 32px);border-radius:var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0;box-shadow:0px 0px 36px rgba(55,65,81,0.15);@media (min-width:441px){box-shadow:0px 8px 36px rgba(55,65,81,0.15);border-radius:var(--privy-border-radius-lg);}"]);function oJe(t){let e=C.useRef(null),r=C.useRef();return C.useEffect((()=>{var n,i;(n=r.current)==null||n.remove(),r.current=(function({botUsername:s,scriptHost:a}){let o=document.createElement("script"),{origin:c}=new URL(a);return o.async=!0,o.src=`${c}/js/telegram-login.js`,o.setAttribute("data-telegram-login",s),o.setAttribute("data-request-access","write"),o.setAttribute("data-lang","en"),o})(t),(i=e.current)==null||i.after(r.current)}),[t]),p.jsx("div",{ref:e,hidden:!0})}const cJe=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","crypto.com_wallet_extension","crypto.com_onchain","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","privy","unknown","phantom","solflare","glow"];function lJe(t){return cJe.includes(t)}function uJe(t){return t.chainType==="solana"}function kU(t){return t.type==="solana"}let dJe=class extends _Q{get isInstalled(){return this.adapter.readyState==="Installed"}buildConnectedWallet(e,r){let n,i,s;if(e.readyState!=="Installed"||!e.publicKey)throw Error("Wallet is not connected.");return"signMessage"in e&&(n=async(...a)=>{if(!e.connected)throw Error("Wallet is not connected.");return await e.signMessage(a[0])}),"sendTransaction"in e&&(i=async(...a)=>await e.sendTransaction(a[0],a[1],a[2])),"signTransaction"in e&&(s=async a=>await e.signTransaction(a)),{type:"solana",address:e.publicKey.toBase58(),meta:r,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>e.connected,disconnect:()=>{try{e.disconnect()}catch{console.error("Wallet does not support programmatic disconnect")}},getProvider:L2(`${this.walletClientType||""} wallet does not support 'getProvider'`),signMessage:n??L2(`${this.walletClientType||""} wallet does not support 'signMessage'`),sendTransaction:i??L2(`${this.walletClientType||""} wallet does not support 'sendTransaction'`),signTransaction:s??L2(`${this.walletClientType||""} wallet does not support 'signTransaction'`)}}async syncAccounts(){if(this.adapter.readyState==="Installed"&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((r=>this.adapter.publicKey&&r.address===this.adapter.publicKey.toBase58()
713))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,r)=>r.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,r){super(lJe(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((n=>console.error("Error disconnecting",n)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(n){throw ih(n)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=n=>{this.syncAccounts()},this.onError=n=>{this.syncAccounts()},this.onReadyStateChange=n=>{n!=="Installed"&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=r,this.wallets=[]}},fJe=class{enqueue(e,r){this.callbacks[e]=r}dequeue(e,r){let n=this.callbacks[r];if(!n)throw Error(`cannot dequeue ${e} event: no event found for id ${r}`);switch(delete this.callbacks[r],e){case"privy:iframe:ready":case"privy:wallets:create":case"privy:wallets:add":case"privy:wallets:import":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:delegated-actions:consent":return n;default:throw Error(`invalid wallet event type ${e}`)}}constructor(){this.callbacks={}}};async function Ja(t,e,r,n,i,s=!1){var l,u,d;let a=s,o=async f=>{var h;if(a&&e&&e.length>0){f===(s?0:1)?i("configureMfa","onMfaRequired",e):(h=n.current)==null||h.reject(new On("missing_or_invalid_mfa","MFA verification failed, retry."));let g=await new Promise(((m,y)=>{r.current={resolve:m,reject:y},setTimeout((()=>{var E;let b=new On("mfa_timeout","Timed out waiting for MFA code");(E=n.current)==null||E.reject(b),y(b)}),3e5)}));return await t(g)}return await t()},c=null;for(let f=0;f<4;f++)try{c=await o(f),(l=n.current)==null||l.resolve(void 0);break}catch(h){if(h.type!=="missing_or_invalid_mfa")throw(u=n.current)==null||u.resolve(void 0),h;a=!0}if(c===null){let f=new On("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw(d=n.current)==null||d.reject(f),f}return c}var $U;let hJe=($U=0,()=>"id-"+$U++);function fi(t){return t.error!==void 0}let ii=new fJe,Qx=new Map,pJe=(t,e)=>typeof e=="bigint"?e.toString():e,gJe=(t,e)=>`${t}${JSON.stringify(e,pJe)}`;function hi(t,e,r,n){let i=r.contentWindow;if(!i)throw Error("iframe not initialized");let s=gJe(t,e);if(t==="privy:wallet:create"){let o=Qx.get(s);if(o)return o}let a=new Promise(((o,c)=>{let l=hJe();ii.enqueue(l,{resolve:o,reject:c}),i.postMessage({id:l,event:t,data:e},n)})).finally((()=>{Qx.delete(s)}));return Qx.set(s,a),a}function mJe(t){let e=C.useRef(null),r=C.useRef(t.mfaMethods),n=MQ(),[i,s]=C.useState(!1);return C.useEffect((()=>{r.current=t.mfaMethods}),[t.mfaMethods]),C.useEffect((()=>{if(!i)return;let a=e.current;if(!a)return;function o(u){var d;u&&u.origin===t.origin&&typeof(d=u.data).event=="string"&&/^privy:.+/.test(d.event)&&(function(f){switch(f.event){case"privy:iframe:ready":let h=ii.dequeue(f.event,f.id);return fi(f)?h.reject(new On(f.error.type,f.error.message)):h.resolve(f.data);case"privy:wallets:create":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:wallets:add":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:wallets:set-recovery":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:wallets:connect":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:wallets:recover":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:wallets:rpc":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:wallet:create":let g=ii.dequeue(f.event,f.id);return fi(f)?g.reject(new On(f.error.type,f.error.message)):g.resolve(f.data);case"privy:wallets:import":let m=ii.dequeue(f.event,f.id);return fi(f)?m.reject(new On(f.error.type,f.error.message)):m.resolve(f.data);case"privy:mfa:verify":let y=ii.dequeue(f.event,f.id);return fi(f)?y.reject(new On(f.error.type,f.error.message)):y.resolve(f.data);case"privy:mfa:init-enrollment":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:mfa:submit-enrollment":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:mfa:unenroll":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:mfa:clear":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:solana-wallet:create":let b=ii.dequeue(f.event,f.id);return fi(f)?b.reject(new On(f.error.type,f.error.message)):b.resolve(f.data);case"privy:farcaster:init-signer":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:farcaster:sign":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}case"privy:delegated-actions:consent":{let E=ii.dequeue(f.event,f.id);return fi(f)?E.reject(new On(f.error.type,f.error.message)):E.resolve(f.data)}default:console.warn("Unsupported wallet proxy method:",f)}})(u.data)}let c={createWallet:u=>Ja((d=>hi("privy:wallets:create",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),addWallet:u=>Ja((d=>hi("privy:wallets:add",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),setRecovery:u=>Ja((d=>hi("privy:wallets:set-recovery",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),connect:u=>Ja((d=>hi("privy:wallets:connect",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),recover:u=>Ja((d=>hi("privy:wallets:recover",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n,!u.recoveryAccessToken&&!u.recoveryPassword&&!u.recoverySecretOverride),rpc:u=>Ja((d=>hi("privy:wallets:rpc",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),create:u=>hi("privy:wallet:create",u,a,t.origin),importWallet:u=>hi("privy:wallets:import",u,a,t.origin),createSolana:u=>Ja((d=>hi("privy:solana-wallet:create",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),createDelegatedAction:u=>hi("privy:delegated-actions:consent",u,a,t.origin),verifyMfa:u=>Ja((d=>hi("privy:mfa:verify",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n,!0),initEnrollMfa:u=>Ja((d=>hi("privy:mfa:init-enrollment",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),submitEnrollMfa:u=>Ja((d=>hi("privy:mfa:submit-enrollment",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n),unenrollMfa:u=>Ja((d=>hi("privy:mfa:unenroll",{...u,...d},a,t.origin)),r.current,t.mfaPromise,t.mfaSubmitPromise,n,!0),clearMfa:u=>hi("privy:mfa:clear",u,a,t.origin),initFarcasterSigner:u=>hi("privy:farcaster:init-signer",u,a,t.origin),signFarcasterMessage:u=>hi("privy:farcaster:sign",u,a,t.origin)};window.addEventListener("message",o);let l=new AbortController;return W9((()=>hi("privy:iframe:ready",{}
713,a,t.origin)),{abortSignal:l.signal}).then((()=>t.onLoad(c)),((...u)=>{console.warn("Privy iframe failed to load: ",...u),t.onLoadFailed()})),()=>{window.removeEventListener("message",o),l.abort()}}),[i]),p.jsx("iframe",{ref:e,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>s(!0),src:nK(t.origin,`/apps/${t.appId}/embedded-wallets`,{caid:t.clientAnalyticsId,client_id:t.appClientId})})}const yJe=({address:t,user:e})=>{let r=e.linkedAccounts.find((n=>n.type==="wallet"&&n.walletClientType==="privy"&&n.address===t));if(!r)throw new xe("Address to delegate is not associated with current user.");return{address:r.address,chainType:r.chainType,walletIndex:r.walletIndex??0}},bJe=({address:t,user:e})=>{let r,n=e.linkedAccounts.find((i=>i.type==="wallet"&&i.walletClientType==="privy"&&i.address===t));if(!n)throw new xe("Address to delegate is not associated with current user.");if(!(r=n.chainType==="ethereum"?n.imported?X9(e):Is(e):n))throw new xe("Unable to determine root address for delegated address.");return{address:r.address,chainType:r.chainType,imported:r.imported}},vre=t=>t.linkedAccounts.filter((e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.delegated)),vJe=({address:t,chainType:e,user:r})=>!!vre(r).find((n=>n.address===t&&n.chainType===e));function wre(t){var n,i;let e=new RegExp(RegExp("^eip155:(?<chainId>\\d+)$","gm")),r=(i=(n=e.exec(t))==null?void 0:n.groups)==null?void 0:i.chainId;if(r)return parseInt(r);throw Error("Chain ID not compatible with CAIP-2 format.")}const Ere="popup-privy-oauth",xre="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";function wJe(t){return t.startsWith("privy:")}let EJe=class{async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(GG,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw $r(e)}}async link(){if(!this.api)throw new xe("Auth flow has no API instance");try{return await this.api.post(KG,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw $r(e)}}constructor({authorizationCode:e,stateCode:r,codeVerifier:n,provider:i}){this.meta={authorizationCode:e,stateCode:r,codeVerifier:n,provider:i}}};async function _re({api:t,requesterAppId:e,providerAppId:r}){let n=(await t.get(`/api/v1/apps/${e}/cross-app/connections`)).connections.find((i=>i.provider_app_id===r));if(!n)throw new xe("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function xJe({api:t,appId:e}){let r=w5(),n=GT(),i=await KT(r);try{let{url:s}=await t.post(HG,{provider:`privy:${e}`,redirect_to:window.location.href,code_challenge:i,state_code:n});return{url:s,stateCode:n,codeVerifier:r}}catch(s){throw $r(s)}}async function _Je({appId:t,stateCode:e,codeVerifier:r,authorizationCode:n,action:i,client:s}){var a;if(!n||!e)throw new xe("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new xe("User denied confirmation during cross-app auth flow");try{let o=new EJe({authorizationCode:n,stateCode:e,codeVerifier:r,provider:`privy:${t}`});s.startAuthFlow(o);let c=i==="link"?await s.link():await s.authenticate(),l=(a=c.oAuthTokens)==null?void 0:a.accessToken;return console.debug(),l}catch(o){let c=$r(o);throw c.privyErrorCode?new xe(c.message||"Invalid code during cross-app auth flow.",void 0,c.privyErrorCode):c.message==="User denied confirmation during cross-app auth flow"?new xe("Invalid code during cross-app auth flow.",void 0,Se.OAUTH_USER_DENIED):new xe("Invalid code during cross-app auth flow.",void 0,Se.UNKNOWN_AUTH_ERROR)}}async function CJe({url:t,popup:e}){return e.location=t,new Promise(((r,n)=>{let i,s=setTimeout((()=>{n(new xe("Authorization request timed out after 2 minutes.")),a()}),12e4);function a(){e==null||e.close(),window.removeEventListener("message",c)}let o=setInterval((()=>{e!=null&&e.closed&&!i&&(a(),clearInterval(o),clearTimeout(s),n(new xe("User rejected request")))}),300);function c(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"&&l.data.stateCode&&l.data.authorizationCode&&(clearTimeout(s),r(l.data),a()),l.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(s),n(new xe(l.data.error)),a()),l.data.type===xre&&((i=new BroadcastChannel(Ere)).onmessage=c))}window.addEventListener("message",c)}))}const Yx=async({user:t,address:e,client:r,request:n,requesterAppId:i,reconnect:s})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:e,method:n.method}});let a=t==null?void 0:t.linkedAccounts.find((d=>d.type==="cross_app"&&(d.embeddedWallets.some((f=>f.address===e))||d.smartWallets.some((f=>f.address===e)))));if(!t||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:e}}),new xe("Cannot request a signature with this wallet address");let o=r.getProviderAccessToken(a.providerApp.id),c=await _re({api:r.api,requesterAppId:i,providerAppId:a.providerApp.id});if(!o){if(c.readOnly)throw console.error("cannot transact against a read-only provider app"),new xe("Cannot transact against a read-only provider app");await s({appId:a.providerApp.id,action:"link"})&&(o=r.getProviderAccessToken(a.providerApp.id))}if(!o)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:e}}),new xe("Transactions require a valid token");let l=q5();if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:e}}),new xe("Failed to initialize signature request");let u=new URL(`${c.apiUrl}/oauth/transact`);return u.searchParams.set("token",o||""),u.searchParams.set("request",SJe(n)),l.location=u.href,new Promise(((d,f)=>{let h=setTimeout((()=>{y(),f(new xe("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:e}})}),12e4),g=setInterval((()=>{l.closed&&(y(),f(new xe("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:e}}))}),300),m=b=>{var E,v,w;b.data&&(((E=b.data.token)==null?void 0:E.action)==="set"&&((v=b.data.token)==null?void 0:v.value)!==void 0?r.storeProviderAccessToken(a.providerApp.id,b.data.token.value):((w=b.data.token)==null?void 0:w.action)==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),b.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&b.data.result&&(y(),d(b.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:e,method:n.method}})),b.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&b.data.error&&(y(),f(b.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:b.data.error,address:e}})))};window.addEventListener("message",m);let y=()=>{l.close(),clearInterval(g),clearTimeout(h),window.removeEventListener("message",m)}}))};let SJe=t=>JSON.stringify({content:{request:{request:gC(t,bc)}},timestamp:Date.now(),callbackUrl:window.origin});const gC=(t,e)=>typeof t=="bigint"?e(t):Array.isArray(t)?t.map((r=>gC(r,e))):t&&typeof t=="object"?Object.fromEntries(Object.entries(t).map((([r,n])=>[r,gC(n,e)]))):t,EI=t=>t.filter((e=>e.method==="wallets"||(e.method==="exchange"?e.provider==="coinbase":e.method==="card"||e.method==="payment-request"?e.provider==="coinbase"||e.provider==="moonpay":(e.method,!1)))),Cre={[_c.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[bQ.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[nh.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[mQ.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Wl.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[yQ.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[ql.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[pQ.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[HA.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[hQ.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[hd.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[fQ.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},AJe=(t,e)=>t===Cre[e.id],NU=({address:t,appConfig:e,fundWalletConfig:r,methodScreen:n,chainIdOverride:i,comingFromSendTransactionScreen:s=!1})=>{var g;let a,o;if(!e.fundingConfig)throw Error("Wallet funding is not enabled");let c=EI(e.fundingConfig.options);if(c.length<1)throw Error("Wallet funding is not enabled");a=i||(Wx(r)&&r.chain?r.chain.id:wre(e.fundingConfig.defaultRecommendedCurrency.chain));let l=e.chains.find((m=>m.id===a));if(!l)throw new xe(`Funding chain ${a} is not in PrivyProvider chains list`);let u=Wx(r)&&r.amount?r.amount:e.fundingConfig.defaultRecommendedAmount,d=!1;function f(){if(!a)return;
713let m=Cre[a];c.find((y=>y.method==="wallets"))&&!m&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),o=m,d=!0}Wx(r)&&"asset"in r?r.asset==="USDC"?f():typeof r.asset!="string"&&"erc20"in r.asset&&(d=AJe(o=r.asset.erc20,l)):e.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&f();let h=r==null?void 0:r.defaultFundingMethod;return{chainType:"ethereum",address:t,amount:u,chain:l,erc20Address:o,erc20ContractInfo:d?{symbol:"USDC",decimals:6}:void 0,isUSDC:d,methodScreen:n,supportedOptions:c,comingFromSendTransactionScreen:s,defaultFundingMethod:h,usingDefaultFundingMethod:!!h,preferredCardProvider:(g=r==null?void 0:r.card)==null?void 0:g.preferredProvider,crossChainBridgingEnabled:e.fundingConfig.crossChainBridgingEnabled??!1,cluster:{name:"mainnet-beta",rpcUrl:e.solanaClusters["mainnet-beta"]},...JKe(r)?{moonpayConfigOverride:r.config}:{}}};function TJe({address:t,fundWalletConfig:e,appConfig:r,comingFromSendTransactionScreen:n,methodScreen:i}){var c,l,u;if(!r.fundingConfig)throw Error("Wallet funding is not enabled");let s=EI(r.fundingConfig.options);if(s.length<1)throw Error("Wallet funding is not enabled");let a=(e==null?void 0:e.amount)??r.fundingConfig.defaultRecommendedAmount,o=e==null?void 0:e.defaultFundingMethod;return{chainType:"solana",address:t,supportedOptions:s,amount:a,isUSDC:!1,methodScreen:i,comingFromSendTransactionScreen:n,cluster:{name:((c=e==null?void 0:e.cluster)==null?void 0:c.name)??"mainnet-beta",rpcUrl:r.solanaClusters[((l=e==null?void 0:e.cluster)==null?void 0:l.name)??"mainnet-beta"]},crossChainBridgingEnabled:r.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:o,preferredCardProvider:(u=e==null?void 0:e.card)==null?void 0:u.preferredProvider,usingDefaultFundingMethod:!!o}}const PU=[de.FUNDING_METHOD_SELECTION_SCREEN,de.FUNDING_TRANSFER_FROM_WALLET_SCREEN,de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN,de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN,de.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN,de.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN,de.FUNDING_MANUAL_TRANSFER_SCREEN,de.MOONPAY_STATUS_SCREEN],IJe={[de.FUNDING_METHOD_SELECTION_SCREEN]:null,[de.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:"external",[de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:"external",[de.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN]:"external",[de.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN]:"external",[de.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN]:"external",[de.FUNDING_MANUAL_TRANSFER_SCREEN]:"manual",[de.MOONPAY_STATUS_SCREEN]:"moonpay"},OU=t=>!!t.fundingConfig&&EI(t.fundingConfig.options).length>=1;async function RU({url:t,popup:e,provider:r}){return e.location=t,new Promise(((n,i)=>{function s(){e==null||e.close(),window.removeEventListener("message",a)}function a(o){o.data&&(o.data.type==="PRIVY_OAUTH_RESPONSE"&&o.data.stateCode&&o.data.authorizationCode&&(n(o.data),s()),o.origin==="https://cdn.apple-cloudkit.com"&&o.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:o.data.ckSession}),s()),o.data.type==="PRIVY_OAUTH_ERROR"&&(i(o.data.error),s()))}window.addEventListener("message",a)}))}const kJe=t=>({id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type});function $Je(){return!!Ut.get(Hv)}function NJe(){return!!Ut.get(Gv)}function PJe(){let t=new URLSearchParams(window.location.search),e=t.get("privy_oauth_code"),r=t.get("privy_oauth_state"),n=t.get("privy_oauth_provider");if(!e||!r||!n)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:e,stateCode:r,provider:n,withPrivyUi:!$Je(),popupFlow:window.opener!==null&&i,disableSignup:NJe()}}class Bh{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new xe("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new xe("User denied confirmation during OAuth flow");let e=nBe();try{let r=await this.api.post(GG,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return Ut.del(o1),Ut.del(Hv),Ut.del(Gv),r}catch(r){let n=$r(r);throw n.privyErrorCode?new xe(n.message||"Invalid code during OAuth flow.",void 0,n.privyErrorCode):n.message==="User denied confirmation during OAuth flow"?new xe("Invalid code during oauth flow.",void 0,Se.OAUTH_USER_DENIED):new xe("Invalid code during OAuth flow.",void 0,Se.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new xe("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");
713if(this.meta.authorizationCode==="undefined")throw new xe("User denied confirmation during OAuth flow");let e=Ut.get(o1);if(!e)throw new xe("Authentication error.");try{let r=await this.api.post(KG,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return Ut.del(o1),r}catch(r){throw $r(r)}}async getAuthorizationUrl(){if(!this.api)throw new xe("Auth flow has no API instance");if(!this.meta.provider)throw new xe("Provider must be set when initializing OAuth authentication.");let e=w5();Ut.put(o1,e);let r=GT();Ut.put(Vv,r);let n=await KT(e);this.meta.withPrivyUi||Ut.put(Hv,!0),this.meta.disableSignup&&Ut.put(Gv,!0);let i=jm(this.meta.withPrivyUi);try{return await this.api.post(HG,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:n,state_code:r},{headers:{...i}})}catch(s){throw $r(s)}}constructor(e){this.meta=e}}class Oh extends Error{constructor(e,r,n){super(e),this.code=r,this.data=n}}function Zx(t,e){if(!Object.prototype.hasOwnProperty.call(t,e))throw TypeError("attempted to use private field on non-instance");return t}var OJe=0;class Sre extends M0{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new un("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw ih(e)}}constructor(e,r,n,i,s){super(s||"unknown",e,r,n),this.connectorType="injected",this.proxyProvider=new us(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let a=i.provider;this.proxyProvider.setWalletProvider(a)}}var Dd="__private_"+OJe+++"__walletBranding";let Xx=class extends M0{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Zx(this,Dd)[Dd]??{name:"Browser Extension",icon:oT,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new un("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw ih(e)}}constructor(e,r,n,i,s){super(s??"unknown",e,r,n),Object.defineProperty(this,Dd,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new us(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),s==="metamask"?Zx(this,Dd)[Dd]={name:"MetaMask",icon:tY,id:"io.metamask"}:s==="phantom"&&(Zx(this,Dd)[Dd]={name:"Phantom",icon:J3,id:"phantom"})}},RJe=class extends Sre{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{An.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new un("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw ih(e)}}},DJe=class extends M0{get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor(e,r){super(e,[],r,{}),this.connectorType="null",this.proxyProvider=new us(void 0,j3),this.connectorType=e}},MJe=class extends DJe{get walletBranding(){return{name:"Phantom",icon:rY,id:"phantom"}}constructor(e){super("phantom",e)}},jJe=class extends dJe{get walletBranding(){return{name:"Wallet",id:""}}
713async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor(...e){super(...e),this.proxyProvider=new us(void 0,j3),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")}}},LJe=class extends jJe{get walletBranding(){return{name:"Phantom",icon:rY,id:"phantom"}}constructor(){super({name:"Phantom"},!1)}},FJe=[WG,VG,zG,QG];class UJe{async get(e,r){try{return await this.baseFetch(e,r)}catch(n){throw $r(n)}}async post(e,r,n){try{return await this.baseFetch(e,{method:"POST",...r?{body:r}:{},...n})}catch(i){throw $r(i)}}async delete(e,r){try{return await this.baseFetch(e,{method:"DELETE",...r})}catch(n){throw $r(n)}}constructor({appId:e,appClientId:r,client:n,defaults:i}){this.appId=e,this.appClientId=r,this.clientAnalyticsId=n.clientAnalyticsId,this.sdkVersion=q8e,this.client=n,this.defaults=i,this.fallbackApiUrl=n.fallbackApiUrl,this.baseFetch=qG.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:s,options:a})=>{let o=new Headers(a.headers);o.set("privy-app-id",this.appId),this.appClientId&&o.set("privy-client-id",this.appClientId),o.set("privy-ca-id",this.clientAnalyticsId||""),o.set("privy-client",`react-auth:${this.sdkVersion}`);let c=FJe.includes(s.toString());if(!o.has("authorization")){let l=await this.client.getAccessToken({disableAutoRefresh:c});l!==null&&o.set("authorization",`Bearer ${l}`)}a.headers=o,a.retryDelay&&(a.retryDelay=3*a.retryDelay)},onRequestError:({error:s})=>{if(s instanceof DOMException&&s.name==="AbortError")throw new _4e}})}}let BJe=/paymaster\.biconomy\.io\/api/i,qJe={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const WJe=(t,e)=>t&&BJe.test(t)?qJe:e&&e.policy_id?{policyId:e.policy_id}:void 0,zJe=t=>{var e,r,n,i;return{rpId:t.rp_id,challenge:t.challenge,allowCredentials:((e=t.allow_credentials)==null?void 0:e.map((s=>({id:s.id,type:s.type,transports:s.transports}))))||[],timeout:t.timeout,extensions:{appid:(r=t.extensions)==null?void 0:r.app_id,credProps:(n=t.extensions)==null?void 0:n.cred_props,hmacCreateSecret:(i=t.extensions)==null?void 0:i.hmac_create_secret},userVerification:t.user_verification}};function VJe(t){return t instanceof ep?"email":t instanceof tp?"sms":t instanceof Kv?"siwe":t instanceof dK?"guest":t instanceof YG?"custom_auth":t instanceof Bh?t.meta.provider:null}function Jx(){return!(An.isSafari&&window.location.origin.startsWith("http://localhost"))}const DU=t=>{let e;const r=new Set,n=(l,u)=>{const d=typeof l=="function"?l(e):l;if(!Object.is(d,e)){const f=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),r.forEach(h=>h(e,f))}},i=()=>e,o={setState:n,getState:i,getInitialState:()=>c,subscribe:l=>(r.add(l),()=>r.delete(l))},c=e=t(n,i,o);return o},HJe=(t=>t?DU(t):DU),GJe=t=>t;function KJe(t,e=GJe){const r=Rt.useSyncExternalStore(t.subscribe,Rt.useCallback(()=>e(t.getState()),[t,e]),Rt.useCallback(()=>e(t.getInitialState()),[t,e]));return Rt.useDebugValue(r),r}const MU=t=>{const e=HJe(t),r=n=>KJe(e,n);return Object.assign(r,e),r},QJe=(t=>t?MU(t):MU),jU=QJe((()=>({identityToken:null})));var e_,LU=((e_={}).PRIVY="privy_access_token",e_.CUSTOMER="customer_access_token",e_);class YJe{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return e==="privy_access_token"?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(a1)}get privyAccessToken(){return this._getToken(Bb)}_getToken(e){try{let r=Ut.get(e);return typeof r=="string"?Uh.throwIfNotWellFormedJwt(r):null}catch(r){return console.error(r),this.destroyLocalState(),null}}get refreshToken(){try{let e=Ut.get(x4);return typeof e=="string"?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get forkedToken(){try{let e=Ut.get(G9);return typeof e=="string"?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let r=Ut.get(j2(e));if(typeof r!="string")return null;{let n=new Uh(r);return n.isExpired()?(Ut.del(j2(e)),null):n.value}}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let e=Ql.get(_4);return e!==void 0&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(e="privy_access_token"){let r=typeof this.getToken(e)=="string",n=typeof this.refreshToken=="string"&&this.refreshToken!==K8e;return this.mightHaveServerCookies||r&&n}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveAccessToken(e){let r=Uh.parse(this.getToken(e));return r!==null&&!r.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,r){typeof r=="string"?Ut.put(j2(e),r):Ut.del(j2(e))}async _authenticate(e){try{let r=await e.authenticate(),{user:n,is_new_user:i,oauth_tokens:s}=r;this.handleTokenResponse(r);let a=s?{provider:s.provider,accessToken:s.access_token,accessTokenExpiresInSeconds:s.access_token_expires_in_seconds,refreshToken:s.refresh_token,refreshTokenExpiresInSeconds:s.refresh_token_expires_in_seconds,scopes:s.scopes}:void 0;return this._trackAuthenticateEvents(e,i),{user:Ki(n),isNewUser:i,oAuthTokens:a}}catch(r){throw console.warn("Error authenticating session"),rn(r)}}_trackAuthenticateEvents(e,r){let n=VJe(e);n&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:n,isNewUser:r}}),n==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let r=await e.link(),n=r.oauth_tokens,i=n?{provider:n.provider,accessToken:n.access_token,accessTokenExpiresInSeconds:n.access_token_expires_in_seconds,refreshToken:n.refresh_token,refreshTokenExpiresInSeconds:n.refresh_token_expires_in_seconds,scopes:n.scopes}:void 0;return{user:Ki(r),oAuthTokens:i}}catch(r){throw console.warn("Error linking account"),rn(r)}}async _refresh(){if(!this.api)throw new xe("Session has no API instance");if(!this.client)throw new xe("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,r=this.refreshToken,n=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let i;if(e&&r||this.mightHaveServerCookies){let s={};e&&(s.authorization=`Bearer ${e}`),i=await this.api.post(WG,r?{refresh_token:r}:{},{headers:s}),n&&this.clearForkedToken()}else{if(!n)return null;i=await this.api.post(VG,{refresh_token:n}),this.clearForkedToken()}return this.handleTokenResponse(i),Ki(i.user)}catch(i){if(i instanceof $a&&i.privyErrorCode===Se.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw rn(i)}}handleTokenResponse(e){e.session_update_action&&e.session_update_action!=="set"?e.session_update_action==="clear"?this.destroyLocalState():e.session_update_action==="ignore"&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){var e;try{await((e=this.api)==null?void 0:e.post(zG,{refresh_token:this.refreshToken}
713))}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new xe("Session has no API instance");let e=this.refreshToken;try{let r=await this.api.post(S4e,{refresh_token:e});return this.storeRefreshToken(r.refresh_token),this.storeCustomerAccessToken(r.token),r.new_session_refresh_token}catch(r){throw rn(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeCustomerAccessToken(e){var r,n,i,s,a,o;if(typeof e=="string"){let c=Ut.get(a1);if(Ut.put(a1,e),!((r=this.client)!=null&&r.useServerCookies)){let l=(n=Uh.parse(e))==null?void 0:n.expiration;Ql.set(eO,e,{sameSite:"Strict",secure:Jx(),expires:l?new Date(1e3*l):void 0})}c!==e&&((s=(i=this.client)==null?void 0:i.onStoreCustomerAccessToken)==null||s.call(i,e))}else Ut.del(a1),Ql.remove(eO),(o=(a=this.client)==null?void 0:a.onDeleteCustomerAccessToken)==null||o.call(a)}storeRefreshToken(e){var r;typeof e=="string"?(Ut.put(x4,e),(r=this.client)!=null&&r.useServerCookies||Ql.set(_4,"t",{sameSite:"Strict",secure:Jx(),expires:30})):(Ut.del(x4),Ql.remove(W8e),Ql.remove(_4))}storePrivyAccessToken(e){typeof e=="string"?Ut.put(Bb,e):Ut.del(Bb)}storeIdentityToken(e){var n,i;if((n=this.client)!=null&&n.useServerCookies)return;Ut.put(tO,e);let r=(i=Uh.parse(e))==null?void 0:i.expiration;jU.setState({identityToken:e}),Ql.set(rO,e,{sameSite:"Strict",secure:Jx(),expires:r?new Date(1e3*r):void 0})}clearIdentityToken(){Ut.del(tO),jU.setState({identityToken:null}),Ql.remove(rO)}clearForkedToken(){Ut.del(G9)}constructor(){this.authenticateOnce=new es((async e=>this._authenticate(e))),this.linkOnce=new es((async e=>this._link(e))),this.refreshOnce=new es(this._refresh.bind(this)),this.destroyOnce=new es(this._destroy.bind(this)),this.forkSessionOnce=new es(this._forkSession.bind(this))}}class FU extends NS{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new Oh(`Invalid params for ${e.method}`,4200);let r=e.params[0];if(!await Nr()||!this.address)throw new Oh("Disconnected",4900);return(await iet(r,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let r;if(!e.params||!Array.isArray(e.params))throw new Oh(`Invalid params for ${e.method}`,4200);if(typeof e.params[0]=="string")r=e.params[0];else{if(!("chainId"in e.params[0])||typeof e.params[0].chainId!="string")throw new Oh(`Invalid params for ${e.method}`,4200);r=e.params[0].chainId}this.chainId=Number(r),this.provider=a0(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",r)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let r=e.params[0],n=e.params[1];return await ret(r,void 0,n)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let r=e.params[0],n=typeof e.params[1]=="string"?JSON.parse(e.params[1]):e.params[1];return await net(z9(n),void 0,r)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let r={...e.params[0],chainId:zv(this.chainId)};try{return await this.provider.send("eth_estimateGas",[r])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete r.from,await this.provider.send("eth_estimateGas",[r])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return zv(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!h_e(e.method))return this.provider.send(e.method,e.params);{let r=await Nr();if(await set(),!r||!this.address)throw new Oh("Disconnected",4900);try{return(await this.walletProxy.rpc({accessToken:r,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(n){throw console.error(n),new Oh("Disconnected",4900)}}}constructor({walletProxy:e,address:r,entropyId:n,entropyIdVerifier:i,rpcConfig:s,chains:a,appId:o,chainId:c=1,walletIndex:l}){super(),this.walletProxy=e,this.address=r,this.entropyId=n,this.entropyIdVerifier=i,this.chainId=c,this.rpcConfig=s,this.chains=a,this.provider=a0(c,this.chains,s,{appId:o}),this.rpcTimeoutDuration=KA(s,"privy"),this.appId=o,this.walletIndex=l}}class ZJe extends NS{get wallets(){let e=new Set,r=this.walletConnectors.flatMap((i=>i.wallets)).sort(((i,s)=>i.connectedAt&&s.connectedAt?s.connectedAt-i.connectedAt:0)).filter((i=>{let s=`${i.address}${i.walletClientType}${i.connectorType}`;return!e.has(s)&&(e.add(s),!0)})),n=r.findIndex((i=>i.address===(this.activeWallet?this.activeWallet:"unknown")));return n>=0&&r.unshift(r.splice(n,1)[0]),r}async initialize(){var r,n,i;if(this.initialized)return;
713Ut.get(nO)&&(Ut.getKeys().forEach((s=>{s.startsWith("walletconnect")&&Ut.del(s)})),Ut.del(nO));let e=P8e({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then((s=>{s.forEach((({type:a,eip6963InjectedProvider:o,legacyInjectedProvider:c})=>{this.createEthereumWalletConnector("injected",a,{eip6963InjectedProvider:o,legacyInjectedProvider:c})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!D3()&&this.walletList.includes("phantom")&&(["ethereum-only","ethereum-and-solana"].includes(this.walletChainType)&&this.createEthereumWalletConnector("phantom","phantom"),["ethereum-and-solana","solana-only"].includes(this.walletChainType)&&this.addWalletConnector(new LJe)),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),(r=this.externalWalletConfig.solana.connectors)==null||r.get().forEach(this.addSolanaWalletConnector),(i=(n=this.externalWalletConfig.solana.connectors)==null?void 0:n._setOnConnectorsUpdated)==null||i.call(n,(s=>{s==null||s.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,r){return e==="wallet_connect_v2"?this.walletConnectors.filter(Dg).find((n=>n.connectorType===e))??null:this.walletConnectors.filter(Dg).find((n=>n.connectorType===e&&n.walletClientType===r))??null}findSolanaWalletConnector(e,r){return this.walletConnectors.filter(uJe).find((n=>n.connectorType===e&&n.walletClientType===r))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>e.connectorType==="embedded"))}onInitialized(e){e.wallets.forEach((r=>{let n=this.storedConnections.find((i=>i.address===r.address&&i.connectorType===r.connectorType&&i.walletClientType===r.walletClientType));n&&(r.connectedAt=n.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:r,embeddedWallets:n,defaultChain:i,appId:s}){for(let a of n){let o=this.findEmbeddedWalletConnectors().find((c=>c.walletIndex===a.walletIndex));if(o&&Dg(o))o.proxyProvider.walletProxy=e;else{let{entropyId:c,entropyIdVerifier:l}=_n(r),u=new WD({provider:new FU({walletProxy:e,address:a.address,entropyId:c,entropyIdVerifier:l,rpcConfig:this.rpcConfig,chains:this.chains,appId:s,chainId:i.id,walletIndex:a.walletIndex}),chains:this.chains,defaultChain:i,rpcConfig:this.rpcConfig,imported:!1,walletIndex:a.walletIndex});this.addWalletConnector(u)}}}addImportedWalletConnector(e,r,n,i){let s=this.findWalletConnector("embedded_imported","privy");if(s&&Dg(s))s.proxyProvider.walletProxy=e;else{let a=new WD({provider:new FU({walletProxy:e,address:r,entropyId:r,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id}),chains:this.chains,walletIndex:0,defaultChain:n,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(a)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>e.connectorType!=="embedded")),this.saveConnectionHistory(),this.storedConnections=t_(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let r=this.walletConnectors.indexOf(e);this.walletConnectors.splice(r,1),this.saveConnectionHistory(),this.storedConnections=t_(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,r,n){let i=this.findWalletConnector(e,r);if(i&&Dg(i))return i instanceof Cp&&i.resetConnection(r),i;let s=e!=="injected"?e==="coinbase_wallet"?new d_e(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):e==="phantom"?new MJe(this.defaultChain):new Cp(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,r):r==="metamask"&&(n!=null&&n.eip6963InjectedProvider)?new RJe(this.chains,this.defaultChain,this.rpcConfig,n==null?void 0:n.eip6963InjectedProvider,"metamask"):r==="metamask"&&(n!=null&&n.legacyInjectedProvider)?new Xx(this.chains,this.defaultChain,this.rpcConfig,n==null?void 0:n.legacyInjectedProvider,"metamask"):r==="phantom"&&(n!=null&&n.legacyInjectedProvider)?new Xx(this.chains,this.defaultChain,this.rpcConfig,n==null?void 0:n.legacyInjectedProvider,"phantom"):n!=null&&n.legacyInjectedProvider&&r==="unknown_browser_extension"?new Xx(this.chains,this.defaultChain,this.rpcConfig,n==null?void 0:n.legacyInjectedProvider):n!=null&&n.eip6963InjectedProvider?new Sre(this.chains,this.defaultChain,this.rpcConfig,n==null?void 0:n.eip6963InjectedProvider,r):void 0;return s&&this.addWalletConnector(s),s||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((r=>{console.debug("Failed to initialize connector",r)}))}saveConnectionHistory(){let e=this.wallets.map((r=>({address:r.address,connectorType:r.connectorType,walletClientType:r.walletClientType,connectedAt:r.connectedAt})));Ut.put(uK,e)}async activeWalletSign(e){let r=this.wallets,n=r.length>0?r[0]:null;return n&&el(n)?n.sign(e):null}
713setActiveWallet(e){this.activeWallet=jr(e),this.emit("walletsUpdated")}constructor(e,r,n,i,s,a,o,c,l,u,d,f){super(),this.addSolanaWalletConnector=async h=>{this.findSolanaWalletConnector("solana_adapter",h.walletClientType)||this.addWalletConnector(h)},this.getEthereumProvider=()=>{let h=this.wallets[0],g=this.walletConnectors.find((m=>m.wallets.find((y=>y.address===(h==null?void 0:h.address)))));return h&&g?g.proxyProvider:new us},this.privyAppId=e,this.walletConnectCloudProjectId=r,this.rpcConfig=n,this.chains=i,this.defaultChain=s,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=l,this.privyAppName=u,this.privyAppLogo=d,this.walletChainType=f||"ethereum-only",this.storedConnections=t_()}}const t_=()=>{let t=Ut.get(uK);return t&&Array.isArray(t)&&t.map((e=>(r=>r&&typeof r.address=="string"&&typeof r.connectorType=="string"&&typeof r.walletClientType=="string"&&typeof r.connectedAt=="number")(e))).every(Boolean)?t:[]};let r_;var XJe=0,n_="__private_"+XJe+++"__getOrGenerateClientAnalyticsId";class JJe{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:r,chains:n,defaultChain:i,store:s,walletList:a,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:c,appName:l,walletChainType:u}){this.connectors||(this.connectors=new ZJe(this.appId,e,r,n,i,s,a,o,c,l,void 0,u))}generateApi(){let e=new UJe({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new xe("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new xe("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,r){this.session.storeProviderAccessToken(e,r)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((r=>r.type==="cross_app")).forEach((r=>{this.storeProviderAccessToken(r.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(m8e,{action:"verify"})}catch(e){throw $r(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post(y8e,{});return zJe(e.options)}catch(e){throw $r(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(r){console.error("Error fetching cross app provider details",r)}}async acceptTerms(){try{let e=await this.api.post(b8e,{});return Ki(e)}catch(e){throw rn(e)}}async unlinkEmail(e){try{let r=await this.api.post(V4e,{address:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async unlinkPhone(e){try{let r=await this.api.post(Y4e,{phoneNumber:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async unlinkEthereumWallet(e){try{let r=await this.api.post($4e,{address:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async unlinkSolanaWallet(e){try{let r=await this.api.post(D4e,{address:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async unlinkOAuth(e,r){try{let n=await this.api.post(e8e,{provider:e,subject:r});return await this.getAuthenticatedUser()??Ki(n)}catch(n){throw rn(n)}}async unlinkFarcaster(e){try{let r=await this.api.post(U4e,{fid:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async unlinkTelegram(e){try{let r=await this.api.post(p8e,{telegram_user_id:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async unlinkPasskey(e){try{let r=await this.api.post(d8e,{credential_id:e});return await this.getAuthenticatedUser()??Ki(r)}catch(r){throw rn(r)}}async revokeDelegatedWallet(){try{await this.api.post(C8e,{})}catch(e){throw rn(e)}}async createAnalyticsEvent({eventName:e,payload:r,timestamp:n,options:i}){if(typeof window<"u")try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(QG,{event_name:e,client_id:this.clientAnalyticsId,payload:{...r||{}
713,clientTimestamp:n?n.toISOString():new Date().toISOString()}},{retry:-1,keepalive:(i==null?void 0:i.keepAlive)??!1})}catch{}}async signMoonpayOnRampUrl(e){try{return this.api.post(E8e,e)}catch(r){throw rn(r)}}async initCoinbaseOnRamp(e){try{return this.api.post(x8e,e)}catch(r){throw rn(r)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`${_8e}?partnerUserId=${e}`)}catch(r){throw rn(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(LU.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(LU.PRIVY,e)}async _getToken(e,r){var n;return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?((n=eEe.parse(this.session.getToken(e)))==null?void 0:n.appId)!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):!(r!=null&&r.disableAutoRefresh)&&this.session.hasRefreshCredentials(e)?(await this.session.refresh(),this.session.getToken(e)):null:null}async getSmartWalletsConfig(){try{let e={},r=this.session.token;r&&(e.authorization=`Bearer ${r}`);let n=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return n.enabled?{enabled:n.enabled,smartWalletType:n.smart_wallet_type,configuredNetworks:n.configured_networks.map((i=>({chainId:i.chain_id,bundlerUrl:i.bundler_url,paymasterUrl:i.paymaster_url,paymasterContext:WJe(i.paymaster_url,i.paymaster_context)})))}:{enabled:n.enabled}}catch(e){throw rn(e)}}async getServerConfig(){var e;try{let r={},n=this.session.token;n&&(r.authorization=`Bearer ${n}`);let i=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:r}),s=i.telegram_auth_config?{botId:i.telegram_auth_config.bot_id,botName:i.telegram_auth_config.bot_name,linkEnabled:i.telegram_auth_config.link_enabled,seamlessAuthEnabled:i.telegram_auth_config.seamless_auth_enabled}:void 0,a=i.funding_config?{methods:i.funding_config.methods,options:i.funding_config.options,defaultRecommendedAmount:i.funding_config.default_recommended_amount,defaultRecommendedCurrency:i.funding_config.default_recommended_currency,promptFundingOnWalletCreation:i.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:i.funding_config.cross_chain_bridging_enabled}:void 0;return{id:i.id,name:i.name,verificationKey:i.verification_key,logoUrl:i.logo_url||void 0,accentColor:i.accent_color||void 0,showWalletLoginFirst:i.show_wallet_login_first,allowlistConfig:{errorTitle:i.allowlist_config.error_title,errorDetail:i.allowlist_config.error_detail,errorCtaText:i.allowlist_config.cta_text,errorCtaLink:i.allowlist_config.cta_link},walletAuth:i.wallet_auth,solanaWalletAuth:i.solana_wallet_auth,emailAuth:i.email_auth,smsAuth:i.sms_auth,googleOAuth:i.google_oauth,twitterOAuth:i.twitter_oauth,discordOAuth:i.discord_oauth,githubOAuth:i.github_oauth,spotifyOAuth:i.spotify_oauth,instagramOAuth:i.instagram_oauth,tiktokOAuth:i.tiktok_oauth,linkedinOAuth:i.linkedin_oauth,appleOAuth:i.apple_oauth,farcasterAuth:i.farcaster_auth,passkeyAuth:i.passkey_auth,passkeysForSignupEnabled:i.passkeys_for_signup_enabled,telegramAuth:i.telegram_auth,disablePlusEmails:i.disable_plus_emails,termsAndConditionsUrl:i.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:(e=i.embedded_wallet_config)==null?void 0:e.create_on_login,userOwnedRecoveryOptions:i.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:i.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:i.privacy_policy_url,requireUsersAcceptTerms:i.require_users_accept_terms,customApiUrl:i.custom_api_url,walletConnectCloudProjectId:i.wallet_connect_cloud_project_id,fiatOnRampEnabled:i.fiat_on_ramp_enabled,captchaEnabled:i.captcha_enabled,captchaSiteKey:i.captcha_site_key,createdAt:new Date(1e3*i.created_at),updatedAt:new Date(1e3*i.updated_at),mfaMethods:i.mfa_methods,enforceWalletUis:i.enforce_wallet_uis,legacyWalletUiConfig:i.legacy_wallet_ui_config,telegramAuthConfiguration:s,fundingConfig:a}}catch(r){throw rn(r)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch{return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch{return void console.error("Unable to fetch token price for SOL")}}async getSplTokenMetadata({mintAddress:e,cluster:r}){try{return await this.api.get(`/api/v1/spl_token_info?mint_address=${e}
713&cluster=${r}`)}catch{return void console.error(`Unable to fetch token metadata for ${r}:${e}`)}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:r}){try{return(await this.api.post(A4e,{address:e,token:r})).nonce}catch(n){throw rn(n)}}async authenticateWithSiweInternal({message:e,signature:r,chainId:n,walletClientType:i,connectorType:s,mode:a}){return await this.api.post(T4e,{message:e,signature:r,chainId:n,walletClientType:i,connectorType:s,mode:a})}async linkWithSiweInternal({message:e,signature:r,chainId:n,walletClientType:i,connectorType:s}){return await this.api.post(I4e,{message:e,signature:r,chainId:n,walletClientType:i,connectorType:s})}async linkSmartWallet({message:e,signature:r,smartWalletType:n}){try{let i=await this.api.post(k4e,{message:e,signature:r,smart_wallet_type:n});return Ki(i)}catch(i){throw rn(i)}}async linkWithSiwe({message:e,signature:r,chainId:n,walletClientType:i,connectorType:s}){try{let a=await this.linkWithSiweInternal({message:e,signature:r,chainId:n,walletClientType:i,connectorType:s});return Ki(a)}catch(a){throw rn(a)}}async generateSiwsNonce({address:e,captchaToken:r}){try{return(await this.api.post(P4e,{address:e,token:r})).nonce}catch(n){throw rn(n)}}async authenticateWithSiwsInternal({message:e,signature:r,walletClientType:n,connectorType:i,mode:s}){return await this.api.post(O4e,{message:e,signature:r,walletClientType:n,connectorType:i,mode:s})}async sendAccountTransferRequest({nonce:e,account:r,accountType:n,externalWalletMetadata:i,telegramAuthResult:s,telegramWebAppData:a,farcasterEmbeddedAddress:o,oAuthUserInfo:c}){try{let l,u;switch(n){case"email":l=G4e,u={nonce:e,email:r};break;case"sms":l=J4e,u={nonce:e,phoneNumber:r};break;case"siwe":if(l=N4e,!i)throw Error("Wallet parameters must be defined");u={nonce:e,address:r,...i};break;case"farcaster":l=B4e,u={nonce:e,farcaster_id:r,farcaster_embedded_address:o};break;case"telegram":l=g8e,u={nonce:e,telegram_auth_result:s,telegram_web_app_data:a};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l=t8e,u={nonce:e,userInfo:c}}let d=await this.api.post(l,u);return await this.getAuthenticatedUser()??Ki(d)}catch(l){throw rn(l)}}async linkWithSiwsInternal({message:e,signature:r,walletClientType:n,connectorType:i}){return await this.api.post(R4e,{message:e,signature:r,walletClientType:n,connectorType:i})}async linkWithSiws({message:e,signature:r,walletClientType:n,connectorType:i}){try{let s=await this.linkWithSiwsInternal({message:e,signature:r,walletClientType:n,connectorType:i});return Ki(s)}catch(s){throw rn(s)}}constructor({apiUrl:e=H9,appId:r,appClientId:n,timeout:i=B8e}){Object.defineProperty(this,n_,{value:eet}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==H9&&e.startsWith("https://privy."),this.timeout=i,this.appId=r,this.appClientId=n,this.clientAnalyticsId=(function(s,a){if(!Object.prototype.hasOwnProperty.call(s,a))throw TypeError("attempted to use private field on non-instance");return s})(this,n_)[n_](),r_||(r_=new YJe),this.session=r_,this.api=this.generateApi(),this.session.client=this}}function eet(){if(typeof window>"u")return null;try{let e=Ut.get(K9);if(typeof e=="string"&&e.length>0)return e}catch{}let t=nV();try{return Ut.put(K9,t),t}catch{return t}}class tet{async handleSignMessage(e){if(!e.params||typeof e.params.message!="string")throw Error("Message must be provided as a string for Solana signMessage RPC");return await oet({message:e.params.message,address:this.address})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await Nr())throw Error("User must be authenticated to use embedded Solana wallet");if(!await aet())throw new xe("Unable to connect to Solana embedded wallet");if(e.method==="signMessage")return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,r){this.walletProxy=e,this.address=r}}let cl,Are,Tre,Ire,kre,$re,Nre;async function Nr(){return cl?cl.getAccessToken():Promise.resolve(Ut.get(Bb)||Ut.get(a1)||null)}const ret=(t,e,r)=>Are(t,e,r),net=(t,e,r)=>Tre(t,e,r),iet=(t,e,r,n)=>Ire(t,e,r,n),set=()=>kre(),aet=()=>$re(),oet=({message:t,address:e})=>Nre({message:t,address:e}),cet=({config:t,...e})=>{var i,s;var r;if(typeof window<"u"&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&window.location.protocol!=="https:")throw new xe("Embedded wallet is only available over HTTPS");if(typeof(r=e.appId)!="string"||r.length!==25)throw new xe("Cannot initialize the Privy provider with an invali
713d Privy app ID");cl||(cl=new JJe({appId:e.appId,appClientId:e.clientId,apiUrl:e.apiUrl}));let n=Object.assign({},t);return e.createPrivyWalletOnLogin!==void 0&&((i=n.embeddedWallets)==null?void 0:i.createOnLogin)===void 0&&(n.embeddedWallets||(n.embeddedWallets={}),n.embeddedWallets.createOnLogin=e.createPrivyWalletOnLogin?"users-without-wallets":"off"),e.createPrivyWalletOnLogin!==void 0&&((s=t==null?void 0:t.embeddedWallets)!=null&&s.createOnLogin)&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),p.jsx(c9e,{client:cl,clientConfig:n,legacyCreateEmbeddedWalletFlag:e.createPrivyWalletOnLogin,children:p.jsx(wWe,{children:p.jsx(uet,{...e,client:cl})})})};let uet=t=>{var Ke,rt,Ze,_t,Et;let e=t.client,r=r2(),[n,i]=C.useState(!1),[s,a]=C.useState(!1),[o,c]=C.useState(!1),[l,u]=C.useState(null),[d,f]=C.useState([]),[h,g]=C.useState([]),[m,y]=C.useState([]),b=C.useRef(d),[E,v]=C.useState(!1),[w,x]=C.useState(null),[_,S]=C.useState(!1),[A,I]=C.useState({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:Fe}),[$,P]=C.useState({status:"initial"}),[j,L]=C.useState({status:"initial"}),[B,k]=C.useState({status:"initial"}),[D,q]=C.useState({status:"initial"}),[U,W]=C.useState({status:"initial"}),[V,Y]=C.useState(null),K=Jn(),ge=l9e(),[ae,ce]=C.useState(!0),[Q,se]=C.useState({}),[me,_e]=C.useState(null),[z,R]=C.useState(null),[M,ee]=C.useState(!1),[ie,le]=C.useState(!1),[ye,fe]=C.useState((Ke=K.customAuth)!=null&&Ke.enabled?{status:"initial"}:{status:"not-enabled"}),we=C.useRef(null),Ce=C.useRef(null),ne=C.useRef(p9e),[Re,Pe]=C.useState(!1);e.onStoreCustomerAccessToken=F=>{F&&qe(ne,"accessToken","onAccessTokenGranted",F)},e.onDeleteCustomerAccessToken=()=>{u(null),c(!1),qe(ne,"accessToken","onAccessTokenRemoved")};let Ae=C.useRef(null),Ue=C.useRef(null),He=C.useRef(!1),Qe=({showWalletUIs:F,typedData:H})=>He.current?He.current:F!==void 0?!F:K.embeddedWallets.showWalletUIs!==void 0?!K.embeddedWallets.showWalletUIs:H?K.embeddedWallets.noPromptOnSignature||(K.legacyWalletUiConfig??!1):!!K.embeddedWallets.noPromptOnSignature,O=F=>{x(F),setTimeout((()=>{i(!0)}),15),e.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:F}})},T=F=>{K.embeddedWallets.createOnLogin!=="off"&&ce(!0),O(F)};C.useEffect((()=>{let F=[...Wb(l),zb(l)].filter((H=>!!H));V&&y(F.map((H=>({type:"solana",imported:H.imported,address:H.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",walletIndex:H.walletIndex??void 0,meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund(){throw new xe("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:()=>{throw new xe("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new tet(V,H.address),async signMessage(J){let Z=await Nr();if(!Z||!V)throw new xe("Must have valid access token and Privy wallet to send transaction",Se.MUST_BE_AUTHENTICATED);let X=H.imported?zb(l):Ts(l);if(!X)throw new xe("Attempting to sign a transaction without a root wallet");let{entropyId:Ee,entropyIdVerifier:Me}=_n(X);if(!await jt.recoverPrimaryWallet().catch((()=>!1)))throw new xe("Wallet couldn't be connected",Se.UNKNOWN_CONNECT_WALLET_ERROR);if(!l)throw new xe("Attempting to sign a transaction with no user initialized");let{response:De}=await V.rpc({accessToken:Z,entropyId:Ee,entropyIdVerifier:Me,chainType:"solana",hdWalletIndex:this.walletIndex??0,request:{method:"signMessage",params:{message:Buffer.from(J).toString("base64")}}});return Buffer.from(De.data.signature,"base64")},async sendTransaction(J,Z,X){let{signature:Ee}=await Ti({transaction:J,connection:Z,transactionOptions:X,wallet:this});return Ee},async signTransaction(J){let Z=await Nr();if(!Z||!V)throw new xe("Must have valid access token and Privy wallet to send transaction",Se.MUST_BE_AUTHENTICATED);if(!await jt.recoverPrimaryWallet().catch((()=>!1)))throw new xe("Wallet couldn't be connected",Se.UNKNOWN_CONNECT_WALLET_ERROR);let X=H.imported?H:Ts(l);if(!X)throw new xe("Attempting to sign a transaction without a root wallet");let{entropyId:Ee,entropyIdVerifier:Me}=_n(X);return await are({tx:J,accessToken:Z,walletProxy:V,entropyId:Ee,entropyIdVerifier:Me,transactingWalletAddress:this.address,transactingWalletIndex:this.walletIndex??0}),J},loginOrLink:async()=>{throw new xe("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{},isConnected:async()=>!0}))))}),[V,l]),C.useEffect((()=>{var Z,X,Ee;if(!l)return void((Z=e.connectors)==null?void 0:Z.removeEmbeddedWalletConnectors());let F=Is(l),H=qb(l),J=X9(l);F&&H.length||((X=e.connectors)==null||X.removeEmbeddedWalletConnectors()),J||((Ee=e.connectors)==null||Ee.removeImportedWalletConnector()),e.connectors?V?(F&&e.connectors.addEmbeddedWalletConnectors({w
713alletProxy:V,rootWallet:F,embeddedWallets:H,defaultChain:K.defaultChain,appId:t.appId}),J&&e.connectors.addImportedWalletConnector(V,J.address,K.defaultChain,t.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[V,l]),C.useEffect((()=>{V&&(z==null||z(V))}),[V]);let N=C.useRef();C.useEffect((()=>{(async()=>{var J;if(!((J=K.customAuth)!=null&&J.enabled))return void fe({status:"not-enabled"});ce(!0);let{getCustomAccessToken:F,isLoading:H}=K.customAuth;if(s&&!H&&ye.status!=="loading"){fe({status:"loading"});try{let Z=await F();if(Z===N.current)return void fe({status:"done"});if(!Z&&o)return N.current=Z,await Wi.logout(),fe({status:"done"}),void qe(ne,"customAuth","onUnauthenticated");if(!Z)return N.current=Z,void fe({status:"done"});e.startAuthFlow(new YG(Z));let{user:X,isNewUser:Ee}=await e.authenticate();if(!X)return await Wi.logout(),fe({status:"error",error:new xe("Failed to sync with custom auth provider")}),void qe(ne,"customAuth","onUnauthenticated");Ee!==void 0&&qe(ne,"login","onComplete",X,Ee,!1,"custom",null),N.current=Z,qe(ne,"customAuth","onAuthenticated",{user:X}),fe({status:"done"}),u(X||null),v(Ee||!1),c(!0),le(!0)}catch(Z){if(console.warn(Z),await Wi.logout(),qe(ne,"customAuth","onUnauthenticated"),Z.message==="User already exists with provided custom JWT account.")return void fe({status:"initial"});qe(ne,"login","onError",Z.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),fe({status:"error",error:Z})}}})()}),[ye.status==="initial",(rt=K.customAuth)==null?void 0:rt.enabled,(Ze=K.customAuth)==null?void 0:Ze.getCustomAccessToken,(_t=K.customAuth)==null?void 0:_t.isLoading,s,o]),C.useEffect((()=>{ie&&V&&l&&Sl(l,K.embeddedWallets.createOnLogin)&&(le(!1),ir(l,kA).catch(console.error))}),[ie&&V&&l]),C.useEffect((()=>{if(K.externalWallets.solana.connectors)return K.externalWallets.solana.connectors.onMount(),()=>{var F;return(F=K.externalWallets.solana.connectors)==null?void 0:F.onUnmount()}}),[K.externalWallets.solana.connectors]),C.useEffect((()=>{!s&&ge&&(async function(){var Me,De,Be;let F,H=G(),J=te();(()=>{let Je=new URLSearchParams(window.location.search).get("privy_token");if(!Je)return;Ut.put(G9,Je);let nt=new URL(window.location.href);nt.searchParams.delete("privy_token"),window.history.pushState({},"",nt)})();let Z=_pe();e.initializeConnectorManager({walletConnectCloudProjectId:K.walletConnectCloudProjectId,rpcConfig:K.rpcConfig,chains:K.chains,defaultChain:K.defaultChain,store:Z,walletList:K.appearance.walletList,shouldEnforceDefaultChainOnConnect:K.shouldEnforceDefaultChainOnConnect,externalWalletConfig:K.externalWallets,appName:K.name??"Privy",walletChainType:K.appearance.walletChainType}),(Me=e.connectors)==null||Me.on("connectorInitialized",(()=>{F&&clearTimeout(F);let Je=e.connectors.walletConnectors.length,nt=e.connectors.walletConnectors.reduce(((et,Ct)=>et+(Ct.initialized?1:0)),0);nt===Je?Pe(!0):F=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:nt,expected:Je}),Pe(!0)}),1500)})),(De=e.connectors)==null||De.initialize().then((()=>{Te()}));let X=await e.getAuthenticatedUser(),Ee=!!X;K.legal.requireUsersAcceptTerms&&X&&!X.hasAcceptedTerms?(await e.logout(),jt.setReadyToTrue(!0),qe(ne,"logout","onSuccess")):((Be=K.customAuth)!=null&&Be.enabled||(c(!!X),X&&qe(ne,"login","onComplete",X,!1,!0,null,null),u(X)),H?Ue.current=Ee?"link":"login":J&&!Ee?(Ue.current="login",se({telegramAuthModalData:{seamlessAuth:!0}}),T(de.TELEGRAM_AUTH_SCREEN)):jt.setReadyToTrue(!!X))})()}),[e,me,s,ge]),C.useEffect((()=>{if(s){if(!l||!l.linkedAccounts.find((F=>F.type==="wallet"&&F.walletClientType==="privy")))return void ee(!0);ee(!!d.find((F=>F.walletClientType==="privy")))}}),[s,l,d]);let G=()=>{let F=PJe();return F.inProgress&&F.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):F.authorizationCode==="error"?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:F.stateCode,authorizationCode:F.authorizationCode}):(F.inProgress&&wJe(F.provider)&&!F.popupFlow&&(new BroadcastChannel(Ere).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:F.stateCode,authorizationCode:F.authorizationCode}),window.close()),!!F.inProgress&&!!F.withPrivyUi&&(e.startAuthFlow(new Bh(F)),T(de.AWAITING_OAUTH_SCREEN),!0))},te=()=>{var J;let F=J8e();if(!F||!K.loginMethods.telegram||!((J=K.loginConfig.telegramAuthConfiguration)!=null&&J.seamlessAuthEnabled))return;let H=new hg;return e.startAuthFlow(H),F.flowType==="login-url"&&(H.meta.telegramWebAppData=void 0,H.meta.telegramAuthResult=F.authData),F.flowType==="web-app"&&(H.meta.telegramAuthResult=void 0,H.meta.telegramWebAppData=F.authData),!0},ue=async(F,H,J,Z)=>{var X;pe(await((X=e.connectors)==null?void 0:X.createEthereumWalletConnector(F,H))||null,H,J,Z)};async function pe(F,H,J,Z){if(!F)return I({status:"disconnected",connectedWallet:null,connectError:new un("Unable to connect to wallet."),connector:null,connectRetry:Fe}),Z==null?void 0:Z(null,J);I({status:"disconnected",connectedWallet:null,connectError:null,connector:F,connectRetry:Fe}),F instanceof Cp&&H&&await F.resetConnection(H),I({connector:F,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>pe(F,H,J,Z)});try{let X=await F.connect({showPrompt:!0});if((!X||el(X))&&K.shouldEnforceDefaultChainOnConnect&&!K.chains.find((Ee=>Ee.id===Number(X==null?void 0:X.chainId.replace("eip155:",""))))&&((X==null?void 0:X.connectorType)!=="wallet_connect_v2"||(X==null?void 0:X.walletClientType)!=="metamask")){I((Ee=>
713({...Ee,connector:F,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:Fe})));try{await(X==null?void 0:X.switchChain(K.defaultChain.id)),X&&(X.chainId=Ub(zv(K.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${K.defaultChain.id}`)}}return I((Ee=>({...Ee,status:"connected",connectedWallet:X,connectError:null,connectRetry:Fe}))),X&&qe(ne,"connectWallet","onSuccess",(F.chainType,X)),Z==null?void 0:Z(X,J)}catch(X){return X instanceof Fs?(console.warn(X.cause?X.cause:X.message),qe(ne,"connectWallet","onError",X.privyErrorCode||Se.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(X),qe(ne,"connectWallet","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR)),I((Ee=>({...Ee,status:"disconnected",connectedWallet:null,connectError:X}))),Z==null?void 0:Z(null,J)}}let Ie=async(F,H,J)=>{if(F===null||!el(F))return;let Z=new Kv(F,e,H,J);e.startAuthFlow(Z)},je=async(F,H)=>{if(F===null||!kU(F))return;let J=new Z9(F,e,H);e.startAuthFlow(J)},Te=()=>{let F=new URLSearchParams(window.location.search),H=F.get("privy_connector"),J=F.get("privy_wallet_client");if(!H||!J)return;if(J!=="phantom"||D3()||T(de.LOGIN_FAILED_SCREEN),!e.connectors)throw new xe("Connector not initialized");O(de.AWAITING_CONNECTION);let Z=new URL(window.location.href);Z.searchParams.delete("privy_connector"),Z.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",Z),ue(H,J,void 0,Ie)};C.useEffect((()=>{s&&o&&l===null&&e.getAuthenticatedUser().then(u)}),[s,o,l,e]);let ve=F=>{if(!o)throw qe(ne,"linkAccount","onError",Se.MUST_BE_AUTHENTICATED,{linkMethod:F}),new xe("User must be authenticated before linking an account.")},Oe=()=>{ve("siwe"),Ae.current="siwe",Ue.current="link",O(de.LINK_WALLET_SCREEN)},at=F=>{if(!o||!l)return!1;if(F.walletClientType==="privy")return!0;for(let H of l.linkedAccounts)if(H.type==="wallet"&&H.address===F.address&&H.walletClientType!=="privy")return!0;return!1},gt=async F=>{let H;if(!e.connectors)throw new xe("Connector not initialized");H=F.type==="ethereum"?e.connectors.findWalletConnector(F.connectorType,F.walletClientType)||null:e.connectors.findSolanaWalletConnector(F.connectorType,F.walletClientType)||null,I((J=>({...J,connector:H,status:"connected",connectedWallet:F,connectError:null,connectRetry:Fe}))),K.captchaEnabled&&!o?(se({captchaModalData:{callback:J=>el(F)?Ie(F,J):je(F,J),userIntentRequired:!1,onSuccessNavigateTo:de.AWAITING_CONNECTION,onErrorNavigateTo:de.ERROR_SCREEN}}),T(de.CAPTCHA_SCREEN)):(el(F)?await Ie(F):await je(F),T(de.AWAITING_CONNECTION))},$t=()=>{f((F=>{var J;let H=((J=e.connectors)==null?void 0:J.wallets.filter(el).map((Z=>({...Z,linked:at(Z),loginOrLink:async()=>{if(!await Z.isConnected())throw new xe("Wallet is not connected");if(Z.connectorType==="embedded"&&Z.walletClientType==="privy")throw new xe("Cannot link or login with embedded wallet");gt(Z)},fund:async X=>{await jt.fundWallet(Z.address,X)},unlink:async()=>{if(!o)throw new xe("User is not authenticated.");if(Z.connectorType==="embedded"&&Z.walletClientType==="privy")throw new xe("Cannot unlink an embedded wallet");u(await e.unlinkEthereumWallet(Z.address))}}))))||[];return o7(F,H)?F:H})),g((F=>{var J;let H=(((J=e.connectors)==null?void 0:J.wallets)??[]).concat(m).filter(kU).map((Z=>({...Z,linked:at(Z),loginOrLink:async()=>{if(!await Z.isConnected())throw new xe("Wallet is not connected");if(Z.connectorType==="embedded"&&Z.walletClientType==="privy")throw new xe("Cannot link or login with embedded wallet");gt(Z)},fund:async()=>{throw new xe("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:async()=>{if(!o)throw new xe("User is not authenticated.");if(Z.connectorType==="embedded"&&Z.walletClientType==="privy")throw new xe("Cannot unlink an embedded wallet");u(await e.unlinkSolanaWallet(Z.address))}})));return o7(F,H)?F:H}))};C.useEffect((()=>{$t()}),[l==null?void 0:l.linkedAccounts,o,s,m]),C.useEffect((()=>{if(s){if(!e.connectors)throw new xe("Connector not initialized");$t(),e.connectors.on("walletsUpdated",$t)}}),[s]),C.useEffect((()=>{var F,H;[...((F=K.loginMethodsAndOrder)==null?void 0:F.primary)??[],...((H=K.loginMethodsAndOrder)==null?void 0:H.overflow)??[]].filter((J=>
713J.startsWith("privy:"))).forEach((J=>e.getCrossAppProviderDetails(J.replace("privy:",""))))}),[!!e]),C.useEffect((()=>{let F;if(!d[0])return;let H=d[0],J=b.current.find((Z=>Z.address===H.address));if(F=H.walletClientType==="privy"?l==null?void 0:l.linkedAccounts.find((Z=>Z.type==="wallet"&&Z.address===H.address&&Z.walletClientType==="privy")):l==null?void 0:l.linkedAccounts.find((Z=>Z.type==="wallet"&&Z.address===H.address&&Z.walletClientType!=="privy")),!J&&F){let Z=Object.assign({},l);Z.wallet=F&&{address:F.address,chainType:F.chainType,chainId:F.chainId,walletClient:F.walletClient,walletClientType:F.walletClientType,connectorType:F.connectorType,imported:F.imported,delegated:F.delegated,walletIndex:F.walletIndex},u(Z)}b.current=d}),[d]);let ir=async(F,H,J)=>{var Be,Je,nt;let Z=Is(F),X=Jo(F);if(J&&"walletIndex"in J)return Ar(F,H,J.walletIndex,Z,X);let Ee=J&&"createAdditional"in J&&J.createAdditional;if(Z&&!Ee)throw qe(ne,"createWallet","onError",Se.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[Me,De]=await Promise.all([jt.initializeWalletProxy(H),Nr()]);if(!Me&&((Be=K.customAuth)!=null&&Be.enabled))throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!Me||!De||(Je=K.embeddedWallets)!=null&&Je.requireUserOwnedRecoveryOnCreate)return _r();if(!Z)return await Me.create({accessToken:De,solanaAddress:X==null?void 0:X.address}),dr(0,"ethereum");{let et=(((nt=tEe(F))==null?void 0:nt.walletIndex)??0)+1,{entropyId:Ct,entropyIdVerifier:Nt}=_n(Ts(F));return await jt.recoverPrimaryWallet(),await Me.addWallet({accessToken:De,entropyId:Ct,entropyIdVerifier:Nt,chainType:"ethereum",hdWalletIndex:et}),dr(et,"ethereum")}},_r=async()=>new Promise(((F,H)=>{ce(!0),se({createWallet:{onSuccess:J=>{qe(ne,"createWallet","onSuccess",J),F(J)},onFailure:J=>{qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),H(J)},callAuthOnSuccessOnClose:!1}}),O(de.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)})),Ar=async(F,H,J,Z,X)=>{var De,Be;if(J<0)throw qe(ne,"createWallet","onError",Se.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${J}
713) is invalid.`);let[Ee,Me]=await Promise.all([jt.initializeWalletProxy(H),Nr()]);if(!Ee&&((De=K.customAuth)!=null&&De.enabled))throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!Ee||!Me||(Be=K.embeddedWallets)!=null&&Be.requireUserOwnedRecoveryOnCreate){if(J==0)return _r();throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Create wallet UI can only be displayed when walletIndex is 0.")}if(J==0){if(Z)return Z;await Ee.create({accessToken:Me,solanaAddress:X==null?void 0:X.address})}else{if(!Z)throw qe(ne,"createWallet","onError",Se.EMBEDDED_WALLET_CREATE_ERROR),Error("A user must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let Je=qb(F).find((Ct=>Ct.walletIndex===J));if(Je)return Je;let{entropyId:nt,entropyIdVerifier:et}=_n(Ts(F));await jt.recoverPrimaryWallet(),await Ee.addWallet({accessToken:Me,entropyId:nt,entropyIdVerifier:et,chainType:"ethereum",hdWalletIndex:J})}return dr(J,"ethereum")},Zt=async({user:F,wp:H,accessToken:J,walletIndex:Z,ethereumWallet:X})=>{let Ee=Wb(F).find((Me=>Me.walletIndex===Z));if(Ee)return Ee;if(Z===0)await H.createSolana({accessToken:J,ethereumAddress:X==null?void 0:X.address});else{let Me=Ts(F);if(!Me)throw qe(ne,"createWallet","onError",Se.EMBEDDED_WALLET_CREATE_ERROR),Error("User must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let{entropyId:De,entropyIdVerifier:Be}=_n(Me);await jt.recoverPrimaryWallet(),await H.addWallet({accessToken:J,entropyId:De,entropyIdVerifier:Be,chainType:"solana",hdWalletIndex:Z})}return dr(Z,"solana")},dr=async(F,H)=>{let J=await jt.refreshUser(),Z=(H==="ethereum"?qb(J):Wb(J)).find((X=>X.walletIndex===F));if(!Z)throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return qe(ne,"createWallet","onSuccess",Z),Z},gn=(F,H,J,Z)=>new Promise((async(X,Ee)=>{var nr;let{requesterAppId:Me}=H||{};if(!o||!l)return qe(ne,"sendTransaction","onError",Se.MUST_BE_AUTHENTICATED),void Ee(Error("User must be authenticated before signing with a Privy wallet"));let De=Z??((nr=Is(l))==null?void 0:nr.address);if(!De)throw new xe("User must have an embedded wallet to send a transaction.");let{signingWallet:Be,rootWallet:Je}=F2(l,De);if(!Je||!Be)return qe(ne,"sendTransaction","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void Ee(Error("Must have a Privy wallet before signing"));ce(!0);let nt=Wa.wallets.find((gr=>gr.walletClientType==="privy"&&jr(gr.address)===jr(Be.address))),et=await(nt==null?void 0:nt.getEthereumProvider());if(!nt||!et)throw new xe(`Cannot sendTransaction before embedded wallet ${Be.address} is connected`);let Ct=F.chainId?Number(F.chainId):wre(nt.chainId);(gr=>{if(!K.chains.map((Fr=>Fr.id)).includes(gr))throw new un(`Chain ID ${gr} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,Se.UNSUPPORTED_CHAIN_ID)})(Ct);let Nt=Object.assign({},F,{chainId:Ct});if(Qe({showWalletUIs:H==null?void 0:H.showWalletUIs}))(async()=>{let gr=await Nr();if(!gr||!V)return qe(ne,"sendTransaction","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void Ee(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await jt.recoverPrimaryWallet())return qe(ne,"sendTransaction","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),void Ee(Error("Unable to connect to wallet"));let Fr=a0(Nt.chainId,K.chains,K.rpcConfig,{appId:t.appId}),kn=await $S(Be.address,Nt,Fr);if(Qe({showWalletUIs:H==null?void 0:H.showWalletUIs})){let{totalGasEstimate:wa}=await kS(kn,Fr),{hasSufficientFunds:zi}=await pre(Be.address,kn,wa,Fr);if(!zi)throw new yo(new yf("Wallet has insufficient funds for this transaction.",xi.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let{entropyId:Wr,entropyIdVerifier:Kr}=_n(Je),en=await hre({accessToken:gr,entropyId:Wr,entropyIdVerifier:Kr,transactingWallet:Be,walletProxy:V,transactionRequest:kn,provider:Fr,requesterAppId:Me});qe(ne,"sendTransaction","onSuccess",en),X(en)}catch(Fr){qe(ne,"sendTransaction","onError",Se.TRANSACTION_FAILURE),Ee(Fr)}})();else{let{entropyId:gr,entropyIdVerifier:Fr}
713=_n(Je),kn={entropyId:gr,entropyIdVerifier:Fr,onCompleteNavigateTo:de.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:Kr=>{qe(ne,"sendTransaction","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),Ee(Kr)}},Wr=OU(K)?NU({address:Be.address,appConfig:K,fundWalletConfig:J,methodScreen:de.FUNDING_METHOD_SELECTION_SCREEN,chainIdOverride:Nt.chainId,comingFromSendTransactionScreen:!0}):void 0;se({connectWallet:kn,sendTransaction:{transactionRequest:Nt,transactingWallet:Be,entropyId:gr,entropyIdVerifier:Fr,onSuccess:Kr=>{qe(ne,"sendTransaction","onSuccess",Kr),X(Kr)},onFailure:Kr=>{qe(ne,"sendTransaction","onError",Se.TRANSACTION_FAILURE),Ee(Kr)},uiOptions:H||{},fundWalletConfig:J,requesterAppId:Me},funding:Wr}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),Ti=({transaction:F,connection:H,transactionOptions:J,fundWalletConfig:Z,uiOptions:X,wallet:Ee})=>new Promise((async(Me,De)=>{let{requesterAppId:Be}=X||{};if(!o||!l)return qe(ne,"sendSolanaTransaction","onError",Se.MUST_BE_AUTHENTICATED),void De(new xe("User must be authenticated before signing with a Privy wallet",Se.MUST_BE_AUTHENTICATED));let Je=Ee?l.linkedAccounts.find((et=>et.type==="wallet"&&et.address===Ee.address)):Jo(l);if(!Je)return qe(ne,"sendSolanaTransaction","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void De(new xe("Must have a Privy wallet before signing",Se.EMBEDDED_WALLET_NOT_FOUND));ce(!0);let{rootWallet:nt}=Vb(l,Je.address);if(!await jt.recoverPrimaryWallet().catch((()=>!1))||!nt)throw qe(ne,"sendSolanaTransaction","onError",Se.EMBEDDED_WALLET_NOT_FOUND),new xe(`Cannot sendSolanaTransaction before embedded wallet ${Je.address} is connected`,Se.EMBEDDED_WALLET_NOT_FOUND);if(Qe({showWalletUIs:X==null?void 0:X.showWalletUIs}))(async()=>{let et=await Nr();if(!et||!V)return qe(ne,"sendSolanaTransaction","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void De(new xe("Must have valid access token and Privy wallet to send transaction",Se.EMBEDDED_WALLET_NOT_FOUND));try{if(!await jt.recoverPrimaryWallet())return qe(ne,"sendSolanaTransaction","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),void De(new xe("Unable to connect to wallet",Se.UNKNOWN_CONNECT_WALLET_ERROR));if(Qe({showWalletUIs:X==null?void 0:X.showWalletUIs})&&!await mWe(F,H))return qe(ne,"sendSolanaTransaction","onError",Se.INSUFFICIENT_BALANCE),void De(new xe("Solana wallet has insufficient funds for this transaction.",Se.INSUFFICIENT_BALANCE));let{entropyId:Ct,entropyIdVerifier:Nt}=nEe(l),{signature:nr,receipt:gr}=await ore({accessToken:et,tx:F,connection:H,walletProxy:V,transactionOptions:J,entropyId:Ct,entropyIdVerifier:Nt,transactingWalletAddress:Je.address,transactingWalletIndex:Je.walletIndex??0}),Fr=FJ(nr,gr);qe(ne,"sendSolanaTransaction","onSuccess",Fr),Me(Fr)}catch(Ct){qe(ne,"sendSolanaTransaction","onError",Se.TRANSACTION_FAILURE),De(Ct)}})();else{let{entropyId:et,entropyIdVerifier:Ct}=_n(nt),Nt={entropyId:et,entropyIdVerifier:Ct,onCompleteNavigateTo:de.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:gr=>{qe(ne,"sendSolanaTransaction","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),De(gr)}},nr=OU(K)?TJe({address:Je.address,appConfig:K,methodScreen:de.FUNDING_METHOD_SELECTION_SCREEN,fundWalletConfig:Z,comingFromSendTransactionScreen:!0}):void 0;se({connectWallet:Nt,sendSolanaTransaction:{transactionRequest:F,connection:H,transactionOptions:J,transactingWallet:Je,onSuccess:gr=>{qe(ne,"sendSolanaTransaction","onSuccess",gr),Me(gr)},onFailure:gr=>{qe(ne,"sendSolanaTransaction","onError",Se.TRANSACTION_FAILURE),De(gr)},uiOptions:X||{},requesterAppId:Be},funding:nr}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)}}));function Ks(){return new Promise((async(F,H)=>{let J=await Nr();if(!J||!V)throw Error("Must have valid access token to enroll in MFA");try{await V.verifyMfa({accessToken:J}),F()}catch(Z){H(Z)}}))}let ti=F=>F==null?void 0:F.linkedAccounts.filter((H=>H.latestVerifiedAt!==null&&!(H.type==="wallet"&&H.walletClientType==="privy"))).sort(((H,J)=>J.latestVerifiedAt.getTime()-H.latestVerifiedAt.getTime()))[0],xn=F=>{let H=(l==null?void 0:l.linkedAccounts.filter((X=>X.type===F)).length)??0,{displayName:J,loginMethod:Z}=W5(F);if(F==="passkey"&&H>=5||F!=="passkey"&&H>=1)throw qe(ne,"linkAccount","onError",Se.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:Z}),new xe(`User already has an account of type ${J} linked.`)};async function Jr({showAutomaticRecovery:F=!1,legacySetWalletPasswordFlow:H=!1}){x(null);let J=H?"setWalletPassword":"setWalletRecovery";if(!o||!l)throw qe(ne,J,"onError",Se.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let Z=Ts(l);
713if(!Z||!V)throw qe(ne,J,"onError",Se.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");try{await Ks()}catch(X){throw qe(ne,J,"onError",Se.MISSING_MFA_CREDENTIALS),X}return new Promise(((X,Ee)=>{ce(!0);let Me={onSuccess:et=>{qe(ne,J,"onSuccess","user-passcode",et),X(et)},onFailure:et=>{qe(ne,J,"onError",Se.USER_EXITED_SET_PASSWORD_FLOW),Ee(et)},callAuthOnSuccessOnClose:!1},De=Z.recoveryMethod==="user-passcode",Be=mJ({walletAction:"update",availableRecoveryMethods:K.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:H,isResettingPassword:De,showAutomaticRecovery:F}),{entropyId:Je,entropyIdVerifier:nt}=_n(Z);se({setWalletPassword:Me,recoverWallet:{entropyId:Je,entropyIdVerifier:nt,onFailure:Ee},createWallet:Me,connectWallet:{onCompleteNavigateTo:Be,shouldForceMFA:!1,entropyId:Je,entropyIdVerifier:nt,onFailure:et=>{qe(ne,J,"onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),Ee(et)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:De}}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function Qs({appId:F,action:H}){let J=await Nr();if(H==="link"&&!J)throw qe(ne,"linkAccount","onError",Se.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${F}`}),new xe("User must be authenticated before linking an account.");if(H==="login"&&J)throw qe(ne,"login","onError",Se.UNKNOWN_AUTH_ERROR),new xe("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Ae.current=`privy:${F}`,Ue.current=H;let Z=q5();return e.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:F}}),new Promise((async(X,Ee)=>{let{name:Me,logoUrl:De}=await _re({api:e.api,providerAppId:F,requesterAppId:K.id});se({crossAppAuth:{appId:F,name:Me,logoUrl:De,action:H,popup:Z,onSuccess:X,onError:Ee}}),T(de.CROSS_APP_AUTH_SCREEN)}))}let Wi={ready:s,authenticated:o,user:l,walletConnectors:e.connectors||null,connectWallet:F=>{F&&"target"in F&&F&&(F=void 0),se({externalConnectWallet:{walletList:F!=null&&F.walletList&&(F==null?void 0:F.walletList.length)>0?F.walletList:void 0,suggestedAddress:F==null?void 0:F.suggestedAddress}}),O(o?de.CONNECT_ONLY_AUTHENTICATED_SCREEN:de.CONNECT_ONLY_LANDING_SCREEN)},linkWallet:Oe,startCrossAppAuthFlow:Qs,linkEmail:()=>{ve("email"),xn("email"),Ae.current="email",Ue.current="link",O(de.LINK_EMAIL_SCREEN)},linkPhone:()=>{ve("sms"),xn("phone"),Ae.current="sms",Ue.current="link",O(de.LINK_PHONE_SCREEN)},linkGoogle:async()=>{ve("google"),xn("google_oauth"),Ue.current="link",await jt.initLoginWithOAuth("google")},linkTwitter:async()=>{ve("twitter"),xn("twitter_oauth"),Ue.current="link",await jt.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ve("discord"),xn("discord_oauth"),Ue.current="link",await jt.initLoginWithOAuth("discord")},linkGithub:async()=>{ve("github"),xn("github_oauth"),Ue.current="link",await jt.initLoginWithOAuth("github")},linkSpotify:async()=>{ve("spotify"),xn("spotify_oauth"),Ue.current="link",await jt.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ve("instagram"),xn("instagram_oauth"),Ue.current="link",await jt.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ve("tiktok"),xn("tiktok_oauth"),Ue.current="link",await jt.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ve("linkedin"),xn("linkedin_oauth"),Ue.current="link",await jt.initLoginWithOAuth("linkedin")},linkApple:async()=>{ve("apple"),xn("apple_oauth"),Ue.current="link",await jt.initLoginWithOAuth("apple")},linkPasskey:async()=>{ve("passkey"),xn("passkey"),await jt.initLinkWithPasskey(),O(de.LINK_PASSKEY_SCREEN)},linkTelegram:async F=>{if(ve("telegram"),xn("telegram"),Ue.current="link",Ae.current="telegram",F==null?void 0:F.launchParams)if(F.launchParams.initDataRaw){let H=new hg;e.startAuthFlow(H),H.meta.telegramAuthResult=void 0,H.meta.telegramWebAppData=hK(F.launchParams.initDataRaw),se({telegramAuthModalData:{seamlessAuth:!0}}),T(de.TELEGRAM_AUTH_SCREEN)}else qe(ne,"linkAccount","onError",Se.INVALID_DATA,{linkMethod:"telegram"});else await jt.initLoginWithTelegram();O(de.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{ve("farcaster"),xn("farcaster"),await jt.initLoginWithFarcaster(),Ue.current="link",Ae.current="farcaster",O(de.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(ve("email"),!(l!=null&&l.email))throw new xe("User does not have an email linked to their account.");Ue.current="update",Ae.current="email",O(de.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(ve("sms"),!(l!=null&&l.phone))throw new xe("User does not have a phone number linked to their account.");Ue.current="update",Ae.current="sms",O(de.UPDATE_PHONE_SCREEN)},login:async F=>{F&&"target"in F&&F&&(F=void 0);let H="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!s){let J=await new Promise((Z=>{_e((X=>Z.bind(X)))}));if(_e(null),J)return void console.warn(H)}!l||l.isGuest?(Ue.current="login",se({login:F}),T(de.LANDING)):console.warn(H)},connectOrCreateWallet:async()=>{s||(await new Promise((F=>{_e((()=>F))})),_e(null)),o?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Ue.current="login",T(de.CONNECT_OR_CREATE))},logout:async()=>
713{if(Ue.current=null,Ae.current=null,l&&e.clearProviderAcccessTokens(l),x(null),await e.logout(),l&&V)try{await V.clearMfa({userId:l.id})}catch{}u(null),c(!1),qe(ne,"logout","onSuccess"),i(!1),Ut.del(K9),Ut.del(lK(K.id))},getAccessToken:()=>e.getCustomerAccessToken(),getEthereumProvider:()=>{var J;if(!l||!l.wallet)return new us;let F=d.find((Z=>l.wallet&&Z.address===l.wallet.address)),H=(J=e.connectors)==null?void 0:J.walletConnectors.find((Z=>Z.wallets.find((X=>X.address===(F==null?void 0:F.address)))));return F&&H?H.proxyProvider:new us},getEthersProvider:()=>{var J;if(!l||!l.wallet)return new Iv(new ew(new us));let F=d.find((Z=>l.wallet&&Z.address===l.wallet.address)),H=(J=e.connectors)==null?void 0:J.walletConnectors.find((Z=>Z.wallets.find((X=>X.address===(F==null?void 0:F.address)))));return new Iv(new ew(F&&H?H.proxyProvider:new us))},getWeb3jsProvider:()=>{var J;if(!l||!l.wallet)return new c7(new us);let F=d.find((Z=>l.wallet&&Z.address===l.wallet.address)),H=(J=e.connectors)==null?void 0:J.walletConnectors.find((Z=>Z.wallets.find((X=>X.address===(F==null?void 0:F.address)))));return new c7(F&&H?H.proxyProvider:new us)},unlinkWallet:async F=>{let H;return u(H=F.startsWith("0x")?await e.unlinkEthereumWallet(F):await e.unlinkSolanaWallet(F)),H},unlinkEmail:async F=>{let H=await e.unlinkEmail(F);return u(H),H},unlinkPhone:async F=>{let H=await e.unlinkPhone(F);return u(H),H},unlinkGoogle:async F=>{let H=await e.unlinkOAuth("google",F);return u(H),H},unlinkTwitter:async F=>{let H=await e.unlinkOAuth("twitter",F);return u(H),H},unlinkDiscord:async F=>{let H=await e.unlinkOAuth("discord",F);return u(H),H},unlinkGithub:async F=>{let H=await e.unlinkOAuth("github",F);return u(H),H},unlinkSpotify:async F=>{let H=await e.unlinkOAuth("spotify",F);return u(H),H},unlinkInstagram:async F=>{let H=await e.unlinkOAuth("instagram",F);return u(H),H},unlinkTiktok:async F=>{let H=await e.unlinkOAuth("tiktok",F);return u(H),H},unlinkLinkedIn:async F=>{let H=await e.unlinkOAuth("linkedin",F);return u(H),H},unlinkApple:async F=>{let H=await e.unlinkOAuth("apple",F);return u(H),H},unlinkFarcaster:async F=>{let H=await e.unlinkFarcaster(F);return u(H),H},unlinkTelegram:async F=>{let H=await e.unlinkTelegram(F);return u(H),H},unlinkPasskey:async F=>{let H=await e.unlinkPasskey(F);return u(H),H},unlinkCrossAppAccount:async({subject:F})=>{var Z;let H=(Z=l==null?void 0:l.linkedAccounts.find((X=>X.type==="cross_app"&&X.subject===F)))==null?void 0:Z.providerApp;if(!H)throw new xe("Invalid subject");e.storeProviderAccessToken(H.id,null);let J=await e.unlinkOAuth(`privy:${H.id}`,F);return u(J),J},setActiveWallet:async F=>{let H=d.find((Z=>jr(Z.address)===jr(F))),J=l==null?void 0:l.linkedAccounts.find((Z=>Z.type==="wallet"&&jr(Z.address)===jr(F)));if(H&&await H.isConnected())if(H.linked){let Z=Object.assign({},l);Z.wallet=J&&{address:J.address,chainType:J.chainType,chainId:J.chainId,walletClient:J.walletClient,walletClientType:J.walletClientType,connectorType:J.connectorType,imported:J.imported,delegated:J.delegated,walletIndex:J.walletIndex},u(Z)}else H.loginOrLink();else se({externalConnectWallet:{suggestedAddress:F}}),Oe()},forkSession:()=>e.forkSession(),createWallet:async F=>{if(F&&"target"in F&&F&&(F=void 0),!o||!l)throw qe(ne,"createWallet","onError",Se.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return ir(l,15e3,F)},setWalletRecovery:async F=>Jr({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:(F==null?void 0:F.showAutomaticRecovery)??!1}),setWalletPassword:async()=>Jr({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(F,H,J)=>new Promise((async(Z,X)=>{var nt;let{requesterAppId:Ee}=H||{};if(!o||!l)return qe(ne,"signMessage","onError",Se.MUST_BE_AUTHENTICATED),void X(Error("User must be authenticated before signing with a Privy wallet"));let Me=J??((nt=Is(l))==null?void 0:nt.address);if(!Me)throw new xe("User must have an embedded wallet to sign a message.");let{signingWallet:De,rootWallet:Be}=F2(l,Me);if(!De||!Be)return qe(ne,"signMessage","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void X(Error("Mu
713st have a Privy wallet before signing"));if(typeof F!="string"||F.length<1)return qe(ne,"signMessage","onError",Se.INVALID_MESSAGE),void X(Error("Message must be a non-empty string"));ce(!0);let Je=async()=>{if(!o)throw Error("User must be authenticated before signing with a Privy wallet");let et=await Nr();if(!V||!et||!await jt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:De.address,requesterAppId:Ee}});let{entropyId:Ct,entropyIdVerifier:Nt}=_n(Be),{response:nr}=await V.rpc({accessToken:et,entropyId:Ct,entropyIdVerifier:Nt,chainType:"ethereum",hdWalletIndex:De.walletIndex??0,requesterAppId:Ee,request:{method:"personal_sign",params:[F,De.address]}}),gr=nr.data;return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:De.address,requesterAppId:Ee}}),gr};if(Qe({showWalletUIs:H==null?void 0:H.showWalletUIs}))try{let et=await Je();qe(ne,"signMessage","onSuccess",et),Z(et)}catch(et){qe(ne,"signMessage","onError",Se.UNABLE_TO_SIGN),X(et??new yo("Unable to sign message"))}else{let{entropyId:et,entropyIdVerifier:Ct}=_n(Be);se({signMessage:{method:"personal_sign",data:F,confirmAndSign:Je,onSuccess:Nt=>{qe(ne,"signMessage","onSuccess",Nt),Z(Nt)},onFailure:Nt=>{qe(ne,"signMessage","onError",Se.UNABLE_TO_SIGN),X(Nt)},uiOptions:H||{}},connectWallet:{entropyId:et,entropyIdVerifier:Ct,onCompleteNavigateTo:de.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:Nt=>{qe(ne,"signMessage","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),X(Nt)}}}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),signTypedData:(F,H,J)=>new Promise((async(Z,X)=>{var et;let{requesterAppId:Ee}=H||{};if(!o||!l)return qe(ne,"signTypedData","onError",Se.MUST_BE_AUTHENTICATED),void X(Error("User must be authenticated before signing with a Privy wallet"));let Me=J??((et=Is(l))==null?void 0:et.address);if(!Me)throw new xe("User must have an embedded wallet to sign a message.");let{signingWallet:De,rootWallet:Be}=F2(l,Me);if(!Be||!De)return qe(ne,"signTypedData","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void X(Error("Must have a Privy wallet before signing"));ce(!0);let Je=z9(F),nt=async()=>{if(!o)throw Error("User must be authenticated before signing with a Privy wallet");let Ct=await Nr();if(!V||!Ct||!await jt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:De.address,requesterAppId:Ee}});let{entropyId:Nt,entropyIdVerifier:nr}=_n(Be),{response:gr}=await V.rpc({accessToken:Ct,entropyId:Nt,entropyIdVerifier:nr,chainType:"ethereum",hdWalletIndex:De.walletIndex??0,requesterAppId:Ee,request:{method:"eth_signTypedData_v4",params:[De.address,Je]}}),Fr=gr.data;return e.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:De.address,requesterAppId:Ee}}),Fr};if(Qe({showWalletUIs:H==null?void 0:H.showWalletUIs,typedData:!0}))try{let Ct=await nt();qe(ne,"signTypedData","onSuccess",Ct),Z(Ct)}catch(Ct){qe(ne,"signTypedData","onError",Se.UNABLE_TO_SIGN),X(Ct??new yo("Unable to sign message"))}else{let{entropyId:Ct,entropyIdVerifier:Nt}=_n(Be);se({signMessage:{method:"eth_signTypedData_v4",data:Je,confirmAndSign:nt,onSuccess:nr=>{qe(ne,"signTypedData","onSuccess",nr),Z(nr)},onFailure:nr=>{qe(ne,"signTypedData","onError",Se.UNABLE_TO_SIGN),X(nr)},uiOptions:H||{}},connectWallet:{entropyId:Ct,entropyIdVerifier:Nt,onCompleteNavigateTo:de.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:nr=>{qe(ne,"signMessage","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),X(nr)}}}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),sendTransaction:async(F,H,J,Z)=>{let X=await gn(F,H,J,Z);return gre(await X.wait())},sendSolanaTransaction:async(F,H,J,Z,X,Ee)=>{let Me=Ee?h.find((({address:De})=>De===Ee)):h.slice().sort(((De,Be)=>(De.walletIndex??0)-(Be.walletIndex??0)))[0];if(!Me)throw qe(ne,"sendSolanaTransaction","onError",Se.EMBEDDED_WALLET_NOT_FOUND),new xe("Embedded wallet not found",Se.EMBEDDED_WALLET_NOT_FOUND);return await Ti({transaction:F,connection:H,transactionOptions:Z,uiOptions:J,fundWalletConfig:X,wallet:Me})},exportWallet:F=>new Promise((async(H,J)=>{var Je;if(!o||!l)return void J(Error("User must be authenticated before exporting their Privy wallet"));F&&"target"in F&&F&&(F=void 0);let Z=(F==null?void 0:F.address)??((Je=Is(l))==null?void 0:Je.address);if(!Z)return void J(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));let{signingWallet:X,rootWallet:Ee}=F2(l,Z);
713if(!X||!Ee)return void J(Error("Must have a Privy wallet before exporting"));ce(!0);let{entropyId:Me,entropyIdVerifier:De}=_n(Ee),Be={entropyId:Me,entropyIdVerifier:De,onCompleteNavigateTo:de.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:J,shouldForceMFA:!0};se(Q),await Nr()&&V?V?(se({keyExport:{appId:t.appId,appClientId:t.clientId,origin:e.apiUrl,walletToExport:X,primaryWallet:Ee,onSuccess:H,onFailure:J},connectWallet:Be}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)):J(Error("Must have a Privy wallet before exporting")):J(Error("Must have valid access token to enroll in MFA"))})),promptMfa:Ks,async init(F){switch(F){case"sms":return void await e.initMfaSmsVerification();case"passkey":return await e.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${F}`)}},async submit(F,H){var J,Z,X;switch(F){case"totp":case"sms":if(typeof H!="string")throw new xe("Invalid MFA code");(J=we.current)==null||J.resolve({mfaMethod:F,mfaCode:H,relyingParty:window.origin}),await new Promise(((De,Be)=>{Ce.current={resolve:De,reject:Be}}));break;case"passkey":if(typeof H=="string")throw new xe("Invalid authenticator response");let Ee=await sc(()=>import("./index-Bjltdz_y.js"),[]),Me=kJe(await Ee.startAuthentication(H));(Z=we.current)==null||Z.resolve({mfaMethod:F,mfaCode:Me,relyingParty:window.origin}),await new Promise(((De,Be)=>{Ce.current={resolve:De,reject:Be}}));break;default:throw(X=we.current)==null||X.reject(new xe("Unsupported MFA method")),new xe(`Unsupported MFA method: ${F}`)}},cancel(){var F;(F=we.current)==null||F.reject(new xe("MFA canceled"))},async initEnrollmentWithSms(F){let H=await Nr();if(!H||!V)throw Error("Must have valid access token to enroll in MFA");await V.initEnrollMfa({method:"sms",accessToken:H,phoneNumber:F.phoneNumber})},enrollInMfa:F=>new Promise(((H,J)=>{if(!F)return jt.closePrivyModal(),void H();K.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),se({mfaEnrollmentFlow:{mfaMethods:K.mfa.methods,onSuccess:H,onFailure:J}}),O(de.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let F=await Nr();if(!F||!V)throw Error("Must have valid access token to enroll in MFA");let H=await V.initEnrollMfa({method:"totp",accessToken:F});return{secret:H.secret,authUrl:H.authUrl}},async submitEnrollmentWithSms(F){let H=await Nr();if(!H||!V)throw Error("Must have valid access token to enroll in MFA");await V.submitEnrollMfa({method:"sms",accessToken:H,phoneNumber:F.phoneNumber,code:F.mfaCode}),u(await e.getAuthenticatedUser())},async submitEnrollmentWithTotp(F){let H=await Nr();if(!H||!V)throw Error("Must have valid access token to enroll in MFA");await V.submitEnrollMfa({method:"totp",accessToken:H,code:F.mfaCode}),u(await e.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:F}){let H=await Nr();if(!H||!V)throw Error("Must have valid access token to enroll in MFA");await V.submitEnrollMfa({method:"passkey",accessToken:H,credentialIds:F}),u(await e.getAuthenticatedUser())},async unenroll(F){let H=await Nr();if(!H||!V)throw Error("Must have valid access token to remove MFA");F==="passkey"?await V.submitEnrollMfa({method:"passkey",accessToken:H,credentialIds:[]}):await V.unenrollMfa({method:F,accessToken:H}),u(await e.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{var Z;let F=await Nr(),H=l==null?void 0:l.linkedAccounts.find((X=>X.type==="wallet"&&X.walletClientType==="privy"));if(!F)throw Error("Must have valid access token to connect with Farcaster");if(!V||!H)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((Z=l==null?void 0:l.farcaster)!=null&&Z.fid))throw Error("Must have Farcaster account to use Farcaster signers");if(!await jt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");let J=await V.initFarcasterSigner({address:H.address,hdWalletIndex:null,accessToken:F,mfaCode:null,mfaMethod:null,relyingParty:window.origin});
713J.status==="approved"&&u(await e.getAuthenticatedUser()||l||null),se({farcasterSigner:J}),O(de.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{var Z,X;let F,H=await Nr(),J=l==null?void 0:l.linkedAccounts.find((Ee=>Ee.type==="wallet"&&Ee.walletClientType==="privy"));if(!H)throw Error("Must have valid access token to connect with Farcaster");if(!V||!J)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((Z=l==null?void 0:l.farcaster)!=null&&Z.fid))throw Error("Must have Farcaster account to use Farcaster signers");if(!await jt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!((X=l.farcaster)!=null&&X.signerPublicKey))throw Error("Must have a Farcaster signer public key to sign");return F=l.farcaster.signerPublicKey.slice(2),Uint8Array.from(F.match(/.{1,2}/g).map((Ee=>parseInt(Ee,16))))},signFarcasterMessage:async F=>{var Ee,Me;let H=await Nr(),J=l==null?void 0:l.linkedAccounts.find((De=>De.type==="wallet"&&De.walletClientType==="privy"));if(!H)throw Error("Must have valid access token to connect with Farcaster");if(!V||!J)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((Ee=l==null?void 0:l.farcaster)!=null&&Ee.fid))throw Error("Must have Farcaster account to use Farcaster signers");if(!await jt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!((Me=l.farcaster)!=null&&Me.signerPublicKey))throw Error("Must have a Farcaster signer public key to sign");let Z=await sc(()=>import("./index-Bjltdz_y.js"),[]),X=await V.signFarcasterMessage({address:J.address,hdWalletIndex:null,accessToken:H,mfaCode:null,mfaMethod:null,payload:{hash:Z.bufferToBase64URLString(F)},fid:BigInt(l.farcaster.fid),relyingParty:window.origin});return new Uint8Array(Z.base64URLStringToBuffer(X.signature))},createGuestAccount:async()=>{if(l&&!l.isGuest)throw Error("User cannot already be authenticated to create a guest account");return l!=null&&l.isGuest?l:jt.loginWithGuestAccountFlow()},signMessageWithCrossAppWallet(F,{address:H}){let J=l==null?void 0:l.linkedAccounts.some((Z=>Z.type==="cross_app"&&Z.smartWallets.some((X=>X.address===H))));return Yx({user:l,client:e,address:H,requesterAppId:K.id,request:{method:J?"privy_signSmartWalletMessage":"personal_sign",params:[F,H]},reconnect:Qs})},signTypedDataWithCrossAppWallet(F,{address:H}){let J=l==null?void 0:l.linkedAccounts.some((X=>X.type==="cross_app"&&X.smartWallets.some((Ee=>Ee.address===H)))),Z=z9(F);return Yx({user:l,client:e,address:H,requesterAppId:K.id,request:{method:J?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[H,Z]},reconnect:Qs})},sendTransactionWithCrossAppWallet(F,{address:H}){let J=l==null?void 0:l.linkedAccounts.some((Z=>Z.type==="cross_app"&&Z.smartWallets.some((X=>X.address===H))));return Yx({user:l,client:e,address:H,requesterAppId:K.id,request:{method:J?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[F]},reconnect:Qs})},isModalOpen:n,mfaMethods:K.mfa.methods};Are=Wi.signMessage,Tre=Wi.signTypedData,Ire=async(...F)=>{let H=await gn(...F);return K.embeddedWallets.waitForTransactionConfirmation&&await H.wait(),H};let jt={setAuthenticated:c,setUser:u,isNewUserThisSession:E,pendingTransaction:null,walletConnectionStatus:A,connectors:((Et=e.connectors)==null?void 0:Et.walletConnectors)??[],solanaWallets:h,rpcConfig:K.rpcConfig,chains:K.chains,appId:t.appId,showFiatPrices:K.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:e.clientAnalyticsId,customAuthStatus:ye,noPromptOnSignature:He,emailOtpState:j,setEmailOtpState:L,smsOtpState:B,setSmsOtpState:k,oAuthState:U,setOAuthState:W,siweState:D,setSiweState:q,isHeadlessOAuthLoading:_,nativeTokenSymbolForChainId:F=>{var H;return(H=K.chains.find((J=>J.id===Number(F))))==null?void 0:H.nativeCurrency.symbol},initializeWalletProxy:async F=>{if(V)return V;let H=new Promise((X=>{R((()=>Ee=>X(Ee)))})),J=new Promise((X=>setTimeout((()=>X(null)),F))),Z=await Promise.race([H,J]);return R(null),Z},getAuthFlow:()=>e.authFlow,getAuthMeta:()=>{var F;return(F=e.authFlow)==null?void 0:F.meta},client:e,closePrivyModal:async(F={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{var Ee;let H,J=s&&o&&l;J&&Ae.current&&(H=ti(l)),Ue.current==="login"?F.shouldCallAuthOnSuccess&&J&&Ae.current?(qe(ne,"login","onComplete",l,E,!1,Ae.current,H??null),(Ee=t.onSuccess)==null||Ee.call(t,l,E)):qe(ne,"login","onError",Se.USER_EXITED_AUTH_FLOW):Ue.current==="link"&&H?F.isSuccess&&J&&Ae.current?qe(ne,"linkAccount","onSuccess",l,Ae.current,H):Ae.current&&qe(ne,"linkAccount","onError",Se.USER_EXITED_LINK_FLOW,{linkMethod:Ae.current}):Ue.current==="update"&&H&&(F.isSuccess&&J&&Ae.current?qe(ne,"update","onSuccess",l,Ae.current,H):Ae.current&&qe(ne,"update","onError",Se.USER_EXITED_UPDATE_FLOW,{linkMethod:Ae.current}));
713let Z=w&&PU.includes(w),X=w===de.ERROR_SCREEN&&Q.errorModalData&&PU.includes(Q.errorModalData.previousScreen);if((Z||X)&&Q.funding){let Me,De=IJe[w]??null;if(Q.funding.chainType==="solana"){let Be=r(n2);if(!Be)return void console.warn("Unable to load solana plugin, skipping balance");try{Me=BigInt(await Be.getBalance({address:Q.funding.address,cluster:Q.funding.cluster}))}catch{console.error("Unable to pull wallet balance")}qe(ne,"fundSolanaWallet","onUserExited",{address:Q.funding.address,cluster:Q.funding.cluster,fundingMethod:De,balance:Me})}else{let Be=a0(Q.funding.chain.id,K.chains,K.rpcConfig,{appId:t.appId});try{Me=(await Be.getBalance(Q.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}qe(ne,"fundWallet","onUserExited",{address:Q.funding.address,chain:Q.funding.chain,fundingMethod:De,balance:Me})}}se({...Q,externalConnectWallet:{suggestedAddress:void 0}}),Ue.current=null,Ae.current=null,v(!1),i(!1),setTimeout((()=>{e.authFlow=void 0}),200),e.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:({message:F,address:H})=>new Promise((async(J,Z)=>{var Be;if(!o||!l)return qe(ne,"signMessage","onError",Se.MUST_BE_AUTHENTICATED),void Z(Error("User must be authenticated before signing with a Privy wallet"));let X=H??((Be=Jo(l))==null?void 0:Be.address);if(!X)throw new xe("User must have an embedded wallet to sign a message.");let{signingWallet:Ee,rootWallet:Me}=Vb(l,X);if(!Ee||!Me)return qe(ne,"signMessage","onError",Se.EMBEDDED_WALLET_NOT_FOUND),void Z(Error("Must have a Privy wallet before signing"));if(typeof F!="string"||F.length<1)return qe(ne,"signMessage","onError",Se.INVALID_MESSAGE),void Z(Error("Message must be a non-empty string"));ce(!0);let De=async()=>{if(!o)throw Error("User must be authenticated before signing with a Privy wallet");let Je=await e.getAccessToken();if(!Je)throw Error("User must be authenticated to use their embedded wallet.");let nt=jt.walletProxy??await jt.initializeWalletProxy(15e3);if(!nt)throw Error("Failed to initialize embedded wallet proxy.");if(!await jt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!Me)throw Error("No root wallet for signing wallet found");let{entropyId:et,entropyIdVerifier:Ct}=_n(Me),{response:Nt}=await nt.rpc({accessToken:Je,entropyId:et,entropyIdVerifier:Ct,chainType:"solana",hdWalletIndex:Ee.walletIndex??0,request:{method:"signMessage",params:{message:F}}});return Nt.data.signature};if(Qe({showWalletUIs:void 0}))try{let Je=await De();J({signature:Je})}catch(Je){Z(Je)}else{let{entropyId:Je,entropyIdVerifier:nt}=_n(Me);se({signMessage:{method:"solana_signMessage",data:F,confirmAndSign:De,onSuccess:et=>{J({signature:et})},onFailure:et=>{Z(et)},uiOptions:{}},connectWallet:{entropyId:Je,entropyIdVerifier:nt,onCompleteNavigateTo:de.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:et=>{qe(ne,"signMessage","onError",Se.UNKNOWN_CONNECT_WALLET_ERROR),Z(et)}}}),T(de.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),openPrivyModal:O,connectWallet:pe,initLoginWithWallet:async(F,H,J)=>{el(F)?(Ae.current="siwe",Ie(F,H,J)):(Ae.current="siws",je(F,H))},loginWithWallet:async()=>{let F,H,J;if(!s)throw new xd;if(e.authFlow instanceof Kv?F="siwe":e.authFlow instanceof Z9&&(F="siws"),!F)throw new xe("Must initialize SIWE/SIWS flow first.");if(await e.getAccessToken()!==null)try{({user:H}=await e.link()),Ae.current=F}catch(Z){throw qe(ne,"linkAccount","onError",Z.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:F}),Z}else try{({user:H,isNewUser:J}=await e.authenticate()),Ae.current=F}catch(Z){throw qe(ne,"login","onError",Z.privyErrorCode||Se.GENERIC_CONNECT_WALLET_ERROR),Z}u(H||l||null),v(J||!1),c(!0)},delegateWallet:async({address:F,chainType:H})=>new Promise((async(J,Z)=>{let X=await Nr();if(!o||!l||!X)throw new xe("User must be authenticated and have an embedded wallet to delegate actions.");if(H!=="solana"&&H!=="ethereum")throw new xe("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let Ee=jt.walletProxy??await jt.initializeWalletProxy(15e3);if(!Ee)throw new xe("Wallet proxy not initialized.");
713if(vJe({address:F,chainType:H,user:l}))return J();let Me=yJe({address:F,user:l}),De=bJe({address:F,user:l});await jt.recoverPrimaryWallet(),se({delegatedActions:{consent:{address:F,onDelegate:async()=>{await Ee.createDelegatedAction({accessToken:X,rootWallet:De,delegatedWallets:[Me]}),await jt.refreshUser()},onSuccess:async()=>{J()},onError:async Be=>{Z(Be)}}}}),O(de.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN)})),revokeDelegatedWallets:async()=>new Promise((async(F,H)=>{if(!o||!l)throw new xe("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");if(vre(l).length===0)throw new xe("User has no delegated wallets to revoke.");se({delegatedActions:{revoke:{onRevoke:async()=>{await e.revokeDelegatedWallet(),await jt.refreshUser()},onSuccess:async()=>{F()},onError:async J=>{H(J)}}}}),O(de.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN)})),initLoginWithFarcaster:async(F,H)=>{let J=new JP(F,H);e.startAuthFlow(J);try{Ae.current="farcaster",await J.initializeFarcasterConnect()}catch(Z){throw Ue.current==="login"?qe(ne,"login","onError",Z.privyErrorCode||Se.UNKNOWN_AUTH_ERROR):Ue.current==="link"&&qe(ne,"linkAccount","onError",Z.privyErrorCode||Se.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),Z}},loginWithFarcaster:async()=>{let F,H;if(!s)throw new xd;if(!(e.authFlow instanceof JP))throw new xe("Must initialize Farcaster flow first.");if(await e.getAccessToken()!==null)try{({user:F}=await e.link()),Ae.current="farcaster"}catch(J){throw qe(ne,"linkAccount","onError",J.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),J}else try{({user:F,isNewUser:H}=await e.authenticate()),Ae.current="farcaster"}catch(J){throw qe(ne,"login","onError",J.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),J}u(F||null),v(H||!1),c(!0)},async loginWithGuestAccountFlow(){let F=new dK(this.appId);e.startAuthFlow(F);try{Ue.current="login",Ae.current="guest";let{user:H,isNewUser:J}=await e.authenticate();if(J=J||!1,!H)throw new xe("Unable to authenticate guest account");if(Sl(H,K.embeddedWallets.createOnLogin))try{await ir(H,15e3),H=await jt.refreshUser()}catch{u(H),console.warn("Unable to create embedded wallet for guest account")}else u(H);return v(J),c(!0),qe(ne,"login","onComplete",H,J,!1,"guest",null),H}catch(H){throw qe(ne,"login","onError",H.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),H}},async crossAppAuthFlow({appId:F,popup:H,action:J}){let Z=`privy:${F}`;Ae.current=Z;let{url:X,stateCode:Ee,codeVerifier:Me}=await xJe({api:e.api,appId:F});if(!X)throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:F}}),new xe("No authorization URL returned for cross-app auth.");try{let De=await CJe({url:X,popup:H,provider:Z}),Be=De.stateCode,Je=De.authorizationCode;if(Be!==Ee)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:Z,storedStateCode:Ee??"",returnedStateCode:Be??""}}),new xe("Unexpected auth flow. This may be a phishing attempt.",void 0,Se.OAUTH_UNEXPECTED);let nt=await _Je({appId:F,codeVerifier:Me,stateCode:Be,authorizationCode:Je,action:J,client:e});nt&&e.storeProviderAccessToken(F,nt);let et=await jt.refreshUser();if(!et)throw new xe("Unable to update user");return e.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:F}}),et}catch(De){throw e.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:De.toString(),provider:Z}}),De}},async initLoginWithOAuth(F,H,J){if(Ae.current=F,!q9()||F==="google"&&p7(window.navigator.userAgent))return void T(de.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);F==="twitter"&&window.opener&&window.opener.postMessage({type:xre},"*"),Ut.del(Hv),Ut.del(Gv);let Z=new Bh({provider:F,disableSignup:!!J,withPrivyUi:!0});H&&Z.addCaptchaToken(H),e.startAuthFlow(Z);let X=await e.authFlow.getAuthorizationUrl();X&&X.url&&(F==="twitter"&&An.isAndroid&&(X.url=X.url.replace("x.com","twitter.com")),window.location.assign(X.url))},async initLoginWithTelegram(F,H){if(!s)throw new xd;Ae.current="telegram";let J=new hg(F,H);e.startAuthFlow(J),J.meta.telegramWebAppData=void 0,J.meta.telegramAuthResult=await new Promise(((Z,X)=>K.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:K.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(Ee=>Ee?Z(Ee):X(new xe("Telegram auth failed or was canceled by the client")))):X(new xe("Telegram was not initialized")):X(new xe("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(F){var Z;let H,J;if(!(e.authFlow instanceof hg))throw new xe("Must initialize Telegram flow before calling loginWithTelegram");if((Z=e.authFlow.meta).captchaToken||(Z.captchaToken=F),Ue.current==="login")try{let X=await e.authenticate();H=X.user,J=X.isNewUser,Ae.current="telegram"}catch(X){throw qe(ne,"login","onError",X.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),X}else{if(Ue.current!=="link")throw new xe("Unknown auth intent");try{H=(await e.link()).user,Ae.current="telegram"}catch(X){throw qe(ne,"linkAccount","onError",X.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),X}}u(H),v(J||!1),c(!0)},async recoveryOAuthFlow(F,H,J){var Me,De;let Z,X;function Ee(Be){if(!Be)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:F}}),new xe("Recovery OAuth failed")}switch(F){case"google-drive":{let Be,Je,{url:nt,codeVerifier:et,stateCode:Ct}=await jL({api:cl.api,provider:F});Ee(nt);try{let Nt=await RU({url:nt,popup:J,provider:F});if(Be=Nt.stateCode,Je=Nt.authorizationCode,Be!==Ct)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:F,storedStateCode:Ct??"",returnedStateCode:Be??""}}),new xe("Unexpected auth flow. This may be a phishing attempt.",void 0,Se.OAUTH_UNEXPECTED)}catch(Nt){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:Nt.toString(),provider:F}}),new xe("Recovery OAuth failed")}[Z,X]=await Promise.all([Nr(),iBe({api:cl.api,provider:F,codeVerifier:et,stateCode:Be,authorizationCode:Je})]);break}case"icloud":{let{url:Be}=await jL({api:cl.api,provider:F});Ee(Be);let{ckWebAuthToken:Je}=await RU({url:Be,popup:J,provider:F});X=Je,Z=await Nr()}}if(!V)throw new xe("Cannot connect to wallet proxy");if(!Z)throw new xe("Unable to authorize user");
713switch(H){case"recover":{let Be=(Me=Q.recoverWallet)==null?void 0:Me.entropyId,Je=(De=Q.recoverWallet)==null?void 0:De.entropyIdVerifier;if(!Be||!Je)throw new xe("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:Be,recoveryMethod:F}}),await V.recover({accessToken:Z,entropyId:Be,entropyIdVerifier:Je,recoveryAccessToken:X}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:Be,recoveryMethod:F}});break}case"create-wallet":{e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await V.create({accessToken:Z,recoveryAccessToken:X,recoveryMethod:F});let Be=Is(await jt.refreshUser());if(!Be)throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Be.address}}),qe(ne,"createWallet","onSuccess",Be);break}case"set-recovery":{let Be=Ts(l);if(!Be)throw qe(ne,"setWalletRecovery","onError",Se.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:Be.address,existingRecoveryMethod:Be.recoveryMethod,targetRecoveryMethod:F}});let{entropyId:Je,entropyIdVerifier:nt}=_n(Be);await V.setRecovery({accessToken:Z,entropyId:Je,entropyIdVerifier:nt,recoveryMethod:F,recoveryAccessToken:X});let et=Ts(await jt.refreshUser());if(!et)throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:Be.address,existingRecoveryMethod:Be.recoveryMethod,targetRecoveryMethod:F}}),qe(ne,"setWalletRecovery","onSuccess",F,et);break}default:throw new xe("Unsupported recovery action")}},async loginWithOAuth(F){let H,J,Z;if(!(e.authFlow instanceof Bh))throw new xe("Must initialize OAuth flow before calling loginWithOAuth");let X=Ut.get(Vv),Ee=e.authFlow.meta.stateCode;if(X!==Ee)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:F,storedStateCode:X??"",returnedStateCode:Ee??""}}),new xe("Unexpected auth flow. This may be a phishing attempt.",void 0,Se.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{let Me=await e.link();H=Me.user,Z=Me.oAuthTokens,Ae.current=F}catch(Me){throw qe(ne,"linkAccount","onError",Me.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:F}),Me}else try{let Me=await e.authenticate();H=Me.user,J=Me.isNewUser,Z=Me.oAuthTokens,Ae.current=F}catch(Me){throw Ue.current==="login"?qe(ne,"login","onError",Me.privyErrorCode||Se.UNKNOWN_AUTH_ERROR):Ue.current==="link"&&qe(ne,"linkAccount","onError",Me.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:F}),Me}return u(H),v(J||!1),c(!0),Z&&H&&qe(ne,"oAuthAuthorization","onOAuthTokenGrant",Z,{user:H}),Z},passkeyAuthState:$,setPasskeyAuthState:P,async initSignupWithPasskey({captchaToken:F,withPrivyUi:H}){let J=new Ah({captchaToken:F,setPasskeyAuthState:P});e.startAuthFlow(J),Ue.current="login";try{Ae.current="passkey",P({status:"generating-challenge"}),await J.initRegisterFlow(H),P({status:"awaiting-passkey"})}catch(Z){throw P({status:"error",error:Z}),qe(ne,"login","onError",Z.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),Z}},async signupWithPasskey(){let F,H;if(!s)throw new xd;if(!(e.authFlow instanceof Ah))throw new xe("Must initialize Passkey flow first.");if(Ae.current!=="passkey"){let X=new xe("Must init login with Passkey flow first.");throw P({status:"error",error:X}),X}let J=await Nr();try{Ae.current="passkey",P({status:"awaiting-passkey"}),{user:F,isNewUser:H}=await e.authenticate()}catch(X){throw P({status:"error",error:X}),qe(ne,"login","onError",X.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),X}u(F),v(H||!1),c(!0),P({status:"done"});let Z=(F==null?void 0:F.linkedAccounts.find((({type:X})=>X==="passkey")))||null;return{user:F,isNewUser:H||!1,wasAlreadyAuthenticated:!!J,loginAccount:Z}},async initLoginWithPasskey({captchaToken:F,withPrivyUi:H}
713){let J=new Ah({captchaToken:F,setPasskeyAuthState:P});e.startAuthFlow(J),Ue.current="login";try{Ae.current="passkey",P({status:"generating-challenge"}),await J.initAuthenticationFlow(H),P({status:"awaiting-passkey"})}catch(Z){throw P({status:"error",error:Z}),qe(ne,"login","onError",Z.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),Z}},async loginWithPasskey(){let F,H;if(!s)throw new xd;if(!(e.authFlow instanceof Ah))throw new xe("Must initialize Passkey flow first.");if(Ae.current!=="passkey"){let X=new xe("Must init login with Passkey flow first.");throw P({status:"error",error:X}),X}let J=await Nr();try{Ae.current="passkey",P({status:"awaiting-passkey"}),{user:F,isNewUser:H}=await e.authenticate()}catch(X){throw P({status:"error",error:X}),qe(ne,"login","onError",X.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),X}u(F),v(H||!1),c(!0),P({status:"done"});let Z=(F==null?void 0:F.linkedAccounts.find((({type:X})=>X==="passkey")))||null;return{user:F,isNewUser:H||!1,wasAlreadyAuthenticated:!!J,loginAccount:Z}},async initLinkWithPasskey(F){let H=new Ah({captchaToken:F});e.startAuthFlow(H),Ue.current="link",Ae.current="passkey",P({status:"generating-challenge"});try{await H.initLinkFlow(),P({status:"awaiting-passkey"})}catch(J){throw qe(ne,"linkAccount","onError",J.privyErrorCode||Se.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),P({status:"error",error:J}),J}},async linkWithPasskey(){let F;if(!s)throw new xd;if(!(e.authFlow instanceof Ah))throw new xe("Must initialize Passkey flow first.");if(Ae.current!=="passkey")throw new xe("Must init login with Passkey flow first.");try{Ae.current="passkey",{user:F}=await e.link()}catch(H){throw qe(ne,"linkAccount","onError",H.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),H}return u(F||l||null),P({status:"done"}),F},async initLoginWithHeadlessOAuth(F,H,J){if(!q9()||F==="google"&&p7(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let Z=new Bh({provider:F,withPrivyUi:!1,disableSignup:J??!1});H&&Z.addCaptchaToken(H),W({status:"loading"});let X=await e.startAuthFlow(Z).getAuthorizationUrl();X!=null&&X.url&&window.location.assign(X.url)},async loginWithHeadlessOAuth(F){let H,J,Z;S(!0),W({status:"loading"}),e.startAuthFlow(new Bh(F));let X=Ut.get(Vv),Ee=F.stateCode;if(X!==Ee)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:F.provider,storedStateCode:X??"",returnedStateCode:Ee??""}}),S(!1),new xe("Unexpected auth flow. This may be a phishing attempt.",void 0,Se.OAUTH_UNEXPECTED);if(await e.getAccessToken()!==null)try{({user:H,oAuthTokens:Z}=await e.link()),Ae.current=F.provider;let Me=ti(H);H&&Me&&qe(ne,"linkAccount","onSuccess",H,Ae.current,Me)}catch(Me){throw S(!1),qe(ne,"linkAccount","onError",Me.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:F.provider}),Me}else try{({user:H,isNewUser:J,oAuthTokens:Z}=await e.authenticate()),Ae.current=F.provider;let Me=ti(H);H&&Me&&J!==void 0&&qe(ne,"login","onComplete",H,J,!1,Ae.current,Me)}catch(Me){throw S(!1),W({status:"error",error:Me}),qe(ne,"login","onError",Me.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),Me}return u(H),v(J||!1),c(!0),S(!1),W({status:"done"}),Z&&H&&qe(ne,"oAuthAuthorization","onOAuthTokenGrant",Z,{user:H}),H??void 0},initLoginWithEmail:async({email:F,captchaToken:H,disableSignup:J,withPrivyUi:Z})=>{let X=new ep({email:F,captchaToken:H,disableSignup:J});e.startAuthFlow(X);try{Ae.current="email",L({status:"sending-code"}),await X.sendCodeEmail({withPrivyUi:Z}),L({status:"awaiting-code-input"})}catch(Ee){throw L({status:"error",error:Ee}),Ue.current==="login"?qe(ne,"login","onError",Ee.privyErrorCode||Se.UNKNOWN_AUTH_ERROR):Ue.current==="link"&&qe(ne,"linkAccount","onError",Ee.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),Ee}},initUpdateEmail:async(F,H,J)=>{let Z=new S8e(F,H,J);e.startAuthFlow(Z);try{await Z.sendCodeEmail({withPrivyUi:!0})}catch(X){qe(ne,"update","onError",X.privyErrorCode||Se.UNKNOWN_AUTH_ERROR,{linkMethod:Ae.current})}},initUpdatePhone:async(F,H,J)=>{let Z=new Z8e(F,H,J);e.startAuthFlow(Z);try{await Z.sendSmsCode({withPrivyUi:!0})}catch(X){qe(ne,"update","onError",X.privyErrorCode||Se.UNKNOWN_AUTH_ERROR,{linkMethod:Ae.current})}},initLoginWithSms:async({phoneNumber:F,captchaToken:H,disableSignup:J,withPrivyUi:Z})=>{k({status:"sending-code"});let X=new tp({phoneNumber:F,captchaToken:H,disableSignup:J});e.startAuthFlow(X);try{Ae.current="sms",await X.sendSmsCode({withPrivyUi:Z}),k({status:"awaiting-code-input"})}catch(Ee){throw k({status:"error",error:Ee}),Ue.current==="login"?qe(ne,"login","onError",Ee.privyErrorCode||Se.UNKNOWN_AUTH_ERROR):Ue.current==="link"&&qe(ne,"linkAccount","onError",Ee.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),Ee}},resendEmailCode:async()=>{var F;await((F=e.authFlow)==null?void 0:F.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{var F;await((F=e.authFlow)==null?void 0:F.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async F=>{let H,J;function Z(De){e.authFlow instanceof ep?L(De):e.authFlow instanceof tp&&k(De)}if(Z({status:"submitting-code"}),!s){let De=new xd;throw Z({status:"error",error:De}),De}if(e.authFlow instanceof ep)e.authFlow.meta.emailCode=F.trim();else{if(!(e.authFlow instanceof tp)){let De=new xe("Must initialize a passwordless code flow first");throw Z({status:"error",error:De}),De}e.authFlow.meta.smsCode=F.trim()}let X=await Nr();if(Ue.current==="link")try{({user:H}=await e.link())}catch(De){throw Z({status:"error",error:De}),qe(ne,"linkAccount","onError",De.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:Ae.current}),De}else if(Ue.current==="update")try{({user:H}=await e.link())}catch(De){throw Z({status:"error",error:De}),qe(ne,"update","onError",De.privyErrorCode||Se.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:Ae.current}),De}else try{({user:H,isNewUser:J}=await e.authenticate())}catch(De){throw Z({status:"error",error:De}),qe(ne,"login","onError",De.privyErrorCode||Se.UNKNOWN_AUTH_ERROR),De}let Ee=H||l;u(Ee||null),v(J||!1),c(!0),Z({status:"done"});let Me=null;return e.authFlow instanceof ep?Me=(Ee==null?void 0:Ee.linkedAccounts.find((({type:De})=>De==="email")))||null:e.authFlow instanceof tp&&(Me=(Ee==null?void 0:Ee.linkedAccounts.find((({type:De})=>De==="phone")))||null),{user:Ee,isNewUser:J||!1,wasAlreadyAuthenticated:!!X,linkedAccount:Me}},generateSiweMessage:async({address:F,chainId:H,captchaToken:J})=>{Ue.current="link",Ae.current="siwe",q({status:"generating-message"});let Z=await e.generateSiweNonce({address:F,captchaToken:J});return q({status:"awaiting-signature"}),Y9({address:F,chainId:H.replace("eip155:",""),nonce:Z})},generateSiweMessageForSmartWallet:async({address:F,chainId:H})=>{let J=await e.generateSiweNonce({address:F});return Y9({address:F,chainId:H.replace("eip155:",""),nonce:J})},linkSmartWallet:async({message:F,signature:H,smartWalletType:J})=>{let Z;Z=await e.linkSmartWallet({message:F,signature:H,smartWalletType:J}),u((Z=await jt.refreshUser()??Z)||l||null)},linkWithSiwe:async({message:F,signature:H,chainId:J,walletClientType:Z,connectorType:X})=>{let Ee;ve("siwe");let Me=null;try{q({status:"submitting-signature"}),Ee=await e.linkWithSiwe({message:F,signature:H,chainId:J,walletClientType:Z,connectorType:X}),Ee=await jt.refreshUser()??Ee,q({status:"done"}),(Me=ti(Ee)||null)&&qe(ne,"linkAccount","onSuccess",Ee,"siwe",Me)}catch(Be){throw qe(ne,"linkAccount","onError",Be.privyErrorCode||Se.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Ue.current=null,Ae.current=null,q({status:"error",error:Be}),Be}let De=Ee||l;return u(De||null),Ue.current=null,Ae.current=null,{user:De,linkedAccount:Me}}
713,refreshUser:async()=>{let F=await e.getAuthenticatedUser();return c(!!F),u(F),F},walletProxy:V,createAnalyticsEvent:({eventName:F,payload:H,timestamp:J})=>e.createAnalyticsEvent({eventName:F,payload:H,timestamp:J}),acceptTerms:async()=>{let F=await e.acceptTerms();return u(F),F},getUsdTokenPrice:F=>e.getUsdTokenPrice(F),getUsdPriceForSol:()=>e.getUsdPriceForSol(),getSplTokenMetadata:F=>e.getSplTokenMetadata(F),recoverPrimaryWallet:async F=>new Promise((async(H,J)=>{let Z=Ts((F==null?void 0:F.user)??l)||X9((F==null?void 0:F.user)??l)||zb((F==null?void 0:F.user)??l),X=await Nr();if(!X||!V||!Z)return void J(Error("Must have valid access token and Privy wallet to recover wallet"));ce(!0);let{entropyId:Ee,entropyIdVerifier:Me}=_n(Z);try{await V.connect({accessToken:X,entropyId:Ee,entropyIdVerifier:Me}),H(!0)}catch(De){xw(De)&&Z.recoveryMethod==="privy"?(e.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:Z.address}}),(await V.recover({entropyId:Ee,entropyIdVerifier:Me,accessToken:X})).entropyId||J(Error("Unable to recover wallet")),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:Z.address}}),H(!0)):xw(De)&&Z.recoveryMethod!=="privy"?(se({recoverWallet:{entropyId:Ee,entropyIdVerifier:Me,onFailure:J,onSuccess:()=>H(!0)},recoveryOAuthStatus:{provider:Z.recoveryMethod,action:"recover"}}),O(yJ(Z.recoveryMethod))):J(De)}})),createEmbeddedSolanaWallet:async F=>{if(F&&"target"in F&&(F=void 0),!o||!l)throw qe(ne,"createWallet","onError",Se.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return(async(H,J,Z)=>{var et;let X=Is(H),Ee=Jo(H),Me=Z&&"createAdditional"in Z&&Z.createAdditional,De=Z&&"walletIndex"in Z?Z.walletIndex:void 0,Be=(((et=rEe(H))==null?void 0:et.walletIndex)??-1)+1;if(Ee&&!Me&&typeof De!="number")throw qe(ne,"createWallet","onError",Se.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");if(typeof De=="number"&&De<0)throw qe(ne,"createWallet","onError",Se.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${De}
713) is invalid.`);let[Je,nt]=await Promise.all([jt.initializeWalletProxy(J),Nr()]);if(!Je||!nt)throw qe(ne,"createWallet","onError",Se.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return await Zt({user:H,wp:Je,accessToken:nt,walletIndex:De??Be,ethereumWallet:X})})(l,15e3,F)},exportSolanaWallet:F=>new Promise((async(H,J)=>{var Be;if(!o||!l)return void J(Error("User must be authenticated before exporting their Privy wallet"));let Z=(F==null?void 0:F.address)??((Be=Jo(l))==null?void 0:Be.address);if(!Z)return void J(Error("User does not have an HD Solana wallet."));let{signingWallet:X,rootWallet:Ee}=Vb(l,Z);if(!X||!Ee)return void J(Error("Must have a Privy wallet before exporting"));if(ce(!0),!await Nr()||!V)return void J(Error("Must have valid access token to enroll in MFA"));if(!V)return void J(Error("Must have a Privy wallet before exporting"));let{entropyId:Me,entropyIdVerifier:De}=_n(Ee);se({connectWallet:{entropyId:Me,entropyIdVerifier:De,onCompleteNavigateTo:de.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:J,shouldForceMFA:!0},keyExport:{appId:t.appId,appClientId:t.clientId,origin:e.apiUrl,walletToExport:X,primaryWallet:Ee,onSuccess:H,onFailure:J}}),O(de.EMBEDDED_WALLET_CONNECTING_SCREEN)})),setReadyToTrue:F=>{a(!0),me==null||me(F)},updateWallets:()=>$t(),fundWallet:async(F,H)=>{let J=de.FUNDING_METHOD_SELECTION_SCREEN;se({funding:NU({address:F,appConfig:K,fundWalletConfig:H,methodScreen:J})}),O(J)},openModal:O,requestFarcasterSignerStatus:async F=>{var X;let H=await Nr(),J=l==null?void 0:l.linkedAccounts.find((Ee=>Ee.type==="wallet"&&Ee.walletClientType==="privy"));if(!H)throw Error("Must have valid access token to connect with Farcaster");if(!V||!J)throw Error("Must have an embedded wallet to use Farcaster signers");if(!((X=l==null?void 0:l.farcaster)!=null&&X.fid))throw Error("Must have Farcaster account to use Farcaster signers");let Z=await e.requestFarcasterSignerStatus(F);return Z.status==="approved"&&u(await e.getAuthenticatedUser()||l||null),Z},connectCoinbaseSmartWallet:async()=>{var H,J;K.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let F=((H=e.connectors)==null?void 0:H.findWalletConnector("coinbase_wallet","coinbase_smart_wallet"))||((J=e.connectors)==null?void 0:J.findWalletConnector("coinbase_wallet","coinbase_wallet"));if(F)return F.updateConnectionPreference("smartWalletOnly"),pe(F);await ue("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:F,account:H,accountType:J,externalWalletMetadata:Z,telegramAuthResult:X,telegramWebAppData:Ee,farcasterEmbeddedAddress:Me,oAuthUserInfo:De})=>{let Be=await e.sendAccountTransferRequest({nonce:F,account:H,accountType:J,externalWalletMetadata:Z,telegramAuthResult:X,telegramWebAppData:Ee,farcasterEmbeddedAddress:Me,oAuthUserInfo:De});return u(Be),Be}};kre=jt.recoverPrimaryWallet,$re=jt.recoverPrimaryWallet,Nre=jt.solanaSignMessage;let Wa=C.useMemo((()=>({wallets:d,ready:M&&Re})),[d,M,Re]),$e=e.authFlow instanceof hg,We=!K.headless&&K.captchaEnabled&&!o&&(s||$e);return p.jsx(Ly.Provider,{value:Wi,children:p.jsx(RQ.Provider,{value:ne,children:p.jsx(jJ.Provider,{value:Wa,children:p.jsx(X8e,{...K,children:p.jsxs(PQ.Provider,{value:jt,children:[p.jsx(Z7e,{children:p.jsxs(f9e,{data:Q,setModalData:se,setInitialScreen:x,initialScreen:w,authenticated:o,open:n,children:[t.children,We&&p.jsx(E_e,{delayedExecution:!1}),p.jsx(QXe,{theme:{...K.appearance.palette||{}}}),!K.render.standalone&&p.jsx(sJe,{open:n})]})}),ae&&ge?p.jsx(mJe,{appId:t.appId,appClientId:t.clientId,clientAnalyticsId:e.clientAnalyticsId,origin:e.apiUrl,mfaMethods:l==null?void 0:l.mfaMethods,mfaPromise:we,mfaSubmitPromise:Ce,onLoad:Y,onLoadFailed:()=>null}):null,K.loginConfig.telegramAuthConfiguration&&p.jsx(Df,{$if:!0,children:p.jsx(oJe,{scriptHost:t.apiUrl||H9,botUsername:K.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};const det="/assets/new_message-CtOLJ-sq.mp3",fet=t=>t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ");var het={VITE_APP_GET_STREAM_API_KEY:"twfjd2y6asta"};const pet=C.createContext({client:void 0,unreadPendingCount:0,unreadPendingOrders:[],setTotalUnreadCount:()=>{}}),get=({children:t})=>{const[e,r]=C.useState(),[n,i]=C.useState(0),[s,a]=C.useState([]),o=C.useMemo(()=>new Audio(det),[]),{t:c}=pB(),{user:l}=r3(),u=het.VITE_APP_GET_STREAM_API_KEY,d=Mq(),f=gB(),h=()=>{o.autoplay=!0,o.play().catch(g=>{o.play(),console.error("Audio playback failed:",g)})};return C.useEffect(()=>((async()=>{const m=async()=>{const y=await dp.getPendingMessage();i(y.unreadPending),a(y.data)};try{const y=l?l._id:"",{token:b}=await dp.getChatToken(),E=dne.getInstance(u),v={type:"messaging",members:{$in:[y]}},w={last_message_at:-1};await Promise.all([E.connectUser({id:y},b),E.queryChannels(v,w,{watch:!0})]),r(E),m();const x=await dp.getUserChat(),_=await E.queryUsers({id:{$in:x}}),S=async()=>{var A;
713m(),d(hk((A=E.user)==null?void 0:A.total_unread_count))};E.on("message.read",S),E.on("message.new",async A=>{var L,B,k,D,q,U;const I=window.location.pathname,$=/p2p\/orders\/.+$/.test(I),P=((B=(L=A==null?void 0:A.message)==null?void 0:L.user)==null?void 0:B.id)!==y,j=fet(((q=(D=(k=A==null?void 0:A.message)==null?void 0:k.user)==null?void 0:D.name)==null?void 0:q.split("_").join(" "))||"");P&&!$&&(h(),sv.info(`${j} ${c("toast.hasSent")}: ${(U=A==null?void 0:A.message)==null?void 0:U.text}`,{position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,progress:void 0,theme:"light",onClick:()=>{f("/p2p/orders")}})),await m(),d(hk(A.unread_count))}),d(xae(_.users))}catch(y){console.error("Error initializing chat client:",y)}})(),()=>{e==null||e.disconnectUser()}),[u,l==null?void 0:l._id]),p.jsx(pet.Provider,{value:{client:e,unreadPendingCount:n,unreadPendingOrders:s,setTotalUnreadCount:i},children:t})},met=["/","/wallet","/trade","/whale/661f51d5aaeae9d2f951e562","/whale/66264b3ff65dcbaa2bbcd1c4"];function yet(){const t=hS(),e=mB(),r=Mq();return C.useEffect(()=>{r(g_())},[]),C.useEffect(()=>{if(!t||!met.includes(e.pathname))return;const n=setInterval(()=>{r(g_())},6e4);return()=>{clearInterval(n)}},[t,e.pathname]),null}var G5=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sf,Cu,Ip,nB,bet=(nB=class extends G5{constructor(){super();Ir(this,sf);Ir(this,Cu);Ir(this,Ip);sr(this,Ip,e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){ze(this,Cu)||this.setEventListener(ze(this,Ip))}onUnsubscribe(){var e;this.hasListeners()||((e=ze(this,Cu))==null||e.call(this),sr(this,Cu,void 0))}setEventListener(e){var r;sr(this,Ip,e),(r=ze(this,Cu))==null||r.call(this),sr(this,Cu,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){ze(this,sf)!==e&&(sr(this,sf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof ze(this,sf)=="boolean"?ze(this,sf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},sf=new WeakMap,Cu=new WeakMap,Ip=new WeakMap,nB),Pre=new bet,vet={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Su,xC,iB,wet=(iB=class{constructor(){Ir(this,Su,vet);Ir(this,xC,!1)}setTimeoutProvider(t){sr(this,Su,t)}setTimeout(t,e){return ze(this,Su).setTimeout(t,e)}clearTimeout(t){ze(this,Su).clearTimeout(t)}setInterval(t,e){return ze(this,Su).setInterval(t,e)}clearInterval(t){ze(this,Su).clearInterval(t)}},Su=new WeakMap,xC=new WeakMap,iB),mC=new wet;function Eet(t){setTimeout(t,0)}var xet=typeof window>"u"||"Deno"in globalThis;function oo(){}function _et(t,e){return typeof t=="function"?t(e):t}function Cet(t){return typeof t=="number"&&t>=0&&t!==1/0}function Aet(t,e){return Math.max(t+(e||0)-Date.now(),0)}function yC(t,e){return typeof t=="function"?t(e):t}function Tet(t,e){return typeof t=="function"?t(e):t}function UU(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=t;if(a){if(n){if(e.queryHash!==xI(a,e.options))return!1}else if(!Jm(e.queryKey,a))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||i&&i!==e.state.fetchStatus||s&&!s(e))}function BU(t,e){const{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(Xm(e.options.mutationKey)!==Xm(s))return!1}else if(!Jm(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function xI(t,e){return((e==null?void 0:e.queryKeyHashFn)||Xm)(t)}function Xm(t){return JSON.stringify(t,(e,r)=>bC(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Jm(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>Jm(t[r],e[r])):!1}var Iet=Object.prototype.hasOwnProperty;function Ore(t,e,r=0){if(t===e)return t;if(r>500)return e;const n=qU(t)&&qU(e);if(!n&&!(bC(t)&&bC(e)))return e;const s=(n?t:Object.keys(t)).length,a=n?e:Object.keys(e),o=a.length,c=n?new Array(o):{};let l=0;for(let u=0;u<o;u++){const d=n?u:a[u],f=t[d],h=e[d];if(f===h){c[d]=f,(n?u<s:Iet.call(t,d))&&l++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){c[d]=h;continue}const g=Ore(f,h,r+1);c[d]=g,g===f&&l++}return s===o&&l===s?t:c}function qU(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function bC(t){if(!WU(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!WU(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function WU(t){return Object.prototype.toString.call(t)==="[object Object]"}function ket(t){return new Promise(e=>{mC.setTimeout(e,t)})}function $et(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Ore(t,e):e}function Net(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Pet(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var _I=Symbol();function Rre(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===_I?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Oet(t,e,r){let n=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),t}var Dre=(()=>{let t=()=>xet;return{isServer(){return t()},setIsServer(e){t=e}}})();function Ret(){let t,e;const r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}var Det=Eet;function Met(){let t=[],e=0,r=o=>{o()},n=o=>{o()},i=Det;const s=o=>{e?t.push(o):i(()=>{r(o)})},a=()=>{const o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(c=>{r(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{s(()=>{o(...c)})},schedule:s,setNotifyFunction:o=>{r=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var ds=Met(),kp,Au,$p,sB,jet=(sB=class extends G5{constructor(){super();Ir(this,kp,!0);Ir(this,Au);Ir(this,$p);sr(this,$p,e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n
713)}}})}onSubscribe(){ze(this,Au)||this.setEventListener(ze(this,$p))}onUnsubscribe(){var e;this.hasListeners()||((e=ze(this,Au))==null||e.call(this),sr(this,Au,void 0))}setEventListener(e){var r;sr(this,$p,e),(r=ze(this,Au))==null||r.call(this),sr(this,Au,e(this.setOnline.bind(this)))}setOnline(e){ze(this,kp)!==e&&(sr(this,kp,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return ze(this,kp)}},kp=new WeakMap,Au=new WeakMap,$p=new WeakMap,sB),Ow=new jet;function Let(t){return Math.min(1e3*2**t,3e4)}function Mre(t){return(t??"online")==="online"?Ow.isOnline():!0}var vC=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function jre(t){let e=!1,r=0,n;const i=Ret(),s=()=>i.status!=="pending",a=m=>{var y;if(!s()){const b=new vC(m);f(b),(y=t.onCancel)==null||y.call(t,b)}},o=()=>{e=!0},c=()=>{e=!1},l=()=>Pre.isFocused()&&(t.networkMode==="always"||Ow.isOnline())&&t.canRun(),u=()=>Mre(t.networkMode)&&t.canRun(),d=m=>{s()||(n==null||n(),i.resolve(m))},f=m=>{s()||(n==null||n(),i.reject(m))},h=()=>new Promise(m=>{var y;n=b=>{(s()||l())&&m(b)},(y=t.onPause)==null||y.call(t)}).then(()=>{var m;n=void 0,s()||(m=t.onContinue)==null||m.call(t)}),g=()=>{if(s())return;let m;const y=r===0?t.initialPromise:void 0;try{m=y??t.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{var _;if(s())return;const E=t.retry??(Dre.isServer()?0:3),v=t.retryDelay??Let,w=typeof v=="function"?v(r,b):v,x=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,b);if(e||!x){f(b);return}r++,(_=t.onFail)==null||_.call(t,r,b),ket(w).then(()=>l()?void 0:h()).then(()=>{e?f(b):g()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(n==null||n(),i),cancelRetry:o,continueRetry:c,canStart:u,start:()=>(u()?g():h().then(g),i)}}var af,aB,Lre=(aB=class{constructor(){Ir(this,af)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cet(this.gcTime)&&sr(this,af,mC.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Dre.isServer()?1/0:300*1e3))}clearGcTimeout(){ze(this,af)&&(mC.clearTimeout(ze(this,af)),sr(this,af,void 0))}},af=new WeakMap,aB),of,Np,Ta,cf,gi,ty,lf,ra,Fre,Kc,oB,Fet=(oB=class extends Lre{constructor(e){super();Ir(this,ra);Ir(this,of);Ir(this,Np);Ir(this,Ta);Ir(this,cf);Ir(this,gi);Ir(this,ty);Ir(this,lf);sr(this,lf,!1),sr(this,ty,e.defaultOptions),this.setOptions(e.options),this.observers=[],sr(this,cf,e.client),sr(this,Ta,ze(this,cf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,sr(this,of,VU(this.options)),this.state=e.state??ze(this,of),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=ze(this,gi))==null?void 0:e.promise}setOptions(e){if(this.options={...ze(this,ty),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=VU(this.options);r.data!==void 0&&(this.setState(zU(r.data,r.dataUpdatedAt)),sr(this,of,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ze(this,Ta).remove(this)}setData(e,r){const n=$et(this.state.data,e,this.options);return Ni(this,ra,Kc).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){Ni(this,ra,Kc).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,i;const r=(n=ze(this,gi))==null?void 0:n.promise;return(i=ze(this,gi))==null||i.cancel(e),r?r.then(oo).catch(oo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return ze(this,of)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Tet(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_I||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>yC(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Aet(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=ze(this,gi))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=ze(this,gi))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),ze(this,Ta).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(ze(this,gi)&&(ze(this,lf)||Ni(this,ra,Fre).call(this)?ze(this,gi).cancel({revert:!0}):ze(this,gi).cancelRetry()),this.scheduleGc()),ze(this,Ta).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ni(this,ra,Kc).call(this,{type:"invalidate"})}async fetch(e,r){var c,l,u,d,f,h,g,m,y,b,E,v;if(this.state.fetchStatus!=="idle"&&((c=ze(this,gi))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(ze(this,gi))return ze(this,gi).continueRetry(),ze(this,gi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const w=this.observers.find(x=>x.options.queryFn);w&&this.setOptions(w.options)}const n=new AbortController,i=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(sr(this,lf,!0),n.signal)}
713)},s=()=>{const w=Rre(this.options,r),_=(()=>{const S={client:ze(this,cf),queryKey:this.queryKey,meta:this.meta};return i(S),S})();return sr(this,lf,!1),this.options.persister?this.options.persister(w,_,this):w(_)},o=(()=>{const w={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:ze(this,cf),state:this.state,fetchFn:s};return i(w),w})();(l=this.options.behavior)==null||l.onFetch(o,this),sr(this,Np,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&Ni(this,ra,Kc).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta}),sr(this,gi,jre({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,onCancel:w=>{w instanceof vC&&w.revert&&this.setState({...ze(this,Np),fetchStatus:"idle"}),n.abort()},onFail:(w,x)=>{Ni(this,ra,Kc).call(this,{type:"failed",failureCount:w,error:x})},onPause:()=>{Ni(this,ra,Kc).call(this,{type:"pause"})},onContinue:()=>{Ni(this,ra,Kc).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const w=await ze(this,gi).start();if(w===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(w),(h=(f=ze(this,Ta).config).onSuccess)==null||h.call(f,w,this),(m=(g=ze(this,Ta).config).onSettled)==null||m.call(g,w,this.state.error,this),w}catch(w){if(w instanceof vC){if(w.silent)return ze(this,gi).promise;if(w.revert){if(this.state.data===void 0)throw w;return this.state.data}}throw Ni(this,ra,Kc).call(this,{type:"error",error:w}),(b=(y=ze(this,Ta).config).onError)==null||b.call(y,w,this),(v=(E=ze(this,Ta).config).onSettled)==null||v.call(E,this.state.data,w,this),w}finally{this.scheduleGc()}}},of=new WeakMap,Np=new WeakMap,Ta=new WeakMap,cf=new WeakMap,gi=new WeakMap,ty=new WeakMap,lf=new WeakMap,ra=new WeakSet,Fre=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Kc=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Uet(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...zU(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return sr(this,Np,e.manual?i:void 0),i;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),ds.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),ze(this,Ta).notify({query:this,type:"updated",action:e})})},oB);function Uet(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mre(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function zU(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function VU(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function HU(t){return{onFetch:(e,r)=>{var u,d,f,h,g;const n=e.options,i=(f=(d=(u=e.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((h=e.state.data)==null?void 0:h.pages)||[],a=((g=e.state.data)==null?void 0:g.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const l=async()=>{let m=!1;const y=v=>{Oet(v,()=>e.signal,()=>m=!0)},b=Rre(e.options,e.fetchOptions),E=async(v,w,x)=>{if(m)return Promise.reject();if(w==null&&v.pages.length)return Promise.resolve(v);const S=(()=>{const P={client:e.client,queryKey:e.queryKey,pageParam:w,direction:x?"backward":"forward",meta:e.options.meta};return y(P),P})(),A=await b(S),{maxPages:I}=e.options,$=x?Pet:Net;return{pages:$(v.pages,A,I),pageParams:$(v.pageParams,w,I)}};if(i&&s.length){const v=i==="backward",w=v?Bet:GU,x={pages:s,pageParams:a},_=w(n,x);o=await E(x,_,v)}else{const v=t??s.length;do{const w=c===0?a[0]??n.initialPageParam:GU(n,o);if(c>0&&w==null)break;o=await E(o,w),c++}while(c<v)}return o};e.options.persister?e.fetchFn=()=>{var m,y;return(y=(m=e.options).persister)==null?void 0:y.call(m,l,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=l}}}function GU(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>
vendor: 5,208 bytes, line 713
7130?t.getNextPageParam(e[n],e,r[n],r):void 0}function Bet(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var ry,Qo,Qi,uf,Yo,cu,cB,qet=(cB=class extends Lre{constructor(e){super();Ir(this,Yo);Ir(this,ry);Ir(this,Qo);Ir(this,Qi);Ir(this,uf);sr(this,ry,e.client),this.mutationId=e.mutationId,sr(this,Qi,e.mutationCache),sr(this,Qo,[]),this.state=e.state||Wet(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){ze(this,Qo).includes(e)||(ze(this,Qo).push(e),this.clearGcTimeout(),ze(this,Qi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){sr(this,Qo,ze(this,Qo).filter(r=>r!==e)),this.scheduleGc(),ze(this,Qi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){ze(this,Qo).length||(this.state.status==="pending"?this.scheduleGc():ze(this,Qi).remove(this))}continue(){var e;return((e=ze(this,uf))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,o,c,l,u,d,f,h,g,m,y,b,E,v,w,x,_,S;const r=()=>{Ni(this,Yo,cu).call(this,{type:"continue"})},n={client:ze(this,ry),meta:this.options.meta,mutationKey:this.options.mutationKey};sr(this,uf,jre({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(A,I)=>{Ni(this,Yo,cu).call(this,{type:"failed",failureCount:A,error:I})},onPause:()=>{Ni(this,Yo,cu).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ze(this,Qi).canRun(this)}));const i=this.state.status==="pending",s=!ze(this,uf).canStart();try{if(i)r();else{Ni(this,Yo,cu).call(this,{type:"pending",variables:e,isPaused:s}),ze(this,Qi).config.onMutate&&await ze(this,Qi).config.onMutate(e,this,n);const I=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e,n));I!==this.state.context&&Ni(this,Yo,cu).call(this,{type:"pending",context:I,variables:e,isPaused:s})}const A=await ze(this,uf).start();return await((l=(c=ze(this,Qi).config).onSuccess)==null?void 0:l.call(c,A,e,this.state.context,this,n)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,A,e,this.state.context,n)),await((h=(f=ze(this,Qi).config).onSettled)==null?void 0:h.call(f,A,null,this.state.variables,this.state.context,this,n)),await((m=(g=this.options).onSettled)==null?void 0:m.call(g,A,null,e,this.state.context,n)),Ni(this,Yo,cu).call(this,{type:"success",data:A}),A}catch(A){try{await((b=(y=ze(this,Qi).config).onError)==null?void 0:b.call(y,A,e,this.state.context,this,n))}catch(I){Promise.reject(I)}try{await((v=(E=this.options).onError)==null?void 0:v.call(E,A,e,this.state.context,n))}catch(I){Promise.reject(I)}try{await((x=(w=ze(this,Qi).config).onSettled)==null?void 0:x.call(w,void 0,A,this.state.variables,this.state.context,this,n))}catch(I){Promise.reject(I)}try{await((S=(_=this.options).onSettled)==null?void 0:S.call(_,void 0,A,e,this.state.context,n))}catch(I){Promise.reject(I)}throw Ni(this,Yo,cu).call(this,{type:"error",error:A}),A}finally{ze(this,Qi).runNext(this)}}},ry=new WeakMap,Qo=new WeakMap,Qi=new WeakMap,uf=new WeakMap,Yo=new WeakSet,cu=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ds.batch(()=>{ze(this,Qo).forEach(n=>{n.onMutationUpdate(e)}),ze(this,Qi).notify({mutation:this,type:"updated",action:e})})},cB);function Wet(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rl,co,ny,lB,zet=(lB=class extends G5{constructor(e={}){super();Ir(this,rl);Ir(this,co);Ir(this,ny);this.config=e,sr(this,rl,new Set),sr(this,co,new Map),sr(this,ny,0)}build(e,r,n){const i=new qet({client:e,mutationCache:this,mutationId:++p2(this,ny)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){ze(this,rl).add(e);const r=bb(e);if(typeof r=="string"){const n=ze(this,co).get(r);n?n.push(e):ze(this,co).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(ze(this,rl).delete(e)){const r=bb(e);if(typeof r=="string"){const n=ze(this,co).get(r);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&ze(this,co).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=bb(e);if(typeof r=="string"){const n=ze(this,co).get(r),i=n==null?void 0:n.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var n;const r=bb(e);if(typeof r=="string"){const i=(n=ze(this,co).get(r))==null?void 0:n.find(s=>
vendor: 7,283 bytes, line 713
713s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ds.batch(()=>{ze(this,rl).forEach(e=>{this.notify({type:"removed",mutation:e})}),ze(this,rl).clear(),ze(this,co).clear()})}getAll(){return Array.from(ze(this,rl))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>BU(r,n))}findAll(e={}){return this.getAll().filter(r=>BU(e,r))}notify(e){ds.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return ds.batch(()=>Promise.all(e.map(r=>r.continue().catch(oo))))}},rl=new WeakMap,co=new WeakMap,ny=new WeakMap,lB);function bb(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Zo,uB,Vet=(uB=class extends G5{constructor(e={}){super();Ir(this,Zo);this.config=e,sr(this,Zo,new Map)}build(e,r,n){const i=r.queryKey,s=r.queryHash??xI(i,r);let a=this.get(s);return a||(a=new Fet({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(a)),a}add(e){ze(this,Zo).has(e.queryHash)||(ze(this,Zo).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=ze(this,Zo).get(e.queryHash);r&&(e.destroy(),r===e&&ze(this,Zo).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ds.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return ze(this,Zo).get(e)}getAll(){return[...ze(this,Zo).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>UU(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>UU(e,n)):r}notify(e){ds.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){ds.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ds.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Zo=new WeakMap,uB),Pn,Tu,Iu,Pp,Op,ku,Rp,Dp,dB,Het=(dB=class{constructor(t={}){Ir(this,Pn);Ir(this,Tu);Ir(this,Iu);Ir(this,Pp);Ir(this,Op);Ir(this,ku);Ir(this,Rp);Ir(this,Dp);sr(this,Pn,t.queryCache||new Vet),sr(this,Tu,t.mutationCache||new zet),sr(this,Iu,t.defaultOptions||{}),sr(this,Pp,new Map),sr(this,Op,new Map),sr(this,ku,0)}mount(){p2(this,ku)._++,ze(this,ku)===1&&(sr(this,Rp,Pre.subscribe(async t=>{t&&(await this.resumePausedMutations(),ze(this,Pn).onFocus())})),sr(this,Dp,Ow.subscribe(async t=>{t&&(await this.resumePausedMutations(),ze(this,Pn).onOnline())})))}unmount(){var t,e;p2(this,ku)._--,ze(this,ku)===0&&((t=ze(this,Rp))==null||t.call(this),sr(this,Rp,void 0),(e=ze(this,Dp))==null||e.call(this),sr(this,Dp,void 0))}isFetching(t){return ze(this,Pn).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return ze(this,Tu).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=ze(this,Pn).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=ze(this,Pn).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(yC(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return ze(this,Pn).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),i=ze(this,Pn).get(n.queryHash),s=i==null?void 0:i.state.data,a=_et(e,s);if(a!==void 0)return ze(this,Pn).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(t,e,r){return ds.batch(()=>ze(this,Pn).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=ze(this,Pn).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=ze(this,Pn);ds.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=ze(this,Pn);return ds.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=ds.batch(()=>ze(this,Pn).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(oo).catch(oo)}invalidateQueries(t,e={}){return ds.batch(()=>(ze(this,Pn).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=ds.batch(()=>ze(this,Pn).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(oo)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(oo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=ze(this,Pn).build(this,e);return r.isStaleByTime(yC(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(oo).catch(oo)}fetchInfiniteQuery(t){return t.behavior=HU(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(oo).catch(oo)}ensureInfiniteQueryData(t){return t.behavior=HU(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Ow.isOnline()?ze(this,Tu).resumePausedMutations():Promise.resolve()}getQueryCache(){return ze(this,Pn)}getMutationCache(){return ze(this,Tu)}getDefaultOptions(){return ze(this,Iu)}setDefaultOptions(t){sr(this,Iu,t)}setQueryDefaults(t,e){ze(this,Pp).set(Xm(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...ze(this,Pp).values()],r={};return e.forEach(n=>{Jm(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){ze(this,Op).set(Xm(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...ze(this,Op).values()],r={};return e.forEach(n=>{Jm(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...ze(this,Iu).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=xI(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===_I&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...ze(this,Iu).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){ze(this,Pn).clear(),ze(this,Tu).clear()}},Pn=new WeakMap,Tu=new WeakMap,Iu=new WeakMap,Pp=new WeakMap,Op=new WeakMap,ku=new WeakMap,Rp=new WeakMap,Dp=new WeakMap,dB),Get=C.createContext(void 0),Ket=({client:t,children:e})=>(C.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),p.jsx(Get.Provider,{value:t,children:e})),Qet={VITE_APP_PRIVY_APP_ID:"clxlnrvzy073ll6yvy1b6lcko"};function Yet(){return p.jsxs(p.Fragment,{children:[p.jsx(yet,{}),p.jsx(Pde,{}),p.jsx(xfe,{}),p.jsx(Ofe,{})]})}const Zet=({children:t})=>{const e=new Het({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e5}}});return p.jsx(dfe,{children:p.jsx(fne,{store:_oe,children:p.jsxs(cet,{config:{appearance:{accentColor:"#35FB9B",theme:"#FFFFFF",showWalletLoginFirst:!1,logo:Wde},loginMethods:["email","google","twitter","sms"],fundingMethodConfig:{moonpay:{useSandbox:!0}},embeddedWallets:{createOnLogin:"users-without-wallets",requireUserPasswordOnCreate:!1}
713,mfa:{noPromptOnMfaRequired:!1}},appId:Qet.VITE_APP_PRIVY_APP_ID,onSuccess:r=>console.log(`User ${r.id} logged in!`),children:[p.jsx(Yet,{}),p.jsx(Hfe,{children:p.jsxs(_he,{children:[p.jsx(hne,{position:"top-center",autoClose:5e3,hideProgressBar:!1,newestOnTop:!0,closeOnClick:!0,pauseOnFocusLoss:!0,pauseOnHover:!0,theme:"light"}),p.jsx(Ket,{client:e,children:p.jsx(get,{children:p.jsx(Bfe,{children:p.jsx(pne,{theme:{token:{fontFamily:"Plus Jakarta Sans, sans-serif"}},children:t})})})})]})})]})})})},{slice:Xet,forEach:Jet}=[];function ett(t){return Jet.call(Xet.call(arguments,1),e=>{if(e)for(const r in e)t[r]===void 0&&(t[r]=e[r])}),t}function ttt(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(r=>r.test(t))}const KU=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rtt=function(t,e){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(n.maxAge>0){const a=n.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(a)}`}if(n.domain){if(!KU.test(n.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${n.domain}`}if(n.path){if(!KU.test(n.path))throw new TypeError("option path is invalid");s+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invali
713d");s+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(s+="; Partitioned"),s},QU={create(t,e,r,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),n&&(i.domain=n),document.cookie=rtt(t,e,i)},read(t){const e=`${t}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let i=r[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var ntt={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return QU.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:r,cookieMinutes:n,cookieDomain:i,cookieOptions:s}=e;r&&typeof document<"u"&&QU.create(r,t,n,i,s)}},itt={name:"querystring",lookup(t){var n;let{lookupQuerystring:e}=t,r;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const a=i.substring(1).split("&");for(let o=0;o<a.length;o++){const c=a[o].indexOf("=");c>0&&a[o].substring(0,c)===e&&(r=a[o].substring(c+1))}}return r}},stt={name:"hash",lookup(t){var i;let{lookupHash:e,lookupFromHashIndex:r}=t,n;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const a=s.substring(1);if(e){const o=a.split("&");for(let c=0;c<o.length;c++){const l=o[c].indexOf("=");l>0&&o[c].substring(0,l)===e&&(n=o[c].substring(l+1))}}if(n)return n;if(!n&&r>-1){const o=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?(i=o[typeof r=="number"?r:0])==null?void 0:i.replace("/",""):void 0}}}return n}};let Rh=null;const YU=()=>
vendor: 4,716 bytes, line 713
713{if(Rh!==null)return Rh;try{if(Rh=typeof window<"u"&&window.localStorage!==null,!Rh)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Rh=!1}return Rh};var att={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&YU())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:r}=e;r&&YU()&&window.localStorage.setItem(r,t)}};let Dh=null;const ZU=()=>{if(Dh!==null)return Dh;try{if(Dh=typeof window<"u"&&window.sessionStorage!==null,!Dh)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Dh=!1}return Dh};var ott={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&ZU())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:r}=e;r&&ZU()&&window.sessionStorage.setItem(r,t)}},ctt={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:i}=navigator;if(r)for(let s=0;s<r.length;s++)e.push(r[s]);n&&e.push(n),i&&e.push(i)}return e.length>0?e:void 0}},ltt={name:"htmlTag",lookup(t){let{htmlTag:e}=t,r;const n=e||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},utt={name:"path",lookup(t){var i;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(i=r[typeof e=="number"?e:0])==null?void 0:i.replace("/",""):void 0}},dtt={name:"subdomain",lookup(t){var i,s;let{lookupFromSubdomainIndex:e}=t;const r=typeof e=="number"?e+1:1,n=typeof window<"u"&&((s=(i=window.location)==null?void 0:i.hostname)==null?void 0:s.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[r]}};let Ure=!1;try{document.cookie,Ure=!0}catch{}const Bre=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Ure||Bre.splice(1,1);const ftt=()=>({order:Bre,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class qre{constructor(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,r)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=ett(r,this.options||{},ftt()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(ntt),this.addDetector(itt),this.addDetector(att),this.addDetector(ott),this.addDetector(ctt),this.addDetector(ltt),this.addDetector(utt),this.addDetector(dtt),this.addDetector(stt)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,r=[];return e.forEach(n=>{if(this.detectors[n]){let i=this.detectors[n].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(r=r.concat(i))}}),r=r.filter(n=>n!=null&&!ttt(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(e,this.options)}))}}qre.type="languageDetector";function wC(t){"@babel/helpers - typeof";return wC=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wC(t)}function Wre(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":wC(XMLHttpRequest))==="object"}function htt(t){return!!t&&typeof t.then=="function"}function ptt(t){return htt(t)?t:Promise.resolve(t)}function XU(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function JU(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};
vendor: 8,716 bytes, line 713
713e%2?XU(Object(r),!0).forEach(function(n){gtt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):XU(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gtt(t,e,r){return(e=mtt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mtt(t){var e=ytt(t,"string");return Hf(e)=="symbol"?e:e+""}function ytt(t,e){if(Hf(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Hf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hf(t){"@babel/helpers - typeof";return Hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hf(t)}var nd=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?nd=global.fetch:typeof window<"u"&&window.fetch&&(nd=window.fetch);var ey;Wre()&&(typeof global<"u"&&global.XMLHttpRequest?ey=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ey=window.XMLHttpRequest));var Rw;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Rw=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Rw=window.ActiveXObject));typeof nd!="function"&&(nd=void 0);if(!nd&&!ey&&!Rw)try{sc(()=>import("./browser-ponyfill-Gs_wi8WC.js").then(t=>t.b),__vite__mapDeps([6,1])).then(function(t){nd=t.default}).catch(function(){})}catch{}var EC=function(e,r){if(r&&Hf(r)==="object"){var n="";for(var i in r)n+="&"+encodeURIComponent(i)+"="+encodeURIComponent(r[i]);if(!n)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+n.slice(1)}return e},eB=function(e,r,n,i){var s=function(c){if(!c.ok)return n(c.statusText||"Error",{status:c.status});c.text().then(function(l){n(null,{status:c.status,data:l})}).catch(n)};if(i){var a=i(e,r);if(a instanceof Promise){a.then(s).catch(n);return}}typeof fetch=="function"?fetch(e,r).then(s).catch(n):nd(e,r).then(s).catch(n)},tB=!1,btt=function(e,r,n,i){e.queryStringParams&&(r=EC(r,e.queryStringParams));var s=JU({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(s["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(s["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(n):e.requestOptions,o=JU({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:s},tB?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{eB(r,o,i,c)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete o[u]}),eB(r,o,i,c),tB=!0}catch(u){i(u)}}},vtt=function(e,r,n,i){n&&Hf(n)==="object"&&(n=EC("",n).slice(1)),e.queryStringParams&&(r=EC(r,e.queryStringParams));try{var s=ey?new ey:new Rw("MSXML2.XMLHTTP.3.0");s.open(n?"POST":"GET",r,1),e.crossDomain||s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.withCredentials=!!e.withCredentials,n&&s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.overrideMimeType&&s.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var o in a)s.setRequestHeader(o,a[o]);s.onreadystatechange=function(){s.readyState>3&&i(s.status>=400?s.statusText:null,{status:s.status,data:s.responseText})},s.send(n)}catch(c){console&&console.log(c)}},wtt=function(e,r,n,i){if(typeof n=="function"&&(i=n,n=void 0),i=i||function(){},nd&&r.indexOf("file:")!==0)return btt(e,r,n,i);if(Wre()||typeof ActiveXObject=="function")return vtt(e,r,n,i);i(new Error("No fetch and no xhr implementation found!"))};function p0(t){"@babel/helpers - typeof";return p0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p0(t)}function rB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function i_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rB(Object(r),!0).forEach(function(n){zre(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rB(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ett(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xtt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Vre(n.key),n)}}function _tt(t,e,r){return e&&xtt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function zre(t,e,r){return(e=Vre(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vre(t){var e=Ctt(t,"string");return p0(e)=="symbol"?e:e+""}function Ctt(t,e){if(p0(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(p0(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Stt=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(r){return JSON.parse(r)},stringify:JSON.stringify,parsePayload:function(r,n,i){return zre({},n,i||"")},parseLoadPayload:function(r,n){},request:wtt,reloadInterval:typeof window<"u"?!1:3600*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Hre=(function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Ett(this,t),this.services=e,this.options=r,this.allOptions=n,this.type="backend",this.init(e,r,n)}return _tt(t,[{key:"init",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=r,this.options=i_(i_(i_({},Stt()),this.options||{}),i),this.allOptions=s,this.services&&this.options.reloadInterval){var a=setInterval(function(){return n.reload()},this.options.reloadInterval);p0(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(r,n,i){this._readAny(r,r,n,n,i)}},{key:"read",value:function(r,n,i){this._readAny([r],r,[n],n,i)}},{key:"_readAny",value:function(r,n,i,s,a){var o=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(r,i)),c=ptt(c),c.then(function(l){if(!l)return a(null,{});var u=o.services.interpolator.interpolate(l,{lng:r.join("+"),ns:i.join("+")});o.loadUrl(u,a,n,s)})}},{key:"loadUrl",value:function(r,n,i,s){var a=this,o=typeof i=="string"?[i]:i,c=typeof s=="string"?[s]:s,l=this.options.parseLoadPayload(o,c);this.options.request(this.options,r,l,function(u,d){if(d&&(d.status>=500&&d.status<600||!d.status))return n("failed loading "+r+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return n("failed loading "+r+"; status code: "+d.status,!1);if(!d&&u&&u.message){var f=u.message.toLowerCase(),h=["failed","fetch","network","load"].find(function(y){return f.indexOf(y)>-1});if(h)return n("failed loading "+r+": "+u.message,!0)}if(u)return n(u,!1);var g,m;try{typeof d.data=="string"?g=a.options.parse(d.data,i,s):g=d.data}catch{m="failed parsing "+r+" to json"}if(m)return n(m,!1);n(null,g)})}},{key:"create",value:function(r,n,i,s,a){var o=this;if(this.options.addPath){typeof r=="string"&&(r=[r]);var c=this.options.parsePayload(n,i,s),l=0,u=[],d=[];r.forEach(function(f){var h=o.options.addPath;typeof o.options.addPath=="function"&&(h=o.options.addPath(f,n));var g=o.services.interpolator.interpolate(h,{lng:f,ns:n});o.options.request(o.options,g,c,function(m,y){l+=1,u.push(m),d.push(y),l===r.length&&typeof a=="function"&&a(u,d)})})}}},{key:"reload",value:function(){var r=this,n=this.services,i=n.backendConnector,s=n.languageUtils,a=n.logger,o=i.language;if(!(o&&o.toLowerCase()==="cimode")){var c=[],l=function(d){var f=s.toResolveHierarchy(d);f.forEach(function(h){c.indexOf(h)<0&&c.push(h)})};
713l(o),this.allOptions.preload&&this.allOptions.preload.forEach(function(u){return l(u)}),c.forEach(function(u){r.allOptions.ns.forEach(function(d){i.read(u,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(u," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(u),h),i.loaded("".concat(u,"|").concat(d),f,h)})})})}}}])})();Hre.type="backend";Si.use(qre).use(Hre).use(gne).init({supportedLngs:["en","vi","zh","ko","it"],fallbackLng:"en",debug:!0,interpolation:{escapeValue:!1},backend:{loadPath:"/locales/{{lng}}/translation.json"},detection:{order:["querystring","cookie","localStorage","navigator","htmlTag","path"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupFromPathIndex:0,lookupFromSubdomainIndex:0,caches:["localStorage","cookie"]}});Mne.createRoot(document.getElementById("root")).render(p.jsx(mne,{children:p.jsx(Zet,{children:p.jsx("div",{className:"flex flex-col items-center justify-center h-screen",children:p.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 bg-white p-4 m-4 rounded-lg shadow-lg max-w-[500px]",children:[p.jsx("h1",{className:"text-2xl font-bold",children:"Site not found"}),p.jsx("p",{className:"text-gray-500",children:"Looks like you followed a broken link or entered a URL that doesnât exist on Netlify."}),p.jsxs("p",{className:"text-gray-500",children:["If this is your site, and you werenât expecting a 404 for this path, please visit Netlifyâs"," ",p.jsx("a",{className:"text-blue-500 underline",href:"https://answers.netlify.com/t/support-guide-i-ve-deployed-my-site-but-i-still-see-page-not-found/125?utm_source=404page&utm_campaign=community_tracking",children:"âpage not foundâ support guide"})," ","for troubleshooting tips."]}),p.jsxs("p",{className:"text-gray-500",children:["Netlify Internal ID:"," ",p.jsx("span",{className:"bg-gray-100 p-1 rounded-md",children:"01JYDB3S3VGD7GP0T6KK2198YV"})]})]})})})}));export{nP as $,m5 as A,Vm as B,b$e as C,Eke as D,Zh as E,cT as F,oNe as G,Uf as H,ch as I,Ff as J,Nu as K,g5 as L,Ko as M,ka as N,Go as O,QM as P,aZ as Q,va as R,WX as S,wm as T,mp as U,Rf as V,Pm as W,bc as X,Bqe as Y,Of as Z,e2e as _,mZ as a,m2e as a$,wV as a0,by as a1,t2e as a2,r2e as a3,n2e as a4,i2e as a5,iP as a6,EV as a7,sP as a8,s2e as a9,Im as aA,HS as aB,fg as aC,_we as aD,fA as aE,zbe as aF,Dv as aG,m9 as aH,h2e as aI,A1 as aJ,w9 as aK,DS as aL,If as aM,E9 as aN,x9 as aO,d2e as aP,u2e as aQ,Tye as aR,$ye as aS,Dye as aT,Qu as aU,_V as aV,g2e as aW,$5e as aX,f2e as aY,i3e as aZ,Rye as a_,a2e as aa,Yp as ab,xV as ac,o2e as ad,Abe as ae,Nm as af,n0 as ag,Ye as ah,ZV as ai,XV as aj,pwe as ak,$m as al,l2e as am,GV as an,Sm as ao,T9 as ap,ewe as aq,twe as ar,Lye as as,IH as at,KV as au,p9 as av,Obe as aw,Rbe as ax,Rv as ay,RS as az,YCe as b,cve as b$,Yu as b0,Oye as b1,Nye as b2,ym as b3,Fye as b4,s3e as b5,gm as b6,kbe as b7,S0 as b8,jye as b9,zV as bA,VV as bB,_9 as bC,xm as bD,km as bE,Cy as bF,Mbe as bG,Mye as bH,Iye as bI,Tm as bJ,r0 as bK,_m as bL,k6e as bM,gwe as bN,Nbe as bO,cA as bP,Ll as bQ,rH as bR,nH as bS,x2e as bT,AV as bU,pbe as bV,gbe as bW,di as bX,fl as bY,mbe as bZ,vy as b_,a3e as ba,Em as bb,t0 as bc,Ybe as bd,mm as be,Zd as bf,v9 as bg,y9 as bh,b9 as bi,pm as bj,Cm as bk,zs as bl,w3 as bm,bm as bn,vm as bo,Ws as bp,zS as bq,SV as br,y2e as bs,CV as bt,Pye as bu,Tbe as bv,Am as bw,bP as bx,Mv as by,$be as bz,DG as c,tP as c$,lve as c0,is as c1,J2e as c2,k0 as c3,UH as c4,RG as c5,MG as c6,$0 as c7,Cbe as c8,jv as c9,Z2e as cA,wy as cB,pve as cC,ZH as cD,Sbe as cE,u3e as cF,QH as cG,XH as cH,l3e as cI,ha as cJ,b2e as cK,vc as cL,_o as cM,La as cN,i0 as cO,xo as cP,Li as cQ,wwe as cR,Qbe as cS,s0 as cT,$9 as cU,_2e as cV,Vt as cW,A0 as cX,p2e as cY,Du as cZ,yV as c_,BH as ca,dd as cb,TH as cc,Xve as cd,Jf as ce,T3 as cf,DP as cg,Ey as ch,ws as ci,mwe as cj,OP as ck,Jve as cl,V5e as cm,WV as cn,eH as co,xy as cp,js as cq,wc as cr,GS as cs,OH as ct,ld as cu,eh as cv,e0 as cw,P0 as cx,kf as cy,b3 as cz,Oa as d,rP as d0,SG as d1,eA as d2,N5e as d3,lbe as d4,r3e as d5,SA as d6,g9 as d7,Fbe as d8,Hbe as d9,N3 as dA,ywe as dB,ky as dC,X5e as da,o3e as db,ove as dc,Tn as dd,Tf as de,MV as df,d9 as dg,pf as dh,Zp as di,li as dj,hve as dk,fve as dl,T0 as dm,OV as dn,n3e as dp,Ube as dq,JV as dr,Mu as ds,YH as dt,I6e as du,dwe as dv,Uv as dw,Xwe as dx,Ha as dy,WS as dz,Lrt as e,hm as f,ot as g,kl as h,pCe as i,$1 as j,zSe as k,x$e as l,MSe as m,ba as n,uDe as o,FDe as p,Hs as q,HSe as r,S7 as s,Ls as t,uo as u,lh as v,I9 as w,LT as x,EMe as y,jT 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.