@imtbl/checkout-widgets 2.0.2-alpha.3 → 2.0.2-alpha.5
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/dist/browser/{AddTokensWidget-D4nVvHez.js → AddTokensWidget-CJg-yVjC.js} +3 -3
- package/dist/browser/{BridgeWidget-ZVgpMi0M.js → BridgeWidget-C0Q6bOgT.js} +7 -7
- package/dist/browser/{CommerceWidget-SMC-yO4n.js → CommerceWidget-B9oSel1c.js} +13 -13
- package/dist/browser/{FeesBreakdown-CBeF4wP4.js → FeesBreakdown-BIc7WTJ9.js} +1 -1
- package/dist/browser/{OnRampWidget-JOhYwyml.js → OnRampWidget-COp34DGI.js} +3 -3
- package/dist/browser/{SaleWidget-DvHr6HpK.js → SaleWidget-CcJMMOoC.js} +10 -10
- package/dist/browser/{SpendingCapHero-ClOXfIW6.js → SpendingCapHero-BuX6il5e.js} +1 -1
- package/dist/browser/{SwapWidget-CJ7RBsv3.js → SwapWidget-CJ4vJ000.js} +11 -11
- package/dist/browser/{TokenImage-eJND6ltR.js → TokenImage-CZ3P4lD-.js} +1 -1
- package/dist/browser/{TopUpView-BO8m1CfP.js → TopUpView-BCGFxkmN.js} +1 -1
- package/dist/browser/{WalletApproveHero-JN9M91AQ.js → WalletApproveHero-CIG9ishV.js} +17 -6
- package/dist/browser/{WalletWidget-BuZwylPn.js → WalletWidget-1bMGxvEq.js} +3 -3
- package/dist/browser/{auto-track-BJUel0NO.js → auto-track-D4FwZuq1.js} +1 -1
- package/dist/browser/{index-BSOc2BhK.js → index-B0eFcYBX.js} +1 -1
- package/dist/browser/{index-CatjPiiH.js → index-BEf6HW-V.js} +1 -1
- package/dist/browser/{index-BzIYiSrN.js → index-BOb9DsN4.js} +1 -1
- package/dist/browser/{index-C7Oa4HGC.js → index-BTK7BasN.js} +1 -1
- package/dist/browser/{index-Bwjg_0wC.js → index-CjHnZkHN.js} +1 -1
- package/dist/browser/{index-EBVlIaRM.js → index-Crkt1BNU.js} +25 -25
- package/dist/browser/{index-CznNSczn.js → index-DJu0Gu5q.js} +1 -1
- package/dist/browser/{index-CaRdxus5.js → index-suneijDN.js} +2 -2
- package/dist/browser/index.cdn.js +26 -15
- package/dist/browser/index.js +1 -1
- package/dist/browser/{index.umd-ilfCwhzJ.js → index.umd-BQWpWIfm.js} +1 -1
- package/dist/browser/{useInterval-DYfAIV2X.js → useInterval-xyIERLzn.js} +1 -1
- package/dist/types/components/FormComponents/SelectForm/SelectForm.d.ts +5 -1
- package/dist/types/components/FormComponents/SelectInput/SelectInput.d.ts +5 -1
- package/package.json +7 -7
- package/src/components/FormComponents/SelectForm/SelectForm.tsx +22 -3
- package/src/components/FormComponents/SelectInput/SelectInput.tsx +11 -0
- package/src/locales/en.json +6 -6
- package/src/widgets/bridge/components/BridgeForm.tsx +3 -0
- package/src/widgets/swap/components/SwapForm.tsx +6 -0
|
@@ -4137,7 +4137,7 @@
|
|
|
4137
4137
|
};
|
|
4138
4138
|
lib$N.clearGlobalNamespace = clearGlobalNamespace;
|
|
4139
4139
|
|
|
4140
|
-
var Ut$3=Object.defineProperty;var St$2=(u,c)=>{for(var p in c)Ut$3(u,p,{get:c[p],enumerable:!0});};function Br$2(u){throw new Error("Node.js process "+u+" is not supported by JSPM core outside of Node.js")}var G$8=[],tr$3=!1,W$7,cr$6=-1;function kt$3(){!tr$3||!W$7||(tr$3=!1,W$7.length?G$8=W$7.concat(G$8):cr$6=-1,G$8.length&&Vr$2());}function Vr$2(){if(!tr$3){var u=setTimeout(kt$3,0);tr$3=!0;for(var c=G$8.length;c;){for(W$7=G$8,G$8=[];++cr$6<c;)W$7&&W$7[cr$6].run();cr$6=-1,c=G$8.length;}W$7=null,tr$3=!1,clearTimeout(u);}}function _t$3(u){var c=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)c[p-1]=arguments[p];G$8.push(new Gr$2(u,c)),G$8.length===1&&!tr$3&&setTimeout(Vr$2,0);}function Gr$2(u,c){this.fun=u,this.array=c;}Gr$2.prototype.run=function(){this.fun.apply(null,this.array);};var Pt$3="browser",Rt$3="x64",bt$3="browser",Nt$3={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},vt$2=["/usr/bin/node"],Mt$2=[],Ct$4="v16.8.0",Lt$4={},Dt$3=function(u,c){console.warn((c?c+": ":"")+u);},$t$4=function(u){Br$2("binding");},Ft$3=function(u){return 0},Ot$4=function(){return "/"},Vt$2=function(u){},Gt$4={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function M$9(){}var Yt$4=M$9,Kt$6=[];function Ht$4(u){Br$2("_linkedBinding");}var Wt$4={},jt$4=!1,Xt$6={};function qt$4(u){Br$2("dlopen");}function Jt$6(){return []}function zt$4(){return []}var Qt$3=M$9,Zt$4=M$9,Tr$3=function(){return {}},re$a=Tr$3,te$7=Tr$3,ee$6=M$9,ne$7=M$9,ie$8=M$9,oe$9={};function se$7(u,c){if(!u)throw new Error(c||"assertion error")}var ue$6={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ae$5=M$9,ce$6=M$9;function pe$5(){return !1}var le$6=M$9,fe$7=M$9,he$5=M$9,de$7=M$9,me$7=M$9,we$7=void 0,ge$6=void 0,ye$8=void 0,Ee$6=M$9,Ie$4=2,Be$7=1,Te$3="/bin/usr/node",Ae$6=9229,xe$6="node",Ue$7=[],Se$5=M$9,K$b={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};K$b.now===void 0&&(yr$4=Date.now(),K$b.timing&&K$b.timing.navigationStart&&(yr$4=K$b.timing.navigationStart),K$b.now=()=>Date.now()-yr$4);var yr$4;function ke$7(){return K$b.now()/1e3}var Er$3=1e9;function Ir$3(u){var c=Math.floor((Date.now()-K$b.now())*.001),p=K$b.now()*.001,l=Math.floor(p)+c,m=Math.floor(p%1*1e9);return u&&(l=l-u[0],m=m-u[1],m<0&&(l--,m+=Er$3)),[l,m]}Ir$3.bigint=function(u){var c=Ir$3(u);return typeof BigInt>"u"?c[0]*Er$3+c[1]:BigInt(c[0]*Er$3)+BigInt(c[1])};var _e$6=10,Pe$6={},Re$8=0;function H$8(){return T$a}var be$6=H$8,Ne$4=H$8,ve$7=H$8,Me$5=H$8,Ce$6=H$8,Le$6=M$9,De$7=H$8,$e$7=H$8;function Fe$5(u){return []}var T$a={version:Ct$4,versions:Lt$4,arch:Rt$3,platform:bt$3,release:Gt$4,_rawDebug:Yt$4,moduleLoadList:Kt$6,binding:$t$4,_linkedBinding:Ht$4,_events:Pe$6,_eventsCount:Re$8,_maxListeners:_e$6,on:H$8,addListener:be$6,once:Ne$4,off:ve$7,removeListener:Me$5,removeAllListeners:Ce$6,emit:Le$6,prependListener:De$7,prependOnceListener:$e$7,listeners:Fe$5,domain:Wt$4,_exiting:jt$4,config:Xt$6,dlopen:qt$4,uptime:ke$7,_getActiveRequests:Jt$6,_getActiveHandles:zt$4,reallyExit:Qt$3,_kill:Zt$4,cpuUsage:Tr$3,resourceUsage:re$a,memoryUsage:te$7,kill:ee$6,exit:ne$7,openStdin:ie$8,allowedNodeEnvironmentFlags:oe$9,assert:se$7,features:ue$6,_fatalExceptions:ae$5,setUncaughtExceptionCaptureCallback:ce$6,hasUncaughtExceptionCaptureCallback:pe$5,emitWarning:Dt$3,nextTick:_t$3,_tickCallback:le$6,_debugProcess:fe$7,_debugEnd:he$5,_startProfilerIdleNotifier:de$7,_stopProfilerIdleNotifier:me$7,stdout:we$7,stdin:ye$8,stderr:ge$6,abort:Ee$6,umask:Ft$3,chdir:Vt$2,cwd:Ot$4,env:Nt$3,title:Pt$3,argv:vt$2,execArgv:Mt$2,pid:Ie$4,ppid:Be$7,execPath:Te$3,debugPort:Ae$6,hrtime:Ir$3,argv0:xe$6,_preload_modules:Ue$7,setSourceMapsEnabled:Se$5};var nr$5={},Yr$1=!1;function Oe$5(){if(Yr$1)return nr$5;Yr$1=!0,nr$5.byteLength=E,nr$5.toByteArray=C,nr$5.fromByteArray=_;for(var u=[],c=[],p=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,w=l.length;m<w;++m)u[m]=l[m],c[l.charCodeAt(m)]=m;c[45]=62,c[95]=63;function o(f){var h=f.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=h);var A=g===h?0:4-g%4;return [g,A]}function E(f){var h=o(f),g=h[0],A=h[1];return (g+A)*3/4-A}function b(f,h,g){return (h+g)*3/4-g}function C(f){var h,g=o(f),A=g[0],v=g[1],P=new p(b(f,A,v)),D=0,F=v>0?A-4:A,L;for(L=0;L<F;L+=4)h=c[f.charCodeAt(L)]<<18|c[f.charCodeAt(L+1)]<<12|c[f.charCodeAt(L+2)]<<6|c[f.charCodeAt(L+3)],P[D++]=h>>16&255,P[D++]=h>>8&255,P[D++]=h&255;return v===2&&(h=c[f.charCodeAt(L)]<<2|c[f.charCodeAt(L+1)]>>4,P[D++]=h&255),v===1&&(h=c[f.charCodeAt(L)]<<10|c[f.charCodeAt(L+1)]<<4|c[f.charCodeAt(L+2)]>>2,P[D++]=h>>8&255,P[D++]=h&255),P}function B(f){return u[f>>18&63]+u[f>>12&63]+u[f>>6&63]+u[f&63]}function k(f,h,g){for(var A,v=[],P=h;P<g;P+=3)A=(f[P]<<16&16711680)+(f[P+1]<<8&65280)+(f[P+2]&255),v.push(B(A));return v.join("")}function _(f){for(var h,g=f.length,A=g%3,v=[],P=16383,D=0,F=g-A;D<F;D+=P)v.push(k(f,D,D+P>F?F:D+P));return A===1?(h=f[g-1],v.push(u[h>>2]+u[h<<4&63]+"==")):A===2&&(h=(f[g-2]<<8)+f[g-1],v.push(u[h>>10]+u[h>>4&63]+u[h<<2&63]+"=")),v.join("")}return nr$5}var pr$5={},Kr$3=!1;function Ve$5(){if(Kr$3)return pr$5;Kr$3=!0;return pr$5.read=function(u,c,p,l,m){var w,o,E=m*8-l-1,b=(1<<E)-1,C=b>>1,B=-7,k=p?m-1:0,_=p?-1:1,f=u[c+k];for(k+=_,w=f&(1<<-B)-1,f>>=-B,B+=E;B>0;w=w*256+u[c+k],k+=_,B-=8);for(o=w&(1<<-B)-1,w>>=-B,B+=l;B>0;o=o*256+u[c+k],k+=_,B-=8);if(w===0)w=1-C;else {if(w===b)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,l),w=w-C;}return (f?-1:1)*o*Math.pow(2,w-l)},pr$5.write=function(u,c,p,l,m,w){var o,E,b,C=w*8-m-1,B=(1<<C)-1,k=B>>1,_=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=l?0:w-1,h=l?1:-1,g=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(E=isNaN(c)?1:0,o=B):(o=Math.floor(Math.log(c)/Math.LN2),c*(b=Math.pow(2,-o))<1&&(o--,b*=2),o+k>=1?c+=_/b:c+=_*Math.pow(2,1-k),c*b>=2&&(o++,b/=2),o+k>=B?(E=0,o=B):o+k>=1?(E=(c*b-1)*Math.pow(2,m),o=o+k):(E=c*Math.pow(2,k-1)*Math.pow(2,m),o=0));m>=8;u[p+f]=E&255,f+=h,E/=256,m-=8);for(o=o<<m|E,C+=m;C>0;u[p+f]=o&255,f+=h,o/=256,C-=8);u[p+f-h]|=g*128;},pr$5}var j$9={},Hr$2=!1;function Ge$7(){if(Hr$2)return j$9;Hr$2=!0;let u=Oe$5(),c=Ve$5(),p=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;j$9.Buffer=o,j$9.SlowBuffer=v,j$9.INSPECT_MAX_BYTES=50;let l=2147483647;j$9.kMaxLength=l,o.TYPED_ARRAY_SUPPORT=m(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function m(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return !1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function w(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,o.prototype),r}function o(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return E(e,r,t)}o.poolSize=8192;function E(e,r,t){if(typeof e=="string")return k(e,r);if(ArrayBuffer.isView(e))return f(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return h(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return o.from(n,r,t);let i=g(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return o.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}o.from=function(e,r,t){return E(e,r,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function b(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function C(e,r,t){return b(e),e<=0?w(e):r!==void 0?typeof t=="string"?w(e).fill(r,t):w(e).fill(r):w(e)}o.alloc=function(e,r,t){return C(e,r,t)};function B(e){return b(e),w(e<0?0:A(e)|0)}o.allocUnsafe=function(e){return B(e)},o.allocUnsafeSlow=function(e){return B(e)};function k(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=P(e,r)|0,n=w(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function _(e){let r=e.length<0?0:A(e.length)|0,t=w(r);for(let n=0;n<r;n+=1)t[n]=e[n]&255;return t}function f(e){if(O(e,Uint8Array)){let r=new Uint8Array(e);return h(r.buffer,r.byteOffset,r.byteLength)}return _(e)}function h(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,o.prototype),n}function g(e){if(o.isBuffer(e)){let r=A(e.length)|0,t=w(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||gr(e.length)?w(0):_(e);if(e.type==="Buffer"&&Array.isArray(e.data))return _(e.data)}function A(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function v(e){return +e!=e&&(e=0),o.alloc(+e)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,i=t.length;for(let s=0,a=Math.min(n,i);s<a;++s)if(r[s]!==t[s]){n=r[s],i=t[s];break}return n<i?-1:i<n?1:0},o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return !0;default:return !1}},o.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;let i=o.allocUnsafe(t),s=0;for(n=0;n<r.length;++n){let a=r[n];if(O(a,Uint8Array))s+a.length>i.length?(o.isBuffer(a)||(a=o.from(a)),a.copy(i,s)):Uint8Array.prototype.set.call(i,a,s);else if(o.isBuffer(a))a.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length;}return i};function P(e,r){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Or(e).length;default:if(i)return n?-1:wr(e).length;r=(""+r).toLowerCase(),i=!0;}}o.byteLength=P;function D(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return "";for(e||(e="utf8");;)switch(e){case"hex":return wt(this,r,t);case"utf8":case"utf-8":return br(this,r,t);case"ascii":return dt(this,r,t);case"latin1":case"binary":return mt(this,r,t);case"base64":return ft(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}o.prototype._isBuffer=!0;function F(e,r,t){let n=e[r];e[r]=e[t],e[t]=n;}o.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)F(this,t,t+1);return this},o.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)F(this,t,t+3),F(this,t+1,t+2);return this},o.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)F(this,t,t+7),F(this,t+1,t+6),F(this,t+2,t+5),F(this,t+3,t+4);return this},o.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?br(this,0,r):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(r){if(!o.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0},o.prototype.inspect=function(){let r="",t=j$9.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"},p&&(o.prototype[p]=o.prototype.inspect),o.prototype.compare=function(r,t,n,i,s){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>r.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===r)return 0;let a=s-i,d=n-t,x=Math.min(a,d),I=this.slice(i,s),U=r.slice(t,n);for(let y=0;y<x;++y)if(I[y]!==U[y]){a=I[y],d=U[y];break}return a<d?-1:d<a?1:0};function L(e,r,t,n,i){if(e.length===0)return -1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,gr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return -1;t=e.length-1;}else if(t<0)if(i)t=0;else return -1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:Rr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Rr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Rr(e,r,t,n,i){let s=1,a=e.length,d=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return -1;s=2,a/=2,d/=2,t/=2;}function x(U,y){return s===1?U[y]:U.readUInt16BE(y*s)}let I;if(i){let U=-1;for(I=t;I<a;I++)if(x(e,I)===x(r,U===-1?0:I-U)){if(U===-1&&(U=I),I-U+1===d)return U*s}else U!==-1&&(I-=I-U),U=-1;}else for(t+d>a&&(t=a-d),I=t;I>=0;I--){let U=!0;for(let y=0;y<d;y++)if(x(e,I+y)!==x(r,y)){U=!1;break}if(U)return I}return -1}o.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},o.prototype.indexOf=function(r,t,n){return L(this,r,t,n,!0)},o.prototype.lastIndexOf=function(r,t,n){return L(this,r,t,n,!1)};function ut(e,r,t,n){t=Number(t)||0;let i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let s=r.length;n>s/2&&(n=s/2);let a;for(a=0;a<n;++a){let d=parseInt(r.substr(a*2,2),16);if(gr(d))return a;e[t+a]=d;}return a}function at(e,r,t,n){return ar(wr(r,e.length-t),e,t,n)}function ct(e,r,t,n){return ar(Bt(r),e,t,n)}function pt(e,r,t,n){return ar(Or(r),e,t,n)}function lt(e,r,t,n){return ar(Tt(r,e.length-t),e,t,n)}o.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-t;if((n===void 0||n>s)&&(n=s),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return ut(this,r,t,n);case"utf8":case"utf-8":return at(this,r,t,n);case"ascii":case"latin1":case"binary":return ct(this,r,t,n);case"base64":return pt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lt(this,r,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0;}},o.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(e,r,t){return r===0&&t===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(r,t))}function br(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i<t;){let s=e[i],a=null,d=s>239?4:s>223?3:s>191?2:1;if(i+d<=t){let x,I,U,y;switch(d){case 1:s<128&&(a=s);break;case 2:x=e[i+1],(x&192)===128&&(y=(s&31)<<6|x&63,y>127&&(a=y));break;case 3:x=e[i+1],I=e[i+2],(x&192)===128&&(I&192)===128&&(y=(s&15)<<12|(x&63)<<6|I&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:x=e[i+1],I=e[i+2],U=e[i+3],(x&192)===128&&(I&192)===128&&(U&192)===128&&(y=(s&15)<<18|(x&63)<<12|(I&63)<<6|U&63,y>65535&&y<1114112&&(a=y));}}a===null?(a=65533,d=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=d;}return ht(n)}let Nr=4096;function ht(e){let r=e.length;if(r<=Nr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=Nr));return t}function dt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function mt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function wt(e,r,t){let n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);let i="";for(let s=r;s<t;++s)i+=At[e[s]];return i}function gt(e,r,t){let n=e.slice(r,t),i="";for(let s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}o.prototype.slice=function(r,t){let n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);let i=this.subarray(r,t);return Object.setPrototypeOf(i,o.prototype),i};function N(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],s=1,a=0;for(;++a<t&&(s*=256);)i+=this[r+a]*s;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r+--t],s=1;for(;t>0&&(s*=256);)i+=this[r+--t]*s;return i},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,s=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<<BigInt(32))}),o.prototype.readBigUInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],s=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return (BigInt(i)<<BigInt(32))+BigInt(s)}),o.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],s=1,a=0;for(;++a<t&&(s*=256);)i+=this[r+a]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=t,s=1,a=this[r+--i];for(;i>0&&(s*=256);)a+=this[r+--i]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return (BigInt(i)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),o.prototype.readBigInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return (BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)}),o.prototype.readFloatLE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!1,52,8)};function $(e,r,t,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<s)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let d=Math.pow(2,8*n)-1;$(this,r,t,n,d,0);}let s=1,a=0;for(this[t]=r&255;++a<n&&(s*=256);)this[t+a]=r/s&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let d=Math.pow(2,8*n)-1;$(this,r,t,n,d,0);}let s=n-1,a=1;for(this[t+s]=r&255;--s>=0&&(a*=256);)this[t+s]=r/a&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function vr(e,r,t,n,i){Fr(r,n,i,e,t,7);let s=Number(r&BigInt(4294967295));e[t++]=s,s=s>>8,e[t++]=s,s=s>>8,e[t++]=s,s=s>>8,e[t++]=s;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,t}function Mr(e,r,t,n,i){Fr(r,n,i,e,t,7);let s=Number(r&BigInt(4294967295));e[t+7]=s,s=s>>8,e[t+6]=s,s=s>>8,e[t+5]=s,s=s>>8,e[t+4]=s;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=a,a=a>>8,e[t+2]=a,a=a>>8,e[t+1]=a,a=a>>8,e[t]=a,t+8}o.prototype.writeBigUInt64LE=Y(function(r,t=0){return vr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Y(function(r,t=0){return Mr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let s=0,a=1,d=0;for(this[t]=r&255;++s<n&&(a*=256);)r<0&&d===0&&this[t+s-1]!==0&&(d=1),this[t+s]=(r/a>>0)-d&255;return t+n},o.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let s=n-1,a=1,d=0;for(this[t+s]=r&255;--s>=0&&(a*=256);)r<0&&d===0&&this[t+s+1]!==0&&(d=1),this[t+s]=(r/a>>0)-d&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=Y(function(r,t=0){return vr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Y(function(r,t=0){return Mr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cr(e,r,t,n,i,s){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Lr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,4),c.write(e,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return Lr(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return Lr(this,r,t,!1,n)};function Dr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,8),c.write(e,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return Dr(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return Dr(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,i){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);let s=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),s},o.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){let a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a);}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let s;if(typeof r=="number")for(s=t;s<n;++s)this[s]=r;else {let a=o.isBuffer(r)?r:o.from(r,i),d=a.length;if(d===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(s=0;s<n-t;++s)this[s+t]=a[s%d];}return this};let Z={};function mr(e,r,t){Z[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name;}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0});}toString(){return `${this.name} [${e}]: ${this.message}`}};}mr("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),mr("ERR_INVALID_ARG_TYPE",function(e,r){return `The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError),mr("ERR_OUT_OF_RANGE",function(e,r,t){let n=`The value of "${e}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=$r(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=$r(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function $r(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return `${e.slice(0,t)}${r}`}function yt(e,r,t){rr(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&er(r,e.length-(t+1));}function Fr(e,r,t,n,i,s){if(e>t||e<r){let a=typeof r=="bigint"?"n":"",d;throw r===0||r===BigInt(0)?d=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:d=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`,new Z.ERR_OUT_OF_RANGE("value",d,e)}yt(n,i,s);}function rr(e,r){if(typeof e!="number")throw new Z.ERR_INVALID_ARG_TYPE(r,"number",e)}function er(e,r,t){throw Math.floor(e)!==e?(rr(e,t),new Z.ERR_OUT_OF_RANGE("offset","an integer",e)):r<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${r}`,e)}let Et=/[^+/0-9A-Za-z-_]/g;function It(e){if(e=e.split("=")[0],e=e.trim().replace(Et,""),e.length<2)return "";for(;e.length%4!==0;)e=e+"=";return e}function wr(e,r){r=r||1/0;let t,n=e.length,i=null,s=[];for(let a=0;a<n;++a){if(t=e.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536;}else i&&(r-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;s.push(t);}else if(t<2048){if((r-=2)<0)break;s.push(t>>6|192,t&63|128);}else if(t<65536){if((r-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128);}else if(t<1114112){if((r-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128);}else throw new Error("Invalid code point")}return s}function Bt(e){let r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Tt(e,r){let t,n,i,s=[];for(let a=0;a<e.length&&!((r-=2)<0);++a)t=e.charCodeAt(a),n=t>>8,i=t%256,s.push(i),s.push(n);return s}function Or(e){return u.toByteArray(It(e))}function ar(e,r,t,n){let i;for(i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function O(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function gr(e){return e!==e}let At=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i];}return r}();function Y(e){return typeof BigInt>"u"?xt:e}function xt(){throw new Error("BigInt not supported")}return j$9}var X$7=Ge$7();X$7.Buffer;X$7.SlowBuffer;X$7.INSPECT_MAX_BYTES;X$7.kMaxLength;var S$b=X$7.Buffer;X$7.INSPECT_MAX_BYTES;X$7.kMaxLength;var Ur$3={};St$2(Ur$3,{deleteItem:()=>We$8,getItem:()=>fr$3,setItem:()=>or$5});var ir$5=()=>typeof window>"u",lr$4=()=>!ir$5();var Ye$7="__IMX-",Ar$4=()=>lr$4()&&window.localStorage,Ke$4=u=>{if(u!==null)try{return JSON.parse(u)}catch{return u}},He$6=u=>typeof u=="string"?u:JSON.stringify(u),xr$4=u=>`${Ye$7}${u}`;function fr$3(u){if(Ar$4())return Ke$4(window.localStorage.getItem(xr$4(u)))}var or$5=(u,c)=>Ar$4()?(window.localStorage.setItem(xr$4(u),He$6(c)),!0):!1,We$8=u=>Ar$4()?(window.localStorage.removeItem(xr$4(u)),!0):!1;var Sr$3=0,Wr$1=u=>{let c=parseInt(u,10)*1e3,p=new Date(c),l=new Date;return Sr$3=p.getTime()-l.getTime(),Sr$3},jr$3=()=>{let u=new Date().getTime()+Sr$3;return new Date(u).toISOString()};var sr$5=(E=>(E.RUNTIME_ID="rid",E.PASSPORT_CLIENT_ID="passportClientId",E.ENVIRONMENT="env",E.PUBLISHABLE_API_KEY="pak",E.IDENTITY="uid",E.DOMAIN="domain",E.SDK_VERSION="sdkVersion",E))(sr$5||{});var Xe$6="https://api.immutable.com";async function hr$5(u,c){let p=axios$1.create({baseURL:Xe$6}),l=JSON.stringify(c),m={payload:S$b.from(l).toString("base64")};return (await p.post(u,m)).data}var q$b,J$6,qe$6=()=>{q$b=fr$3("metrics-events")||[],J$6=fr$3("metrics-runtime")||{};};qe$6();var V$b=(u,c)=>{J$6={...J$6,[u]:c},or$5("metrics-runtime",J$6);},ur$4=u=>{if(J$6[u]!==void 0)return J$6[u]},Xr$1=()=>J$6,qr$2=()=>q$b,Jr$2=u=>{q$b.push(u),or$5("metrics-events",q$b);},zr$2=u=>{q$b=q$b.slice(u),or$5("metrics-events",q$b);},dr$5=u=>{let c=[];return Object.entries(u).forEach(([p,l])=>{(typeof p=="string"||typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&c.push([p,l.toString()]);}),c};var kr$3="2.0.2-alpha.3",Je$5=()=>ir$5()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"",ze$6=()=>{if(ir$5())return "";let u;try{window.self!==window.top&&(u=Je$5());}catch{}return u||(u=window.location.hostname),u},Qe$6=()=>{if(V$b("sdkVersion",kr$3),ir$5())return {browser:"nodejs",sdkVersion:kr$3};let u=ze$6();return u&&V$b("domain",u),{sdkVersion:kr$3,browser:window.navigator.userAgent,domain:u,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}},_r$3=!1,Qr$2=()=>_r$3,Zr$1=async()=>{_r$3=!0;try{let u=dr$5(Qe$6()),c=ur$4("rid"),p=ur$4("uid"),m=await hr$5("/v1/sdk/initialise",{version:1,data:{runtimeDetails:u,runtimeId:c,uId:p}}),{runtimeId:w,sTime:o}=m;V$b("rid",w),Wr$1(o);}catch{_r$3=!1;}};function R$6(u,c){return (...p)=>{try{let l=u(...p);return l instanceof Promise?l.catch(()=>c):l}catch{return c}}}function Ze$5(){return lr$4()||typeof T$a>"u"?!1:T$a.env.JEST_WORKER_ID!==void 0}var rt$5=R$6(Ze$5,!1);var et$5="imtbl__metrics",tn$2=5e3,en$2=1e3,z$d=(u,c)=>getGlobalisedValue_1(et$5,u,c),nt$4=(u,c)=>{let p=memorise(c,{lruOptions:{ttl:tn$2,max:en$2}});return getGlobalisedValue_1(et$5,u,p)};var nn$1=5e3,on$1=(u,c,p)=>{let l={event:`${u}.${c}`,time:jr$3(),...p&&{properties:dr$5(p)}};Jr$2(l);},Q$a=R$6(nt$4("track",on$1)),sn$1=async()=>{if(Qr$2()===!1){await Zr$1();return}let u=qr$2();if(u.length===0)return;let c=u.length,p=Xr$1();await hr$5("/v1/sdk/metrics",{version:1,data:{events:u,details:p}})instanceof Error||zr$2(c);},un=R$6(sn$1),ot$4=async()=>{await un(),setTimeout(ot$4,nn$1);},it$3=!1,an$1=()=>{it$3||(it$3=!0,ot$4());};rt$5()||R$6(z$d("startFlushing",an$1))();var Pr$4=(u,c,p,l)=>Q$a(u,c,{...l||{},duration:Math.round(p)});var st$5=()=>{let u=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return `${u()}${u()}-${u()}-${u()}-${u()}-${u()}${u()}${u()}`};var cn$1=(...u)=>{if(!u.some(l=>!!l))return {};let p={};return u.forEach(l=>{l&&(p={...p,...l});}),p},pn$1=u=>u.replace(/[^a-zA-Z0-9\s\-_]/g,""),ln$1=(u,c)=>`${u}_${pn$1(c)}`,fn=(u,c,p=!0,l)=>{let m=st$5(),w=Date.now(),o=0,E=0,b={},C=(..._)=>cn$1(b,..._,{flowId:m,flowName:c});b=C(l);let B=_=>{_&&(b=C(_));},k=(_,f)=>{let h=ln$1(c,_),g=0,A=performance.now();o>0&&(g=A-E);let v=C(f,{flowEventName:_,flowStep:o});Pr$4(u,h,g,v),o++,E=A;};return p&&k("Start"),{details:{moduleName:u,flowName:c,flowId:m,flowStartTime:w},addEvent:R$6(k),addFlowProperties:R$6(B)}},hn=R$6(fn);var dn$2=(u,c,p,l)=>{let{message:m}=p,w=p.stack||"",{cause:o}=p;o instanceof Error&&(w=`${w}
|
|
4140
|
+
var Ut$3=Object.defineProperty;var St$2=(u,c)=>{for(var p in c)Ut$3(u,p,{get:c[p],enumerable:!0});};function Br$2(u){throw new Error("Node.js process "+u+" is not supported by JSPM core outside of Node.js")}var G$8=[],tr$3=!1,W$7,cr$6=-1;function kt$3(){!tr$3||!W$7||(tr$3=!1,W$7.length?G$8=W$7.concat(G$8):cr$6=-1,G$8.length&&Vr$2());}function Vr$2(){if(!tr$3){var u=setTimeout(kt$3,0);tr$3=!0;for(var c=G$8.length;c;){for(W$7=G$8,G$8=[];++cr$6<c;)W$7&&W$7[cr$6].run();cr$6=-1,c=G$8.length;}W$7=null,tr$3=!1,clearTimeout(u);}}function _t$3(u){var c=new Array(arguments.length-1);if(arguments.length>1)for(var p=1;p<arguments.length;p++)c[p-1]=arguments[p];G$8.push(new Gr$2(u,c)),G$8.length===1&&!tr$3&&setTimeout(Vr$2,0);}function Gr$2(u,c){this.fun=u,this.array=c;}Gr$2.prototype.run=function(){this.fun.apply(null,this.array);};var Pt$3="browser",Rt$3="x64",bt$3="browser",Nt$3={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},vt$2=["/usr/bin/node"],Mt$2=[],Ct$4="v16.8.0",Lt$4={},Dt$3=function(u,c){console.warn((c?c+": ":"")+u);},$t$4=function(u){Br$2("binding");},Ft$3=function(u){return 0},Ot$4=function(){return "/"},Vt$2=function(u){},Gt$4={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};function M$9(){}var Yt$4=M$9,Kt$6=[];function Ht$4(u){Br$2("_linkedBinding");}var Wt$4={},jt$4=!1,Xt$6={};function qt$4(u){Br$2("dlopen");}function Jt$6(){return []}function zt$4(){return []}var Qt$3=M$9,Zt$4=M$9,Tr$3=function(){return {}},re$a=Tr$3,te$7=Tr$3,ee$6=M$9,ne$7=M$9,ie$8=M$9,oe$9={};function se$7(u,c){if(!u)throw new Error(c||"assertion error")}var ue$6={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ae$5=M$9,ce$6=M$9;function pe$5(){return !1}var le$6=M$9,fe$7=M$9,he$5=M$9,de$7=M$9,me$7=M$9,we$7=void 0,ge$6=void 0,ye$8=void 0,Ee$6=M$9,Ie$4=2,Be$7=1,Te$3="/bin/usr/node",Ae$6=9229,xe$6="node",Ue$7=[],Se$5=M$9,K$b={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};K$b.now===void 0&&(yr$4=Date.now(),K$b.timing&&K$b.timing.navigationStart&&(yr$4=K$b.timing.navigationStart),K$b.now=()=>Date.now()-yr$4);var yr$4;function ke$7(){return K$b.now()/1e3}var Er$3=1e9;function Ir$3(u){var c=Math.floor((Date.now()-K$b.now())*.001),p=K$b.now()*.001,l=Math.floor(p)+c,m=Math.floor(p%1*1e9);return u&&(l=l-u[0],m=m-u[1],m<0&&(l--,m+=Er$3)),[l,m]}Ir$3.bigint=function(u){var c=Ir$3(u);return typeof BigInt>"u"?c[0]*Er$3+c[1]:BigInt(c[0]*Er$3)+BigInt(c[1])};var _e$6=10,Pe$6={},Re$8=0;function H$8(){return T$a}var be$6=H$8,Ne$4=H$8,ve$7=H$8,Me$5=H$8,Ce$6=H$8,Le$6=M$9,De$7=H$8,$e$7=H$8;function Fe$5(u){return []}var T$a={version:Ct$4,versions:Lt$4,arch:Rt$3,platform:bt$3,release:Gt$4,_rawDebug:Yt$4,moduleLoadList:Kt$6,binding:$t$4,_linkedBinding:Ht$4,_events:Pe$6,_eventsCount:Re$8,_maxListeners:_e$6,on:H$8,addListener:be$6,once:Ne$4,off:ve$7,removeListener:Me$5,removeAllListeners:Ce$6,emit:Le$6,prependListener:De$7,prependOnceListener:$e$7,listeners:Fe$5,domain:Wt$4,_exiting:jt$4,config:Xt$6,dlopen:qt$4,uptime:ke$7,_getActiveRequests:Jt$6,_getActiveHandles:zt$4,reallyExit:Qt$3,_kill:Zt$4,cpuUsage:Tr$3,resourceUsage:re$a,memoryUsage:te$7,kill:ee$6,exit:ne$7,openStdin:ie$8,allowedNodeEnvironmentFlags:oe$9,assert:se$7,features:ue$6,_fatalExceptions:ae$5,setUncaughtExceptionCaptureCallback:ce$6,hasUncaughtExceptionCaptureCallback:pe$5,emitWarning:Dt$3,nextTick:_t$3,_tickCallback:le$6,_debugProcess:fe$7,_debugEnd:he$5,_startProfilerIdleNotifier:de$7,_stopProfilerIdleNotifier:me$7,stdout:we$7,stdin:ye$8,stderr:ge$6,abort:Ee$6,umask:Ft$3,chdir:Vt$2,cwd:Ot$4,env:Nt$3,title:Pt$3,argv:vt$2,execArgv:Mt$2,pid:Ie$4,ppid:Be$7,execPath:Te$3,debugPort:Ae$6,hrtime:Ir$3,argv0:xe$6,_preload_modules:Ue$7,setSourceMapsEnabled:Se$5};var nr$5={},Yr$1=!1;function Oe$5(){if(Yr$1)return nr$5;Yr$1=!0,nr$5.byteLength=E,nr$5.toByteArray=C,nr$5.fromByteArray=_;for(var u=[],c=[],p=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m=0,w=l.length;m<w;++m)u[m]=l[m],c[l.charCodeAt(m)]=m;c[45]=62,c[95]=63;function o(f){var h=f.length;if(h%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var g=f.indexOf("=");g===-1&&(g=h);var A=g===h?0:4-g%4;return [g,A]}function E(f){var h=o(f),g=h[0],A=h[1];return (g+A)*3/4-A}function b(f,h,g){return (h+g)*3/4-g}function C(f){var h,g=o(f),A=g[0],v=g[1],P=new p(b(f,A,v)),D=0,F=v>0?A-4:A,L;for(L=0;L<F;L+=4)h=c[f.charCodeAt(L)]<<18|c[f.charCodeAt(L+1)]<<12|c[f.charCodeAt(L+2)]<<6|c[f.charCodeAt(L+3)],P[D++]=h>>16&255,P[D++]=h>>8&255,P[D++]=h&255;return v===2&&(h=c[f.charCodeAt(L)]<<2|c[f.charCodeAt(L+1)]>>4,P[D++]=h&255),v===1&&(h=c[f.charCodeAt(L)]<<10|c[f.charCodeAt(L+1)]<<4|c[f.charCodeAt(L+2)]>>2,P[D++]=h>>8&255,P[D++]=h&255),P}function B(f){return u[f>>18&63]+u[f>>12&63]+u[f>>6&63]+u[f&63]}function k(f,h,g){for(var A,v=[],P=h;P<g;P+=3)A=(f[P]<<16&16711680)+(f[P+1]<<8&65280)+(f[P+2]&255),v.push(B(A));return v.join("")}function _(f){for(var h,g=f.length,A=g%3,v=[],P=16383,D=0,F=g-A;D<F;D+=P)v.push(k(f,D,D+P>F?F:D+P));return A===1?(h=f[g-1],v.push(u[h>>2]+u[h<<4&63]+"==")):A===2&&(h=(f[g-2]<<8)+f[g-1],v.push(u[h>>10]+u[h>>4&63]+u[h<<2&63]+"=")),v.join("")}return nr$5}var pr$5={},Kr$3=!1;function Ve$5(){if(Kr$3)return pr$5;Kr$3=!0;return pr$5.read=function(u,c,p,l,m){var w,o,E=m*8-l-1,b=(1<<E)-1,C=b>>1,B=-7,k=p?m-1:0,_=p?-1:1,f=u[c+k];for(k+=_,w=f&(1<<-B)-1,f>>=-B,B+=E;B>0;w=w*256+u[c+k],k+=_,B-=8);for(o=w&(1<<-B)-1,w>>=-B,B+=l;B>0;o=o*256+u[c+k],k+=_,B-=8);if(w===0)w=1-C;else {if(w===b)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,l),w=w-C;}return (f?-1:1)*o*Math.pow(2,w-l)},pr$5.write=function(u,c,p,l,m,w){var o,E,b,C=w*8-m-1,B=(1<<C)-1,k=B>>1,_=m===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=l?0:w-1,h=l?1:-1,g=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(E=isNaN(c)?1:0,o=B):(o=Math.floor(Math.log(c)/Math.LN2),c*(b=Math.pow(2,-o))<1&&(o--,b*=2),o+k>=1?c+=_/b:c+=_*Math.pow(2,1-k),c*b>=2&&(o++,b/=2),o+k>=B?(E=0,o=B):o+k>=1?(E=(c*b-1)*Math.pow(2,m),o=o+k):(E=c*Math.pow(2,k-1)*Math.pow(2,m),o=0));m>=8;u[p+f]=E&255,f+=h,E/=256,m-=8);for(o=o<<m|E,C+=m;C>0;u[p+f]=o&255,f+=h,o/=256,C-=8);u[p+f-h]|=g*128;},pr$5}var j$9={},Hr$2=!1;function Ge$7(){if(Hr$2)return j$9;Hr$2=!0;let u=Oe$5(),c=Ve$5(),p=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;j$9.Buffer=o,j$9.SlowBuffer=v,j$9.INSPECT_MAX_BYTES=50;let l=2147483647;j$9.kMaxLength=l,o.TYPED_ARRAY_SUPPORT=m(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function m(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return !1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function w(e){if(e>l)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,o.prototype),r}function o(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return B(e)}return E(e,r,t)}o.poolSize=8192;function E(e,r,t){if(typeof e=="string")return k(e,r);if(ArrayBuffer.isView(e))return f(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(O(e,ArrayBuffer)||e&&O(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(e,SharedArrayBuffer)||e&&O(e.buffer,SharedArrayBuffer)))return h(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return o.from(n,r,t);let i=g(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return o.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}o.from=function(e,r,t){return E(e,r,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function b(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function C(e,r,t){return b(e),e<=0?w(e):r!==void 0?typeof t=="string"?w(e).fill(r,t):w(e).fill(r):w(e)}o.alloc=function(e,r,t){return C(e,r,t)};function B(e){return b(e),w(e<0?0:A(e)|0)}o.allocUnsafe=function(e){return B(e)},o.allocUnsafeSlow=function(e){return B(e)};function k(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=P(e,r)|0,n=w(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function _(e){let r=e.length<0?0:A(e.length)|0,t=w(r);for(let n=0;n<r;n+=1)t[n]=e[n]&255;return t}function f(e){if(O(e,Uint8Array)){let r=new Uint8Array(e);return h(r.buffer,r.byteOffset,r.byteLength)}return _(e)}function h(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,o.prototype),n}function g(e){if(o.isBuffer(e)){let r=A(e.length)|0,t=w(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||gr(e.length)?w(0):_(e);if(e.type==="Buffer"&&Array.isArray(e.data))return _(e.data)}function A(e){if(e>=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return e|0}function v(e){return +e!=e&&(e=0),o.alloc(+e)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,i=t.length;for(let s=0,a=Math.min(n,i);s<a;++s)if(r[s]!==t[s]){n=r[s],i=t[s];break}return n<i?-1:i<n?1:0},o.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return !0;default:return !1}},o.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return o.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;let i=o.allocUnsafe(t),s=0;for(n=0;n<r.length;++n){let a=r[n];if(O(a,Uint8Array))s+a.length>i.length?(o.isBuffer(a)||(a=o.from(a)),a.copy(i,s)):Uint8Array.prototype.set.call(i,a,s);else if(o.isBuffer(a))a.copy(i,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length;}return i};function P(e,r){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||O(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return wr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Or(e).length;default:if(i)return n?-1:wr(e).length;r=(""+r).toLowerCase(),i=!0;}}o.byteLength=P;function D(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return "";for(e||(e="utf8");;)switch(e){case"hex":return wt(this,r,t);case"utf8":case"utf-8":return br(this,r,t);case"ascii":return dt(this,r,t);case"latin1":case"binary":return mt(this,r,t);case"base64":return ft(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gt(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0;}}o.prototype._isBuffer=!0;function F(e,r,t){let n=e[r];e[r]=e[t],e[t]=n;}o.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)F(this,t,t+1);return this},o.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)F(this,t,t+3),F(this,t+1,t+2);return this},o.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)F(this,t,t+7),F(this,t+1,t+6),F(this,t+2,t+5),F(this,t+3,t+4);return this},o.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?br(this,0,r):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(r){if(!o.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:o.compare(this,r)===0},o.prototype.inspect=function(){let r="",t=j$9.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"},p&&(o.prototype[p]=o.prototype.inspect),o.prototype.compare=function(r,t,n,i,s){if(O(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||n>r.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=n)return 0;if(i>=s)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,s>>>=0,this===r)return 0;let a=s-i,d=n-t,x=Math.min(a,d),I=this.slice(i,s),U=r.slice(t,n);for(let y=0;y<x;++y)if(I[y]!==U[y]){a=I[y],d=U[y];break}return a<d?-1:d<a?1:0};function L(e,r,t,n,i){if(e.length===0)return -1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,gr(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return -1;t=e.length-1;}else if(t<0)if(i)t=0;else return -1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:Rr(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Rr(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Rr(e,r,t,n,i){let s=1,a=e.length,d=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return -1;s=2,a/=2,d/=2,t/=2;}function x(U,y){return s===1?U[y]:U.readUInt16BE(y*s)}let I;if(i){let U=-1;for(I=t;I<a;I++)if(x(e,I)===x(r,U===-1?0:I-U)){if(U===-1&&(U=I),I-U+1===d)return U*s}else U!==-1&&(I-=I-U),U=-1;}else for(t+d>a&&(t=a-d),I=t;I>=0;I--){let U=!0;for(let y=0;y<d;y++)if(x(e,I+y)!==x(r,y)){U=!1;break}if(U)return I}return -1}o.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},o.prototype.indexOf=function(r,t,n){return L(this,r,t,n,!0)},o.prototype.lastIndexOf=function(r,t,n){return L(this,r,t,n,!1)};function ut(e,r,t,n){t=Number(t)||0;let i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let s=r.length;n>s/2&&(n=s/2);let a;for(a=0;a<n;++a){let d=parseInt(r.substr(a*2,2),16);if(gr(d))return a;e[t+a]=d;}return a}function at(e,r,t,n){return ar(wr(r,e.length-t),e,t,n)}function ct(e,r,t,n){return ar(Bt(r),e,t,n)}function pt(e,r,t,n){return ar(Or(r),e,t,n)}function lt(e,r,t,n){return ar(Tt(r,e.length-t),e,t,n)}o.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-t;if((n===void 0||n>s)&&(n=s),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return ut(this,r,t,n);case"utf8":case"utf-8":return at(this,r,t,n);case"ascii":case"latin1":case"binary":return ct(this,r,t,n);case"base64":return pt(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lt(this,r,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0;}},o.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(e,r,t){return r===0&&t===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(r,t))}function br(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i<t;){let s=e[i],a=null,d=s>239?4:s>223?3:s>191?2:1;if(i+d<=t){let x,I,U,y;switch(d){case 1:s<128&&(a=s);break;case 2:x=e[i+1],(x&192)===128&&(y=(s&31)<<6|x&63,y>127&&(a=y));break;case 3:x=e[i+1],I=e[i+2],(x&192)===128&&(I&192)===128&&(y=(s&15)<<12|(x&63)<<6|I&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:x=e[i+1],I=e[i+2],U=e[i+3],(x&192)===128&&(I&192)===128&&(U&192)===128&&(y=(s&15)<<18|(x&63)<<12|(I&63)<<6|U&63,y>65535&&y<1114112&&(a=y));}}a===null?(a=65533,d=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=d;}return ht(n)}let Nr=4096;function ht(e){let r=e.length;if(r<=Nr)return String.fromCharCode.apply(String,e);let t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=Nr));return t}function dt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function mt(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function wt(e,r,t){let n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);let i="";for(let s=r;s<t;++s)i+=At[e[s]];return i}function gt(e,r,t){let n=e.slice(r,t),i="";for(let s=0;s<n.length-1;s+=2)i+=String.fromCharCode(n[s]+n[s+1]*256);return i}o.prototype.slice=function(r,t){let n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);let i=this.subarray(r,t);return Object.setPrototypeOf(i,o.prototype),i};function N(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],s=1,a=0;for(;++a<t&&(s*=256);)i+=this[r+a]*s;return i},o.prototype.readUintBE=o.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r+--t],s=1;for(;t>0&&(s*=256);)i+=this[r+--t]*s;return i},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||N(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,s=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(s)<<BigInt(32))}),o.prototype.readBigUInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],s=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return (BigInt(i)<<BigInt(32))+BigInt(s)}),o.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=this[r],s=1,a=0;for(;++a<t&&(s*=256);)i+=this[r+a]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||N(r,t,this.length);let i=t,s=1,a=this[r+--i];for(;i>0&&(s*=256);)a+=this[r+--i]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(r,t){return r=r>>>0,t||N(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||N(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||N(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return (BigInt(i)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)}),o.prototype.readBigInt64BE=Y(function(r){r=r>>>0,rr(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&er(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return (BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)}),o.prototype.readFloatLE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||N(r,4,this.length),c.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||N(r,8,this.length),c.read(this,r,!1,52,8)};function $(e,r,t,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<s)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let d=Math.pow(2,8*n)-1;$(this,r,t,n,d,0);}let s=1,a=0;for(this[t]=r&255;++a<n&&(s*=256);)this[t+a]=r/s&255;return t+n},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let d=Math.pow(2,8*n)-1;$(this,r,t,n,d,0);}let s=n-1,a=1;for(this[t+s]=r&255;--s>=0&&(a*=256);)this[t+s]=r/a&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function vr(e,r,t,n,i){Fr(r,n,i,e,t,7);let s=Number(r&BigInt(4294967295));e[t++]=s,s=s>>8,e[t++]=s,s=s>>8,e[t++]=s,s=s>>8,e[t++]=s;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,t}function Mr(e,r,t,n,i){Fr(r,n,i,e,t,7);let s=Number(r&BigInt(4294967295));e[t+7]=s,s=s>>8,e[t+6]=s,s=s>>8,e[t+5]=s,s=s>>8,e[t+4]=s;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=a,a=a>>8,e[t+2]=a,a=a>>8,e[t+1]=a,a=a>>8,e[t]=a,t+8}o.prototype.writeBigUInt64LE=Y(function(r,t=0){return vr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Y(function(r,t=0){return Mr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let s=0,a=1,d=0;for(this[t]=r&255;++s<n&&(a*=256);)r<0&&d===0&&this[t+s-1]!==0&&(d=1),this[t+s]=(r/a>>0)-d&255;return t+n},o.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let x=Math.pow(2,8*n-1);$(this,r,t,n,x-1,-x);}let s=n-1,a=1,d=0;for(this[t+s]=r&255;--s>=0&&(a*=256);)r<0&&d===0&&this[t+s+1]!==0&&(d=1),this[t+s]=(r/a>>0)-d&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||$(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=Y(function(r,t=0){return vr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Y(function(r,t=0){return Mr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cr(e,r,t,n,i,s){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Lr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,4),c.write(e,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return Lr(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return Lr(this,r,t,!1,n)};function Dr(e,r,t,n,i){return r=+r,t=t>>>0,i||Cr(e,r,t,8),c.write(e,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return Dr(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return Dr(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,i){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);let s=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),s},o.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){let a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a);}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let s;if(typeof r=="number")for(s=t;s<n;++s)this[s]=r;else {let a=o.isBuffer(r)?r:o.from(r,i),d=a.length;if(d===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(s=0;s<n-t;++s)this[s+t]=a[s%d];}return this};let Z={};function mr(e,r,t){Z[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name;}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0});}toString(){return `${this.name} [${e}]: ${this.message}`}};}mr("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),mr("ERR_INVALID_ARG_TYPE",function(e,r){return `The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError),mr("ERR_OUT_OF_RANGE",function(e,r,t){let n=`The value of "${e}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=$r(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=$r(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function $r(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return `${e.slice(0,t)}${r}`}function yt(e,r,t){rr(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&er(r,e.length-(t+1));}function Fr(e,r,t,n,i,s){if(e>t||e<r){let a=typeof r=="bigint"?"n":"",d;throw r===0||r===BigInt(0)?d=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:d=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`,new Z.ERR_OUT_OF_RANGE("value",d,e)}yt(n,i,s);}function rr(e,r){if(typeof e!="number")throw new Z.ERR_INVALID_ARG_TYPE(r,"number",e)}function er(e,r,t){throw Math.floor(e)!==e?(rr(e,t),new Z.ERR_OUT_OF_RANGE("offset","an integer",e)):r<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${r}`,e)}let Et=/[^+/0-9A-Za-z-_]/g;function It(e){if(e=e.split("=")[0],e=e.trim().replace(Et,""),e.length<2)return "";for(;e.length%4!==0;)e=e+"=";return e}function wr(e,r){r=r||1/0;let t,n=e.length,i=null,s=[];for(let a=0;a<n;++a){if(t=e.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&s.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536;}else i&&(r-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;s.push(t);}else if(t<2048){if((r-=2)<0)break;s.push(t>>6|192,t&63|128);}else if(t<65536){if((r-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128);}else if(t<1114112){if((r-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128);}else throw new Error("Invalid code point")}return s}function Bt(e){let r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Tt(e,r){let t,n,i,s=[];for(let a=0;a<e.length&&!((r-=2)<0);++a)t=e.charCodeAt(a),n=t>>8,i=t%256,s.push(i),s.push(n);return s}function Or(e){return u.toByteArray(It(e))}function ar(e,r,t,n){let i;for(i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function O(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function gr(e){return e!==e}let At=function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i];}return r}();function Y(e){return typeof BigInt>"u"?xt:e}function xt(){throw new Error("BigInt not supported")}return j$9}var X$7=Ge$7();X$7.Buffer;X$7.SlowBuffer;X$7.INSPECT_MAX_BYTES;X$7.kMaxLength;var S$b=X$7.Buffer;X$7.INSPECT_MAX_BYTES;X$7.kMaxLength;var Ur$3={};St$2(Ur$3,{deleteItem:()=>We$8,getItem:()=>fr$3,setItem:()=>or$5});var ir$5=()=>typeof window>"u",lr$4=()=>!ir$5();var Ye$7="__IMX-",Ar$4=()=>lr$4()&&window.localStorage,Ke$4=u=>{if(u!==null)try{return JSON.parse(u)}catch{return u}},He$6=u=>typeof u=="string"?u:JSON.stringify(u),xr$4=u=>`${Ye$7}${u}`;function fr$3(u){if(Ar$4())return Ke$4(window.localStorage.getItem(xr$4(u)))}var or$5=(u,c)=>Ar$4()?(window.localStorage.setItem(xr$4(u),He$6(c)),!0):!1,We$8=u=>Ar$4()?(window.localStorage.removeItem(xr$4(u)),!0):!1;var Sr$3=0,Wr$1=u=>{let c=parseInt(u,10)*1e3,p=new Date(c),l=new Date;return Sr$3=p.getTime()-l.getTime(),Sr$3},jr$3=()=>{let u=new Date().getTime()+Sr$3;return new Date(u).toISOString()};var sr$5=(E=>(E.RUNTIME_ID="rid",E.PASSPORT_CLIENT_ID="passportClientId",E.ENVIRONMENT="env",E.PUBLISHABLE_API_KEY="pak",E.IDENTITY="uid",E.DOMAIN="domain",E.SDK_VERSION="sdkVersion",E))(sr$5||{});var Xe$6="https://api.immutable.com";async function hr$5(u,c){let p=axios$1.create({baseURL:Xe$6}),l=JSON.stringify(c),m={payload:S$b.from(l).toString("base64")};return (await p.post(u,m)).data}var q$b,J$6,qe$6=()=>{q$b=fr$3("metrics-events")||[],J$6=fr$3("metrics-runtime")||{};};qe$6();var V$b=(u,c)=>{J$6={...J$6,[u]:c},or$5("metrics-runtime",J$6);},ur$4=u=>{if(J$6[u]!==void 0)return J$6[u]},Xr$1=()=>J$6,qr$2=()=>q$b,Jr$2=u=>{q$b.push(u),or$5("metrics-events",q$b);},zr$2=u=>{q$b=q$b.slice(u),or$5("metrics-events",q$b);},dr$5=u=>{let c=[];return Object.entries(u).forEach(([p,l])=>{(typeof p=="string"||typeof l=="string"||typeof l=="number"||typeof l=="boolean")&&c.push([p,l.toString()]);}),c};var kr$3="2.0.2-alpha.5",Je$5=()=>ir$5()?"":window.location.ancestorOrigins&&window.location.ancestorOrigins.length>0?new URL(window.location.ancestorOrigins[0]).hostname:document.referrer?new URL(window.document.referrer).hostname:"",ze$6=()=>{if(ir$5())return "";let u;try{window.self!==window.top&&(u=Je$5());}catch{}return u||(u=window.location.hostname),u},Qe$6=()=>{if(V$b("sdkVersion",kr$3),ir$5())return {browser:"nodejs",sdkVersion:kr$3};let u=ze$6();return u&&V$b("domain",u),{sdkVersion:kr$3,browser:window.navigator.userAgent,domain:u,tz:Intl.DateTimeFormat().resolvedOptions().timeZone,screen:`${window.screen.width}x${window.screen.height}`}},_r$3=!1,Qr$2=()=>_r$3,Zr$1=async()=>{_r$3=!0;try{let u=dr$5(Qe$6()),c=ur$4("rid"),p=ur$4("uid"),m=await hr$5("/v1/sdk/initialise",{version:1,data:{runtimeDetails:u,runtimeId:c,uId:p}}),{runtimeId:w,sTime:o}=m;V$b("rid",w),Wr$1(o);}catch{_r$3=!1;}};function R$6(u,c){return (...p)=>{try{let l=u(...p);return l instanceof Promise?l.catch(()=>c):l}catch{return c}}}function Ze$5(){return lr$4()||typeof T$a>"u"?!1:T$a.env.JEST_WORKER_ID!==void 0}var rt$5=R$6(Ze$5,!1);var et$5="imtbl__metrics",tn$2=5e3,en$2=1e3,z$d=(u,c)=>getGlobalisedValue_1(et$5,u,c),nt$4=(u,c)=>{let p=memorise(c,{lruOptions:{ttl:tn$2,max:en$2}});return getGlobalisedValue_1(et$5,u,p)};var nn$1=5e3,on$1=(u,c,p)=>{let l={event:`${u}.${c}`,time:jr$3(),...p&&{properties:dr$5(p)}};Jr$2(l);},Q$a=R$6(nt$4("track",on$1)),sn$1=async()=>{if(Qr$2()===!1){await Zr$1();return}let u=qr$2();if(u.length===0)return;let c=u.length,p=Xr$1();await hr$5("/v1/sdk/metrics",{version:1,data:{events:u,details:p}})instanceof Error||zr$2(c);},un=R$6(sn$1),ot$4=async()=>{await un(),setTimeout(ot$4,nn$1);},it$3=!1,an$1=()=>{it$3||(it$3=!0,ot$4());};rt$5()||R$6(z$d("startFlushing",an$1))();var Pr$4=(u,c,p,l)=>Q$a(u,c,{...l||{},duration:Math.round(p)});var st$5=()=>{let u=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return `${u()}${u()}-${u()}-${u()}-${u()}-${u()}${u()}${u()}`};var cn$1=(...u)=>{if(!u.some(l=>!!l))return {};let p={};return u.forEach(l=>{l&&(p={...p,...l});}),p},pn$1=u=>u.replace(/[^a-zA-Z0-9\s\-_]/g,""),ln$1=(u,c)=>`${u}_${pn$1(c)}`,fn=(u,c,p=!0,l)=>{let m=st$5(),w=Date.now(),o=0,E=0,b={},C=(..._)=>cn$1(b,..._,{flowId:m,flowName:c});b=C(l);let B=_=>{_&&(b=C(_));},k=(_,f)=>{let h=ln$1(c,_),g=0,A=performance.now();o>0&&(g=A-E);let v=C(f,{flowEventName:_,flowStep:o});Pr$4(u,h,g,v),o++,E=A;};return p&&k("Start"),{details:{moduleName:u,flowName:c,flowId:m,flowStartTime:w},addEvent:R$6(k),addFlowProperties:R$6(B)}},hn=R$6(fn);var dn$2=(u,c,p,l)=>{let{message:m}=p,w=p.stack||"",{cause:o}=p;o instanceof Error&&(w=`${w}
|
|
4141
4141
|
Cause: ${o.message}
|
|
4142
4142
|
${o.stack}`),Q$a(u,`trackError_${c}`,{...l||{},errorMessage:m,errorStack:w,isTrackError:!0});},mn$1=R$6(dn$2);var En$2=u=>{V$b("env",u);},In$1=R$6(z$d("setEnvironment",En$2)),Bn=u=>{V$b("passportClientId",u);};R$6(z$d("setPassportClientId",Bn));var An=u=>{V$b("pak",u);};R$6(z$d("setPublishableApiKey",An));R$6(z$d("getDetail",ur$4));
|
|
4143
4143
|
|
|
@@ -107475,14 +107475,14 @@ Cause: ${o.message}
|
|
|
107475
107475
|
},
|
|
107476
107476
|
swapForm: {
|
|
107477
107477
|
from: {
|
|
107478
|
-
label: "
|
|
107478
|
+
label: "Sell",
|
|
107479
107479
|
inputPlaceholder: "0",
|
|
107480
|
-
selectorTitle: "What are you
|
|
107480
|
+
selectorTitle: "What are you selling?"
|
|
107481
107481
|
},
|
|
107482
107482
|
to: {
|
|
107483
|
-
label: "
|
|
107483
|
+
label: "Buy",
|
|
107484
107484
|
inputPlaceholder: "0",
|
|
107485
|
-
selectorTitle: "What are you
|
|
107485
|
+
selectorTitle: "What are you buying?"
|
|
107486
107486
|
},
|
|
107487
107487
|
buttonText: "Swap",
|
|
107488
107488
|
conversionRate: "1 {{fromSymbol}} ≈ {{rate}} {{toSymbol}}, inclusive of {{fee}}% fee"
|
|
@@ -107493,8 +107493,8 @@ Cause: ${o.message}
|
|
|
107493
107493
|
validation: {
|
|
107494
107494
|
noAmountInputted: "Please input amount",
|
|
107495
107495
|
insufficientBalance: "Insufficient balance",
|
|
107496
|
-
noFromTokenSelected: "Select a token to
|
|
107497
|
-
noToTokenSelected: "Select a token to
|
|
107496
|
+
noFromTokenSelected: "Select a token to sell",
|
|
107497
|
+
noToTokenSelected: "Select a token to buy"
|
|
107498
107498
|
},
|
|
107499
107499
|
success: {
|
|
107500
107500
|
text: "Success",
|
|
@@ -382809,7 +382809,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
382809
382809
|
return (jsxs(Drawer, { headerBarTitle: heading, size: "full", onCloseDrawer: handleCloseDrawer, visible: visible, children: [jsx$1(Drawer.Target, { children: children }), jsx$1(Drawer.Content, { children: jsxs(Box, { sx: selectOptionsContainerStyles, children: [optionsLoading && options.length === 0 && (jsxs(Box, { sx: selectOptionsLoadingIconStyles, children: [jsx$1(MenuItem, { shimmer: true, emphasized: true, testId: "balance-item-shimmer--1" }), jsx$1(MenuItem, { shimmer: true, emphasized: true, testId: "balance-item-shimmer--2" }), jsx$1(MenuItem, { shimmer: true, emphasized: true, testId: "balance-item-shimmer--3" })] })), !optionsLoading && options.length === 0 && (jsx$1(Body, { sx: { padding: 'base.spacing.x4' }, children: t('drawers.coinSelector.noCoins') })), !optionsLoading ? (jsxs(Fragment$1, { children: [jsx$1(TextInput, { sx: { marginBottom: 'base.spacing.x4', minWidth: '100%' }, testId: "search-text", onChange: (event) => handleOnChange(event), sizeVariant: "large", value: searchValue, inputMode: "search", placeholder: "name/symbol/contract address", onClearValue: () => setSearchValue(''), hideClearValueButton: false, autoFocus: true, children: jsx$1(TextInput.Icon, { icon: "Search" }) }), filteredOptions.map(({ onClick, icon, name, symbol, balance, id, testId, }) => (jsx$1(CoinSelectorOption, { id: id, testId: testId, onClick: onClick, icon: icon, name: name, symbol: symbol, balance: balance, defaultTokenImage: defaultTokenImage }, `${symbol}-${name}`)))] })) : null] }) })] }));
|
|
382810
382810
|
}
|
|
382811
382811
|
|
|
382812
|
-
function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange, textAlign, errorMessage, disabled, selectedOption, coinSelectorHeading, defaultTokenImage, environment = K$a.PRODUCTION, theme = xo$2.DARK, }) {
|
|
382812
|
+
function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange, textAlign, errorMessage, disabled, selectedOption, coinSelectorHeading, defaultTokenImage, userJourney, screen, control, environment = K$a.PRODUCTION, theme = xo$2.DARK, }) {
|
|
382813
|
+
const { track } = useAnalytics();
|
|
382813
382814
|
const [coinSelectorOpen, setCoinSelectorOpen] = reactExports.useState(false);
|
|
382814
382815
|
const coinSelectorOptions = reactExports.useMemo(() => options.map((option) => ({
|
|
382815
382816
|
...option,
|
|
@@ -382828,8 +382829,18 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
382828
382829
|
return undefined;
|
|
382829
382830
|
return selectedOption;
|
|
382830
382831
|
};
|
|
382831
|
-
const filteredOption = options
|
|
382832
|
-
|
|
382832
|
+
const filteredOption = options.find((o) => o.id === selectedOption) ?? selectedOption;
|
|
382833
|
+
const openCoinSelector = reactExports.useCallback(() => {
|
|
382834
|
+
setCoinSelectorOpen(true);
|
|
382835
|
+
track({
|
|
382836
|
+
userJourney,
|
|
382837
|
+
screen,
|
|
382838
|
+
control,
|
|
382839
|
+
controlType: 'Select',
|
|
382840
|
+
action: 'Opened',
|
|
382841
|
+
});
|
|
382842
|
+
}, [setCoinSelectorOpen, track]);
|
|
382843
|
+
return (jsxs(Box, { children: [jsx$1(CoinSelector, { heading: coinSelectorHeading, options: coinSelectorOptions, defaultTokenImage: defaultTokenImage, optionsLoading: optionsLoading ?? false, visible: coinSelectorOpen, onCloseDrawer: () => setCoinSelectorOpen(false) }), jsx$1(FormControlWrapper, { testId: `${testId}-select-control`, textAlign: textAlign ?? 'left', subtext: errorMessage ? undefined : subtext, isErrored: !!errorMessage, errorMessage: errorMessage, children: jsx$1(Select, { testId: `${testId}-select`, size: "large", defaultLabel: "Select token", targetClickOveride: openCoinSelector, selectedOption: getSelectedOption(), sx: { minw: '170px' }, children: filteredOption && (jsxs(Select.Option, { optionKey: filteredOption.id, testId: filteredOption.testId,
|
|
382833
382844
|
// select cannot currently be disabled so disabling at the option level for now
|
|
382834
382845
|
disabled: disabled, children: [!filteredOption.icon && (jsx$1(Select.Option.Icon, { icon: "Coins", variant: "bold" })), filteredOption.icon && (jsx$1(Select.Option.FramedImage, { use: (jsx$1(TokenImage, { environment: environment, theme: theme, src: filteredOption.icon, name: filteredOption.name })), circularFrame: true, sx: { background: 'base.color.translucent.standard.100' } })), jsx$1(Select.Option.Label, { children: filteredOption.symbol })] }, filteredOption.id)) }) })] }));
|
|
382835
382846
|
}
|
|
@@ -383144,7 +383155,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
383144
383155
|
setShowTxnRejectedState(false);
|
|
383145
383156
|
await submitBridgeValues();
|
|
383146
383157
|
};
|
|
383147
|
-
return (jsxs(Box, { testId: testId, sx: bridgeFormWrapperStyles, children: [jsxs(Box, { sx: { paddingX: 'base.spacing.x4' }, children: [jsx$1(Heading, { testId: `${testId}-content-heading`, size: "small", weight: "regular", sx: { paddingBottom: 'base.spacing.x4' }, children: t('views.BRIDGE_FORM.content.title') }), (!defaultTokenAddress || !isTokenBalancesLoading) && (jsxs(Box, { sx: formInputsContainerStyles, children: [jsx$1(SelectForm, { testId: "bridge-token", options: tokensOptions, optionsLoading: isTokenBalancesLoading, coinSelectorHeading: t('views.BRIDGE_FORM.bridgeForm.from.selectorTitle'), selectedOption: selectedOption, subtext: tokenBalanceSubtext, textAlign: "left", errorMessage: t(tokenError), onSelectChange: (option) => handleSelectTokenChange(option), defaultTokenImage: defaultTokenImage, environment: environment, theme: theme }), jsx$1(TextInputForm, { testId: "bridge-amount", type: "number", value: formAmount, placeholder: t('views.BRIDGE_FORM.bridgeForm.from.inputPlaceholder'), subtext: `${t('views.BRIDGE_FORM.content.fiatPricePrefix')} $${formatZeroAmount(amountFiatValue, true)}`, validator: amountInputValidation, onTextInputChange: (value) => handleBridgeAmountChange(value), onTextInputEnter: submitBridgeValues, textAlign: "right", inputMode: "decimal", errorMessage: t(amountError) })] })), defaultTokenAddress && isTokenBalancesLoading && (jsx$1(TokenSelectShimmer, { sx: formInputsContainerStyles }))] }), jsxs(Box, { sx: bridgeFormButtonContainerStyles, children: [jsx$1(Button, { testId: `${testId}-button`, variant: "primary", onClick: submitBridgeValues, size: "large", children: t('views.BRIDGE_FORM.bridgeForm.buttonText') }), jsx$1(TransactionRejected, { visible: showTxnRejectedState, showHeaderBar: false, onCloseDrawer: () => setShowTxnRejectedState(false), onRetry: retrySubmitBridgeValues })] })] }));
|
|
383158
|
+
return (jsxs(Box, { testId: testId, sx: bridgeFormWrapperStyles, children: [jsxs(Box, { sx: { paddingX: 'base.spacing.x4' }, children: [jsx$1(Heading, { testId: `${testId}-content-heading`, size: "small", weight: "regular", sx: { paddingBottom: 'base.spacing.x4' }, children: t('views.BRIDGE_FORM.content.title') }), (!defaultTokenAddress || !isTokenBalancesLoading) && (jsxs(Box, { sx: formInputsContainerStyles, children: [jsx$1(SelectForm, { userJourney: UserJourney.BRIDGE, screen: "TokenAmount", control: "FromToken", testId: "bridge-token", options: tokensOptions, optionsLoading: isTokenBalancesLoading, coinSelectorHeading: t('views.BRIDGE_FORM.bridgeForm.from.selectorTitle'), selectedOption: selectedOption, subtext: tokenBalanceSubtext, textAlign: "left", errorMessage: t(tokenError), onSelectChange: (option) => handleSelectTokenChange(option), defaultTokenImage: defaultTokenImage, environment: environment, theme: theme }), jsx$1(TextInputForm, { testId: "bridge-amount", type: "number", value: formAmount, placeholder: t('views.BRIDGE_FORM.bridgeForm.from.inputPlaceholder'), subtext: `${t('views.BRIDGE_FORM.content.fiatPricePrefix')} $${formatZeroAmount(amountFiatValue, true)}`, validator: amountInputValidation, onTextInputChange: (value) => handleBridgeAmountChange(value), onTextInputEnter: submitBridgeValues, textAlign: "right", inputMode: "decimal", errorMessage: t(amountError) })] })), defaultTokenAddress && isTokenBalancesLoading && (jsx$1(TokenSelectShimmer, { sx: formInputsContainerStyles }))] }), jsxs(Box, { sx: bridgeFormButtonContainerStyles, children: [jsx$1(Button, { testId: `${testId}-button`, variant: "primary", onClick: submitBridgeValues, size: "large", children: t('views.BRIDGE_FORM.bridgeForm.buttonText') }), jsx$1(TransactionRejected, { visible: showTxnRejectedState, showHeaderBar: false, onCloseDrawer: () => setShowTxnRejectedState(false), onRetry: retrySubmitBridgeValues })] })] }));
|
|
383148
383159
|
}
|
|
383149
383160
|
|
|
383150
383161
|
// Inspired by https://usehooks-ts.com/react-hook/use-interval
|
|
@@ -384763,8 +384774,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
384763
384774
|
flex: 2,
|
|
384764
384775
|
};
|
|
384765
384776
|
|
|
384766
|
-
function SelectInput({ testId, options, textInputValue, textInputPlaceholder, textInputValidator, textInputType, onTextInputChange, onTextInputBlur, onTextInputFocus, textInputTextAlign, textInputSubtext, textInputErrorMessage, testInputMode, selectTextAlign, selectSubtext, selectErrorMessage, textInputMaxButtonClick, onSelectChange, textInputDisabled, selectInputDisabled, selectedOption, coinSelectorHeading, defaultTokenImage, environment, theme, }) {
|
|
384767
|
-
return (jsxs(Box, { sx: selectInputBoxStyle, children: [jsx$1(Box, { sx: selectStyle, children: jsx$1(SelectForm, { testId: `${testId}-select-form`, options: options, subtext: selectSubtext, textAlign: selectTextAlign, errorMessage: selectErrorMessage, onSelectChange: onSelectChange, disabled: selectInputDisabled, selectedOption: selectedOption, coinSelectorHeading: coinSelectorHeading, defaultTokenImage: defaultTokenImage, environment: environment, theme: theme }) }), jsx$1(Box, { sx: inputStyle, children: jsx$1(TextInputForm, { type: textInputType, testId: `${testId}-text-form`, value: textInputValue, placeholder: textInputPlaceholder, subtext: textInputSubtext, textAlign: textInputTextAlign, errorMessage: textInputErrorMessage, validator: textInputValidator, onTextInputChange: onTextInputChange, onTextInputBlur: onTextInputBlur, onTextInputFocus: onTextInputFocus, maxButtonClick: textInputMaxButtonClick, disabled: textInputDisabled, inputMode: testInputMode }) })] }));
|
|
384777
|
+
function SelectInput({ testId, options, textInputValue, textInputPlaceholder, textInputValidator, textInputType, onTextInputChange, onTextInputBlur, onTextInputFocus, textInputTextAlign, textInputSubtext, textInputErrorMessage, testInputMode, selectTextAlign, selectSubtext, selectErrorMessage, textInputMaxButtonClick, onSelectChange, textInputDisabled, selectInputDisabled, selectedOption, coinSelectorHeading, defaultTokenImage, userJourney, screen, control, environment, theme, }) {
|
|
384778
|
+
return (jsxs(Box, { sx: selectInputBoxStyle, children: [jsx$1(Box, { sx: selectStyle, children: jsx$1(SelectForm, { testId: `${testId}-select-form`, options: options, subtext: selectSubtext, textAlign: selectTextAlign, errorMessage: selectErrorMessage, onSelectChange: onSelectChange, disabled: selectInputDisabled, selectedOption: selectedOption, coinSelectorHeading: coinSelectorHeading, defaultTokenImage: defaultTokenImage, control: control, userJourney: userJourney, screen: screen, environment: environment, theme: theme }) }), jsx$1(Box, { sx: inputStyle, children: jsx$1(TextInputForm, { type: textInputType, testId: `${testId}-text-form`, value: textInputValue, placeholder: textInputPlaceholder, subtext: textInputSubtext, textAlign: textInputTextAlign, errorMessage: textInputErrorMessage, validator: textInputValidator, onTextInputChange: onTextInputChange, onTextInputBlur: onTextInputBlur, onTextInputFocus: onTextInputFocus, maxButtonClick: textInputMaxButtonClick, disabled: textInputDisabled, inputMode: testInputMode }) })] }));
|
|
384768
384779
|
}
|
|
384769
384780
|
|
|
384770
384781
|
function validateFromToken(fromToken) {
|
|
@@ -385837,7 +385848,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
385837
385848
|
: '', selectTextAlign: "left", textInputType: "number", testInputMode: "decimal", textInputValue: fromAmount, textInputPlaceholder: t('views.SWAP.swapForm.from.inputPlaceholder'), textInputSubtext: `${t('views.SWAP.content.fiatPricePrefix')}
|
|
385838
385849
|
$${formatZeroAmount(fromFiatValue, true)}`, textInputTextAlign: "right", textInputValidator: amountInputValidation, onTextInputChange: (v) => onFromTextInputChange(v), onTextInputFocus: onFromTextInputFocus, textInputMaxButtonClick: textInputMaxButtonClick, onSelectChange: onFromSelectChange, textInputErrorMessage: t(fromAmountError), selectErrorMessage: t(fromTokenError), selectedOption: fromToken
|
|
385839
385850
|
? formatTokenOptionsId(fromToken.symbol, fromToken.address)
|
|
385840
|
-
: undefined, coinSelectorHeading: t('views.SWAP.swapForm.from.selectorTitle'), defaultTokenImage: defaultTokenImage, environment: checkout?.config.environment, theme: theme })] }), jsxs(Box, { children: [jsxs(Box, { sx: {
|
|
385851
|
+
: undefined, coinSelectorHeading: t('views.SWAP.swapForm.from.selectorTitle'), defaultTokenImage: defaultTokenImage, control: "FromToken", userJourney: UserJourney.SWAP, screen: "SwapCoins", environment: checkout?.config.environment, theme: theme })] }), jsxs(Box, { children: [jsxs(Box, { sx: {
|
|
385841
385852
|
display: 'flex',
|
|
385842
385853
|
justifyContent: 'space-between',
|
|
385843
385854
|
paddingBottom: 'base.spacing.x1',
|
|
@@ -385845,7 +385856,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
385845
385856
|
w: 'base.icon.size.300',
|
|
385846
385857
|
} }) }), jsx$1(Tooltip.Content, { children: swapConversionRateTooltip })] }))] }), jsx$1(SelectInput, { testId: "toTokenInputs", options: tokensOptionsTo, selectTextAlign: "left", textInputType: "number", testInputMode: "decimal", textInputValue: toAmount, textInputPlaceholder: t('views.SWAP.swapForm.to.inputPlaceholder'), textInputTextAlign: "right", textInputValidator: amountInputValidation, onTextInputChange: (v) => onToTextInputChange(v), onTextInputFocus: onToTextInputFocus, onSelectChange: onToSelectChange, textInputErrorMessage: t(toAmountError), selectErrorMessage: t(toTokenError), selectedOption: toToken
|
|
385847
385858
|
? formatTokenOptionsId(toToken.symbol, toToken.address)
|
|
385848
|
-
: undefined, coinSelectorHeading: t('views.SWAP.swapForm.to.selectorTitle'), defaultTokenImage: defaultTokenImage, environment: checkout?.config.environment, theme: theme })] })] }), !isPassportProvider(provider) && (jsx$1(Fees, { gasFeeFiatValue: gasFeeFiatValue, gasFeeToken: gasFeeToken, gasFeeValue: gasFeeValue, fees: formattedFees, onFeesClick: () => {
|
|
385859
|
+
: undefined, coinSelectorHeading: t('views.SWAP.swapForm.to.selectorTitle'), defaultTokenImage: defaultTokenImage, control: "ToToken", userJourney: UserJourney.SWAP, screen: "SwapCoins", environment: checkout?.config.environment, theme: theme })] })] }), !isPassportProvider(provider) && (jsx$1(Fees, { gasFeeFiatValue: gasFeeFiatValue, gasFeeToken: gasFeeToken, gasFeeValue: gasFeeValue, fees: formattedFees, onFeesClick: () => {
|
|
385849
385860
|
track({
|
|
385850
385861
|
userJourney: UserJourney.SWAP,
|
|
385851
385862
|
screen: 'SwapCoins',
|
package/dist/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { dW as WidgetsFactory } from './index-
|
|
1
|
+
export { dW as WidgetsFactory } from './index-Crkt1BNU.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, dp as useBrowserLayoutEffect } from './index-
|
|
1
|
+
import { r as reactExports, dp as useBrowserLayoutEffect } from './index-Crkt1BNU.js';
|
|
2
2
|
|
|
3
3
|
// Inspired by https://usehooks-ts.com/react-hook/use-interval
|
|
4
4
|
function useInterval(callback, delay) {
|
|
@@ -2,6 +2,7 @@ import { OptionKey } from '@biom3/react';
|
|
|
2
2
|
import { Environment } from '@imtbl/config';
|
|
3
3
|
import { WidgetTheme } from '@imtbl/checkout-sdk';
|
|
4
4
|
import { CoinSelectorOptionProps } from '../../CoinSelector/CoinSelectorOption';
|
|
5
|
+
import { UserJourney } from '../../../context/analytics-provider/SegmentAnalyticsProvider';
|
|
5
6
|
interface SelectFormProps {
|
|
6
7
|
testId: string;
|
|
7
8
|
options: CoinSelectorOptionProps[];
|
|
@@ -14,8 +15,11 @@ interface SelectFormProps {
|
|
|
14
15
|
onSelectChange: (value: string) => void;
|
|
15
16
|
coinSelectorHeading: string;
|
|
16
17
|
defaultTokenImage: string;
|
|
18
|
+
userJourney: UserJourney;
|
|
19
|
+
screen: string;
|
|
20
|
+
control: string;
|
|
17
21
|
environment?: Environment;
|
|
18
22
|
theme?: WidgetTheme;
|
|
19
23
|
}
|
|
20
|
-
export declare function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange, textAlign, errorMessage, disabled, selectedOption, coinSelectorHeading, defaultTokenImage, environment, theme, }: SelectFormProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function SelectForm({ testId, options, optionsLoading, subtext, onSelectChange, textAlign, errorMessage, disabled, selectedOption, coinSelectorHeading, defaultTokenImage, userJourney, screen, control, environment, theme, }: SelectFormProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
21
25
|
export {};
|
|
@@ -3,6 +3,7 @@ import { WidgetTheme } from '@imtbl/checkout-sdk';
|
|
|
3
3
|
import { Environment } from '@imtbl/config';
|
|
4
4
|
import { InputMode, TextInputType } from '../TextInputForm/TextInputForm';
|
|
5
5
|
import { CoinSelectorOptionProps } from '../../CoinSelector/CoinSelectorOption';
|
|
6
|
+
import { UserJourney } from '../../../context/analytics-provider/SegmentAnalyticsProvider';
|
|
6
7
|
interface SelectInputProps {
|
|
7
8
|
testId: string;
|
|
8
9
|
options: CoinSelectorOptionProps[];
|
|
@@ -27,8 +28,11 @@ interface SelectInputProps {
|
|
|
27
28
|
onSelectChange: (value: OptionKey) => void;
|
|
28
29
|
selectedOption?: OptionKey;
|
|
29
30
|
defaultTokenImage: string;
|
|
31
|
+
userJourney: UserJourney;
|
|
32
|
+
screen: string;
|
|
33
|
+
control: string;
|
|
30
34
|
environment?: Environment;
|
|
31
35
|
theme?: WidgetTheme;
|
|
32
36
|
}
|
|
33
|
-
export declare function SelectInput({ testId, options, textInputValue, textInputPlaceholder, textInputValidator, textInputType, onTextInputChange, onTextInputBlur, onTextInputFocus, textInputTextAlign, textInputSubtext, textInputErrorMessage, testInputMode, selectTextAlign, selectSubtext, selectErrorMessage, textInputMaxButtonClick, onSelectChange, textInputDisabled, selectInputDisabled, selectedOption, coinSelectorHeading, defaultTokenImage, environment, theme, }: SelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function SelectInput({ testId, options, textInputValue, textInputPlaceholder, textInputValidator, textInputType, onTextInputChange, onTextInputBlur, onTextInputFocus, textInputTextAlign, textInputSubtext, textInputErrorMessage, testInputMode, selectTextAlign, selectSubtext, selectErrorMessage, textInputMaxButtonClick, onSelectChange, textInputDisabled, selectInputDisabled, selectedOption, coinSelectorHeading, defaultTokenImage, userJourney, screen, control, environment, theme, }: SelectInputProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
34
38
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imtbl/checkout-widgets",
|
|
3
|
-
"version": "2.0.2-alpha.
|
|
3
|
+
"version": "2.0.2-alpha.5",
|
|
4
4
|
"browserslist": {
|
|
5
5
|
"production": [
|
|
6
6
|
">0.2%",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"@biom3/design-tokens": "^0.4.5",
|
|
19
19
|
"@biom3/react": "^0.29.4",
|
|
20
20
|
"@emotion/react": "^11.11.3",
|
|
21
|
-
"@imtbl/bridge-sdk": "2.0.2-alpha.
|
|
22
|
-
"@imtbl/checkout-sdk": "2.0.2-alpha.
|
|
23
|
-
"@imtbl/config": "2.0.2-alpha.
|
|
24
|
-
"@imtbl/cryptofiat": "2.0.2-alpha.
|
|
25
|
-
"@imtbl/dex-sdk": "2.0.2-alpha.
|
|
26
|
-
"@imtbl/passport": "2.0.2-alpha.
|
|
21
|
+
"@imtbl/bridge-sdk": "2.0.2-alpha.5",
|
|
22
|
+
"@imtbl/checkout-sdk": "2.0.2-alpha.5",
|
|
23
|
+
"@imtbl/config": "2.0.2-alpha.5",
|
|
24
|
+
"@imtbl/cryptofiat": "2.0.2-alpha.5",
|
|
25
|
+
"@imtbl/dex-sdk": "2.0.2-alpha.5",
|
|
26
|
+
"@imtbl/passport": "2.0.2-alpha.5",
|
|
27
27
|
"@imtbl/react-analytics": "0.3.2-alpha",
|
|
28
28
|
"@rive-app/react-canvas-lite": "^4.9.0",
|
|
29
29
|
"@walletconnect/ethereum-provider": "^2.11.1",
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Select, Box, OptionKey,
|
|
3
3
|
} from '@biom3/react';
|
|
4
|
-
import { useMemo, useState } from 'react';
|
|
4
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
5
5
|
import { Environment } from '@imtbl/config';
|
|
6
6
|
import { WidgetTheme } from '@imtbl/checkout-sdk';
|
|
7
7
|
import { TokenImage } from '../../TokenImage/TokenImage';
|
|
8
8
|
import { FormControlWrapper } from '../FormControlWrapper/FormControlWrapper';
|
|
9
9
|
import { CoinSelector } from '../../CoinSelector/CoinSelector';
|
|
10
10
|
import { CoinSelectorOptionProps } from '../../CoinSelector/CoinSelectorOption';
|
|
11
|
+
import { useAnalytics, UserJourney } from '../../../context/analytics-provider/SegmentAnalyticsProvider';
|
|
11
12
|
|
|
12
13
|
interface SelectFormProps {
|
|
13
14
|
testId: string;
|
|
@@ -21,6 +22,9 @@ interface SelectFormProps {
|
|
|
21
22
|
onSelectChange: (value: string) => void;
|
|
22
23
|
coinSelectorHeading: string;
|
|
23
24
|
defaultTokenImage: string;
|
|
25
|
+
userJourney: UserJourney;
|
|
26
|
+
screen: string;
|
|
27
|
+
control: string;
|
|
24
28
|
environment?: Environment;
|
|
25
29
|
theme?: WidgetTheme,
|
|
26
30
|
}
|
|
@@ -37,9 +41,13 @@ export function SelectForm({
|
|
|
37
41
|
selectedOption,
|
|
38
42
|
coinSelectorHeading,
|
|
39
43
|
defaultTokenImage,
|
|
44
|
+
userJourney,
|
|
45
|
+
screen,
|
|
46
|
+
control,
|
|
40
47
|
environment = Environment.PRODUCTION,
|
|
41
48
|
theme = WidgetTheme.DARK,
|
|
42
49
|
}: SelectFormProps) {
|
|
50
|
+
const { track } = useAnalytics();
|
|
43
51
|
const [coinSelectorOpen, setCoinSelectorOpen] = useState<boolean>(false);
|
|
44
52
|
const coinSelectorOptions = useMemo(() => options.map((option) => ({
|
|
45
53
|
...option,
|
|
@@ -57,7 +65,18 @@ export function SelectForm({
|
|
|
57
65
|
return selectedOption;
|
|
58
66
|
};
|
|
59
67
|
|
|
60
|
-
const filteredOption = options
|
|
68
|
+
const filteredOption = options.find((o) => o.id === selectedOption) as CoinSelectorOptionProps ?? selectedOption;
|
|
69
|
+
|
|
70
|
+
const openCoinSelector = useCallback(() => {
|
|
71
|
+
setCoinSelectorOpen(true);
|
|
72
|
+
track({
|
|
73
|
+
userJourney,
|
|
74
|
+
screen,
|
|
75
|
+
control,
|
|
76
|
+
controlType: 'Select',
|
|
77
|
+
action: 'Opened',
|
|
78
|
+
});
|
|
79
|
+
}, [setCoinSelectorOpen, track]);
|
|
61
80
|
|
|
62
81
|
return (
|
|
63
82
|
<Box>
|
|
@@ -80,7 +99,7 @@ export function SelectForm({
|
|
|
80
99
|
testId={`${testId}-select`}
|
|
81
100
|
size="large"
|
|
82
101
|
defaultLabel="Select token"
|
|
83
|
-
targetClickOveride={
|
|
102
|
+
targetClickOveride={openCoinSelector}
|
|
84
103
|
selectedOption={getSelectedOption()}
|
|
85
104
|
sx={{ minw: '170px' }}
|
|
86
105
|
>
|
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
import { SelectForm } from '../SelectForm/SelectForm';
|
|
10
10
|
import { InputMode, TextInputForm, TextInputType } from '../TextInputForm/TextInputForm';
|
|
11
11
|
import { CoinSelectorOptionProps } from '../../CoinSelector/CoinSelectorOption';
|
|
12
|
+
import { UserJourney } from '../../../context/analytics-provider/SegmentAnalyticsProvider';
|
|
12
13
|
|
|
13
14
|
interface SelectInputProps {
|
|
15
|
+
|
|
14
16
|
testId: string;
|
|
15
17
|
options: CoinSelectorOptionProps[];
|
|
16
18
|
selectTextAlign?: 'left' | 'right';
|
|
@@ -34,6 +36,9 @@ interface SelectInputProps {
|
|
|
34
36
|
onSelectChange: (value: OptionKey) => void;
|
|
35
37
|
selectedOption?: OptionKey;
|
|
36
38
|
defaultTokenImage: string;
|
|
39
|
+
userJourney: UserJourney;
|
|
40
|
+
screen: string;
|
|
41
|
+
control: string;
|
|
37
42
|
environment?: Environment;
|
|
38
43
|
theme?: WidgetTheme;
|
|
39
44
|
}
|
|
@@ -62,6 +67,9 @@ export function SelectInput({
|
|
|
62
67
|
selectedOption,
|
|
63
68
|
coinSelectorHeading,
|
|
64
69
|
defaultTokenImage,
|
|
70
|
+
userJourney,
|
|
71
|
+
screen,
|
|
72
|
+
control,
|
|
65
73
|
environment,
|
|
66
74
|
theme,
|
|
67
75
|
}: SelectInputProps) {
|
|
@@ -79,6 +87,9 @@ export function SelectInput({
|
|
|
79
87
|
selectedOption={selectedOption}
|
|
80
88
|
coinSelectorHeading={coinSelectorHeading}
|
|
81
89
|
defaultTokenImage={defaultTokenImage}
|
|
90
|
+
control={control}
|
|
91
|
+
userJourney={userJourney}
|
|
92
|
+
screen={screen}
|
|
82
93
|
environment={environment}
|
|
83
94
|
theme={theme}
|
|
84
95
|
/>
|
package/src/locales/en.json
CHANGED
|
@@ -145,14 +145,14 @@
|
|
|
145
145
|
},
|
|
146
146
|
"swapForm": {
|
|
147
147
|
"from": {
|
|
148
|
-
"label": "
|
|
148
|
+
"label": "Sell",
|
|
149
149
|
"inputPlaceholder": "0",
|
|
150
|
-
"selectorTitle": "What are you
|
|
150
|
+
"selectorTitle": "What are you selling?"
|
|
151
151
|
},
|
|
152
152
|
"to": {
|
|
153
|
-
"label": "
|
|
153
|
+
"label": "Buy",
|
|
154
154
|
"inputPlaceholder": "0",
|
|
155
|
-
"selectorTitle": "What are you
|
|
155
|
+
"selectorTitle": "What are you buying?"
|
|
156
156
|
},
|
|
157
157
|
"buttonText": "Swap",
|
|
158
158
|
"conversionRate": "1 {{fromSymbol}} ≈ {{rate}} {{toSymbol}}, inclusive of {{fee}}% fee"
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
"validation": {
|
|
164
164
|
"noAmountInputted": "Please input amount",
|
|
165
165
|
"insufficientBalance": "Insufficient balance",
|
|
166
|
-
"noFromTokenSelected": "Select a token to
|
|
167
|
-
"noToTokenSelected": "Select a token to
|
|
166
|
+
"noFromTokenSelected": "Select a token to sell",
|
|
167
|
+
"noToTokenSelected": "Select a token to buy"
|
|
168
168
|
},
|
|
169
169
|
"success": {
|
|
170
170
|
"text": "Success",
|
|
@@ -326,6 +326,9 @@ export function BridgeForm(props: BridgeFormProps) {
|
|
|
326
326
|
{(!defaultTokenAddress || !isTokenBalancesLoading) && (
|
|
327
327
|
<Box sx={formInputsContainerStyles}>
|
|
328
328
|
<SelectForm
|
|
329
|
+
userJourney={UserJourney.BRIDGE}
|
|
330
|
+
screen="TokenAmount"
|
|
331
|
+
control="FromToken"
|
|
329
332
|
testId="bridge-token"
|
|
330
333
|
options={tokensOptions}
|
|
331
334
|
optionsLoading={isTokenBalancesLoading}
|
|
@@ -920,6 +920,9 @@ export function SwapForm({ data, theme, cancelAutoProceed }: SwapFromProps) {
|
|
|
920
920
|
: undefined}
|
|
921
921
|
coinSelectorHeading={t('views.SWAP.swapForm.from.selectorTitle')}
|
|
922
922
|
defaultTokenImage={defaultTokenImage}
|
|
923
|
+
control="FromToken"
|
|
924
|
+
userJourney={UserJourney.SWAP}
|
|
925
|
+
screen="SwapCoins"
|
|
923
926
|
environment={checkout?.config.environment}
|
|
924
927
|
theme={theme}
|
|
925
928
|
/>
|
|
@@ -971,6 +974,9 @@ export function SwapForm({ data, theme, cancelAutoProceed }: SwapFromProps) {
|
|
|
971
974
|
: undefined}
|
|
972
975
|
coinSelectorHeading={t('views.SWAP.swapForm.to.selectorTitle')}
|
|
973
976
|
defaultTokenImage={defaultTokenImage}
|
|
977
|
+
control="ToToken"
|
|
978
|
+
userJourney={UserJourney.SWAP}
|
|
979
|
+
screen="SwapCoins"
|
|
974
980
|
environment={checkout?.config.environment}
|
|
975
981
|
theme={theme}
|
|
976
982
|
/>
|