@frak-labs/components 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/components.css +1 -0
- package/cdn/components.js +10 -64
- package/package.json +12 -15
- package/cdn/css/ButtonWallet.css +0 -35
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._spinner_1gez9_1{--spinner-opacity: .65;display:block;position:relative;opacity:var(--spinner-opacity);width:16px;height:16px}._spinner__leaf_1gez9_10{--spinner-animation-duration: .8s;position:absolute;top:0;left:43.75%;width:12.5%;height:100%;animation:_rt-spinner-leaf-fade_1gez9_1 var(--spinner-animation-duration) linear infinite}._spinner__leaf_1gez9_10:before{content:"";display:block;width:100%;height:30%;border-radius:3px;background-color:currentColor}._spinner__leaf_1gez9_10:where(:nth-child(1)){transform:rotate(0);animation-delay:calc(-8 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(2)){transform:rotate(45deg);animation-delay:calc(-7 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(3)){transform:rotate(90deg);animation-delay:calc(-6 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(4)){transform:rotate(135deg);animation-delay:calc(-5 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(5)){transform:rotate(180deg);animation-delay:calc(-4 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(6)){transform:rotate(225deg);animation-delay:calc(-3 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(7)){transform:rotate(270deg);animation-delay:calc(-2 / 8 * var(--spinner-animation-duration))}._spinner__leaf_1gez9_10:where(:nth-child(8)){transform:rotate(315deg);animation-delay:calc(-1 / 8 * var(--spinner-animation-duration))}@keyframes _rt-spinner-leaf-fade_1gez9_1{0%{opacity:1}to{opacity:.25}}._buttonShare_i4e8j_1{display:flex;align-items:center;justify-content:center;gap:10px}frak-button-wallet{position:fixed;bottom:20px;z-index:2000000}frak-button-wallet.left{left:20px}frak-button-wallet.right{right:20px}frak-button-wallet button,frak-button-wallet [type=button]{all:unset;display:flex;justify-content:center;align-items:center;position:relative;background-color:#3e557e;width:45px;height:45px;border-radius:50%;cursor:pointer;text-align:center}frak-button-wallet span{position:absolute;top:-4px;right:27px;padding:2px 3px;border-radius:5px;background:#ff3f3f;font-size:9px;color:#fff;font-weight:600;white-space:nowrap;line-height:9px}
|
package/cdn/components.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
|
-
"use strict";var FrakComponents=(()=>{var _s=Object.create;var Yt=Object.defineProperty;var ys=Object.getOwnPropertyDescriptor;var ws=Object.getOwnPropertyNames;var gs=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty;var ce=(e,t)=>()=>(e&&(t=e(e=0)),t);var Gt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Kt=(e,t)=>{for(var n in t)Yt(e,n,{get:t[n],enumerable:!0})},zn=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of ws(t))!xs.call(e,c)&&c!==n&&Yt(e,c,{get:()=>t[c],enumerable:!(s=ys(t,c))||s.enumerable});return e};var Wn=(e,t,n)=>(n=e!=null?_s(gs(e)):{},zn(t||!e||!e.__esModule?Yt(n,"default",{value:e,enumerable:!0}):n,e)),Mr=e=>zn(Yt({},"__esModule",{value:!0}),e);var U=ce(()=>{"use strict"});var W={};Kt(W,{_debugEnd:()=>Po,_debugProcess:()=>Uo,_events:()=>Jo,_eventsCount:()=>Xo,_exiting:()=>ho,_fatalExceptions:()=>ko,_getActiveHandles:()=>wo,_getActiveRequests:()=>yo,_kill:()=>xo,_linkedBinding:()=>lo,_maxListeners:()=>Ko,_preload_modules:()=>qo,_rawDebug:()=>co,_startProfilerIdleNotifier:()=>Oo,_stopProfilerIdleNotifier:()=>Mo,_tickCallback:()=>Fo,abort:()=>Do,addListener:()=>Qo,allowedNodeEnvironmentFlags:()=>So,arch:()=>Kn,argv:()=>Qn,argv0:()=>Vo,assert:()=>To,binding:()=>no,browser:()=>uo,chdir:()=>ao,config:()=>mo,cpuUsage:()=>Qt,cwd:()=>io,debugPort:()=>Wo,default:()=>si,dlopen:()=>_o,domain:()=>po,emit:()=>ni,emitWarning:()=>ro,env:()=>Xn,execArgv:()=>Zn,execPath:()=>zo,exit:()=>Ao,features:()=>Co,hasUncaughtExceptionCaptureCallback:()=>Ro,hrtime:()=>Xt,kill:()=>Eo,listeners:()=>ai,memoryUsage:()=>vo,moduleLoadList:()=>fo,nextTick:()=>qn,off:()=>ei,on:()=>je,once:()=>Zo,openStdin:()=>Io,pid:()=>$o,platform:()=>Jn,ppid:()=>jo,prependListener:()=>oi,prependOnceListener:()=>ii,reallyExit:()=>go,release:()=>so,removeAllListeners:()=>ri,removeListener:()=>ti,resourceUsage:()=>bo,setSourceMapsEnabled:()=>Yo,setUncaughtExceptionCaptureCallback:()=>Bo,stderr:()=>Lo,stdin:()=>Ho,stdout:()=>No,title:()=>Gn,umask:()=>oo,uptime:()=>Go,version:()=>eo,versions:()=>to});function Hr(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function bs(){!pt||!rt||(pt=!1,rt.length?$e=rt.concat($e):Jt=-1,$e.length&&Vn())}function Vn(){if(!pt){var e=setTimeout(bs,0);pt=!0;for(var t=$e.length;t;){for(rt=$e,$e=[];++Jt<t;)rt&&rt[Jt].run();Jt=-1,t=$e.length}rt=null,pt=!1,clearTimeout(e)}}function qn(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];$e.push(new Yn(e,t)),$e.length===1&&!pt&&setTimeout(Vn,0)}function Yn(e,t){this.fun=e,this.array=t}function be(){}function lo(e){Hr("_linkedBinding")}function _o(e){Hr("dlopen")}function yo(){return[]}function wo(){return[]}function To(e,t){if(!e)throw new Error(t||"assertion error")}function Ro(){return!1}function Go(){return Ve.now()/1e3}function Xt(e){var t=Math.floor((Date.now()-Ve.now())*.001),n=Ve.now()*.001,s=Math.floor(n)+t,c=Math.floor(n%1*1e9);return e&&(s=s-e[0],c=c-e[1],c<0&&(s--,c+=Lr)),[s,c]}function je(){return si}function ai(e){return[]}var $e,pt,rt,Jt,Gn,Kn,Jn,Xn,Qn,Zn,eo,to,ro,no,oo,io,ao,so,uo,co,fo,po,ho,mo,go,xo,Qt,bo,vo,Eo,Ao,Io,So,Co,ko,Bo,Fo,Uo,Po,Oo,Mo,No,Lo,Ho,Do,$o,jo,zo,Wo,Vo,qo,Yo,Ve,Nr,Lr,Ko,Jo,Xo,Qo,Zo,ei,ti,ri,ni,oi,ii,si,ui=ce(()=>{"use strict";U();O();P();$e=[],pt=!1,Jt=-1;Yn.prototype.run=function(){this.fun.apply(null,this.array)};Gn="browser",Kn="x64",Jn="browser",Xn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Qn=["/usr/bin/node"],Zn=[],eo="v16.8.0",to={},ro=function(e,t){console.warn((t?t+": ":"")+e)},no=function(e){Hr("binding")},oo=function(e){return 0},io=function(){return"/"},ao=function(e){},so={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};uo=!0,co=be,fo=[];po={},ho=!1,mo={};go=be,xo=be,Qt=function(){return{}},bo=Qt,vo=Qt,Eo=be,Ao=be,Io=be,So={};Co={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ko=be,Bo=be;Fo=be,Uo=be,Po=be,Oo=be,Mo=be,No=void 0,Lo=void 0,Ho=void 0,Do=be,$o=2,jo=1,zo="/bin/usr/node",Wo=9229,Vo="node",qo=[],Yo=be,Ve={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Ve.now===void 0&&(Nr=Date.now(),Ve.timing&&Ve.timing.navigationStart&&(Nr=Ve.timing.navigationStart),Ve.now=()=>Date.now()-Nr);Lr=1e9;Xt.bigint=function(e){var t=Xt(e);return typeof BigInt>"u"?t[0]*Lr+t[1]:BigInt(t[0]*Lr)+BigInt(t[1])};Ko=10,Jo={},Xo=0;Qo=je,Zo=je,ei=je,ti=je,ri=je,ni=be,oi=je,ii=je;si={version:eo,versions:to,arch:Kn,platform:Jn,browser:uo,release:so,_rawDebug:co,moduleLoadList:fo,binding:no,_linkedBinding:lo,_events:Jo,_eventsCount:Xo,_maxListeners:Ko,on:je,addListener:Qo,once:Zo,off:ei,removeListener:ti,removeAllListeners:ri,emit:ni,prependListener:oi,prependOnceListener:ii,listeners:ai,domain:po,_exiting:ho,config:mo,dlopen:_o,uptime:Go,_getActiveRequests:yo,_getActiveHandles:wo,reallyExit:go,_kill:xo,cpuUsage:Qt,resourceUsage:bo,memoryUsage:vo,kill:Eo,exit:Ao,openStdin:Io,allowedNodeEnvironmentFlags:So,assert:To,features:Co,_fatalExceptions:ko,setUncaughtExceptionCaptureCallback:Bo,hasUncaughtExceptionCaptureCallback:Ro,emitWarning:ro,nextTick:qn,_tickCallback:Fo,_debugProcess:Uo,_debugEnd:Po,_startProfilerIdleNotifier:Oo,_stopProfilerIdleNotifier:Mo,stdout:No,stdin:Ho,stderr:Lo,abort:Do,umask:oo,chdir:ao,cwd:io,env:Xn,title:Gn,argv:Qn,execArgv:Zn,pid:$o,ppid:jo,execPath:zo,debugPort:Wo,hrtime:Xt,argv0:Vo,_preload_modules:qo,setSourceMapsEnabled:Yo}});var P=ce(()=>{"use strict";ui()});function vs(){if(ci)return Et;ci=!0,Et.byteLength=m,Et.toByteArray=A,Et.fromByteArray=S;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,f=s.length;c<f;++c)e[c]=s[c],t[s.charCodeAt(c)]=c;t[45]=62,t[95]=63;function a(h){var b=h.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=h.indexOf("=");v===-1&&(v=b);var I=v===b?0:4-v%4;return[v,I]}function m(h){var b=a(h),v=b[0],I=b[1];return(v+I)*3/4-I}function d(h,b,v){return(b+v)*3/4-v}function A(h){var b,v=a(h),I=v[0],l=v[1],w=new n(d(h,I,l)),k=0,D=l>0?I-4:I,F;for(F=0;F<D;F+=4)b=t[h.charCodeAt(F)]<<18|t[h.charCodeAt(F+1)]<<12|t[h.charCodeAt(F+2)]<<6|t[h.charCodeAt(F+3)],w[k++]=b>>16&255,w[k++]=b>>8&255,w[k++]=b&255;return l===2&&(b=t[h.charCodeAt(F)]<<2|t[h.charCodeAt(F+1)]>>4,w[k++]=b&255),l===1&&(b=t[h.charCodeAt(F)]<<10|t[h.charCodeAt(F+1)]<<4|t[h.charCodeAt(F+2)]>>2,w[k++]=b>>8&255,w[k++]=b&255),w}function R(h){return e[h>>18&63]+e[h>>12&63]+e[h>>6&63]+e[h&63]}function g(h,b,v){for(var I,l=[],w=b;w<v;w+=3)I=(h[w]<<16&16711680)+(h[w+1]<<8&65280)+(h[w+2]&255),l.push(R(I));return l.join("")}function S(h){for(var b,v=h.length,I=v%3,l=[],w=16383,k=0,D=v-I;k<D;k+=w)l.push(g(h,k,k+w>D?D:k+w));return I===1?(b=h[v-1],l.push(e[b>>2]+e[b<<4&63]+"==")):I===2&&(b=(h[v-2]<<8)+h[v-1],l.push(e[b>>10]+e[b>>4&63]+e[b<<2&63]+"=")),l.join("")}return Et}function Es(){if(fi)return Zt;fi=!0;return Zt.read=function(e,t,n,s,c){var f,a,m=c*8-s-1,d=(1<<m)-1,A=d>>1,R=-7,g=n?c-1:0,S=n?-1:1,h=e[t+g];for(g+=S,f=h&(1<<-R)-1,h>>=-R,R+=m;R>0;f=f*256+e[t+g],g+=S,R-=8);for(a=f&(1<<-R)-1,f>>=-R,R+=s;R>0;a=a*256+e[t+g],g+=S,R-=8);if(f===0)f=1-A;else{if(f===d)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,s),f=f-A}return(h?-1:1)*a*Math.pow(2,f-s)},Zt.write=function(e,t,n,s,c,f){var a,m,d,A=f*8-c-1,R=(1<<A)-1,g=R>>1,S=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=s?0:f-1,b=s?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(m=isNaN(t)?1:0,a=R):(a=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+g>=1?t+=S/d:t+=S*Math.pow(2,1-g),t*d>=2&&(a++,d/=2),a+g>=R?(m=0,a=R):a+g>=1?(m=(t*d-1)*Math.pow(2,c),a=a+g):(m=t*Math.pow(2,g-1)*Math.pow(2,c),a=0));c>=8;e[n+h]=m&255,h+=b,m/=256,c-=8);for(a=a<<c|m,A+=c;A>0;e[n+h]=a&255,h+=b,a/=256,A-=8);e[n+h-b]|=v*128},Zt}function pi(){if(li)return nt;li=!0;let e=vs(),t=Es(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;nt.Buffer=a,nt.SlowBuffer=l,nt.INSPECT_MAX_BYTES=50;let s=2147483647;nt.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{let u=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(u,r),u.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function f(u){if(u>s)throw new RangeError('The value "'+u+'" is invalid for option "size"');let r=new Uint8Array(u);return Object.setPrototypeOf(r,a.prototype),r}function a(u,r,o){if(typeof u=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(u)}return m(u,r,o)}a.poolSize=8192;function m(u,r,o){if(typeof u=="string")return g(u,r);if(ArrayBuffer.isView(u))return h(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(Ee(u,ArrayBuffer)||u&&Ee(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ee(u,SharedArrayBuffer)||u&&Ee(u.buffer,SharedArrayBuffer)))return b(u,r,o);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let p=u.valueOf&&u.valueOf();if(p!=null&&p!==u)return a.from(p,r,o);let _=v(u);if(_)return _;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return a.from(u[Symbol.toPrimitive]("string"),r,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}a.from=function(u,r,o){return m(u,r,o)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function d(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function A(u,r,o){return d(u),u<=0?f(u):r!==void 0?typeof o=="string"?f(u).fill(r,o):f(u).fill(r):f(u)}a.alloc=function(u,r,o){return A(u,r,o)};function R(u){return d(u),f(u<0?0:I(u)|0)}a.allocUnsafe=function(u){return R(u)},a.allocUnsafeSlow=function(u){return R(u)};function g(u,r){if((typeof r!="string"||r==="")&&(r="utf8"),!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let o=w(u,r)|0,p=f(o),_=p.write(u,r);return _!==o&&(p=p.slice(0,_)),p}function S(u){let r=u.length<0?0:I(u.length)|0,o=f(r);for(let p=0;p<r;p+=1)o[p]=u[p]&255;return o}function h(u){if(Ee(u,Uint8Array)){let r=new Uint8Array(u);return b(r.buffer,r.byteOffset,r.byteLength)}return S(u)}function b(u,r,o){if(r<0||u.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(u.byteLength<r+(o||0))throw new RangeError('"length" is outside of buffer bounds');let p;return r===void 0&&o===void 0?p=new Uint8Array(u):o===void 0?p=new Uint8Array(u,r):p=new Uint8Array(u,r,o),Object.setPrototypeOf(p,a.prototype),p}function v(u){if(a.isBuffer(u)){let r=I(u.length)|0,o=f(r);return o.length===0||u.copy(o,0,0,r),o}if(u.length!==void 0)return typeof u.length!="number"||Re(u.length)?f(0):S(u);if(u.type==="Buffer"&&Array.isArray(u.data))return S(u.data)}function I(u){if(u>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return u|0}function l(u){return+u!=u&&(u=0),a.alloc(+u)}a.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==a.prototype},a.compare=function(r,o){if(Ee(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),Ee(o,Uint8Array)&&(o=a.from(o,o.offset,o.byteLength)),!a.isBuffer(r)||!a.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===o)return 0;let p=r.length,_=o.length;for(let E=0,C=Math.min(p,_);E<C;++E)if(r[E]!==o[E]){p=r[E],_=o[E];break}return p<_?-1:_<p?1:0},a.isEncoding=function(r){switch(String(r).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}},a.concat=function(r,o){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return a.alloc(0);let p;if(o===void 0)for(o=0,p=0;p<r.length;++p)o+=r[p].length;let _=a.allocUnsafe(o),E=0;for(p=0;p<r.length;++p){let C=r[p];if(Ee(C,Uint8Array))E+C.length>_.length?(a.isBuffer(C)||(C=a.from(C)),C.copy(_,E)):Uint8Array.prototype.set.call(_,C,E);else if(a.isBuffer(C))C.copy(_,E);else throw new TypeError('"list" argument must be an Array of Buffers');E+=C.length}return _};function w(u,r){if(a.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||Ee(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);let o=u.length,p=arguments.length>2&&arguments[2]===!0;if(!p&&o===0)return 0;let _=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return bt(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return vt(u).length;default:if(_)return p?-1:bt(u).length;r=(""+r).toLowerCase(),_=!0}}a.byteLength=w;function k(u,r,o){let p=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,r>>>=0,o<=r))return"";for(u||(u="utf8");;)switch(u){case"hex":return Se(this,r,o);case"utf8":case"utf-8":return L(this,r,o);case"ascii":return ge(this,r,o);case"latin1":case"binary":return te(this,r,o);case"base64":return K(this,r,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ee(this,r,o);default:if(p)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),p=!0}}a.prototype._isBuffer=!0;function D(u,r,o){let p=u[r];u[r]=u[o],u[o]=p}a.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let o=0;o<r;o+=2)D(this,o,o+1);return this},a.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let o=0;o<r;o+=4)D(this,o,o+3),D(this,o+1,o+2);return this},a.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let o=0;o<r;o+=8)D(this,o,o+7),D(this,o+1,o+6),D(this,o+2,o+5),D(this,o+3,o+4);return this},a.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?L(this,0,r):k.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(r){if(!a.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:a.compare(this,r)===0},a.prototype.inspect=function(){let r="",o=nt.INSPECT_MAX_BYTES;return r=this.toString("hex",0,o).replace(/(.{2})/g,"$1 ").trim(),this.length>o&&(r+=" ... "),"<Buffer "+r+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(r,o,p,_,E){if(Ee(r,Uint8Array)&&(r=a.from(r,r.offset,r.byteLength)),!a.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(o===void 0&&(o=0),p===void 0&&(p=r?r.length:0),_===void 0&&(_=0),E===void 0&&(E=this.length),o<0||p>r.length||_<0||E>this.length)throw new RangeError("out of range index");if(_>=E&&o>=p)return 0;if(_>=E)return-1;if(o>=p)return 1;if(o>>>=0,p>>>=0,_>>>=0,E>>>=0,this===r)return 0;let C=E-_,X=p-o,le=Math.min(C,X),fe=this.slice(_,E),pe=r.slice(o,p);for(let ne=0;ne<le;++ne)if(fe[ne]!==pe[ne]){C=fe[ne],X=pe[ne];break}return C<X?-1:X<C?1:0};function F(u,r,o,p,_){if(u.length===0)return-1;if(typeof o=="string"?(p=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,Re(o)&&(o=_?0:u.length-1),o<0&&(o=u.length+o),o>=u.length){if(_)return-1;o=u.length-1}else if(o<0)if(_)o=0;else return-1;if(typeof r=="string"&&(r=a.from(r,p)),a.isBuffer(r))return r.length===0?-1:x(u,r,o,p,_);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?_?Uint8Array.prototype.indexOf.call(u,r,o):Uint8Array.prototype.lastIndexOf.call(u,r,o):x(u,[r],o,p,_);throw new TypeError("val must be string, number or Buffer")}function x(u,r,o,p,_){let E=1,C=u.length,X=r.length;if(p!==void 0&&(p=String(p).toLowerCase(),p==="ucs2"||p==="ucs-2"||p==="utf16le"||p==="utf-16le")){if(u.length<2||r.length<2)return-1;E=2,C/=2,X/=2,o/=2}function le(pe,ne){return E===1?pe[ne]:pe.readUInt16BE(ne*E)}let fe;if(_){let pe=-1;for(fe=o;fe<C;fe++)if(le(u,fe)===le(r,pe===-1?0:fe-pe)){if(pe===-1&&(pe=fe),fe-pe+1===X)return pe*E}else pe!==-1&&(fe-=fe-pe),pe=-1}else for(o+X>C&&(o=C-X),fe=o;fe>=0;fe--){let pe=!0;for(let ne=0;ne<X;ne++)if(le(u,fe+ne)!==le(r,ne)){pe=!1;break}if(pe)return fe}return-1}a.prototype.includes=function(r,o,p){return this.indexOf(r,o,p)!==-1},a.prototype.indexOf=function(r,o,p){return F(this,r,o,p,!0)},a.prototype.lastIndexOf=function(r,o,p){return F(this,r,o,p,!1)};function N(u,r,o,p){o=Number(o)||0;let _=u.length-o;p?(p=Number(p),p>_&&(p=_)):p=_;let E=r.length;p>E/2&&(p=E/2);let C;for(C=0;C<p;++C){let X=parseInt(r.substr(C*2,2),16);if(Re(X))return C;u[o+C]=X}return C}function $(u,r,o,p){return ve(bt(r,u.length-o),u,o,p)}function T(u,r,o,p){return ve($t(r),u,o,p)}function V(u,r,o,p){return ve(vt(r),u,o,p)}function M(u,r,o,p){return ve(jt(r,u.length-o),u,o,p)}a.prototype.write=function(r,o,p,_){if(o===void 0)_="utf8",p=this.length,o=0;else if(p===void 0&&typeof o=="string")_=o,p=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(p)?(p=p>>>0,_===void 0&&(_="utf8")):(_=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let E=this.length-o;if((p===void 0||p>E)&&(p=E),r.length>0&&(p<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");_||(_="utf8");let C=!1;for(;;)switch(_){case"hex":return N(this,r,o,p);case"utf8":case"utf-8":return $(this,r,o,p);case"ascii":case"latin1":case"binary":return T(this,r,o,p);case"base64":return V(this,r,o,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,r,o,p);default:if(C)throw new TypeError("Unknown encoding: "+_);_=(""+_).toLowerCase(),C=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function K(u,r,o){return r===0&&o===u.length?e.fromByteArray(u):e.fromByteArray(u.slice(r,o))}function L(u,r,o){o=Math.min(u.length,o);let p=[],_=r;for(;_<o;){let E=u[_],C=null,X=E>239?4:E>223?3:E>191?2:1;if(_+X<=o){let le,fe,pe,ne;switch(X){case 1:E<128&&(C=E);break;case 2:le=u[_+1],(le&192)===128&&(ne=(E&31)<<6|le&63,ne>127&&(C=ne));break;case 3:le=u[_+1],fe=u[_+2],(le&192)===128&&(fe&192)===128&&(ne=(E&15)<<12|(le&63)<<6|fe&63,ne>2047&&(ne<55296||ne>57343)&&(C=ne));break;case 4:le=u[_+1],fe=u[_+2],pe=u[_+3],(le&192)===128&&(fe&192)===128&&(pe&192)===128&&(ne=(E&15)<<18|(le&63)<<12|(fe&63)<<6|pe&63,ne>65535&&ne<1114112&&(C=ne))}}C===null?(C=65533,X=1):C>65535&&(C-=65536,p.push(C>>>10&1023|55296),C=56320|C&1023),p.push(C),_+=X}return ie(p)}let J=4096;function ie(u){let r=u.length;if(r<=J)return String.fromCharCode.apply(String,u);let o="",p=0;for(;p<r;)o+=String.fromCharCode.apply(String,u.slice(p,p+=J));return o}function ge(u,r,o){let p="";o=Math.min(u.length,o);for(let _=r;_<o;++_)p+=String.fromCharCode(u[_]&127);return p}function te(u,r,o){let p="";o=Math.min(u.length,o);for(let _=r;_<o;++_)p+=String.fromCharCode(u[_]);return p}function Se(u,r,o){let p=u.length;(!r||r<0)&&(r=0),(!o||o<0||o>p)&&(o=p);let _="";for(let E=r;E<o;++E)_+=lt[u[E]];return _}function ee(u,r,o){let p=u.slice(r,o),_="";for(let E=0;E<p.length-1;E+=2)_+=String.fromCharCode(p[E]+p[E+1]*256);return _}a.prototype.slice=function(r,o){let p=this.length;r=~~r,o=o===void 0?p:~~o,r<0?(r+=p,r<0&&(r=0)):r>p&&(r=p),o<0?(o+=p,o<0&&(o=0)):o>p&&(o=p),o<r&&(o=r);let _=this.subarray(r,o);return Object.setPrototypeOf(_,a.prototype),_};function re(u,r,o){if(u%1!==0||u<0)throw new RangeError("offset is not uint");if(u+r>o)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(r,o,p){r=r>>>0,o=o>>>0,p||re(r,o,this.length);let _=this[r],E=1,C=0;for(;++C<o&&(E*=256);)_+=this[r+C]*E;return _},a.prototype.readUintBE=a.prototype.readUIntBE=function(r,o,p){r=r>>>0,o=o>>>0,p||re(r,o,this.length);let _=this[r+--o],E=1;for(;o>0&&(E*=256);)_+=this[r+--o]*E;return _},a.prototype.readUint8=a.prototype.readUInt8=function(r,o){return r=r>>>0,o||re(r,1,this.length),this[r]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(r,o){return r=r>>>0,o||re(r,2,this.length),this[r]|this[r+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(r,o){return r=r>>>0,o||re(r,2,this.length),this[r]<<8|this[r+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(r,o){return r=r>>>0,o||re(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(r,o){return r=r>>>0,o||re(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},a.prototype.readBigUInt64LE=Ie(function(r){r=r>>>0,Be(r,"offset");let o=this[r],p=this[r+7];(o===void 0||p===void 0)&&He(r,this.length-8);let _=o+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,E=this[++r]+this[++r]*2**8+this[++r]*2**16+p*2**24;return BigInt(_)+(BigInt(E)<<BigInt(32))}),a.prototype.readBigUInt64BE=Ie(function(r){r=r>>>0,Be(r,"offset");let o=this[r],p=this[r+7];(o===void 0||p===void 0)&&He(r,this.length-8);let _=o*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],E=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+p;return(BigInt(_)<<BigInt(32))+BigInt(E)}),a.prototype.readIntLE=function(r,o,p){r=r>>>0,o=o>>>0,p||re(r,o,this.length);let _=this[r],E=1,C=0;for(;++C<o&&(E*=256);)_+=this[r+C]*E;return E*=128,_>=E&&(_-=Math.pow(2,8*o)),_},a.prototype.readIntBE=function(r,o,p){r=r>>>0,o=o>>>0,p||re(r,o,this.length);let _=o,E=1,C=this[r+--_];for(;_>0&&(E*=256);)C+=this[r+--_]*E;return E*=128,C>=E&&(C-=Math.pow(2,8*o)),C},a.prototype.readInt8=function(r,o){return r=r>>>0,o||re(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},a.prototype.readInt16LE=function(r,o){r=r>>>0,o||re(r,2,this.length);let p=this[r]|this[r+1]<<8;return p&32768?p|4294901760:p},a.prototype.readInt16BE=function(r,o){r=r>>>0,o||re(r,2,this.length);let p=this[r+1]|this[r]<<8;return p&32768?p|4294901760:p},a.prototype.readInt32LE=function(r,o){return r=r>>>0,o||re(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},a.prototype.readInt32BE=function(r,o){return r=r>>>0,o||re(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},a.prototype.readBigInt64LE=Ie(function(r){r=r>>>0,Be(r,"offset");let o=this[r],p=this[r+7];(o===void 0||p===void 0)&&He(r,this.length-8);let _=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(p<<24);return(BigInt(_)<<BigInt(32))+BigInt(o+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),a.prototype.readBigInt64BE=Ie(function(r){r=r>>>0,Be(r,"offset");let o=this[r],p=this[r+7];(o===void 0||p===void 0)&&He(r,this.length-8);let _=(o<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(_)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+p)}),a.prototype.readFloatLE=function(r,o){return r=r>>>0,o||re(r,4,this.length),t.read(this,r,!0,23,4)},a.prototype.readFloatBE=function(r,o){return r=r>>>0,o||re(r,4,this.length),t.read(this,r,!1,23,4)},a.prototype.readDoubleLE=function(r,o){return r=r>>>0,o||re(r,8,this.length),t.read(this,r,!0,52,8)},a.prototype.readDoubleBE=function(r,o){return r=r>>>0,o||re(r,8,this.length),t.read(this,r,!1,52,8)};function ue(u,r,o,p,_,E){if(!a.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>_||r<E)throw new RangeError('"value" argument is out of bounds');if(o+p>u.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(r,o,p,_){if(r=+r,o=o>>>0,p=p>>>0,!_){let X=Math.pow(2,8*p)-1;ue(this,r,o,p,X,0)}let E=1,C=0;for(this[o]=r&255;++C<p&&(E*=256);)this[o+C]=r/E&255;return o+p},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(r,o,p,_){if(r=+r,o=o>>>0,p=p>>>0,!_){let X=Math.pow(2,8*p)-1;ue(this,r,o,p,X,0)}let E=p-1,C=1;for(this[o+E]=r&255;--E>=0&&(C*=256);)this[o+E]=r/C&255;return o+p},a.prototype.writeUint8=a.prototype.writeUInt8=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,1,255,0),this[o]=r&255,o+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,2,65535,0),this[o]=r&255,this[o+1]=r>>>8,o+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,2,65535,0),this[o]=r>>>8,this[o+1]=r&255,o+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,4,4294967295,0),this[o+3]=r>>>24,this[o+2]=r>>>16,this[o+1]=r>>>8,this[o]=r&255,o+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,4,4294967295,0),this[o]=r>>>24,this[o+1]=r>>>16,this[o+2]=r>>>8,this[o+3]=r&255,o+4};function Te(u,r,o,p,_){Qe(r,p,_,u,o,7);let E=Number(r&BigInt(4294967295));u[o++]=E,E=E>>8,u[o++]=E,E=E>>8,u[o++]=E,E=E>>8,u[o++]=E;let C=Number(r>>BigInt(32)&BigInt(4294967295));return u[o++]=C,C=C>>8,u[o++]=C,C=C>>8,u[o++]=C,C=C>>8,u[o++]=C,o}function Pe(u,r,o,p,_){Qe(r,p,_,u,o,7);let E=Number(r&BigInt(4294967295));u[o+7]=E,E=E>>8,u[o+6]=E,E=E>>8,u[o+5]=E,E=E>>8,u[o+4]=E;let C=Number(r>>BigInt(32)&BigInt(4294967295));return u[o+3]=C,C=C>>8,u[o+2]=C,C=C>>8,u[o+1]=C,C=C>>8,u[o]=C,o+8}a.prototype.writeBigUInt64LE=Ie(function(r,o=0){return Te(this,r,o,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ie(function(r,o=0){return Pe(this,r,o,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(r,o,p,_){if(r=+r,o=o>>>0,!_){let le=Math.pow(2,8*p-1);ue(this,r,o,p,le-1,-le)}let E=0,C=1,X=0;for(this[o]=r&255;++E<p&&(C*=256);)r<0&&X===0&&this[o+E-1]!==0&&(X=1),this[o+E]=(r/C>>0)-X&255;return o+p},a.prototype.writeIntBE=function(r,o,p,_){if(r=+r,o=o>>>0,!_){let le=Math.pow(2,8*p-1);ue(this,r,o,p,le-1,-le)}let E=p-1,C=1,X=0;for(this[o+E]=r&255;--E>=0&&(C*=256);)r<0&&X===0&&this[o+E+1]!==0&&(X=1),this[o+E]=(r/C>>0)-X&255;return o+p},a.prototype.writeInt8=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,1,127,-128),r<0&&(r=255+r+1),this[o]=r&255,o+1},a.prototype.writeInt16LE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,2,32767,-32768),this[o]=r&255,this[o+1]=r>>>8,o+2},a.prototype.writeInt16BE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,2,32767,-32768),this[o]=r>>>8,this[o+1]=r&255,o+2},a.prototype.writeInt32LE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,4,2147483647,-2147483648),this[o]=r&255,this[o+1]=r>>>8,this[o+2]=r>>>16,this[o+3]=r>>>24,o+4},a.prototype.writeInt32BE=function(r,o,p){return r=+r,o=o>>>0,p||ue(this,r,o,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[o]=r>>>24,this[o+1]=r>>>16,this[o+2]=r>>>8,this[o+3]=r&255,o+4},a.prototype.writeBigInt64LE=Ie(function(r,o=0){return Te(this,r,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ie(function(r,o=0){return Pe(this,r,o,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ke(u,r,o,p,_,E){if(o+p>u.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function Oe(u,r,o,p,_){return r=+r,o=o>>>0,_||ke(u,r,o,4),t.write(u,r,o,p,23,4),o+4}a.prototype.writeFloatLE=function(r,o,p){return Oe(this,r,o,!0,p)},a.prototype.writeFloatBE=function(r,o,p){return Oe(this,r,o,!1,p)};function ft(u,r,o,p,_){return r=+r,o=o>>>0,_||ke(u,r,o,8),t.write(u,r,o,p,52,8),o+8}a.prototype.writeDoubleLE=function(r,o,p){return ft(this,r,o,!0,p)},a.prototype.writeDoubleBE=function(r,o,p){return ft(this,r,o,!1,p)},a.prototype.copy=function(r,o,p,_){if(!a.isBuffer(r))throw new TypeError("argument should be a Buffer");if(p||(p=0),!_&&_!==0&&(_=this.length),o>=r.length&&(o=r.length),o||(o=0),_>0&&_<p&&(_=p),_===p||r.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(_<0)throw new RangeError("sourceEnd out of bounds");_>this.length&&(_=this.length),r.length-o<_-p&&(_=r.length-o+p);let E=_-p;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,p,_):Uint8Array.prototype.set.call(r,this.subarray(p,_),o),E},a.prototype.fill=function(r,o,p,_){if(typeof r=="string"){if(typeof o=="string"?(_=o,o=0,p=this.length):typeof p=="string"&&(_=p,p=this.length),_!==void 0&&typeof _!="string")throw new TypeError("encoding must be a string");if(typeof _=="string"&&!a.isEncoding(_))throw new TypeError("Unknown encoding: "+_);if(r.length===1){let C=r.charCodeAt(0);(_==="utf8"&&C<128||_==="latin1")&&(r=C)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(o<0||this.length<o||this.length<p)throw new RangeError("Out of range index");if(p<=o)return this;o=o>>>0,p=p===void 0?this.length:p>>>0,r||(r=0);let E;if(typeof r=="number")for(E=o;E<p;++E)this[E]=r;else{let C=a.isBuffer(r)?r:a.from(r,_),X=C.length;if(X===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(E=0;E<p-o;++E)this[E+o]=C[E%X]}return this};let Me={};function Je(u,r,o){Me[u]=class extends o{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${u}]`,this.stack,delete this.name}get code(){return u}set code(_){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:_,writable:!0})}toString(){return`${this.name} [${u}]: ${this.message}`}}}Je("ERR_BUFFER_OUT_OF_BOUNDS",function(u){return u?`${u} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Je("ERR_INVALID_ARG_TYPE",function(u,r){return`The "${u}" argument must be of type number. Received type ${typeof r}`},TypeError),Je("ERR_OUT_OF_RANGE",function(u,r,o){let p=`The value of "${u}" is out of range.`,_=o;return Number.isInteger(o)&&Math.abs(o)>2**32?_=Xe(String(o)):typeof o=="bigint"&&(_=String(o),(o>BigInt(2)**BigInt(32)||o<-(BigInt(2)**BigInt(32)))&&(_=Xe(_)),_+="n"),p+=` It must be ${r}. Received ${_}`,p},RangeError);function Xe(u){let r="",o=u.length,p=u[0]==="-"?1:0;for(;o>=p+4;o-=3)r=`_${u.slice(o-3,o)}${r}`;return`${u.slice(0,o)}${r}`}function xt(u,r,o){Be(r,"offset"),(u[r]===void 0||u[r+o]===void 0)&&He(r,u.length-(o+1))}function Qe(u,r,o,p,_,E){if(u>o||u<r){let C=typeof r=="bigint"?"n":"",X;throw r===0||r===BigInt(0)?X=`>= 0${C} and < 2${C} ** ${(E+1)*8}${C}`:X=`>= -(2${C} ** ${(E+1)*8-1}${C}) and < 2 ** ${(E+1)*8-1}${C}`,new Me.ERR_OUT_OF_RANGE("value",X,u)}xt(p,_,E)}function Be(u,r){if(typeof u!="number")throw new Me.ERR_INVALID_ARG_TYPE(r,"number",u)}function He(u,r,o){throw Math.floor(u)!==u?(Be(u,o),new Me.ERR_OUT_OF_RANGE("offset","an integer",u)):r<0?new Me.ERR_BUFFER_OUT_OF_BOUNDS:new Me.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${r}`,u)}let Ze=/[^+/0-9A-Za-z-_]/g;function et(u){if(u=u.split("=")[0],u=u.trim().replace(Ze,""),u.length<2)return"";for(;u.length%4!==0;)u=u+"=";return u}function bt(u,r){r=r||1/0;let o,p=u.length,_=null,E=[];for(let C=0;C<p;++C){if(o=u.charCodeAt(C),o>55295&&o<57344){if(!_){if(o>56319){(r-=3)>-1&&E.push(239,191,189);continue}else if(C+1===p){(r-=3)>-1&&E.push(239,191,189);continue}_=o;continue}if(o<56320){(r-=3)>-1&&E.push(239,191,189),_=o;continue}o=(_-55296<<10|o-56320)+65536}else _&&(r-=3)>-1&&E.push(239,191,189);if(_=null,o<128){if((r-=1)<0)break;E.push(o)}else if(o<2048){if((r-=2)<0)break;E.push(o>>6|192,o&63|128)}else if(o<65536){if((r-=3)<0)break;E.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((r-=4)<0)break;E.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return E}function $t(u){let r=[];for(let o=0;o<u.length;++o)r.push(u.charCodeAt(o)&255);return r}function jt(u,r){let o,p,_,E=[];for(let C=0;C<u.length&&!((r-=2)<0);++C)o=u.charCodeAt(C),p=o>>8,_=o%256,E.push(_),E.push(p);return E}function vt(u){return e.toByteArray(et(u))}function ve(u,r,o,p){let _;for(_=0;_<p&&!(_+o>=r.length||_>=u.length);++_)r[_+o]=u[_];return _}function Ee(u,r){return u instanceof r||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===r.name}function Re(u){return u!==u}let lt=function(){let u="0123456789abcdef",r=new Array(256);for(let o=0;o<16;++o){let p=o*16;for(let _=0;_<16;++_)r[p+_]=u[o]+u[_]}return r}();function Ie(u){return typeof BigInt>"u"?Fr:u}function Fr(){throw new Error("BigInt not supported")}return nt}var Et,ci,Zt,fi,nt,li,di=ce(()=>{"use strict";U();O();P();Et={},ci=!1;Zt={},fi=!1;nt={},li=!1});var hi={};Kt(hi,{Buffer:()=>Y,INSPECT_MAX_BYTES:()=>As,default:()=>qe,kMaxLength:()=>Is});var qe,Y,As,Is,Dr=ce(()=>{"use strict";U();O();P();di();qe=pi();qe.Buffer;qe.SlowBuffer;qe.INSPECT_MAX_BYTES;qe.kMaxLength;Y=qe.Buffer,As=qe.INSPECT_MAX_BYTES,Is=qe.kMaxLength});var O=ce(()=>{"use strict";Dr()});var yi={};Kt(yi,{default:()=>Fs});var Fs,wi=ce(()=>{"use strict";U();O();P();Fs={}});var gi=Gt((vc,tr)=>{"use strict";U();O();P();(function(){"use strict";var e="input is invalid type",t=typeof window=="object",n=t?window:{};n.JS_SHA256_NO_WINDOW&&(t=!1);var s=!t&&typeof self=="object",c=!n.JS_SHA256_NO_NODE_JS&&typeof W=="object"&&W.versions&&W.versions.node;c?n=global:s&&(n=self);var f=!n.JS_SHA256_NO_COMMON_JS&&typeof tr=="object"&&tr.exports,a=typeof define=="function"&&define.amd,m=!n.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),A=[-2147483648,8388608,32768,128],R=[24,16,8,0],g=[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],S=["hex","array","digest","arrayBuffer"],h=[];(n.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}),m&&(n.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(x){return typeof x=="object"&&x.buffer&&x.buffer.constructor===ArrayBuffer});var b=function(x,N){return function($){return new k(N,!0).update($)[x]()}},v=function(x){var N=b("hex",x);c&&(N=I(N,x)),N.create=function(){return new k(x)},N.update=function(V){return N.create().update(V)};for(var $=0;$<S.length;++$){var T=S[$];N[T]=b(T,x)}return N},I=function(x,N){var $=(wi(),Mr(yi)),T=(Dr(),Mr(hi)).Buffer,V=N?"sha224":"sha256",M;T.from&&!n.JS_SHA256_NO_BUFFER_FROM?M=T.from:M=function(L){return new T(L)};var K=function(L){if(typeof L=="string")return $.createHash(V).update(L,"utf8").digest("hex");if(L==null)throw new Error(e);return L.constructor===ArrayBuffer&&(L=new Uint8Array(L)),Array.isArray(L)||ArrayBuffer.isView(L)||L.constructor===T?$.createHash(V).update(M(L)).digest("hex"):x(L)};return K},l=function(x,N){return function($,T){return new D($,N,!0).update(T)[x]()}},w=function(x){var N=l("hex",x);N.create=function(V){return new D(V,x)},N.update=function(V,M){return N.create(V).update(M)};for(var $=0;$<S.length;++$){var T=S[$];N[T]=l(T,x)}return N};function k(x,N){N?(h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=x}k.prototype.update=function(x){if(!this.finalized){var N,$=typeof x;if($!=="string"){if($==="object"){if(x===null)throw new Error(e);if(m&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!m||!ArrayBuffer.isView(x)))throw new Error(e)}else throw new Error(e);N=!0}for(var T,V=0,M,K=x.length,L=this.blocks;V<K;){if(this.hashed&&(this.hashed=!1,L[0]=this.block,this.block=L[16]=L[1]=L[2]=L[3]=L[4]=L[5]=L[6]=L[7]=L[8]=L[9]=L[10]=L[11]=L[12]=L[13]=L[14]=L[15]=0),N)for(M=this.start;V<K&&M<64;++V)L[M>>>2]|=x[V]<<R[M++&3];else for(M=this.start;V<K&&M<64;++V)T=x.charCodeAt(V),T<128?L[M>>>2]|=T<<R[M++&3]:T<2048?(L[M>>>2]|=(192|T>>>6)<<R[M++&3],L[M>>>2]|=(128|T&63)<<R[M++&3]):T<55296||T>=57344?(L[M>>>2]|=(224|T>>>12)<<R[M++&3],L[M>>>2]|=(128|T>>>6&63)<<R[M++&3],L[M>>>2]|=(128|T&63)<<R[M++&3]):(T=65536+((T&1023)<<10|x.charCodeAt(++V)&1023),L[M>>>2]|=(240|T>>>18)<<R[M++&3],L[M>>>2]|=(128|T>>>12&63)<<R[M++&3],L[M>>>2]|=(128|T>>>6&63)<<R[M++&3],L[M>>>2]|=(128|T&63)<<R[M++&3]);this.lastByteIndex=M,this.bytes+=M-this.start,M>=64?(this.block=L[16],this.start=M-64,this.hash(),this.hashed=!0):this.start=M}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var x=this.blocks,N=this.lastByteIndex;x[16]=this.block,x[N>>>2]|=A[N&3],this.block=x[16],N>=56&&(this.hashed||this.hash(),x[0]=this.block,x[16]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=x[8]=x[9]=x[10]=x[11]=x[12]=x[13]=x[14]=x[15]=0),x[14]=this.hBytes<<3|this.bytes>>>29,x[15]=this.bytes<<3,this.hash()}},k.prototype.hash=function(){var x=this.h0,N=this.h1,$=this.h2,T=this.h3,V=this.h4,M=this.h5,K=this.h6,L=this.h7,J=this.blocks,ie,ge,te,Se,ee,re,ue,Te,Pe,ke,Oe;for(ie=16;ie<64;++ie)ee=J[ie-15],ge=(ee>>>7|ee<<25)^(ee>>>18|ee<<14)^ee>>>3,ee=J[ie-2],te=(ee>>>17|ee<<15)^(ee>>>19|ee<<13)^ee>>>10,J[ie]=J[ie-16]+ge+J[ie-7]+te<<0;for(Oe=N&$,ie=0;ie<64;ie+=4)this.first?(this.is224?(Te=300032,ee=J[0]-1413257819,L=ee-150054599<<0,T=ee+24177077<<0):(Te=704751109,ee=J[0]-210244248,L=ee-1521486534<<0,T=ee+143694565<<0),this.first=!1):(ge=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),te=(V>>>6|V<<26)^(V>>>11|V<<21)^(V>>>25|V<<7),Te=x&N,Se=Te^x&$^Oe,ue=V&M^~V&K,ee=L+te+ue+g[ie]+J[ie],re=ge+Se,L=T+ee<<0,T=ee+re<<0),ge=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),te=(L>>>6|L<<26)^(L>>>11|L<<21)^(L>>>25|L<<7),Pe=T&x,Se=Pe^T&N^Te,ue=L&V^~L&M,ee=K+te+ue+g[ie+1]+J[ie+1],re=ge+Se,K=$+ee<<0,$=ee+re<<0,ge=($>>>2|$<<30)^($>>>13|$<<19)^($>>>22|$<<10),te=(K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7),ke=$&T,Se=ke^$&x^Pe,ue=K&L^~K&V,ee=M+te+ue+g[ie+2]+J[ie+2],re=ge+Se,M=N+ee<<0,N=ee+re<<0,ge=(N>>>2|N<<30)^(N>>>13|N<<19)^(N>>>22|N<<10),te=(M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7),Oe=N&$,Se=Oe^N&T^ke,ue=M&K^~M&L,ee=V+te+ue+g[ie+3]+J[ie+3],re=ge+Se,V=x+ee<<0,x=ee+re<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+x<<0,this.h1=this.h1+N<<0,this.h2=this.h2+$<<0,this.h3=this.h3+T<<0,this.h4=this.h4+V<<0,this.h5=this.h5+M<<0,this.h6=this.h6+K<<0,this.h7=this.h7+L<<0},k.prototype.hex=function(){this.finalize();var x=this.h0,N=this.h1,$=this.h2,T=this.h3,V=this.h4,M=this.h5,K=this.h6,L=this.h7,J=d[x>>>28&15]+d[x>>>24&15]+d[x>>>20&15]+d[x>>>16&15]+d[x>>>12&15]+d[x>>>8&15]+d[x>>>4&15]+d[x&15]+d[N>>>28&15]+d[N>>>24&15]+d[N>>>20&15]+d[N>>>16&15]+d[N>>>12&15]+d[N>>>8&15]+d[N>>>4&15]+d[N&15]+d[$>>>28&15]+d[$>>>24&15]+d[$>>>20&15]+d[$>>>16&15]+d[$>>>12&15]+d[$>>>8&15]+d[$>>>4&15]+d[$&15]+d[T>>>28&15]+d[T>>>24&15]+d[T>>>20&15]+d[T>>>16&15]+d[T>>>12&15]+d[T>>>8&15]+d[T>>>4&15]+d[T&15]+d[V>>>28&15]+d[V>>>24&15]+d[V>>>20&15]+d[V>>>16&15]+d[V>>>12&15]+d[V>>>8&15]+d[V>>>4&15]+d[V&15]+d[M>>>28&15]+d[M>>>24&15]+d[M>>>20&15]+d[M>>>16&15]+d[M>>>12&15]+d[M>>>8&15]+d[M>>>4&15]+d[M&15]+d[K>>>28&15]+d[K>>>24&15]+d[K>>>20&15]+d[K>>>16&15]+d[K>>>12&15]+d[K>>>8&15]+d[K>>>4&15]+d[K&15];return this.is224||(J+=d[L>>>28&15]+d[L>>>24&15]+d[L>>>20&15]+d[L>>>16&15]+d[L>>>12&15]+d[L>>>8&15]+d[L>>>4&15]+d[L&15]),J},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(){this.finalize();var x=this.h0,N=this.h1,$=this.h2,T=this.h3,V=this.h4,M=this.h5,K=this.h6,L=this.h7,J=[x>>>24&255,x>>>16&255,x>>>8&255,x&255,N>>>24&255,N>>>16&255,N>>>8&255,N&255,$>>>24&255,$>>>16&255,$>>>8&255,$&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255,V>>>24&255,V>>>16&255,V>>>8&255,V&255,M>>>24&255,M>>>16&255,M>>>8&255,M&255,K>>>24&255,K>>>16&255,K>>>8&255,K&255];return this.is224||J.push(L>>>24&255,L>>>16&255,L>>>8&255,L&255),J},k.prototype.array=k.prototype.digest,k.prototype.arrayBuffer=function(){this.finalize();var x=new ArrayBuffer(this.is224?28:32),N=new DataView(x);return N.setUint32(0,this.h0),N.setUint32(4,this.h1),N.setUint32(8,this.h2),N.setUint32(12,this.h3),N.setUint32(16,this.h4),N.setUint32(20,this.h5),N.setUint32(24,this.h6),this.is224||N.setUint32(28,this.h7),x};function D(x,N,$){var T,V=typeof x;if(V==="string"){var M=[],K=x.length,L=0,J;for(T=0;T<K;++T)J=x.charCodeAt(T),J<128?M[L++]=J:J<2048?(M[L++]=192|J>>>6,M[L++]=128|J&63):J<55296||J>=57344?(M[L++]=224|J>>>12,M[L++]=128|J>>>6&63,M[L++]=128|J&63):(J=65536+((J&1023)<<10|x.charCodeAt(++T)&1023),M[L++]=240|J>>>18,M[L++]=128|J>>>12&63,M[L++]=128|J>>>6&63,M[L++]=128|J&63);x=M}else if(V==="object"){if(x===null)throw new Error(e);if(m&&x.constructor===ArrayBuffer)x=new Uint8Array(x);else if(!Array.isArray(x)&&(!m||!ArrayBuffer.isView(x)))throw new Error(e)}else throw new Error(e);x.length>64&&(x=new k(N,!0).update(x).array());var ie=[],ge=[];for(T=0;T<64;++T){var te=x[T]||0;ie[T]=92^te,ge[T]=54^te}k.call(this,N,$),this.update(ge),this.oKeyPad=ie,this.inner=!0,this.sharedMemory=$}D.prototype=new k,D.prototype.finalize=function(){if(k.prototype.finalize.call(this),this.inner){this.inner=!1;var x=this.array();k.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(x),k.prototype.finalize.call(this)}};var F=v();F.sha256=F,F.sha224=v(!0),F.sha256.hmac=w(),F.sha224.hmac=w(!0),f?tr.exports=F:(n.sha256=F.sha256,n.sha224=F.sha224,a&&define(function(){return F}))})()});function dt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var rr=ce(()=>{"use strict";U();O();P()});function Wr(e){return dt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var xi=ce(()=>{"use strict";U();O();P();rr()});var Vr,bi=ce(()=>{"use strict";U();O();P();Vr="2.22.10"});function vi(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?vi(e.cause,t):t?null:e}var At,Fe,It=ce(()=>{"use strict";U();O();P();bi();At={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e!=null?e:"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Vr}`},Fe=class e extends Error{constructor(t,n={}){var m,d;let s=(()=>{var A;return n.cause instanceof e?n.cause.details:(A=n.cause)!=null&&A.message?n.cause.message:n.details})(),c=n.cause instanceof e&&n.cause.docsPath||n.docsPath,f=(m=At.getDocsUrl)==null?void 0:m.call(At,{...n,docsPath:c}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...f?[`Docs: ${f}`]:[],...s?[`Details: ${s}`]:[],...At.version?[`Version: ${At.version}`]:[]].join(`
|
|
2
|
-
`);super(a,n.cause?{cause:n.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=s,this.docsPath=c,this.metaMessages=n.metaMessages,this.name=(d=n.name)!=null?d:this.name,this.shortMessage=t,this.version=Vr}walk(t){return vi(this,t)}}});var St,Ei=ce(()=>{"use strict";U();O();P();It();St=class extends Fe{constructor({size:t,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}});function Ue(e,{dir:t,size:n=32}={}){return typeof e=="string"?Ai(e,{dir:t,size:n}):Ii(e,{dir:t,size:n})}function Ai(e,{dir:t,size:n=32}={}){if(n===null)return e;let s=e.replace("0x","");if(s.length>n*2)throw new St({size:Math.ceil(s.length/2),targetSize:n,type:"hex"});return`0x${s[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Ii(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new St({size:e.length,targetSize:n,type:"bytes"});let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=t==="right";s[f?c:n-c-1]=e[f?c:e.length-c-1]}return s}var nr=ce(()=>{"use strict";U();O();P();Ei()});var or,ir,qr=ce(()=>{"use strict";U();O();P();It();or=class extends Fe{constructor({max:t,min:n,signed:s,size:c,value:f}){super(`Number "${f}" is not in safe ${c?`${c*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}},ir=class extends Fe{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function ot(e,{size:t}){if(Wr(e)>t)throw new ir({givenSize:Wr(e),maxSize:t})}var Yr=ce(()=>{"use strict";U();O();P();qr();xi()});function Ye(e,t={}){return typeof e=="number"||typeof e=="bigint"?ar(e,t):typeof e=="string"?Ti(e,t):typeof e=="boolean"?Si(e,t):Tt(e,t)}function Si(e,t={}){let n=`0x${Number(e)}`;return typeof t.size=="number"?(ot(n,{size:t.size}),Ue(n,{size:t.size})):n}function Tt(e,t={}){let n="";for(let c=0;c<e.length;c++)n+=Us[e[c]];let s=`0x${n}`;return typeof t.size=="number"?(ot(s,{size:t.size}),Ue(s,{dir:"right",size:t.size})):s}function ar(e,t={}){let{signed:n,size:s}=t,c=BigInt(e),f;s?n?f=(1n<<BigInt(s)*8n-1n)-1n:f=2n**(BigInt(s)*8n)-1n:typeof e=="number"&&(f=BigInt(Number.MAX_SAFE_INTEGER));let a=typeof f=="bigint"&&n?-f-1n:0;if(f&&c>f||c<a){let d=typeof e=="bigint"?"n":"";throw new or({max:f?`${f}${d}`:void 0,min:`${a}${d}`,signed:n,size:s,value:`${e}${d}`})}let m=`0x${(n&&c<0?(1n<<BigInt(s*8))+BigInt(c):c).toString(16)}`;return s?Ue(m,{size:s}):m}function Ti(e,t={}){let n=Ps.encode(e);return Tt(n,t)}var Us,Ps,sr=ce(()=>{"use strict";U();O();P();qr();nr();Yr();Us=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Ps=new TextEncoder});function Gr(e,t={}){return typeof e=="number"||typeof e=="bigint"?Bi(e,t):typeof e=="boolean"?ki(e,t):dt(e)?Ct(e,t):ur(e,t)}function ki(e,t={}){let n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(ot(n,{size:t.size}),Ue(n,{size:t.size})):n}function Ci(e){if(e>=ze.zero&&e<=ze.nine)return e-ze.zero;if(e>=ze.A&&e<=ze.F)return e-(ze.A-10);if(e>=ze.a&&e<=ze.f)return e-(ze.a-10)}function Ct(e,t={}){let n=e;t.size&&(ot(n,{size:t.size}),n=Ue(n,{dir:"right",size:t.size}));let s=n.slice(2);s.length%2&&(s=`0${s}`);let c=s.length/2,f=new Uint8Array(c);for(let a=0,m=0;a<c;a++){let d=Ci(s.charCodeAt(m++)),A=Ci(s.charCodeAt(m++));if(d===void 0||A===void 0)throw new Fe(`Invalid byte sequence ("${s[m-2]}${s[m-1]}" in "${s}").`);f[a]=d*16+A}return f}function Bi(e,t){let n=ar(e,t);return Ct(n)}function ur(e,t={}){let n=Os.encode(e);return typeof t.size=="number"?(ot(n,{size:t.size}),Ue(n,{dir:"right",size:t.size})):n}var Os,ze,cr=ce(()=>{"use strict";U();O();P();It();rr();nr();Yr();sr();Os=new TextEncoder;ze={zero:48,nine:57,A:65,F:70,a:97,f:102}});function Kr(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ms(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function kt(e,...t){if(!Ms(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Jr(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ri(e,t){kt(e);let n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}var Xr=ce(()=>{"use strict";U();O();P()});function Ns(e,t=!1){return t?{h:Number(e&fr),l:Number(e>>Fi&fr)}:{h:Number(e>>Fi&fr)|0,l:Number(e&fr)|0}}function Ui(e,t=!1){let n=new Uint32Array(e.length),s=new Uint32Array(e.length);for(let c=0;c<e.length;c++){let{h:f,l:a}=Ns(e[c],t);[n[c],s[c]]=[f,a]}return[n,s]}var fr,Fi,Pi,Oi,Mi,Ni,Li=ce(()=>{"use strict";U();O();P();fr=BigInt(4294967295),Fi=BigInt(32);Pi=(e,t,n)=>e<<n|t>>>32-n,Oi=(e,t,n)=>t<<n|e>>>32-n,Mi=(e,t,n)=>t<<n-32|e>>>64-n,Ni=(e,t,n)=>e<<n-32|t>>>64-n});function Zr(e){for(let t=0;t<e.length;t++)e[t]=Ls(e[t])}function Hs(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function pr(e){return typeof e=="string"&&(e=Hs(e)),kt(e),e}function Di(e){let t=s=>e().update(pr(s)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function $i(e){let t=(s,c)=>e(c).update(pr(s)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=s=>e(s),t}var Hi,Qr,Ls,lr,ji=ce(()=>{"use strict";U();O();P();Xr();Hi=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Qr=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Ls=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;lr=class{clone(){return this._cloneInto()}}});function Ys(e,t=24){let n=new Uint32Array(10);for(let s=24-t;s<24;s++){for(let a=0;a<10;a++)n[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let m=(a+8)%10,d=(a+2)%10,A=n[d],R=n[d+1],g=zi(A,R,1)^n[m],S=Wi(A,R,1)^n[m+1];for(let h=0;h<50;h+=10)e[a+h]^=g,e[a+h+1]^=S}let c=e[2],f=e[3];for(let a=0;a<24;a++){let m=qi[a],d=zi(c,f,m),A=Wi(c,f,m),R=Vi[a];c=e[R],f=e[R+1],e[R]=d,e[R+1]=A}for(let a=0;a<50;a+=10){for(let m=0;m<10;m++)n[m]=e[a+m];for(let m=0;m<10;m++)e[a+m]^=~n[(m+2)%10]&n[(m+4)%10]}e[0]^=Vs[s],e[1]^=qs[s]}n.fill(0)}var Vi,qi,Yi,Ds,Bt,$s,js,zs,Ws,Vs,qs,zi,Wi,dr,Ge,Vf,qf,Yf,Gf,Kf,Gi,Jf,Xf,Ki,Qf,Zf,Ji=ce(()=>{"use strict";U();O();P();Xr();Li();ji();Vi=[],qi=[],Yi=[],Ds=BigInt(0),Bt=BigInt(1),$s=BigInt(2),js=BigInt(7),zs=BigInt(256),Ws=BigInt(113);for(let e=0,t=Bt,n=1,s=0;e<24;e++){[n,s]=[s,(2*n+3*s)%5],Vi.push(2*(5*s+n)),qi.push((e+1)*(e+2)/2%64);let c=Ds;for(let f=0;f<7;f++)t=(t<<Bt^(t>>js)*Ws)%zs,t&$s&&(c^=Bt<<(Bt<<BigInt(f))-Bt);Yi.push(c)}[Vs,qs]=Ui(Yi,!0),zi=(e,t,n)=>n>32?Mi(e,t,n):Pi(e,t,n),Wi=(e,t,n)=>n>32?Ni(e,t,n):Oi(e,t,n);dr=class e extends lr{constructor(t,n,s,c=!1,f=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=s,this.enableXOF=c,this.rounds=f,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Kr(s),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Hi(this.state)}keccak(){Qr||Zr(this.state32),Ys(this.state32,this.rounds),Qr||Zr(this.state32),this.posOut=0,this.pos=0}update(t){Jr(this);let{blockLen:n,state:s}=this;t=pr(t);let c=t.length;for(let f=0;f<c;){let a=Math.min(n-this.pos,c-f);for(let m=0;m<a;m++)s[this.pos++]^=t[f++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:s,blockLen:c}=this;t[s]^=n,n&128&&s===c-1&&this.keccak(),t[c-1]^=128,this.keccak()}writeInto(t){Jr(this,!1),kt(t),this.finish();let n=this.state,{blockLen:s}=this;for(let c=0,f=t.length;c<f;){this.posOut>=s&&this.keccak();let a=Math.min(s-this.posOut,f-c);t.set(n.subarray(this.posOut,this.posOut+a),c),this.posOut+=a,c+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Kr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Ri(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:n,suffix:s,outputLen:c,rounds:f,enableXOF:a}=this;return t||(t=new e(n,s,c,a,f)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=f,t.suffix=s,t.outputLen=c,t.enableXOF=a,t.destroyed=this.destroyed,t}},Ge=(e,t,n)=>Di(()=>new dr(t,e,n)),Vf=Ge(6,144,224/8),qf=Ge(6,136,256/8),Yf=Ge(6,104,384/8),Gf=Ge(6,72,512/8),Kf=Ge(1,144,224/8),Gi=Ge(1,136,256/8),Jf=Ge(1,104,384/8),Xf=Ge(1,72,512/8),Ki=(e,t,n)=>$i((s={})=>new dr(t,e,s.dkLen===void 0?n:s.dkLen,!0)),Qf=Ki(31,168,128/8),Zf=Ki(31,136,256/8)});function Rt(e,t){let n=t||"hex",s=Gi(dt(e,{strict:!1})?Gr(e):e);return n==="bytes"?s:Ye(s)}var en=ce(()=>{"use strict";U();O();P();Ji();rr();cr();sr()});var Ft,Xi=ce(()=>{"use strict";U();O();P();It();Ft=class extends Fe{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var ht,tn=ce(()=>{"use strict";U();O();P();ht=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){let s=this.keys().next().value;s&&this.delete(s)}return this}}});function Qi(e,t){if(rn.has(`${e}.${t}`))return rn.get(`${e}.${t}`);let n=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),s=Rt(ur(n),"bytes"),c=(t?n.substring(`${t}0x`.length):n).split("");for(let a=0;a<40;a+=2)s[a>>1]>>4>=8&&c[a]&&(c[a]=c[a].toUpperCase()),(s[a>>1]&15)>=8&&c[a+1]&&(c[a+1]=c[a+1].toUpperCase());let f=`0x${c.join("")}`;return rn.set(`${e}.${t}`,f),f}var rn,Zi=ce(()=>{"use strict";U();O();P();cr();en();tn();rn=new ht(8192)});function on(e,t){let{strict:n=!0}=t!=null?t:{},s=`${e}.${n}`;if(nn.has(s))return nn.get(s);let c=Gs.test(e)?e.toLowerCase()===e?!0:n?Qi(e)===e:!0:!1;return nn.set(s,c),c}var Gs,nn,ea=ce(()=>{"use strict";U();O();P();tn();Zi();Gs=/^0x[a-fA-F0-9]{40}$/,nn=new ht(8192)});function an(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}var ta=ce(()=>{"use strict";U();O();P()});function sn(e,t){if(!on(e,{strict:!1}))throw new Ft({address:e});if(!on(t,{strict:!1}))throw new Ft({address:t});return e.toLowerCase()===t.toLowerCase()}var ra=ce(()=>{"use strict";U();O();P();Xi();ea()});var ls=Gt(Q=>{"use strict";U();O();P();var Tn=Symbol.for("react.transitional.element"),Uu=Symbol.for("react.portal"),Pu=Symbol.for("react.fragment"),Ou=Symbol.for("react.strict_mode"),Mu=Symbol.for("react.profiler"),Nu=Symbol.for("react.consumer"),Lu=Symbol.for("react.context"),Hu=Symbol.for("react.forward_ref"),Du=Symbol.for("react.suspense"),$u=Symbol.for("react.memo"),is=Symbol.for("react.lazy"),es=Symbol.iterator;function ju(e){return e===null||typeof e!="object"?null:(e=es&&e[es]||e["@@iterator"],typeof e=="function"?e:null)}var as={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ss=Object.assign,us={};function gt(e,t,n){this.props=e,this.context=t,this.refs=us,this.updater=n||as}gt.prototype.isReactComponent={};gt.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};gt.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cs(){}cs.prototype=gt.prototype;function Cn(e,t,n){this.props=e,this.context=t,this.refs=us,this.updater=n||as}var kn=Cn.prototype=new cs;kn.constructor=Cn;ss(kn,gt.prototype);kn.isPureReactComponent=!0;var ts=Array.isArray,he={H:null,A:null,T:null,S:null},fs=Object.prototype.hasOwnProperty;function Bn(e,t,n,s,c,f){return n=f.ref,{$$typeof:Tn,type:e,key:t,ref:n!==void 0?n:null,props:f}}function zu(e,t){return Bn(e.type,t,void 0,void 0,void 0,e.props)}function Rn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Tn}function Wu(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var rs=/\/+/g;function Sn(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wu(""+e.key):t.toString(36)}function ns(){}function Vu(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(ns,ns):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function wt(e,t,n,s,c){var f=typeof e;(f==="undefined"||f==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(f){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Tn:case Uu:a=!0;break;case is:return a=e._init,wt(a(e._payload),t,n,s,c)}}if(a)return c=c(e),a=s===""?"."+Sn(e,0):s,ts(c)?(n="",a!=null&&(n=a.replace(rs,"$&/")+"/"),wt(c,t,n,"",function(A){return A})):c!=null&&(Rn(c)&&(c=zu(c,n+(c.key==null||e&&e.key===c.key?"":(""+c.key).replace(rs,"$&/")+"/")+a)),t.push(c)),1;a=0;var m=s===""?".":s+":";if(ts(e))for(var d=0;d<e.length;d++)s=e[d],f=m+Sn(s,d),a+=wt(s,t,n,f,c);else if(d=ju(e),typeof d=="function")for(e=d.call(e),d=0;!(s=e.next()).done;)s=s.value,f=m+Sn(s,d++),a+=wt(s,t,n,f,c);else if(f==="object"){if(typeof e.then=="function")return wt(Vu(e),t,n,s,c);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function kr(e,t,n){if(e==null)return e;var s=[],c=0;return wt(e,s,"","",function(f){return t.call(n,f,c++)}),s}function qu(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var os=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof W=="object"&&typeof W.emit=="function"){W.emit("uncaughtException",e);return}console.error(e)};function Yu(){}Q.Children={map:kr,forEach:function(e,t,n){kr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return kr(e,function(){t++}),t},toArray:function(e){return kr(e,function(t){return t})||[]},only:function(e){if(!Rn(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Q.Component=gt;Q.Fragment=Pu;Q.Profiler=Mu;Q.PureComponent=Cn;Q.StrictMode=Ou;Q.Suspense=Du;Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=he;Q.act=function(){throw Error("act(...) is not supported in production builds of React.")};Q.cache=function(e){return function(){return e.apply(null,arguments)}};Q.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var s=ss({},e.props),c=e.key,f=void 0;if(t!=null)for(a in t.ref!==void 0&&(f=void 0),t.key!==void 0&&(c=""+t.key),t)!fs.call(t,a)||a==="key"||a==="__self"||a==="__source"||a==="ref"&&t.ref===void 0||(s[a]=t[a]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var m=Array(a),d=0;d<a;d++)m[d]=arguments[d+2];s.children=m}return Bn(e.type,c,void 0,void 0,f,s)};Q.createContext=function(e){return e={$$typeof:Lu,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:Nu,_context:e},e};Q.createElement=function(e,t,n){var s,c={},f=null;if(t!=null)for(s in t.key!==void 0&&(f=""+t.key),t)fs.call(t,s)&&s!=="key"&&s!=="__self"&&s!=="__source"&&(c[s]=t[s]);var a=arguments.length-2;if(a===1)c.children=n;else if(1<a){for(var m=Array(a),d=0;d<a;d++)m[d]=arguments[d+2];c.children=m}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)c[s]===void 0&&(c[s]=a[s]);return Bn(e,f,void 0,void 0,null,c)};Q.createRef=function(){return{current:null}};Q.forwardRef=function(e){return{$$typeof:Hu,render:e}};Q.isValidElement=Rn;Q.lazy=function(e){return{$$typeof:is,_payload:{_status:-1,_result:e},_init:qu}};Q.memo=function(e,t){return{$$typeof:$u,type:e,compare:t===void 0?null:t}};Q.startTransition=function(e){var t=he.T,n={};he.T=n;try{var s=e(),c=he.S;c!==null&&c(n,s),typeof s=="object"&&s!==null&&typeof s.then=="function"&&s.then(Yu,os)}catch(f){os(f)}finally{he.T=t}};Q.unstable_useCacheRefresh=function(){return he.H.useCacheRefresh()};Q.use=function(e){return he.H.use(e)};Q.useActionState=function(e,t,n){return he.H.useActionState(e,t,n)};Q.useCallback=function(e,t){return he.H.useCallback(e,t)};Q.useContext=function(e){return he.H.useContext(e)};Q.useDebugValue=function(){};Q.useDeferredValue=function(e,t){return he.H.useDeferredValue(e,t)};Q.useEffect=function(e,t){return he.H.useEffect(e,t)};Q.useId=function(){return he.H.useId()};Q.useImperativeHandle=function(e,t,n){return he.H.useImperativeHandle(e,t,n)};Q.useInsertionEffect=function(e,t){return he.H.useInsertionEffect(e,t)};Q.useLayoutEffect=function(e,t){return he.H.useLayoutEffect(e,t)};Q.useMemo=function(e,t){return he.H.useMemo(e,t)};Q.useOptimistic=function(e,t){return he.H.useOptimistic(e,t)};Q.useReducer=function(e,t,n){return he.H.useReducer(e,t,n)};Q.useRef=function(e){return he.H.useRef(e)};Q.useState=function(e){return he.H.useState(e)};Q.useSyncExternalStore=function(e,t,n){return he.H.useSyncExternalStore(e,t,n)};Q.useTransition=function(){return he.H.useTransition()};Q.version="19.0.0"});var ps=Gt((Z,Br)=>{"use strict";U();O();P();W.env.NODE_ENV!=="production"&&function(){function e(i,y){Object.defineProperty(s.prototype,i,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",y[0],y[1])}})}function t(i){return i===null||typeof i!="object"?null:(i=$t&&i[$t]||i["@@iterator"],typeof i=="function"?i:null)}function n(i,y){i=(i=i.constructor)&&(i.displayName||i.name)||"ReactClass";var B=i+"."+y;jt[B]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",y,i),jt[B]=!0)}function s(i,y,B){this.props=i,this.context=y,this.refs=Ee,this.updater=B||vt}function c(){}function f(i,y,B){this.props=i,this.context=y,this.refs=Ee,this.updater=B||vt}function a(i){return""+i}function m(i){try{a(i);var y=!1}catch{y=!0}if(y){y=console;var B=y.error,H=typeof Symbol=="function"&&Symbol.toStringTag&&i[Symbol.toStringTag]||i.constructor.name||"Object";return B.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",H),a(i)}}function d(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Fr?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case ft:return"Fragment";case Oe:return"Portal";case Je:return"Profiler";case Me:return"StrictMode";case Be:return"Suspense";case He:return"SuspenseList"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case xt:return(i.displayName||"Context")+".Provider";case Xe:return(i._context.displayName||"Context")+".Consumer";case Qe:var y=i.render;return i=i.displayName,i||(i=y.displayName||y.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Ze:return y=i.displayName||null,y!==null?y:d(i.type)||"Memo";case et:y=i._payload,i=i._init;try{return d(i(y))}catch{}}return null}function A(i){return typeof i=="string"||typeof i=="function"||i===ft||i===Je||i===Me||i===Be||i===He||i===bt||typeof i=="object"&&i!==null&&(i.$$typeof===et||i.$$typeof===Ze||i.$$typeof===xt||i.$$typeof===Xe||i.$$typeof===Qe||i.$$typeof===o||i.getModuleId!==void 0)}function R(){}function g(){if(p===0){_=console.log,E=console.info,C=console.warn,X=console.error,le=console.group,fe=console.groupCollapsed,pe=console.groupEnd;var i={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}p++}function S(){if(p--,p===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ve({},i,{value:_}),info:ve({},i,{value:E}),warn:ve({},i,{value:C}),error:ve({},i,{value:X}),group:ve({},i,{value:le}),groupCollapsed:ve({},i,{value:fe}),groupEnd:ve({},i,{value:pe})})}0>p&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function h(i){if(ne===void 0)try{throw Error()}catch(B){var y=B.stack.trim().match(/\n( *(at )?)/);ne=y&&y[1]||"",Un=-1<B.stack.indexOf(`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Check the render method of \``+B+"`."),y||(i=d(i))&&(y=`
|
|
10
|
-
|
|
11
|
-
Check the top-level render call using <`+i+">."),y}function V(i){var y={"=":"=0",":":"=2"};return"$"+i.replace(/[=:]/g,function(B){return y[B]})}function M(i,y){return typeof i=="object"&&i!==null&&i.key!=null?(m(i.key),V(""+i.key)):y.toString(36)}function K(){}function L(i){switch(i.status){case"fulfilled":return i.value;case"rejected":throw i.reason;default:switch(typeof i.status=="string"?i.then(K,K):(i.status="pending",i.then(function(y){i.status==="pending"&&(i.status="fulfilled",i.value=y)},function(y){i.status==="pending"&&(i.status="rejected",i.reason=y)})),i.status){case"fulfilled":return i.value;case"rejected":throw i.reason}}throw i}function J(i,y,B,H,j){var q=typeof i;(q==="undefined"||q==="boolean")&&(i=null);var z=!1;if(i===null)z=!0;else switch(q){case"bigint":case"string":case"number":z=!0;break;case"object":switch(i.$$typeof){case ke:case Oe:z=!0;break;case et:return z=i._init,J(z(i._payload),y,B,H,j)}}if(z){z=i,j=j(z);var ae=H===""?"."+M(z,0):H;return Ie(j)?(B="",ae!=null&&(B=ae.replace(Hn,"$&/")+"/"),J(j,y,B,"",function(me){return me})):j!=null&&(N(j)&&(j.key!=null&&(z&&z.key===j.key||m(j.key)),B=F(j,B+(j.key==null||z&&z.key===j.key?"":(""+j.key).replace(Hn,"$&/")+"/")+ae),H!==""&&z!=null&&N(z)&&z.key==null&&z._store&&!z._store.validated&&(B._store.validated=2),j=B),y.push(j)),1}if(z=0,ae=H===""?".":H+":",Ie(i))for(var oe=0;oe<i.length;oe++)H=i[oe],q=ae+M(H,oe),z+=J(H,y,B,q,j);else if(oe=t(i),typeof oe=="function")for(oe===i.entries&&(Ln||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ln=!0),i=oe.call(i),oe=0;!(H=i.next()).done;)H=H.value,q=ae+M(H,oe++),z+=J(H,y,B,q,j);else if(q==="object"){if(typeof i.then=="function")return J(L(i),y,B,H,j);throw y=String(i),Error("Objects are not valid as a React child (found: "+(y==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":y)+"). If you meant to render a collection of children, use an array instead.")}return z}function ie(i,y,B){if(i==null)return i;var H=[],j=0;return J(i,H,"","",function(q){return y.call(B,q,j++)}),H}function ge(i){if(i._status===-1){var y=i._result;y=y(),y.then(function(B){(i._status===0||i._status===-1)&&(i._status=1,i._result=B)},function(B){(i._status===0||i._status===-1)&&(i._status=2,i._result=B)}),i._status===-1&&(i._status=0,i._result=y)}if(i._status===1)return y=i._result,y===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
12
|
-
|
|
13
|
-
Your code should look like:
|
|
14
|
-
const MyComponent = lazy(() => import('./MyComponent'))
|
|
15
|
-
|
|
16
|
-
Did you accidentally put curly braces around the import?`,y),"default"in y||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
17
|
-
|
|
18
|
-
Your code should look like:
|
|
19
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,y),y.default;throw i._result}function te(){var i=u.H;return i===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
20
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
21
|
-
2. You might be breaking the Rules of Hooks
|
|
22
|
-
3. You might have more than one copy of React in the same app
|
|
23
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),i}function Se(){}function ee(i){if(zt===null)try{var y=("require"+Math.random()).slice(0,7);zt=(Br&&Br[y]).call(Br,"timers").setImmediate}catch{zt=function(H){$n===!1&&($n=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var j=new MessageChannel;j.port1.onmessage=H,j.port2.postMessage(void 0)}}return zt(i)}function re(i){return 1<i.length&&typeof AggregateError=="function"?new AggregateError(i):i[0]}function ue(i,y){y!==Wt-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Wt=y}function Te(i,y,B){var H=u.actQueue;if(H!==null)if(H.length!==0)try{Pe(H),ee(function(){return Te(i,y,B)});return}catch(j){u.thrownErrors.push(j)}else u.actQueue=null;0<u.thrownErrors.length?(H=re(u.thrownErrors),u.thrownErrors.length=0,B(H)):y(i)}function Pe(i){if(!Or){Or=!0;var y=0;try{for(;y<i.length;y++){var B=i[y];do{u.didUsePromise=!1;var H=B(!1);if(H!==null){if(u.didUsePromise){i[y]=B,i.splice(0,y);return}B=H}else break}while(!0)}i.length=0}catch(j){i.splice(0,y+1),u.thrownErrors.push(j)}finally{Or=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var ke=Symbol.for("react.transitional.element"),Oe=Symbol.for("react.portal"),ft=Symbol.for("react.fragment"),Me=Symbol.for("react.strict_mode"),Je=Symbol.for("react.profiler");Symbol.for("react.provider");var Xe=Symbol.for("react.consumer"),xt=Symbol.for("react.context"),Qe=Symbol.for("react.forward_ref"),Be=Symbol.for("react.suspense"),He=Symbol.for("react.suspense_list"),Ze=Symbol.for("react.memo"),et=Symbol.for("react.lazy"),bt=Symbol.for("react.offscreen"),$t=Symbol.iterator,jt={},vt={isMounted:function(){return!1},enqueueForceUpdate:function(i){n(i,"forceUpdate")},enqueueReplaceState:function(i){n(i,"replaceState")},enqueueSetState:function(i){n(i,"setState")}},ve=Object.assign,Ee={};Object.freeze(Ee),s.prototype.isReactComponent={},s.prototype.setState=function(i,y){if(typeof i!="object"&&typeof i!="function"&&i!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,i,y,"setState")},s.prototype.forceUpdate=function(i){this.updater.enqueueForceUpdate(this,i,"forceUpdate")};var Re={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},lt;for(lt in Re)Re.hasOwnProperty(lt)&&e(lt,Re[lt]);c.prototype=s.prototype,Re=f.prototype=new c,Re.constructor=f,ve(Re,s.prototype),Re.isPureReactComponent=!0;var Ie=Array.isArray,Fr=Symbol.for("react.client.reference"),u={H:null,A:null,T:null,S:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null},r=Object.prototype.hasOwnProperty,o=Symbol.for("react.client.reference"),p=0,_,E,C,X,le,fe,pe;R.__reactDisabledLog=!0;var ne,Un,Ur=!1,Pr=new(typeof WeakMap=="function"?WeakMap:Map),ms=Symbol.for("react.client.reference"),Pn,On,Mn={},Nn={},Ln=!1,Hn=/\/+/g,Dn=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(y))return}else if(typeof W=="object"&&typeof W.emit=="function"){W.emit("uncaughtException",i);return}console.error(i)},$n=!1,zt=null,Wt=0,Vt=!1,Or=!1,jn=typeof queueMicrotask=="function"?function(i){queueMicrotask(function(){return queueMicrotask(i)})}:ee;Z.Children={map:ie,forEach:function(i,y,B){ie(i,function(){y.apply(this,arguments)},B)},count:function(i){var y=0;return ie(i,function(){y++}),y},toArray:function(i){return ie(i,function(y){return y})||[]},only:function(i){if(!N(i))throw Error("React.Children.only expected to receive a single React element child.");return i}},Z.Component=s,Z.Fragment=ft,Z.Profiler=Je,Z.PureComponent=f,Z.StrictMode=Me,Z.Suspense=Be,Z.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Z.act=function(i){var y=u.actQueue,B=Wt;Wt++;var H=u.actQueue=y!==null?y:[],j=!1;try{var q=i()}catch(oe){u.thrownErrors.push(oe)}if(0<u.thrownErrors.length)throw ue(y,B),i=re(u.thrownErrors),u.thrownErrors.length=0,i;if(q!==null&&typeof q=="object"&&typeof q.then=="function"){var z=q;return jn(function(){j||Vt||(Vt=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(oe,me){j=!0,z.then(function(Ae){if(ue(y,B),B===0){try{Pe(H),ee(function(){return Te(Ae,oe,me)})}catch(Ne){u.thrownErrors.push(Ne)}if(0<u.thrownErrors.length){var tt=re(u.thrownErrors);u.thrownErrors.length=0,me(tt)}}else oe(Ae)},function(Ae){ue(y,B),0<u.thrownErrors.length&&(Ae=re(u.thrownErrors),u.thrownErrors.length=0),me(Ae)})}}}var ae=q;if(ue(y,B),B===0&&(Pe(H),H.length!==0&&jn(function(){j||Vt||(Vt=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),u.actQueue=null),0<u.thrownErrors.length)throw i=re(u.thrownErrors),u.thrownErrors.length=0,i;return{then:function(oe,me){j=!0,B===0?(u.actQueue=H,ee(function(){return Te(ae,oe,me)})):oe(ae)}}},Z.cache=function(i){return function(){return i.apply(null,arguments)}},Z.cloneElement=function(i,y,B){if(i==null)throw Error("The argument must be a React element, but you passed "+i+".");var H=ve({},i.props),j=i.key,q=i._owner;if(y!=null){var z;e:{if(r.call(y,"ref")&&(z=Object.getOwnPropertyDescriptor(y,"ref").get)&&z.isReactWarning){z=!1;break e}z=y.ref!==void 0}z&&(q=I()),l(y)&&(m(y.key),j=""+y.key);for(ae in y)!r.call(y,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&y.ref===void 0||(H[ae]=y[ae])}var ae=arguments.length-2;if(ae===1)H.children=B;else if(1<ae){z=Array(ae);for(var oe=0;oe<ae;oe++)z[oe]=arguments[oe+2];H.children=z}for(H=D(i.type,j,void 0,void 0,q,H),j=2;j<arguments.length;j++)x(arguments[j],H.type);return H},Z.createContext=function(i){return i={$$typeof:xt,_currentValue:i,_currentValue2:i,_threadCount:0,Provider:null,Consumer:null},i.Provider=i,i.Consumer={$$typeof:Xe,_context:i},i._currentRenderer=null,i._currentRenderer2=null,i},Z.createElement=function(i,y,B){if(A(i))for(var H=2;H<arguments.length;H++)x(arguments[H],i);else{if(H="",(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(H+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i===null)var j="null";else Ie(i)?j="array":i!==void 0&&i.$$typeof===ke?(j="<"+(d(i.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):j=typeof i;console.error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,H)}var q;if(H={},j=null,y!=null)for(q in On||!("__self"in y)||"key"in y||(On=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),l(y)&&(m(y.key),j=""+y.key),y)r.call(y,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(H[q]=y[q]);var z=arguments.length-2;if(z===1)H.children=B;else if(1<z){for(var ae=Array(z),oe=0;oe<z;oe++)ae[oe]=arguments[oe+2];Object.freeze&&Object.freeze(ae),H.children=ae}if(i&&i.defaultProps)for(q in z=i.defaultProps,z)H[q]===void 0&&(H[q]=z[q]);return j&&w(H,typeof i=="function"?i.displayName||i.name||"Unknown":i),D(i,j,void 0,void 0,I(),H)},Z.createRef=function(){var i={current:null};return Object.seal(i),i},Z.forwardRef=function(i){i!=null&&i.$$typeof===Ze?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof i!="function"?console.error("forwardRef requires a render function but was given %s.",i===null?"null":typeof i):i.length!==0&&i.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",i.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),i!=null&&i.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var y={$$typeof:Qe,render:i},B;return Object.defineProperty(y,"displayName",{enumerable:!1,configurable:!0,get:function(){return B},set:function(H){B=H,i.name||i.displayName||(Object.defineProperty(i,"name",{value:H}),i.displayName=H)}}),y},Z.isValidElement=N,Z.lazy=function(i){return{$$typeof:et,_payload:{_status:-1,_result:i},_init:ge}},Z.memo=function(i,y){A(i)||console.error("memo: The first argument must be a component. Instead received: %s",i===null?"null":typeof i),y={$$typeof:Ze,type:i,compare:y===void 0?null:y};var B;return Object.defineProperty(y,"displayName",{enumerable:!1,configurable:!0,get:function(){return B},set:function(H){B=H,i.name||i.displayName||(Object.defineProperty(i,"name",{value:H}),i.displayName=H)}}),y},Z.startTransition=function(i){var y=u.T,B={};u.T=B,B._updatedFibers=new Set;try{var H=i(),j=u.S;j!==null&&j(B,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(Se,Dn)}catch(q){Dn(q)}finally{y===null&&B._updatedFibers&&(i=B._updatedFibers.size,B._updatedFibers.clear(),10<i&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),u.T=y}},Z.unstable_useCacheRefresh=function(){return te().useCacheRefresh()},Z.use=function(i){return te().use(i)},Z.useActionState=function(i,y,B){return te().useActionState(i,y,B)},Z.useCallback=function(i,y){return te().useCallback(i,y)},Z.useContext=function(i){var y=te();return i.$$typeof===Xe&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),y.useContext(i)},Z.useDebugValue=function(i,y){return te().useDebugValue(i,y)},Z.useDeferredValue=function(i,y){return te().useDeferredValue(i,y)},Z.useEffect=function(i,y){return te().useEffect(i,y)},Z.useId=function(){return te().useId()},Z.useImperativeHandle=function(i,y,B){return te().useImperativeHandle(i,y,B)},Z.useInsertionEffect=function(i,y){return te().useInsertionEffect(i,y)},Z.useLayoutEffect=function(i,y){return te().useLayoutEffect(i,y)},Z.useMemo=function(i,y){return te().useMemo(i,y)},Z.useOptimistic=function(i,y){return te().useOptimistic(i,y)},Z.useReducer=function(i,y,B){return te().useReducer(i,y,B)},Z.useRef=function(i){return te().useRef(i)},Z.useState=function(i){return te().useState(i)},Z.useSyncExternalStore=function(i,y,B){return te().useSyncExternalStore(i,y,B)},Z.useTransition=function(){return te().useTransition()},Z.version="19.0.0",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()});var ds=Gt((Nd,Fn)=>{"use strict";U();O();P();W.env.NODE_ENV==="production"?Fn.exports=ls():Fn.exports=ps()});var Ju={};Kt(Ju,{ButtonShare:()=>Cr,ButtonWallet:()=>Rr});U();O();P();U();O();P();U();O();P();U();O();P();var Ss=Object.create,$r=Object.defineProperty,Ts=Object.getOwnPropertyDescriptor,mi=Object.getOwnPropertyNames,Cs=Object.getPrototypeOf,ks=Object.prototype.hasOwnProperty,Bs=(e,t,n)=>t in e?$r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_i=(e,t)=>function(){return t||(0,e[mi(e)[0]])((t={exports:{}}).exports,t),t.exports},Rs=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of mi(t))!ks.call(e,c)&&c!==n&&$r(e,c,{get:()=>t[c],enumerable:!(s=Ts(t,c))||s.enumerable});return e},jr=(e,t,n)=>(n=e!=null?Ss(Cs(e)):{},Rs(t||!e||!e.__esModule?$r(n,"default",{value:e,enumerable:!0}):n,e)),Ce=(e,t,n)=>Bs(e,typeof t!="symbol"?t+"":t,n),er={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},hc=Object.entries(er).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{}),zr={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}};var Pt=Wn(gi(),1);U();O();P();cr();sr();ta();ra();en();nr();var na=_i({"../../node_modules/async-lz-string/libs/async-lz-string.js"(e,t){(function(n,s){if(typeof e=="object"&&typeof t=="object")t.exports=s();else if(typeof define=="function"&&define.amd)define([],s);else{var c=s();for(var f in c)(typeof e=="object"?e:n)[f]=c[f]}})(e,()=>(()=>{var n={48:function(c,f,a){var m=this&&this.__awaiter||function(v,I,l,w){return new(l||(l=Promise))(function(k,D){function F($){try{N(w.next($))}catch(T){D(T)}}function x($){try{N(w.throw($))}catch(T){D(T)}}function N($){var T;$.done?k($.value):(T=$.value,T instanceof l?T:new l(function(V){V(T)})).then(F,x)}N((w=w.apply(v,I||[])).next())})},d=this&&this.__generator||function(v,I){var l,w,k,D,F={label:0,sent:function(){if(1&k[0])throw k[1];return k[1]},trys:[],ops:[]};return D={next:x(0),throw:x(1),return:x(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function x(N){return function($){return function(T){if(l)throw new TypeError("Generator is already executing.");for(;D&&(D=0,T[0]&&(F=0)),F;)try{if(l=1,w&&(k=2&T[0]?w.return:T[0]?w.throw||((k=w.return)&&k.call(w),0):w.next)&&!(k=k.call(w,T[1])).done)return k;switch(w=0,k&&(T=[2&T[0],k.value]),T[0]){case 0:case 1:k=T;break;case 4:return F.label++,{value:T[1],done:!1};case 5:F.label++,w=T[1],T=[0];continue;case 7:T=F.ops.pop(),F.trys.pop();continue;default:if(!((k=(k=F.trys).length>0&&k[k.length-1])||T[0]!==6&&T[0]!==2)){F=0;continue}if(T[0]===3&&(!k||T[1]>k[0]&&T[1]<k[3])){F.label=T[1];break}if(T[0]===6&&F.label<k[1]){F.label=k[1],k=T;break}if(k&&F.label<k[2]){F.label=k[2],F.ops.push(T);break}k[2]&&F.ops.pop(),F.trys.pop();continue}T=I.call(v,F)}catch(V){T=[6,V],w=0}finally{l=k=0}if(5&T[0])throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}([N,$])}}};Object.defineProperty(f,"__esModule",{value:!0}),f.decompressFromUTF16=f.compressToUTF16=f.decompressFromBase64=f.compressToBase64=void 0;var A=a(304),R=a(134),g=new A.CompressorImpl,S=new R.DecompressorImpl,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b={};f.compressToBase64=function(v){return m(this,void 0,void 0,function(){var I;return d(this,function(l){switch(l.label){case 0:return v===null?[2,""]:[4,g.compress(v,6,function(w){return h.charAt(w)})];case 1:switch((I=l.sent()).length%4){default:case 0:return[2,I];case 1:return[2,I+"==="];case 2:return[2,I+"=="];case 3:return[2,I+"="]}return[2]}})})},f.decompressFromBase64=function(v){return m(this,void 0,void 0,function(){return d(this,function(I){switch(I.label){case 0:return v===null?[2,""]:v===""?[2,null]:[4,S.decompress(v.length,32,function(l){return function(w,k){if(!b[w]){b[w]={};for(var D=0;D<w.length;D++)b[w][w.charAt(D)]=D}return b[w][k]}(h,v.charAt(l))})];case 1:return[2,I.sent()]}})})},f.compressToUTF16=function(v){return m(this,void 0,void 0,function(){return d(this,function(I){switch(I.label){case 0:return v===null?[2,""]:[4,g.compress(v,15,function(l){return String.fromCharCode(l+32)})];case 1:return[2,I.sent()+" "]}})})},f.decompressFromUTF16=function(v){return m(this,void 0,void 0,function(){return d(this,function(I){switch(I.label){case 0:return v===null?[2,""]:v===""?[2,null]:[4,S.decompress(v.length,16384,function(l){return v.charCodeAt(l)-32})];case 1:return[2,I.sent()]}})})}},304:function(c,f,a){var m=this&&this.__awaiter||function(S,h,b,v){return new(b||(b=Promise))(function(I,l){function w(F){try{D(v.next(F))}catch(x){l(x)}}function k(F){try{D(v.throw(F))}catch(x){l(x)}}function D(F){var x;F.done?I(F.value):(x=F.value,x instanceof b?x:new b(function(N){N(x)})).then(w,k)}D((v=v.apply(S,h||[])).next())})},d=this&&this.__generator||function(S,h){var b,v,I,l,w={label:0,sent:function(){if(1&I[0])throw I[1];return I[1]},trys:[],ops:[]};return l={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function k(D){return function(F){return function(x){if(b)throw new TypeError("Generator is already executing.");for(;l&&(l=0,x[0]&&(w=0)),w;)try{if(b=1,v&&(I=2&x[0]?v.return:x[0]?v.throw||((I=v.return)&&I.call(v),0):v.next)&&!(I=I.call(v,x[1])).done)return I;switch(v=0,I&&(x=[2&x[0],I.value]),x[0]){case 0:case 1:I=x;break;case 4:return w.label++,{value:x[1],done:!1};case 5:w.label++,v=x[1],x=[0];continue;case 7:x=w.ops.pop(),w.trys.pop();continue;default:if(!((I=(I=w.trys).length>0&&I[I.length-1])||x[0]!==6&&x[0]!==2)){w=0;continue}if(x[0]===3&&(!I||x[1]>I[0]&&x[1]<I[3])){w.label=x[1];break}if(x[0]===6&&w.label<I[1]){w.label=I[1],I=x;break}if(I&&w.label<I[2]){w.label=I[2],w.ops.push(x);break}I[2]&&w.ops.pop(),w.trys.pop();continue}x=h.call(S,w)}catch(N){x=[6,N],v=0}finally{b=I=0}if(5&x[0])throw x[1];return{value:x[0]?x[1]:void 0,done:!0}}([D,F])}}};Object.defineProperty(f,"__esModule",{value:!0}),f.CompressorImpl=void 0;var A=a(658),R=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],g=function(){function S(){}return S.writeValueToData=function(h,b,v,I,l){if(v%4!=0||h.dataPosition+v>I-1)for(var w=0;w<v;w++)h.dataVal=h.dataVal<<1|1&b,h.dataPosition==I-1?(h.dataPosition=0,h.data.push(l(h.dataVal)),h.dataVal=0):h.dataPosition++,b>>=1;else h.dataVal<<=v,h.dataVal|=function(k,D){for(var F=0,x=0;x<D;++x)F<<=4,F|=R[15&k],k>>=4;return F}(b,v/4),h.dataPosition+=v},S.writeWToDataVal=function(h,b,v){h.dictionaryToCreate.has(h.w)?(h.w.charCodeAt(0)<256?(S.writeValueToData(h,0,h.numBits,b,v),S.writeValueToData(h,h.w.charCodeAt(0),8,b,v)):(S.writeValueToData(h,1,h.numBits,b,v),S.writeValueToData(h,h.w.charCodeAt(0),16,b,v)),h.enlargeIn--,h.enlargeIn==0&&(h.enlargeIn=Math.pow(2,h.numBits),h.numBits++),h.dictionaryToCreate.delete(h.w)):S.writeValueToData(h,h.dictionary.get(h.w),h.numBits,b,v),h.enlargeIn--,h.enlargeIn==0&&(h.enlargeIn=Math.pow(2,h.numBits),h.numBits++)},S.loopIteration=function(h,b,v,I,l){var w=h.charAt(b);l.dictionary.has(w)||(l.dictionary.set(w,l.dictSize++),l.dictionaryToCreate.set(w,!0));var k=l.w+w;l.dictionary.has(k)?l.w=k:(this.writeWToDataVal(l,v,I),l.dictionary.set(k,l.dictSize++),l.w=String(w))},S.prototype.compress=function(h,b,v){var I=this;return new Promise(function(l){return m(I,void 0,void 0,function(){var w,k;return d(this,function(D){switch(D.label){case 0:if(h==null)return l(""),[2];w={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},k=0,D.label=1;case 1:return k<h.length?(S.loopIteration(h,k,b,v,w),k%1e4!=0?[3,3]:[4,(0,A.wait)()]):[3,4];case 2:D.sent(),D.label=3;case 3:return k+=1,[3,1];case 4:return w.w!==""&&S.writeWToDataVal(w,b,v),S.writeValueToData(w,2,w.numBits,b,v),w.dataVal<<=b-w.dataPosition,w.data.push(v(w.dataVal)),l(w.data.join("")),[2]}})})})},S}();f.CompressorImpl=g},134:function(c,f,a){var m=this&&this.__awaiter||function(g,S,h,b){return new(h||(h=Promise))(function(v,I){function l(D){try{k(b.next(D))}catch(F){I(F)}}function w(D){try{k(b.throw(D))}catch(F){I(F)}}function k(D){var F;D.done?v(D.value):(F=D.value,F instanceof h?F:new h(function(x){x(F)})).then(l,w)}k((b=b.apply(g,S||[])).next())})},d=this&&this.__generator||function(g,S){var h,b,v,I,l={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return I={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function w(k){return function(D){return function(F){if(h)throw new TypeError("Generator is already executing.");for(;I&&(I=0,F[0]&&(l=0)),l;)try{if(h=1,b&&(v=2&F[0]?b.return:F[0]?b.throw||((v=b.return)&&v.call(b),0):b.next)&&!(v=v.call(b,F[1])).done)return v;switch(b=0,v&&(F=[2&F[0],v.value]),F[0]){case 0:case 1:v=F;break;case 4:return l.label++,{value:F[1],done:!1};case 5:l.label++,b=F[1],F=[0];continue;case 7:F=l.ops.pop(),l.trys.pop();continue;default:if(!((v=(v=l.trys).length>0&&v[v.length-1])||F[0]!==6&&F[0]!==2)){l=0;continue}if(F[0]===3&&(!v||F[1]>v[0]&&F[1]<v[3])){l.label=F[1];break}if(F[0]===6&&l.label<v[1]){l.label=v[1],v=F;break}if(v&&l.label<v[2]){l.label=v[2],l.ops.push(F);break}v[2]&&l.ops.pop(),l.trys.pop();continue}F=S.call(g,l)}catch(x){F=[6,x],b=0}finally{h=v=0}if(5&F[0])throw F[1];return{value:F[0]?F[1]:void 0,done:!0}}([k,D])}}};Object.defineProperty(f,"__esModule",{value:!0}),f.DecompressorImpl=void 0;var A=a(658),R=function(){function g(){}return g.prototype.decompress=function(S,h,b){var v=this;return new Promise(function(I){return m(v,void 0,void 0,function(){var l,w,k;return d(this,function(D){switch(D.label){case 0:for(l={bits:0,c:null,dataIndex:1,dataPosition:h,dataVal:b(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:Math.pow(2,2),numBits:3,power:1,resb:null,result:[],w:null},w=0;w<3;w+=1)l.dictionary.set(w,w);for(;l.power!=l.maxPower;)l.resb=l.dataVal&l.dataPosition,l.dataPosition>>=1,l.dataPosition==0&&(l.dataPosition=h,l.dataVal=b(l.dataIndex++)),l.bits|=(l.resb>0?1:0)*l.power,l.power<<=1;switch(l.bits){case 0:for(l.bits=0,l.maxPower=Math.pow(2,8),l.power=1;l.power!=l.maxPower;)l.resb=l.dataVal&l.dataPosition,l.dataPosition>>=1,l.dataPosition==0&&(l.dataPosition=h,l.dataVal=b(l.dataIndex++)),l.bits|=(l.resb>0?1:0)*l.power,l.power<<=1;l.c=String.fromCharCode(l.bits);break;case 1:for(l.bits=0,l.maxPower=Math.pow(2,16),l.power=1;l.power!==l.maxPower;)l.resb=l.dataVal&l.dataPosition,l.dataPosition>>=1,l.dataPosition===0&&(l.dataPosition=h,l.dataVal=b(l.dataIndex++)),l.bits|=(l.resb>0?1:0)*l.power,l.power<<=1;l.c=String.fromCharCode(l.bits);break;case 2:return I(""),[2]}l.dictionary[3]=l.c,l.w=l.c,l.result.push(l.c),k=1,D.label=1;case 1:return k%2e4!=0?[3,3]:[4,(0,A.wait)()];case 2:D.sent(),D.label=3;case 3:if(l.dataIndex>S)return I(""),[2];for(l.bits=0,l.maxPower=Math.pow(2,l.numBits),l.power=1;l.power!=l.maxPower;)l.resb=l.dataVal&l.dataPosition,l.dataPosition>>=1,l.dataPosition==0&&(l.dataPosition=h,l.dataVal=b(l.dataIndex++)),l.bits|=(l.resb>0?1:0)*l.power,l.power<<=1;switch(l.c=l.bits){case 0:for(l.bits=0,l.maxPower=Math.pow(2,8),l.power=1;l.power!==l.maxPower;)l.resb=l.dataVal&l.dataPosition,l.dataPosition>>=1,l.dataPosition==0&&(l.dataPosition=h,l.dataVal=b(l.dataIndex++)),l.bits|=(l.resb>0?1:0)*l.power,l.power<<=1;l.dictionary[l.dictSize++]=String.fromCharCode(l.bits),l.c=l.dictSize-1,l.enlargeIn--;break;case 1:for(l.bits=0,l.maxPower=Math.pow(2,16),l.power=1;l.power!==l.maxPower;)l.resb=l.dataVal&l.dataPosition,l.dataPosition>>=1,l.dataPosition==0&&(l.dataPosition=h,l.dataVal=b(l.dataIndex++)),l.bits|=(l.resb>0?1:0)*l.power,l.power<<=1;l.dictionary[l.dictSize++]=String.fromCharCode(l.bits),l.c=l.dictSize-1,l.enlargeIn--;break;case 2:return I(l.result.join("")),[2]}if(l.enlargeIn==0&&(l.enlargeIn=Math.pow(2,l.numBits),l.numBits++),l.dictionary[l.c])l.entry=l.dictionary[l.c];else{if(l.c!==l.dictSize)return I(null),[2];l.entry=l.w+l.w.charAt(0)}return l.result.push(l.entry),l.dictionary[l.dictSize++]=l.w+l.entry.charAt(0),l.enlargeIn--,l.w=l.entry,l.enlargeIn==0&&(l.enlargeIn=Math.pow(2,l.numBits),l.numBits++),k++,[3,1];case 4:return[2]}})})})},g}();f.DecompressorImpl=R},658:function(c,f){var a=this&&this.__awaiter||function(d,A,R,g){return new(R||(R=Promise))(function(S,h){function b(l){try{I(g.next(l))}catch(w){h(w)}}function v(l){try{I(g.throw(l))}catch(w){h(w)}}function I(l){var w;l.done?S(l.value):(w=l.value,w instanceof R?w:new R(function(k){k(w)})).then(b,v)}I((g=g.apply(d,A||[])).next())})},m=this&&this.__generator||function(d,A){var R,g,S,h,b={label:0,sent:function(){if(1&S[0])throw S[1];return S[1]},trys:[],ops:[]};return h={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function v(I){return function(l){return function(w){if(R)throw new TypeError("Generator is already executing.");for(;h&&(h=0,w[0]&&(b=0)),b;)try{if(R=1,g&&(S=2&w[0]?g.return:w[0]?g.throw||((S=g.return)&&S.call(g),0):g.next)&&!(S=S.call(g,w[1])).done)return S;switch(g=0,S&&(w=[2&w[0],S.value]),w[0]){case 0:case 1:S=w;break;case 4:return b.label++,{value:w[1],done:!1};case 5:b.label++,g=w[1],w=[0];continue;case 7:w=b.ops.pop(),b.trys.pop();continue;default:if(!((S=(S=b.trys).length>0&&S[S.length-1])||w[0]!==6&&w[0]!==2)){b=0;continue}if(w[0]===3&&(!S||w[1]>S[0]&&w[1]<S[3])){b.label=w[1];break}if(w[0]===6&&b.label<S[1]){b.label=S[1],S=w;break}if(S&&b.label<S[2]){b.label=S[2],b.ops.push(w);break}S[2]&&b.ops.pop(),b.trys.pop();continue}w=A.call(d,b)}catch(k){w=[6,k],g=0}finally{R=S=0}if(5&w[0])throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}([I,l])}}};Object.defineProperty(f,"__esModule",{value:!0}),f.wait=void 0,f.wait=function(){return a(this,void 0,void 0,function(){return m(this,function(d){return[2,new Promise(function(A){setTimeout(A,0)})]})})}}},s={};return function c(f){var a=s[f];if(a!==void 0)return a.exports;var m=s[f]={exports:{}};return n[f].call(m.exports,m,m.exports,c),m.exports}(48)})())}}),we=class extends Error{constructor(e,t,n){super(t),this.code=e,this.data=n}},oa=class extends we{constructor(e){super(xe.internalError,e)}};var xe={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006},mt=class{constructor(){Ce(this,"_promise"),Ce(this,"_resolve"),Ce(this,"_reject"),Ce(this,"resolve",e=>{var t;(t=this._resolve)==null||t.call(this,e)}),Ce(this,"reject",e=>{var t;(t=this._reject)==null||t.call(this,e)}),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}},Ks=jr(na(),1);async function hr(e){let t=(0,Pt.sha256)(JSON.stringify(e)),n={...e,validationHash:t},s=await ia(n),c=(0,Pt.sha256)(s);return{compressed:s,compressedHash:c}}async function ia(e){return(0,Ks.compressToBase64)(JSON.stringify(e))}var Js=jr(na(),1);async function mr(e){if(!(e!=null&&e.compressed&&(e!=null&&e.compressedHash)))throw new we(xe.corruptedResponse,"Missing compressed data");let t=await aa(e.compressed);if(!t)throw new we(xe.corruptedResponse,"Invalid compressed data");if(!(t!=null&&t.validationHash))throw new we(xe.corruptedResponse,"Missing validation hash");if((0,Pt.sha256)(e.compressed)!==e.compressedHash)throw new we(xe.corruptedResponse,"Invalid compressed hash");let{validationHash:s,...c}=t;if((0,Pt.sha256)(JSON.stringify(c))!==t.validationHash)throw new we(xe.corruptedResponse,"Invalid data validation hash");return t}async function aa(e){let t=await(0,Js.decompressFromBase64)(e);try{return JSON.parse(t)}catch(n){return console.error("Invalid compressed data",{e:n,decompressed:t}),null}}var Ut={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:1e3,top:"-1000px",left:"-1000px"}};function un({walletBaseUrl:e,config:t}){let n=document.querySelector("#nexus-wallet");n&&n.remove();let s=document.createElement("iframe");return s.id=Ut.id,s.name=Ut.name,s.allow=Ut.allow,s.style.zIndex=Ut.style.zIndex.toString(),cn({iframe:s,isVisible:!1}),document.body.appendChild(s),new Promise(c=>{var f,a;s==null||s.addEventListener("load",()=>c(s)),s.src=`${(a=(f=t==null?void 0:t.walletUrl)!=null?f:e)!=null?a:"https://wallet.frak.id"}/listener`})}function cn({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}var fn="fCtx";function Xs(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Qs(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),n=>n.charCodeAt(0))}function sa(e){if(e!=null&&e.r)try{let t=Ct(e.r);return Xs(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function ua(e){if(!(!e||e.length===0))try{let t=Qs(e);return{r:Tt(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function ca({url:e}){if(!e)return null;let n=new URL(e).searchParams.get(fn);return n?ua(n):null}function fa({url:e,context:t}){if(!e)return null;let n=ca({url:e}),s=n?{...n,...t}:t;if(!s.r)return null;let c=sa(s);if(!c)return null;let f=new URL(e);return f.searchParams.set(fn,c),f.toString()}function la(e){let t=new URL(e);return t.searchParams.delete(fn),t.toString()}function Zs({url:e,context:t}){var n;if(!((n=window.location)!=null&&n.href)||typeof window>"u"){console.error("No window found, can't update context");return}let s=e!=null?e:window.location.href,c;t!==null?c=fa({url:s,context:t}):c=la(s),c&&window.history.replaceState(null,"",c.toString())}var Ot={compress:sa,decompress:ua,parse:ca,update:fa,remove:la,replaceUrl:Zs};var _r="nexus-wallet-backup",ln=class pa{constructor(t,n){Ce(this,"config"),Ce(this,"iframe"),Ce(this,"isSetupDone",!1),Ce(this,"lastResponse",null),Ce(this,"lastRequest",null),this.config=t,this.iframe=n,this.lastRequest=null,this.lastResponse=null}setLastResponse(t){this.lastResponse={event:t.data,origin:t.origin,timestamp:Date.now()}}setLastRequest(t,n){this.lastRequest={event:t,target:n,timestamp:Date.now()}}updateSetupStatus(t){this.isSetupDone=t}base64Encode(t){try{return btoa(JSON.stringify(t))}catch(n){return console.warn("Failed to encode debug data",n),btoa("Failed to encode data")}}getIframeStatus(){var t;return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:(t=this.iframe.contentDocument)!=null&&t.readyState?this.iframe.contentDocument.readyState==="complete"?1:0:-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(t){let n=this.getIframeStatus(),s=this.getNavigatorInfo(),c="Unknown";return t instanceof we?c=`FrakRpcError: ${t.code} '${t.message}'`:t instanceof Error?c=t.message:typeof t=="string"&&(c=t),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:s?this.base64Encode(s):"no-navigator",iframeStatus:n?this.base64Encode(n):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:c}}static empty(){return new pa}formatDebugInfo(t){let n=this.gatherDebugInfo(t);return`
|
|
1
|
+
(function(fe){typeof define=="function"&&define.amd?define(fe):fe()})(function(){"use strict";var fe=Object.create,nt=Object.defineProperty,Mn=Object.getOwnPropertyDescriptor,rt=Object.getOwnPropertyNames,Nn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty,Ln=(e,t)=>function(){return t||(0,e[rt(e)[0]])((t={exports:{}}).exports,t),t.exports},zn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rt(t))!Un.call(e,o)&&o!==n&&nt(e,o,{get:()=>t[o],enumerable:!(r=Mn(t,o))||r.enumerable});return e},ot=(e,t,n)=>(n=e!=null?fe(Nn(e)):{},zn(nt(n,"default",{value:e,enumerable:!0}),e)),Ie={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31};Object.entries(Ie).reduce((e,[t,n])=>(e[t]=BigInt(1)<<BigInt(n),e),{});var it={referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"}},Dn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Pe={exports:{}};const at=jn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
|
|
2
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
3
|
+
*
|
|
4
|
+
* @version 0.11.0
|
|
5
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
|
+
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
7
|
+
* @license MIT
|
|
8
|
+
*/var st;function Vn(){return st||(st=1,function(e){(function(){var t="input is invalid type",n=typeof window=="object",r=n?window:{};r.JS_SHA256_NO_WINDOW&&(n=!1);var o=!n&&typeof self=="object",a=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?r=Dn:o&&(r=self);var s=!r.JS_SHA256_NO_COMMON_JS&&!0&&e.exports,l=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),_=[-2147483648,8388608,32768,128],v=[24,16,8,0],d=[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],w=["hex","array","digest","arrayBuffer"],f=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(u){return Object.prototype.toString.call(u)==="[object Array]"}),l&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(u){return typeof u=="object"&&u.buffer&&u.buffer.constructor===ArrayBuffer});var b=function(u,S){return function(E){return new g(S,!0).update(E)[u]()}},p=function(u){var S=b("hex",u);a&&(S=m(S,u)),S.create=function(){return new g(u)},S.update=function(A){return S.create().update(A)};for(var E=0;E<w.length;++E){var y=w[E];S[y]=b(y,u)}return S},m=function(u,S){var E=at,y=at.Buffer,A=S?"sha224":"sha256",x;y.from&&!r.JS_SHA256_NO_BUFFER_FROM?x=y.from:x=function(F){return new y(F)};var P=function(F){if(typeof F=="string")return E.createHash(A).update(F,"utf8").digest("hex");if(F==null)throw new Error(t);return F.constructor===ArrayBuffer&&(F=new Uint8Array(F)),Array.isArray(F)||ArrayBuffer.isView(F)||F.constructor===y?E.createHash(A).update(x(F)).digest("hex"):u(F)};return P},i=function(u,S){return function(E,y){return new C(E,S,!0).update(y)[u]()}},h=function(u){var S=i("hex",u);S.create=function(A){return new C(A,u)},S.update=function(A,x){return S.create(A).update(x)};for(var E=0;E<w.length;++E){var y=w[E];S[y]=i(y,u)}return S};function g(u,S){S?(f[0]=f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0,this.blocks=f):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=u}g.prototype.update=function(u){if(!this.finalized){var S,E=typeof u;if(E!=="string"){if(E==="object"){if(u===null)throw new Error(t);if(l&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!l||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);S=!0}for(var y,A=0,x,P=u.length,F=this.blocks;A<P;){if(this.hashed&&(this.hashed=!1,F[0]=this.block,this.block=F[16]=F[1]=F[2]=F[3]=F[4]=F[5]=F[6]=F[7]=F[8]=F[9]=F[10]=F[11]=F[12]=F[13]=F[14]=F[15]=0),S)for(x=this.start;A<P&&x<64;++A)F[x>>>2]|=u[A]<<v[x++&3];else for(x=this.start;A<P&&x<64;++A)y=u.charCodeAt(A),y<128?F[x>>>2]|=y<<v[x++&3]:y<2048?(F[x>>>2]|=(192|y>>>6)<<v[x++&3],F[x>>>2]|=(128|y&63)<<v[x++&3]):y<55296||y>=57344?(F[x>>>2]|=(224|y>>>12)<<v[x++&3],F[x>>>2]|=(128|y>>>6&63)<<v[x++&3],F[x>>>2]|=(128|y&63)<<v[x++&3]):(y=65536+((y&1023)<<10|u.charCodeAt(++A)&1023),F[x>>>2]|=(240|y>>>18)<<v[x++&3],F[x>>>2]|=(128|y>>>12&63)<<v[x++&3],F[x>>>2]|=(128|y>>>6&63)<<v[x++&3],F[x>>>2]|=(128|y&63)<<v[x++&3]);this.lastByteIndex=x,this.bytes+=x-this.start,x>=64?(this.block=F[16],this.start=x-64,this.hash(),this.hashed=!0):this.start=x}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var u=this.blocks,S=this.lastByteIndex;u[16]=this.block,u[S>>>2]|=_[S&3],this.block=u[16],S>=56&&(this.hashed||this.hash(),u[0]=this.block,u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0),u[14]=this.hBytes<<3|this.bytes>>>29,u[15]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var u=this.h0,S=this.h1,E=this.h2,y=this.h3,A=this.h4,x=this.h5,P=this.h6,F=this.h7,$=this.blocks,R,U,L,K,T,G,X,le,et,tt,Ae;for(R=16;R<64;++R)T=$[R-15],U=(T>>>7|T<<25)^(T>>>18|T<<14)^T>>>3,T=$[R-2],L=(T>>>17|T<<15)^(T>>>19|T<<13)^T>>>10,$[R]=$[R-16]+U+$[R-7]+L<<0;for(Ae=S&E,R=0;R<64;R+=4)this.first?(this.is224?(le=300032,T=$[0]-1413257819,F=T-150054599<<0,y=T+24177077<<0):(le=704751109,T=$[0]-210244248,F=T-1521486534<<0,y=T+143694565<<0),this.first=!1):(U=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),L=(A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7),le=u&S,K=le^u&E^Ae,X=A&x^~A&P,T=F+L+X+d[R]+$[R],G=U+K,F=y+T<<0,y=T+G<<0),U=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),L=(F>>>6|F<<26)^(F>>>11|F<<21)^(F>>>25|F<<7),et=y&u,K=et^y&S^le,X=F&A^~F&x,T=P+L+X+d[R+1]+$[R+1],G=U+K,P=E+T<<0,E=T+G<<0,U=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),L=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),tt=E&y,K=tt^E&u^et,X=P&F^~P&A,T=x+L+X+d[R+2]+$[R+2],G=U+K,x=S+T<<0,S=T+G<<0,U=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),L=(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7),Ae=S&E,K=Ae^S&y^tt,X=x&P^~x&F,T=A+L+X+d[R+3]+$[R+3],G=U+K,A=u+T<<0,u=T+G<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+u<<0,this.h1=this.h1+S<<0,this.h2=this.h2+E<<0,this.h3=this.h3+y<<0,this.h4=this.h4+A<<0,this.h5=this.h5+x<<0,this.h6=this.h6+P<<0,this.h7=this.h7+F<<0},g.prototype.hex=function(){this.finalize();var u=this.h0,S=this.h1,E=this.h2,y=this.h3,A=this.h4,x=this.h5,P=this.h6,F=this.h7,$=c[u>>>28&15]+c[u>>>24&15]+c[u>>>20&15]+c[u>>>16&15]+c[u>>>12&15]+c[u>>>8&15]+c[u>>>4&15]+c[u&15]+c[S>>>28&15]+c[S>>>24&15]+c[S>>>20&15]+c[S>>>16&15]+c[S>>>12&15]+c[S>>>8&15]+c[S>>>4&15]+c[S&15]+c[E>>>28&15]+c[E>>>24&15]+c[E>>>20&15]+c[E>>>16&15]+c[E>>>12&15]+c[E>>>8&15]+c[E>>>4&15]+c[E&15]+c[y>>>28&15]+c[y>>>24&15]+c[y>>>20&15]+c[y>>>16&15]+c[y>>>12&15]+c[y>>>8&15]+c[y>>>4&15]+c[y&15]+c[A>>>28&15]+c[A>>>24&15]+c[A>>>20&15]+c[A>>>16&15]+c[A>>>12&15]+c[A>>>8&15]+c[A>>>4&15]+c[A&15]+c[x>>>28&15]+c[x>>>24&15]+c[x>>>20&15]+c[x>>>16&15]+c[x>>>12&15]+c[x>>>8&15]+c[x>>>4&15]+c[x&15]+c[P>>>28&15]+c[P>>>24&15]+c[P>>>20&15]+c[P>>>16&15]+c[P>>>12&15]+c[P>>>8&15]+c[P>>>4&15]+c[P&15];return this.is224||($+=c[F>>>28&15]+c[F>>>24&15]+c[F>>>20&15]+c[F>>>16&15]+c[F>>>12&15]+c[F>>>8&15]+c[F>>>4&15]+c[F&15]),$},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var u=this.h0,S=this.h1,E=this.h2,y=this.h3,A=this.h4,x=this.h5,P=this.h6,F=this.h7,$=[u>>>24&255,u>>>16&255,u>>>8&255,u&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255,A>>>24&255,A>>>16&255,A>>>8&255,A&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255];return this.is224||$.push(F>>>24&255,F>>>16&255,F>>>8&255,F&255),$},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var u=new ArrayBuffer(this.is224?28:32),S=new DataView(u);return S.setUint32(0,this.h0),S.setUint32(4,this.h1),S.setUint32(8,this.h2),S.setUint32(12,this.h3),S.setUint32(16,this.h4),S.setUint32(20,this.h5),S.setUint32(24,this.h6),this.is224||S.setUint32(28,this.h7),u};function C(u,S,E){var y,A=typeof u;if(A==="string"){var x=[],P=u.length,F=0,$;for(y=0;y<P;++y)$=u.charCodeAt(y),$<128?x[F++]=$:$<2048?(x[F++]=192|$>>>6,x[F++]=128|$&63):$<55296||$>=57344?(x[F++]=224|$>>>12,x[F++]=128|$>>>6&63,x[F++]=128|$&63):($=65536+(($&1023)<<10|u.charCodeAt(++y)&1023),x[F++]=240|$>>>18,x[F++]=128|$>>>12&63,x[F++]=128|$>>>6&63,x[F++]=128|$&63);u=x}else if(A==="object"){if(u===null)throw new Error(t);if(l&&u.constructor===ArrayBuffer)u=new Uint8Array(u);else if(!Array.isArray(u)&&(!l||!ArrayBuffer.isView(u)))throw new Error(t)}else throw new Error(t);u.length>64&&(u=new g(S,!0).update(u).array());var R=[],U=[];for(y=0;y<64;++y){var L=u[y]||0;R[y]=92^L,U[y]=54^L}g.call(this,S,E),this.update(U),this.oKeyPad=R,this.inner=!0,this.sharedMemory=E}C.prototype=new g,C.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var u=this.array();g.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(u),g.prototype.finalize.call(this)}};var k=p();k.sha256=k,k.sha224=p(!0),k.sha256.hmac=h(),k.sha224.hmac=h(!0),s?e.exports=k:(r.sha256=k.sha256,r.sha224=k.sha224)})()}(Pe)),Pe.exports}var de=Vn();function $e(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function ct(e){return $e(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const ut="2.22.23";let Te={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${ut}`};class q extends Error{constructor(t,n={}){const r=n.cause instanceof q?n.cause.details:n.cause?.message?n.cause.message:n.details,o=n.cause instanceof q&&n.cause.docsPath||n.docsPath,a=Te.getDocsUrl?.({...n,docsPath:o}),s=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...r?[`Details: ${r}`]:[],...Te.version?[`Version: ${Te.version}`]:[]].join(`
|
|
9
|
+
`);super(s,n.cause?{cause:n.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=r,this.docsPath=o,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=ut}walk(t){return lt(this,t)}}function lt(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lt(e.cause,t):t?null:e}class ft extends q{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Y(e,{dir:t,size:n=32}={}){return typeof e=="string"?Wn(e,{dir:t,size:n}):qn(e,{dir:t,size:n})}function Wn(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new ft({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function qn(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new ft({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let o=0;o<n;o++){const a=t==="right";r[a?o:n-o-1]=e[a?o:e.length-o-1]}return r}class Jn extends q{constructor({max:t,min:n,signed:r,size:o,value:a}){super(`Number "${a}" is not in safe ${o?`${o*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Kn extends q{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function re(e,{size:t}){if(ct(e)>t)throw new Kn({givenSize:ct(e),maxSize:t})}const Gn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function he(e,t={}){return typeof e=="number"||typeof e=="bigint"?dt(e,t):typeof e=="string"?Zn(e,t):typeof e=="boolean"?Xn(e,t):Oe(e,t)}function Xn(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(re(n,{size:t.size}),Y(n,{size:t.size})):n}function Oe(e,t={}){let n="";for(let o=0;o<e.length;o++)n+=Gn[e[o]];const r=`0x${n}`;return typeof t.size=="number"?(re(r,{size:t.size}),Y(r,{dir:"right",size:t.size})):r}function dt(e,t={}){const{signed:n,size:r}=t,o=BigInt(e);let a;r?n?a=(1n<<BigInt(r)*8n-1n)-1n:a=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const s=typeof a=="bigint"&&n?-a-1n:0;if(a&&o>a||o<s){const c=typeof e=="bigint"?"n":"";throw new Jn({max:a?`${a}${c}`:void 0,min:`${s}${c}`,signed:n,size:r,value:`${e}${c}`})}const l=`0x${(n&&o<0?(1n<<BigInt(r*8))+BigInt(o):o).toString(16)}`;return r?Y(l,{size:r}):l}const Yn=new TextEncoder;function Zn(e,t={}){const n=Yn.encode(e);return Oe(n,t)}const Qn=new TextEncoder;function er(e,t={}){return typeof e=="number"||typeof e=="bigint"?nr(e,t):typeof e=="boolean"?tr(e,t):$e(e)?Re(e,t):_t(e,t)}function tr(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(re(n,{size:t.size}),Y(n,{size:t.size})):n}const D={zero:48,nine:57,A:65,F:70,a:97,f:102};function ht(e){if(e>=D.zero&&e<=D.nine)return e-D.zero;if(e>=D.A&&e<=D.F)return e-(D.A-10);if(e>=D.a&&e<=D.f)return e-(D.a-10)}function Re(e,t={}){let n=e;t.size&&(re(n,{size:t.size}),n=Y(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const o=r.length/2,a=new Uint8Array(o);for(let s=0,l=0;s<o;s++){const c=ht(r.charCodeAt(l++)),_=ht(r.charCodeAt(l++));if(c===void 0||_===void 0)throw new q(`Invalid byte sequence ("${r[l-2]}${r[l-1]}" in "${r}").`);a[s]=c*16+_}return a}function nr(e,t){const n=dt(e,t);return Re(n)}function _t(e,t={}){const n=Qn.encode(e);return typeof t.size=="number"?(re(n,{size:t.size}),Y(n,{dir:"right",size:t.size})):n}function pt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function rr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Be(e,...t){if(!rr(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function yt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function or(e,t){Be(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}const _e=BigInt(2**32-1),wt=BigInt(32);function ir(e,t=!1){return t?{h:Number(e&_e),l:Number(e>>wt&_e)}:{h:Number(e>>wt&_e)|0,l:Number(e&_e)|0}}function ar(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:a,l:s}=ir(e[o],t);[n[o],r[o]]=[a,s]}return[n,r]}const sr=(e,t,n)=>e<<n|t>>>32-n,cr=(e,t,n)=>t<<n|e>>>32-n,ur=(e,t,n)=>t<<n-32|e>>>64-n,lr=(e,t,n)=>e<<n-32|t>>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function fr(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}const mt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function dr(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function bt(e){for(let t=0;t<e.length;t++)e[t]=dr(e[t])}function hr(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function gt(e){return typeof e=="string"&&(e=hr(e)),Be(e),e}class _r{clone(){return this._cloneInto()}}function pr(e){const t=r=>e().update(gt(r)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}const vt=[],xt=[],Ft=[],yr=BigInt(0),oe=BigInt(1),wr=BigInt(2),mr=BigInt(7),br=BigInt(256),gr=BigInt(113);for(let e=0,t=oe,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],vt.push(2*(5*r+n)),xt.push((e+1)*(e+2)/2%64);let o=yr;for(let a=0;a<7;a++)t=(t<<oe^(t>>mr)*gr)%br,t&wr&&(o^=oe<<(oe<<BigInt(a))-oe);Ft.push(o)}const[vr,xr]=ar(Ft,!0),kt=(e,t,n)=>n>32?ur(e,t,n):sr(e,t,n),St=(e,t,n)=>n>32?lr(e,t,n):cr(e,t,n);function Fr(e,t=24){const n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){const l=(s+8)%10,c=(s+2)%10,_=n[c],v=n[c+1],d=kt(_,v,1)^n[l],w=St(_,v,1)^n[l+1];for(let f=0;f<50;f+=10)e[s+f]^=d,e[s+f+1]^=w}let o=e[2],a=e[3];for(let s=0;s<24;s++){const l=xt[s],c=kt(o,a,l),_=St(o,a,l),v=vt[s];o=e[v],a=e[v+1],e[v]=c,e[v+1]=_}for(let s=0;s<50;s+=10){for(let l=0;l<10;l++)n[l]=e[s+l];for(let l=0;l<10;l++)e[s+l]^=~n[(l+2)%10]&n[(l+4)%10]}e[0]^=vr[r],e[1]^=xr[r]}n.fill(0)}class He extends _r{constructor(t,n,r,o=!1,a=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,pt(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=fr(this.state)}keccak(){mt||bt(this.state32),Fr(this.state32,this.rounds),mt||bt(this.state32),this.posOut=0,this.pos=0}update(t){yt(this);const{blockLen:n,state:r}=this;t=gt(t);const o=t.length;for(let a=0;a<o;){const s=Math.min(n-this.pos,o-a);for(let l=0;l<s;l++)r[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,n&128&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){yt(this,!1),Be(t),this.finish();const n=this.state,{blockLen:r}=this;for(let o=0,a=t.length;o<a;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,a-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return pt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(or(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:o,rounds:a,enableXOF:s}=this;return t||(t=new He(n,r,o,s,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}}const kr=((e,t,n)=>pr(()=>new He(t,e,n)))(1,136,256/8);function Et(e,t){const n=t||"hex",r=kr($e(e,{strict:!1})?er(e):e);return n==="bytes"?r:he(r)}class Ct extends q{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class At extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const Me=new At(8192);function Sr(e,t){if(Me.has(`${e}.${t}`))return Me.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=Et(_t(n),"bytes"),o=n.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&o[s]&&(o[s]=o[s].toUpperCase()),(r[s>>1]&15)>=8&&o[s+1]&&(o[s+1]=o[s+1].toUpperCase());const a=`0x${o.join("")}`;return Me.set(`${e}.${t}`,a),a}const Er=/^0x[a-fA-F0-9]{40}$/,Ne=new At(8192);function It(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(Ne.has(r))return Ne.get(r);const o=Er.test(e)?e.toLowerCase()===e?!0:n?Sr(e)===e:!0:!1;return Ne.set(r,o),o}function Cr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function Ar(e,t){if(!It(e,{strict:!1}))throw new Ct({address:e});if(!It(t,{strict:!1}))throw new Ct({address:t});return e.toLowerCase()===t.toLowerCase()}var Pt=Ln({"../../node_modules/async-lz-string/libs/async-lz-string.js"(e,t){(function(n,r){if(typeof e=="object"&&typeof t=="object")t.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var o=r();for(var a in o)(typeof e=="object"?e:n)[a]=o[a]}})(e,()=>(()=>{var n={48:function(o,a,s){var l=this&&this.__awaiter||function(p,m,i,h){return new(i||(i=Promise))(function(g,C){function k(E){try{S(h.next(E))}catch(y){C(y)}}function u(E){try{S(h.throw(E))}catch(y){C(y)}}function S(E){var y;E.done?g(E.value):(y=E.value,y instanceof i?y:new i(function(A){A(y)})).then(k,u)}S((h=h.apply(p,m||[])).next())})},c=this&&this.__generator||function(p,m){var i,h,g,C,k={label:0,sent:function(){if(1&g[0])throw g[1];return g[1]},trys:[],ops:[]};return C={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function u(S){return function(E){return function(y){if(i)throw new TypeError("Generator is already executing.");for(;C&&(C=0,y[0]&&(k=0)),k;)try{if(i=1,h&&(g=2&y[0]?h.return:y[0]?h.throw||((g=h.return)&&g.call(h),0):h.next)&&!(g=g.call(h,y[1])).done)return g;switch(h=0,g&&(y=[2&y[0],g.value]),y[0]){case 0:case 1:g=y;break;case 4:return k.label++,{value:y[1],done:!1};case 5:k.label++,h=y[1],y=[0];continue;case 7:y=k.ops.pop(),k.trys.pop();continue;default:if(!((g=(g=k.trys).length>0&&g[g.length-1])||y[0]!==6&&y[0]!==2)){k=0;continue}if(y[0]===3&&(!g||y[1]>g[0]&&y[1]<g[3])){k.label=y[1];break}if(y[0]===6&&k.label<g[1]){k.label=g[1],g=y;break}if(g&&k.label<g[2]){k.label=g[2],k.ops.push(y);break}g[2]&&k.ops.pop(),k.trys.pop();continue}y=m.call(p,k)}catch(A){y=[6,A],h=0}finally{i=g=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([S,E])}}};Object.defineProperty(a,"__esModule",{value:!0}),a.decompressFromUTF16=a.compressToUTF16=a.decompressFromBase64=a.compressToBase64=void 0;var _=s(304),v=s(134),d=new _.CompressorImpl,w=new v.DecompressorImpl,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b={};a.compressToBase64=function(p){return l(this,void 0,void 0,function(){var m;return c(this,function(i){switch(i.label){case 0:return p===null?[2,""]:[4,d.compress(p,6,function(h){return f.charAt(h)})];case 1:switch((m=i.sent()).length%4){default:case 0:return[2,m];case 1:return[2,m+"==="];case 2:return[2,m+"=="];case 3:return[2,m+"="]}return[2]}})})},a.decompressFromBase64=function(p){return l(this,void 0,void 0,function(){return c(this,function(m){switch(m.label){case 0:return p===null?[2,""]:p===""?[2,null]:[4,w.decompress(p.length,32,function(i){return function(h,g){if(!b[h]){b[h]={};for(var C=0;C<h.length;C++)b[h][h.charAt(C)]=C}return b[h][g]}(f,p.charAt(i))})];case 1:return[2,m.sent()]}})})},a.compressToUTF16=function(p){return l(this,void 0,void 0,function(){return c(this,function(m){switch(m.label){case 0:return p===null?[2,""]:[4,d.compress(p,15,function(i){return String.fromCharCode(i+32)})];case 1:return[2,m.sent()+" "]}})})},a.decompressFromUTF16=function(p){return l(this,void 0,void 0,function(){return c(this,function(m){switch(m.label){case 0:return p===null?[2,""]:p===""?[2,null]:[4,w.decompress(p.length,16384,function(i){return p.charCodeAt(i)-32})];case 1:return[2,m.sent()]}})})}},304:function(o,a,s){var l=this&&this.__awaiter||function(w,f,b,p){return new(b||(b=Promise))(function(m,i){function h(k){try{C(p.next(k))}catch(u){i(u)}}function g(k){try{C(p.throw(k))}catch(u){i(u)}}function C(k){var u;k.done?m(k.value):(u=k.value,u instanceof b?u:new b(function(S){S(u)})).then(h,g)}C((p=p.apply(w,f||[])).next())})},c=this&&this.__generator||function(w,f){var b,p,m,i,h={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return i={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function g(C){return function(k){return function(u){if(b)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(h=0)),h;)try{if(b=1,p&&(m=2&u[0]?p.return:u[0]?p.throw||((m=p.return)&&m.call(p),0):p.next)&&!(m=m.call(p,u[1])).done)return m;switch(p=0,m&&(u=[2&u[0],m.value]),u[0]){case 0:case 1:m=u;break;case 4:return h.label++,{value:u[1],done:!1};case 5:h.label++,p=u[1],u=[0];continue;case 7:u=h.ops.pop(),h.trys.pop();continue;default:if(!((m=(m=h.trys).length>0&&m[m.length-1])||u[0]!==6&&u[0]!==2)){h=0;continue}if(u[0]===3&&(!m||u[1]>m[0]&&u[1]<m[3])){h.label=u[1];break}if(u[0]===6&&h.label<m[1]){h.label=m[1],m=u;break}if(m&&h.label<m[2]){h.label=m[2],h.ops.push(u);break}m[2]&&h.ops.pop(),h.trys.pop();continue}u=f.call(w,h)}catch(S){u=[6,S],p=0}finally{b=m=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([C,k])}}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompressorImpl=void 0;var _=s(658),v=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],d=function(){function w(){}return w.writeValueToData=function(f,b,p,m,i){if(p%4!=0||f.dataPosition+p>m-1)for(var h=0;h<p;h++)f.dataVal=f.dataVal<<1|1&b,f.dataPosition==m-1?(f.dataPosition=0,f.data.push(i(f.dataVal)),f.dataVal=0):f.dataPosition++,b>>=1;else f.dataVal<<=p,f.dataVal|=function(g,C){for(var k=0,u=0;u<C;++u)k<<=4,k|=v[15&g],g>>=4;return k}(b,p/4),f.dataPosition+=p},w.writeWToDataVal=function(f,b,p){f.dictionaryToCreate.has(f.w)?(f.w.charCodeAt(0)<256?(w.writeValueToData(f,0,f.numBits,b,p),w.writeValueToData(f,f.w.charCodeAt(0),8,b,p)):(w.writeValueToData(f,1,f.numBits,b,p),w.writeValueToData(f,f.w.charCodeAt(0),16,b,p)),f.enlargeIn--,f.enlargeIn==0&&(f.enlargeIn=Math.pow(2,f.numBits),f.numBits++),f.dictionaryToCreate.delete(f.w)):w.writeValueToData(f,f.dictionary.get(f.w),f.numBits,b,p),f.enlargeIn--,f.enlargeIn==0&&(f.enlargeIn=Math.pow(2,f.numBits),f.numBits++)},w.loopIteration=function(f,b,p,m,i){var h=f.charAt(b);i.dictionary.has(h)||(i.dictionary.set(h,i.dictSize++),i.dictionaryToCreate.set(h,!0));var g=i.w+h;i.dictionary.has(g)?i.w=g:(this.writeWToDataVal(i,p,m),i.dictionary.set(g,i.dictSize++),i.w=String(h))},w.prototype.compress=function(f,b,p){var m=this;return new Promise(function(i){return l(m,void 0,void 0,function(){var h,g;return c(this,function(C){switch(C.label){case 0:if(f==null)return i(""),[2];h={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},g=0,C.label=1;case 1:return g<f.length?(w.loopIteration(f,g,b,p,h),g%1e4!=0?[3,3]:[4,(0,_.wait)()]):[3,4];case 2:C.sent(),C.label=3;case 3:return g+=1,[3,1];case 4:return h.w!==""&&w.writeWToDataVal(h,b,p),w.writeValueToData(h,2,h.numBits,b,p),h.dataVal<<=b-h.dataPosition,h.data.push(p(h.dataVal)),i(h.data.join("")),[2]}})})})},w}();a.CompressorImpl=d},134:function(o,a,s){var l=this&&this.__awaiter||function(d,w,f,b){return new(f||(f=Promise))(function(p,m){function i(C){try{g(b.next(C))}catch(k){m(k)}}function h(C){try{g(b.throw(C))}catch(k){m(k)}}function g(C){var k;C.done?p(C.value):(k=C.value,k instanceof f?k:new f(function(u){u(k)})).then(i,h)}g((b=b.apply(d,w||[])).next())})},c=this&&this.__generator||function(d,w){var f,b,p,m,i={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return m={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function h(g){return function(C){return function(k){if(f)throw new TypeError("Generator is already executing.");for(;m&&(m=0,k[0]&&(i=0)),i;)try{if(f=1,b&&(p=2&k[0]?b.return:k[0]?b.throw||((p=b.return)&&p.call(b),0):b.next)&&!(p=p.call(b,k[1])).done)return p;switch(b=0,p&&(k=[2&k[0],p.value]),k[0]){case 0:case 1:p=k;break;case 4:return i.label++,{value:k[1],done:!1};case 5:i.label++,b=k[1],k=[0];continue;case 7:k=i.ops.pop(),i.trys.pop();continue;default:if(!((p=(p=i.trys).length>0&&p[p.length-1])||k[0]!==6&&k[0]!==2)){i=0;continue}if(k[0]===3&&(!p||k[1]>p[0]&&k[1]<p[3])){i.label=k[1];break}if(k[0]===6&&i.label<p[1]){i.label=p[1],p=k;break}if(p&&i.label<p[2]){i.label=p[2],i.ops.push(k);break}p[2]&&i.ops.pop(),i.trys.pop();continue}k=w.call(d,i)}catch(u){k=[6,u],b=0}finally{f=p=0}if(5&k[0])throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}([g,C])}}};Object.defineProperty(a,"__esModule",{value:!0}),a.DecompressorImpl=void 0;var _=s(658),v=function(){function d(){}return d.prototype.decompress=function(w,f,b){var p=this;return new Promise(function(m){return l(p,void 0,void 0,function(){var i,h,g;return c(this,function(C){switch(C.label){case 0:for(i={bits:0,c:null,dataIndex:1,dataPosition:f,dataVal:b(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:Math.pow(2,2),numBits:3,power:1,resb:null,result:[],w:null},h=0;h<3;h+=1)i.dictionary.set(h,h);for(;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=f,i.dataVal=b(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=f,i.dataVal=b(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition===0&&(i.dataPosition=f,i.dataVal=b(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 2:return m(""),[2]}i.dictionary[3]=i.c,i.w=i.c,i.result.push(i.c),g=1,C.label=1;case 1:return g%2e4!=0?[3,3]:[4,(0,_.wait)()];case 2:C.sent(),C.label=3;case 3:if(i.dataIndex>w)return m(""),[2];for(i.bits=0,i.maxPower=Math.pow(2,i.numBits),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=f,i.dataVal=b(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.c=i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=f,i.dataVal=b(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=f,i.dataVal=b(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 2:return m(i.result.join("")),[2]}if(i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),i.dictionary[i.c])i.entry=i.dictionary[i.c];else{if(i.c!==i.dictSize)return m(null),[2];i.entry=i.w+i.w.charAt(0)}return i.result.push(i.entry),i.dictionary[i.dictSize++]=i.w+i.entry.charAt(0),i.enlargeIn--,i.w=i.entry,i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),g++,[3,1];case 4:return[2]}})})})},d}();a.DecompressorImpl=v},658:function(o,a){var s=this&&this.__awaiter||function(c,_,v,d){return new(v||(v=Promise))(function(w,f){function b(i){try{m(d.next(i))}catch(h){f(h)}}function p(i){try{m(d.throw(i))}catch(h){f(h)}}function m(i){var h;i.done?w(i.value):(h=i.value,h instanceof v?h:new v(function(g){g(h)})).then(b,p)}m((d=d.apply(c,_||[])).next())})},l=this&&this.__generator||function(c,_){var v,d,w,f,b={label:0,sent:function(){if(1&w[0])throw w[1];return w[1]},trys:[],ops:[]};return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(m){return function(i){return function(h){if(v)throw new TypeError("Generator is already executing.");for(;f&&(f=0,h[0]&&(b=0)),b;)try{if(v=1,d&&(w=2&h[0]?d.return:h[0]?d.throw||((w=d.return)&&w.call(d),0):d.next)&&!(w=w.call(d,h[1])).done)return w;switch(d=0,w&&(h=[2&h[0],w.value]),h[0]){case 0:case 1:w=h;break;case 4:return b.label++,{value:h[1],done:!1};case 5:b.label++,d=h[1],h=[0];continue;case 7:h=b.ops.pop(),b.trys.pop();continue;default:if(!((w=(w=b.trys).length>0&&w[w.length-1])||h[0]!==6&&h[0]!==2)){b=0;continue}if(h[0]===3&&(!w||h[1]>w[0]&&h[1]<w[3])){b.label=h[1];break}if(h[0]===6&&b.label<w[1]){b.label=w[1],w=h;break}if(w&&b.label<w[2]){b.label=w[2],b.ops.push(h);break}w[2]&&b.ops.pop(),b.trys.pop();continue}h=_.call(c,b)}catch(g){h=[6,g],d=0}finally{v=w=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([m,i])}}};Object.defineProperty(a,"__esModule",{value:!0}),a.wait=void 0,a.wait=function(){return s(this,void 0,void 0,function(){return l(this,function(c){return[2,new Promise(function(_){setTimeout(_,0)})]})})}}},r={};return function o(a){var s=r[a];if(s!==void 0)return s.exports;var l=r[a]={exports:{}};return n[a].call(l.exports,l,l.exports,o),l.exports}(48)})())}}),M=class extends Error{constructor(e,t,n){super(t),this.code=e,this.data=n}},Ir=class extends M{constructor(e){super(N.internalError,e)}},N={internalError:-32603,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006},$t=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve=e=>{this._resolve?.(e)};reject=e=>{this._reject?.(e)}},Pr=ot(Pt());async function Tt(e){const t=de.sha256(JSON.stringify(e)),n={...e,validationHash:t},r=await $r(n),o=de.sha256(r);return{compressed:r,compressedHash:o}}async function $r(e){return(0,Pr.compressToBase64)(JSON.stringify(e))}var Tr=ot(Pt());async function Ot(e){if(!(e?.compressed&&e?.compressedHash))throw new M(N.corruptedResponse,"Missing compressed data");const t=await Or(e.compressed);if(!t)throw new M(N.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new M(N.corruptedResponse,"Missing validation hash");if(de.sha256(e.compressed)!==e.compressedHash)throw new M(N.corruptedResponse,"Invalid compressed hash");const{validationHash:r,...o}=t;if(de.sha256(JSON.stringify(o))!==t.validationHash)throw new M(N.corruptedResponse,"Invalid data validation hash");return t}async function Or(e){const t=await(0,Tr.decompressFromBase64)(e);try{return JSON.parse(t)}catch(n){return console.error("Invalid compressed data",{e:n,decompressed:t}),null}}var pe={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{zIndex:2000001}};function Rr({walletBaseUrl:e,config:t}){const n=document.querySelector("#nexus-wallet");n&&n.remove();const r=document.createElement("iframe");return r.id=pe.id,r.name=pe.name,r.allow=pe.allow,r.style.zIndex=pe.style.zIndex.toString(),Rt({iframe:r,isVisible:!1}),document.body.appendChild(r),new Promise(o=>{r?.addEventListener("load",()=>o(r)),r.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function Rt({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}var Ue="fCtx";function Br(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Hr(e){const t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),n=>n.charCodeAt(0))}function Bt(e){if(e?.r)try{const t=Re(e.r);return Br(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function Ht(e){if(!(!e||e.length===0))try{const t=Hr(e);return{r:Oe(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function Mt({url:e}){if(!e)return null;const n=new URL(e).searchParams.get(Ue);return n?Ht(n):null}function Nt({url:e,context:t}){if(!e)return null;const n=Mt({url:e}),r=n?{...n,...t}:t;if(!r.r)return null;const o=Bt(r);if(!o)return null;const a=new URL(e);return a.searchParams.set(Ue,o),a.toString()}function Ut(e){const t=new URL(e);return t.searchParams.delete(Ue),t.toString()}function Mr({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}const n=e??window.location.href;let r;t!==null?r=Nt({url:n,context:t}):r=Ut(n),r&&window.history.replaceState(null,"",r.toString())}var Le={compress:Bt,decompress:Ht,parse:Mt,update:Nt,remove:Ut,replaceUrl:Mr},ye="nexus-wallet-backup",Lt=class Hn{config;iframe;isSetupDone=!1;lastResponse=null;lastRequest=null;constructor(t,n){this.config=t,this.iframe=n,this.lastRequest=null,this.lastResponse=null}setLastResponse(t){this.lastResponse={event:t.data,origin:t.origin,timestamp:Date.now()}}setLastRequest(t,n){this.lastRequest={event:t,target:n,timestamp:Date.now()}}updateSetupStatus(t){this.isSetupDone=t}base64Encode(t){try{return btoa(JSON.stringify(t))}catch(n){return console.warn("Failed to encode debug data",n),btoa("Failed to encode data")}}getIframeStatus(){return this.iframe?{loading:this.iframe.hasAttribute("loading"),url:this.iframe.src,readyState:this.iframe.contentDocument?.readyState?this.iframe.contentDocument.readyState==="complete"?1:0:-1,contentWindow:!!this.iframe.contentWindow,isConnected:this.iframe.isConnected}:null}getNavigatorInfo(){return navigator?{userAgent:navigator.userAgent,language:navigator.language,onLine:navigator.onLine,screenWidth:window.screen.width,screenHeight:window.screen.height,pixelRatio:window.devicePixelRatio}:null}gatherDebugInfo(t){const n=this.getIframeStatus(),r=this.getNavigatorInfo();let o="Unknown";return t instanceof M?o=`FrakRpcError: ${t.code} '${t.message}'`:t instanceof Error?o=t.message:typeof t=="string"&&(o=t),{timestamp:new Date().toISOString(),encodedUrl:btoa(window.location.href),encodedConfig:this.config?this.base64Encode(this.config):"no-config",navigatorInfo:r?this.base64Encode(r):"no-navigator",iframeStatus:n?this.base64Encode(n):"not-iframe",lastRequest:this.lastRequest?this.base64Encode(this.lastRequest):"No Frak request logged",lastResponse:this.lastResponse?this.base64Encode(this.lastResponse):"No Frak response logged",clientStatus:this.isSetupDone?"setup":"not-setup",error:o}}static empty(){return new Hn}formatDebugInfo(t){const n=this.gatherDebugInfo(t);return`
|
|
24
10
|
Debug Information:
|
|
25
11
|
-----------------
|
|
26
12
|
Timestamp: ${n.timestamp}
|
|
@@ -32,44 +18,4 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
|
|
|
32
18
|
Last Response: ${n.lastResponse}
|
|
33
19
|
Client Status: ${n.clientStatus}
|
|
34
20
|
Error: ${n.error}
|
|
35
|
-
`.trim()}};function eu(){let e=new Map;return{createChannel:t=>{let n=Math.random().toString(36).substring(7);return e.set(n,t),n},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}function tu({iframe:e}){let t=new mt;return{handleEvent:async s=>{var c;switch(s.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":s.data.backup?localStorage.setItem(_r,s.data.backup):localStorage.removeItem(_r);break;case"remove-backup":localStorage.removeItem(_r);break;case"show":case"hide":cn({iframe:e,isVisible:s.iframeLifecycle==="show"});break;case"handshake":{console.log("Received handshake event",{token:s.data.token}),(c=e.contentWindow)==null||c.postMessage({clientLifecycle:"handshake-response",data:{token:s.data.token,currentUrl:window.location.href}},"*");break}}},isConnected:t.promise}}function ru({frakWalletUrl:e,iframe:t,channelManager:n,iframeLifecycleManager:s,debugInfo:c}){if(typeof window>"u")throw new we(xe.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new we(xe.configError,"The iframe does not have a product window");let f=t.contentWindow;async function a(A){if(!A.origin)return;try{if(new URL(A.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return}catch(S){console.log("Unable to check frak msg origin",S);return}if(typeof A.data!="object")return;if(c.setLastResponse(A),"iframeLifecycle"in A.data){await s.handleEvent(A.data);return}if("clientLifecycle"in A.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let R=A.data.id,g=n.getRpcResolver(R);g&&await g(A.data)}window.addEventListener("message",a);function m(A){f.postMessage(A,{targetOrigin:e}),c.setLastRequest(A,e)}function d(){window.removeEventListener("message",a)}return{sendEvent:m,cleanup:d}}function nu({config:e,iframe:t}){var n;let s=eu(),c=tu({iframe:t}),f=new ln(e,t),a=ru({frakWalletUrl:(n=e==null?void 0:e.walletUrl)!=null?n:"https://wallet.frak.id",iframe:t,channelManager:s,iframeLifecycleManager:c,debugInfo:f}),m=async S=>{if(!await c.isConnected)throw new we(xe.clientNotConnected,"The iframe provider isn't connected yet");let b=new mt,v=s.createChannel(async l=>{var w;let k=await mr(l.data);k.error?b.reject(new we(k.error.code,k.error.message,(w=k.error)==null?void 0:w.data)):b.resolve(k.result),s.removeChannel(v)}),I=await hr(S);return a.sendEvent({id:v,topic:S.method,data:I}),b.promise},d=async(S,h)=>{if(!await c.isConnected)throw new we(xe.clientNotConnected,"The iframe provider isn't connected yet");let v=s.createChannel(async l=>{let w=await mr(l.data);if(w.result)h(w.result);else throw new oa("No valid result in the response")}),I=await hr(S);a.sendEvent({id:v,topic:S.method,data:I})},A=ou(a,c),R=async()=>{A(),s.destroy(),a.cleanup(),t.remove()},g=iu({config:e,messageHandler:a,lifecycleManager:c}).then(()=>f.updateSetupStatus(!0));return{config:e,debugInfo:f,waitForConnection:c.isConnected,waitForSetup:g,request:m,listenerRequest:d,destroy:R}}function ou(e,t){let c,f,a=()=>e.sendEvent({clientLifecycle:"heartbeat"});async function m(){a(),c=setInterval(a,100),f=setTimeout(()=>{d(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,d()}function d(){c&&clearInterval(c),f&&clearTimeout(f)}return m(),d}async function iu({config:e,messageHandler:t,lifecycleManager:n}){await n.isConnected;let s=async()=>{let f=e.metadata.css;f&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:f}})},c=async()=>{if(typeof window>"u")return;let f=window.localStorage.getItem(_r);f&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:f}})};await Promise.all([s(),c()])}async function da({config:e}){let t=await un({config:e});if(!t){console.error("Failed to create iframe");return}let n=nu({config:e,iframe:t});if(await n.waitForSetup,!await n.waitForConnection){console.error("Failed to connect to client");return}return n}U();O();P();function ha(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}U();O();P();U();O();P();U();O();P();var ma={createLink(){return{handlerTypeDenominator:Ye(er.referral),interactionData:zr.referral.createLink}},referred({referrer:e}){let t=an([zr.referral.referred,Ue(e,{size:32})]);return{handlerTypeDenominator:Ye(er.referral),interactionData:t}}};function au(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(c=>(_a(c.interactionToken),c));let n=new mt,s=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},c=>{t(c),_a(c.interactionToken),s||(n.resolve(c),s=!0)}).then(()=>n.promise)}function _a(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function su({domain:e}){let t=e!=null?e:window.location.host;return Rt(Ye(t))}async function uu(e,{productId:t,interaction:n,validation:s}){let c=t!=null?t:su(e.config);return await e.request({method:"frak_sendInteraction",params:[c,n,s]})}async function ya(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,n]})}async function wr(e,t){await e.request({method:"frak_displayEmbededWallet",params:[t,e.config.metadata.name]})}async function wa(e){return await e.request({method:"frak_getProductInformation"})}function ga(e,{metadata:t,login:n,openSession:s}){let c={steps:{login:n!=null?n:{},openSession:s!=null?s:{}},metadata:t};return yr(e,c)}function yr(e,t){function n(a){return yr(e,{...t,steps:{...t.steps,sendTransaction:a}})}function s(a){return yr(e,{...t,steps:{...t.steps,final:{...a,action:{key:"reward"}}}})}function c(a,m){return yr(e,{...t,steps:{...t.steps,final:{...m,action:{key:"sharing",options:a}}}})}async function f(a){var m;return a&&(t.metadata=a((m=t.metadata)!=null?m:{})),await ya(e,t)}return{params:t,sendTx:n,reward:s,sharing:c,display:f}}async function cu(e,{walletStatus:t,frakContext:n,modalConfig:s,productId:c,options:f}){var a,m;let d=!1;async function A(){if(!d)return d=!0,lu(e,{modalConfig:s,walletStatus:t})}async function R(g){let S=ma.referred({referrer:g});await uu(e,{productId:c,interaction:S})}try{let{status:g,currentWallet:S}=await fu({initialWalletStatus:t,getFreshWalletStatus:A,pushReferralInteraction:R,frakContext:n});return Ot.replaceUrl({url:(a=window.location)==null?void 0:a.href,context:f!=null&&f.alwaysAppendUrl?{r:S}:null}),g}catch(g){return console.log("Error processing referral",{error:g}),Ot.replaceUrl({url:(m=window.location)==null?void 0:m.href,context:f!=null&&f.alwaysAppendUrl?{r:t==null?void 0:t.wallet}:null}),pu(g)}}async function fu({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:s}){let c=e==null?void 0:e.wallet;return s!=null&&s.r?(c||(c=await t()),c&&sn(s.r,c)?{status:"self-referral",currentWallet:c}:(e!=null&&e.interactionSession||(c=await t()),await n(s.r),{status:"success",currentWallet:c})):{status:"no-referrer",currentWallet:c}}async function lu(e,{modalConfig:t,walletStatus:n}){var s,c,f;if(!(n!=null&&n.interactionSession)){if(!t)return;let a=await ya(e,t);return(c=(s=a==null?void 0:a.login)==null?void 0:s.wallet)!=null?c:void 0}return(f=n.wallet)!=null?f:void 0}function pu(e){if(e instanceof we)switch(e.code){case xe.walletNotConnected:return"no-wallet";case xe.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function xa(e,{productId:t,modalConfig:n,options:s}={}){let c=Ot.parse({url:window.location.href}),f=await au(e);try{return await cu(e,{walletStatus:f,frakContext:c,modalConfig:n,productId:t,options:s})}catch(a){console.warn("Error processing referral",{error:a})}}var ba="frakClientReady",gr;function va(){let e=new CustomEvent(ba);window.dispatchEvent(e)}function _t(e,t){var s;if((s=window.FrakSetup)!=null&&s.client&&e==="add"){t();return}(e==="add"?window.addEventListener:window.removeEventListener)(ba,t,!1)}function Ea(e){var t,n;gr=ga(e,(n=(t=window.FrakSetup)==null?void 0:t.modalConfig)!=null?n:{})}async function Aa(e){if(!gr){console.error("modalBuilderSteps not found");return}let t=await xa(e,{modalConfig:gr.reward().params});console.log("referral",t)}function Ia(){return gr}function Sa(){"vibrate"in navigator?navigator.vibrate(200):console.log("Vibration not supported")}async function xr(e){var c;let t=(c=window.FrakSetup)==null?void 0:c.client;if(!t){console.warn("Frak client not ready yet");return}let n=await wa(t);if(!(n!=null&&n.estimatedEurReward))return;let s=n.estimatedEurReward;if(e){let f=n.rewards.filter(a=>a.interactionTypeKey===e).map(a=>a.referrer.eurAmount).reduce((a,m)=>m>a?m:a,0);f>0&&(s=Math.ceil(f).toString())}return s}U();O();P();U();O();P();U();O();P();var Lt,se,Ra,du,it,Ta,Fa,pn,Ua,mn,dn,hn,hu,Nt={},Pa=[],mu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_n=Array.isArray;function We(e,t){for(var n in t)e[n]=t[n];return e}function yn(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function at(e,t,n){var s,c,f,a={};for(f in t)f=="key"?s=t[f]:f=="ref"?c=t[f]:a[f]=t[f];if(arguments.length>2&&(a.children=arguments.length>3?Lt.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(f in e.defaultProps)a[f]===void 0&&(a[f]=e.defaultProps[f]);return Mt(e,a,s,c,null)}function Mt(e,t,n,s,c){var f={type:e,props:t,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:c==null?++Ra:c,__i:-1,__u:0};return c==null&&se.vnode!=null&&se.vnode(f),f}function Ke(e){return e.children}function vr(e,t){this.props=e,this.context=t}function yt(e,t){if(t==null)return e.__?yt(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?yt(e):null}function Oa(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Oa(e)}}function Ca(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!Er.__r++||Ta!==se.debounceRendering)&&((Ta=se.debounceRendering)||Fa)(Er)}function Er(){var e,t,n,s,c,f,a,m;for(it.sort(pn);e=it.shift();)e.__d&&(t=it.length,s=void 0,f=(c=(n=e).__v).__e,a=[],m=[],n.__P&&((s=We({},c)).__v=c.__v+1,se.vnode&&se.vnode(s),wn(n.__P,s,c,n.__n,n.__P.namespaceURI,32&c.__u?[f]:null,a,f==null?yt(c):f,!!(32&c.__u),m),s.__v=c.__v,s.__.__k[s.__i]=s,La(a,s,m),s.__e!=f&&Oa(s)),it.length>t&&it.sort(pn));Er.__r=0}function Ma(e,t,n,s,c,f,a,m,d,A,R){var g,S,h,b,v,I,l=s&&s.__k||Pa,w=t.length;for(d=_u(n,t,l,d,w),g=0;g<w;g++)(h=n.__k[g])!=null&&(S=h.__i===-1?Nt:l[h.__i]||Nt,h.__i=g,I=wn(e,h,S,c,f,a,m,d,A,R),b=h.__e,h.ref&&S.ref!=h.ref&&(S.ref&&gn(S.ref,null,h),R.push(h.ref,h.__c||b,h)),v==null&&b!=null&&(v=b),4&h.__u||S.__k===h.__k?d=Na(h,d,e):typeof h.type=="function"&&I!==void 0?d=I:b&&(d=b.nextSibling),h.__u&=-7);return n.__e=v,d}function _u(e,t,n,s,c){var f,a,m,d,A,R=n.length,g=R,S=0;for(e.__k=new Array(c),f=0;f<c;f++)(a=t[f])!=null&&typeof a!="boolean"&&typeof a!="function"?(d=f+S,(a=e.__k[f]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Mt(null,a,null,null,null):_n(a)?Mt(Ke,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Mt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,m=null,(A=a.__i=yu(a,n,d,g))!==-1&&(g--,(m=n[A])&&(m.__u|=2)),m==null||m.__v===null?(A==-1&&S--,typeof a.type!="function"&&(a.__u|=4)):A!=d&&(A==d-1?S--:A==d+1?S++:(A>d?S--:S++,a.__u|=4))):e.__k[f]=null;if(g)for(f=0;f<R;f++)(m=n[f])!=null&&!(2&m.__u)&&(m.__e==s&&(s=yt(m)),Ha(m,m));return s}function Na(e,t,n){var s,c;if(typeof e.type=="function"){for(s=e.__k,c=0;s&&c<s.length;c++)s[c]&&(s[c].__=e,t=Na(s[c],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=yt(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function yu(e,t,n,s){var c,f,a=e.key,m=e.type,d=t[n];if(d===null||d&&a==d.key&&m===d.type&&!(2&d.__u))return n;if(s>(d!=null&&!(2&d.__u)?1:0))for(c=n-1,f=n+1;c>=0||f<t.length;){if(c>=0){if((d=t[c])&&!(2&d.__u)&&a==d.key&&m===d.type)return c;c--}if(f<t.length){if((d=t[f])&&!(2&d.__u)&&a==d.key&&m===d.type)return f;f++}}return-1}function ka(e,t,n){t[0]=="-"?e.setProperty(t,n==null?"":n):e[t]=n==null?"":typeof n!="number"||mu.test(t)?n:n+"px"}function br(e,t,n,s,c){var f;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof s=="string"&&(e.style.cssText=s=""),s)for(t in s)n&&t in n||ka(e.style,t,"");if(n)for(t in n)s&&n[t]===s[t]||ka(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")f=t!=(t=t.replace(Ua,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+f]=n,n?s?n.u=s.u:(n.u=mn,e.addEventListener(t,f?hn:dn,f)):e.removeEventListener(t,f?hn:dn,f);else{if(c=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n==null?"":n;break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ba(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=mn++;else if(t.t<n.u)return;return n(se.event?se.event(t):t)}}}function wn(e,t,n,s,c,f,a,m,d,A){var R,g,S,h,b,v,I,l,w,k,D,F,x,N,$,T,V,M=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(d=!!(32&n.__u),f=[m=t.__e=n.__e]),(R=se.__b)&&R(t);e:if(typeof M=="function")try{if(l=t.props,w="prototype"in M&&M.prototype.render,k=(R=M.contextType)&&s[R.__c],D=R?k?k.props.value:R.__:s,n.__c?I=(g=t.__c=n.__c).__=g.__E:(w?t.__c=g=new M(l,D):(t.__c=g=new vr(l,D),g.constructor=M,g.render=gu),k&&k.sub(g),g.props=l,g.state||(g.state={}),g.context=D,g.__n=s,S=g.__d=!0,g.__h=[],g._sb=[]),w&&g.__s==null&&(g.__s=g.state),w&&M.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=We({},g.__s)),We(g.__s,M.getDerivedStateFromProps(l,g.__s))),h=g.props,b=g.state,g.__v=t,S)w&&M.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),w&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(w&&M.getDerivedStateFromProps==null&&l!==h&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(l,D),!g.__e&&(g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(l,g.__s,D)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(g.props=l,g.state=g.__s,g.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(K){K&&(K.__=t)}),F=0;F<g._sb.length;F++)g.__h.push(g._sb[F]);g._sb=[],g.__h.length&&a.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(l,g.__s,D),w&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(h,b,v)})}if(g.context=D,g.props=l,g.__P=e,g.__e=!1,x=se.__r,N=0,w){for(g.state=g.__s,g.__d=!1,x&&x(t),R=g.render(g.props,g.state,g.context),$=0;$<g._sb.length;$++)g.__h.push(g._sb[$]);g._sb=[]}else do g.__d=!1,x&&x(t),R=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++N<25);g.state=g.__s,g.getChildContext!=null&&(s=We(We({},s),g.getChildContext())),w&&!S&&g.getSnapshotBeforeUpdate!=null&&(v=g.getSnapshotBeforeUpdate(h,b)),m=Ma(e,_n(T=R!=null&&R.type===Ke&&R.key==null?R.props.children:R)?T:[T],t,n,s,c,f,a,m,d,A),g.base=t.__e,t.__u&=-161,g.__h.length&&a.push(g),I&&(g.__E=g.__=null)}catch(K){if(t.__v=null,d||f!=null)if(K.then){for(t.__u|=d?160:128;m&&m.nodeType==8&&m.nextSibling;)m=m.nextSibling;f[f.indexOf(m)]=null,t.__e=m}else for(V=f.length;V--;)yn(f[V]);else t.__e=n.__e,t.__k=n.__k;se.__e(K,t,n)}else f==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):m=t.__e=wu(n.__e,t,n,s,c,f,a,d,A);return(R=se.diffed)&&R(t),128&t.__u?void 0:m}function La(e,t,n){for(var s=0;s<n.length;s++)gn(n[s],n[++s],n[++s]);se.__c&&se.__c(t,e),e.some(function(c){try{e=c.__h,c.__h=[],e.some(function(f){f.call(c)})}catch(f){se.__e(f,c.__v)}})}function wu(e,t,n,s,c,f,a,m,d){var A,R,g,S,h,b,v,I=n.props,l=t.props,w=t.type;if(w=="svg"?c="http://www.w3.org/2000/svg":w=="math"?c="http://www.w3.org/1998/Math/MathML":c||(c="http://www.w3.org/1999/xhtml"),f!=null){for(A=0;A<f.length;A++)if((h=f[A])&&"setAttribute"in h==!!w&&(w?h.localName==w:h.nodeType==3)){e=h,f[A]=null;break}}if(e==null){if(w==null)return document.createTextNode(l);e=document.createElementNS(c,w,l.is&&l),m&&(se.__m&&se.__m(t,f),m=!1),f=null}if(w===null)I===l||m&&e.data===l||(e.data=l);else{if(f=f&&Lt.call(e.childNodes),I=n.props||Nt,!m&&f!=null)for(I={},A=0;A<e.attributes.length;A++)I[(h=e.attributes[A]).name]=h.value;for(A in I)if(h=I[A],A!="children"){if(A=="dangerouslySetInnerHTML")g=h;else if(!(A in l)){if(A=="value"&&"defaultValue"in l||A=="checked"&&"defaultChecked"in l)continue;br(e,A,null,h,c)}}for(A in l)h=l[A],A=="children"?S=h:A=="dangerouslySetInnerHTML"?R=h:A=="value"?b=h:A=="checked"?v=h:m&&typeof h!="function"||I[A]===h||br(e,A,h,I[A],c);if(R)m||g&&(R.__html===g.__html||R.__html===e.innerHTML)||(e.innerHTML=R.__html),t.__k=[];else if(g&&(e.innerHTML=""),Ma(e,_n(S)?S:[S],t,n,s,w=="foreignObject"?"http://www.w3.org/1999/xhtml":c,f,a,f?f[0]:n.__k&&yt(n,0),m,d),f!=null)for(A=f.length;A--;)yn(f[A]);m||(A="value",w=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[A]||w=="progress"&&!b||w=="option"&&b!==I[A])&&br(e,A,b,I[A],c),A="checked",v!==void 0&&v!==e[A]&&br(e,A,v,I[A],c))}return e}function gn(e,t,n){try{if(typeof e=="function"){var s=typeof e.__u=="function";s&&e.__u(),s&&t==null||(e.__u=e(t))}else e.current=t}catch(c){se.__e(c,n)}}function Ha(e,t,n){var s,c;if(se.unmount&&se.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||gn(s,null,t)),(s=e.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(f){se.__e(f,t)}s.base=s.__P=null}if(s=e.__k)for(c=0;c<s.length;c++)s[c]&&Ha(s[c],t,n||typeof e.type!="function");n||yn(e.__e),e.__c=e.__=e.__e=void 0}function gu(e,t,n){return this.constructor(e,n)}function Ht(e,t,n){var s,c,f,a;t==document&&(t=document.documentElement),se.__&&se.__(e,t),c=(s=typeof n=="function")?null:n&&n.__k||t.__k,f=[],a=[],wn(t,e=(!s&&n||t).__k=at(Ke,null,[e]),c||Nt,Nt,t.namespaceURI,!s&&n?[n]:c?null:t.firstChild?Lt.call(t.childNodes):null,f,!s&&n?n:c?c.__e:t.firstChild,s,a),La(f,e,a)}function xn(e,t){Ht(e,t,xn)}function bn(e,t,n){var s,c,f,a,m=We({},e.props);for(f in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)f=="key"?s=t[f]:f=="ref"?c=t[f]:m[f]=t[f]===void 0&&a!==void 0?a[f]:t[f];return arguments.length>2&&(m.children=arguments.length>3?Lt.call(arguments,2):n),Mt(e.type,m,s||e.key,c||e.ref,null)}Lt=Pa.slice,se={__e:function(e,t,n,s){for(var c,f,a;t=t.__;)if((c=t.__c)&&!c.__)try{if((f=c.constructor)&&f.getDerivedStateFromError!=null&&(c.setState(f.getDerivedStateFromError(e)),a=c.__d),c.componentDidCatch!=null&&(c.componentDidCatch(e,s||{}),a=c.__d),a)return c.__E=c}catch(m){e=m}throw e}},Ra=0,du=function(e){return e!=null&&e.constructor==null},vr.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=We({},this.state),typeof e=="function"&&(e=e(We({},n),this.props)),e&&We(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ca(this))},vr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ca(this))},vr.prototype.render=Ke,it=[],Fa=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pn=function(e,t){return e.__v.__b-t.__v.__b},Er.__r=0,Ua=/(PointerCapture)$|Capture$/i,mn=0,dn=Ba(!1),hn=Ba(!0),hu=0;function vn(){return(vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}var xu=["context","children"];function bu(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(s,c){if(s==null)return{};var f,a,m={},d=Object.keys(s);for(a=0;a<d.length;a++)c.indexOf(f=d[a])>=0||(m[f]=s[f]);return m}(e,xu);return bn(t,n)}function vu(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=at(bu,vn({},this._props,{context:e.detail.context}),function t(n,s){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var c=[],f={},a=0,m=n.attributes,d=n.childNodes;for(a=m.length;a--;)m[a].name!=="slot"&&(f[m[a].name]=m[a].value,f[$a(m[a].name)]=m[a].value);for(a=d.length;a--;){var A=t(d[a],null),R=d[a].slot;R?f[R]=at(Da,{name:R},A):c[a]=A}var g=s?at(Da,null,c):c;return at(s||n.nodeName.toLowerCase(),f,g)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?xn:Ht)(this._vdom,this._root)}function $a(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function Eu(e,t,n){if(this._vdom){var s={};s[e]=n=n==null?void 0:n,s[$a(e)]=n,this._vdom=bn(this._vdom,s),Ht(this._vdom,this._root)}}function Au(){Ht(this._vdom=null,this._root)}function Da(e,t){var n=this;return at("slot",vn({},e,{ref:function(s){s?(n.ref=s,n._listener||(n._listener=function(c){c.stopPropagation(),c.detail.context=t},s.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function Ar(e,t,n,s){function c(){var f=Reflect.construct(HTMLElement,[],c);return f._vdomComponent=e,f._root=s&&s.shadow?f.attachShadow({mode:s.mode||"open"}):f,f}return(c.prototype=Object.create(HTMLElement.prototype)).constructor=c,c.prototype.connectedCallback=vu,c.prototype.attributeChangedCallback=Eu,c.prototype.disconnectedCallback=Au,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),c.observedAttributes=n,n.forEach(function(f){Object.defineProperty(c.prototype,f,{get:function(){return this._vdom.props[f]},set:function(a){this._vdom?this.attributeChangedCallback(f,null,a):(this._props||(this._props={}),this._props[f]=a,this.connectedCallback());var m=typeof a;a!=null&&m!=="string"&&m!=="boolean"&&m!=="number"||this.setAttribute(f,a)}})}),customElements.define(t||e.tagName||e.displayName||e.name,c)}U();O();P();U();O();P();var Dt,_e,En,ja,Sr=0,Ja=[],ye=se,za=ye.__b,Wa=ye.__r,Va=ye.diffed,qa=ye.__c,Ya=ye.unmount,Ga=ye.__;function In(e,t){ye.__h&&ye.__h(_e,e,Sr||t),Sr=0;var n=_e.__H||(_e.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function Le(e){return Sr=1,Iu(Qa,e)}function Iu(e,t,n){var s=In(Dt++,2);if(s.t=e,!s.__c&&(s.__=[n?n(t):Qa(void 0,t),function(m){var d=s.__N?s.__N[0]:s.__[0],A=s.t(d,m);d!==A&&(s.__N=[A,s.__[1]],s.__c.setState({}))}],s.__c=_e,!_e.u)){var c=function(m,d,A){if(!s.__c.__H)return!0;var R=s.__c.__H.__.filter(function(S){return!!S.__c});if(R.every(function(S){return!S.__N}))return!f||f.call(this,m,d,A);var g=s.__c.props!==m;return R.forEach(function(S){if(S.__N){var h=S.__[0];S.__=S.__N,S.__N=void 0,h!==S.__[0]&&(g=!0)}}),f&&f.call(this,m,d,A)||g};_e.u=!0;var f=_e.shouldComponentUpdate,a=_e.componentWillUpdate;_e.componentWillUpdate=function(m,d,A){if(this.__e){var R=f;f=void 0,c(m,d,A),f=R}a&&a.call(this,m,d,A)},_e.shouldComponentUpdate=c}return s.__N||s.__}function Tr(e,t){var n=In(Dt++,3);!ye.__s&&Xa(n.__H,t)&&(n.__=e,n.i=t,_e.__H.__h.push(n))}function st(e,t){var n=In(Dt++,7);return Xa(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ut(e,t){return Sr=8,st(function(){return e},t)}function Su(){for(var e;e=Ja.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ir),e.__H.__h.forEach(An),e.__H.__h=[]}catch(t){e.__H.__h=[],ye.__e(t,e.__v)}}ye.__b=function(e){_e=null,za&&za(e)},ye.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ga&&Ga(e,t)},ye.__r=function(e){Wa&&Wa(e),Dt=0;var t=(_e=e.__c).__H;t&&(En===_e?(t.__h=[],_e.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(Ir),t.__h.forEach(An),t.__h=[],Dt=0)),En=_e},ye.diffed=function(e){Va&&Va(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ja.push(t)!==1&&ja===ye.requestAnimationFrame||((ja=ye.requestAnimationFrame)||Tu)(Su)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),En=_e=null},ye.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Ir),n.__h=n.__h.filter(function(s){return!s.__||An(s)})}catch(s){t.some(function(c){c.__h&&(c.__h=[])}),t=[],ye.__e(s,n.__v)}}),qa&&qa(e,t)},ye.unmount=function(e){Ya&&Ya(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(s){try{Ir(s)}catch(c){t=c}}),n.__H=void 0,t&&ye.__e(t,n.__v))};var Ka=typeof requestAnimationFrame=="function";function Tu(e){var t,n=function(){clearTimeout(s),Ka&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(n,100);Ka&&(t=requestAnimationFrame(n))}function Ir(e){var t=_e,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),_e=t}function An(e){var t=_e;e.__c=e.__(),_e=t}function Xa(e,t){return!e||e.length!==t.length||t.some(function(n,s){return n!==e[s]})}function Qa(e,t){return typeof t=="function"?t(e):t}U();O();P();function Za(e={}){let{successDuration:t=2e3}=e,[n,s]=Le(!1);return{copy:ut(async f=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(f),s(!0);else{let a=document.createElement("textarea");a.value=f,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),s(!0)}catch(m){return console.error("Failed to copy text:",m),!1}finally{a.remove()}}return setTimeout(()=>{s(!1)},t),!0}catch(a){return console.error("Failed to copy text:",a),!1}},[t]),copied:n}}U();O();P();var Cu=0,ud=Array.isArray;function de(e,t,n,s,c,f){t||(t={});var a,m,d=t;if("ref"in d)for(m in d={},t)m=="ref"?a=t[m]:d[m]=t[m];var A={type:e,props:d,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Cu,__i:-1,__u:0,__source:c,__self:f};if(typeof e=="function"&&(a=e.defaultProps))for(m in a)d[m]===void 0&&(d[m]=a[m]);return se.vnode&&se.vnode(A),A}async function ku(e){var n,s;let t=Ia();if(!t)throw new Error("modalBuilderSteps not found");await t.sharing((s=(n=window.FrakSetup)==null?void 0:n.modalShareConfig)!=null?s:{}).display(c=>({...c,targetInteraction:e}))}async function Bu(){var e,t,n;if(!((e=window.FrakSetup)!=null&&e.client))throw new Error("Frak client not found");await wr(window.FrakSetup.client,(n=(t=window.FrakSetup)==null?void 0:t.modalWalletConfig)!=null?n:{})}function Cr({text:e="Share and earn!",classname:t="",useReward:n,noRewardText:s,targetInteraction:c,showWallet:f}){let a=st(()=>n!==void 0,[n]),m=st(()=>f!==void 0,[f]),[d,A]=Le(void 0),[R,g]=Le(void 0),[S,h]=Le(!1),b=ut(()=>{a&&xr(c).then(l=>{l&&g(`${l}\u20AC`)})},[a,c]);Tr(()=>(_t("add",b),()=>_t("remove",b)),[b]);let v=st(()=>a?R?e.includes("{REWARD}")?e.replace("{REWARD}",R):`${e} ${R}`:s!=null?s:e.replace("{REWARD}",""):e,[a,e,s,R]),I=ut(async()=>{var l;if(!((l=window.FrakSetup)!=null&&l.client)){console.error("Frak client not found"),A(ln.empty().formatDebugInfo("Frak client not found")),h(!0);return}try{m?await Bu():await ku(c)}catch(w){if(w instanceof we&&w.code===xe.clientAborted){console.debug("User aborted the modal");return}let k=window.FrakSetup.client.debugInfo.formatDebugInfo(w);A(k),h(!0),console.error("Error while opening the modal",w);return}},[m,c]);return de(Ke,{children:[de("button",{type:"button",class:t,onClick:I,children:v}),S&&de(Ru,{debugInfo:d})]})}var ct={errorContainer:{marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},header:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},title:{margin:0,fontSize:"16px",fontWeight:500},message:{fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},link:{color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},copyButton:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500}};function Ru({debugInfo:e}){let{copied:t,copy:n}=Za();return de("div",{style:ct.errorContainer,children:[de("div",{style:ct.header,children:de("h3",{style:ct.title,children:"Oups ! Nous avons rencontr\xE9 un petit probl\xE8me"})}),de("p",{style:ct.message,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le probl\xE8me persiste, copiez les informations ci-dessous et collez-les dans votre mail \xE0"," ",de("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:ct.link,children:"help@frak-labs.com"})," ",de("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs d\xE9lais."]}),de("button",{type:"button",onClick:()=>n(e!=null?e:""),style:ct.copyButton,children:t?"Informations copi\xE9es !":"Copier les informations de d\xE9bogage"}),de(Fu,{debugInfo:e})]})}function Fu({debugInfo:e}){let[t,n]=Le(!1);return de("div",{children:[de("button",{type:"button",style:ct.copyButton,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&de("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}customElements.get("frak-button-share")||Ar(Cr,"frak-button-share",["text"],{shadow:!1});U();O();P();U();O();P();U();O();P();var $d=Wn(ds());var Gu=e=>de("svg",{fill:"none",height:24,viewBox:"0 0 28 28",width:24,xmlns:"http://www.w3.org/2000/svg",...e,children:de("path",{d:"m23.1427 13.9999v11.4285h-18.2857v-11.4285m9.1429 11.4285v-17.14282m0 0h-5.1429c-.75776 0-1.48448-.30102-2.0203-.83684s-.83684-1.26255-.83684-2.02031.30102-1.48448.83684-2.0203 1.26254-.83684 2.0203-.83684c4 0 5.1429 5.71429 5.1429 5.71429zm0 0h5.1428c.7578 0 1.4845-.30102 2.0203-.83684s.8369-1.26255.8369-2.02031-.3011-1.48448-.8369-2.0203-1.2625-.83684-2.0203-.83684c-4 0-5.1428 5.71429-5.1428 5.71429zm-11.42861 0h22.85711v5.71432h-22.85711z",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round"})}),hs=Gu;function Ku(){var e,t,n;if(!((e=window.FrakSetup)!=null&&e.client)){console.error("Frak client not found");return}Sa(),wr(window.FrakSetup.client,(n=(t=window.FrakSetup)==null?void 0:t.modalWalletConfig)!=null?n:{})}function Rr({classname:e="",useReward:t,targetInteraction:n}){let s=st(()=>t!==void 0,[t]),[c,f]=Le(!0),[a,m]=Le(void 0),d=ut(()=>{f(!1),s&&xr(n).then(A=>{A&&m(`${A}\u20AC`)})},[s,n]);return Tr(()=>(_t("add",d),()=>_t("remove",d)),[d]),de("button",{type:"button",class:e,disabled:c,onClick:Ku,children:[de(hs,{}),a&&de("span",{children:a})]})}customElements.get("frak-button-wallet")||Ar(Rr,"frak-button-wallet",[],{shadow:!1});ha(async function(){var n;if(!((n=window.FrakSetup)!=null&&n.config)){console.error("window.FrakSetup.config not found");return}let t=await da({config:window.FrakSetup.config});if(!t){console.error("Failed to create Frak client");return}window.FrakSetup.client=t,va(),Ea(t),Aa(t)});return Mr(Ju);})();
|
|
36
|
-
/*! Bundled license information:
|
|
37
|
-
|
|
38
|
-
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
39
|
-
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
40
|
-
|
|
41
|
-
js-sha256/src/sha256.js:
|
|
42
|
-
(**
|
|
43
|
-
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
44
|
-
*
|
|
45
|
-
* @version 0.11.0
|
|
46
|
-
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
47
|
-
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
48
|
-
* @license MIT
|
|
49
|
-
*)
|
|
50
|
-
|
|
51
|
-
@noble/hashes/esm/utils.js:
|
|
52
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
53
|
-
|
|
54
|
-
react/cjs/react.production.js:
|
|
55
|
-
(**
|
|
56
|
-
* @license React
|
|
57
|
-
* react.production.js
|
|
58
|
-
*
|
|
59
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
60
|
-
*
|
|
61
|
-
* This source code is licensed under the MIT license found in the
|
|
62
|
-
* LICENSE file in the root directory of this source tree.
|
|
63
|
-
*)
|
|
64
|
-
|
|
65
|
-
react/cjs/react.development.js:
|
|
66
|
-
(**
|
|
67
|
-
* @license React
|
|
68
|
-
* react.development.js
|
|
69
|
-
*
|
|
70
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the MIT license found in the
|
|
73
|
-
* LICENSE file in the root directory of this source tree.
|
|
74
|
-
*)
|
|
75
|
-
*/
|
|
21
|
+
`.trim()}};function Nr(){const e=new Map;return{createChannel:t=>{const n=Math.random().toString(36).substring(7);return e.set(n,t),n},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}function Ur({iframe:e}){const t=new $t;return{handleEvent:async r=>{switch(r.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":r.data.backup?localStorage.setItem(ye,r.data.backup):localStorage.removeItem(ye);break;case"remove-backup":localStorage.removeItem(ye);break;case"show":case"hide":Rt({iframe:e,isVisible:r.iframeLifecycle==="show"});break;case"handshake":{e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:r.data.token,currentUrl:window.location.href}},"*");break}}},isConnected:t.promise}}function Lr({frakWalletUrl:e,iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}){if(typeof window>"u")throw new M(N.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new M(N.configError,"The iframe does not have a product window");const a=t.contentWindow;async function s(_){if(!_.origin)return;try{if(new URL(_.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return}catch(w){console.log("Unable to check frak msg origin",w);return}if(typeof _.data!="object")return;if(o.setLastResponse(_),"iframeLifecycle"in _.data){await r.handleEvent(_.data);return}if("clientLifecycle"in _.data){console.error("Client lifecycle event received on the client side, dismissing it");return}const v=_.data.id,d=n.getRpcResolver(v);d&&await d(_.data)}window.addEventListener("message",s);function l(_){a.postMessage(_,{targetOrigin:e}),o.setLastRequest(_,e)}function c(){window.removeEventListener("message",s)}return{sendEvent:l,cleanup:c}}function zr({config:e,iframe:t}){const n=Nr(),r=Ur({iframe:t}),o=new Lt(e,t),a=Lr({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}),s=async d=>{if(!await r.isConnected)throw new M(N.clientNotConnected,"The iframe provider isn't connected yet");const f=new $t,b=n.createChannel(async m=>{const i=await Ot(m.data);i.error?f.reject(new M(i.error.code,i.error.message,i.error?.data)):f.resolve(i.result),n.removeChannel(b)}),p=await Tt(d);return a.sendEvent({id:b,topic:d.method,data:p}),f.promise},l=async(d,w)=>{if(!await r.isConnected)throw new M(N.clientNotConnected,"The iframe provider isn't connected yet");const b=n.createChannel(async m=>{const i=await Ot(m.data);if(i.result)w(i.result);else throw new Ir("No valid result in the response")}),p=await Tt(d);a.sendEvent({id:b,topic:d.method,data:p})},c=Dr(a,r),_=async()=>{c(),n.destroy(),a.cleanup(),t.remove()},v=jr({config:e,messageHandler:a,lifecycleManager:r}).then(()=>o.updateSetupStatus(!0));return{config:e,debugInfo:o,waitForConnection:r.isConnected,waitForSetup:v,request:s,listenerRequest:l,destroy:_}}function Dr(e,t){let o,a;const s=()=>e.sendEvent({clientLifecycle:"heartbeat"});async function l(){s(),o=setInterval(s,100),a=setTimeout(()=>{c(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,c()}function c(){o&&clearInterval(o),a&&clearTimeout(a)}return l(),c}async function jr({config:e,messageHandler:t,lifecycleManager:n}){await n.isConnected;const r=async()=>{const a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},o=async()=>{if(typeof window>"u")return;const a=window.localStorage.getItem(ye);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([r(),o()])}async function Vr({config:e}){const t=await Rr({config:e});if(!t){console.error("Failed to create iframe");return}const n=zr({config:e,iframe:t});if(await n.waitForSetup,!await n.waitForConnection){console.error("Failed to connect to client");return}return n}function Wr(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}var ie,I,zt,Z,Dt,jt,ze,Vt,De,je,Ve,ae={},Wt=[],qr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,we=Array.isArray;function j(e,t){for(var n in t)e[n]=t[n];return e}function We(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function z(e,t,n){var r,o,a,s={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?ie.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return se(e,s,r,o,null)}function se(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++zt,__i:-1,__u:0};return o==null&&I.vnode!=null&&I.vnode(a),a}function Q(e){return e.children}function V(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?te(e):null}function qt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return qt(e)}}function Jt(e){(!e.__d&&(e.__d=!0)&&Z.push(e)&&!me.__r++||Dt!==I.debounceRendering)&&((Dt=I.debounceRendering)||jt)(me)}function me(){var e,t,n,r,o,a,s,l;for(Z.sort(ze);e=Z.shift();)e.__d&&(t=Z.length,r=void 0,a=(o=(n=e).__v).__e,s=[],l=[],n.__P&&((r=j({},o)).__v=o.__v+1,I.vnode&&I.vnode(r),qe(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[a]:null,s,a??te(o),!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,Zt(s,r,l),r.__e!=a&&qt(r)),Z.length>t&&Z.sort(ze));me.__r=0}function Kt(e,t,n,r,o,a,s,l,c,_,v){var d,w,f,b,p,m,i=r&&r.__k||Wt,h=t.length;for(c=Jr(n,t,i,c,h),d=0;d<h;d++)(f=n.__k[d])!=null&&(w=f.__i===-1?ae:i[f.__i]||ae,f.__i=d,m=qe(e,f,w,o,a,s,l,c,_,v),b=f.__e,f.ref&&w.ref!=f.ref&&(w.ref&&Je(w.ref,null,f),v.push(f.ref,f.__c||b,f)),p==null&&b!=null&&(p=b),4&f.__u||w.__k===f.__k?c=Gt(f,c,e):typeof f.type=="function"&&m!==void 0?c=m:b&&(c=b.nextSibling),f.__u&=-7);return n.__e=p,c}function Jr(e,t,n,r,o){var a,s,l,c,_,v=n.length,d=v,w=0;for(e.__k=new Array(o),a=0;a<o;a++)(s=t[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=a+w,(s=e.__k[a]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?se(null,s,null,null,null):we(s)?se(Q,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?se(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,l=null,(_=s.__i=Kr(s,n,c,d))!==-1&&(d--,(l=n[_])&&(l.__u|=2)),l==null||l.__v===null?(_==-1&&w--,typeof s.type!="function"&&(s.__u|=4)):_!=c&&(_==c-1?w--:_==c+1?w++:(_>c?w--:w++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<v;a++)(l=n[a])!=null&&!(2&l.__u)&&(l.__e==r&&(r=te(l)),Qt(l,l));return r}function Gt(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Gt(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=te(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function be(e,t){return t=t||[],e==null||typeof e=="boolean"||(we(e)?e.some(function(n){be(n,t)}):t.push(e)),t}function Kr(e,t,n,r){var o,a,s=e.key,l=e.type,c=t[n];if(c===null||c&&s==c.key&&l===c.type&&!(2&c.__u))return n;if(r>(c!=null&&!(2&c.__u)?1:0))for(o=n-1,a=n+1;o>=0||a<t.length;){if(o>=0){if((c=t[o])&&!(2&c.__u)&&s==c.key&&l===c.type)return o;o--}if(a<t.length){if((c=t[a])&&!(2&c.__u)&&s==c.key&&l===c.type)return a;a++}}return-1}function Xt(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||qr.test(t)?n:n+"px"}function ge(e,t,n,r,o){var a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Xt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Xt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(Vt,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=De,e.addEventListener(t,a?Ve:je,a)):e.removeEventListener(t,a?Ve:je,a);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Yt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=De++;else if(t.t<n.u)return;return n(I.event?I.event(t):t)}}}function qe(e,t,n,r,o,a,s,l,c,_){var v,d,w,f,b,p,m,i,h,g,C,k,u,S,E,y,A,x=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(v=I.__b)&&v(t);e:if(typeof x=="function")try{if(i=t.props,h="prototype"in x&&x.prototype.render,g=(v=x.contextType)&&r[v.__c],C=v?g?g.props.value:v.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:(h?t.__c=d=new x(i,C):(t.__c=d=new V(i,C),d.constructor=x,d.render=Xr),g&&g.sub(d),d.props=i,d.state||(d.state={}),d.context=C,d.__n=r,w=d.__d=!0,d.__h=[],d._sb=[]),h&&d.__s==null&&(d.__s=d.state),h&&x.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=j({},d.__s)),j(d.__s,x.getDerivedStateFromProps(i,d.__s))),f=d.props,b=d.state,d.__v=t,w)h&&x.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),h&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(h&&x.getDerivedStateFromProps==null&&i!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(i,C),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(i,d.__s,C)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(d.props=i,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(P){P&&(P.__=t)}),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(i,d.__s,C),h&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,b,p)})}if(d.context=C,d.props=i,d.__P=e,d.__e=!1,u=I.__r,S=0,h){for(d.state=d.__s,d.__d=!1,u&&u(t),v=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,u&&u(t),v=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=j(j({},r),d.getChildContext())),h&&!w&&d.getSnapshotBeforeUpdate!=null&&(p=d.getSnapshotBeforeUpdate(f,b)),l=Kt(e,we(y=v!=null&&v.type===Q&&v.key==null?v.props.children:v)?y:[y],t,n,r,o,a,s,l,c,_),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(P){if(t.__v=null,c||a!=null)if(P.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else for(A=a.length;A--;)We(a[A]);else t.__e=n.__e,t.__k=n.__k;I.__e(P,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Gr(n.__e,t,n,r,o,a,s,c,_);return(v=I.diffed)&&v(t),128&t.__u?void 0:l}function Zt(e,t,n){for(var r=0;r<n.length;r++)Je(n[r],n[++r],n[++r]);I.__c&&I.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){I.__e(a,o.__v)}})}function Gr(e,t,n,r,o,a,s,l,c){var _,v,d,w,f,b,p,m=n.props,i=t.props,h=t.type;if(h=="svg"?o="http://www.w3.org/2000/svg":h=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(_=0;_<a.length;_++)if((f=a[_])&&"setAttribute"in f==!!h&&(h?f.localName==h:f.nodeType==3)){e=f,a[_]=null;break}}if(e==null){if(h==null)return document.createTextNode(i);e=document.createElementNS(o,h,i.is&&i),l&&(I.__m&&I.__m(t,a),l=!1),a=null}if(h===null)m===i||l&&e.data===i||(e.data=i);else{if(a=a&&ie.call(e.childNodes),m=n.props||ae,!l&&a!=null)for(m={},_=0;_<e.attributes.length;_++)m[(f=e.attributes[_]).name]=f.value;for(_ in m)if(f=m[_],_!="children"){if(_=="dangerouslySetInnerHTML")d=f;else if(!(_ in i)){if(_=="value"&&"defaultValue"in i||_=="checked"&&"defaultChecked"in i)continue;ge(e,_,null,f,o)}}for(_ in i)f=i[_],_=="children"?w=f:_=="dangerouslySetInnerHTML"?v=f:_=="value"?b=f:_=="checked"?p=f:l&&typeof f!="function"||m[_]===f||ge(e,_,f,m[_],o);if(v)l||d&&(v.__html===d.__html||v.__html===e.innerHTML)||(e.innerHTML=v.__html),t.__k=[];else if(d&&(e.innerHTML=""),Kt(e,we(w)?w:[w],t,n,r,h=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:n.__k&&te(n,0),l,c),a!=null)for(_=a.length;_--;)We(a[_]);l||(_="value",h=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[_]||h=="progress"&&!b||h=="option"&&b!==m[_])&&ge(e,_,b,m[_],o),_="checked",p!==void 0&&p!==e[_]&&ge(e,_,p,m[_],o))}return e}function Je(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){I.__e(o,n)}}function Qt(e,t,n){var r,o;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Je(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){I.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Qt(r[o],t,n||typeof e.type!="function");n||We(e.__e),e.__c=e.__=e.__e=void 0}function Xr(e,t,n){return this.constructor(e,n)}function ve(e,t,n){var r,o,a,s;t==document&&(t=document.documentElement),I.__&&I.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,a=[],s=[],qe(t,e=(!r&&n||t).__k=z(Q,null,[e]),o||ae,ae,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ie.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,s),Zt(a,e,s)}function en(e,t){ve(e,t,en)}function tn(e,t,n){var r,o,a,s,l=j({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)a=="key"?r=t[a]:a=="ref"?o=t[a]:l[a]=t[a]===void 0&&s!==void 0?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?ie.call(arguments,2):n),se(e.type,l,r||e.key,o||e.ref,null)}ie=Wt.slice,I={__e:function(e,t,n,r){for(var o,a,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},zt=0,V.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},n),this.props)),e&&j(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Jt(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jt(this))},V.prototype.render=Q,Z=[],jt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ze=function(e,t){return e.__v.__b-t.__v.__b},me.__r=0,Vt=/(PointerCapture)$|Capture$/i,De=0,je=Yt(!1),Ve=Yt(!0);function Ke(){return(Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Yr=["context","children"];function Zr(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,s,l={},c=Object.keys(r);for(s=0;s<c.length;s++)o.indexOf(a=c[s])>=0||(l[a]=r[a]);return l}(e,Yr);return tn(t,n)}function Qr(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=z(Zr,Ke({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},s=0,l=n.attributes,c=n.childNodes;for(s=l.length;s--;)l[s].name!=="slot"&&(a[l[s].name]=l[s].value,a[nn(l[s].name)]=l[s].value);for(s=c.length;s--;){var _=t(c[s],null),v=c[s].slot;v?a[v]=z(rn,{name:v},_):o[s]=_}var d=r?z(rn,null,o):o;return z(r||n.nodeName.toLowerCase(),a,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?en:ve)(this._vdom,this._root)}function nn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function eo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[nn(e)]=n,this._vdom=tn(this._vdom,r),ve(this._vdom,this._root)}}function to(){ve(this._vdom=null,this._root)}function rn(e,t){var n=this;return z("slot",Ke({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function on(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Qr,o.prototype.attributeChangedCallback=eo,o.prototype.disconnectedCallback=to,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(s){this._vdom?this.attributeChangedCallback(a,null,s):(this._props||(this._props={}),this._props[a]=s,this.connectedCallback());var l=typeof s;s!=null&&l!=="string"&&l!=="boolean"&&l!=="number"||this.setAttribute(a,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}var no=0;function O(e,t,n,r,o,a){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var _={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--no,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return I.vnode&&I.vnode(_),_}var ro={createLink(){return{handlerTypeDenominator:he(Ie.referral),interactionData:it.referral.createLink}},referred({referrer:e}){const t=Cr([it.referral.referred,Y(e,{size:32})]);return{handlerTypeDenominator:he(Ie.referral),interactionData:t}}};function oo(e,t){return e.request({method:"frak_listenToWalletStatus"}).then(n=>(io(n.interactionToken),n))}function io(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function ao({domain:e}){const t=e??window.location.host;return Et(he(t))}async function so(e,{productId:t,interaction:n,validation:r}){const o=t??ao(e.config);return await e.request({method:"frak_sendInteraction",params:[o,n,r]})}async function an(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,n]})}async function sn(e,t){await e.request({method:"frak_displayEmbededWallet",params:[t,e.config.metadata.name]})}async function co(e){return await e.request({method:"frak_getProductInformation"})}function uo(e,{metadata:t,login:n,openSession:r}){return xe(e,{steps:{login:n??{},openSession:r??{}},metadata:t})}function xe(e,t){function n(s){return xe(e,{...t,steps:{...t.steps,sendTransaction:s}})}function r(s){return xe(e,{...t,steps:{...t.steps,final:{...s,action:{key:"reward"}}}})}function o(s,l){return xe(e,{...t,steps:{...t.steps,final:{...l,action:{key:"sharing",options:s}}}})}async function a(s){return s&&(t.metadata=s(t.metadata??{})),await an(e,t)}return{params:t,sendTx:n,reward:r,sharing:o,display:a}}async function lo(e,{walletStatus:t,frakContext:n,modalConfig:r,productId:o,options:a}){let s=!1;async function l(){if(!s)return s=!0,ho(e,{modalConfig:r,walletStatus:t})}async function c(_){const v=ro.referred({referrer:_});await so(e,{productId:o,interaction:v})}try{const{status:_,currentWallet:v}=await fo({initialWalletStatus:t,getFreshWalletStatus:l,pushReferralInteraction:c,frakContext:n});return Le.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:v}:null}),_}catch(_){return console.log("Error processing referral",{error:_}),Le.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),_o(_)}}async function fo({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:r}){let o=e?.wallet;return r?.r?(o||(o=await t()),o&&Ar(r.r,o)?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await n(r.r),{status:"success",currentWallet:o})):{status:"no-referrer",currentWallet:o}}async function ho(e,{modalConfig:t,walletStatus:n}){return n?.interactionSession?n.wallet??void 0:t?(await an(e,t))?.login?.wallet??void 0:void 0}function _o(e){if(e instanceof M)switch(e.code){case N.walletNotConnected:return"no-wallet";case N.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function po(e,{productId:t,modalConfig:n,options:r}={}){const o=Le.parse({url:window.location.href}),a=await oo(e);try{return await lo(e,{walletStatus:a,frakContext:o,modalConfig:n,productId:t,options:r})}catch(s){console.warn("Error processing referral",{error:s})}}function cn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yo(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cn(e))&&(r&&(r+=" "),r+=t);return r}const un=yo;var ce,B,Ge,ln,ue=0,fn=[],H=I,dn=H.__b,hn=H.__r,_n=H.diffed,pn=H.__c,yn=H.unmount,wn=H.__;function Xe(e,t){H.__h&&H.__h(B,e,ue||t),ue=0;var n=B.__H||(B.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function J(e){return ue=1,wo(gn,e)}function wo(e,t,n){var r=Xe(ce++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gn(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],_=r.t(c,l);c!==_&&(r.__N=[_,r.__[1]],r.__c.setState({}))}],r.__c=B,!B.u)){var o=function(l,c,_){if(!r.__c.__H)return!0;var v=r.__c.__H.__.filter(function(w){return!!w.__c});if(v.every(function(w){return!w.__N}))return!a||a.call(this,l,c,_);var d=r.__c.props!==l;return v.forEach(function(w){if(w.__N){var f=w.__[0];w.__=w.__N,w.__N=void 0,f!==w.__[0]&&(d=!0)}}),a&&a.call(this,l,c,_)||d};B.u=!0;var a=B.shouldComponentUpdate,s=B.componentWillUpdate;B.componentWillUpdate=function(l,c,_){if(this.__e){var v=a;a=void 0,o(l,c,_),a=v}s&&s.call(this,l,c,_)},B.shouldComponentUpdate=o}return r.__N||r.__}function Ye(e,t){var n=Xe(ce++,3);!H.__s&&bn(n.__H,t)&&(n.__=e,n.i=t,B.__H.__h.push(n))}function mo(e){return ue=5,ne(function(){return{current:e}},[])}function ne(e,t){var n=Xe(ce++,7);return bn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Fe(e,t){return ue=8,ne(function(){return e},t)}function bo(){for(var e;e=fn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ke),e.__H.__h.forEach(Ze),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){B=null,dn&&dn(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),wn&&wn(e,t)},H.__r=function(e){hn&&hn(e),ce=0;var t=(B=e.__c).__H;t&&(Ge===B?(t.__h=[],B.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(ke),t.__h.forEach(Ze),t.__h=[],ce=0)),Ge=B},H.diffed=function(e){_n&&_n(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fn.push(t)!==1&&ln===H.requestAnimationFrame||((ln=H.requestAnimationFrame)||go)(bo)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Ge=B=null},H.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ke),n.__h=n.__h.filter(function(r){return!r.__||Ze(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],H.__e(r,n.__v)}}),pn&&pn(e,t)},H.unmount=function(e){yn&&yn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ke(r)}catch(o){t=o}}),n.__H=void 0,t&&H.__e(t,n.__v))};var mn=typeof requestAnimationFrame=="function";function go(e){var t,n=function(){clearTimeout(r),mn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);mn&&(t=requestAnimationFrame(n))}function ke(e){var t=B,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),B=t}function Ze(e){var t=B;e.__c=e.__(),B=t}function bn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gn(e,t){return typeof t=="function"?t(e):t}const W={spinner:"_spinner_1gez9_1",spinner__leaf:"_spinner__leaf_1gez9_10"},vn=({ref:e,className:t,...n})=>O("span",{...n,ref:e,className:un(W.spinner),children:[O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf})]});vn.displayName="Spinner";function vo(e={}){const{successDuration:t=2e3}=e,[n,r]=J(!1);return{copy:Fe(async a=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a),r(!0);else{const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),r(!0)}catch(l){return console.error("Failed to copy text:",l),!1}finally{s.remove()}}return setTimeout(()=>{r(!1)},t),!0}catch(s){return console.error("Failed to copy text:",s),!1}},[t]),copied:n}}const xn="frakClientReady";let Se;function xo(){const e=new CustomEvent(xn);window.dispatchEvent(e)}function Ee(e,t){if(window.FrakSetup?.client&&e==="add"){t();return}(e==="add"?window.addEventListener:window.removeEventListener)(xn,t,!1)}function Fo(e){Se=uo(e,window.FrakSetup?.modalConfig??{})}async function ko(e){if(!Se){console.error("modalBuilderSteps not found");return}const t=await po(e,{modalConfig:Se.reward().params});console.log("referral",t)}function So(){return Se}function Eo(){"vibrate"in navigator?navigator.vibrate(200):console.log("Vibration not supported")}async function Fn(e){const t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}const n=await co(t);if(!n?.estimatedEurReward)return;let r=n.estimatedEurReward;if(e){const o=n.rewards.filter(a=>a.interactionTypeKey===e).map(a=>a.referrer.eurAmount).reduce((a,s)=>s>a?s:a,0);o>0&&(r=Math.ceil(o).toString())}return r}const Co={buttonShare:"_buttonShare_i4e8j_1"};async function Ao(e){const t=So();if(!t)throw new Error("modalBuilderSteps not found");await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(n=>({...n,targetInteraction:e}))}async function Io(){if(!window.FrakSetup?.client)throw new Error("Frak client not found");await sn(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function Po({text:e="Share and earn!",classname:t="",useReward:n,noRewardText:r,targetInteraction:o,showWallet:a}){const s=ne(()=>n!==void 0,[n]),l=ne(()=>a!==void 0,[a]),[c,_]=J(void 0),[v,d]=J(void 0),[w,f]=J(!1),[b,p]=J(!1),m=Fe(()=>{p(!0),s&&Fn(o).then(g=>{g&&d(`${g}€`)})},[s,o]);Ye(()=>(Ee("add",m),()=>Ee("remove",m)),[m]);const i=ne(()=>s?v?e.includes("{REWARD}")?e.replace("{REWARD}",v):`${e} ${v}`:r??e.replace("{REWARD}",""):e,[s,e,r,v]),h=Fe(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),_(Lt.empty().formatDebugInfo("Frak client not found")),f(!0);return}try{l?await Io():await Ao(o)}catch(g){if(g instanceof M&&g.code===N.clientAborted){console.debug("User aborted the modal");return}const C=window.FrakSetup.client.debugInfo.formatDebugInfo(g);_(C),f(!0),console.error("Error while opening the modal",g);return}},[l,o]);return O(Q,{children:[O("button",{type:"button",className:un(Co.buttonShare,t),onClick:h,children:[!b&&O(vn,{})," ",i]}),w&&O($o,{debugInfo:c})]})}const ee={errorContainer:{marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},header:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},title:{margin:0,fontSize:"16px",fontWeight:500},message:{fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},link:{color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},copyButton:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500}};function $o({debugInfo:e}){const{copied:t,copy:n}=vo();return O("div",{style:ee.errorContainer,children:[O("div",{style:ee.header,children:O("h3",{style:ee.title,children:"Oups ! Nous avons rencontré un petit problème"})}),O("p",{style:ee.message,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le problème persiste, copiez les informations ci-dessous et collez-les dans votre mail à"," ",O("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:ee.link,children:"help@frak-labs.com"})," ",O("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs délais."]}),O("button",{type:"button",onClick:()=>n(e??""),style:ee.copyButton,children:t?"Informations copiées !":"Copier les informations de débogage"}),O(To,{debugInfo:e})]})}function To({debugInfo:e}){const[t,n]=J(!1);return O("div",{children:[O("button",{type:"button",style:ee.copyButton,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&O("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function Oo(){customElements.get("frak-button-share")||on(Po,"frak-button-share",["text"],{shadow:!1})}function Ro(e,t){for(var n in t)e[n]=t[n];return e}function kn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Sn(e,t){this.props=e,this.context=t}(Sn.prototype=new V).isPureReactComponent=!0,Sn.prototype.shouldComponentUpdate=function(e,t){return kn(this.props,e)||kn(this.state,t)};var En=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),En&&En(e)};var Bo=I.__e;I.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Bo(e,t,n,r)};var Cn=I.unmount;function An(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ro({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return An(r,t,n)})),e}function In(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return In(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Qe(){this.__u=0,this.o=null,this.__b=null}function Pn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ce(){this.i=null,this.l=null}I.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Cn&&Cn(e)},(Qe.prototype=new V).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Pn(r.__v),a=!1,s=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=s;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=In(c,c.__c.__P,c.__c.__O)}var _;for(r.setState({__a:r.__b=null});_=r.o.pop();)_.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=An(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&z(Q,null,e.fallback);return o&&(o.__u&=-33),[z(Q,null,t.__a?null:e.children),o]};var $n=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ce.prototype=new V).__a=function(e){var t=this,n=Pn(t.__v),r=t.l.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),$n(t,e,r)):o()};n?n(a):a()}},Ce.prototype.render=function(e){this.i=null,this.l=new Map;var t=be(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ce.prototype.componentDidUpdate=Ce.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){$n(e,n,t)})};var Ho=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Mo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,No=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Uo=/[A-Z0-9]/g,Lo=typeof document<"u",zo=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};V.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Tn=I.event;function Do(){}function jo(){return this.cancelBubble}function Vo(){return this.defaultPrevented}I.event=function(e){return Tn&&(e=Tn(e)),e.persist=Do,e.isPropagationStopped=jo,e.isDefaultPrevented=Vo,e.nativeEvent=e};var Wo={enumerable:!1,configurable:!0,get:function(){return this.class}},On=I.vnode;I.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},a=r.indexOf("-")===-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||Lo&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||zo(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":No.test(s)&&(s=c):c=s="oninput":a&&Mo.test(s)?s=s.replace(Uo,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=be(n.children).forEach(function(_){_.props.selected=o.value.indexOf(_.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=be(n.children).forEach(function(_){_.props.selected=o.multiple?o.defaultValue.indexOf(_.props.value)!=-1:o.defaultValue==_.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Wo)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ho,On&&On(e)};var Rn=I.__r;I.__r=function(e){Rn&&Rn(e),e.__c};var Bn=I.diffed;I.diffed=function(e){Bn&&Bn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};const qo=e=>z("svg",{fill:"none",height:24,viewBox:"0 0 28 28",width:24,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"m23.1427 13.9999v11.4285h-18.2857v-11.4285m9.1429 11.4285v-17.14282m0 0h-5.1429c-.75776 0-1.48448-.30102-2.0203-.83684s-.83684-1.26255-.83684-2.02031.30102-1.48448.83684-2.0203 1.26254-.83684 2.0203-.83684c4 0 5.1429 5.71429 5.1429 5.71429zm0 0h5.1428c.7578 0 1.4845-.30102 2.0203-.83684s.8369-1.26255.8369-2.02031-.3011-1.48448-.8369-2.0203-1.2625-.83684-2.0203-.83684c-4 0-5.1428 5.71429-5.1428 5.71429zm-11.42861 0h22.85711v5.71432h-22.85711z",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round"}));function Jo(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}Eo(),sn(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function Ko({classname:e="",useReward:t,targetInteraction:n}){const r=ne(()=>t!==void 0,[t]),[o,a]=J(!0),[s,l]=J(void 0),c=mo(null),_=Fe(()=>{a(!1),r&&Fn(n).then(v=>{v&&l(`${v}€`)})},[r,n]);return Ye(()=>(Ee("add",_),()=>Ee("remove",_)),[_]),Ye(()=>{const v=window.FrakSetup.modalWalletConfig?.metadata?.position;c.current?.parentElement?.classList.add(v??"right")},[]),O("button",{ref:c,type:"button",class:e,disabled:o,onClick:Jo,children:[O(qo,{}),s&&O("span",{children:s})]})}function Go(){customElements.get("frak-button-wallet")||on(Ko,"frak-button-wallet",[],{shadow:!1})}Oo(),Go(),Wr(async function(){if(!window.FrakSetup?.config){console.error("window.FrakSetup.config not found");return}const t=await Vr({config:window.FrakSetup.config});if(!t){console.error("Failed to create Frak client");return}window.FrakSetup.client=t,xo(),Fo(t),ko(t)})});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.8",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -44,33 +44,30 @@
|
|
|
44
44
|
"format:check": "biome check .",
|
|
45
45
|
"format": "biome check --write .",
|
|
46
46
|
"clean": "rimraf cdn",
|
|
47
|
-
"build": "
|
|
48
|
-
"
|
|
49
|
-
"build:watch": "tsup --watch --onSuccess 'bun run copy:css'",
|
|
50
|
-
"copy:css": "bunx cpy --flat \"src/**/*.css\" cdn/css",
|
|
47
|
+
"build": "vite build",
|
|
48
|
+
"build:watch": "vite build --watch",
|
|
51
49
|
"typecheck": "tsc --noEmit",
|
|
52
50
|
"prepublish": "bun run lint && bun run build",
|
|
53
51
|
"publish": "bun publish"
|
|
54
52
|
},
|
|
55
53
|
"dependencies": {
|
|
56
|
-
"@frak-labs/core-sdk": "0.0.
|
|
54
|
+
"@frak-labs/core-sdk": "0.0.6",
|
|
57
55
|
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
58
56
|
"preact": "^10.25.4",
|
|
59
57
|
"preact-custom-element": "^4.3.0"
|
|
60
58
|
},
|
|
61
59
|
"devDependencies": {
|
|
60
|
+
"@preact/preset-vite": "^2.10.1",
|
|
62
61
|
"@types/node": "^22",
|
|
63
62
|
"@types/preact-custom-element": "^4.0.4",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
63
|
+
"browserslist": "^4.24.4",
|
|
64
|
+
"browserslist-to-esbuild": "^2.1.1",
|
|
65
|
+
"typescript": "^5",
|
|
66
|
+
"vite": "^6.1.0",
|
|
67
|
+
"vite-plugin-svgr": "^4.3.0",
|
|
68
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
68
69
|
},
|
|
69
70
|
"browserslist": [
|
|
70
|
-
"
|
|
71
|
-
"edge 79",
|
|
72
|
-
"firefox 68",
|
|
73
|
-
"opera 54",
|
|
74
|
-
"safari 14"
|
|
71
|
+
"extends @frak-labs/browserslist-config"
|
|
75
72
|
]
|
|
76
73
|
}
|
package/cdn/css/ButtonWallet.css
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
frak-button-wallet {
|
|
2
|
-
position: fixed;
|
|
3
|
-
bottom: 20px;
|
|
4
|
-
right: 20px;
|
|
5
|
-
z-index: 900;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
frak-button-wallet button {
|
|
9
|
-
all: unset;
|
|
10
|
-
position: relative;
|
|
11
|
-
background-color: #3e557e;
|
|
12
|
-
width: 42px;
|
|
13
|
-
height: 42px;
|
|
14
|
-
border-radius: 50%;
|
|
15
|
-
cursor: pointer;
|
|
16
|
-
text-align: center;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
frak-button-wallet svg {
|
|
20
|
-
margin-top: 2px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
frak-button-wallet span {
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: -4px;
|
|
26
|
-
right: 27px;
|
|
27
|
-
padding: 2px 3px;
|
|
28
|
-
border-radius: 5px;
|
|
29
|
-
background: #ff3f3f;
|
|
30
|
-
font-size: 9px;
|
|
31
|
-
color: #fff;
|
|
32
|
-
font-weight: 600;
|
|
33
|
-
white-space: nowrap;
|
|
34
|
-
line-height: 9px;
|
|
35
|
-
}
|