@frak-labs/components 0.0.6 → 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 +21 -17
- package/package.json +17 -7
|
@@ -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,17 +1,21 @@
|
|
|
1
|
-
"use strict";var FrakComponents=(()=>{var Ho=Object.create;var Se=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Do=Object.getPrototypeOf,Oo=Object.prototype.hasOwnProperty;var Yt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zo=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},Qt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Uo(t))!Oo.call(e,n)&&n!==r&&Se(e,n,{get:()=>t[n],enumerable:!(o=Lo(t,n))||o.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?Ho(Do(e)):{},Qt(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),No=e=>Qt(Se({},"__esModule",{value:!0}),e);var tt=Zt((se,et)=>{"use strict";(function(e,t){if(typeof se=="object"&&typeof et=="object")et.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r=t();for(var o in r)(typeof se=="object"?se:e)[o]=r[o]}})(se,()=>(()=>{"use strict";var e={48:function(r,o,n){var a=this&&this.__awaiter||function(u,y,i,p){return new(i||(i=Promise))(function(b,F){function g(h){try{R(p.next(h))}catch(_){F(_)}}function E(h){try{R(p.throw(h))}catch(_){F(_)}}function R(h){var _;h.done?b(h.value):(_=h.value,_ instanceof i?_:new i(function(T){T(_)})).then(g,E)}R((p=p.apply(u,y||[])).next())})},c=this&&this.__generator||function(u,y){var i,p,b,F,g={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return F={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function E(R){return function(h){return function(_){if(i)throw new TypeError("Generator is already executing.");for(;F&&(F=0,_[0]&&(g=0)),g;)try{if(i=1,p&&(b=2&_[0]?p.return:_[0]?p.throw||((b=p.return)&&b.call(p),0):p.next)&&!(b=b.call(p,_[1])).done)return b;switch(p=0,b&&(_=[2&_[0],b.value]),_[0]){case 0:case 1:b=_;break;case 4:return g.label++,{value:_[1],done:!1};case 5:g.label++,p=_[1],_=[0];continue;case 7:_=g.ops.pop(),g.trys.pop();continue;default:if(!((b=(b=g.trys).length>0&&b[b.length-1])||_[0]!==6&&_[0]!==2)){g=0;continue}if(_[0]===3&&(!b||_[1]>b[0]&&_[1]<b[3])){g.label=_[1];break}if(_[0]===6&&g.label<b[1]){g.label=b[1],b=_;break}if(b&&g.label<b[2]){g.label=b[2],g.ops.push(_);break}b[2]&&g.ops.pop(),g.trys.pop();continue}_=y.call(u,g)}catch(T){_=[6,T],p=0}finally{i=b=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([R,h])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFromUTF16=o.compressToUTF16=o.decompressFromBase64=o.compressToBase64=void 0;var f=n(304),l=n(134),x=new f.CompressorImpl,d=new l.DecompressorImpl,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m={};o.compressToBase64=function(u){return a(this,void 0,void 0,function(){var y;return c(this,function(i){switch(i.label){case 0:return u===null?[2,""]:[4,x.compress(u,6,function(p){return s.charAt(p)})];case 1:switch((y=i.sent()).length%4){default:case 0:return[2,y];case 1:return[2,y+"==="];case 2:return[2,y+"=="];case 3:return[2,y+"="]}return[2]}})})},o.decompressFromBase64=function(u){return a(this,void 0,void 0,function(){return c(this,function(y){switch(y.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,32,function(i){return function(p,b){if(!m[p]){m[p]={};for(var F=0;F<p.length;F++)m[p][p.charAt(F)]=F}return m[p][b]}(s,u.charAt(i))})];case 1:return[2,y.sent()]}})})},o.compressToUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(y){switch(y.label){case 0:return u===null?[2,""]:[4,x.compress(u,15,function(i){return String.fromCharCode(i+32)})];case 1:return[2,y.sent()+" "]}})})},o.decompressFromUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(y){switch(y.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,16384,function(i){return u.charCodeAt(i)-32})];case 1:return[2,y.sent()]}})})}},304:function(r,o,n){var a=this&&this.__awaiter||function(d,s,m,u){return new(m||(m=Promise))(function(y,i){function p(g){try{F(u.next(g))}catch(E){i(E)}}function b(g){try{F(u.throw(g))}catch(E){i(E)}}function F(g){var E;g.done?y(g.value):(E=g.value,E instanceof m?E:new m(function(R){R(E)})).then(p,b)}F((u=u.apply(d,s||[])).next())})},c=this&&this.__generator||function(d,s){var m,u,y,i,p={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]};return i={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function b(F){return function(g){return function(E){if(m)throw new TypeError("Generator is already executing.");for(;i&&(i=0,E[0]&&(p=0)),p;)try{if(m=1,u&&(y=2&E[0]?u.return:E[0]?u.throw||((y=u.return)&&y.call(u),0):u.next)&&!(y=y.call(u,E[1])).done)return y;switch(u=0,y&&(E=[2&E[0],y.value]),E[0]){case 0:case 1:y=E;break;case 4:return p.label++,{value:E[1],done:!1};case 5:p.label++,u=E[1],E=[0];continue;case 7:E=p.ops.pop(),p.trys.pop();continue;default:if(!((y=(y=p.trys).length>0&&y[y.length-1])||E[0]!==6&&E[0]!==2)){p=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){p.label=E[1];break}if(E[0]===6&&p.label<y[1]){p.label=y[1],y=E;break}if(y&&p.label<y[2]){p.label=y[2],p.ops.push(E);break}y[2]&&p.ops.pop(),p.trys.pop();continue}E=s.call(d,p)}catch(R){E=[6,R],u=0}finally{m=y=0}if(5&E[0])throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}([F,g])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompressorImpl=void 0;var f=n(658),l=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],x=function(){function d(){}return d.writeValueToData=function(s,m,u,y,i){if(u%4!=0||s.dataPosition+u>y-1)for(var p=0;p<u;p++)s.dataVal=s.dataVal<<1|1&m,s.dataPosition==y-1?(s.dataPosition=0,s.data.push(i(s.dataVal)),s.dataVal=0):s.dataPosition++,m>>=1;else s.dataVal<<=u,s.dataVal|=function(b,F){for(var g=0,E=0;E<F;++E)g<<=4,g|=l[15&b],b>>=4;return g}(m,u/4),s.dataPosition+=u},d.writeWToDataVal=function(s,m,u){s.dictionaryToCreate.has(s.w)?(s.w.charCodeAt(0)<256?(d.writeValueToData(s,0,s.numBits,m,u),d.writeValueToData(s,s.w.charCodeAt(0),8,m,u)):(d.writeValueToData(s,1,s.numBits,m,u),d.writeValueToData(s,s.w.charCodeAt(0),16,m,u)),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++),s.dictionaryToCreate.delete(s.w)):d.writeValueToData(s,s.dictionary.get(s.w),s.numBits,m,u),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++)},d.loopIteration=function(s,m,u,y,i){var p=s.charAt(m);i.dictionary.has(p)||(i.dictionary.set(p,i.dictSize++),i.dictionaryToCreate.set(p,!0));var b=i.w+p;i.dictionary.has(b)?i.w=b:(this.writeWToDataVal(i,u,y),i.dictionary.set(b,i.dictSize++),i.w=String(p))},d.prototype.compress=function(s,m,u){var y=this;return new Promise(function(i){return a(y,void 0,void 0,function(){var p,b;return c(this,function(F){switch(F.label){case 0:if(s==null)return i(""),[2];p={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},b=0,F.label=1;case 1:return b<s.length?(d.loopIteration(s,b,m,u,p),b%1e4!=0?[3,3]:[4,(0,f.wait)()]):[3,4];case 2:F.sent(),F.label=3;case 3:return b+=1,[3,1];case 4:return p.w!==""&&d.writeWToDataVal(p,m,u),d.writeValueToData(p,2,p.numBits,m,u),p.dataVal<<=m-p.dataPosition,p.data.push(u(p.dataVal)),i(p.data.join("")),[2]}})})})},d}();o.CompressorImpl=x},134:function(r,o,n){var a=this&&this.__awaiter||function(x,d,s,m){return new(s||(s=Promise))(function(u,y){function i(F){try{b(m.next(F))}catch(g){y(g)}}function p(F){try{b(m.throw(F))}catch(g){y(g)}}function b(F){var g;F.done?u(F.value):(g=F.value,g instanceof s?g:new s(function(E){E(g)})).then(i,p)}b((m=m.apply(x,d||[])).next())})},c=this&&this.__generator||function(x,d){var s,m,u,y,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return y={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function p(b){return function(F){return function(g){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,g[0]&&(i=0)),i;)try{if(s=1,m&&(u=2&g[0]?m.return:g[0]?m.throw||((u=m.return)&&u.call(m),0):m.next)&&!(u=u.call(m,g[1])).done)return u;switch(m=0,u&&(g=[2&g[0],u.value]),g[0]){case 0:case 1:u=g;break;case 4:return i.label++,{value:g[1],done:!1};case 5:i.label++,m=g[1],g=[0];continue;case 7:g=i.ops.pop(),i.trys.pop();continue;default:if(!((u=(u=i.trys).length>0&&u[u.length-1])||g[0]!==6&&g[0]!==2)){i=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){i.label=g[1];break}if(g[0]===6&&i.label<u[1]){i.label=u[1],u=g;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(g);break}u[2]&&i.ops.pop(),i.trys.pop();continue}g=d.call(x,i)}catch(E){g=[6,E],m=0}finally{s=u=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([b,F])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.DecompressorImpl=void 0;var f=n(658),l=function(){function x(){}return x.prototype.decompress=function(d,s,m){var u=this;return new Promise(function(y){return a(u,void 0,void 0,function(){var i,p,b;return c(this,function(F){switch(F.label){case 0:for(i={bits:0,c:null,dataIndex:1,dataPosition:s,dataVal:m(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:Math.pow(2,2),numBits:3,power:1,resb:null,result:[],w:null},p=0;p<3;p+=1)i.dictionary.set(p,p);for(;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=m(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=s,i.dataVal=m(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=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 2:return y(""),[2]}i.dictionary[3]=i.c,i.w=i.c,i.result.push(i.c),b=1,F.label=1;case 1:return b%2e4!=0?[3,3]:[4,(0,f.wait)()];case 2:F.sent(),F.label=3;case 3:if(i.dataIndex>d)return y(""),[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=s,i.dataVal=m(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=s,i.dataVal=m(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=s,i.dataVal=m(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 y(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 y(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++),b++,[3,1];case 4:return[2]}})})})},x}();o.DecompressorImpl=l},658:function(r,o){var n=this&&this.__awaiter||function(c,f,l,x){return new(l||(l=Promise))(function(d,s){function m(i){try{y(x.next(i))}catch(p){s(p)}}function u(i){try{y(x.throw(i))}catch(p){s(p)}}function y(i){var p;i.done?d(i.value):(p=i.value,p instanceof l?p:new l(function(b){b(p)})).then(m,u)}y((x=x.apply(c,f||[])).next())})},a=this&&this.__generator||function(c,f){var l,x,d,s,m={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(y){return function(i){return function(p){if(l)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(m=0)),m;)try{if(l=1,x&&(d=2&p[0]?x.return:p[0]?x.throw||((d=x.return)&&d.call(x),0):x.next)&&!(d=d.call(x,p[1])).done)return d;switch(x=0,d&&(p=[2&p[0],d.value]),p[0]){case 0:case 1:d=p;break;case 4:return m.label++,{value:p[1],done:!1};case 5:m.label++,x=p[1],p=[0];continue;case 7:p=m.ops.pop(),m.trys.pop();continue;default:if(!((d=(d=m.trys).length>0&&d[d.length-1])||p[0]!==6&&p[0]!==2)){m=0;continue}if(p[0]===3&&(!d||p[1]>d[0]&&p[1]<d[3])){m.label=p[1];break}if(p[0]===6&&m.label<d[1]){m.label=d[1],d=p;break}if(d&&m.label<d[2]){m.label=d[2],m.ops.push(p);break}d[2]&&m.ops.pop(),m.trys.pop();continue}p=f.call(c,m)}catch(b){p=[6,b],x=0}finally{l=d=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([y,i])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.wait=void 0,o.wait=function(){return n(this,void 0,void 0,function(){return a(this,function(c){return[2,new Promise(function(f){setTimeout(f,0)})]})})}}},t={};return function r(o){var n=t[o];if(n!==void 0)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,r),a.exports}(48)})())});var rt=Zt((Un,Te)=>{"use strict";(function(){"use strict";var e="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var o=!t&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?r=global:o&&(r=self);var a=!r.JS_SHA256_NO_COMMON_JS&&typeof Te=="object"&&Te.exports,c=typeof define=="function"&&define.amd,f=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),x=[-2147483648,8388608,32768,128],d=[24,16,8,0],s=[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],m=["hex","array","digest","arrayBuffer"],u=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"}),f&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(h){return typeof h=="object"&&h.buffer&&h.buffer.constructor===ArrayBuffer});var y=function(h,_){return function(T){return new g(_,!0).update(T)[h]()}},i=function(h){var _=y("hex",h);n&&(_=p(_,h)),_.create=function(){return new g(h)},_.update=function(I){return _.create().update(I)};for(var T=0;T<m.length;++T){var S=m[T];_[S]=y(S,h)}return _},p=function(h,_){var T=Yt("crypto"),S=Yt("buffer").Buffer,I=_?"sha224":"sha256",w;S.from&&!r.JS_SHA256_NO_BUFFER_FROM?w=S.from:w=function(v){return new S(v)};var C=function(v){if(typeof v=="string")return T.createHash(I).update(v,"utf8").digest("hex");if(v==null)throw new Error(e);return v.constructor===ArrayBuffer&&(v=new Uint8Array(v)),Array.isArray(v)||ArrayBuffer.isView(v)||v.constructor===S?T.createHash(I).update(w(v)).digest("hex"):h(v)};return C},b=function(h,_){return function(T,S){return new E(T,_,!0).update(S)[h]()}},F=function(h){var _=b("hex",h);_.create=function(I){return new E(I,h)},_.update=function(I,w){return _.create(I).update(w)};for(var T=0;T<m.length;++T){var S=m[T];_[S]=b(S,h)}return _};function g(h,_){_?(u[0]=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,this.blocks=u):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h?(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=h}g.prototype.update=function(h){if(!this.finalized){var _,T=typeof h;if(T!=="string"){if(T==="object"){if(h===null)throw new Error(e);if(f&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!f||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);_=!0}for(var S,I=0,w,C=h.length,v=this.blocks;I<C;){if(this.hashed&&(this.hashed=!1,v[0]=this.block,this.block=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),_)for(w=this.start;I<C&&w<64;++I)v[w>>>2]|=h[I]<<d[w++&3];else for(w=this.start;I<C&&w<64;++I)S=h.charCodeAt(I),S<128?v[w>>>2]|=S<<d[w++&3]:S<2048?(v[w>>>2]|=(192|S>>>6)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):S<55296||S>=57344?(v[w>>>2]|=(224|S>>>12)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):(S=65536+((S&1023)<<10|h.charCodeAt(++I)&1023),v[w>>>2]|=(240|S>>>18)<<d[w++&3],v[w>>>2]|=(128|S>>>12&63)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]);this.lastByteIndex=w,this.bytes+=w-this.start,w>=64?(this.block=v[16],this.start=w-64,this.hash(),this.hashed=!0):this.start=w}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 h=this.blocks,_=this.lastByteIndex;h[16]=this.block,h[_>>>2]|=x[_&3],this.block=h[16],_>=56&&(this.hashed||this.hash(),h[0]=this.block,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),h[14]=this.hBytes<<3|this.bytes>>>29,h[15]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var h=this.h0,_=this.h1,T=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,k=this.blocks,M,O,z,q,A,K,J,ae,Ze,Qe,ve;for(M=16;M<64;++M)A=k[M-15],O=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,A=k[M-2],z=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,k[M]=k[M-16]+O+k[M-7]+z<<0;for(ve=_&T,M=0;M<64;M+=4)this.first?(this.is224?(ae=300032,A=k[0]-1413257819,v=A-150054599<<0,S=A+24177077<<0):(ae=704751109,A=k[0]-210244248,v=A-1521486534<<0,S=A+143694565<<0),this.first=!1):(O=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),z=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),ae=h&_,q=ae^h&T^ve,J=I&w^~I&C,A=v+z+J+s[M]+k[M],K=O+q,v=S+A<<0,S=A+K<<0),O=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),z=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),Ze=S&h,q=Ze^S&_^ae,J=v&I^~v&w,A=C+z+J+s[M+1]+k[M+1],K=O+q,C=T+A<<0,T=A+K<<0,O=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),z=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),Qe=T&S,q=Qe^T&h^Ze,J=C&v^~C&I,A=w+z+J+s[M+2]+k[M+2],K=O+q,w=_+A<<0,_=A+K<<0,O=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),z=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),ve=_&T,q=ve^_&S^Qe,J=w&C^~w&v,A=I+z+J+s[M+3]+k[M+3],K=O+q,I=h+A<<0,h=A+K<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+h<<0,this.h1=this.h1+_<<0,this.h2=this.h2+T<<0,this.h3=this.h3+S<<0,this.h4=this.h4+I<<0,this.h5=this.h5+w<<0,this.h6=this.h6+C<<0,this.h7=this.h7+v<<0},g.prototype.hex=function(){this.finalize();var h=this.h0,_=this.h1,T=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,k=l[h>>>28&15]+l[h>>>24&15]+l[h>>>20&15]+l[h>>>16&15]+l[h>>>12&15]+l[h>>>8&15]+l[h>>>4&15]+l[h&15]+l[_>>>28&15]+l[_>>>24&15]+l[_>>>20&15]+l[_>>>16&15]+l[_>>>12&15]+l[_>>>8&15]+l[_>>>4&15]+l[_&15]+l[T>>>28&15]+l[T>>>24&15]+l[T>>>20&15]+l[T>>>16&15]+l[T>>>12&15]+l[T>>>8&15]+l[T>>>4&15]+l[T&15]+l[S>>>28&15]+l[S>>>24&15]+l[S>>>20&15]+l[S>>>16&15]+l[S>>>12&15]+l[S>>>8&15]+l[S>>>4&15]+l[S&15]+l[I>>>28&15]+l[I>>>24&15]+l[I>>>20&15]+l[I>>>16&15]+l[I>>>12&15]+l[I>>>8&15]+l[I>>>4&15]+l[I&15]+l[w>>>28&15]+l[w>>>24&15]+l[w>>>20&15]+l[w>>>16&15]+l[w>>>12&15]+l[w>>>8&15]+l[w>>>4&15]+l[w&15]+l[C>>>28&15]+l[C>>>24&15]+l[C>>>20&15]+l[C>>>16&15]+l[C>>>12&15]+l[C>>>8&15]+l[C>>>4&15]+l[C&15];return this.is224||(k+=l[v>>>28&15]+l[v>>>24&15]+l[v>>>20&15]+l[v>>>16&15]+l[v>>>12&15]+l[v>>>8&15]+l[v>>>4&15]+l[v&15]),k},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var h=this.h0,_=this.h1,T=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,k=[h>>>24&255,h>>>16&255,h>>>8&255,h&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255];return this.is224||k.push(v>>>24&255,v>>>16&255,v>>>8&255,v&255),k},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var h=new ArrayBuffer(this.is224?28:32),_=new DataView(h);return _.setUint32(0,this.h0),_.setUint32(4,this.h1),_.setUint32(8,this.h2),_.setUint32(12,this.h3),_.setUint32(16,this.h4),_.setUint32(20,this.h5),_.setUint32(24,this.h6),this.is224||_.setUint32(28,this.h7),h};function E(h,_,T){var S,I=typeof h;if(I==="string"){var w=[],C=h.length,v=0,k;for(S=0;S<C;++S)k=h.charCodeAt(S),k<128?w[v++]=k:k<2048?(w[v++]=192|k>>>6,w[v++]=128|k&63):k<55296||k>=57344?(w[v++]=224|k>>>12,w[v++]=128|k>>>6&63,w[v++]=128|k&63):(k=65536+((k&1023)<<10|h.charCodeAt(++S)&1023),w[v++]=240|k>>>18,w[v++]=128|k>>>12&63,w[v++]=128|k>>>6&63,w[v++]=128|k&63);h=w}else if(I==="object"){if(h===null)throw new Error(e);if(f&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!f||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);h.length>64&&(h=new g(_,!0).update(h).array());var M=[],O=[];for(S=0;S<64;++S){var z=h[S]||0;M[S]=92^z,O[S]=54^z}g.call(this,_,T),this.update(O),this.oKeyPad=M,this.inner=!0,this.sharedMemory=T}E.prototype=new g,E.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();g.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),g.prototype.finalize.call(this)}};var R=i();R.sha256=R,R.sha224=i(!0),R.sha256.hmac=F(),R.sha224.hmac=F(!0),a?Te.exports=R:(r.sha256=R.sha256,r.sha224=R.sha224,c&&define(function(){return R}))})()});function te(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var Ae=B(()=>{"use strict"});function ct(e){return te(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var sr=B(()=>{"use strict";Ae()});var lt,cr=B(()=>{"use strict";lt="2.22.3"});function lr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lr(e.cause,t):t?null:e}var ut,N,ce=B(()=>{"use strict";cr();ut={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${lt}`},N=class e extends Error{constructor(t,r={}){let o=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,n=r.cause instanceof e&&r.cause.docsPath||r.docsPath,a=ut.getDocsUrl?.({...r,docsPath:n}),c=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...ut.version?[`Version: ${ut.version}`]:[]].join(`
|
|
2
|
-
`);super(c,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=n,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=lt}walk(t){return lr(this,t)}}});var le,ur=B(()=>{"use strict";ce();le=class extends N{constructor({size:t,targetSize:r,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function V(e,{dir:t,size:r=32}={}){return typeof e=="string"?pr(e,{dir:t,size:r}):fr(e,{dir:t,size:r})}function pr(e,{dir:t,size:r=32}={}){if(r===null)return e;let o=e.replace("0x","");if(o.length>r*2)throw new le({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function fr(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new le({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let n=0;n<r;n++){let a=t==="right";o[a?n:r-n-1]=e[a?n:e.length-n-1]}return o}var Pe=B(()=>{"use strict";ur()});var Re,Me,pt=B(()=>{"use strict";ce();Re=class extends N{constructor({max:t,min:r,signed:o,size:n,value:a}){super(`Number "${a}" is not in safe ${n?`${n*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Me=class extends N{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function Y(e,{size:t}){if(ct(e)>t)throw new Me({givenSize:ct(e),maxSize:t})}var ft=B(()=>{"use strict";pt();sr()});function G(e,t={}){return typeof e=="number"||typeof e=="bigint"?Be(e,t):typeof e=="string"?mr(e,t):typeof e=="boolean"?dr(e,t):ue(e,t)}function dr(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function ue(e,t={}){let r="";for(let n=0;n<e.length;n++)r+=Wo[e[n]];let o=`0x${r}`;return typeof t.size=="number"?(Y(o,{size:t.size}),V(o,{dir:"right",size:t.size})):o}function Be(e,t={}){let{signed:r,size:o}=t,n=BigInt(e),a;o?r?a=(1n<<BigInt(o)*8n-1n)-1n:a=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));let c=typeof a=="bigint"&&r?-a-1n:0;if(a&&n>a||n<c){let l=typeof e=="bigint"?"n":"";throw new Re({max:a?`${a}${l}`:void 0,min:`${c}${l}`,signed:r,size:o,value:`${e}${l}`})}let f=`0x${(r&&n<0?(1n<<BigInt(o*8))+BigInt(n):n).toString(16)}`;return o?V(f,{size:o}):f}function mr(e,t={}){let r=jo.encode(e);return ue(r,t)}var Wo,jo,He=B(()=>{"use strict";pt();Pe();ft();Wo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));jo=new TextEncoder});function dt(e,t={}){return typeof e=="number"||typeof e=="bigint"?_r(e,t):typeof e=="boolean"?xr(e,t):te(e)?pe(e,t):Le(e,t)}function xr(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function hr(e){if(e>=W.zero&&e<=W.nine)return e-W.zero;if(e>=W.A&&e<=W.F)return e-(W.A-10);if(e>=W.a&&e<=W.f)return e-(W.a-10)}function pe(e,t={}){let r=e;t.size&&(Y(r,{size:t.size}),r=V(r,{dir:"right",size:t.size}));let o=r.slice(2);o.length%2&&(o=`0${o}`);let n=o.length/2,a=new Uint8Array(n);for(let c=0,f=0;c<n;c++){let l=hr(o.charCodeAt(f++)),x=hr(o.charCodeAt(f++));if(l===void 0||x===void 0)throw new N(`Invalid byte sequence ("${o[f-2]}${o[f-1]}" in "${o}").`);a[c]=l*16+x}return a}function _r(e,t){let r=Be(e,t);return pe(r)}function Le(e,t={}){let r=qo.encode(e);return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{dir:"right",size:t.size})):r}var qo,W,Ue=B(()=>{"use strict";ce();Ae();Pe();ft();He();qo=new TextEncoder;W={zero:48,nine:57,A:65,F:70,a:97,f:102}});function mt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ko(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fe(e,...t){if(!Ko(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 ht(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 yr(e,t){fe(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var xt=B(()=>{"use strict"});function Jo(e,t=!1){return t?{h:Number(e&De),l:Number(e>>gr&De)}:{h:Number(e>>gr&De)|0,l:Number(e&De)|0}}function br(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:a,l:c}=Jo(e[n],t);[r[n],o[n]]=[a,c]}return[r,o]}var De,gr,wr,vr,Sr,Fr,Er=B(()=>{"use strict";De=BigInt(4294967295),gr=BigInt(32);wr=(e,t,r)=>e<<r|t>>>32-r,vr=(e,t,r)=>t<<r|e>>>32-r,Sr=(e,t,r)=>t<<r-32|e>>>64-r,Fr=(e,t,r)=>e<<r-32|t>>>64-r});function yt(e){for(let t=0;t<e.length;t++)e[t]=Go(e[t])}function Xo(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function ze(e){return typeof e=="string"&&(e=Xo(e)),fe(e),e}function Ir(e){let t=o=>e().update(ze(o)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Cr(e){let t=(o,n)=>e(n).update(ze(o)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=o=>e(o),t}var Tr,_t,Go,Oe,kr=B(()=>{"use strict";xt();Tr=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),_t=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Go=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;Oe=class{clone(){return this._cloneInto()}}});function nn(e,t=24){let r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let c=0;c<10;c++)r[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){let f=(c+8)%10,l=(c+2)%10,x=r[l],d=r[l+1],s=Ar(x,d,1)^r[f],m=Pr(x,d,1)^r[f+1];for(let u=0;u<50;u+=10)e[c+u]^=s,e[c+u+1]^=m}let n=e[2],a=e[3];for(let c=0;c<24;c++){let f=Mr[c],l=Ar(n,a,f),x=Pr(n,a,f),d=Rr[c];n=e[d],a=e[d+1],e[d]=l,e[d+1]=x}for(let c=0;c<50;c+=10){for(let f=0;f<10;f++)r[f]=e[c+f];for(let f=0;f<10;f++)e[c+f]^=~r[(f+2)%10]&r[(f+4)%10]}e[0]^=rn[o],e[1]^=on[o]}r.fill(0)}var Rr,Mr,Br,Yo,de,Zo,Qo,en,tn,rn,on,Ar,Pr,Ne,X,Vi,$i,Wi,ji,qi,Hr,Ki,Ji,Lr,Gi,Xi,Ur=B(()=>{"use strict";xt();Er();kr();Rr=[],Mr=[],Br=[],Yo=BigInt(0),de=BigInt(1),Zo=BigInt(2),Qo=BigInt(7),en=BigInt(256),tn=BigInt(113);for(let e=0,t=de,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],Rr.push(2*(5*o+r)),Mr.push((e+1)*(e+2)/2%64);let n=Yo;for(let a=0;a<7;a++)t=(t<<de^(t>>Qo)*tn)%en,t&Zo&&(n^=de<<(de<<BigInt(a))-de);Br.push(n)}[rn,on]=br(Br,!0),Ar=(e,t,r)=>r>32?Sr(e,t,r):wr(e,t,r),Pr=(e,t,r)=>r>32?Fr(e,t,r):vr(e,t,r);Ne=class e extends Oe{constructor(t,r,o,n=!1,a=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,mt(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Tr(this.state)}keccak(){_t||yt(this.state32),nn(this.state32,this.rounds),_t||yt(this.state32),this.posOut=0,this.pos=0}update(t){ht(this);let{blockLen:r,state:o}=this;t=ze(t);let n=t.length;for(let a=0;a<n;){let c=Math.min(r-this.pos,n-a);for(let f=0;f<c;f++)o[this.pos++]^=t[a++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:o,blockLen:n}=this;t[o]^=r,r&128&&o===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){ht(this,!1),fe(t),this.finish();let r=this.state,{blockLen:o}=this;for(let n=0,a=t.length;n<a;){this.posOut>=o&&this.keccak();let c=Math.min(o-this.posOut,a-n);t.set(r.subarray(this.posOut,this.posOut+c),n),this.posOut+=c,n+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return mt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(yr(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:r,suffix:o,outputLen:n,rounds:a,enableXOF:c}=this;return t||(t=new e(r,o,n,c,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=o,t.outputLen=n,t.enableXOF=c,t.destroyed=this.destroyed,t}},X=(e,t,r)=>Ir(()=>new Ne(t,e,r)),Vi=X(6,144,224/8),$i=X(6,136,256/8),Wi=X(6,104,384/8),ji=X(6,72,512/8),qi=X(1,144,224/8),Hr=X(1,136,256/8),Ki=X(1,104,384/8),Ji=X(1,72,512/8),Lr=(e,t,r)=>Cr((o={})=>new Ne(t,e,o.dkLen===void 0?r:o.dkLen,!0)),Gi=Lr(31,168,128/8),Xi=Lr(31,136,256/8)});function me(e,t){let r=t||"hex",o=Hr(te(e,{strict:!1})?dt(e):e);return r==="bytes"?o:G(o)}var gt=B(()=>{"use strict";Ur();Ae();Ue();He()});var he,Dr=B(()=>{"use strict";ce();he=class extends N{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 re,bt=B(()=>{"use strict";re=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 r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let o=this.keys().next().value;o&&this.delete(o)}return this}}});function Or(e,t){if(wt.has(`${e}.${t}`))return wt.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),o=me(Le(r),"bytes"),n=(t?r.substring(`${t}0x`.length):r).split("");for(let c=0;c<40;c+=2)o[c>>1]>>4>=8&&n[c]&&(n[c]=n[c].toUpperCase()),(o[c>>1]&15)>=8&&n[c+1]&&(n[c+1]=n[c+1].toUpperCase());let a=`0x${n.join("")}`;return wt.set(`${e}.${t}`,a),a}var wt,zr=B(()=>{"use strict";Ue();gt();bt();wt=new re(8192)});function St(e,t){let{strict:r=!0}=t??{},o=`${e}.${r}`;if(vt.has(o))return vt.get(o);let n=an.test(e)?e.toLowerCase()===e?!0:r?Or(e)===e:!0:!1;return vt.set(o,n),n}var an,vt,Nr=B(()=>{"use strict";bt();zr();an=/^0x[a-fA-F0-9]{40}$/,vt=new re(8192)});function Ft(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Vr=B(()=>{"use strict"});function Et(e,t){if(!St(e,{strict:!1}))throw new he({address:e});if(!St(t,{strict:!1}))throw new he({address:t});return e.toLowerCase()===t.toLowerCase()}var $r=B(()=>{"use strict";Dr();Nr()});var An={};zo(An,{ButtonShare:()=>Ye});var U=class extends Error{constructor(r,o,n){super(o);this.code=r;this.data=n}};var Ee=class extends U{constructor(t){super(D.internalError,t)}};var D={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};var $=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve=t=>{this._resolve?.(t)};reject=t=>{this._reject?.(t)}};var er=Fe(tt(),1),ot=Fe(rt(),1);async function Ie(e){let t=(0,ot.sha256)(JSON.stringify(e)),r={...e,validationHash:t},o=await tr(r),n=(0,ot.sha256)(o);return{compressed:o,compressedHash:n}}async function tr(e){return(0,er.compressToBase64)(JSON.stringify(e))}var rr=Fe(tt(),1),nt=Fe(rt(),1);async function Ce(e){if(!(e?.compressed&&e?.compressedHash))throw new U(D.corruptedResponse,"Missing compressed data");let t=await or(e.compressed);if(!t)throw new U(D.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new U(D.corruptedResponse,"Missing validation hash");if((0,nt.sha256)(e.compressed)!==e.compressedHash)throw new U(D.corruptedResponse,"Invalid compressed hash");let{validationHash:o,...n}=t;if((0,nt.sha256)(JSON.stringify(n))!==t.validationHash)throw new U(D.corruptedResponse,"Invalid data validation hash");return t}async function or(e){let t=await(0,rr.decompressFromBase64)(e);try{return JSON.parse(t)}catch(r){return console.error("Invalid compressed data",{e:r,decompressed:t}),null}}var ee="nexus-wallet-backup";function nr(){let e=new Map;return{createChannel:t=>{let r=Math.random().toString(36).substring(7);return e.set(r,t),r},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}var ke={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 it({walletBaseUrl:e,config:t}){let r=document.querySelector("#nexus-wallet");r&&r.remove();let o=document.createElement("iframe");return o.id=ke.id,o.name=ke.name,o.allow=ke.allow,o.style.zIndex=ke.style.zIndex.toString(),at({iframe:o,isVisible:!1}),document.body.appendChild(o),new Promise(n=>{o?.addEventListener("load",()=>n(o)),o.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function at({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"}function ir({iframe:e}){let t=new $;return{handleEvent:async o=>{switch(o.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":o.data.backup?localStorage.setItem(ee,o.data.backup):localStorage.removeItem(ee);break;case"remove-backup":localStorage.removeItem(ee);break;case"show":case"hide":at({iframe:e,isVisible:o.iframeLifecycle==="show"});break}},isConnected:t.promise}}function ar({frakWalletUrl:e,iframe:t,channelManager:r,iframeLifecycleManager:o}){if(typeof window>"u")throw new U(D.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new U(D.configError,"The iframe does not have a product window");let n=t.contentWindow,a=async l=>{if(!(l.origin&&URL.canParse(l.origin))||new URL(l.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase()||typeof l.data!="object")return;if("iframeLifecycle"in l.data){await o.handleEvent(l.data);return}if("clientLifecycle"in l.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let x=l.data.id,d=r.getRpcResolver(x);d&&await d(l.data)};return window.addEventListener("message",a),{sendEvent:l=>{n.postMessage(l,{targetOrigin:e})},cleanup:()=>{window.removeEventListener("message",a)}}}function st({config:e,iframe:t}){let r=nr(),o=ir({iframe:t}),n=ar({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:r,iframeLifecycleManager:o}),a=async d=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let m=new $,u=r.createChannel(async i=>{let p=await Ce(i.data);p.error?m.reject(new U(p.error.code,p.error.message,p.error?.data)):m.resolve(p.result),r.removeChannel(u)}),y=await Ie(d);return n.sendEvent({id:u,topic:d.method,data:y}),m.promise},c=async(d,s)=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let u=r.createChannel(async i=>{let p=await Ce(i.data);if(p.result)s(p.result);else throw new Ee("No valid result in the response")}),y=await Ie(d);n.sendEvent({id:u,topic:d.method,data:y})},f=Vo(n,o),l=async()=>{f(),r.destroy(),n.cleanup(),t.remove()},x=$o({config:e,messageHandler:n,lifecycleManager:o});return{config:e,waitForConnection:o.isConnected,waitForSetup:x,request:a,listenerRequest:c,destroy:l}}function Vo(e,t){let n,a,c=()=>e.sendEvent({iframeLifecycle:"heartbeat"});async function f(){c(),n=setInterval(c,100),a=setTimeout(()=>{l(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,l()}function l(){n&&clearInterval(n),a&&clearTimeout(a)}return f(),l}async function $o({config:e,messageHandler:t,lifecycleManager:r}){await r.isConnected;let o=async()=>{let a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},n=async()=>{if(typeof window>"u")return;let a=window.localStorage.getItem(ee);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([o(),n()])}Ue();He();Vr();$r();gt();Pe();var Tt="fCtx";function sn(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function cn(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),r=>r.charCodeAt(0))}function Wr(e){if(e?.r)try{let t=pe(e.r);return sn(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function jr(e){if(!(!e||e.length===0))try{let t=cn(e);return{r:ue(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function qr({url:e}){if(!e)return null;let r=new URL(e).searchParams.get(Tt);return r?jr(r):null}function Kr({url:e,context:t}){if(!e)return null;let r=qr({url:e}),o=r?{...r,...t}:t;if(!o.r)return null;let n=Wr(o);if(!n)return null;let a=new URL(e);return a.searchParams.set(Tt,n),a.toString()}function Jr(e){let t=new URL(e);return t.searchParams.delete(Tt),t.toString()}function ln({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}let r=e??window.location.href,o;t!==null?o=Kr({url:r,context:t}):o=Jr(r),o&&window.history.replaceState(null,"",o.toString())}var oe={compress:Wr,decompress:jr,parse:qr,update:Kr,remove:Jr,replaceUrl:ln};async function It({config:e}){let t=await it({config:e});if(!t){console.error("Failed to create iframe");return}let r=st({config:e,iframe:t});if(await r.waitForSetup,!await r.waitForConnection){console.error("Failed to connect to client");return}return r}function Gr(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}function Ct(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(n=>(Xr(n.interactionToken),n));let r=new $,o=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},n=>{t(n),Xr(n.interactionToken),o||(r.resolve(n),o=!0)}).then(()=>r.promise)}function Xr(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function Yr({domain:e}){let t=e??window.location.host;return me(G(t))}async function kt(e,{productId:t,interaction:r,validation:o}){let n=t??Yr(e.config);return await e.request({method:"frak_sendInteraction",params:[n,r,o]})}async function xe(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,r]})}async function At(e){return await e.request({method:"frak_getProductInformation"})}function Pt(e,{metadata:t,login:r,openSession:o}){return Ve(e,{steps:{login:r??{},openSession:o??{}},metadata:t})}function Ve(e,t){function r(c){return Ve(e,{...t,steps:{...t.steps,sendTransaction:c}})}function o(c){return Ve(e,{...t,steps:{...t.steps,final:{...c,action:{key:"reward"}}}})}function n(c,f){return Ve(e,{...t,steps:{...t.steps,final:{...f,action:{key:"sharing",options:c}}}})}async function a(){return await xe(e,t)}return{params:t,sendTx:r,reward:o,sharing:n,display:a}}var Rt={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 $e={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},Xa=Object.entries($e).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var Mt={createLink(){return{handlerTypeDenominator:G($e.referral),interactionData:Rt.referral.createLink}},referred({referrer:e}){let t=Ft([Rt.referral.referred,V(e,{size:32})]);return{handlerTypeDenominator:G($e.referral),interactionData:t}}};async function Zr(e,{walletStatus:t,frakContext:r,modalConfig:o,productId:n,options:a}){let c=!1;async function f(){if(!c)return c=!0,pn(e,{modalConfig:o,walletStatus:t})}async function l(x){let d=Mt.referred({referrer:x});await kt(e,{productId:n,interaction:d})}try{let{status:x,currentWallet:d}=await un({initialWalletStatus:t,getFreshWalletStatus:f,pushReferralInteraction:l,frakContext:r});return oe.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:d}:null}),x}catch(x){return console.log("Error processing referral",{error:x}),oe.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),fn(x)}}async function un({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:o}){let n=e?.wallet;return o?.r?(n||(n=await t()),n&&Et(o.r,n)?{status:"self-referral",currentWallet:n}:(e?.interactionSession||(n=await t()),await r(o.r),{status:"success",currentWallet:n})):{status:"no-referrer",currentWallet:n}}async function pn(e,{modalConfig:t,walletStatus:r}){return r?.interactionSession?r.wallet??void 0:t?(await xe(e,t))?.login?.wallet??void 0:void 0}function fn(e){if(e instanceof U)switch(e.code){case D.walletNotConnected:return"no-wallet";case D.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function Bt(e,{productId:t,modalConfig:r,options:o}={}){let n=oe.parse({url:window.location.href}),a=await Ct(e);try{return await Zr(e,{walletStatus:a,frakContext:n,modalConfig:r,productId:t,options:o})}catch(c){console.warn("Error processing referral",{error:c})}}var Qr="frakClientReady",We;function eo(){let e=new CustomEvent(Qr);window.dispatchEvent(e)}function Ht(e,t){if(window.FrakSetup?.client&&e==="add"){t();return}(e==="add"?window.addEventListener:window.removeEventListener)(Qr,t,!1)}function to(e){We=Pt(e,window.FrakSetup?.modalConfig??{})}async function ro(e){if(!We){console.error("modalBuilderSteps not found");return}let t=await Bt(e,{modalConfig:We.reward().params});console.log("referral",t)}function oo(){return We}var ge,P,co,dn,Z,no,lo,Lt,uo,Ot,Ut,Dt,mn,ye={},po=[],hn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zt=Array.isArray;function j(e,t){for(var r in t)e[r]=t[r];return e}function Nt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Q(e,t,r){var o,n,a,c={};for(a in t)a=="key"?o=t[a]:a=="ref"?n=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?ge.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)c[a]===void 0&&(c[a]=e.defaultProps[a]);return _e(e,c,o,n,null)}function _e(e,t,r,o,n){var a={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++co,__i:-1,__u:0};return n==null&&P.vnode!=null&&P.vnode(a),a}function ie(e){return e.children}function qe(e,t){this.props=e,this.context=t}function ne(e,t){if(t==null)return e.__?ne(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ne(e):null}function fo(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return fo(e)}}function io(e){(!e.__d&&(e.__d=!0)&&Z.push(e)&&!Ke.__r++||no!==P.debounceRendering)&&((no=P.debounceRendering)||lo)(Ke)}function Ke(){var e,t,r,o,n,a,c,f;for(Z.sort(Lt);e=Z.shift();)e.__d&&(t=Z.length,o=void 0,a=(n=(r=e).__v).__e,c=[],f=[],r.__P&&((o=j({},n)).__v=n.__v+1,P.vnode&&P.vnode(o),Vt(r.__P,o,n,r.__n,r.__P.namespaceURI,32&n.__u?[a]:null,c,a??ne(n),!!(32&n.__u),f),o.__v=n.__v,o.__.__k[o.__i]=o,xo(c,o,f),o.__e!=a&&fo(o)),Z.length>t&&Z.sort(Lt));Ke.__r=0}function mo(e,t,r,o,n,a,c,f,l,x,d){var s,m,u,y,i,p,b=o&&o.__k||po,F=t.length;for(l=xn(r,t,b,l,F),s=0;s<F;s++)(u=r.__k[s])!=null&&(m=u.__i===-1?ye:b[u.__i]||ye,u.__i=s,p=Vt(e,u,m,n,a,c,f,l,x,d),y=u.__e,u.ref&&m.ref!=u.ref&&(m.ref&&$t(m.ref,null,u),d.push(u.ref,u.__c||y,u)),i==null&&y!=null&&(i=y),4&u.__u||m.__k===u.__k?l=ho(u,l,e):typeof u.type=="function"&&p!==void 0?l=p:y&&(l=y.nextSibling),u.__u&=-7);return r.__e=i,l}function xn(e,t,r,o,n){var a,c,f,l,x,d=r.length,s=d,m=0;for(e.__k=new Array(n),a=0;a<n;a++)(c=t[a])!=null&&typeof c!="boolean"&&typeof c!="function"?(l=a+m,(c=e.__k[a]=typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?_e(null,c,null,null,null):zt(c)?_e(ie,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?_e(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):c).__=e,c.__b=e.__b+1,f=null,(x=c.__i=_n(c,r,l,s))!==-1&&(s--,(f=r[x])&&(f.__u|=2)),f==null||f.__v===null?(x==-1&&m--,typeof c.type!="function"&&(c.__u|=4)):x!=l&&(x==l-1?m--:x==l+1?m++:(x>l?m--:m++,c.__u|=4))):e.__k[a]=null;if(s)for(a=0;a<d;a++)(f=r[a])!=null&&!(2&f.__u)&&(f.__e==o&&(o=ne(f)),_o(f,f));return o}function ho(e,t,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=ho(o[n],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=ne(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function _n(e,t,r,o){var n,a,c=e.key,f=e.type,l=t[r];if(l===null||l&&c==l.key&&f===l.type&&!(2&l.__u))return r;if(o>(l!=null&&!(2&l.__u)?1:0))for(n=r-1,a=r+1;n>=0||a<t.length;){if(n>=0){if((l=t[n])&&!(2&l.__u)&&c==l.key&&f===l.type)return n;n--}if(a<t.length){if((l=t[a])&&!(2&l.__u)&&c==l.key&&f===l.type)return a;a++}}return-1}function ao(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||hn.test(t)?r:r+"px"}function je(e,t,r,o,n){var a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||ao(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||ao(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(uo,"$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]=r,r?o?r.u=o.u:(r.u=Ot,e.addEventListener(t,a?Dt:Ut,a)):e.removeEventListener(t,a?Dt:Ut,a);else{if(n=="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]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function so(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ot++;else if(t.t<r.u)return;return r(P.event?P.event(t):t)}}}function Vt(e,t,r,o,n,a,c,f,l,x){var d,s,m,u,y,i,p,b,F,g,E,R,h,_,T,S,I,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[f=t.__e=r.__e]),(d=P.__b)&&d(t);e:if(typeof w=="function")try{if(b=t.props,F="prototype"in w&&w.prototype.render,g=(d=w.contextType)&&o[d.__c],E=d?g?g.props.value:d.__:o,r.__c?p=(s=t.__c=r.__c).__=s.__E:(F?t.__c=s=new w(b,E):(t.__c=s=new qe(b,E),s.constructor=w,s.render=gn),g&&g.sub(s),s.props=b,s.state||(s.state={}),s.context=E,s.__n=o,m=s.__d=!0,s.__h=[],s._sb=[]),F&&s.__s==null&&(s.__s=s.state),F&&w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=j({},s.__s)),j(s.__s,w.getDerivedStateFromProps(b,s.__s))),u=s.props,y=s.state,s.__v=t,m)F&&w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),F&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(F&&w.getDerivedStateFromProps==null&&b!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(b,E),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(b,s.__s,E)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(s.props=b,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(C){C&&(C.__=t)}),R=0;R<s._sb.length;R++)s.__h.push(s._sb[R]);s._sb=[],s.__h.length&&c.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(b,s.__s,E),F&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,y,i)})}if(s.context=E,s.props=b,s.__P=e,s.__e=!1,h=P.__r,_=0,F){for(s.state=s.__s,s.__d=!1,h&&h(t),d=s.render(s.props,s.state,s.context),T=0;T<s._sb.length;T++)s.__h.push(s._sb[T]);s._sb=[]}else do s.__d=!1,h&&h(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++_<25);s.state=s.__s,s.getChildContext!=null&&(o=j(j({},o),s.getChildContext())),F&&!m&&s.getSnapshotBeforeUpdate!=null&&(i=s.getSnapshotBeforeUpdate(u,y)),f=mo(e,zt(S=d!=null&&d.type===ie&&d.key==null?d.props.children:d)?S:[S],t,r,o,n,a,c,f,l,x),s.base=t.__e,t.__u&=-161,s.__h.length&&c.push(s),p&&(s.__E=s.__=null)}catch(C){if(t.__v=null,l||a!=null)if(C.then){for(t.__u|=l?160:128;f&&f.nodeType==8&&f.nextSibling;)f=f.nextSibling;a[a.indexOf(f)]=null,t.__e=f}else for(I=a.length;I--;)Nt(a[I]);else t.__e=r.__e,t.__k=r.__k;P.__e(C,t,r)}else a==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):f=t.__e=yn(r.__e,t,r,o,n,a,c,l,x);return(d=P.diffed)&&d(t),128&t.__u?void 0:f}function xo(e,t,r){for(var o=0;o<r.length;o++)$t(r[o],r[++o],r[++o]);P.__c&&P.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(a){a.call(n)})}catch(a){P.__e(a,n.__v)}})}function yn(e,t,r,o,n,a,c,f,l){var x,d,s,m,u,y,i,p=r.props,b=t.props,F=t.type;if(F=="svg"?n="http://www.w3.org/2000/svg":F=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),a!=null){for(x=0;x<a.length;x++)if((u=a[x])&&"setAttribute"in u==!!F&&(F?u.localName==F:u.nodeType==3)){e=u,a[x]=null;break}}if(e==null){if(F==null)return document.createTextNode(b);e=document.createElementNS(n,F,b.is&&b),f&&(P.__m&&P.__m(t,a),f=!1),a=null}if(F===null)p===b||f&&e.data===b||(e.data=b);else{if(a=a&&ge.call(e.childNodes),p=r.props||ye,!f&&a!=null)for(p={},x=0;x<e.attributes.length;x++)p[(u=e.attributes[x]).name]=u.value;for(x in p)if(u=p[x],x!="children"){if(x=="dangerouslySetInnerHTML")s=u;else if(!(x in b)){if(x=="value"&&"defaultValue"in b||x=="checked"&&"defaultChecked"in b)continue;je(e,x,null,u,n)}}for(x in b)u=b[x],x=="children"?m=u:x=="dangerouslySetInnerHTML"?d=u:x=="value"?y=u:x=="checked"?i=u:f&&typeof u!="function"||p[x]===u||je(e,x,u,p[x],n);if(d)f||s&&(d.__html===s.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),mo(e,zt(m)?m:[m],t,r,o,F=="foreignObject"?"http://www.w3.org/1999/xhtml":n,a,c,a?a[0]:r.__k&&ne(r,0),f,l),a!=null)for(x=a.length;x--;)Nt(a[x]);f||(x="value",F=="progress"&&y==null?e.removeAttribute("value"):y!==void 0&&(y!==e[x]||F=="progress"&&!y||F=="option"&&y!==p[x])&&je(e,x,y,p[x],n),x="checked",i!==void 0&&i!==e[x]&&je(e,x,i,p[x],n))}return e}function $t(e,t,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){P.__e(n,r)}}function _o(e,t,r){var o,n;if(P.unmount&&P.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||$t(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){P.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&_o(o[n],t,r||typeof e.type!="function");r||Nt(e.__e),e.__c=e.__=e.__e=void 0}function gn(e,t,r){return this.constructor(e,r)}function be(e,t,r){var o,n,a,c;t==document&&(t=document.documentElement),P.__&&P.__(e,t),n=(o=typeof r=="function")?null:r&&r.__k||t.__k,a=[],c=[],Vt(t,e=(!o&&r||t).__k=Q(ie,null,[e]),n||ye,ye,t.namespaceURI,!o&&r?[r]:n?null:t.firstChild?ge.call(t.childNodes):null,a,!o&&r?r:n?n.__e:t.firstChild,o,c),xo(a,e,c)}function Wt(e,t){be(e,t,Wt)}function jt(e,t,r){var o,n,a,c,f=j({},e.props);for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)a=="key"?o=t[a]:a=="ref"?n=t[a]:f[a]=t[a]===void 0&&c!==void 0?c[a]:t[a];return arguments.length>2&&(f.children=arguments.length>3?ge.call(arguments,2):r),_e(e.type,f,o||e.key,n||e.ref,null)}ge=po.slice,P={__e:function(e,t,r,o){for(var n,a,c;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(e)),c=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),c=n.__d),c)return n.__E=n}catch(f){e=f}throw e}},co=0,dn=function(e){return e!=null&&e.constructor==null},qe.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},r),this.props)),e&&j(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),io(this))},qe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),io(this))},qe.prototype.render=ie,Z=[],lo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Lt=function(e,t){return e.__v.__b-t.__v.__b},Ke.__r=0,uo=/(PointerCapture)$|Capture$/i,Ot=0,Ut=so(!1),Dt=so(!0),mn=0;function qt(){return(qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var bn=["context","children"];function wn(e){this.getChildContext=function(){return e.context};var t=e.children,r=function(o,n){if(o==null)return{};var a,c,f={},l=Object.keys(o);for(c=0;c<l.length;c++)n.indexOf(a=l[c])>=0||(f[a]=o[a]);return f}(e,bn);return jt(t,r)}function vn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Q(wn,qt({},this._props,{context:e.detail.context}),function t(r,o){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var n=[],a={},c=0,f=r.attributes,l=r.childNodes;for(c=f.length;c--;)f[c].name!=="slot"&&(a[f[c].name]=f[c].value,a[go(f[c].name)]=f[c].value);for(c=l.length;c--;){var x=t(l[c],null),d=l[c].slot;d?a[d]=Q(yo,{name:d},x):n[c]=x}var s=o?Q(yo,null,n):n;return Q(o||r.nodeName.toLowerCase(),a,s)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Wt:be)(this._vdom,this._root)}function go(e){return e.replace(/-(\w)/g,function(t,r){return r?r.toUpperCase():""})}function Sn(e,t,r){if(this._vdom){var o={};o[e]=r=r??void 0,o[go(e)]=r,this._vdom=jt(this._vdom,o),be(this._vdom,this._root)}}function Fn(){be(this._vdom=null,this._root)}function yo(e,t){var r=this;return Q("slot",qt({},e,{ref:function(o){o?(r.ref=o,r._listener||(r._listener=function(n){n.stopPropagation(),n.detail.context=t},o.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function bo(e,t,r,o){function n(){var a=Reflect.construct(HTMLElement,[],n);return a._vdomComponent=e,a._root=o&&o.shadow?a.attachShadow({mode:o.mode||"open"}):a,a}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=vn,n.prototype.attributeChangedCallback=Sn,n.prototype.disconnectedCallback=Fn,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=r,r.forEach(function(a){Object.defineProperty(n.prototype,a,{get:function(){return this._vdom.props[a]},set:function(c){this._vdom?this.attributeChangedCallback(a,null,c):(this._props||(this._props={}),this._props[a]=c,this.connectedCallback());var f=typeof c;c!=null&&f!=="string"&&f!=="boolean"&&f!=="number"||this.setAttribute(a,c)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var we,H,Kt,wo,Ge=0,ko=[],L=P,vo=L.__b,So=L.__r,Fo=L.diffed,Eo=L.__c,To=L.unmount,Io=L.__;function Gt(e,t){L.__h&&L.__h(H,e,Ge||t),Ge=0;var r=H.__H||(H.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Xt(e){return Ge=1,En(Mo,e)}function En(e,t,r){var o=Gt(we++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):Mo(void 0,t),function(f){var l=o.__N?o.__N[0]:o.__[0],x=o.t(l,f);l!==x&&(o.__N=[x,o.__[1]],o.__c.setState({}))}],o.__c=H,!H.u)){var n=function(f,l,x){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(m){return!!m.__c});if(d.every(function(m){return!m.__N}))return!a||a.call(this,f,l,x);var s=o.__c.props!==f;return d.forEach(function(m){if(m.__N){var u=m.__[0];m.__=m.__N,m.__N=void 0,u!==m.__[0]&&(s=!0)}}),a&&a.call(this,f,l,x)||s};H.u=!0;var a=H.shouldComponentUpdate,c=H.componentWillUpdate;H.componentWillUpdate=function(f,l,x){if(this.__e){var d=a;a=void 0,n(f,l,x),a=d}c&&c.call(this,f,l,x)},H.shouldComponentUpdate=n}return o.__N||o.__}function Ao(e,t){var r=Gt(we++,3);!L.__s&&Ro(r.__H,t)&&(r.__=e,r.i=t,H.__H.__h.push(r))}function Xe(e,t){var r=Gt(we++,7);return Ro(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Po(e,t){return Ge=8,Xe(function(){return e},t)}function Tn(){for(var e;e=ko.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Je),e.__H.__h.forEach(Jt),e.__H.__h=[]}catch(t){e.__H.__h=[],L.__e(t,e.__v)}}L.__b=function(e){H=null,vo&&vo(e)},L.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Io&&Io(e,t)},L.__r=function(e){So&&So(e),we=0;var t=(H=e.__c).__H;t&&(Kt===H?(t.__h=[],H.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Je),t.__h.forEach(Jt),t.__h=[],we=0)),Kt=H},L.diffed=function(e){Fo&&Fo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ko.push(t)!==1&&wo===L.requestAnimationFrame||((wo=L.requestAnimationFrame)||In)(Tn)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Kt=H=null},L.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Je),r.__h=r.__h.filter(function(o){return!o.__||Jt(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],L.__e(o,r.__v)}}),Eo&&Eo(e,t)},L.unmount=function(e){To&&To(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Je(o)}catch(n){t=n}}),r.__H=void 0,t&&L.__e(t,r.__v))};var Co=typeof requestAnimationFrame=="function";function In(e){var t,r=function(){clearTimeout(o),Co&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);Co&&(t=requestAnimationFrame(r))}function Je(e){var t=H,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),H=t}function Jt(e){var t=H;e.__c=e.__(),H=t}function Ro(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function Mo(e,t){return typeof t=="function"?t(e):t}var Cn=0,ks=Array.isArray;function Bo(e,t,r,o,n,a){t||(t={});var c,f,l=t;if("ref"in l)for(f in l={},t)f=="ref"?c=t[f]:l[f]=t[f];var x={type:e,props:l,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Cn,__i:-1,__u:0,__source:n,__self:a};if(typeof e=="function"&&(c=e.defaultProps))for(f in c)l[f]===void 0&&(l[f]=c[f]);return P.vnode&&P.vnode(x),x}function kn(){let e=oo();if(!e){console.error("modalBuilderSteps not found");return}e.sharing(window.FrakSetup?.modalShareConfig??{}).display()}function Ye({text:e="Share and earn!",classname:t="",useReward:r,noRewardText:o}){let n=Xe(()=>r!==void 0,[r]),[a,c]=Xt(!0),[f,l]=Xt(void 0),x=Po(()=>{if(c(!1),!n)return;let s=window.FrakSetup?.client;if(!s){console.warn("Frak client not ready yet");return}At(s).then(m=>{m?.estimatedEurReward&&l(`${m.estimatedEurReward} \u20AC`)})},[n]);Ao(()=>(Ht("add",x),()=>Ht("remove",x)),[x]);let d=Xe(()=>n?f?e.includes("{REWARD}")?e.replace("{REWARD}",f):`${e} ${f}`:o??e.replace("{REWARD}",""):e,[n,e,o,f]);return Bo("button",{type:"button",class:t,disabled:a,onClick:kn,children:d})}customElements.get("frak-button-share")||bo(Ye,"frak-button-share",["text"],{shadow:!1});Gr(async function(){if(!window.FrakSetup?.config){console.error("window.FrakSetup.config not found");return}let t=await It({config:window.FrakSetup.config});if(!t){console.error("Failed to create Frak client");return}window.FrakSetup.client=t,eo(),to(t),ro(t)});return No(An);})();
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* @version 0.11.0
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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`
|
|
10
|
+
Debug Information:
|
|
11
|
+
-----------------
|
|
12
|
+
Timestamp: ${n.timestamp}
|
|
13
|
+
URL: ${n.encodedUrl}
|
|
14
|
+
Config: ${n.encodedConfig}
|
|
15
|
+
Navigator Info: ${n.navigatorInfo}
|
|
16
|
+
IFrame Status: ${n.iframeStatus}
|
|
17
|
+
Last Request: ${n.lastRequest}
|
|
18
|
+
Last Response: ${n.lastResponse}
|
|
19
|
+
Client Status: ${n.clientStatus}
|
|
20
|
+
Error: ${n.error}
|
|
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,20 +44,30 @@
|
|
|
44
44
|
"format:check": "biome check .",
|
|
45
45
|
"format": "biome check --write .",
|
|
46
46
|
"clean": "rimraf cdn",
|
|
47
|
-
"build": "
|
|
48
|
-
"build:watch": "
|
|
47
|
+
"build": "vite build",
|
|
48
|
+
"build:watch": "vite build --watch",
|
|
49
49
|
"typecheck": "tsc --noEmit",
|
|
50
50
|
"prepublish": "bun run lint && bun run build",
|
|
51
51
|
"publish": "bun publish"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"@frak-labs/core-sdk": "0.0.6",
|
|
55
|
+
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
54
56
|
"preact": "^10.25.4",
|
|
55
57
|
"preact-custom-element": "^4.3.0"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
60
|
+
"@preact/preset-vite": "^2.10.1",
|
|
58
61
|
"@types/node": "^22",
|
|
59
62
|
"@types/preact-custom-element": "^4.0.4",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
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"
|
|
69
|
+
},
|
|
70
|
+
"browserslist": [
|
|
71
|
+
"extends @frak-labs/browserslist-config"
|
|
72
|
+
]
|
|
73
|
+
}
|