1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DyY49ZKk.js","assets/index-BUPDK_h2.js","assets/index-BXkGCamU.css"])))=>i.map(i=>d[i]); 2import{k as Cu,n as zv,o as Kl,p as pn,_ as g8}from"./index-BUPDK_h2.js";import{r as v8}from"./events-DQ172AOg.js";import{r as Ou}from"./inherits_browser-BICa84dG.js";var eh={},zt={},th,gp;function Us(){if(gp)return th;gp=1,th=r;function r(e,t){if(!e)throw new Error(t||"Assertion failed")}return r.equal=function(t,i,s){if(t!=i)throw new Error(s||"Assertion failed: "+t+" != "+i)},th}var vp;function En(){if(vp)return zt;vp=1;var r=Us(),e=Ou();zt.inherits=e;function t(w,c){return(w.charCodeAt(c)&64512)!==55296||c<0||c+1>=w.length?!1:(w.charCodeAt(c+1)&64512)===56320}function i(w,c){if(Array.isArray(w))return w.slice();if(!w)return[];var h=[];if(typeof w=="string")if(c){if(c==="hex")for(w=w.replace(/[^a-z0-9]+/ig,""),w.length%2!==0&&(w="0"+w),y=0;y<w.length;y+=2)h.push(parseInt(w[y]+w[y+1],16))}else for(var d=0,y=0;y<w.length;y++){var A=w.charCodeAt(y);A<128?h[d++]=A:A<2048?(h[d++]=A>>6|192,h[d++]=A&63|128):t(w,y)?(A=65536+((A&1023)<<10)+(w.charCodeAt(++y)&1023),h[d++]=A>>18|240,h[d++]=A>>12&63|128,h[d++]=A>>6&63|128,h[d++]=A&63|128):(h[d++]=A>>12|224,h[d++]=A>>6&63|128,h[d++]=A&63|128)}else for(y=0;y<w.length;y++)h[y]=w[y]|0;return h}zt.toArray=i;function s(w){for(var c="",h=0;h<w.length;h++)c+=l(w[h].toString(16));return c}zt.toHex=s;function a(w){var c=w>>>24|w>>>8&65280|w<<8&16711680|(w&255)<<24;return c>>>0}zt.htonl=a;function f(w,c){for(var h="",d=0;d<w.length;d++){var y=w[d];c==="little"&&(y=a(y)),h+=p(y.toString(16))}return h}zt.toHex32=f;function l(w){return w.length===1?"0"+w:w}zt.zero2=l;function p(w){return w.length===7?"0"+w:w.length===6?"00"+w:w.length===5?"000"+w:w.length===4?"0000"+w:w.length===3?"00000"+w:w.length===2?"000000"+w:w.length===1?"0000000"+w:w}zt.zero8=p;function u(w,c,h,d){var y=h-c;r(y%4===0);for(var A=new Array(y/4),D=0,x=c;D<A.length;D++,x+=4){var g;d==="big"?g=w[x]<<24|w[x+1]<<16|w[x+2]<<8|w[x+3]:g=w[x+3]<<24|w[x+2]<<16|w[x+1]<<8|w[x],A[D]=g>>>0}return A}zt.join32=u;function b(w,c){for(var h=new Array(w.length*4),d=0,y=0;d<w.length;d++,y+=4){var A=w[d];c==="big"?(h[y]=A>>>24,h[y+1]=A>>>16&255,h[y+2]=A>>>8&255,h[y+3]=A&255):(h[y+3]=A>>>24,h[y+2]=A>>>16&255,h[y+1]=A>>>8&255,h[y]=A&255)}return h}zt.split32=b;function _(w,c){return w>>>c|w<<32-c}zt.rotr32=_;function M(w,c){return w<<c|w>>>32-c}zt.rotl32=M;function I(w,c){return w+c>>>0}zt.sum32=I;function C(w,c,h){return w+c+h>>>0}zt.sum32_3=C;function R(w,c,h,d){return w+c+h+d>>>0}zt.sum32_4=R;function U(w,c,h,d,y){return w+c+h+d+y>>>0}zt.sum32_5=U;function V(w,c,h,d){var y=w[c],A=w[c+1],D=d+A>>>0,x=(D<d?1:0)+h+y;w[c]=x>>>0,w[c+1]=D}zt.sum64=V;function F(w,c,h,d){var y=c+d>>>0,A=(y<c?1:0)+w+h;return A>>>0}zt.sum64_hi=F;function K(w,c,h,d){var y=c+d;return y>>>0}zt.sum64_lo=K;function B(w,c,h,d,y,A,D,x){var g=0,m=c;m=m+d>>>0,g+=m<c?1:0,m=m+A>>>0,g+=m<A?1:0,m=m+x>>>0,g+=m<x?1:0;var N=w+h+y+D+g;return N>>>0}zt.sum64_4_hi=B;function j(w,c,h,d,y,A,D,x){var g=c+d+A+x;return g>>>0}zt.sum64_4_lo=j;function q(w,c,h,d,y,A,D,x,g,m){var N=0,Q=c;Q=Q+d>>>0,N+=Q<c?1:0,Q=Q+A>>>0,N+=Q<A?1:0,Q=Q+x>>>0,N+=Q<x?1:0,Q=Q+m>>>0,N+=Q<m?1:0;var re=w+h+y+D+g+N;return re>>>0}zt.sum64_5_hi=q;function E(w,c,h,d,y,A,D,x,g,m){var N=c+d+A+x+m;return N>>>0}zt.sum64_5_lo=E;function L(w,c,h){var d=c<<32-h|w>>>h;return d>>>0}zt.rotr64_hi=L;function te(w,c,h){var d=w<<32-h|c>>>h;return d>>>0}zt.rotr64_lo=te;function ae(w,c,h){return w>>>h}zt.shr64_hi=ae;function z(w,c,h){var d=w<<32-h|c>>>h;return d>>>0}return zt.shr64_lo=z,zt}var rh={},bp;function Co(){if(bp)return rh;bp=1;var r=En(),e=Us();function t(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}return rh.BlockHash=t,t.prototype.update=function(s,a){if(s=r.toArray(s,a),this.pending?this.pending=this.pending.concat(s):this.pending=s,this.pendingTotal+=s.length,this.pending.length>=this._delta8){s=this.pending;var f=s.length%this._delta8;this.pending=s.slice(s.length-f,s.length),this.pending.length===0&&(this.pending=null),s=r.join32(s,0,s.length-f,this.endian);for(var l=0;l<s.length;l+=this._delta32)this._update(s,l,l+this._delta32)}return this},t.prototype.digest=function(s){return this.update(this._pad()),e(this.pending===null),this._digest(s)},t.prototype._pad=function(){var s=this.pendingTotal,a=this._delta8,f=a-(s+this.padLength)%a,l=new Array(f+this.padLength);l[0]=128;for(var p=1;p<f;p++)l[p]=0;if(s<<=3,this.endian==="big"){for(var u=8;u<this.padLength;u++)l[p++]=0;l[p++]=0,l[p++]=0,l[p++]=0,l[p++]=0,l[p++]=s>>>24&255,l[p++]=s>>>16&255,l[p++]=s>>>8&255,l[p++]=s&255}else for(l[p++]=s&255,l[p++]=s>>>8&255,l[p++]=s>>>16&255,l[p++]=s>>>24&255,l[p++]=0,l[p++]=0,l[p++]=0,l[p++]=0,u=8;u<this.padLength;u++)l[p++]=0;return l},rh}var Ss={},on={},mp;function jv(){if(mp)return on;mp=1;var r=En(),e=r.rotr32;function t(b,_,M,I){if(b===0)return i(_,M,I);if(b===1||b===3)return a(_,M,I);if(b===2)return s(_,M,I)}on.ft_1=t;function i(b,_,M){return b&_^~b&M}on.ch32=i;function s(b,_,M){return b&_^b&M^_&M}on.maj32=s;function a(b,_,M){return b^_^M}on.p32=a;function f(b){return e(b,2)^e(b,13)^e(b,22)}on.s0_256=f;function l(b){return e(b,6)^e(b,11)^e(b,25)}on.s1_256=l;function p(b){return e(b,7)^e(b,18)^b>>>3}on.g0_256=p;function u(b){return e(b,17)^e(b,19)^b>>>10}return on.g1_256=u,on}var ih,yp;function b8(){if(yp)return ih;yp=1;var r=En(),e=Co(),t=jv(),i=r.rotl32,s=r.sum32,a=r.sum32_5,f=t.ft_1,l=e.BlockHash,p=[1518500249,1859775393,2400959708,3395469782];function u(){if(!(this instanceof u))return new u;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return r.inherits(u,l),ih=u,u.blockSize=512,u.outSize=160,u.hmacStrength=80,u.padLength=64,u.prototype._update=function(_,M){for(var I=this.W,C=0;C<16;C++)I[C]=_[M+C];for(;C<I.length;
2C++)I[C]=i(I[C-3]^I[C-8]^I[C-14]^I[C-16],1);var R=this.h[0],U=this.h[1],V=this.h[2],F=this.h[3],K=this.h[4];for(C=0;C<I.length;C++){var B=~~(C/20),j=a(i(R,5),f(B,U,V,F),K,I[C],p[B]);K=F,F=V,V=i(U,30),U=R,R=j}this.h[0]=s(this.h[0],R),this.h[1]=s(this.h[1],U),this.h[2]=s(this.h[2],V),this.h[3]=s(this.h[3],F),this.h[4]=s(this.h[4],K)},u.prototype._digest=function(_){return _==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},ih}var nh,wp;function $v(){if(wp)return nh;wp=1;var r=En(),e=Co(),t=jv(),i=Us(),s=r.sum32,a=r.sum32_4,f=r.sum32_5,l=t.ch32,p=t.maj32,u=t.s0_256,b=t.s1_256,_=t.g0_256,M=t.g1_256,I=e.BlockHash,C=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function R(){if(!(this instanceof R))return new R;I.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=C,this.W=new Array(64)}return r.inherits(R,I),nh=R,R.blockSize=512,R.outSize=256,R.hmacStrength=192,R.padLength=64,R.prototype._update=function(V,F){for(var K=this.W,B=0;B<16;B++)K[B]=V[F+B];for(;B<K.length;B++)K[B]=a(M(K[B-2]),K[B-7],_(K[B-15]),K[B-16]);var j=this.h[0],q=this.h[1],E=this.h[2],L=this.h[3],te=this.h[4],ae=this.h[5],z=this.h[6],w=this.h[7];for(i(this.k.length===K.length),B=0;B<K.length;B++){var c=f(w,b(te),l(te,ae,z),this.k[B],K[B]),h=s(u(j),p(j,q,E));w=z,z=ae,ae=te,te=s(L,c),L=E,E=q,q=j,j=s(c,h)}this.h[0]=s(this.h[0],j),this.h[1]=s(this.h[1],q),this.h[2]=s(this.h[2],E),this.h[3]=s(this.h[3],L),this.h[4]=s(this.h[4],te),this.h[5]=s(this.h[5],ae),this.h[6]=s(this.h[6],z),this.h[7]=s(this.h[7],w)},R.prototype._digest=function(V){return V==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},nh}var sh,_p;function m8(){if(_p)return sh;_p=1;var r=En(),e=$v();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return r.inherits(t,e),sh=t,t.blockSize=512,t.outSize=224,t.hmacStrength=192,t.padLength=64,t.prototype._digest=function(s){return s==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")},sh}var ah,Ap;function kv(){if(Ap)return ah;Ap=1;var r=En(),e=Co(),t=Us(),i=r.rotr64_hi,s=r.rotr64_lo,a=r.shr64_hi,f=r.shr64_lo,l=r.sum64,p=r.sum64_hi,u=r.sum64_lo,b=r.sum64_4_hi,_=r.sum64_4_lo,M=r.sum64_5_hi,I=r.sum64_5_lo,C=e.BlockHash,R=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
21322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function U(){if(!(this instanceof U))return new U;C.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=R,this.W=new Array(160)}r.inherits(U,C),ah=U,U.blockSize=1024,U.outSize=512,U.hmacStrength=192,U.padLength=128,U.prototype._prepareBlock=function(h,d){for(var y=this.W,A=0;A<32;A++)y[A]=h[d+A];for(;A<y.length;A+=2){var D=z(y[A-4],y[A-3]),x=w(y[A-4],y[A-3]),g=y[A-14],m=y[A-13],N=te(y[A-30],y[A-29]),Q=ae(y[A-30],y[A-29]),re=y[A-32],O=y[A-31];y[A]=b(D,x,g,m,N,Q,re,O),y[A+1]=_(D,x,g,m,N,Q,re,O)}},U.prototype._update=function(h,d){this._prepareBlock(h,d);var y=this.W,A=this.h[0],D=this.h[1],x=this.h[2],g=this.h[3],m=this.h[4],N=this.h[5],Q=this.h[6],re=this.h[7],O=this.h[8],Z=this.h[9],k=this.h[10],W=this.h[11],J=this.h[12],S=this.h[13],G=this.h[14],oe=this.h[15];t(this.k.length===y.length);for(var ce=0;ce<y.length;ce+=2){var fe=G,be=oe,we=E(O,Z),Ie=L(O,Z),Je=V(O,Z,k,W,J),Ce=F(O,Z,k,W,J,S),Te=this.k[ce],Se=this.k[ce+1],me=y[ce],Oe=y[ce+1],Re=M(fe,be,we,Ie,Je,Ce,Te,Se,me,Oe),ve=I(fe,be,we,Ie,Je,Ce,Te,Se,me,Oe);fe=j(A,D),be=q(A,D),we=K(A,D,x,g,m),Ie=B(A,D,x,g,m,N);var Ne=p(fe,be,we,Ie),Ee=u(fe,be,we,Ie);G=J,oe=S,J=k,S=W,k=O,W=Z,O=p(Q,re,Re,ve),Z=u(re,re,Re,ve),Q=m,re=N,m=x,N=g,x=A,g=D,A=p(Re,ve,Ne,Ee),D=u(Re,ve,Ne,Ee)}l(this.h,0,A,D),l(this.h,2,x,g),l(this.h,4,m,N),l(this.h,6,Q,re),l(this.h,8,O,Z),l(this.h,10,k,W),l(this.h,12,J,S),l(this.h,14,G,oe)},U.prototype._digest=function(h){return h==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")};function V(c,h,d,y,A){var D=c&d^~c&A;return D<0&&(D+=4294967296),D}function F(c,h,d,y,A,D){var x=h&y^~h&D;return x<0&&(x+=4294967296),x}function K(c,h,d,y,A){var D=c&d^c&A^d&A;return D<0&&(D+=4294967296),D}function B(c,h,d,y,A,D){var x=h&y^h&D^y&D;return x<0&&(x+=4294967296),x}function j(c,h){var d=i(c,h,28),y=i(h,c,2),A=i(h,c,7),D=d^y^A;return D<0&&(D+=4294967296),D}function q(c,h){var d=s(c,h,28),y=s(h,c,2),A=s(h,c,7),D=d^y^A;return D<0&&(D+=4294967296),D}function E(c,h){var d=i(c,h,14),y=i(c,h,18),A=i(h,c,9),D=d^y^A;return D<0&&(D+=4294967296),D}function L(c,h){var d=s(c,h,14),y=s(c,h,18),A=s(h,c,9),D=d^y^A;return D<0&&(D+=4294967296),D}function te(c,h){var d=i(c,h,1),y=i(c,h,8),A=a(c,h,7),D=d^y^A;return D<0&&(D+=4294967296),D}function ae(c,h){var d=s(c,h,1),y=s(c,h,8),A=f(c,h,7),D=d^y^A;return D<0&&(D+=4294967296),D}function z(c,h){var d=i(c,h,19),y=i(h,c,29),A=a(c,h,6),D=d^y^A;return D<0&&(D+=4294967296),D}function w(c,h){var d=s(c,h,19),y=s(h,c,29),A=f(c,h,6),D=d^y^A;return D<0&&(D+=4294967296),D}return ah}var oh,Ep;function y8(){if(Ep)return oh;Ep=1;var r=En(),e=kv();function t(){if(!(this instanceof t))return new t;e.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return r.inherits(t,e),oh=t,t.blockSize=1024,t.outSize=384,t.hmacStrength=192,t.padLength=128,t.prototype._digest=function(s){return s==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")},oh}var xp;function w8(){return xp||(xp=1,Ss.sha1=b8(),Ss.sha224=m8(),Ss.sha256=$v(),Ss.sha384=y8(),Ss.sha512=kv()),Ss}var ch={},Sp;function _8(){if(Sp)return ch;Sp=1;var r=En(),e=Co(),t=r.rotl32,i=r.sum32,s=r.sum32_3,a=r.sum32_4,f=e.BlockHash;function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}r.inherits(l,f),ch.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(U,V){for(var F=this.h[0],K=this.h[1],B=this.h[2],j=this.h[3],q=this.h[4],E=F,L=K,te=B,ae=j,z=q,w=0;w<80;w++){var c=i(t(a(F,p(w,K,B,j),U[_[w]+V],u(w)),I[w]),q);F=q,q=j,j=t(B,10),B=K,K=c,c=i(t(a(E,p(79-w,L,te,ae),U[M[w]+V],b(w)),C[w]),z),E=z,z=ae,ae=t(te,10),te=L,L=c}c=s(this.h[1],B,ae),this.h[1]=s(this.h[2],j,z),this.h[2]=s(this.h[3],q,E),this.h[3]=s(this.h[4],F,L),this.h[4]=s(this.h[0],K,te),this.h[0]=c},l.prototype._digest=function(U){return U==="hex"?r.toHex32(this.h,"little"):r.split32(this.h,"little")};function p(R,U,V,F){return R<=15?U^V^F:R<=31?U&V|~U&F:R<=47?(U|~V)^F:R<=63?U&F|V&~F:U^(V|~F)}function u(R){return R<=15?0:R<=31?1518500249:R<=47?1859775393:R<=63?2400959708:2840853838}function b(R){return R<=15?1352829926:R<=31?1548603684:R<=47?1836072691:R<=63?2053994217:0}var _=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],M=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],I=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],C=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];return ch}var uh,Mp;function A8(){if(Mp)return uh;Mp=1;var r=En(),e=Us();function t(i,s,a){if(!(this instanceof t))return new t(i,s,a);this.Hash=i,this.blockSize=i.blockSize/8,this.outSize=i.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(s,a))}return uh=t,t.prototype._init=function(s){s.length>this.blockSize&&(s=new this.Hash().update(s).digest()),e(s.length<=this.blockSize);for(var a=s.length;a<this.blockSize;a++)s.push(0);for(a=0;a<s.length;a++)s[a]^=54;for(this.inner=new this.Hash().update(s),a=0;a<s.length;a++)s[a]^=106;this.outer=new this.Hash().update(s)},t.prototype.update=function(s,a){return this.inner.update(s,a),this},t.prototype.digest=function(s){return this.outer.update(this.inner.digest()),this.outer.digest(s)},uh}var Ip;function Vl(){return Ip||(Ip=1,function(r){var e=r;e.utils=En(),e.common=Co(),e.sha=w8(),e.ripemd=_8(),e.hmac=A8(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(eh)),eh}var pi=v8();const Gl=Cu(pi);var Dp=function(r,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,a;i<s;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return r.concat(a||Array.prototype.slice.call(e))},E8=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),x8=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),S8=function(){function r(e,t,i,s){this.name=e,this.version=t,this.os=i,this.bot=s,this.type="bot-device"}return r}(),M8=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),I8=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),D8=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yaho
vendor: 10,090 bytes, lines 2-15
2o!|yandex/,P8=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Pp=3,C8=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",D8]],Cp=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function O8(r){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new I8:typeof navigator<"u"?N8(navigator.userAgent):q8()}function R8(r){return r!==""&&C8.reduce(function(e,t){var i=t[0],s=t[1];if(e)return e;var a=s.exec(r);return!!a&&[i,a]},!1)}function N8(r){var e=R8(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new M8;var s=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);s?s.length<Pp&&(s=Dp(Dp([],s,!0),F8(Pp-s.length),!0)):s=[];var a=s.join("."),f=T8(r),l=P8.exec(r);return l&&l[1]?new S8(t,a,f,l[1]):new E8(t,a,f)}function T8(r){for(var e=0,t=Cp.length;e<t;e++){var i=Cp[e],s=i[0],a=i[1],f=a.exec(r);if(f)return s}return null}function q8(){var r=typeof process<"u"&&process.version;return r?new x8(process.version.slice(1)):null}function F8(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}var fh={};/*! ***************************************************************************** 3Copyright (c) Microsoft Corporation. 4 5Permission to use, copy, modify, and/or distribute this software for any 6purpose with or without fee is hereby granted. 7 8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 9REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 10AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 11INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 12LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 13OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 14PERFORMANCE OF THIS SOFTWARE. 15***************************************************************************** */var El=function(r,e){return El=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},El(r,e)};function B8(r,e){El(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var xl=function(){return xl=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},xl.apply(this,arguments)};function L8(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function U8(r,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(f=r[l])&&(a=(s<3?f(a):s>3?f(e,t,a):f(e,t))||a);return s>3&&a&&Object.defineProperty(e,t,a),a}function z8(r,e){return function(t,i){e(t,i,r)}}function j8(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function $8(r,e,t,i){function s(a){return a instanceof t?a:new t(function(f){f(a)})}return new(t||(t=Promise))(function(a,f){function l(b){try{u(i.next(b))}catch(_){f(_)}}function p(b){try{u(i.throw(b))}catch(_){f(_)}}function u(b){b.done?a(b.value):s(b.value).then(l,p)}u((i=i.apply(r,e||[])).next())})}function k8(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,s,a,f;return f={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function l(u){return function(b){return p([u,b])}}function p(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(b){u=[6,b],s=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function H8(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function K8(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Sl(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hv(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,a=[],f;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)a.push(s.value)}catch(l){f={error:l}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return a}function V8(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(Hv(arguments[e]));return r}function G8(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var a=arguments[e],f=0,l=a.length;f<l;f++,s++)i[s]=a[f];return i}function xo(r){return this instanceof xo?(this.v=r,this):new xo(r)}function W8(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,a=[];return s={},f("next"),f("throw"),f("return"),s[Symbol.asyncIterator]=function(){return this},s;function f(M){i[M]&&(s[M]=function(I){return new Promise(function(C,R){a.push([M,I,C,R])>1||l(M,I)})})}function l(M,I){try{p(i[M](I))}catch(C){_(a[0][3],C)}}function p(M){M.value instanceof xo?Promise.resolve(M.value.v).then(u,b):_(a[0][2],M)}function u(M){l("next",M)}function b(M){l("throw",M)}function _(M,I){M(I),a.shift(),a.length&&l(a[0][0],a[0][1])}}function J8(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,a){e[s]=r[s]?function(f){return(t=!t)?{value:xo(r[s](f)),done:s==="return"}:a?a(f):f}:a}}function Y8(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Sl=="function"?Sl(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(f){return new Promise(function(l,p){f=r[a](f),s(l,p,f.done,f.value)})}}function s(a,f,l,p){Promise.resolve(p).then(function(u){a({value:u,done:l})},f)}}function Q8(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function X8(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function Z8(r){return r&&r.__esModule?r:{default:r}}function e4(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function t4(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const r4=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return xl},__asyncDelegator:J8,__asyncGenerator:W8,__asyncValues:Y8,__await:xo,__awaiter:$8,__classPrivateFieldGet:e4,__classPrivateFieldSet:t4,__createBinding:H8,__decorate:U8,__exportStar:K8,__extends:B8,__generator:k8,__importDefault:Z8,__importStar:X8,__makeTemplateOb
15ject:Q8,__metadata:j8,__param:z8,__read:Hv,__rest:L8,__spread:V8,__spreadArrays:G8,__values:Sl},Symbol.toStringTag,{value:"Module"})),Ru=zv(r4);var hh={},Ja={},Op;function i4(){if(Op)return Ja;Op=1,Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return Ja.delay=r,Ja}var Ms={},lh={},Is={},Rp;function n4(){return Rp||(Rp=1,Object.defineProperty(Is,"__esModule",{value:!0}),Is.ONE_THOUSAND=Is.ONE_HUNDRED=void 0,Is.ONE_HUNDRED=100,Is.ONE_THOUSAND=1e3),Is}var dh={},Np;function s4(){return Np||(Np=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(dh)),dh}var Tp;function Kv(){return Tp||(Tp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ru;e.__exportStar(n4(),r),e.__exportStar(s4(),r)}(lh)),lh}var qp;function a4(){if(qp)return Ms;qp=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.fromMiliseconds=Ms.toMiliseconds=void 0;const r=Kv();
vendor: 4,129 bytes, line 15
15function e(i){return i*r.ONE_THOUSAND}Ms.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return Ms.fromMiliseconds=t,Ms}var Fp;function o4(){return Fp||(Fp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ru;e.__exportStar(i4(),r),e.__exportStar(a4(),r)}(hh)),hh}var ua={},Bp;function c4(){if(Bp)return ua;Bp=1,Object.defineProperty(ua,"__esModule",{value:!0}),ua.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const s=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:s})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return ua.Watch=r,ua.default=r,ua}var ph={},Ya={},Lp;function u4(){if(Lp)return Ya;Lp=1,Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.IWatch=void 0;class r{}return Ya.IWatch=r,Ya}var Up;function f4(){return Up||(Up=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Ru.__exportStar(u4(),r)}(ph)),ph}var zp;function h4(){return zp||(zp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Ru;e.__exportStar(o4(),r),e.__exportStar(c4(),r),e.__exportStar(f4(),r),e.__exportStar(Kv(),r)}(fh)),fh}var Me=h4(),Kt={},jp;function Vv(){if(jp)return Kt;jp=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.getLocalStorage=Kt.getLocalStorageOrThrow=Kt.getCrypto=Kt.getCryptoOrThrow=Kt.getLocation=Kt.getLocationOrThrow=Kt.getNavigator=Kt.getNavigatorOrThrow=Kt.getDocument=Kt.getDocumentOrThrow=Kt.getFromWindowOrThrow=Kt.getFromWindow=void 0;function r(M){let I;return typeof window<"u"&&typeof window[M]<"u"&&(I=window[M]),I}Kt.getFromWindow=r;function e(M){const I=r(M);if(!I)throw new Error(`${M} is not defined in Window`);return I}Kt.getFromWindowOrThrow=e;function t(){return e("document")}Kt.getDocumentOrThrow=t;function i(){return r("document")}Kt.getDocument=i;function s(){return e("navigator")}Kt.getNavigatorOrThrow=s;function a(){return r("navigator")}Kt.getNavigator=a;function f(){return e("location")}Kt.getLocationOrThrow=f;function l(){return r("location")}Kt.getLocation=l;function p(){return e("crypto")}Kt.getCryptoOrThrow=p;function u(){return r("crypto")}Kt.getCrypto=u;function b(){return e("localStorage")}Kt.getLocalStorageOrThrow=b;function _(){return r("localStorage")}return Kt.getLocalStorage=_,Kt}var ya=Vv(),Qa={},$p;function l4(){if($p)return Qa;$p=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.getWindowMetadata=void 0;const r=Vv();function e(){let t,i;try{t=r.getDocumentOrThrow(),i=r.getLocationOrThrow()}catch{return null}function s(){const I=t.getElementsByTagName("link"),C=[];for(let R=0;R<I.length;R++){const U=I[R],V=U.getAttribute("rel");if(V&&V.toLowerCase().indexOf("icon")>-1){const F=U.getAttribute("href");if(F)if(F.toLowerCase().indexOf("https:")===-1&&F.toLowerCase().indexOf("http:")===-1&&F.indexOf("//")!==0){let K=i.protocol+"//"+i.host;if(F.indexOf("/")===0)K+=F;else{const B=i.pathname.split("/");B.pop();const j=B.join("/");K+=j+"/"+F}C.push(K)}else if(F.indexOf("//")===0){const K=i.protocol+F;C.push(K)}else C.push(F)}}return C}function a(...I){const C=t.getElementsByTagName("meta");for(let R=0;R<C.length;R++){const U=C[R],V=["itemprop","property","name"].map(F=>U.getAttribute(F)).filter(F=>F?I.includes(F):!1);if(V.length&&V){const F=U.getAttribute("content");if(F)return F}}return""}function f(){let I=a("name","og:site_name","og:title","twitter:title");return I||(I=t.title),I}function l(){return a("description","og:description","twitter:description","keywords")}const p=f(),u=l(),b=i.origin,_=s();return{description:u,url:b,icons:_,name:p}}return Qa.getWindowMetadata=e,Qa}var d4=l4(),gh={},vh,kp;function p4(){return kp||(kp=1,vh=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),vh}var bh,Hp;
15function g4(){if(Hp)return bh;Hp=1;var r="%[a-f0-9]{2}",e=new RegExp("("+r+")|([^%]+?)","gi"),t=new RegExp("("+r+")+","gi");function i(f,l){try{return[decodeURIComponent(f.join(""))]}catch{}if(f.length===1)return f;l=l||1;var p=f.slice(0,l),u=f.slice(l);return Array.prototype.concat.call([],i(p),i(u))}function s(f){try{return decodeURIComponent(f)}catch{for(var l=f.match(e)||[],p=1;p<l.length;p++)f=i(l,p).join(""),l=f.match(e)||[];return f}}function a(f){for(var l={"%FE%FF":"��","%FF%FE":"��"},p=t.exec(f);p;){try{l[p[0]]=decodeURIComponent(p[0])}catch{var u=s(p[0]);u!==p[0]&&(l[p[0]]=u)}p=t.exec(f)}l["%C2"]="�";for(var b=Object.keys(l),_=0;_<b.length;_++){var M=b[_];f=f.replace(new RegExp(M,"g"),l[M])}return f}return bh=function(f){if(typeof f!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof f+"`");try{return f=f.replace(/\+/g," "),decodeURIComponent(f)}catch{return a(f)}},bh}var mh,Kp;function v4(){return Kp||(Kp=1,mh=(r,e)=>{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]}),mh}var yh,Vp;function b4(){return Vp||(Vp=1,yh=function(r,e){for(var t={},i=Object.keys(r),s=Array.isArray(e),a=0;a<i.length;a++){var f=i[a],l=r[f];(s?e.indexOf(f)!==-1:e(f,l,r))&&(t[f]=l)}return t}),yh}var Gp;function m4(){return Gp||(Gp=1,function(r){const e=p4(),t=g4(),i=v4(),s=b4(),a=F=>F==null,f=Symbol("encodeFragmentIdentifier");function l(F){switch(F.arrayFormat){case"index":return K=>(B,j)=>{const q=B.length;return j===void 0||F.skipNull&&j===null||F.skipEmptyString&&j===""?B:j===null?[...B,[b(K,F),"[",q,"]"].join("")]:[...B,[b(K,F),"[",b(q,F),"]=",b(j,F)].join("")]};case"bracket":return K=>(B,j)=>j===void 0||F.skipNull&&j===null||F.skipEmptyString&&j===""?B:j===null?[...B,[b(K,F),"[]"].join("")]:[...B,[b(K,F),"[]=",b(j,F)].join("")];case"colon-list-separator":return K=>(B,j)=>j===void 0||F.skipNull&&j===null||F.skipEmptyString&&j===""?B:j===null?[...B,[b(K,F),":list="].join("")]:[...B,[b(K,F),":list=",b(j,F)].join("")];case"comma":case"separator":case"bracket-separator":{const K=F.arrayFormat==="bracket-separator"?"[]=":"=";return B=>(j,q)=>q===void 0||F.skipNull&&q===null||F.skipEmptyString&&q===""?j:(q=q===null?"":q,j.length===0?[[b(B,F),K,b(q,F)].join("")]:[[j,b(q,F)].join(F.arrayFormatSeparator)])}default:return K=>(B,j)=>j===void 0||F.skipNull&&j===null||F.skipEmptyString&&j===""?B:j===null?[...B,b(K,F)]:[...B,[b(K,F),"=",b(j,F)].join("")]}}function p(F){let K;switch(F.arrayFormat){case"index":return(B,j,q)=>{if(K=/\[(\d*)\]$/.exec(B),B=B.replace(/\[\d*\]$/,""),!K){q[B]=j;return}q[B]===void 0&&(q[B]={}),q[B][K[1]]=j};case"bracket":return(B,j,q)=>{if(K=/(\[\])$/.exec(B),B=B.replace(/\[\]$/,""),!K){q[B]=j;return}if(q[B]===void 0){q[B]=[j];return}q[B]=[].concat(q[B],j)};case"colon-list-separator":return(B,j,q)=>{if(K=/(:list)$/.exec(B),B=B.replace(/:list$/,""),!K){q[B]=j;return}if(q[B]===void 0){q[B]=[j];return}q[B]=[].concat(q[B],j)};case"comma":case"separator":return(B,j,q)=>{const E=typeof j=="string"&&j.includes(F.arrayFormatSeparator),L=typeof j=="string"&&!E&&_(j,F).includes(F.arrayFormatSeparator);j=L?_(j,F):j;const te=E||L?j.split(F.arrayFormatSeparator).map(ae=>_(ae,F)):j===null?j:_(j,F);q[B]=te};case"bracket-separator":return(B,j,q)=>{const E=/(\[\])$/.test(B);if(B=B.replace(/\[\]$/,""),!E){q[B]=j&&_(j,F);return}const L=j===null?[]:j.split(F.arrayFormatSeparator).map(te=>_(te,F));if(q[B]===void 0){q[B]=L;return}q[B]=[].concat(q[B],L)};default:return(B,j,q)=>{if(q[B]===void 0){q[B]=j;return}q[B]=[].concat(q[B],j)}}}function u(F){if(typeof F!="string"||F.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(F,K){return K.encode?K.strict?e(F):encodeURIComponent(F):F}function _(F,K){return K.decode?t(F):F}function M(F){return Array.isArray(F)?F.sort():typeof F=="object"?M(Object.keys(F)).sort((K,B)=>Number(K)-Number(B)).map(K=>F[K]):F}function I(F){const K=F.indexOf("#");return K!==-1&&(F=F.slice(0,K)),F}function C(F){let K="";const B=F.indexOf("#");return B!==-1&&(K=F.slice(B)),K}function R(F){F=I(F);const K=F.indexOf("?");return K===-1?"":F.slice(K+1)}function U(F,K){return K.parseNumbers&&!Number.isNaN(Number(F))&&typeof F=="string"&&F.trim()!==""?F=Number(F):K.parseBooleans&&F!==null&&(F.toLowerCase()==="true"||F.toLowerCase()==="false")&&(F=F.toLowerCase()==="true"),F}function V(F,K){K=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},K),u(K.arrayFormatSeparator);const B=p(K),j=Object.create(null);if(typeof F!="string"||(F=F.trim().replace(/^[?#&]/,""),!F))return j;for(const q of F.split("&")){if(q==="")continue;let[E,L]=i(K.decode?q.replace(/\+/g," "):q,"=");L=L===void 0?null:["comma","separator","bracket-separator"].includes(K.arrayFormat)?L:_(L,K),B(_(E,K),L,j)}
15for(const q of Object.keys(j)){const E=j[q];if(typeof E=="object"&&E!==null)for(const L of Object.keys(E))E[L]=U(E[L],K);else j[q]=U(E,K)}return K.sort===!1?j:(K.sort===!0?Object.keys(j).sort():Object.keys(j).sort(K.sort)).reduce((q,E)=>{const L=j[E];return L&&typeof L=="object"&&!Array.isArray(L)?q[E]=M(L):q[E]=L,q},Object.create(null))}r.extract=R,r.parse=V,r.stringify=(F,K)=>{if(!F)return"";K=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},K),u(K.arrayFormatSeparator);const B=L=>K.skipNull&&a(F[L])||K.skipEmptyString&&F[L]==="",j=l(K),q={};for(const L of Object.keys(F))B(L)||(q[L]=F[L]);const E=Object.keys(q);return K.sort!==!1&&E.sort(K.sort),E.map(L=>{const te=F[L];return te===void 0?"":te===null?b(L,K):Array.isArray(te)?te.length===0&&K.arrayFormat==="bracket-separator"?b(L,K)+"[]":te.reduce(j(L),[]).join("&"):b(L,K)+"="+b(te,K)}).filter(L=>L.length>0).join("&")},r.parseUrl=(F,K)=>{K=Object.assign({decode:!0},K);const[B,j]=i(F,"#");return Object.assign({url:B.split("?")[0]||"",query:V(R(F),K)},K&&K.parseFragmentIdentifier&&j?{fragmentIdentifier:_(j,K)}:{})},r.stringifyUrl=(F,K)=>{K=Object.assign({encode:!0,strict:!0,[f]:!0},K);const B=I(F.url).split("?")[0]||"",j=r.extract(F.url),q=r.parse(j,{sort:!1}),E=Object.assign(q,F.query);let L=r.stringify(E,K);L&&(L=`?${L}`);let te=C(F.url);return F.fragmentIdentifier&&(te=`#${K[f]?b(F.fragmentIdentifier,K):F.fragmentIdentifier}`),`${B}${L}${te}`},r.pick=(F,K,B)=>{B=Object.assign({parseFragmentIdentifier:!0,[f]:!1},B);const{url:j,query:q,fragmentIdentifier:E}=r.parseUrl(F,B);return r.stringifyUrl({url:j,query:s(q,K),fragmentIdentifier:E},B)},r.exclude=(F,K,B)=>{const j=Array.isArray(K)?q=>!K.includes(q):(q,E)=>!K(q,E);return r.pick(F,j,B)}}(gh)),gh}var bu=m4(),wh={},Xa={},At={},_h={},Wp;function y4(){return Wp||(Wp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(l,p){var u=l>>>16&65535,b=l&65535,_=p>>>16&65535,M=p&65535;return b*M+(u*M+b*_<<16>>>0)|0}r.mul=Math.imul||e;function t(l,p){return l+p|0}r.add=t;function i(l,p){return l-p|0}r.sub=i;function s(l,p){return l<<p|l>>>32-p}r.rotl=s;function a(l,p){return l<<32-p|l>>>p}r.rotr=a;function f(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}r.isInteger=Number.isInteger||f,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(l){return r.isInteger(l)&&l>=-r.MAX_SAFE_INTEGER&&l<=r.MAX_SAFE_INTEGER}}(_h)),_h}var Jp;function Oo(){if(Jp)return At;Jp=1,Object.defineProperty(At,"__esModule",{value:!0});var r=y4();function e(d,y){return y===void 0&&(y=0),(d[y+0]<<8|d[y+1])<<16>>16}At.readInt16BE=e;function t(d,y){return y===void 0&&(y=0),(d[y+0]<<8|d[y+1])>>>0}At.readUint16BE=t;function i(d,y){return y===void 0&&(y=0),(d[y+1]<<8|d[y])<<16>>16}At.readInt16LE=i;function s(d,y){return y===void 0&&(y=0),(d[y+1]<<8|d[y])>>>0}At.readUint16LE=s;function a(d,y,A){return y===void 0&&(y=new Uint8Array(2)),A===void 0&&(A=0),y[A+0]=d>>>8,y[A+1]=d>>>0,y}At.writeUint16BE=a,At.writeInt16BE=a;function f(d,y,A){return y===void 0&&(y=new Uint8Array(2)),A===void 0&&(A=0),y[A+0]=d>>>0,y[A+1]=d>>>8,y}At.writeUint16LE=f,At.writeInt16LE=f;function l(d,y){return y===void 0&&(y=0),d[y]<<24|d[y+1]<<16|d[y+2]<<8|d[y+3]}At.readInt32BE=l;function p(d,y){return y===void 0&&(y=0),(d[y]<<24|d[y+1]<<16|d[y+2]<<8|d[y+3])>>>0}At.readUint32BE=p;function u(d,y){return y===void 0&&(y=0),d[y+3]<<24|d[y+2]<<16|d[y+1]<<8|d[y]}At.readInt32LE=u;function b(d,y){return y===void 0&&(y=0),(d[y+3]<<24|d[y+2]<<16|d[y+1]<<8|d[y])>>>0}At.readUint32LE=b;function _(d,y,A){return y===void 0&&(y=new Uint8Array(4)),A===void 0&&(A=0),y[A+0]=d>>>24,y[A+1]=d>>>16,y[A+2]=d>>>8,y[A+3]=d>>>0,y}At.writeUint32BE=_,At.writeInt32BE=_;function M(d,y,A){return y===void 0&&(y=new Uint8Array(4)),A===void 0&&(A=0),y[A+0]=d>>>0,y[A+1]=d>>>8,y[A+2]=d>>>16,y[A+3]=d>>>24,y}At.writeUint32LE=M,At.writeInt32LE=M;function I(d,y){y===void 0&&(y=0);var A=l(d,y),D=l(d,y+4);return A*4294967296+D-(D>>31)*4294967296}At.readInt64BE=I;function C(d,y){y===void 0&&(y=0);var A=p(d,y),D=p(d,y+4);return A*4294967296+D}At.readUint64BE=C;function R(d,y){y===void 0&&(y=0);var A=u(d,y),D=u(d,y+4);return D*4294967296+A-(A>>31)*4294967296}At.readInt64LE=R;function U(d,y){y===void 0&&(y=0);var A=b(d,y),D=b(d,y+4);return D*4294967296+A}At.readUint64LE=U;function V(d,y,A){return y===void 0&&(y=new Uint8Array(8)),A===void 0&&(A=0),_(d/4294967296>>>0,y,A),_(d>>>0,y,A+4),y}At.writeUint64BE=V,At.writeInt64BE=V;function F(d,y,A){return y===void 0&&(y=new Uint8Array(8)),A===void 0&&(A=0),M(d>>>0,y,A),M(d/4294967296>>>0,y,A+4),y}At.writeUint64LE=F,At.writeInt64LE=F;function K(d,y,A){if(A===void 0&&(A=0),d%8!==0)throw new Error("readUintBE supp
15orts only bitLengths divisible by 8");if(d/8>y.length-A)throw new Error("readUintBE: array is too short for the given bitLength");for(var D=0,x=1,g=d/8+A-1;g>=A;g--)D+=y[g]*x,x*=256;return D}At.readUintBE=K;function B(d,y,A){if(A===void 0&&(A=0),d%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(d/8>y.length-A)throw new Error("readUintLE: array is too short for the given bitLength");for(var D=0,x=1,g=A;g<A+d/8;g++)D+=y[g]*x,x*=256;return D}At.readUintLE=B;function j(d,y,A,D){if(A===void 0&&(A=new Uint8Array(d/8)),D===void 0&&(D=0),d%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!r.isSafeInteger(y))throw new Error("writeUintBE value must be an integer");for(var x=1,g=d/8+D-1;g>=D;g--)A[g]=y/x&255,x*=256;return A}At.writeUintBE=j;function q(d,y,A,D){if(A===void 0&&(A=new Uint8Array(d/8)),D===void 0&&(D=0),d%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!r.isSafeInteger(y))throw new Error("writeUintLE value must be an integer");for(var x=1,g=D;g<D+d/8;g++)A[g]=y/x&255,x*=256;return A}At.writeUintLE=q;function E(d,y){y===void 0&&(y=0);var A=new DataView(d.buffer,d.byteOffset,d.byteLength);return A.getFloat32(y)}At.readFloat32BE=E;function L(d,y){y===void 0&&(y=0);var A=new DataView(d.buffer,d.byteOffset,d.byteLength);return A.getFloat32(y,!0)}At.readFloat32LE=L;function te(d,y){y===void 0&&(y=0);var A=new DataView(d.buffer,d.byteOffset,d.byteLength);return A.getFloat64(y)}At.readFloat64BE=te;function ae(d,y){y===void 0&&(y=0);var A=new DataView(d.buffer,d.byteOffset,d.byteLength);return A.getFloat64(y,!0)}At.readFloat64LE=ae;function z(d,y,A){y===void 0&&(y=new Uint8Array(4)),A===void 0&&(A=0);var D=new DataView(y.buffer,y.byteOffset,y.byteLength);return D.setFloat32(A,d),y}At.writeFloat32BE=z;function w(d,y,A){y===void 0&&(y=new Uint8Array(4)),A===void 0&&(A=0);var D=new DataView(y.buffer,y.byteOffset,y.byteLength);return D.setFloat32(A,d,!0),y}At.writeFloat32LE=w;function c(d,y,A){y===void 0&&(y=new Uint8Array(8)),A===void 0&&(A=0);var D=new DataView(y.buffer,y.byteOffset,y.byteLength);return D.setFloat64(A,d),y}At.writeFloat64BE=c;function h(d,y,A){y===void 0&&(y=new Uint8Array(8)),A===void 0&&(A=0);var D=new DataView(y.buffer,y.byteOffset,y.byteLength);return D.setFloat64(A,d,!0),y}return At.writeFloat64LE=h,At}var Kc={},Yp;function Xi(){if(Yp)return Kc;Yp=1,Object.defineProperty(Kc,"__esModule",{value:!0});function r(e){for(var t=0;t<e.length;t++)e[t]=0;return e}return Kc.wipe=r,Kc}var Qp;function w4(){if(Qp)return Xa;Qp=1,Object.defineProperty(Xa,"__esModule",{value:!0});var r=Oo(),e=Xi(),t=20;function i(l,p,u){for(var b=1634760805,_=857760878,M=2036477234,I=1797285236,C=u[3]<<24|u[2]<<16|u[1]<<8|u[0],R=u[7]<<24|u[6]<<16|u[5]<<8|u[4],U=u[11]<<24|u[10]<<16|u[9]<<8|u[8],V=u[15]<<24|u[14]<<16|u[13]<<8|u[12],F=u[19]<<24|u[18]<<16|u[17]<<8|u[16],K=u[23]<<24|u[22]<<16|u[21]<<8|u[20],B=u[27]<<24|u[26]<<16|u[25]<<8|u[24],j=u[31]<<24|u[30]<<16|u[29]<<8|u[28],q=p[3]<<24|p[2]<<16|p[1]<<8|p[0],E=p[7]<<24|p[6]<<16|p[5]<<8|p[4],L=p[11]<<24|p[10]<<16|p[9]<<8|p[8],te=p[15]<<24|p[14]<<16|p[13]<<8|p[12],ae=b,z=_,w=M,c=I,h=C,d=R,y=U,A=V,D=F,x=K,g=B,m=j,N=q,Q=E,re=L,O=te,Z=0;Z<t;Z+=2)ae=ae+h|0,N^=ae,N=N>>>16|N<<16,D=D+N|0,h^=D,h=h>>>20|h<<12,z=z+d|0,Q^=z,Q=Q>>>16|Q<<16,x=x+Q|0,d^=x,d=d>>>20|d<<12,w=w+y|0,re^=w,re=re>>>16|re<<16,g=g+re|0,y^=g,y=y>>>20|y<<12,c=c+A|0,O^=c,O=O>>>16|O<<16,m=m+O|0,A^=m,A=A>>>20|A<<12,w=w+y|0,re^=w,re=re>>>24|re<<8,g=g+re|0,y^=g,y=y>>>25|y<<7,c=c+A|0,O^=c,O=O>>>24|O<<8,m=m+O|0,A^=m,A=A>>>25|A<<7,z=z+d|0,Q^=z,Q=Q>>>24|Q<<8,x=x+Q|0,d^=x,d=d>>>25|d<<7,ae=ae+h|0,N^=ae,N=N>>>24|N<<8,D=D+N|0,h^=D,h=h>>>25|h<<7,ae=ae+d|0,O^=ae,O=O>>>16|O<<16,g=g+O|0,d^=g,d=d>>>20|d<<12,z=z+y|0,N^=z,N=N>>>16|N<<16,m=m+N|0,y^=m,y=y>>>20|y<<12,w=w+A|0,Q^=w,Q=Q>>>16|Q<<16,D=D+Q|0,A^=D,A=A>>>20|A<<12,c=c+h|0,re^=c,re=re>>>16|re<<16,x=x+re|0,h^=x,h=h>>>20|h<<12,w=w+A|0,Q^=w,Q=Q>>>24|Q<<8,D=D+Q|0,A^=D,A=A>>>25|A<<7,c=c+h|0,re^=c,re=re>>>24|re<<8,x=x+re|0,h^=x,h=h>>>25|h<<7,z=z+y|0,N^=z,N=N>>>24|N<<8,m=m+N|0,y^=m,y=y>>>25|y<<7,ae=ae+d|0,O^=ae,O=O>>>24|O<<8,g=g+O|0,d^=g,d=d>>>25|d<<7;r.writeUint32LE(ae+b|0,l,0),r.writeUint32LE(z+_|0,l,4),r.writeUint32LE(w+M|0,l,8),r.writeUint32LE(c+I|0,l,12),r.writeUint32LE(h+C|0,l,16),r.writeUint32LE(d+R|0,l,20),r.writeUint32LE(y+U|0,l,24),r.writeUint32LE(A+V|0,l,28),r.writeUint32LE(D+F|0,l,32),r.writeUint32LE(x+K|0,l,36),r.writeUint32LE(g+B|0,l,40),r.writeUint32LE(m+j|0,l,44),r.writeUint32LE(N+q|0,l,48),r.writeUint32LE(Q+E|0,l,52),r.writeUint32LE(re+L|0,l,56),r.writeUint32LE(O+te|0,l,60)}function s(l,p,u,b,_){if(_===void 0&&(_=0),l.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(b.length<u.length)throw new Error("ChaCha: destination is shorter than source");var M,I;if(_===0){if(p.length!==8&&p.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");M=new Uint8Array(16),I=M.length-p.length,M.set(p,I)}else{if(p.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");M=p,I=_}for(var C=new Uint8Array(64),R=0;R<u.length;R+=64){i(C,M,l);for(var U=R;U<R+64&&U<u.length;U++)b[U]=u[U]^C[U-R];f(M,0,I)}return e.wipe(C),_===0&&e.wipe(M),b}Xa.streamXOR=s;function a(l,p,u,b){return b===void 0&&(b=0),e.wipe(u),s(l,p,u,u,b)}Xa.stream=a;function f(l,p,u){for(var b=1;u--;)b=b+(l[p]&255)|0,l[p]=b&255,b>>>=8,p++;if(b>0)throw new Error("ChaCha: counter overflow")}return Xa}var Ah={},Ds={},Xp;function Wl(){if(Xp)return Ds;Xp=1,Object.defineProperty(Ds,"__esModule",{value:!0});function r(s,a,f){return~(s-1)&a|s-1&f}Ds.select=r;function e(s,a){return(s|0)-(a|0)-1>>>31&1}Ds.lessOrEqual=e;function t(s,a){if(s.length!==a.length)return 0;for(var f=0,l=0;l<s.length;l++)f|=s[l]^a[l];return 1&f-1>>>8}Ds.compare=t;function i(s,a){return s.length===0||a.length===0?!1:t(s,a)!==0}return Ds.equal=i,Ds}var Zp;
15function _4(){return Zp||(Zp=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Wl(),t=Xi();r.DIGEST_LENGTH=16;var i=function(){function f(l){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var p=l[0]|l[1]<<8;this._r[0]=p&8191;var u=l[2]|l[3]<<8;this._r[1]=(p>>>13|u<<3)&8191;var b=l[4]|l[5]<<8;this._r[2]=(u>>>10|b<<6)&7939;var _=l[6]|l[7]<<8;this._r[3]=(b>>>7|_<<9)&8191;var M=l[8]|l[9]<<8;this._r[4]=(_>>>4|M<<12)&255,this._r[5]=M>>>1&8190;var I=l[10]|l[11]<<8;this._r[6]=(M>>>14|I<<2)&8191;var C=l[12]|l[13]<<8;this._r[7]=(I>>>11|C<<5)&8065;var R=l[14]|l[15]<<8;this._r[8]=(C>>>8|R<<8)&8191,this._r[9]=R>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return f.prototype._blocks=function(l,p,u){for(var b=this._fin?0:2048,_=this._h[0],M=this._h[1],I=this._h[2],C=this._h[3],R=this._h[4],U=this._h[5],V=this._h[6],F=this._h[7],K=this._h[8],B=this._h[9],j=this._r[0],q=this._r[1],E=this._r[2],L=this._r[3],te=this._r[4],ae=this._r[5],z=this._r[6],w=this._r[7],c=this._r[8],h=this._r[9];u>=16;){var d=l[p+0]|l[p+1]<<8;_+=d&8191;var y=l[p+2]|l[p+3]<<8;M+=(d>>>13|y<<3)&8191;var A=l[p+4]|l[p+5]<<8;I+=(y>>>10|A<<6)&8191;var D=l[p+6]|l[p+7]<<8;C+=(A>>>7|D<<9)&8191;var x=l[p+8]|l[p+9]<<8;R+=(D>>>4|x<<12)&8191,U+=x>>>1&8191;var g=l[p+10]|l[p+11]<<8;V+=(x>>>14|g<<2)&8191;var m=l[p+12]|l[p+13]<<8;F+=(g>>>11|m<<5)&8191;var N=l[p+14]|l[p+15]<<8;K+=(m>>>8|N<<8)&8191,B+=N>>>5|b;var Q=0,re=Q;re+=_*j,re+=M*(5*h),re+=I*(5*c),re+=C*(5*w),re+=R*(5*z),Q=re>>>13,re&=8191,re+=U*(5*ae),re+=V*(5*te),re+=F*(5*L),re+=K*(5*E),re+=B*(5*q),Q+=re>>>13,re&=8191;var O=Q;O+=_*q,O+=M*j,O+=I*(5*h),O+=C*(5*c),O+=R*(5*w),Q=O>>>13,O&=8191,O+=U*(5*z),O+=V*(5*ae),O+=F*(5*te),O+=K*(5*L),O+=B*(5*E),Q+=O>>>13,O&=8191;var Z=Q;Z+=_*E,Z+=M*q,Z+=I*j,Z+=C*(5*h),Z+=R*(5*c),Q=Z>>>13,Z&=8191,Z+=U*(5*w),Z+=V*(5*z),Z+=F*(5*ae),Z+=K*(5*te),Z+=B*(5*L),Q+=Z>>>13,Z&=8191;var k=Q;k+=_*L,k+=M*E,k+=I*q,k+=C*j,k+=R*(5*h),Q=k>>>13,k&=8191,k+=U*(5*c),k+=V*(5*w),k+=F*(5*z),k+=K*(5*ae),k+=B*(5*te),Q+=k>>>13,k&=8191;var W=Q;W+=_*te,W+=M*L,W+=I*E,W+=C*q,W+=R*j,Q=W>>>13,W&=8191,W+=U*(5*h),W+=V*(5*c),W+=F*(5*w),W+=K*(5*z),W+=B*(5*ae),Q+=W>>>13,W&=8191;var J=Q;J+=_*ae,J+=M*te,J+=I*L,J+=C*E,J+=R*q,Q=J>>>13,J&=8191,J+=U*j,J+=V*(5*h),J+=F*(5*c),J+=K*(5*w),J+=B*(5*z),Q+=J>>>13,J&=8191;var S=Q;S+=_*z,S+=M*ae,S+=I*te,S+=C*L,S+=R*E,Q=S>>>13,S&=8191,S+=U*q,S+=V*j,S+=F*(5*h),S+=K*(5*c),S+=B*(5*w),Q+=S>>>13,S&=8191;var G=Q;G+=_*w,G+=M*z,G+=I*ae,G+=C*te,G+=R*L,Q=G>>>13,G&=8191,G+=U*E,G+=V*q,G+=F*j,G+=K*(5*h),G+=B*(5*c),Q+=G>>>13,G&=8191;var oe=Q;oe+=_*c,oe+=M*w,oe+=I*z,oe+=C*ae,oe+=R*te,Q=oe>>>13,oe&=8191,oe+=U*L,oe+=V*E,oe+=F*q,oe+=K*j,oe+=B*(5*h),Q+=oe>>>13,oe&=8191;var ce=Q;ce+=_*h,ce+=M*c,ce+=I*w,ce+=C*z,ce+=R*ae,Q=ce>>>13,ce&=8191,ce+=U*te,ce+=V*L,ce+=F*E,ce+=K*q,ce+=B*j,Q+=ce>>>13,ce&=8191,Q=(Q<<2)+Q|0,Q=Q+re|0,re=Q&8191,Q=Q>>>13,O+=Q,_=re,M=O,I=Z,C=k,R=W,U=J,V=S,F=G,K=oe,B=ce,p+=16,u-=16}this._h[0]=_,this._h[1]=M,this._h[2]=I,this._h[3]=C,this._h[4]=R,this._h[5]=U,this._h[6]=V,this._h[7]=F,this._h[8]=K,this._h[9]=B},f.prototype.finish=function(l,p){p===void 0&&(p=0);var u=new Uint16Array(10),b,_,M,I;if(this._leftover){for(I=this._leftover,this._buffer[I++]=1;I<16;I++)this._buffer[I]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(b=this._h[1]>>>13,this._h[1]&=8191,I=2;I<10;I++)this._h[I]+=b,b=this._h[I]>>>13,this._h[I]&=8191;for(this._h[0]+=b*5,b=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=b,b=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=b,u[0]=this._h[0]+5,b=u[0]>>>13,u[0]&=8191,I=1;I<10;I++)u[I]=this._h[I]+b,b=u[I]>>>13,u[I]&=8191;for(u[9]-=8192,_=(b^1)-1,I=0;I<10;I++)u[I]&=_;for(_=~_,I=0;I<10;I++)this._h[I]=this._h[I]&_|u[I];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,M=this._h[0]+this._pad[0],this._h[0]=M&65535,I=1;I<8;I++)M=(this._h[I]+this._pad[I]|0)+(M>>>16)|0,this._h[I]=M&65535;return l[p+0]=this._h[0]>>>0,l[p+1]=this._h[0]>>>8,l[p+2]=this._h[1]>>>0,l[p+3]=this._h[1]>>>8,l[p+4]=this._h[2]>>>0,l[p+5]=this._h[2]>>>8,l[p+6]=this._h[3]>>>0,l[p+7]=this._h[3]>>>8,l[p+8]=this._h[4]>>>0,l[p+9]=this._h[4]>>>8,l[p+10]=this._h[5]>>>0,l[p+11]=this._h[5]>>>8,l[p+12]=this._h[6]>>>0,l[p+13]=this._h[6]>>>8,l[p+14]=this._h[7]>>>0,l[p+15]=this._h[7]>>>8,this._finished=!0,this},f.prototype.update=function(l){var p=0,u=l.length,b;if(this._leftover){b=16-this._leftover,b>u&&(b=u);for(var _=0;_<b;_++)this._buffer[this._leftover+_]=l[p+_];if(u-=b,p+=b,this._leftover+=b,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(b=u-u%16,this._blocks(l,p,b),p+=b,u-=b),u){for(var _=0;_<u;_++)this._buffer[this._leftover+_]=l[p+_];this._leftover+=u}return this},f.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},f.prototype.clean=function(){return t.wipe(this._buffer),t.wipe(this._r),t.wipe(this._h),t.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},f}();r.Poly1305=i;function s(f,l){var p=new i(f);p.update(l);var u=p.digest();return p.clean(),u}r.oneTimeAuth=s;function a(f,l){return f.length!==r.DIGEST_LENGTH||l.length!==r.DIGEST_LENGTH?!1:e.equal(f,l)}r.equal=a}(Ah)),Ah}var e1;function A4(){return e1||(e1=1,function(r){Object.defineProperty(r,"__esMo
15dule",{value:!0});var e=w4(),t=_4(),i=Xi(),s=Oo(),a=Wl();r.KEY_LENGTH=32,r.NONCE_LENGTH=12,r.TAG_LENGTH=16;var f=new Uint8Array(16),l=function(){function p(u){if(this.nonceLength=r.NONCE_LENGTH,this.tagLength=r.TAG_LENGTH,u.length!==r.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return p.prototype.seal=function(u,b,_,M){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var I=new Uint8Array(16);I.set(u,I.length-u.length);var C=new Uint8Array(32);e.stream(this._key,I,C,4);var R=b.length+this.tagLength,U;if(M){if(M.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");U=M}else U=new Uint8Array(R);return e.streamXOR(this._key,I,b,U,4),this._authenticate(U.subarray(U.length-this.tagLength,U.length),C,U.subarray(0,U.length-this.tagLength),_),i.wipe(I),U},p.prototype.open=function(u,b,_,M){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(b.length<this.tagLength)return null;var I=new Uint8Array(16);I.set(u,I.length-u.length);var C=new Uint8Array(32);e.stream(this._key,I,C,4);var R=new Uint8Array(this.tagLength);if(this._authenticate(R,C,b.subarray(0,b.length-this.tagLength),_),!a.equal(R,b.subarray(b.length-this.tagLength,b.length)))return null;var U=b.length-this.tagLength,V;if(M){if(M.length!==U)throw new Error("ChaCha20Poly1305: incorrect destination length");V=M}else V=new Uint8Array(U);return e.streamXOR(this._key,I,b.subarray(0,b.length-this.tagLength),V,4),i.wipe(I),V},p.prototype.clean=function(){return i.wipe(this._key),this},p.prototype._authenticate=function(u,b,_,M){var I=new t.Poly1305(b);M&&(I.update(M),M.length%16>0&&I.update(f.subarray(M.length%16))),I.update(_),_.length%16>0&&I.update(f.subarray(_.length%16));var C=new Uint8Array(8);M&&s.writeUint64LE(M.length,C),I.update(C),s.writeUint64LE(_.length,C),I.update(C);for(var R=I.digest(),U=0;U<R.length;U++)u[U]=R[U];I.clean(),i.wipe(R),i.wipe(C)},p}();r.ChaCha20Poly1305=l}(wh)),wh}var Gv=A4(),Vc={},fa={},Gc={},t1;function E4(){if(t1)return Gc;t1=1,Object.defineProperty(Gc,"__esModule",{value:!0});function r(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}return Gc.isSerializableHash=r,Gc}var r1;function x4(){if(r1)return fa;r1=1,Object.defineProperty(fa,"__esModule",{value:!0});var r=E4(),e=Wl(),t=Xi(),i=function(){function a(f,l){this._finished=!1,this._inner=new f,this._outer=new f,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var p=new Uint8Array(this.blockSize);l.length>this.blockSize?this._inner.update(l).finish(p).clean():p.set(l);for(var u=0;u<p.length;u++)p[u]^=54;this._inner.update(p);for(var u=0;u<p.length;u++)p[u]^=106;this._outer.update(p),r.isSerializableHash(this._inner)&&r.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),t.wipe(p)}return a.prototype.reset=function(){if(!r.isSerializableHash(this._inner)||!r.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},a.prototype.clean=function(){r.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),r.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},a.prototype.update=function(f){return this._inner.update(f),this},a.prototype.finish=function(f){return this._finished?(this._outer.finish(f),this):(this._inner.finish(f),this._outer.update(f.subarray(0,this.digestLength)).finish(f),this._finished=!0,this)},a.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},a.prototype.saveState=function(){if(!r.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},a.prototype.restoreState=function(f){if(!r.isSerializableHash(this._inner)||!r.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(f),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},a.prototype.cleanSavedState=function(f){if(!r.isSerializableHash(this._inner))throw new Error("hmac: can't
15cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(f)},a}();fa.HMAC=i;function s(a,f,l){var p=new i(a,f);p.update(l);var u=p.digest();return p.clean(),u}return fa.hmac=s,fa.equal=e.equal,fa}var i1;function S4(){if(i1)return Vc;i1=1,Object.defineProperty(Vc,"__esModule",{value:!0});var r=x4(),e=Xi(),t=function(){function i(s,a,f,l){f===void 0&&(f=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=s,this._info=l;var p=r.hmac(this._hash,f,a);this._hmac=new r.HMAC(s,p),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return i.prototype._fillBuffer=function(){this._counter[0]++;var s=this._counter[0];if(s===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),s>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},i.prototype.expand=function(s){for(var a=new Uint8Array(s),f=0;f<a.length;f++)this._bufpos===this._buffer.length&&this._fillBuffer(),a[f]=this._buffer[this._bufpos++];return a},i.prototype.clean=function(){this._hmac.clean(),e.wipe(this._buffer),e.wipe(this._counter),this._bufpos=0},i}();return Vc.HKDF=t,Vc}var M4=S4(),Eh={},Za={},eo={},n1;function I4(){if(n1)return eo;n1=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.BrowserRandomSource=void 0;const r=65536;class e{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const i=typeof self<"u"?self.crypto||self.msCrypto:null;i&&i.getRandomValues!==void 0&&(this._crypto=i,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(i){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const s=new Uint8Array(i);for(let a=0;a<s.length;a+=r)this._crypto.getRandomValues(s.subarray(a,a+Math.min(s.length-a,r)));return s}}return eo.BrowserRandomSource=e,eo}function D4(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var to={},s1;function P4(){if(s1)return to;s1=1,Object.defineProperty(to,"__esModule",{value:!0}),to.NodeRandomSource=void 0;const r=Xi();class e{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof D4<"u"){const i=Kl;i&&i.randomBytes&&(this._crypto=i,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(i){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let s=this._crypto.randomBytes(i);if(s.length!==i)throw new Error("NodeRandomSource: got fewer bytes than requested");const a=new Uint8Array(i);for(let f=0;f<a.length;f++)a[f]=s[f];return(0,r.wipe)(s),a}}return to.NodeRandomSource=e,to}var a1;function C4(){if(a1)return Za;a1=1,Object.defineProperty(Za,"__esModule",{value:!0}),Za.SystemRandomSource=void 0;const r=I4(),e=P4();class t{constructor(){if(this.isAvailable=!1,this.name="",this._source=new r.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new e.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(s){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(s)}}return Za.SystemRandomSource=t,Za}var o1;function Jl(){return o1||(o1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.randomStringForEntropy=r.randomString=r.randomUint32=r.randomBytes=r.defaultRandomSource=void 0;const e=C4(),t=Oo(),i=Xi();r.defaultRandomSource=new e.SystemRandomSource;function s(u,b=r.defaultRandomSource){return b.randomBytes(u)}r.randomBytes=s;function a(u=r.defaultRandomSource){const b=s(4,u),_=(0,t.readUint32LE)(b);return(0,i.wipe)(b),_}r.randomUint32=a;const f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(u,b=f,_=r.defaultRandomSource){if(b.length<2)throw new Error("randomString charset is too short");if(b.length>256)throw new Error("randomString charset is too long");let M="";const I=b.length,C=256-256%I;for(;u>0;){const R=s(Math.ceil(u*256/C),_);for(let U=0;U<R.length&&u>0;U++){const V=R[U];V<C&&(M+=b.charAt(V%I),u--)}(0,i.wipe)(R)}return M}r.randomString=l;function p(u,b=f,_=r.defaultRandomSource){const M=Math.ceil(u/(Math.log(b.length)/Math.LN2));return l(M,b,_)}r.randomStringForEntropy=p}(Eh)),Eh}var Ro=Jl(),xh={},c1;function O4(){return c1||(c1=1,function(r){Object.defineProperty(r,"__esMo
15dule",{value:!0});var e=Oo(),t=Xi();r.DIGEST_LENGTH=32,r.BLOCK_SIZE=64;var i=function(){function l(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._temp),this.reset()},l.prototype.update=function(p,u){if(u===void 0&&(u=p.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var b=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=p[b++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(b=a(this._temp,this._state,p,b,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=p[b++],u--;return this},l.prototype.finish=function(p){if(!this._finished){var u=this._bytesHashed,b=this._bufferLength,_=u/536870912|0,M=u<<3,I=u%64<56?64:128;this._buffer[b]=128;for(var C=b+1;C<I-8;C++)this._buffer[C]=0;e.writeUint32BE(_,this._buffer,I-8),e.writeUint32BE(M,this._buffer,I-4),a(this._temp,this._state,this._buffer,0,I),this._finished=!0}for(var C=0;C<this.digestLength/4;C++)e.writeUint32BE(this._state[C],p,C*4);return this},l.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(p){return this._state.set(p.state),this._bufferLength=p.bufferLength,p.buffer&&this._buffer.set(p.buffer),this._bytesHashed=p.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(p){t.wipe(p.state),p.buffer&&t.wipe(p.buffer),p.bufferLength=0,p.bytesHashed=0},l}();r.SHA256=i;var s=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(l,p,u,b,_){for(;_>=64;){for(var M=p[0],I=p[1],C=p[2],R=p[3],U=p[4],V=p[5],F=p[6],K=p[7],B=0;B<16;B++){var j=b+B*4;l[B]=e.readUint32BE(u,j)}for(var B=16;B<64;B++){var q=l[B-2],E=(q>>>17|q<<15)^(q>>>19|q<<13)^q>>>10;q=l[B-15];var L=(q>>>7|q<<25)^(q>>>18|q<<14)^q>>>3;l[B]=(E+l[B-7]|0)+(L+l[B-16]|0)}for(var B=0;B<64;B++){var E=(((U>>>6|U<<26)^(U>>>11|U<<21)^(U>>>25|U<<7))+(U&V^~U&F)|0)+(K+(s[B]+l[B]|0)|0)|0,L=((M>>>2|M<<30)^(M>>>13|M<<19)^(M>>>22|M<<10))+(M&I^M&C^I&C)|0;K=F,F=V,V=U,U=R+E|0,R=C,C=I,I=M,M=E+L|0}p[0]+=M,p[1]+=I,p[2]+=C,p[3]+=R,p[4]+=U,p[5]+=V,p[6]+=F,p[7]+=K,b+=64,_-=64}return b}function f(l){var p=new i;p.update(l);var u=p.digest();return p.clean(),u}r.hash=f}(xh)),xh}var Nu=O4(),Sh={},u1;function R4(){return u1||(u1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=Jl(),t=Xi();r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(B){const j=new Float64Array(16);if(B)for(let q=0;q<B.length;q++)j[q]=B[q];return j}const s=new Uint8Array(32);s[0]=9;const a=i([56129,1]);function f(B){let j=1;for(let q=0;q<16;q++){let E=B[q]+j+65535;j=Math.floor(E/65536),B[q]=E-j*65536}B[0]+=j-1+37*(j-1)}function l(B,j,q){const E=~(q-1);for(let L=0;L<16;L++){const te=E&(B[L]^j[L]);B[L]^=te,j[L]^=te}}function p(B,j){const q=i(),E=i();for(let L=0;L<16;L++)E[L]=j[L];f(E),f(E),f(E);for(let L=0;L<2;L++){q[0]=E[0]-65517;for(let ae=1;ae<15;ae++)q[ae]=E[ae]-65535-(q[ae-1]>>16&1),q[ae-1]&=65535;q[15]=E[15]-32767-(q[14]>>16&1);const te=q[15]>>16&1;q[14]&=65535,l(E,q,1-te)}for(let L=0;L<16;L++)B[2*L]=E[L]&255,B[2*L+1]=E[L]>>8}function u(B,j){for(let q=0;q<16;q++)B[q]=j[2*q]+(j[2*q+1]<<8);B[15]&=32767}function b(B,j,q){for(let E=0;E<16;
vendor: 4,436 bytes, line 15
15E++)B[E]=j[E]+q[E]}function _(B,j,q){for(let E=0;E<16;E++)B[E]=j[E]-q[E]}function M(B,j,q){let E,L,te=0,ae=0,z=0,w=0,c=0,h=0,d=0,y=0,A=0,D=0,x=0,g=0,m=0,N=0,Q=0,re=0,O=0,Z=0,k=0,W=0,J=0,S=0,G=0,oe=0,ce=0,fe=0,be=0,we=0,Ie=0,Je=0,Ce=0,Te=q[0],Se=q[1],me=q[2],Oe=q[3],Re=q[4],ve=q[5],Ne=q[6],Ee=q[7],ye=q[8],Le=q[9],De=q[10],_e=q[11],He=q[12],Ve=q[13],xe=q[14],Ke=q[15];E=j[0],te+=E*Te,ae+=E*Se,z+=E*me,w+=E*Oe,c+=E*Re,h+=E*ve,d+=E*Ne,y+=E*Ee,A+=E*ye,D+=E*Le,x+=E*De,g+=E*_e,m+=E*He,N+=E*Ve,Q+=E*xe,re+=E*Ke,E=j[1],ae+=E*Te,z+=E*Se,w+=E*me,c+=E*Oe,h+=E*Re,d+=E*ve,y+=E*Ne,A+=E*Ee,D+=E*ye,x+=E*Le,g+=E*De,m+=E*_e,N+=E*He,Q+=E*Ve,re+=E*xe,O+=E*Ke,E=j[2],z+=E*Te,w+=E*Se,c+=E*me,h+=E*Oe,d+=E*Re,y+=E*ve,A+=E*Ne,D+=E*Ee,x+=E*ye,g+=E*Le,m+=E*De,N+=E*_e,Q+=E*He,re+=E*Ve,O+=E*xe,Z+=E*Ke,E=j[3],w+=E*Te,c+=E*Se,h+=E*me,d+=E*Oe,y+=E*Re,A+=E*ve,D+=E*Ne,x+=E*Ee,g+=E*ye,m+=E*Le,N+=E*De,Q+=E*_e,re+=E*He,O+=E*Ve,Z+=E*xe,k+=E*Ke,E=j[4],c+=E*Te,h+=E*Se,d+=E*me,y+=E*Oe,A+=E*Re,D+=E*ve,x+=E*Ne,g+=E*Ee,m+=E*ye,N+=E*Le,Q+=E*De,re+=E*_e,O+=E*He,Z+=E*Ve,k+=E*xe,W+=E*Ke,E=j[5],h+=E*Te,d+=E*Se,y+=E*me,A+=E*Oe,D+=E*Re,x+=E*ve,g+=E*Ne,m+=E*Ee,N+=E*ye,Q+=E*Le,re+=E*De,O+=E*_e,Z+=E*He,k+=E*Ve,W+=E*xe,J+=E*Ke,E=j[6],d+=E*Te,y+=E*Se,A+=E*me,D+=E*Oe,x+=E*Re,g+=E*ve,m+=E*Ne,N+=E*Ee,Q+=E*ye,re+=E*Le,O+=E*De,Z+=E*_e,k+=E*He,W+=E*Ve,J+=E*xe,S+=E*Ke,E=j[7],y+=E*Te,A+=E*Se,D+=E*me,x+=E*Oe,g+=E*Re,m+=E*ve,N+=E*Ne,Q+=E*Ee,re+=E*ye,O+=E*Le,Z+=E*De,k+=E*_e,W+=E*He,J+=E*Ve,S+=E*xe,G+=E*Ke,E=j[8],A+=E*Te,D+=E*Se,x+=E*me,g+=E*Oe,m+=E*Re,N+=E*ve,Q+=E*Ne,re+=E*Ee,O+=E*ye,Z+=E*Le,k+=E*De,W+=E*_e,J+=E*He,S+=E*Ve,G+=E*xe,oe+=E*Ke,E=j[9],D+=E*Te,x+=E*Se,g+=E*me,m+=E*Oe,N+=E*Re,Q+=E*ve,re+=E*Ne,O+=E*Ee,Z+=E*ye,k+=E*Le,W+=E*De,J+=E*_e,S+=E*He,G+=E*Ve,oe+=E*xe,ce+=E*Ke,E=j[10],x+=E*Te,g+=E*Se,m+=E*me,N+=E*Oe,Q+=E*Re,re+=E*ve,O+=E*Ne,Z+=E*Ee,k+=E*ye,W+=E*Le,J+=E*De,S+=E*_e,G+=E*He,oe+=E*Ve,ce+=E*xe,fe+=E*Ke,E=j[11],g+=E*Te,m+=E*Se,N+=E*me,Q+=E*Oe,re+=E*Re,O+=E*ve,Z+=E*Ne,k+=E*Ee,W+=E*ye,J+=E*Le,S+=E*De,G+=E*_e,oe+=E*He,ce+=E*Ve,fe+=E*xe,be+=E*Ke,E=j[12],m+=E*Te,N+=E*Se,Q+=E*me,re+=E*Oe,O+=E*Re,Z+=E*ve,k+=E*Ne,W+=E*Ee,J+=E*ye,S+=E*Le,G+=E*De,oe+=E*_e,ce+=E*He,fe+=E*Ve,be+=E*xe,we+=E*Ke,E=j[13],N+=E*Te,Q+=E*Se,re+=E*me,O+=E*Oe,Z+=E*Re,k+=E*ve,W+=E*Ne,J+=E*Ee,S+=E*ye,G+=E*Le,oe+=E*De,ce+=E*_e,fe+=E*He,be+=E*Ve,we+=E*xe,Ie+=E*Ke,E=j[14],Q+=E*Te,re+=E*Se,O+=E*me,Z+=E*Oe,k+=E*Re,W+=E*ve,J+=E*Ne,S+=E*Ee,G+=E*ye,oe+=E*Le,ce+=E*De,fe+=E*_e,be+=E*He,we+=E*Ve,Ie+=E*xe,Je+=E*Ke,E=j[15],re+=E*Te,O+=E*Se,Z+=E*me,k+=E*Oe,W+=E*Re,J+=E*ve,S+=E*Ne,G+=E*Ee,oe+=E*ye,ce+=E*Le,fe+=E*De,be+=E*_e,we+=E*He,Ie+=E*Ve,Je+=E*xe,Ce+=E*Ke,te+=38*O,ae+=38*Z,z+=38*k,w+=38*W,c+=38*J,h+=38*S,d+=38*G,y+=38*oe,A+=38*ce,D+=38*fe,x+=38*be,g+=38*we,m+=38*Ie,N+=38*Je,Q+=38*Ce,L=1,E=te+L+65535,L=Math.floor(E/65536),te=E-L*65536,E=ae+L+65535,L=Math.floor(E/65536),ae=E-L*65536,E=z+L+65535,L=Math.floor(E/65536),z=E-L*65536,E=w+L+65535,L=Math.floor(E/65536),w=E-L*65536,E=c+L+65535,L=Math.floor(E/65536),c=E-L*65536,E=h+L+65535,L=Math.floor(E/65536),h=E-L*65536,E=d+L+65535,L=Math.floor(E/65536),d=E-L*65536,E=y+L+65535,L=Math.floor(E/65536),y=E-L*65536,E=A+L+65535,L=Math.floor(E/65536),A=E-L*65536,E=D+L+65535,L=Math.floor(E/65536),D=E-L*65536,E=x+L+65535,L=Math.floor(E/65536),x=E-L*65536,E=g+L+65535,L=Math.floor(E/65536),g=E-L*65536,E=m+L+65535,L=Math.floor(E/65536),m=E-L*65536,E=N+L+65535,L=Math.floor(E/65536),N=E-L*65536,E=Q+L+65535,L=Math.floor(E/65536),Q=E-L*65536,E=re+L+65535,L=Math.floor(E/65536),re=E-L*65536,te+=L-1+37*(L-1),L=1,E=te+L+65535,L=Math.floor(E/65536),te=E-L*65536,E=ae+L+65535,L=Math.floor(E/65536),ae=E-L*65536,E=z+L+65535,L=Math.floor(E/65536),z=E-L*65536,E=w+L+65535,L=Math.floor(E/65536),w=E-L*65536,E=c+L+65535,L=Math.floor(E/65536),c=E-L*65536,E=h+L+65535,L=Math.floor(E/65536),h=E-L*65536,E=d+L+65535,L=Math.floor(E/65536),d=E-L*65536,E=y+L+65535,L=Math.floor(E/65536),y=E-L*65536,E=A+L+65535,L=Math.floor(E/65536),A=E-L*65536,E=D+L+65535,L=Math.floor(E/65536),D=E-L*65536,E=x+L+65535,L=Math.floor(E/65536),x=E-L*65536,E=g+L+65535,L=Math.floor(E/65536),g=E-L*65536,E=m+L+65535,L=Math.floor(E/65536),m=E-L*65536,E=N+L+65535,L=Math.floor(E/65536),N=E-L*65536,E=Q+L+65535,L=Math.floor(E/65536),Q=E-L*65536,E=re+L+65535,L=Math.floor(E/65536),re=E-L*65536,te+=L-1+37*(L-1),B[0]=te,B[1]=ae,B[2]=z,B[3]=w,B[4]=c,B[5]=h,B[6]=d,B[7]=y,B[8]=A,B[9]=D,B[10]=x,B[11]=g,B[12]=m,B[13]=N,B[14]=Q,B[15]=re}function I(B,j){M(B,j,j)}function C(B,j){const q=i();for(let E=0;E<16;
15E++)q[E]=j[E];for(let E=253;E>=0;E--)I(q,q),E!==2&&E!==4&&M(q,q,j);for(let E=0;E<16;E++)B[E]=q[E]}function R(B,j){const q=new Uint8Array(32),E=new Float64Array(80),L=i(),te=i(),ae=i(),z=i(),w=i(),c=i();for(let A=0;A<31;A++)q[A]=B[A];q[31]=B[31]&127|64,q[0]&=248,u(E,j);for(let A=0;A<16;A++)te[A]=E[A];L[0]=z[0]=1;for(let A=254;A>=0;--A){const D=q[A>>>3]>>>(A&7)&1;l(L,te,D),l(ae,z,D),b(w,L,ae),_(L,L,ae),b(ae,te,z),_(te,te,z),I(z,w),I(c,L),M(L,ae,L),M(ae,te,w),b(w,L,ae),_(L,L,ae),I(te,L),_(ae,z,c),M(L,ae,a),b(L,L,z),M(ae,ae,L),M(L,z,c),M(z,te,E),I(te,w),l(L,te,D),l(ae,z,D)}for(let A=0;A<16;A++)E[A+16]=L[A],E[A+32]=ae[A],E[A+48]=te[A],E[A+64]=z[A];const h=E.subarray(32),d=E.subarray(16);C(h,h),M(d,d,h);const y=new Uint8Array(32);return p(y,d),y}r.scalarMult=R;function U(B){return R(B,s)}r.scalarMultBase=U;function V(B){if(B.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(B);return{publicKey:U(j),secretKey:j}}r.generateKeyPairFromSeed=V;function F(B){const j=(0,e.randomBytes)(32,B),q=V(j);return(0,t.wipe)(j),q}r.generateKeyPair=F;function K(B,j,q=!1){if(B.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const E=R(B,j);if(q){let L=0;for(let te=0;te<E.length;te++)L|=E[te];if(L===0)throw new Error("X25519: invalid shared key")}return E}r.sharedKey=K}(Sh)),Sh}var Wv=R4();function Jv(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function au(r,e){e||(e=r.reduce((s,a)=>s+a.length,0));const t=Jv(e);let i=0;for(const s of r)t.set(s,i),i+=s.length;return t}function N4(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var s=0;s<r.length;s++){var a=r.charAt(s),f=a.charCodeAt(0);if(t[f]!==255)throw new TypeError(a+" is ambiguous");t[f]=s}var l=r.length,p=r.charAt(0),u=Math.log(l)/Math.log(256),b=Math.log(256)/Math.log(l);function _(C){if(C instanceof Uint8Array||(ArrayBuffer.isView(C)?C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength):Array.isArray(C)&&(C=Uint8Array.from(C))),!(C instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(C.length===0)return"";for(var R=0,U=0,V=0,F=C.length;V!==F&&C[V]===0;)V++,R++;for(var K=(F-V)*b+1>>>0,B=new Uint8Array(K);V!==F;){for(var j=C[V],q=0,E=K-1;(j!==0||q<U)&&E!==-1;E--,q++)j+=256*B[E]>>>0,B[E]=j%l>>>0,j=j/l>>>0;if(j!==0)throw new Error("Non-zero carry");U=q,V++}for(var L=K-U;L!==K&&B[L]===0;)L++;for(var te=p.repeat(R);L<K;++L)te+=r.charAt(B[L]);return te}function M(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return new Uint8Array;var R=0;if(C[R]!==" "){for(var U=0,V=0;C[R]===p;)U++,R++;for(var F=(C.length-R)*u+1>>>0,K=new Uint8Array(F);C[R];){var B=t[C.charCodeAt(R)];if(B===255)return;for(var j=0,q=F-1;(B!==0||j<V)&&q!==-1;q--,j++)B+=l*K[q]>>>0,K[q]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");V=j,R++}if(C[R]!==" "){for(var E=F-V;E!==F&&K[E]===0;)E++;for(var L=new Uint8Array(U+(F-E)),te=U;E!==F;)L[te++]=K[E++];return L}}}function I(C){var R=M(C);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:M,decode:I}}var T4=N4,q4=T4;const F4=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},B4=r=>new TextEncoder().encode(r),L4=r=>new TextDecoder().decode(r);class U4{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class z4{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
15 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Yv(this,e)}}class j4{constructor(e){this.decoders=e}or(e){return Yv(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Yv=(r,e)=>new j4({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class $4{constructor(e,t,i,s){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=s,this.encoder=new U4(e,t,i),this.decoder=new z4(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Tu=({name:r,prefix:e,encode:t,decode:i})=>new $4(r,e,t,i),No=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:s}=q4(t,e);return Tu({prefix:r,name:e,encode:i,decode:a=>F4(s(a))})},k4=(r,e,t,i)=>{const s={};for(let b=0;b<e.length;++b)s[e[b]]=b;let a=r.length;for(;r[a-1]==="=";)--a;const f=new Uint8Array(a*t/8|0);let l=0,p=0,u=0;for(let b=0;b<a;++b){const _=s[r[b]];if(_===void 0)throw new SyntaxError(`Non-${i} character`);p=p<<t|_,l+=t,l>=8&&(l-=8,f[u++]=255&p>>l)}if(l>=t||255&p<<8-l)throw new SyntaxError("Unexpected end of data");return f},H4=(r,e,t)=>{const i=e[e.length-1]==="=",s=(1<<t)-1;let a="",f=0,l=0;for(let p=0;p<r.length;++p)for(l=l<<8|r[p],f+=8;f>t;)f-=t,a+=e[s&l>>f];if(f&&(a+=e[s&l<<t-f]),i)for(;a.length*t&7;)a+="=";return a},Sr=({name:r,prefix:e,bitsPerChar:t,alphabet:i})=>Tu({prefix:e,name:r,encode(s){return H4(s,i,t)},decode(s){return k4(s,i,t,r)}}),K4=Tu({prefix:"\0",name:"identity",encode:r=>L4(r),decode:r=>B4(r)}),V4=Object.freeze(Object.defineProperty({__proto__:null,identity:K4},Symbol.toStringTag,{value:"Module"})),G4=Sr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),W4=Object.freeze(Object.defineProperty({__proto__:null,base2:G4},Symbol.toStringTag,{value:"Module"})),J4=Sr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Y4=Object.freeze(Object.defineProperty({__proto__:null,base8:J4},Symbol.toStringTag,{value:"Module"})),Q4=No({prefix:"9",name:"base10",alphabet:"0123456789"}),X4=Object.freeze(Object.defineProperty({__proto__:null,base10:Q4},Symbol.toStringTag,{value:"Module"})),Z4=Sr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),e_=Sr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),t_=Object.freeze(Object.defineProperty({__proto__:null,base16:Z4,base16upper:e_},Symbol.toStringTag,{value:"Module"})),r_=Sr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),i_=Sr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),n_=Sr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),s_=Sr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),a_=Sr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),o_=Sr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),c_=Sr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),u_=Sr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),f_=Sr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),h_=Object.freeze(Object.defineProperty({__proto__:null,base32:r_,base32hex:a_,base32hexpad:c_,base32hexpadupper:u_,base32hexupper:o_,base32pad:n_,base32padupper:s_,base32upper:i_,base32z:f_},Symbol.toStringTag,{value:"Module"})),l_=No({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),d_=No({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),p_=Object.freeze(Object.defineProperty({__proto__:null,base36:l_,base36upper:d_},Symbol.toStringTag,{value:"Module"})),g_=No({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),v_=No({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),b_=Object.freeze(Object.defineProperty({__proto__:null,base58btc:g_,base58flickr:v_},Symbol.toStringTag,{value:"Module"})),m_=Sr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
15+/",bitsPerChar:6}),y_=Sr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),w_=Sr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),__=Sr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),A_=Object.freeze(Object.defineProperty({__proto__:null,base64:m_,base64pad:y_,base64url:w_,base64urlpad:__},Symbol.toStringTag,{value:"Module"})),Qv=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),E_=Qv.reduce((r,e,t)=>(r[t]=e,r),[]),x_=Qv.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function S_(r){return r.reduce((e,t)=>(e+=E_[t],e),"")}function M_(r){const e=[];for(const t of r){const i=x_[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const I_=Tu({prefix:"ð",name:"base256emoji",encode:S_,decode:M_}),D_=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:I_},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const f1={...V4,...W4,...Y4,...X4,...t_,...h_,...p_,...b_,...A_,...D_};function Xv(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const h1=Xv("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>
15new TextEncoder().encode(r.substring(1))),Mh=Xv("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=Jv(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),Zv={utf8:h1,"utf-8":h1,hex:f1.base16,latin1:Mh,ascii:Mh,binary:Mh,...f1};function wr(r,e="utf8"){const t=Zv[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):t.decoder.decode(`${t.prefix}${r}`)}function _r(r,e="utf8"){const t=Zv[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var Ih={};const P_="elliptic",C_="6.6.1",O_="EC cryptography",R_="lib/elliptic.js",N_=["lib"],T_={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},q_={type:"git",url:"[email protected]:indutny/elliptic"},F_=["EC","Elliptic","curve","Cryptography"],B_="Fedor Indutny <[email protected]>",L_="MIT",U_={url:"https://github.com/indutny/elliptic/issues"},z_="https://github.com/indutny/elliptic",j_={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},$_={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},k_={name:P_,version:C_,description:O_,main:R_,files:N_,scripts:T_,repository:q_,keywords:F_,author:B_,license:L_,bugs:U_,homepage:z_,devDependencies:j_,dependencies:$_};var Dh={},ou={exports:{}},H_=ou.exports,l1;function Vn(){return l1||(l1=1,function(r){(function(e,t){function i(z,w){if(!z)throw new Error(w||"Assertion failed")}function s(z,w){z.super_=w;var c=function(){};c.prototype=w.prototype,z.prototype=new c,z.prototype.constructor=z}function a(z,w,c){if(a.isBN(z))return z;this.negative=0,this.words=null,this.length=0,this.red=null,z!==null&&((w==="le"||w==="be")&&(c=w,w=10),this._init(z||0,w||10,c||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Kl.Buffer}catch{}a.isBN=function(w){return w instanceof a?!0:w!==null&&typeof w=="object"&&w.constructor.wordSize===a.wordSize&&Array.isArray(w.words)},a.max=function(w,c){return w.cmp(c)>0?w:c},a.min=function(w,c){return w.cmp(c)<0?w:c},a.prototype._init=function(w,c,h){if(typeof w=="number")return this._initNumber(w,c,h);if(typeof w=="object")return this._initArray(w,c,h);c==="hex"&&(c=16),i(c===(c|0)&&c>=2&&c<=36),w=w.toString().replace(/\s+/g,"");var d=0;w[0]==="-"&&(d++,this.negative=1),d<w.length&&(c===16?this._parseHex(w,d,h):(this._parseBase(w,c,d),h==="le"&&this._initArray(this.toArray(),c,h)))},a.prototype._initNumber=function(w,c,h){w<0&&(this.negative=1,w=-w),w<67108864?(this.words=[w&67108863],this.length=1):w<4503599627370496?(this.words=[w&67108863,w/67108864&67108863],this.length=2):(i(w<9007199254740992),this.words=[w&67108863,w/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),c,h)},a.prototype._initArray=function(w,c,h){if(i(typeof w.length=="number"),w.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(w.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var y,A,D=0;if(h==="be")for(d=w.length-1,y=0;d>=0;d-=3)A=w[d]|w[d-1]<<8|w[d-2]<<16,this.words[y]|=A<<D&67108863,this.words[y+1]=A>>>26-D&67108863,D+=24,D>=26&&(D-=26,y++);else if(h==="le")for(d=0,y=0;d<w.length;d+=3)A=w[d]|w[d+1]<<8|w[d+2]<<16,this.words[y]|=A<<D&67108863,this.words[y+1]=A>>>26-D&67108863,D+=24,D>=26&&(D-=26,y++);return this.strip()};function l(z,w){var c=z.charCodeAt(w);return c>=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function p(z,w,c){var h=l(z,c);return c-1>=w&&(h|=l(z,c-1)<<4),h}a.prototype._parseHex=function(w,c,h){this.length=Math.ceil((w.length-c)/6),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var y=0,A=0,D;if(h==="be")for(d=w.length-1;d>=c;d-=2)D=p(w,c,d)<<y,this.words[A]|=D&67108863,y>=18?(y-=18,A+=1,this.words[A]|=D>>>26):y+=8;else{var x=w.length-c;for(d=x%2===0?c+1:c;d<w.length;d+=2)D=p(w,c,d)<<y,this.words[A]|=D&67108863,y>=18?(y-=18,A+=1,this.words[A]|=D>>>26):y+=8}this.strip()};function u(z,w,c,h){for(var d=0,y=Math.min(z.length,c),A=w;A<y;A++){var D=z.charCodeAt(A)-48;d*=h,D>=49?d+=D-49+10:D>=17?d+=D-17+10:d+=D}return d}a.prototype._parseBase=function(w,c,h){this.words=[0],this.length=1;for(var d=0,y=1;y<=67108863;y*=c)d++;d--,y=y/c|0;for(var A=w.length-h,D=A%d,x=Math.min(A,A-D)+h,g=0,m=h;m<x;m+=d)g=u(w,m,m+d,c),this.imuln(y),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(D!==0){var N=1;for(g=u(w,m,w.length,c),m=0;m<D;m++)N*=c;this.imuln(N),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()}
vendor: 7,028 bytes, line 15
15,a.prototype.copy=function(w){w.words=new Array(this.length);for(var c=0;c<this.length;c++)w.words[c]=this.words[c];w.length=this.length,w.negative=this.negative,w.red=this.red},a.prototype.clone=function(){var w=new a(null);return this.copy(w),w},a.prototype._expand=function(w){for(;this.length<w;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],_=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],M=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(w,c){w=w||10,c=c|0||1;var h;if(w===16||w==="hex"){h="";for(var d=0,y=0,A=0;A<this.length;A++){var D=this.words[A],x=((D<<d|y)&16777215).toString(16);y=D>>>24-d&16777215,d+=2,d>=26&&(d-=26,A--),y!==0||A!==this.length-1?h=b[6-x.length]+x+h:h=x+h}for(y!==0&&(h=y.toString(16)+h);h.length%c!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(w===(w|0)&&w>=2&&w<=36){var g=_[w],m=M[w];h="";var N=this.clone();for(N.negative=0;!N.isZero();){var Q=N.modn(m).toString(w);N=N.idivn(m),N.isZero()?h=Q+h:h=b[g-Q.length]+Q+h}for(this.isZero()&&(h="0"+h);h.length%c!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var w=this.words[0];return this.length===2?w+=this.words[1]*67108864:this.length===3&&this.words[2]===1?w+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-w:w},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(w,c){return i(typeof f<"u"),this.toArrayLike(f,w,c)},a.prototype.toArray=function(w,c){return this.toArrayLike(Array,w,c)},a.prototype.toArrayLike=function(w,c,h){var d=this.byteLength(),y=h||Math.max(1,d);i(d<=y,"byte array longer than desired length"),i(y>0,"Requested array length <= 0"),this.strip();var A=c==="le",D=new w(y),x,g,m=this.clone();if(A){for(g=0;!m.isZero();g++)x=m.andln(255),m.iushrn(8),D[g]=x;for(;g<y;g++)D[g]=0}else{for(g=0;g<y-d;g++)D[g]=0;for(g=0;!m.isZero();g++)x=m.andln(255),m.iushrn(8),D[y-g-1]=x}return D},Math.clz32?a.prototype._countBits=function(w){return 32-Math.clz32(w)}:a.prototype._countBits=function(w){var c=w,h=0;return c>=4096&&(h+=13,c>>>=13),c>=64&&(h+=7,c>>>=7),c>=8&&(h+=4,c>>>=4),c>=2&&(h+=2,c>>>=2),h+c},a.prototype._zeroBits=function(w){if(w===0)return 26;var c=w,h=0;return c&8191||(h+=13,c>>>=13),c&127||(h+=7,c>>>=7),c&15||(h+=4,c>>>=4),c&3||(h+=2,c>>>=2),c&1||h++,h},a.prototype.bitLength=function(){var w=this.words[this.length-1],c=this._countBits(w);return(this.length-1)*26+c};function I(z){for(var w=new Array(z.bitLength()),c=0;c<w.length;c++){var h=c/26|0,d=c%26;w[c]=(z.words[h]&1<<d)>>>d}return w}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var w=0,c=0;c<this.length;c++){var h=this._zeroBits(this.words[c]);if(w+=h,h!==26)break}return w},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(w){return this.negative!==0?this.abs().inotn(w).iaddn(1):this.clone()},a.prototype.fromTwos=function(w){return this.testn(w-1)?this.notn(w).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(w){for(;this.length<w.length;)this.words[this.length++]=0;for(var c=0;c<w.length;c++)this.words[c]=this.words[c]|w.words[c];return this.strip()},a.prototype.ior=function(w){return i((this.negative|w.negative)===0),this.iuor(w)},a.prototype.or=function(w){return this.length>w.length?this.clone().ior(w):w.clone().ior(this)},a.prototype.uor=function(w){return this.length>w.length?this.clone().iuor(w):w.clone().iuor(this)},a.prototype.iuand=function(w){var c;this.length>w.length?c=w:c=this;for(var h=0;h<c.length;h++)this.words[h]=this.words[h]&w.words[h];return this.length=c.length,this.strip()},a.prototype.iand=function(w){return i((this.negative|w.negative)===0),this.iuand(w)},a.prototype.and=function(w){return this.length>w.length?this.clone().iand(w):w.clone().iand(this)},a.prototype.uand=function(w){return this.length>w.length?this.clone().iuand(w):w.clone().iuand(this)},a.prototype.iuxor=function(w){var c,h;this.length>w.length?(c=this,h=w):(c=w,h=this);for(var d=0;d<h.length;d++)this.words[d]=c.words[d]^h.words[d];if(this!==c)for(;d<c.length;d++)this.words[d]=c.words[d];return this.length=c.length,this.strip()},a.prototype.ixor=function(w){return i((this.negative|w.negative)===0),this.iuxor(w)},a.prototype.xor=function(w){return this.length>w.length?this.clone().ixor(w):w.clone().ixor(this)},a.prototype.uxor=function(w){return this.length>w.length?this.clone().iuxor(w):w.clone().iuxor(this)},a.prototype.inotn=function(w){i(typeof w=="number"&&w>=0);var c=Math.ceil(w/26)|0,h=w%26;this._expand(c),h>0&&c--;for(var d=0;d<c;d++)this.words[d]=~this.words[d]&67108863;return h>0&&(this.words[d]=~this.words[d]&67108863>>26-h),this.strip()},a.prototype.notn=function(w){return this.clone().inotn(w)},a.prototype.setn=function(w,c){i(typeof w=="number"&&w>=0);var h=w/26|0,d=w%26;return this._expand(h+1),c?this.words[h]=this.words[h]|1<<d:this.words[h]=this.words[h]&~(1<<d),this.strip()},a.prototype.iadd=function(w){var c;if(this.negative!==0&&w.negative===0)return this.negative=0,c=this.isub(w),this.negative^=1,this._normSign();if(this.negative===0&&w.negative!==0)return w.negative=0,c=this.isub(w),w.negative=1,c._normSign();var h,d;this.length>w.length?(h=this,d=w):(h=w,d=this);for(var y=0,A=0;A<d.length;A++)c=(h.words[A]|0)+(d.words[A]|0)+y,this.words[A]=c&67108863,y=c>>>26;for(;y!==0&&A<h.length;A++)c=(h.words[A]|0)+y,this.words[A]=c&67108863,y=c>>>26;if(this.length=h.length,y!==0)this.words[this.length]=y,this.length++;else if(h!==this)for(;A<h.length;A++)this.words[A]=h.words[A];return this},a.prototype.add=function(w){var c;return w.negative!==0&&this.negative===0?(w.negative=0,c=this.sub(w),w.negative^=1,c):w.negative===0&&this.negative!==0?(this.negative=0,c=w.sub(this),this.negative=1,c):this.length>
vendor: 28,446 bytes, line 15
15w.length?this.clone().iadd(w):w.clone().iadd(this)},a.prototype.isub=function(w){if(w.negative!==0){w.negative=0;var c=this.iadd(w);return w.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(w),this.negative=1,this._normSign();var h=this.cmp(w);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,y;h>0?(d=this,y=w):(d=w,y=this);for(var A=0,D=0;D<y.length;D++)c=(d.words[D]|0)-(y.words[D]|0)+A,A=c>>26,this.words[D]=c&67108863;for(;A!==0&&D<d.length;D++)c=(d.words[D]|0)+A,A=c>>26,this.words[D]=c&67108863;if(A===0&&D<d.length&&d!==this)for(;D<d.length;D++)this.words[D]=d.words[D];return this.length=Math.max(this.length,D),d!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(w){return this.clone().isub(w)};function C(z,w,c){c.negative=w.negative^z.negative;var h=z.length+w.length|0;c.length=h,h=h-1|0;var d=z.words[0]|0,y=w.words[0]|0,A=d*y,D=A&67108863,x=A/67108864|0;c.words[0]=D;for(var g=1;g<h;g++){for(var m=x>>>26,N=x&67108863,Q=Math.min(g,w.length-1),re=Math.max(0,g-z.length+1);re<=Q;re++){var O=g-re|0;d=z.words[O]|0,y=w.words[re]|0,A=d*y+N,m+=A/67108864|0,N=A&67108863}c.words[g]=N|0,x=m|0}return x!==0?c.words[g]=x|0:c.length--,c.strip()}var R=function(w,c,h){var d=w.words,y=c.words,A=h.words,D=0,x,g,m,N=d[0]|0,Q=N&8191,re=N>>>13,O=d[1]|0,Z=O&8191,k=O>>>13,W=d[2]|0,J=W&8191,S=W>>>13,G=d[3]|0,oe=G&8191,ce=G>>>13,fe=d[4]|0,be=fe&8191,we=fe>>>13,Ie=d[5]|0,Je=Ie&8191,Ce=Ie>>>13,Te=d[6]|0,Se=Te&8191,me=Te>>>13,Oe=d[7]|0,Re=Oe&8191,ve=Oe>>>13,Ne=d[8]|0,Ee=Ne&8191,ye=Ne>>>13,Le=d[9]|0,De=Le&8191,_e=Le>>>13,He=y[0]|0,Ve=He&8191,xe=He>>>13,Ke=y[1]|0,ht=Ke&8191,Ge=Ke>>>13,wt=y[2]|0,lt=wt&8191,Ye=wt>>>13,Et=y[3]|0,Mt=Et&8191,qe=Et>>>13,Xe=y[4]|0,tt=Xe&8191,Fe=Xe>>>13,et=y[5]|0,Ze=et&8191,ze=et>>>13,ut=y[6]|0,rt=ut&8191,je=ut>>>13,it=y[7]|0,st=it&8191,Be=it>>>13,Qe=y[8]|0,ft=Qe&8191,$e=Qe>>>13,Rt=y[9]|0,Nt=Rt&8191,at=Rt>>>13;h.negative=w.negative^c.negative,h.length=19,x=Math.imul(Q,Ve),g=Math.imul(Q,xe),g=g+Math.imul(re,Ve)|0,m=Math.imul(re,xe);var bt=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(bt>>>26)|0,bt&=67108863,x=Math.imul(Z,Ve),g=Math.imul(Z,xe),g=g+Math.imul(k,Ve)|0,m=Math.imul(k,xe),x=x+Math.imul(Q,ht)|0,g=g+Math.imul(Q,Ge)|0,g=g+Math.imul(re,ht)|0,m=m+Math.imul(re,Ge)|0;var Ir=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,x=Math.imul(J,Ve),g=Math.imul(J,xe),g=g+Math.imul(S,Ve)|0,m=Math.imul(S,xe),x=x+Math.imul(Z,ht)|0,g=g+Math.imul(Z,Ge)|0,g=g+Math.imul(k,ht)|0,m=m+Math.imul(k,Ge)|0,x=x+Math.imul(Q,lt)|0,g=g+Math.imul(Q,Ye)|0,g=g+Math.imul(re,lt)|0,m=m+Math.imul(re,Ye)|0;var Dr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,x=Math.imul(oe,Ve),g=Math.imul(oe,xe),g=g+Math.imul(ce,Ve)|0,m=Math.imul(ce,xe),x=x+Math.imul(J,ht)|0,g=g+Math.imul(J,Ge)|0,g=g+Math.imul(S,ht)|0,m=m+Math.imul(S,Ge)|0,x=x+Math.imul(Z,lt)|0,g=g+Math.imul(Z,Ye)|0,g=g+Math.imul(k,lt)|0,m=m+Math.imul(k,Ye)|0,x=x+Math.imul(Q,Mt)|0,g=g+Math.imul(Q,qe)|0,g=g+Math.imul(re,Mt)|0,m=m+Math.imul(re,qe)|0;var Pr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,x=Math.imul(be,Ve),g=Math.imul(be,xe),g=g+Math.imul(we,Ve)|0,m=Math.imul(we,xe),x=x+Math.imul(oe,ht)|0,g=g+Math.imul(oe,Ge)|0,g=g+Math.imul(ce,ht)|0,m=m+Math.imul(ce,Ge)|0,x=x+Math.imul(J,lt)|0,g=g+Math.imul(J,Ye)|0,g=g+Math.imul(S,lt)|0,m=m+Math.imul(S,Ye)|0,x=x+Math.imul(Z,Mt)|0,g=g+Math.imul(Z,qe)|0,g=g+Math.imul(k,Mt)|0,m=m+Math.imul(k,qe)|0,x=x+Math.imul(Q,tt)|0,g=g+Math.imul(Q,Fe)|0,g=g+Math.imul(re,tt)|0,m=m+Math.imul(re,Fe)|0;var Cr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,x=Math.imul(Je,Ve),g=Math.imul(Je,xe),g=g+Math.imul(Ce,Ve)|0,m=Math.imul(Ce,xe),x=x+Math.imul(be,ht)|0,g=g+Math.imul(be,Ge)|0,g=g+Math.imul(we,ht)|0,m=m+Math.imul(we,Ge)|0,x=x+Math.imul(oe,lt)|0,g=g+Math.imul(oe,Ye)|0,g=g+Math.imul(ce,lt)|0,m=m+Math.imul(ce,Ye)|0,x=x+Math.imul(J,Mt)|0,g=g+Math.imul(J,qe)|0,g=g+Math.imul(S,Mt)|0,m=m+Math.imul(S,qe)|0,x=x+Math.imul(Z,tt)|0,g=g+Math.imul(Z,Fe)|0,g=g+Math.imul(k,tt)|0,m=m+Math.imul(k,Fe)|0,x=x+Math.imul(Q,Ze)|0,g=g+Math.imul(Q,ze)|0,g=g+Math.imul(re,Ze)|0,m=m+Math.imul(re,ze)|0;var Or=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Or>>>26)|0,Or&=67108863,x=Math.imul(Se,Ve),g=Math.imul(Se,xe),g=g+Math.imul(me,Ve)|0,m=Math.imul(me,xe),x=x+Math.imul(Je,ht)|0,g=g+Math.imul(Je,Ge)|0,g=g+Math.imul(Ce,ht)|0,m=m+Math.imul(Ce,Ge)|0,x=x+Math.imul(be,lt)|0,g=g+Math.imul(be,Ye)|0,g=g+Math.imul(we,lt)|0,m=m+Math.imul(we,Ye)|0,x=x+Math.imul(oe,Mt)|0,g=g+Math.imul(oe,qe)|0,g=g+Math.imul(ce,Mt)|0,m=m+Math.imul(ce,qe)|0,x=x+Math.imul(J,tt)|0,g=g+Math.imul(J,Fe)|0,g=g+Math.imul(S,tt)|0,m=m+Math.imul(S,Fe)|0,x=x+Math.imul(Z,Ze)|0,g=g+Math.imul(Z,ze)|0,g=g+Math.imul(k,Ze)|0,m=m+Math.imul(k,ze)|0,x=x+Math.imul(Q,rt)|0,g=g+Math.imul(Q,je)|0,g=g+Math.imul(re,rt)|0,m=m+Math.imul(re,je)|0;var Zt=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,x=Math.imul(Re,Ve),g=Math.imul(Re,xe),g=g+Math.imul(ve,Ve)|0,m=Math.imul(ve,xe),x=x+Math.imul(Se,ht)|0,g=g+Math.imul(Se,Ge)|0,g=g+Math.imul(me,ht)|0,m=m+Math.imul(me,Ge)|0,x=x+Math.imul(Je,lt)|0,g=g+Math.imul(Je,Ye)|0,g=g+Math.imul(Ce,lt)|0,m=m+Math.imul(Ce,Ye)|0,x=x+Math.imul(be,Mt)|0,g=g+Math.imul(be,qe)|0,g=g+Math.imul(we,Mt)|0,m=m+Math.imul(we,qe)|0,x=x+Math.imul(oe,tt)|0,g=g+Math.imul(oe,Fe)|0,g=g+Math.imul(ce,tt)|0,m=m+Math.imul(ce,Fe)|0,x=x+Math.imul(J,Ze)|0,g=g+Math.imul(J,ze)|0,g=g+Math.imul(S,Ze)|0,m=m+Math.imul(S,ze)|0,x=x+Math.imul(Z,rt)|0,g=g+Math.imul(Z,je)|0,g=g+Math.imul(k,rt)|0,m=m+Math.imul(k,je)|0,x=x+Math.imul(Q,st)|0,g=g+Math.imul(Q,Be)|0,g=g+Math.imul(re,st)|0,m=m+Math.imul(re,Be)|0;var Hr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,x=Math.imul(Ee,Ve),g=Math.imul(Ee,xe),g=g+Math.imul(ye,Ve)|0,m=Math.imul(ye,xe),x=x+Math.imul(Re,ht)|0,g=g+Math.imul(Re,Ge)|0,g=g+Math.imul(ve,ht)|0,m=m+Math.imul(ve,Ge)|0,x=x+Math.imul(Se,lt)|0,g=g+Math.imul(Se,Ye)|0,g=g+Math.imul(me,lt)|0,m=m+Math.imul(me,Ye)|0,x=x+Math.imul(Je,Mt)|0,g=g+Math.imul(Je,qe)|0,g=g+Math.imul(Ce,Mt)|0,m=m+Math.imul(Ce,qe)|0,x=x+Math.imul(be,tt)|0,g=g+Math.imul(be,Fe)|0,g=g+Math.imul(we,tt)|0,m=m+Math.imul(we,Fe)|0,x=x+Math.imul(oe,Ze)|0,g=g+Math.imul(oe,ze)|0,g=g+Math.imul(ce,Ze)|0,m=m+Math.imul(ce,ze)|0,x=x+Math.imul(J,rt)|0,g=g+Math.imul(J,je)|0,g=g+Math.imul(S,rt)|0,m=m+Math.imul(S,je)|0,x=x+Math.imul(Z,st)|0,g=g+Math.imul(Z,Be)|0,g=g+Math.imul(k,st)|0,m=m+Math.imul(k,Be)|0,x=x+Math.imul(Q,ft)|0,g=g+Math.imul(Q,$e)|0,g=g+Math.imul(re,ft)|0,m=m+Math.imul(re,$e)|0;var Ni=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Ni>>>26)|0,Ni&=67108863,x=Math.imul(De,Ve),g=Math.imul(De,xe),g=g+Math.imul(_e,Ve)|0,m=Math.imul(_e,xe),x=x+Math.imul(Ee,ht)|0,g=g+Math.imul(Ee,Ge)|0,g=g+Math.imul(ye,ht)|0,m=m+Math.imul(ye,Ge)|0,x=x+Math.imul(Re,lt)|0,g=g+Math.imul(Re,Ye)|0,g=g+Math.imul(ve,lt)|0,m=m+Math.imul(ve,Ye)|0,x=x+Math.imul(Se,Mt)|0,g=g+Math.imul(Se,qe)|0,g=g+Math.imul(me,Mt)|0,m=m+Math.imul(me,qe)|0,x=x+Math.imul(Je,tt)|0,g=g+Math.imul(Je,Fe)|0,g=g+Math.imul(Ce,tt)|0,m=m+Math.imul(Ce,Fe)|0,x=x+Math.imul(be,Ze)|0,g=g+Math.imul(be,ze)|0,g=g+Math.imul(we,Ze)|0,m=m+Math.imul(we,ze)|0,x=x+Math.imul(oe,rt)|0,g=g+Math.imul(oe,je)|0,g=g+Math.imul(ce,rt)|0,m=m+Math.imul(ce,je)|0,x=x+Math.imul(J,st)|0,g=g+Math.imul(J,Be)|0,g=g+Math.imul(S,st)|0,m=m+Math.imul(S,Be)|0,x=x+Math.imul(Z,ft)|0,g=g+Math.imul(Z,$e)|0,g=g+Math.imul(k,ft)|0,m=m+Math.imul(k,$e)|0,x=x+Math.imul(Q,Nt)|0,g=g+Math.imul(Q,at)|0,g=g+Math.imul(re,Nt)|0,m=m+Math.imul(re,at)|0;var Kr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,x=Math.imul(De,ht),g=Math.imul(De,Ge),g=g+Math.imul(_e,ht)|0,m=Math.imul(_e,Ge),x=x+Math.imul(Ee,lt)|0,g=g+Math.imul(Ee,Ye)|0,g=g+Math.imul(ye,lt)|0,m=m+Math.imul(ye,Ye)|0,x=x+Math.imul(Re,Mt)|0,g=g+Math.imul(Re,qe)|0,g=g+Math.imul(ve,Mt)|0,m=m+Math.imul(ve,qe)|0,x=x+Math.imul(Se,tt)|0,g=g+Math.imul(Se,Fe)|0,g=g+Math.imul(me,tt)|0,m=m+Math.imul(me,Fe)|0,x=x+Math.imul(Je,Ze)|0,g=g+Math.imul(Je,ze)|0,g=g+Math.imul(Ce,Ze)|0,m=m+Math.imul(Ce,ze)|0,x=x+Math.imul(be,rt)|0,g=g+Math.imul(be,je)|0,g=g+Math.imul(we,rt)|0,m=m+Math.imul(we,je)|0,x=x+Math.imul(oe,st)|0,g=g+Math.imul(oe,Be)|0,g=g+Math.imul(ce,st)|0,m=m+Math.imul(ce,Be)|0,x=x+Math.imul(J,ft)|0,g=g+Math.imul(J,$e)|0,g=g+Math.imul(S,ft)|0,m=m+Math.imul(S,$e)|0,x=x+Math.imul(Z,Nt)|0,g=g+Math.imul(Z,at)|0,g=g+Math.imul(k,Nt)|0,m=m+Math.imul(k,at)|0;var Ti=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,x=Math.imul(De,lt),g=Math.imul(De,Ye),g=g+Math.imul(_e,lt)|0,m=Math.imul(_e,Ye),x=x+Math.imul(Ee,Mt)|0,g=g+Math.imul(Ee,qe)|0,g=g+Math.imul(ye,Mt)|0,m=m+Math.imul(ye,qe)|0,x=x+Math.imul(Re,tt)|0,g=g+Math.imul(Re,Fe)|0,g=g+Math.imul(ve,tt)|0,m=m+Math.imul(ve,Fe)|0,x=x+Math.imul(Se,Ze)|0,g=g+Math.imul(Se,ze)|0,g=g+Math.imul(me,Ze)|0,m=m+Math.imul(me,ze)|0,x=x+Math.imul(Je,rt)|0,g=g+Math.imul(Je,je)|0,g=g+Math.imul(Ce,rt)|0,m=m+Math.imul(Ce,je)|0,x=x+Math.imul(be,st)|0,g=g+Math.imul(be,Be)|0,g=g+Math.imul(we,st)|0,m=m+Math.imul(we,Be)|0,x=x+Math.imul(oe,ft)|0,g=g+Math.imul(oe,$e)|0,g=g+Math.imul(ce,ft)|0,m=m+Math.imul(ce,$e)|0,x=x+Math.imul(J,Nt)|0,g=g+Math.imul(J,at)|0,g=g+Math.imul(S,Nt)|0,m=m+Math.imul(S,at)|0;var qi=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(qi>>>26)|0,qi&=67108863,x=Math.imul(De,Mt),g=Math.imul(De,qe),g=g+Math.imul(_e,Mt)|0,m=Math.imul(_e,qe),x=x+Math.imul(Ee,tt)|0,g=g+Math.imul(Ee,Fe)|0,g=g+Math.imul(ye,tt)|0,m=m+Math.imul(ye,Fe)|0,x=x+Math.imul(Re,Ze)|0,g=g+Math.imul(Re,ze)|0,g=g+Math.imul(ve,Ze)|0,m=m+Math.imul(ve,ze)|0,x=x+Math.imul(Se,rt)|0,g=g+Math.imul(Se,je)|0,g=g+Math.imul(me,rt)|0,m=m+Math.imul(me,je)|0,x=x+Math.imul(Je,st)|0,g=g+Math.imul(Je,Be)|0,g=g+Math.imul(Ce,st)|0,m=m+Math.imul(Ce,Be)|0,x=x+Math.imul(be,ft)|0,g=g+Math.imul(be,$e)|0,g=g+Math.imul(we,ft)|0,m=m+Math.imul(we,$e)|0,x=x+Math.imul(oe,Nt)|0,g=g+Math.imul(oe,at)|0,g=g+Math.imul(ce,Nt)|0,m=m+Math.imul(ce,at)|0;var Vr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,x=Math.imul(De,tt),g=Math.imul(De,Fe),g=g+Math.imul(_e,tt)|0,m=Math.imul(_e,Fe),x=x+Math.imul(Ee,Ze)|0,g=g+Math.imul(Ee,ze)|0,g=g+Math.imul(ye,Ze)|0,m=m+Math.imul(ye,ze)|0,x=x+Math.imul(Re,rt)|0,g=g+Math.imul(Re,je)|0,g=g+Math.imul(ve,rt)|0,m=m+Math.imul(ve,je)|0,x=x+Math.imul(Se,st)|0,g=g+Math.imul(Se,Be)|0,g=g+Math.imul(me,st)|0,m=m+Math.imul(me,Be)|0,x=x+Math.imul(Je,ft)|0,g=g+Math.imul(Je,$e)|0,g=g+Math.imul(Ce,ft)|0,m=m+Math.imul(Ce,$e)|0,x=x+Math.imul(be,Nt)|0,g=g+Math.imul(be,at)|0,g=g+Math.imul(we,Nt)|0,m=m+Math.imul(we,at)|0;var gi=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(gi>>>26)|0,gi&=67108863,x=Math.imul(De,Ze),g=Math.imul(De,ze),g=g+Math.imul(_e,Ze)|0,m=Math.imul(_e,ze),x=x+Math.imul(Ee,rt)|0,g=g+Math.imul(Ee,je)|0,g=g+Math.imul(ye,rt)|0,m=m+Math.imul(ye,je)|0,x=x+Math.imul(Re,st)|0,g=g+Math.imul(Re,Be)|0,g=g+Math.imul(ve,st)|0,m=m+Math.imul(ve,Be)|0,x=x+Math.imul(Se,ft)|0,g=g+Math.imul(Se,$e)|0,g=g+Math.imul(me,ft)|0,m=m+Math.imul(me,$e)|0,x=x+Math.imul(Je,Nt)|0,g=g+Math.imul(Je,at)|0,g=g+Math.imul(Ce,Nt)|0,m=m+Math.imul(Ce,at)|0;var vi=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(vi>>>26)|0,vi&=67108863,x=Math.imul(De,rt),g=Math.imul(De,je),g=g+Math.imul(_e,rt)|0,m=Math.imul(_e,je),x=x+Math.imul(Ee,st)|0,g=g+Math.imul(Ee,Be)|0,g=g+Math.imul(ye,st)|0,m=m+Math.imul(ye,Be)|0,x=x+Math.imul(Re,ft)|0,g=g+Math.imul(Re,$e)|0,g=g+Math.imul(ve,ft)|0,m=m+Math.imul(ve,$e)|0,x=x+Math.imul(Se,Nt)|0,g=g+Math.imul(Se,at)|0,g=g+Math.imul(me,Nt)|0,m=m+Math.imul(me,at)|0;var fr=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(fr>>>26)|0,fr&=67108863,x=Math.imul(De,st),g=Math.imul(De,Be),g=g+Math.imul(_e,st)|0,m=Math.imul(_e,Be),x=x+Math.imul(Ee,ft)|0,g=g+Math.imul(Ee,$e)|0,g=g+Math.imul(ye,ft)|0,m=m+Math.imul(ye,$e)|0,x=x+Math.imul(Re,Nt)|0,g=g+Math.imul(Re,at)|0,g=g+Math.imul(ve,Nt)|0,m=m+Math.imul(ve,at)|0;var Fi=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Fi>>>26)|0,Fi&=67108863,x=Math.imul(De,ft),g=Math.imul(De,$e),g=g+Math.imul(_e,ft)|0,m=Math.imul(_e,$e),x=x+Math.imul(Ee,Nt)|0,g=g+Math.imul(Ee,at)|0,g=g+Math.imul(ye,Nt)|0,m=m+Math.imul(ye,at)|0;var Bi=(D+x|0)+((g&8191)<<13)|0;D=(m+(g>>>13)|0)+(Bi>>>26)|0,Bi&=67108863,x=Math.imul(De,Nt),g=Math.imul(De,at),g=g+Math.imul(_e,Nt)|0,m=Math.imul(_e,at);var Li=(D+x|0)+((g&8191)<<13)|0;return D=(m+(g>>>13)|0)+(Li>>>26)|0,Li&=67108863,A[0]=bt,A[1]=Ir,A[2]=Dr,A[3]=Pr,A[4]=Cr,A[5]=Or,A[6]=Zt,A[7]=Hr,A[8]=Ni,A[9]=Kr,A[10]=Ti,A[11]=qi,A[12]=Vr,A[13]=gi,A[14]=vi,A[15]=fr,A[16]=Fi,A[17]=Bi,A[18]=Li,D!==0&&(A[19]=D,h.length++),h};Math.imul||(R=C);function U(z,w,c){c.negative=w.negative^z.negative,c.length=z.length+w.length;for(var h=0,d=0,y=0;y<c.length-1;y++){var A=d;d=0;for(var D=h&67108863,x=Math.min(y,w.length-1),g=Math.max(0,y-z.length+1);g<=x;g++){var m=y-g,N=z.words[m]|0,Q=w.words[g]|0,re=N*Q,O=re&67108863;A=A+(re/67108864|0)|0,O=O+D|0,D=O&67108863,A=A+(O>>>26)|0,d+=A>>>26,A&=67108863}c.words[y]=D,h=A,A=d}return h!==0?c.words[y]=h:c.length--,c.strip()}function V(z,w,c){var h=new F;return h.mulp(z,w,c)}a.prototype.mulTo=function(w,c){var h,d=this.length+w.length;return this.length===10&&w.length===10?h=R(this,w,c):d<63?h=C(this,w,c):d<1024?h=U(this,w,c):h=V(this,w,c),h};function F(z,w){this.x=z,this.y=w}F.prototype.makeRBT=function(w){for(var c=new Array(w),h=a.prototype._countBits(w)-1,d=0;d<w;d++)c[d]=this.revBin(d,h,w);return c},F.prototype.revBin=function(w,c,h){if(w===0||w===h-1)return w;for(var d=0,y=0;y<c;y++)d|=(w&1)<<c-y-1,w>>=1;return d},F.prototype.permute=function(w,c,h,d,y,A){for(var D=0;D<A;D++)d[D]=c[w[D]],y[D]=h[w[D]]},F.prototype.transform=function(w,c,h,d,y,A){this.permute(A,w,c,h,d,y);for(var D=1;D<y;D<<=1)for(var x=D<<1,g=Math.cos(2*Math.PI/x),m=Math.sin(2*Math.PI/x),N=0;N<y;N+=x)for(var Q=g,re=m,O=0;O<D;O++){var Z=h[N+O],k=d[N+O],W=h[N+O+D],J=d[N+O+D],S=Q*W-re*J;J=Q*J+re*W,W=S,h[N+O]=Z+W,d[N+O]=k+J,h[N+O+D]=Z-W,d[N+O+D]=k-J,O!==x&&(S=g*Q-m*re,re=g*re+m*Q,Q=S)}},F.prototype.guessLen13b=function(w,c){var h=Math.max(c,w)|1,d=h&1,y=0;for(h=h/2|0;h;h=h>>>1)y++;return 1<<y+1+d},F.prototype.conjugate=function(w,c,h){if(!(h<=1))for(var d=0;d<h/2;d++){var y=w[d];w[d]=w[h-d-1],w[h-d-1]=y,y=c[d],c[d]=-c[h-d-1],c[h-d-1]=-y}},F.prototype.normalize13b=function(w,c){for(var h=0,d=0;d<c/2;d++){var y=Math.round(w[2*d+1]/c)*8192+Math.round(w[2*d]/c)+h;w[d]=y&67108863,y<67108864?h=0:h=y/67108864|0}return w},F.prototype.convert13b=function(w,c,h,d){for(var y=0,A=0;A<c;A++)y=y+(w[A]|0),h[2*A]=y&8191,y=y>>>13,h[2*A+1]=y&8191,y=y>>>13;for(A=2*c;A<d;++A)h[A]=0;i(y===0),i((y&-8192)===0)},F.prototype.stub=function(w){for(var c=new Array(w),h=0;h<w;h++)c[h]=0;return c},F.prototype.mulp=function(w,c,h){var d=2*this.guessLen13b(w.length,c.length),y=this.makeRBT(d),A=this.stub(d),D=new Array(d),x=new Array(d),g=new Array(d),m=new Array(d),N=new Array(d),Q=new Array(d),re=h.words;re.length=d,this.convert13b(w.words,w.length,D,d),this.convert13b(c.words,c.length,m,d),this.transform(D,A,x,g,d,y),this.transform(m,A,N,Q,d,y);for(var O=0;O<d;O++){var Z=x[O]*N[O]-g[O]*Q[O];g[O]=x[O]*Q[O]+g[O]*N[O],x[O]=Z}return this.conjugate(x,g,d),this.transform(x,g,re,A,d,y),this.conjugate(re,A,d),this.normalize13b(re,d),h.negative=w.negative^c.negative,h.length=w.length+c.length,h.strip()},a.prototype.mul=function(w){var c=new a(null);return c.words=new Array(this.length+w.length),this.mulTo(w,c)},a.prototype.mulf=function(w){var c=new a(null);return c.words=new Array(this.length+w.length),V(this,w,c)},a.prototype.imul=function(w){return this.clone().mulTo(w,this)},a.prototype.imuln=function(w){i(typeof w=="number"),i(w<67108864);for(var c=0,h=0;h<this.length;h++){var d=(this.words[h]|0)*w,y=(d&67108863)+(c&67108863);c>>=26,c+=d/67108864|0,c+=y>>>26,this.words[h]=y&67108863}return c!==0&&(this.words[h]=c,this.length++),this},a.prototype.muln=function(w){return this.clone().imuln(w)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(w){var c=I(w);if(c.length===0)return new a(1);for(var h=this,d=0;d<c.length&&c[d]===0;d++,h=h.sqr());if(++d<c.length)for(var y=h.sqr();d<c.length;d++,y=y.sqr())c[d]!==0&&(h=h.mul(y));return h},a.prototype.iushln=function(w){i(typeof w=="number"&&w>=0);var c=w%26,h=(w-c)/26,d=67108863>>>26-c<<26-c,y;if(c!==0){var A=0;for(y=0;y<this.length;y++){var D=this.words[y]&d,x=(this.words[y]|0)-D<<c;this.words[y]=x|A,A=D>>>26-c}A&&(this.words[y]=A,this.length++)}if(h!==0){for(y=this.length-1;y>=0;y--)this.words[y+h]=this.words[y];for(y=0;y<h;y++)this.words[y]=0;this.length+=h}return this.strip()},a.prototype.ishln=function(w){return i(this.negative===0),this.iushln(w)},a.prototype.iushrn=function(w,c,h){i(typeof w=="number"&&w>=0);var d;c?d=(c-c%26)/26:d=0;var y=w%26,A=Math.min((w-y)/26,this.length),D=67108863^67108863>>>y<<y,x=h;if(d-=A,d=Math.max(0,d),x){for(var g=0;g<A;g++)x.words[g]=this.words[g];x.length=A}if(A!==0)if(this.length>A)for(this.length-=A,g=0;g<this.length;g++)this.words[g]=this.words[g+A];else this.words[0]=0,this.length=1;var m=0;for(g=this.length-1;g>=0&&(m!==0||g>=d);g--){var N=this.words[g]|0;this.words[g]=m<<26-y|N>>>y,m=N&D}return x&&m!==0&&(x.words[x.length++]=m),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(w,c,h){return i(this.negative===0),this.iushrn(w,c,h)},a.prototype.shln=function(w){return this.clone().ishln(w)},a.prototype.ushln=function(w){return this.clone().iushln(w)},a.prototype.shrn=function(w){return this.clone().ishrn(w)},a.prototype.ushrn=function(w){return this.clone().iushrn(w)},a.prototype.testn=function(w){i(typeof w=="number"&&w>=0);var c=w%26,h=(w-c)/26,d=1<<c;if(this.length<=h)return!1;var y=this.words[h];return!!(y&d)},a.prototype.imaskn=function(w){i(typeof w=="number"&&w>=0);var c=w%26,h=(w-c)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(c!==0&&h++,this.length=Math.min(h,this.length),c!==0){var d=67108863^67108863>>>c<<c;this.words[this.length-1]&=d}return this.strip()},a.prototype.maskn=function(w){return this.clone().imaskn(w)},a.prototype.iaddn=function(w){return i(typeof w=="number"),i(w<67108864),w<0?this.isubn(-w):this.negative!==0?this.length===1&&(this.words[0]|0)<w?(this.words[0]=w-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(w),this.negative=1,this):this._iaddn(w)},a.prototype._iaddn=function(w){this.words[0]+=w;for(var c=0;c<this.length&&this.words[c]>=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},a.prototype.isubn=function(w){if(i(typeof w=="number"),i(w<67108864),w<0)return this.iaddn(-w);if(this.negative!==0)return this.negative=0,this.iaddn(w),this.negative=1,this;if(this.words[0]-=w,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c<this.length&&this.words[c]<0;c++)this.words[c]+=67108864,this.words[c+1]-=1;return this.strip()},a.prototype.addn=function(w){return this.clone().iaddn(w)},a.prototype.subn=function(w){return this.clone().isubn(w)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(w,c,h){var d=w.length+h,y;this._expand(d);var A,D=0;for(y=0;y<w.length;y++){A=(this.words[y+h]|0)+D;var x=(w.words[y]|0)*c;A-=x&67108863,D=(A>>26)-(x/67108864|0),this.words[y+h]=A&67108863}for(;y<this.length-h;y++)A=(this.words[y+h]|0)+D,D=A>>26,this.words[y+h]=A&67108863;if(D===0)return this.strip();for(i(D===-1),D=0,y=0;y<this.length;y++)A=-(this.words[y]|0)+D,D=A>>26,this.words[y]=A&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(w,c){var h=this.length-w.length,d=this.clone(),y=w,A=y.words[y.length-1]|0,D=this._countBits(A);h=26-D,h!==0&&(y=y.ushln(h),d.iushln(h),A=y.words[y.length-1]|0);var x=d.length-y.length,g;if(c!=="mod"){g=new a(null),g.length=x+1,g.words=new Array(g.length);for(var m=0;m<g.length;m++)g.words[m]=0}var N=d.clone()._ishlnsubmul(y,1,x);N.negative===0&&(d=N,g&&(g.words[x]=1));for(var Q=x-1;Q>=0;Q--){var re=(d.words[y.length+Q]|0)*67108864+(d.words[y.length+Q-1]|0);for(re=Math.min(re/A|0,67108863),d._ishlnsubmul(y,re,Q);d.negative!==0;)re--,d.negative=0,d._ishlnsubmul(y,1,Q),d.isZero()||(d.negative^=1);g&&(g.words[Q]=re)}return g&&g.strip(),d.strip(),c!=="div"&&h!==0&&d.iushrn(h),{div:g||null,mod:d}},a.prototype.divmod=function(w,c,h){if(i(!w.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var d,y,A;return this.negative!==0&&w.negative===0?(A=this.neg().divmod(w,c),c!=="mod"&&(d=A.div.neg()),c!=="div"&&(y=A.mod.neg(),h&&y.negative!==0&&y.iadd(w)),{div:d,mod:y}):this.negative===0&&w.negative!==0?(A=this.divmod(w.neg(),c),c!=="mod"&&(d=A.div.neg()),{div:d,mod:A.mod}):this.negative&w.negative?(A=this.neg().divmod(w.neg(),c),c!=="div"&&(y=A.mod.neg(),h&&y.negative!==0&&y.isub(w)),{div:A.div,mod:y}):w.length>this.length||this.cmp(w)<0?{div:new a(0),mod:this}:w.length===1?c==="div"?{div:this.divn(w.words[0]),mod:null}:c==="mod"?{div:null,mod:new a(this.modn(w.words[0]))}:{div:this.divn(w.words[0]),mod:new a(this.modn(w.words[0]))}:this._wordDiv(w,c)},a.prototype.div=function(w){return this.divmod(w,"div",!1).div},a.prototype.mod=function(w){return this.divmod(w,"mod",!1).mod},a.prototype.umod=function(w){return this.divmod(w,"mod",!0).mod},a.prototype.divRound=function(w){var c=this.divmod(w);if(c.mod.isZero())return c.div;var h=c.div.negative!==0?c.mod.isub(w):c.mod,d=w.ushrn(1),y=w.andln(1),A=h.cmp(d);return A<0||y===1&&A===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},a.prototype.modn=function(w){i(w<=67108863);for(var c=(1<<26)%w,h=0,d=this.length-1;d>=0;d--)h=(c*h+(this.words[d]|0))%w;return h},a.prototype.idivn=function(w){i(w<=67108863);for(var c=0,h=this.length-1;h>=0;h--){var d=(this.words[h]|0)+c*67108864;this.words[h]=d/w|0,c=d%w}return this.strip()},a.prototype.divn=function(w){return this.clone().idivn(w)},a.prototype.egcd=function(w){i(w.negative===0),i(!w.isZero());var c=this,h=w.clone();c.negative!==0?c=c.umod(w):c=c.clone();for(var d=new a(1),y=new a(0),A=new a(0),D=new a(1),x=0;c.isEven()&&h.isEven();)c.iushrn(1),h.iushrn(1),++x;for(var g=h.clone(),m=c.clone();!c.isZero();){for(var N=0,Q=1;!(c.words[0]&Q)&&N<26;++N,Q<<=1);if(N>0)for(c.iushrn(N);N-- >0;)(d.isOdd()||y.isOdd())&&(d.iadd(g),y.isub(m)),d.iushrn(1),y.iushrn(1);for(var re=0,O=1;!(h.words[0]&O)&&re<26;++re,O<<=1);if(re>0)for(h.iushrn(re);re-- >0;)(A.isOdd()||D.isOdd())&&(A.iadd(g),D.isub(m)),A.iushrn(1),D.iushrn(1);c.cmp(h)>=0?(c.isub(h),d.isub(A),y.isub(D)):(h.isub(c),A.isub(d),D.isub(y))}return{a:A,b:D,gcd:h.iushln(x)}},a.prototype._invmp=function(w){i(w.negative===0),i(!w.isZero());var c=this,h=w.clone();c.negative!==0?c=c.umod(w):c=c.clone();for(var d=new a(1),y=new a(0),A=h.clone();c.cmpn(1)>0&&h.cmpn(1)>0;){for(var D=0,x=1;!(c.words[0]&x)&&D<26;++D,x<<=1);if(D>0)for(c.iushrn(D);D-- >0;)d.isOdd()&&d.iadd(A),d.iushrn(1);for(var g=0,m=1;!(h.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(h.iushrn(g);g-- >0;)y.isOdd()&&y.iadd(A),y.iushrn(1);c.cmp(h)>=0?(c.isub(h),d.isub(y)):(h.isub(c),y.isub(d))}var N;return c.cmpn(1)===0?N=d:N=y,N.cmpn(0)<0&&N.iadd(w),N},a.prototype.gcd=function(w){if(this.isZero())return w.abs();if(w.isZero())return this.abs();var c=this.clone(),h=w.clone();c.negative=0,h.negative=0;for(var d=0;c.isEven()&&h.isEven();d++)c.iushrn(1),h.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;h.isEven();)h.iushrn(1);var y=c.cmp(h);if(y<0){var A=c;c=h,h=A}else if(y===0||h.cmpn(1)===0)break;c.isub(h)}while(!0);return h.iushln(d)},a.prototype.invm=function(w){return this.egcd(w).a.umod(w)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(w){return this.words[0]&w},a.prototype.bincn=function(w){i(typeof w=="number");var c=w%26,h=(w-c)/26,d=1<<c;if(this.length<=h)return this._expand(h+1),this.words[h]|=d,this;for(var y=d,A=h;y!==0&&A<this.length;A++){var D=this.words[A]|0;D+=y,y=D>>>26,D&=67108863,this.words[A]=D}return y!==0&&(this.words[A]=y,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(w){var c=w<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var h;if(this.length>1)h=1;else{c&&(w=-w),i(w<=67108863,"Number is too big");var d=this.words[0]|0;h=d===w?0:d<w?-1:1}return this.negative!==0?-h|0:h},a.prototype.cmp=function(w){if(this.negative!==0&&w.negative===0)return-1;if(this.negative===0&&w.negative!==0)return 1;var c=this.ucmp(w);return this.negative!==0?-c|0:c},a.prototype.ucmp=function(w){if(this.length>w.length)return 1;if(this.length<w.length)return-1;for(var c=0,h=this.length-1;h>=0;h--){var d=this.words[h]|0,y=w.words[h]|0;if(d!==y){d<y?c=-1:d>y&&(c=1);break}}return c},a.prototype.gtn=function(w){return this.cmpn(w)===1},a.prototype.gt=function(w){return this.cmp(w)===1},a.prototype.gten=function(w){return this.cmpn(w)>=0},a.prototype.gte=function(w){return this.cmp(w)>=0},a.prototype.ltn=function(w){return this.cmpn(w)===-1},a.prototype.lt=function(w){return this.cmp(w)===-1},a.prototype.lten=function(w){return this.cmpn(w)<=0},a.prototype.lte=function(w){return this.cmp(w)<=0},a.prototype.eqn=function(w){return this.cmpn(w)===0},a.prototype.eq=function(w){return this.cmp(w)===0},a.red=function(w){return new te(w)},a.prototype.toRed=function(w){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),w.convertTo(this)._forceRed(w)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(w){return this.red=w,this},a.prototype.forceRed=function(w){return i(!this.red,"Already a number in reduction context"),this._forceRed(w)},a.prototype.redAdd=function(w){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,w)},a.prototype.redIAdd=function(w){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,w)},a.prototype.redSub=function(w){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,w)},a.prototype.redISub=function(w){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,w)},a.prototype.redShl=function(w){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,w)},a.prototype.redMul=function(w){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.mul(this,w)},a.prototype.redIMul=function(w){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,w),this.red.imul(this,w)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(w){return i(this.red&&!w.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,w)};var K={k256:null,p224:null,p192:null,p25519:null};function B(z,w){this.name=z,this.p=new a(w,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var w=new a(null);return w.words=new Array(Math.ceil(this.n/13)),w},B.prototype.ireduce=function(w){var c=w,h;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),h=c.bitLength();while(h>this.n);var d=h<this.n?-1:c.ucmp(this.p);return d===0?(c.words[0]=0,c.length=1):d>0?c.isub(this.p):c.strip!==void 0?c.strip():c._strip(),c},B.prototype.split=function(w,c){w.iushrn(this.n,0,c)},B.prototype.imulK=function(w){return w.imul(this.k)};function j(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(j,B),j.prototype.split=function(w,c){for(var h=4194303,d=Math.min(w.length,9),y=0;y<d;y++)c.words[y]=w.words[y];if(c.length=d,w.length<=9){w.words[0]=0,w.length=1;return}var A=w.words[9];for(c.words[c.length++]=A&h,y=10;y<w.length;y++){var D=w.words[y]|0;w.words[y-10]=(D&h)<<4|A>>>22,A=D}A>>>=22
vendor: 5,310 bytes, line 15
15,w.words[y-10]=A,A===0&&w.length>10?w.length-=10:w.length-=9},j.prototype.imulK=function(w){w.words[w.length]=0,w.words[w.length+1]=0,w.length+=2;for(var c=0,h=0;h<w.length;h++){var d=w.words[h]|0;c+=d*977,w.words[h]=c&67108863,c=d*64+(c/67108864|0)}return w.words[w.length-1]===0&&(w.length--,w.words[w.length-1]===0&&w.length--),w};function q(){B.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(q,B);function E(){B.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(E,B);function L(){B.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(L,B),L.prototype.imulK=function(w){for(var c=0,h=0;h<w.length;h++){var d=(w.words[h]|0)*19+c,y=d&67108863;d>>>=26,w.words[h]=y,c=d}return c!==0&&(w.words[w.length++]=c),w},a._prime=function(w){if(K[w])return K[w];var c;if(w==="k256")c=new j;else if(w==="p224")c=new q;else if(w==="p192")c=new E;else if(w==="p25519")c=new L;else throw new Error("Unknown prime "+w);return K[w]=c,c};function te(z){if(typeof z=="string"){var w=a._prime(z);this.m=w.p,this.prime=w}else i(z.gtn(1),"modulus must be greater than 1"),this.m=z,this.prime=null}te.prototype._verify1=function(w){i(w.negative===0,"red works only with positives"),i(w.red,"red works only with red numbers")},te.prototype._verify2=function(w,c){i((w.negative|c.negative)===0,"red works only with positives"),i(w.red&&w.red===c.red,"red works only with red numbers")},te.prototype.imod=function(w){return this.prime?this.prime.ireduce(w)._forceRed(this):w.umod(this.m)._forceRed(this)},te.prototype.neg=function(w){return w.isZero()?w.clone():this.m.sub(w)._forceRed(this)},te.prototype.add=function(w,c){this._verify2(w,c);var h=w.add(c);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},te.prototype.iadd=function(w,c){this._verify2(w,c);var h=w.iadd(c);return h.cmp(this.m)>=0&&h.isub(this.m),h},te.prototype.sub=function(w,c){this._verify2(w,c);var h=w.sub(c);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},te.prototype.isub=function(w,c){this._verify2(w,c);var h=w.isub(c);return h.cmpn(0)<0&&h.iadd(this.m),h},te.prototype.shl=function(w,c){return this._verify1(w),this.imod(w.ushln(c))},te.prototype.imul=function(w,c){return this._verify2(w,c),this.imod(w.imul(c))},te.prototype.mul=function(w,c){return this._verify2(w,c),this.imod(w.mul(c))},te.prototype.isqr=function(w){return this.imul(w,w.clone())},te.prototype.sqr=function(w){return this.mul(w,w)},te.prototype.sqrt=function(w){if(w.isZero())return w.clone();var c=this.m.andln(3);if(i(c%2===1),c===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(w,h)}for(var d=this.m.subn(1),y=0;!d.isZero()&&d.andln(1)===0;)y++,d.iushrn(1);i(!d.isZero());var A=new a(1).toRed(this),D=A.redNeg(),x=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new a(2*g*g).toRed(this);this.pow(g,x).cmp(D)!==0;)g.redIAdd(D);for(var m=this.pow(g,d),N=this.pow(w,d.addn(1).iushrn(1)),Q=this.pow(w,d),re=y;Q.cmp(A)!==0;){for(var O=Q,Z=0;O.cmp(A)!==0;Z++)O=O.redSqr();i(Z<re);var k=this.pow(m,new a(1).iushln(re-Z-1));N=N.redMul(k),m=k.redSqr(),Q=Q.redMul(m),re=Z}return N},te.prototype.invm=function(w){var c=w._invmp(this.m);return c.negative!==0?(c.negative=0,this.imod(c).redNeg()):this.imod(c)},te.prototype.pow=function(w,c){if(c.isZero())return new a(1).toRed(this);if(c.cmpn(1)===0)return w.clone();var h=4,d=new Array(1<<h);d[0]=new a(1).toRed(this),d[1]=w;for(var y=2;y<d.length;y++)d[y]=this.mul(d[y-1],w);var A=d[0],D=0,x=0,g=c.bitLength()%26;for(g===0&&(g=26),y=c.length-1;y>=0;y--){for(var m=c.words[y],N=g-1;N>=0;N--){var Q=m>>N&1;if(A!==d[0]&&(A=this.sqr(A)),Q===0&&D===0){x=0;continue}D<<=1,D|=Q,x++,!(x!==h&&(y!==0||N!==0))&&(A=this.mul(A,d[D]),x=0,D=0)}g=26}return A},te.prototype.convertTo=function(w){var c=w.umod(this.m);return c===w?c.clone():c},te.prototype.convertFrom=function(w){var c=w.clone();return c.red=null,c},a.mont=function(w){return new ae(w)};function ae(z){te.call(this,z),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(ae,te),ae.prototype.convertTo=function(w){return this.imod(w.ushln(this.shift))},ae.prototype.convertFrom=function(w){var c=this.imod(w.mul(this.rinv));return c.red=null,c},ae.prototype.imul=function(w,c){if(w.isZero()||c.isZero())return w.words[0]=0,w.length=1,w;var h=w.imul(c),d=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(d).iushrn(this.shift),A=y;return y.cmp(this.m)>=0?A=y.isub(this.m):y.cmpn(0)<0&&(A=y.iadd(this.m)),A._forceRed(this)},ae.prototype.mul=function(w,c){if(w.isZero()||c.isZero())return new a(0)._forceRed(this);var h=w.mul(c),d=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=h.isub(d).iushrn(this.shift),A=y;return y.cmp(this.m)>=0?A=y.isub(this.m):y.cmpn(0)<0&&(A=y.iadd(this.m)),A._forceRed(this)},ae.prototype.invm=function(w){var c=this.imod(w._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(r,H_)}(ou)),ou.exports}var Ph={},d1;function eb(){return d1||(d1=1,function(r){var e=r;function t(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var l=[];
15if(typeof a!="string"){for(var p=0;p<a.length;p++)l[p]=a[p]|0;return l}if(f==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var p=0;p<a.length;p+=2)l.push(parseInt(a[p]+a[p+1],16))}else for(var p=0;p<a.length;p++){var u=a.charCodeAt(p),b=u>>8,_=u&255;b?l.push(b,_):l.push(_)}return l}e.toArray=t;function i(a){return a.length===1?"0"+a:a}e.zero2=i;function s(a){for(var f="",l=0;l<a.length;l++)f+=i(a[l].toString(16));return f}e.toHex=s,e.encode=function(f,l){return l==="hex"?s(f):f}}(Ph)),Ph}var p1;function Ri(){return p1||(p1=1,function(r){var e=r,t=Vn(),i=Us(),s=eb();e.assert=i,e.toArray=s.toArray,e.zero2=s.zero2,e.toHex=s.toHex,e.encode=s.encode;function a(b,_,M){var I=new Array(Math.max(b.bitLength(),M)+1),C;for(C=0;C<I.length;C+=1)I[C]=0;var R=1<<_+1,U=b.clone();for(C=0;C<I.length;C++){var V,F=U.andln(R-1);U.isOdd()?(F>(R>>1)-1?V=(R>>1)-F:V=F,U.isubn(V)):V=0,I[C]=V,U.iushrn(1)}return I}e.getNAF=a;function f(b,_){var M=[[],[]];b=b.clone(),_=_.clone();for(var I=0,C=0,R;b.cmpn(-I)>0||_.cmpn(-C)>0;){var U=b.andln(3)+I&3,V=_.andln(3)+C&3;U===3&&(U=-1),V===3&&(V=-1);var F;U&1?(R=b.andln(7)+I&7,(R===3||R===5)&&V===2?F=-U:F=U):F=0,M[0].push(F);var K;V&1?(R=_.andln(7)+C&7,(R===3||R===5)&&U===2?K=-V:K=V):K=0,M[1].push(K),2*I===F+1&&(I=1-I),2*C===K+1&&(C=1-C),b.iushrn(1),_.iushrn(1)}return M}e.getJSF=f;function l(b,_,M){var I="_"+_;b.prototype[_]=function(){return this[I]!==void 0?this[I]:this[I]=M.call(this)}}e.cachedProperty=l;function p(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=p;function u(b){return new t(b,"hex","le")}e.intFromLE=u}(Dh)),Dh}var Wc={exports:{}},g1;function tb(){if(g1)return Wc.exports;g1=1;var r;Wc.exports=function(s){return r||(r=new e(null)),r.generate(s)};function e(i){this.rand=i}if(Wc.exports.Rand=e,e.prototype.generate=function(s){return this._rand(s)},e.prototype._rand=function(s){if(this.rand.getBytes)return this.rand.getBytes(s);for(var a=new Uint8Array(s),f=0;f<a.length;f++)a[f]=this.rand.getByte();return a},typeof self=="object")self.crypto&&self.crypto.getRandomValues?e.prototype._rand=function(s){var a=new Uint8Array(s);return self.crypto.getRandomValues(a),a}:self.msCrypto&&self.msCrypto.getRandomValues?e.prototype._rand=function(s){var a=new Uint8Array(s);return self.msCrypto.getRandomValues(a),a}:typeof window=="object"&&(e.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var t=Kl;if(typeof t.randomBytes!="function")throw new Error("Not supported");e.prototype._rand=function(s){return t.randomBytes(s)}}catch{}return Wc.exports}var Ch={},Oh,v1;function qu(){if(v1)return Oh;v1=1;var r=Vn(),e=Ri(),t=e.getNAF,i=e.getJSF,s=e.assert;function a(l,p){this.type=l,this.p=new r(p.p,16),this.red=p.prime?r.red(p.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=p.n&&new r(p.n,16),this.g=p.g&&this.pointFromJSON(p.g,p.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var u=this.n&&this.p.div(this.n);!u||u.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}Oh=a,a.prototype.point=function(){throw new Error("Not implemented")},a.prototype.validate=function(){throw new Error("Not implemented")},a.prototype._fixedNafMul=function(p,u){s(p.precomputed);var b=p._getDoubles(),_=t(u,1,this._bitLength),M=(1<<b.step+1)-(b.step%2===0?2:1);M/=3;var I=[],C,R;for(C=0;C<_.length;C+=b.step){R=0;for(var U=C+b.step-1;U>=C;U--)R=(R<<1)+_[U];I.push(R)}for(var V=this.jpoint(null,null,null),F=this.jpoint(null,null,null),K=M;K>0;K--){for(C=0;C<I.length;C++)R=I[C],R===K?F=F.mixedAdd(b.points[C]):R===-K&&(F=F.mixedAdd(b.points[C].neg()));V=V.add(F)}return V.toP()},a.prototype._wnafMul=function(p,u){var b=4,_=p._getNAFPoints(b);b=_.wnd;for(var M=_.points,I=t(u,b,this._bitLength),C=this.jpoint(null,null,null),R=I.length-1;R>=0;R--){for(var U=0;R>=0&&I[R]===0;R--)U++;if(R>=0&&U++,C=C.dblp(U),R<0)break;var V=I[R];s(V!==0),p.type==="affine"?V>0?C=C.mixedAdd(M[V-1>>1]):C=C.mixedAdd(M[-V-1>>1].neg()):V>0?C=C.add(M[V-1>>1]):C=C.add(M[-V-1>>1].neg())}return p.type==="affine"?C.toP():C},a.prototype._wnafMulAdd=function(p,u,b,_,M){var I=this._wnafT1,C=this._wnafT2,R=this._wnafT3,U=0,V,F,K;for(V=0;V<_;V++){K=u[V];var B=K._getNAFPoints(p);I[V]=B.wnd,C[V]=B.points}for(V=_-1;V>=1;V-=2){var j=V-1,q=V;if(I[j]!==1||I[q]!==1){R[j]=t(b[j],I[j],this._bitLength),R[q]=t(b[q],I[q],this._bitLength),U=Math.max(R[j].length,U),U=Math.max(R[q].length,U);continue}var E=[u[j],null,null,u[q]];
15u[j].y.cmp(u[q].y)===0?(E[1]=u[j].add(u[q]),E[2]=u[j].toJ().mixedAdd(u[q].neg())):u[j].y.cmp(u[q].y.redNeg())===0?(E[1]=u[j].toJ().mixedAdd(u[q]),E[2]=u[j].add(u[q].neg())):(E[1]=u[j].toJ().mixedAdd(u[q]),E[2]=u[j].toJ().mixedAdd(u[q].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],te=i(b[j],b[q]);for(U=Math.max(te[0].length,U),R[j]=new Array(U),R[q]=new Array(U),F=0;F<U;F++){var ae=te[0][F]|0,z=te[1][F]|0;R[j][F]=L[(ae+1)*3+(z+1)],R[q][F]=0,C[j]=E}}var w=this.jpoint(null,null,null),c=this._wnafT4;for(V=U;V>=0;V--){for(var h=0;V>=0;){var d=!0;for(F=0;F<_;F++)c[F]=R[F][V]|0,c[F]!==0&&(d=!1);if(!d)break;h++,V--}if(V>=0&&h++,w=w.dblp(h),V<0)break;for(F=0;F<_;F++){var y=c[F];y!==0&&(y>0?K=C[F][y-1>>1]:y<0&&(K=C[F][-y-1>>1].neg()),K.type==="affine"?w=w.mixedAdd(K):w=w.add(K))}}for(V=0;V<_;V++)C[V]=null;return M?w:w.toP()};function f(l,p){this.curve=l,this.type=p,this.precomputed=null}return a.BasePoint=f,f.prototype.eq=function(){throw new Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},a.prototype.decodePoint=function(p,u){p=e.toArray(p,u);var b=this.p.byteLength();if((p[0]===4||p[0]===6||p[0]===7)&&p.length-1===2*b){p[0]===6?s(p[p.length-1]%2===0):p[0]===7&&s(p[p.length-1]%2===1);var _=this.point(p.slice(1,1+b),p.slice(1+b,1+2*b));return _}else if((p[0]===2||p[0]===3)&&p.length-1===b)return this.pointFromX(p.slice(1,1+b),p[0]===3);throw new Error("Unknown point format")},f.prototype.encodeCompressed=function(p){return this.encode(p,!0)},f.prototype._encode=function(p){var u=this.curve.p.byteLength(),b=this.getX().toArray("be",u);return p?[this.getY().isEven()?2:3].concat(b):[4].concat(b,this.getY().toArray("be",u))},f.prototype.encode=function(p,u){return e.encode(this._encode(u),p)},f.prototype.precompute=function(p){if(this.precomputed)return this;var u={doubles:null,naf:null,beta:null};return u.naf=this._getNAFPoints(8),u.doubles=this._getDoubles(4,p),u.beta=this._getBeta(),this.precomputed=u,this},f.prototype._hasDoubles=function(p){if(!this.precomputed)return!1;var u=this.precomputed.doubles;return u?u.points.length>=Math.ceil((p.bitLength()+1)/u.step):!1},f.prototype._getDoubles=function(p,u){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var b=[this],_=this,M=0;M<u;M+=p){for(var I=0;I<p;I++)_=_.dbl();b.push(_)}return{step:p,points:b}},f.prototype._getNAFPoints=function(p){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var u=[this],b=(1<<p)-1,_=b===1?null:this.dbl(),M=1;M<b;M++)u[M]=u[M-1].add(_);return{wnd:p,points:u}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(p){for(var u=this,b=0;b<p;b++)u=u.dbl();return u},Oh}var Rh,b1;function K_(){if(b1)return Rh;b1=1;var r=Ri(),e=Vn(),t=Ou(),i=qu(),s=r.assert;function a(p){i.call(this,"short",p),this.a=new e(p.a,16).toRed(this.red),this.b=new e(p.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(p),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}t(a,i),Rh=a,a.prototype._getEndomorphism=function(u){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var b,_;if(u.beta)b=new e(u.beta,16).toRed(this.red);else{var M=this._getEndoRoots(this.p);b=M[0].cmp(M[1])<0?M[0]:M[1],b=b.toRed(this.red)}if(u.lambda)_=new e(u.lambda,16);else{var I=this._getEndoRoots(this.n);this.g.mul(I[0]).x.cmp(this.g.x.redMul(b))===0?_=I[0]:(_=I[1],s(this.g.mul(_).x.cmp(this.g.x.redMul(b))===0))}var C;return u.basis?C=u.basis.map(function(R){return{a:new e(R.a,16),b:new e(R.b,16)}}):C=this._getEndoBasis(_),{beta:b,lambda:_,basis:C}}},a.prototype._getEndoRoots=function(u){var b=u===this.p?this.red:e.mont(u),_=new e(2).toRed(b).redInvm(),M=_.redNeg(),I=new e(3).toRed(b).redNeg().redSqrt().redMul(_),C=M.redAdd(I).fromRed(),R=M.redSub(I).fromRed();return[C,R]},a.prototype._getEndoBasis=function(u){for(var b=this.n.ushrn(Math.floor(this.n.bitLength()/2)),_=u,M=this.n.clone(),I=new e(1),C=new e(0),R=new e(0),U=new e(1),V,F,K,B,j,q,E,L=0,te,ae;_.cmpn(0)!==0;){var z=M.div(_);te=M.sub(z.mul(_)),ae=R.sub(z.mul(I));var w=U.sub(z.mul(C));if(!K&&te.cmp(b)<0)V=E.neg(),F=I,K=te.neg(),B=ae;else if(K&&++L===2)break;E=te,M=_,_=te,R=I,I=ae,U=C,C=w}j=te.neg(),q=ae;var c=K.sqr().add(B.sqr()),h=j.sqr().add(q.sqr());return h.cmp(c)>=0&&(j=V,q=F),K.negative&&(K=K.neg(),B=B.neg()),j.negative&&(j=j.neg(),q=q.neg()),[{a:K,b:B},{a:j,b:q}]},a.prototype._endoSplit=function(u){var b=this.endo.basis,_=b[0],M=b[1],I=M.b.mul(u).divRound(this.n),C=_.b.neg().mul(u).divRound(this.n),R=I.mul(_.a),U=C.mul(M.a),V=I.mul(_.b),F=C.mul(M.b),K=u.sub(R).sub(U),B=V.add(F).neg();return{k1:K,k2:B}},a.prototype.pointFromX=function(u,b){u=new e(u,16),u.red||(u=u.toRed(this.red));var _=u.redSqr().redMul(u).redIAdd(u.redMul(this.a)).redIAdd(this.b),M=_.redSqrt();if(M.redSqr().redSub(_).cmp(this.zero)!==0)throw new Error("invalid point");var I=M.fromRed().isOdd();return(b&&!I||!b&&I)&&(M=M.redNeg()),this.point(u,M)},a.prototype.validate=function(u){if(u.inf)return!0;var b=u.x,_=u.y,M=this.a.redMul(b),I=b.redSqr().redMul(b).redIAdd(M).redIAdd(this.b);return _.redSqr().redISub(I).cmpn(0)===0},a.prototype._endoWnafMulAdd=function(u,b,_){for(var M=this._endoWnafT1,I=this._endoWnafT2,C=0;C<u.length;C++){var R=this._endoSplit(b[C]),U=u[C],V=U._getBeta();R.k1.negative&&(R.k1.ineg(),U=U.neg(!0)),R.k2.negative&&(R.k2.ineg(),V=V.neg(!0)),M[C*2]=U,M[C*2+1]=V,I[C*2]=R.k1,I[C*2+1]=R.k2}for(var F=this._wnafMulAdd(1,M,I,C*2,_),K=0;K<C*2;K++)M[K]=null,I[K]=null;return F};function f(p,u,b,_){i.BasePoint.call(this,p,"affine"),u===null&&b===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new e(u,16),this.y=new e(b,16),_&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}
vendor: 8,288 bytes, line 15
15t(f,i.BasePoint),a.prototype.point=function(u,b,_){return new f(this,u,b,_)},a.prototype.pointFromJSON=function(u,b){return f.fromJSON(this,u,b)},f.prototype._getBeta=function(){if(this.curve.endo){var u=this.precomputed;if(u&&u.beta)return u.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(u){var _=this.curve,M=function(I){return _.point(I.x.redMul(_.endo.beta),I.y)};u.beta=b,b.precomputed={beta:null,naf:u.naf&&{wnd:u.naf.wnd,points:u.naf.points.map(M)},doubles:u.doubles&&{step:u.doubles.step,points:u.doubles.points.map(M)}}}return b}},f.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},f.fromJSON=function(u,b,_){typeof b=="string"&&(b=JSON.parse(b));var M=u.point(b[0],b[1],_);if(!b[2])return M;function I(R){return u.point(R[0],R[1],_)}var C=b[2];return M.precomputed={beta:null,doubles:C.doubles&&{step:C.doubles.step,points:[M].concat(C.doubles.points.map(I))},naf:C.naf&&{wnd:C.naf.wnd,points:[M].concat(C.naf.points.map(I))}},M},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(u){if(this.inf)return u;if(u.inf)return this;if(this.eq(u))return this.dbl();if(this.neg().eq(u))return this.curve.point(null,null);if(this.x.cmp(u.x)===0)return this.curve.point(null,null);var b=this.y.redSub(u.y);b.cmpn(0)!==0&&(b=b.redMul(this.x.redSub(u.x).redInvm()));var _=b.redSqr().redISub(this.x).redISub(u.x),M=b.redMul(this.x.redSub(_)).redISub(this.y);return this.curve.point(_,M)},f.prototype.dbl=function(){if(this.inf)return this;var u=this.y.redAdd(this.y);if(u.cmpn(0)===0)return this.curve.point(null,null);var b=this.curve.a,_=this.x.redSqr(),M=u.redInvm(),I=_.redAdd(_).redIAdd(_).redIAdd(b).redMul(M),C=I.redSqr().redISub(this.x.redAdd(this.x)),R=I.redMul(this.x.redSub(C)).redISub(this.y);return this.curve.point(C,R)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(u){return u=new e(u,16),this.isInfinity()?this:this._hasDoubles(u)?this.curve._fixedNafMul(this,u):this.curve.endo?this.curve._endoWnafMulAdd([this],[u]):this.curve._wnafMul(this,u)},f.prototype.mulAdd=function(u,b,_){var M=[this,b],I=[u,_];return this.curve.endo?this.curve._endoWnafMulAdd(M,I):this.curve._wnafMulAdd(1,M,I,2)},f.prototype.jmulAdd=function(u,b,_){var M=[this,b],I=[u,_];return this.curve.endo?this.curve._endoWnafMulAdd(M,I,!0):this.curve._wnafMulAdd(1,M,I,2,!0)},f.prototype.eq=function(u){return this===u||this.inf===u.inf&&(this.inf||this.x.cmp(u.x)===0&&this.y.cmp(u.y)===0)},f.prototype.neg=function(u){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(u&&this.precomputed){var _=this.precomputed,M=function(I){return I.neg()};b.precomputed={naf:_.naf&&{wnd:_.naf.wnd,points:_.naf.points.map(M)},doubles:_.doubles&&{step:_.doubles.step,points:_.doubles.points.map(M)}}}return b},f.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var u=this.curve.jpoint(this.x,this.y,this.curve.one);return u};function l(p,u,b,_){i.BasePoint.call(this,p,"jacobian"),u===null&&b===null&&_===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new e(0)):(this.x=new e(u,16),this.y=new e(b,16),this.z=new e(_,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}return t(l,i.BasePoint),a.prototype.jpoint=function(u,b,_){return new l(this,u,b,_)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var u=this.z.redInvm(),b=u.redSqr(),_=this.x.redMul(b),M=this.y.redMul(b).redMul(u);return this.curve.point(_,M)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(u){if(this.isInfinity())return u;if(u.isInfinity())return this;var b=u.z.redSqr(),_=this.z.redSqr(),M=this.x.redMul(b),I=u.x.redMul(_),C=this.y.redMul(b.redMul(u.z)),R=u.y.redMul(_.redMul(this.z)),U=M.redSub(I),V=C.redSub(R);if(U.cmpn(0)===0)return V.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var F=U.redSqr(),K=F.redMul(U),B=M.redMul(F),j=V.redSqr().redIAdd(K).redISub(B).redISub(B),q=V.redMul(B.redISub(j)).redISub(C.redMul(K)),E=this.z.redMul(u.z).redMul(U);return this.curve.jpoint(j,q,E)},l.prototype.mixedAdd=function(u){if(this.isInfinity())return u.toJ();if(u.isInfinity())return this;var b=this.z.redSqr(),_=this.x,M=u.x.redMul(b),I=this.y,C=u.y.redMul(b).redMul(this.z),R=_.redSub(M),U=I.redSub(C);if(R.cmpn(0)===0)return U.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var V=R.redSqr(),F=V.redMul(R),K=_.redMul(V),B=U.redSqr().redIAdd(F).redISub(K).redISub(K),j=U.redMul(K.redISub(B)).redISub(I.redMul(F)),q=this.z.redMul(R);return this.curve.jpoint(B,j,q)},l.prototype.dblp=function(u){if(u===0)return this;if(this.isInfinity())return this;if(!u)return this.dbl();var b;if(this.curve.zeroA||this.curve.threeA){var _=this;for(b=0;b<u;b++)_=_.dbl();return _}var M=this.curve.a,I=this.curve.tinv,C=this.x,R=this.y,U=this.z,V=U.redSqr().redSqr(),F=R.redAdd(R);for(b=0;b<u;b++){var K=C.redSqr(),B=F.redSqr(),j=B.redSqr(),q=K.redAdd(K).redIAdd(K).redIAdd(M.redMul(V)),E=C.redMul(B),L=q.redSqr().redISub(E.redAdd(E)),te=E.redISub(L),ae=q.redMul(te);ae=ae.redIAdd(ae).redISub(j);var z=F.redMul(U);b+1<u&&(V=V.redMul(j)),C=L,U=z,F=ae}return this.curve.jpoint(C,F.redMul(I),U)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var u,b,_;if(this.zOne){var M=this.x.redSqr(),I=this.y.redSqr(),C=I.redSqr(),R=this.x.redAdd(I).redSqr().redISub(M).redISub(C);R=R.redIAdd(R);var U=M.redAdd(M).redIAdd(M),V=U.redSqr().redISub(R).redISub(R),F=C.redIAdd(C);F=F.redIAdd(F),F=F.redIAdd(F),u=V,b=U.redMul(R.redISub(V)).redISub(F),_=this.y.redAdd(this.y)}else{var K=this.x.redSqr(),B=this.y.redSqr(),j=B.redSqr(),q=this.x.redAdd(B).redSqr().redISub(K).redISub(j);q=q.redIAdd(q);var E=K.redAdd(K).redIAdd(K),L=E.redSqr(),te=j.redIAdd(j);te=te.redIAdd(te),te=te.redIAdd(te),u=L.redISub(q).redISub(q),b=E.redMul(q.redISub(u)).redISub(te),_=this.y.redMul(this.z),_=_.redIAdd(_)}return this.curve.jpoint(u,b,_)},l.prototype._threeDbl=function(){var u,b,_;if(this.zOne){var M=this.x.redSqr(),I=this.y.redSqr(),C=I.redSqr(),R=this.x.redAdd(I).redSqr().redISub(M).redISub(C);R=R.redIAdd(R);var U=M.redAdd(M).redIAdd(M).redIAdd(this.curve.a),V=U.redSqr().redISub(R).redISub(R);u=V;var F=C.redIAdd(C);F=F.redIAdd(F),F=F.redIAdd(F),b=U.redMul(R.redISub(V)).redISub(F),_=this.y.redAdd(this.y)}else{var K=this.z.redSqr(),B=this.y.redSqr(),j=this.x.redMul(B),q=this.x.redSub(K).redMul(this.x.redAdd(K));q=q.redAdd(q).redIAdd(q);var E=j.redIAdd(j);E=E.redIAdd(E);var L=E.redAdd(E);u=q.redSqr().redISub(L),_=this.y.redAdd(this.z).redSqr().redISub(B).redISub(K);var te=B.redSqr();te=te.redIAdd(te),te=te.redIAdd(te),te=te.redIAdd(te),b=q.redMul(E.redISub(u)).redISub(te)}return this.curve.jpoint(u,b,_)},l.prototype._dbl=function(){var u=this.curve.a,b=this.x,_=this.y,M=this.z,I=M.redSqr().redSqr(),C=b.redSqr(),R=_.redSqr(),U=C.redAdd(C).redIAdd(C).redIAdd(u.redMul(I)),V=b.redAdd(b);V=V.redIAdd(V);var F=V.redMul(R),K=U.redSqr().redISub(F.redAdd(F)),B=F.redISub(K),j=R.redSqr();j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var q=U.redMul(B).redISub(j),E=_.redAdd(_).redMul(M);return this.curve.jpoint(K,q,E)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var u=this.x.redSqr(),b=this.y.redSqr(),_=this.z.redSqr(),M=b.redSqr(),I=u.redAdd(u).redIAdd(u),C=I.redSqr(),R=this.x.redAdd(b).redSqr().redISub(u).redISub(M);R=R.redIAdd(R),R=R.redAdd(R).redIAdd(R),R=R.redISub(C);var U=R.redSqr(),V=M.redIAdd(M);V=V.redIAdd(V),V=V.redIAdd(V),V=V.redIAdd(V);var F=I.redIAdd(R).redSqr().redISub(C).redISub(U).redISub(V),K=b.redMul(F);
15K=K.redIAdd(K),K=K.redIAdd(K);var B=this.x.redMul(U).redISub(K);B=B.redIAdd(B),B=B.redIAdd(B);var j=this.y.redMul(F.redMul(V.redISub(F)).redISub(R.redMul(U)));j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var q=this.z.redAdd(R).redSqr().redISub(_).redISub(U);return this.curve.jpoint(B,j,q)},l.prototype.mul=function(u,b){return u=new e(u,b),this.curve._wnafMul(this,u)},l.prototype.eq=function(u){if(u.type==="affine")return this.eq(u.toJ());if(this===u)return!0;var b=this.z.redSqr(),_=u.z.redSqr();if(this.x.redMul(_).redISub(u.x.redMul(b)).cmpn(0)!==0)return!1;var M=b.redMul(this.z),I=_.redMul(u.z);return this.y.redMul(I).redISub(u.y.redMul(M)).cmpn(0)===0},l.prototype.eqXToP=function(u){var b=this.z.redSqr(),_=u.toRed(this.curve.red).redMul(b);if(this.x.cmp(_)===0)return!0;for(var M=u.clone(),I=this.curve.redN.redMul(b);;){if(M.iadd(this.curve.n),M.cmp(this.curve.p)>=0)return!1;if(_.redIAdd(I),this.x.cmp(_)===0)return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Rh}var Nh,m1;function V_(){if(m1)return Nh;m1=1;var r=Vn(),e=Ou(),t=qu(),i=Ri();function s(f){t.call(this,"mont",f),this.a=new r(f.a,16).toRed(this.red),this.b=new r(f.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}e(s,t),Nh=s,s.prototype.validate=function(l){var p=l.normalize().x,u=p.redSqr(),b=u.redMul(p).redAdd(u.redMul(this.a)).redAdd(p),_=b.redSqrt();return _.redSqr().cmp(b)===0};function a(f,l,p){t.BasePoint.call(this,f,"projective"),l===null&&p===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(l,16),this.z=new r(p,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return e(a,t.BasePoint),s.prototype.decodePoint=function(l,p){return this.point(i.toArray(l,p),1)},s.prototype.point=function(l,p){return new a(this,l,p)},s.prototype.pointFromJSON=function(l){return a.fromJSON(this,l)},a.prototype.precompute=function(){},a.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},a.fromJSON=function(l,p){return new a(l,p[0],p[1]||l.one)},a.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},a.prototype.isInfinity=function(){return this.z.cmpn(0)===0},a.prototype.dbl=function(){var l=this.x.redAdd(this.z),p=l.redSqr(),u=this.x.redSub(this.z),b=u.redSqr(),_=p.redSub(b),M=p.redMul(b),I=_.redMul(b.redAdd(this.curve.a24.redMul(_)));return this.curve.point(M,I)},a.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.diffAdd=function(l,p){var u=this.x.redAdd(this.z),b=this.x.redSub(this.z),_=l.x.redAdd(l.z),M=l.x.redSub(l.z),I=M.redMul(u),C=_.redMul(b),R=p.z.redMul(I.redAdd(C).redSqr()),U=p.x.redMul(I.redISub(C).redSqr());return this.curve.point(R,U)},a.prototype.mul=function(l){for(var p=l.clone(),u=this,b=this.curve.point(null,null),_=this,M=[];p.cmpn(0)!==0;p.iushrn(1))M.push(p.andln(1));for(var I=M.length-1;I>=0;I--)M[I]===0?(u=u.diffAdd(b,_),b=b.dbl()):(b=u.diffAdd(b,_),u=u.dbl());return b},a.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},a.prototype.eq=function(l){return this.getX().cmp(l.getX())===0},a.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},a.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Nh}var Th,y1;function G_(){if(y1)return Th;y1=1;var r=Ri(),e=Vn(),t=Ou(),i=qu(),s=r.assert;function a(l){this.twisted=(l.a|0)!==1,this.mOneA=this.twisted&&(l.a|0)===-1,this.extended=this.mOneA,i.call(this,"edwards",l),this.a=new e(l.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new e(l.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new e(l.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(l.c|0)===1}
15t(a,i),Th=a,a.prototype._mulA=function(p){return this.mOneA?p.redNeg():this.a.redMul(p)},a.prototype._mulC=function(p){return this.oneC?p:this.c.redMul(p)},a.prototype.jpoint=function(p,u,b,_){return this.point(p,u,b,_)},a.prototype.pointFromX=function(p,u){p=new e(p,16),p.red||(p=p.toRed(this.red));var b=p.redSqr(),_=this.c2.redSub(this.a.redMul(b)),M=this.one.redSub(this.c2.redMul(this.d).redMul(b)),I=_.redMul(M.redInvm()),C=I.redSqrt();if(C.redSqr().redSub(I).cmp(this.zero)!==0)throw new Error("invalid point");var R=C.fromRed().isOdd();return(u&&!R||!u&&R)&&(C=C.redNeg()),this.point(p,C)},a.prototype.pointFromY=function(p,u){p=new e(p,16),p.red||(p=p.toRed(this.red));var b=p.redSqr(),_=b.redSub(this.c2),M=b.redMul(this.d).redMul(this.c2).redSub(this.a),I=_.redMul(M.redInvm());if(I.cmp(this.zero)===0){if(u)throw new Error("invalid point");return this.point(this.zero,p)}var C=I.redSqrt();if(C.redSqr().redSub(I).cmp(this.zero)!==0)throw new Error("invalid point");return C.fromRed().isOdd()!==u&&(C=C.redNeg()),this.point(C,p)},a.prototype.validate=function(p){if(p.isInfinity())return!0;p.normalize();var u=p.x.redSqr(),b=p.y.redSqr(),_=u.redMul(this.a).redAdd(b),M=this.c2.redMul(this.one.redAdd(this.d.redMul(u).redMul(b)));return _.cmp(M)===0};function f(l,p,u,b,_){i.BasePoint.call(this,l,"projective"),p===null&&u===null&&b===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new e(p,16),this.y=new e(u,16),this.z=b?new e(b,16):this.curve.one,this.t=_&&new e(_,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}return t(f,i.BasePoint),a.prototype.pointFromJSON=function(p){return f.fromJSON(this,p)},a.prototype.point=function(p,u,b,_){return new f(this,p,u,b,_)},f.fromJSON=function(p,u){return new f(p,u[0],u[1],u[2])},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},f.prototype._extDbl=function(){var p=this.x.redSqr(),u=this.y.redSqr(),b=this.z.redSqr();b=b.redIAdd(b);var _=this.curve._mulA(p),M=this.x.redAdd(this.y).redSqr().redISub(p).redISub(u),I=_.redAdd(u),C=I.redSub(b),R=_.redSub(u),U=M.redMul(C),V=I.redMul(R),F=M.redMul(R),K=C.redMul(I);return this.curve.point(U,V,K,F)},f.prototype._projDbl=function(){var p=this.x.redAdd(this.y).redSqr(),u=this.x.redSqr(),b=this.y.redSqr(),_,M,I,C,R,U;if(this.curve.twisted){C=this.curve._mulA(u);var V=C.redAdd(b);this.zOne?(_=p.redSub(u).redSub(b).redMul(V.redSub(this.curve.two)),M=V.redMul(C.redSub(b)),I=V.redSqr().redSub(V).redSub(V)):(R=this.z.redSqr(),U=V.redSub(R).redISub(R),_=p.redSub(u).redISub(b).redMul(U),M=V.redMul(C.redSub(b)),I=V.redMul(U))}else C=u.redAdd(b),R=this.curve._mulC(this.z).redSqr(),U=C.redSub(R).redSub(R),_=this.curve._mulC(p.redISub(C)).redMul(U),M=this.curve._mulC(C).redMul(u.redISub(b)),I=C.redMul(U);return this.curve.point(_,M,I)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(p){var u=this.y.redSub(this.x).redMul(p.y.redSub(p.x)),b=this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)),_=this.t.redMul(this.curve.dd).redMul(p.t),M=this.z.redMul(p.z.redAdd(p.z)),I=b.redSub(u),C=M.redSub(_),R=M.redAdd(_),U=b.redAdd(u),V=I.redMul(C),F=R.redMul(U),K=I.redMul(U),B=C.redMul(R);return this.curve.point(V,F,B,K)},f.prototype._projAdd=function(p){var u=this.z.redMul(p.z),b=u.redSqr(),_=this.x.redMul(p.x),M=this.y.redMul(p.y),I=this.curve.d.redMul(_).redMul(M),C=b.redSub(I),R=b.redAdd(I),U=this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(_).redISub(M),V=u.redMul(C).redMul(U),F,K;return this.curve.twisted?(F=u.redMul(R).redMul(M.redSub(this.curve._mulA(_))),K=C.redMul(R)):(F=u.redMul(R).redMul(M.redSub(_)),K=this.curve._mulC(C).redMul(R)),this.curve.point(V,F,K)},f.prototype.add=function(p){return this.isInfinity()?p:p.isInfinity()?this:this.curve.extended?this._extAdd(p):this._projAdd(p)},f.prototype.mul=function(p){return this._hasDoubles(p)?this.curve._fixedNafMul(this,p):this.curve._wnafMul(this,p)},f.prototype.mulAdd=function(p,u,b){return this.curve._wnafMulAdd(1,[this,u],[p,b],2,!1)},f.prototype.jmulAdd=function(p,u,b){return this.curve._wnafMulAdd(1,[this,u],[p,b],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var p=this.z.redInvm();return this.x=this.x.redMul(p),this.y=this.y.redMul(p),this.t&&(this.t=this.t.redMul(p)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(p){return this===p||this.getX().cmp(p.getX())===0&&this.getY().cmp(p.getY())===0},f.prototype.eqXToP=function(p){var u=p.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(u)===0)return!0;for(var b=p.clone(),_=this.curve.redN.redMul(this.z);;){if(b.iadd(this.curve.n),b.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(_),this.x.cmp(u)===0)return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add,Th}var w1;function rb(){return w1||(w1=1,function(r){var e=r;e.base=qu(),e.short=K_(),e.mont=V_(),e.edwards=G_()}(Ch)),Ch}var qh={},Fh,_1;function W_(){return _1||(_1=1,Fh
vendor: 26,127 bytes, line 15
15={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}
15),Fh}var A1;function Yl(){return A1||(A1=1,function(r){var e=r,t=Vl(),i=rb(),s=Ri(),a=s.assert;function f(u){u.type==="short"?this.curve=new i.short(u):u.type==="edwards"?this.curve=new i.edwards(u):this.curve=new i.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=f;function l(u,b){Object.defineProperty(e,u,{configurable:!0,enumerable:!0,get:function(){var _=new f(b);return Object.defineProperty(e,u,{configurable:!0,enumerable:!0,value:_}),_}})}l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:t.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:t.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:t.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:t.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:t.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:t.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var p;try{p=W_()}catch{p=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:t.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
15,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",p]})}(qh)),qh}var Bh,E1;function J_(){if(E1)return Bh;E1=1;var r=Vl(),e=eb(),t=Us();function i(s){if(!(this instanceof i))return new i(s);this.hash=s.hash,this.predResist=!!s.predResist,this.outLen=this.hash.outSize,this.minEntropy=s.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var a=e.toArray(s.entropy,s.entropyEnc||"hex"),f=e.toArray(s.nonce,s.nonceEnc||"hex"),l=e.toArray(s.pers,s.persEnc||"hex");t(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(a,f,l)}return Bh=i,i.prototype._init=function(a,f,l){var p=a.concat(f).concat(l);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var u=0;u<this.V.length;u++)this.K[u]=0,this.V[u]=1;this._update(p),this._reseed=1,this.reseedInterval=281474976710656},i.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},i.prototype._update=function(a){var f=this._hmac().update(this.V).update([0]);a&&(f=f.update(a)),this.K=f.digest(),this.V=this._hmac().update(this.V).digest(),a&&(this.K=this._hmac().update(this.V).update([1]).update(a).digest(),this.V=this._hmac().update(this.V).digest())},i.prototype.reseed=function(a,f,l,p){typeof f!="string"&&(p=l,l=f,f=null),a=e.toArray(a,f),l=e.toArray(l,p),t(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(a.concat(l||[])),this._reseed=1},i.prototype.generate=function(a,f,l,p){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof f!="string"&&(p=l,l=f,f=null),l&&(l=e.toArray(l,p||"hex"),this._update(l));for(var u=[];u.length<a;)this.V=this._hmac().update(this.V).digest(),u=u.concat(this.V);var b=u.slice(0,a);return this._update(l),this._reseed++,e.encode(b,f)},Bh}var Lh,x1;function Y_(){if(x1)return Lh;x1=1;var r=Vn(),e=Ri(),t=e.assert;function i(s,a){this.ec=s,this.priv=null,this.pub=null,a.priv&&this._importPrivate(a.priv,a.privEnc),a.pub&&this._importPublic(a.pub,a.pubEnc)}return Lh=i,i.fromPublic=function(a,f,l){return f instanceof i?f:new i(a,{pub:f,pubEnc:l})},i.fromPrivate=function(a,f,l){return f instanceof i?f:new i(a,{priv:f,privEnc:l})},i.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(a,f){return typeof a=="string"&&(f=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),f?this.pub.encode(f,a):this.pub},i.prototype.getPrivate=function(a){return a==="hex"?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(a,f){this.priv=new r(a,f||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(a,f){if(a.x||a.y){this.ec.curve.type==="mont"?t(a.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&t(a.x&&a.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(a.x,a.y);return}this.pub=this.ec.curve.decodePoint(a,f)},i.prototype.derive=function(a){return a.validate()||t(a.validate(),"public point not validated"),a.mul(this.priv).getX()},i.prototype.sign=function(a,f,l){return this.ec.sign(a,this,f,l)},i.prototype.verify=function(a,f,l){return this.ec.verify(a,f,this,void 0,l)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},Lh}var Uh,S1;function Q_(){if(S1)return Uh;S1=1;var r=Vn(),e=Ri(),t=e.assert;function i(p,u){if(p instanceof i)return p;this._importDER(p,u)||(t(p.r&&p.s,"Signature without r or s"),this.r=new r(p.r,16),this.s=new r(p.s,16),p.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=p.recoveryParam)}Uh=i;function s(){this.place=0}function a(p,u){var b=p[u.place++];if(!(b&128))return b;var _=b&15;if(_===0||_>4||p[u.place]===0)return!1;for(var M=0,I=0,C=u.place;I<_;I++,C++)M<<=8,M|=p[C],M>>>=0;return M<=127?!1:(u.place=C,M)}function f(p){for(var u=0,b=p.length-1;!p[u]&&!(p[u+1]&128)&&u<b;)u++;return u===0?p:p.slice(u)}i.prototype._importDER=function(u,b){u=e.toArray(u,b);var _=new s;if(u[_.place++]!==48)return!1;var M=a(u,_);if(M===!1||M+_.place!==u.length||u[_.place++]!==2)return!1;var I=a(u,_);if(I===!1||u[_.place]&128)return!1;var C=u.slice(_.place,I+_.place);if(_.place+=I,u[_.place++]!==2)return!1;var R=a(u,_);if(R===!1||u.length!==R+_.place||u[_.place]&128)return!1;var U=u.slice(_.place,R+_.place);if(C[0]===0)if(C[1]&128)C=C.slice(1);else return!1;if(U[0]===0)if(U[1]&128)U=U.slice(1);else return!1;return this.r=new r(C),this.s=new r(U),this.recoveryParam=null,!0};function l(p,u){if(u<128){p.push(u);return}var b=1+(Math.log(u)/Math.LN2>>>3);for(p.push(b|128);--b;)p.push(u>>>(b<<3)&255);p.push(u)}return i.prototype.toDER=function(u){var b=this.r.toArray(),_=this.s.toArray();
15for(b[0]&128&&(b=[0].concat(b)),_[0]&128&&(_=[0].concat(_)),b=f(b),_=f(_);!_[0]&&!(_[1]&128);)_=_.slice(1);var M=[2];l(M,b.length),M=M.concat(b),M.push(2),l(M,_.length);var I=M.concat(_),C=[48];return l(C,I.length),C=C.concat(I),e.encode(C,u)},Uh}var zh,M1;function X_(){if(M1)return zh;M1=1;var r=Vn(),e=J_(),t=Ri(),i=Yl(),s=tb(),a=t.assert,f=Y_(),l=Q_();function p(u){if(!(this instanceof p))return new p(u);typeof u=="string"&&(a(Object.prototype.hasOwnProperty.call(i,u),"Unknown curve "+u),u=i[u]),u instanceof i.PresetCurve&&(u={curve:u}),this.curve=u.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=u.curve.g,this.g.precompute(u.curve.n.bitLength()+1),this.hash=u.hash||u.curve.hash}return zh=p,p.prototype.keyPair=function(b){return new f(this,b)},p.prototype.keyFromPrivate=function(b,_){return f.fromPrivate(this,b,_)},p.prototype.keyFromPublic=function(b,_){return f.fromPublic(this,b,_)},p.prototype.genKeyPair=function(b){b||(b={});for(var _=new e({hash:this.hash,pers:b.pers,persEnc:b.persEnc||"utf8",entropy:b.entropy||s(this.hash.hmacStrength),entropyEnc:b.entropy&&b.entropyEnc||"utf8",nonce:this.n.toArray()}),M=this.n.byteLength(),I=this.n.sub(new r(2));;){var C=new r(_.generate(M));if(!(C.cmp(I)>0))return C.iaddn(1),this.keyFromPrivate(C)}},p.prototype._truncateToN=function(b,_,M){var I;if(r.isBN(b)||typeof b=="number")b=new r(b,16),I=b.byteLength();else if(typeof b=="object")I=b.length,b=new r(b,16);else{var C=b.toString();I=C.length+1>>>1,b=new r(C,16)}typeof M!="number"&&(M=I*8);var R=M-this.n.bitLength();return R>0&&(b=b.ushrn(R)),!_&&b.cmp(this.n)>=0?b.sub(this.n):b},p.prototype.sign=function(b,_,M,I){if(typeof M=="object"&&(I=M,M=null),I||(I={}),typeof b!="string"&&typeof b!="number"&&!r.isBN(b)){a(typeof b=="object"&&b&&typeof b.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),a(b.length>>>0===b.length);for(var C=0;C<b.length;C++)a((b[C]&255)===b[C])}_=this.keyFromPrivate(_,M),b=this._truncateToN(b,!1,I.msgBitLength),a(!b.isNeg(),"Can not sign a negative message");var R=this.n.byteLength(),U=_.getPrivate().toArray("be",R),V=b.toArray("be",R);a(new r(V).eq(b),"Can not sign message");for(var F=new e({hash:this.hash,entropy:U,nonce:V,pers:I.pers,persEnc:I.persEnc||"utf8"}),K=this.n.sub(new r(1)),B=0;;B++){var j=I.k?I.k(B):new r(F.generate(this.n.byteLength()));if(j=this._truncateToN(j,!0),!(j.cmpn(1)<=0||j.cmp(K)>=0)){var q=this.g.mul(j);if(!q.isInfinity()){var E=q.getX(),L=E.umod(this.n);if(L.cmpn(0)!==0){var te=j.invm(this.n).mul(L.mul(_.getPrivate()).iadd(b));if(te=te.umod(this.n),te.cmpn(0)!==0){var ae=(q.getY().isOdd()?1:0)|(E.cmp(L)!==0?2:0);return I.canonical&&te.cmp(this.nh)>0&&(te=this.n.sub(te),ae^=1),new l({r:L,s:te,recoveryParam:ae})}}}}}},p.prototype.verify=function(b,_,M,I,C){C||(C={}),b=this._truncateToN(b,!1,C.msgBitLength),M=this.keyFromPublic(M,I),_=new l(_,"hex");var R=_.r,U=_.s;if(R.cmpn(1)<0||R.cmp(this.n)>=0||U.cmpn(1)<0||U.cmp(this.n)>=0)return!1;var V=U.invm(this.n),F=V.mul(b).umod(this.n),K=V.mul(R).umod(this.n),B;return this.curve._maxwellTrick?(B=this.g.jmulAdd(F,M.getPublic(),K),B.isInfinity()?!1:B.eqXToP(R)):(B=this.g.mulAdd(F,M.getPublic(),K),B.isInfinity()?!1:B.getX().umod(this.n).cmp(R)===0)},p.prototype.recoverPubKey=function(u,b,_,M){a((3&_)===_,"The recovery param is more than two bits"),b=new l(b,M);var I=this.n,C=new r(u),R=b.r,U=b.s,V=_&1,F=_>>1;if(R.cmp(this.curve.p.umod(this.curve.n))>=0&&F)throw new Error("Unable to find sencond key candinate");F?R=this.curve.pointFromX(R.add(this.curve.n),V):R=this.curve.pointFromX(R,V);var K=b.r.invm(I),B=I.sub(C).mul(K).umod(I),j=U.mul(K).umod(I);return this.g.mulAdd(B,R,j)},p.prototype.getKeyRecoveryParam=function(u,b,_,M){if(b=new l(b,M),b.recoveryParam!==null)return b.recoveryParam;for(var I=0;I<4;I++){var C;try{C=this.recoverPubKey(u,b,I)}catch{continue}if(C.eq(_))return I}throw new Error("Unable to find valid recovery factor")},zh}var jh,I1;function Z_(){if(I1)return jh;I1=1;var r=Ri(),e=r.assert,t=r.parseBytes,i=r.cachedProperty;function s(a,f){this.eddsa=a,this._secret=t(f.secret),a.isPoint(f.pub)?this._pub=f.pub:this._pubBytes=t(f.pub)}return s.fromPublic=function(f,l){return l instanceof s?l:new s(f,{pub:l})},s.fromSecret=function(f,l){return l instanceof s?l:new s(f,{secret:l})},s.prototype.secret=function(){return this._secret},i(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(s,"privBytes",function(){var f=this.eddsa,l=this.hash(),p=f.encodingLength-1,u=l.slice(0,f.encodingLength);return u[0]&=248,u[p]&=127,u[p]|=64,u}),i(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(f){return e(this._secret,"KeyPair can only verify"),this.eddsa.sign(f,this)},s.prototype.verify=function(f,l){return this.eddsa.verify(f,l,this)},s.prototype.getSecret=function(f){return e(this._secret,"KeyPair is public only"),r.encode(this.secret(),f)},s.prototype.getPublic=function(f){return r.encode(this.pubBytes(),f)},jh=s,jh}var $h,D1;function e7(){if(D1)return $h;D1=1;var r=Vn(),e=Ri(),t=e.assert,i=e.cachedProperty,s=e.parseBytes;function a(f,l){this.eddsa=f,typeof l!="object"&&(l=s(l)),Array.isArray(l)&&(t(l.length===f.encodingLength*2,"Signature has invali
15d size"),l={R:l.slice(0,f.encodingLength),S:l.slice(f.encodingLength)}),t(l.R&&l.S,"Signature without R or S"),f.isPoint(l.R)&&(this._R=l.R),l.S instanceof r&&(this._S=l.S),this._Rencoded=Array.isArray(l.R)?l.R:l.Rencoded,this._Sencoded=Array.isArray(l.S)?l.S:l.Sencoded}return i(a,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),i(a,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),i(a,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),i(a,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),a.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},a.prototype.toHex=function(){return e.encode(this.toBytes(),"hex").toUpperCase()},$h=a,$h}var kh,P1;function t7(){if(P1)return kh;P1=1;var r=Vl(),e=Yl(),t=Ri(),i=t.assert,s=t.parseBytes,a=Z_(),f=e7();function l(p){if(i(p==="ed25519","only tested with ed25519 so far"),!(this instanceof l))return new l(p);p=e[p].curve,this.curve=p,this.g=p.g,this.g.precompute(p.n.bitLength()+1),this.pointClass=p.point().constructor,this.encodingLength=Math.ceil(p.n.bitLength()/8),this.hash=r.sha512}return kh=l,l.prototype.sign=function(u,b){u=s(u);var _=this.keyFromSecret(b),M=this.hashInt(_.messagePrefix(),u),I=this.g.mul(M),C=this.encodePoint(I),R=this.hashInt(C,_.pubBytes(),u).mul(_.priv()),U=M.add(R).umod(this.curve.n);return this.makeSignature({R:I,S:U,Rencoded:C})},l.prototype.verify=function(u,b,_){if(u=s(u),b=this.makeSignature(b),b.S().gte(b.eddsa.curve.n)||b.S().isNeg())return!1;var M=this.keyFromPublic(_),I=this.hashInt(b.Rencoded(),M.pubBytes(),u),C=this.g.mul(b.S()),R=b.R().add(M.pub().mul(I));return R.eq(C)},l.prototype.hashInt=function(){for(var u=this.hash(),b=0;b<arguments.length;b++)u.update(arguments[b]);return t.intFromLE(u.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(u){return a.fromPublic(this,u)},l.prototype.keyFromSecret=function(u){return a.fromSecret(this,u)},l.prototype.makeSignature=function(u){return u instanceof f?u:new f(this,u)},l.prototype.encodePoint=function(u){var b=u.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=u.getX().isOdd()?128:0,b},l.prototype.decodePoint=function(u){u=t.parseBytes(u);var b=u.length-1,_=u.slice(0,b).concat(u[b]&-129),M=(u[b]&128)!==0,I=t.intFromLE(_);return this.curve.pointFromY(I,M)},l.prototype.encodeInt=function(u){return u.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(u){return t.intFromLE(u)},l.prototype.isPoint=function(u){return u instanceof this.pointClass},kh}var C1;function r7(){return C1||(C1=1,function(r){var e=r;e.version=k_.version,e.utils=Ri(),e.rand=tb(),e.curve=rb(),e.curves=Yl(),e.ec=X_(),e.eddsa=t7()}(Ih)),Ih}var i7=r7(),Hh={},Kh={},O1;function n7(){return O1||(O1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Oo(),t=Xi();r.DIGEST_LENGTH=64,r.BLOCK_SIZE=128;var i=function(){function l(){this.digestLength=r.DIGEST_LENGTH,this.blockSize=r.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return l.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},l.prototype.update=function(p,u){if(u===void 0&&(u=p.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var b=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<r.BLOCK_SIZE&&u>0;)this._buffer[this._bufferLength++]=p[b++],u--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(b=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,p,b,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=p[b++],u--;return this},l.prototype.finish=function(p){if(!this._finished){var u=this._bytesHashed,b=this._bufferLength,_=u/536870912|0,M=u<<3,I=u%128<112?128:256;this._buffer[b]=128;for(var C=b+1;C<I-8;C++)this._buffer[C]=0;e.writeUint32BE(_,this._buffer,I-8),e.writeUint32BE(M,this._buffer,I-4),a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,I),this._finished=!0}for(var C=0;C<this.digestLength/8;C++)e.writeUint32BE(this._stateHi[C],p,C*8),e.writeUint32BE(this._stateLo[C],p,C*8+4);return this},l.prototype.digest=function(){var p=new Uint8Array(this.digestLength);return this.finish(p),p},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(p){return this._stateHi.set(p.stateHi),this._stateLo.set(p.stateLo),this._bufferLength=p.bufferLength,p.buffer&&this._buffer.set(p.buffer),this._bytesHashed=p.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(p){t.wipe(p.stateHi),t.wipe(p.stateLo),p.buffer&&t.wipe(p.buffer),p.bufferLength=0,p.bytesHashed=0},l}();r.SHA512=i;var s=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
151322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(l,p,u,b,_,M,I){for(var C=u[0],R=u[1],U=u[2],V=u[3],F=u[4],K=u[5],B=u[6],j=u[7],q=b[0],E=b[1],L=b[2],te=b[3],ae=b[4],z=b[5],w=b[6],c=b[7],h,d,y,A,D,x,g,m;I>=128;){for(var N=0;N<16;N++){var Q=8*N+M;l[N]=e.readUint32BE(_,Q),p[N]=e.readUint32BE(_,Q+4)}for(var N=0;N<80;N++){var re=C,O=R,Z=U,k=V,W=F,J=K,S=B,G=j,oe=q,ce=E,fe=L,be=te,we=ae,Ie=z,Je=w,Ce=c;if(h=j,d=c,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=(F>>>14|ae<<18)^(F>>>18|ae<<14)^(ae>>>9|F<<23),d=(ae>>>14|F<<18)^(ae>>>18|F<<14)^(F>>>9|ae<<23),D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,h=F&K^~F&B,d=ae&z^~ae&w,D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,h=s[N*2],d=s[N*2+1],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,h=l[N%16],d=p[N%16],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,y=g&65535|m<<16,A=D&65535|x<<16,h=y,d=A,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=(C>>>28|q<<4)^(q>>>2|C<<30)^(q>>>7|C<<25),d=(q>>>28|C<<4)^(C>>>2|q<<30)^(C>>>7|q<<25),D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,h=C&R^C&U^R&U,d=q&E^q&L^E&L,D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,G=g&65535|m<<16,Ce=D&65535|x<<16,h=k,d=be,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=y,d=A,D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,k=g&65535|m<<16,be=D&65535|x<<16,R=re,U=O,V=Z,F=k,K=W,B=J,j=S,C=G,E=oe,L=ce,te=fe,ae=be,z=we,w=Ie,c=Je,q=Ce,N%16===15)for(var Q=0;Q<16;Q++)h=l[Q],d=p[Q],D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=l[(Q+9)%16],d=p[(Q+9)%16],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,y=l[(Q+1)%16],A=p[(Q+1)%16],h=(y>>>1|A<<31)^(y>>>8|A<<24)^y>>>7,d=(A>>>1|y<<31)^(A>>>8|y<<24)^(A>>>7|y<<25),D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,y=l[(Q+14)%16],A=p[(Q+14)%16],h=(y>>>19|A<<13)^(A>>>29|y<<3)^y>>>6,d=(A>>>19|y<<13)^(y>>>29|A<<3)^(A>>>6|y<<26),D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,l[Q]=g&65535|m<<16,p[Q]=D&65535|x<<16}h=C,d=q,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[0],d=b[0],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[0]=C=g&65535|m<<16,b[0]=q=D&65535|x<<16,h=R,d=E,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[1],d=b[1],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[1]=R=g&65535|m<<16,b[1]=E=D&65535|x<<16,h=U,d=L,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[2],d=b[2],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[2]=U=g&65535|m<<16,b[2]=L=D&65535|x<<16,h=V,d=te,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[3],d=b[3],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[3]=V=g&65535|m<<16,b[3]=te=D&65535|x<<16,h=F,d=ae,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[4],d=b[4],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[4]=F=g&65535|m<<16,b[4]=ae=D&65535|x<<16,h=K,d=z,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[5],d=b[5],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[5]=K=g&65535|m<<16,b[5]=z=D&65535|x<<16,h=B,d=w,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[6],d=b[6],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[6]=B=g&65535|m<<16,b[6]=w=D&65535|x<<16,h=j,d=c,D=d&65535,x=d>>>16,g=h&65535,m=h>>>16,h=u[7],d=b[7],D+=d&65535,x+=d>>>16,g+=h&65535,m+=h>>>16,x+=D>>>16,g+=x>>>16,m+=g>>>16,u[7]=j=g&65535|m<<16,b[7]=c=D&65535|x<<16,M+=128,I-=128}return M}function f(l){var p=new i;p.update(l);var u=p.digest();return p.clean(),u}r.hash=f}(Kh)),Kh}var R1;function s7(){return R1||(R1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=Jl(),t=n7(),i=Xi();r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function s(k){const W=new Float64Array(16);if(k)for(let J=0;J<k.length;J++)W[J]=k[J];return W}const a=new Uint8Array(32);a[0]=9;const f=s(),l=s([1]),p=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),b=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),_=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),M=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function I(k,W){for(let J=0;J<16;J++)k[J]=W[J]|0}function C(k){let W=1;for(let J=0;J<16;J++){let S=k[J]+W+65535;W=Math.floor(S/65536),k[J]=S-W*65536}k[0]+=W-1+37*(W-1)}function R(k,W,J){const S=~(J-1);for(let G=0;G<16;G++){const oe=S&(k[G]^W[G]);k[G]^=oe,W[G]^=oe}}function U(k,W){const J=s(),S=s();for(let G=0;G<16;G++)S[G]=W[G];C(S),C(S),C(S);for(let G=0;G<2;G++){J[0]=S[0]-65517;for(let ce=1;ce<15;
15ce++)J[ce]=S[ce]-65535-(J[ce-1]>>16&1),J[ce-1]&=65535;J[15]=S[15]-32767-(J[14]>>16&1);const oe=J[15]>>16&1;J[14]&=65535,R(S,J,1-oe)}for(let G=0;G<16;G++)k[2*G]=S[G]&255,k[2*G+1]=S[G]>>8}function V(k,W){let J=0;for(let S=0;S<32;S++)J|=k[S]^W[S];return(1&J-1>>>8)-1}function F(k,W){const J=new Uint8Array(32),S=new Uint8Array(32);return U(J,k),U(S,W),V(J,S)}function K(k){const W=new Uint8Array(32);return U(W,k),W[0]&1}function B(k,W){for(let J=0;J<16;J++)k[J]=W[2*J]+(W[2*J+1]<<8);k[15]&=32767}function j(k,W,J){for(let S=0;S<16;S++)k[S]=W[S]+J[S]}function q(k,W,J){for(let S=0;S<16;S++)k[S]=W[S]-J[S]}function E(k,W,J){let S,G,oe=0,ce=0,fe=0,be=0,we=0,Ie=0,Je=0,Ce=0,Te=0,Se=0,me=0,Oe=0,Re=0,ve=0,Ne=0,Ee=0,ye=0,Le=0,De=0,_e=0,He=0,Ve=0,xe=0,Ke=0,ht=0,Ge=0,wt=0,lt=0,Ye=0,Et=0,Mt=0,qe=J[0],Xe=J[1],tt=J[2],Fe=J[3],et=J[4],Ze=J[5],ze=J[6],ut=J[7],rt=J[8],je=J[9],it=J[10],st=J[11],Be=J[12],Qe=J[13],ft=J[14],$e=J[15];S=W[0],oe+=S*qe,ce+=S*Xe,fe+=S*tt,be+=S*Fe,we+=S*et,Ie+=S*Ze,Je+=S*ze,Ce+=S*ut,Te+=S*rt,Se+=S*je,me+=S*it,Oe+=S*st,Re+=S*Be,ve+=S*Qe,Ne+=S*ft,Ee+=S*$e,S=W[1],ce+=S*qe,fe+=S*Xe,be+=S*tt,we+=S*Fe,Ie+=S*et,Je+=S*Ze,Ce+=S*ze,Te+=S*ut,Se+=S*rt,me+=S*je,Oe+=S*it,Re+=S*st,ve+=S*Be,Ne+=S*Qe,Ee+=S*ft,ye+=S*$e,S=W[2],fe+=S*qe,be+=S*Xe,we+=S*tt,Ie+=S*Fe,Je+=S*et,Ce+=S*Ze,Te+=S*ze,Se+=S*ut,me+=S*rt,Oe+=S*je,Re+=S*it,ve+=S*st,Ne+=S*Be,Ee+=S*Qe,ye+=S*ft,Le+=S*$e,S=W[3],be+=S*qe,we+=S*Xe,Ie+=S*tt,Je+=S*Fe,Ce+=S*et,Te+=S*Ze,Se+=S*ze,me+=S*ut,Oe+=S*rt,Re+=S*je,ve+=S*it,Ne+=S*st,Ee+=S*Be,ye+=S*Qe,Le+=S*ft,De+=S*$e,S=W[4],we+=S*qe,Ie+=S*Xe,Je+=S*tt,Ce+=S*Fe,Te+=S*et,Se+=S*Ze,me+=S*ze,Oe+=S*ut,Re+=S*rt,ve+=S*je,Ne+=S*it,Ee+=S*st,ye+=S*Be,Le+=S*Qe,De+=S*ft,_e+=S*$e,S=W[5],Ie+=S*qe,Je+=S*Xe,Ce+=S*tt,Te+=S*Fe,Se+=S*et,me+=S*Ze,Oe+=S*ze,Re+=S*ut,ve+=S*rt,Ne+=S*je,Ee+=S*it,ye+=S*st,Le+=S*Be,De+=S*Qe,_e+=S*ft,He+=S*$e,S=W[6],Je+=S*qe,Ce+=S*Xe,Te+=S*tt,Se+=S*Fe,me+=S*et,Oe+=S*Ze,Re+=S*ze,ve+=S*ut,Ne+=S*rt,Ee+=S*je,ye+=S*it,Le+=S*st,De+=S*Be,_e+=S*Qe,He+=S*ft,Ve+=S*$e,S=W[7],Ce+=S*qe,Te+=S*Xe,Se+=S*tt,me+=S*Fe,Oe+=S*et,Re+=S*Ze,ve+=S*ze,Ne+=S*ut,Ee+=S*rt,ye+=S*je,Le+=S*it,De+=S*st,_e+=S*Be,He+=S*Qe,Ve+=S*ft,xe+=S*$e,S=W[8],Te+=S*qe,Se+=S*Xe,me+=S*tt,Oe+=S*Fe,Re+=S*et,ve+=S*Ze,Ne+=S*ze,Ee+=S*ut,ye+=S*rt,Le+=S*je,De+=S*it,_e+=S*st,He+=S*Be,Ve+=S*Qe,xe+=S*ft,Ke+=S*$e,S=W[9],Se+=S*qe,me+=S*Xe,Oe+=S*tt,Re+=S*Fe,ve+=S*et,Ne+=S*Ze,Ee+=S*ze,ye+=S*ut,Le+=S*rt,De+=S*je,_e+=S*it,He+=S*st,Ve+=S*Be,xe+=S*Qe,Ke+=S*ft,ht+=S*$e,S=W[10],me+=S*qe,Oe+=S*Xe,Re+=S*tt,ve+=S*Fe,Ne+=S*et,Ee+=S*Ze,ye+=S*ze,Le+=S*ut,De+=S*rt,_e+=S*je,He+=S*it,Ve+=S*st,xe+=S*Be,Ke+=S*Qe,ht+=S*ft,Ge+=S*$e,S=W[11],Oe+=S*qe,Re+=S*Xe,ve+=S*tt,Ne+=S*Fe,Ee+=S*et,ye+=S*Ze,Le+=S*ze,De+=S*ut,_e+=S*rt,He+=S*je,Ve+=S*it,xe+=S*st,Ke+=S*Be,ht+=S*Qe,Ge+=S*ft,wt+=S*$e,S=W[12],Re+=S*qe,ve+=S*Xe,Ne+=S*tt,Ee+=S*Fe,ye+=S*et,Le+=S*Ze,De+=S*ze,_e+=S*ut,He+=S*rt,Ve+=S*je,xe+=S*it,Ke+=S*st,ht+=S*Be,Ge+=S*Qe,wt+=S*ft,lt+=S*$e,S=W[13],ve+=S*qe,Ne+=S*Xe,Ee+=S*tt,ye+=S*Fe,Le+=S*et,De+=S*Ze,_e+=S*ze,He+=S*ut,Ve+=S*rt,xe+=S*je,Ke+=S*it,ht+=S*st,Ge+=S*Be,wt+=S*Qe,lt+=S*ft,Ye+=S*$e,S=W[14],Ne+=S*qe,Ee+=S*Xe,ye+=S*tt,Le+=S*Fe,De+=S*et,_e+=S*Ze,He+=S*ze,Ve+=S*ut,xe+=S*rt,Ke+=S*je,ht+=S*it,Ge+=S*st,wt+=S*Be,lt+=S*Qe,Ye+=S*ft,Et+=S*$e,S=W[15],Ee+=S*qe,ye+=S*Xe,Le+=S*tt,De+=S*Fe,_e+=S*et,He+=S*Ze,Ve+=S*ze,xe+=S*ut,Ke+=S*rt,ht+=S*je,Ge+=S*it,wt+=S*st,lt+=S*Be,Ye+=S*Qe,Et+=S*ft,Mt+=S*$e,oe+=38*ye,ce+=38*Le,fe+=38*De,be+=38*_e,we+=38*He,Ie+=38*Ve,Je+=38*xe,Ce+=38*Ke,Te+=38*ht,Se+=38*Ge,me+=38*wt,Oe+=38*lt,Re+=38*Ye,ve+=38*Et,Ne+=38*Mt,G=1,S=oe+G+65535,G=Math.floor(S/65536),oe=S-G*65536,S=ce+G+65535,G=Math.floor(S/65536),ce=S-G*65536,S=fe+G+65535,G=Math.floor(S/65536),fe=S-G*65536,S=be+G+65535,G=Math.floor(S/65536),be=S-G*65536,S=we+G+65535,G=Math.floor(S/65536),we=S-G*65536,S=Ie+G+65535,G=Math.floor(S/65536),Ie=S-G*65536,S=Je+G+65535,G=Math.floor(S/65536),Je=S-G*65536,S=Ce+G+65535,G=Math.floor(S/65536),Ce=S-G*65536,S=Te+G+65535,G=Math.floor(S/65536),Te=S-G*65536,S=Se+G+65535,G=Math.floor(S/65536),Se=S-G*65536,S=me+G+65535,G=Math.floor(S/65536),me=S-G*65536,S=Oe+G+65535,G=Math.floor(S/65536),Oe=S-G*65536,S=Re+G+65535,G=Math.floor(S/65536),Re=S-G*65536,S=ve+G+65535,G=Math.floor(S/65536),ve=S-G*65536,S=Ne+G+65535,G=Math.floor(S/65536),Ne=S-G*65536,S=Ee+G+65535,G=Math.floor(S/65536),Ee=S-G*65536,oe+=G-1+37*(G-1),G=1,S=oe+G+65535,G=Math.floor(S/65536),oe=S-G*65536,S=ce+G+65535,G=Math.floor(S/65536),ce=S-G*65536,S=fe+G+65535,G=Math.floor(S/65536),fe=S-G*65536,S=be+G+65535,G=Math.floor(S/65536),be=S-G*65536,S=we+G+65535,G=Math.floor(S/65536),we=S-G*65536,S=Ie+G+65535,G=Math.floor(S/65536),Ie=S-G*65536,S=Je+G+65535,G=Math.floor(S/65536),Je=S-G*65536,S=Ce+G+65535,G=Math.floor(S/65536),Ce=S-G*65536,S=Te+G+65535,G=Math.floor(S/65536),Te=S-G*65536,S=Se+G+65535,G=Math.floor(S/65536),Se=S-G*65536,S=me+G+65535,G=Math.floor(S/65536),me=S-G*65536,S=Oe+G+65535,G=Math.floor(S/65536),Oe=S-G*65536,S=Re+G+65535,G=Math.floor(S/65536),Re=S-G*65536,S=ve+G+65535,G=Math.floor(S/65536),ve=S-G*65536,S=Ne+G+65535,G=Math.floor(S/65536),Ne=S-G*65536,S=Ee+G+65535,G=Math.floor(S/65536),Ee=S-G*65536,oe+=G-1+37*(G-1),k[0]=oe,k[1]=ce,k[2]=fe,k[3]=be,k[4]=we,k[5]=Ie,k[6]=Je,k[7]=Ce,k[8]=Te,k[9]=Se,k[10]=me,k[11]=Oe,k[12]=Re,k[13]=ve,k[14]=Ne,k[15]=Ee}function L(k,W){E(k,W,W)}function te(k,W){const J=s();let S;for(S=0;S<16;S++)J[S]=W[S];for(S=253;S>=0;S--)L(J,J),S!==2&&S!==4&&E(J,J,W);for(S=0;S<16;S++)k[S]=J[S]}function ae(k,W){const J=s();let S;for(S=0;S<16;S++)J[S]=W[S];for(S=250;S>=0;S--)L(J,J),S!==1&&E(J,J,W);for(S=0;S<16;S++)k[S]=J[S]}function z(k,W){const J=s(),S=s(),G=s(),oe=s(),ce=s(),fe=s(),be=s(),we=s(),Ie=s();q(J,k[1],k[0]),q(Ie,W[1],W[0]),E(J,J,Ie),j(S,k[0],k[1]),j(Ie,W[0],W[1]),E(S,S,Ie),E(G,k[3],W[3]),E(G,G,u),E(oe,k[2],W[2]),j(oe,oe,oe),q(ce,S,J),q(fe,oe,G),j(be,oe,G),j(we,S,J),E(k[0],ce,fe),E(k[1],we,be),E(k[2],be,fe),E(k[3],ce,we)}function w(k,W,J){for(let S=0;S<4;S++)R(k[S],W[S],J)}function c(k,W){const J=s(),S=s(),G=s();te(G,W[2]),E(J,W[0],G),E(S,W[1],G),U(k,S),k[31]^=K(J)<<7}function h(k,W,J){I(k[0],f),I(k[1],l),I(k[2],l),I(k[3],f);for(let S=255;S>=0;--S){const G=J[S/8|0]>>(S&7)&1;w(k,W,G),z(W,k),z(k,k),w(k,W,G)}}function d(k,W){const J=[s(),s(),s(),s()];I(J[0],b),I(J[1],_),I(J[2],l),E(J[3],b,_),h(k,J,W)}function y(k){if(k.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const W=(0,t.hash)(k);W[0]&=248,W[31]&=127,W[31]|=64;const J=new Uint8Array(32),S=[s(),s(),s(),s()];d(S,W),c(J,S);const G=new Uint8Array(64);return G.set(k),G.set(J,32),{publicKey:J,secretKey:G}}r.generateKeyPairFromSeed=y;function A(k){const W=(0,e.randomBytes)(32,k),J=y(W);return(0,i.wipe)(W),J}r.generateKeyPair=A;function D(k){if(k.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(k.subarray(32))}r.extractPublicKeyFromSecretKey=D;const x=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function g(k,W){let J,S,G,oe;for(S=63;S>=32;--S){for(J=0,G=S-32,oe=S-12;G<oe;++G)W[G]+=J-16*W[S]*x[G-(S-32)],J=Math.floor((W[G]+128)/256),W[G]-=J*256;W[G]+=J,W[S]=0}for(J=0,G=0;G<32;G++)W[G]+=J-(W[31]>>4)*x[G],J=W[G]>>8,W[G]&=255;for(G=0;G<32;G++)W[G]-=J*x[G];for(S=0;S<32;S++)W[S+1]+=W[S]>>8,k[S]=W[S]&255}function m(k){const W=new Float64Array(64);for(let J=0;J<64;J++)W[J]=k[J];for(let J=0;J<64;J++)k[J]=0;g(k,W)}function N(k,W){const J=new Float64Array(64),S=[s(),s(),s(),s()],G=(0,t.hash)(k.subarray(0,32));G[0]&=248,G[31]&=127,G[31]|=64;const oe=new Uint8Array(64);oe.set(G.subarray(32),32);const ce=new t.SHA512;ce.update(oe.subarray(32)),ce.update(W);const fe=ce.digest();ce.clean(),m(fe),d(S,fe),c(oe,S),ce.reset(),ce.update(oe.subarray(0,32)),ce.update(k.subarray(32)),ce.update(W);const be=ce.digest();m(be);for(let we=0;we<32;we++)J[we]=fe[we];for(let we=0;we<32;we++)for(let Ie=0;Ie<32;Ie++)J[we+Ie]+=be[we]*G[Ie];return g(oe.subarray(32),J),oe}r.sign=N;function Q(k,W){const J=s(),S=s(),G=s(),oe=s(),ce=s(),fe=s(),be=s();return I(k[2],l),B(k[1],W),L(G,k[1]),E(oe,G,p),q(G,G,k[2]),j(oe,k[2],oe),L(ce,oe),L(fe,ce),E(be,fe,ce),E(J,be,G),E(J,J,oe),ae(J,J),E(J,J,G),E(J,J,oe),E(J,J,oe),E(k[0],J,oe),L(S,k[0]),E(S,S,oe),F(S,G)&&E(k[0],k[0],M),L(S,k[0]),E(S,S,oe),F(S,G)?-1:(K(k[0])===W[31]>>7&&q(k[0],f,k[0]),E(k[3],k[0],k[1]),0)}function re(k,W,J){const S=new Uint8Array(32),G=[s(),s(),s(),s()],oe=[s(),s(),s(),s()];if(J.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(Q(oe,k))return!1;const ce=new t.SHA512;ce.update(J.subarray(0,32)),ce.update(k),ce.update(W);const fe=ce.digest();
15return m(fe),h(G,oe,fe),d(oe,J.subarray(32)),z(G,oe),c(S,G),!V(J,S)}r.verify=re;function O(k){let W=[s(),s(),s(),s()];if(Q(W,k))throw new Error("Ed25519: invalid public key");let J=s(),S=s(),G=W[1];j(J,l,G),q(S,l,G),te(S,S),E(J,J,S);let oe=new Uint8Array(32);return U(oe,J),oe}r.convertPublicKeyToX25519=O;function Z(k){const W=(0,t.hash)(k.subarray(0,32));W[0]&=248,W[31]&=127,W[31]|=64;const J=new Uint8Array(W.subarray(0,32));return(0,i.wipe)(W),J}r.convertSecretKeyToX25519=Z}(Hh)),Hh}var ib=s7();const a7="EdDSA",o7="JWT",mu=".",Fu="base64url",nb="utf8",sb="utf8",c7=":",u7="did",f7="key",N1="base58btc",h7="z",l7="K36",d7=32,p7=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),g7=r=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,s)=>typeof s=="string"&&s.match(/^\d+n$/)?BigInt(s.substring(0,s.length-1)):s)};function Fs(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return g7(r)}catch{return r}}function Kn(r){return typeof r=="string"?r:p7(r)||""}function T1(r){return Fs(_r(wr(r,Fu),nb))}function yu(r){return _r(wr(Kn(r),nb),Fu)}function ab(r){const e=wr(l7,N1),t=h7+_r(au([e,r]),N1);return[u7,f7,t].join(c7)}function v7(r){return _r(r,Fu)}function b7(r){return wr(r,Fu)}function m7(r){return wr([yu(r.header),yu(r.payload)].join(mu),sb)}function y7(r){return[yu(r.header),yu(r.payload),v7(r.signature)].join(mu)}function Ml(r){const e=r.split(mu),t=T1(e[0]),i=T1(e[1]),s=b7(e[2]),a=wr(e.slice(0,2).join(mu),sb);return{header:t,payload:i,signature:s,data:a}}function q1(r=Ro.randomBytes(d7)){return ib.generateKeyPairFromSeed(r)}async function w7(r,e,t,i,s=Me.fromMiliseconds(Date.now())){const a={alg:a7,typ:o7},f=ab(i.publicKey),l=s+t,p={iss:f,sub:r,aud:e,iat:s,exp:l},u=m7({header:a,payload:p}),b=ib.sign(i.secretKey,u);return y7({header:a,payload:p,signature:b})}const _7={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var A7={};const E7=":";function mo(r){const[e,t]=r.split(E7);return{namespace:e,reference:t}}function F1(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const s=r[i];t.push(...s.accounts)}),t}function ob(r,e){return r.includes(":")?[r]:e.chains||[]}var x7=Object.defineProperty,B1=Object.getOwnPropertySymbols,S7=Object.prototype.hasOwnProperty,M7=Object.prototype.propertyIsEnumerable,L1=(r,e,t)=>e in r?x7(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,U1=(r,e)=>{for(var t in e||(e={}))S7.call(e,t)&&L1(r,t,e[t]);if(B1)for(var t of B1(e))M7.call(e,t)&&L1(r,t,e[t]);return r};const I7="ReactNative",hi={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},D7="js";function wu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Aa(){return!ya.getDocument()&&!!ya.getNavigator()&&navigator.product===I7}function To(){return!wu()&&!!ya.getNavigator()&&!!ya.getDocument()}function qo(){return Aa()?hi.reactNative:wu()?hi.node:To()?hi.browser:hi.unknown}function P7(){var r;try{return Aa()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(r=global.Application)==null?void 0:r.applicationId:void 0}catch{return}}function C7(r,e){let t=bu.parse(r);return t=U1(U1({},t),e),r=bu.stringify(t),r}
15function cb(){return d4.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function O7(){if(qo()===hi.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:i}=global.Platform;return[t,i].join("-")}const r=O8();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function R7(){var r;const e=qo();return e===hi.browser?[e,((r=ya.getLocation())==null?void 0:r.host)||"unknown"].join(":"):e}function ub(r,e,t){const i=O7(),s=R7();return[[r,e].join("-"),[D7,t].join("-"),i,s].join("/")}function N7({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:s,projectId:a,useOnCloseEvent:f,bundleId:l}){const p=t.split("?"),u=ub(r,e,i),b={auth:s,ua:u,projectId:a,useOnCloseEvent:f||void 0,origin:l||void 0},_=C7(p[1]||"",b);return p[0]+"?"+_}function Ns(r,e){return r.filter(t=>e.includes(t)).length===r.length}function fb(r){return Object.fromEntries(r.entries())}function hb(r){return new Map(Object.entries(r))}function Os(r=Me.FIVE_MINUTES,e){const t=Me.toMiliseconds(r||Me.FIVE_MINUTES);let i,s,a;return{resolve:f=>{a&&i&&(clearTimeout(a),i(f))},reject:f=>{a&&s&&(clearTimeout(a),s(f))},done:()=>new Promise((f,l)=>{a=setTimeout(()=>{l(new Error(e))},t),i=f,s=l})}}function va(r,e,t){return new Promise(async(i,s)=>{const a=setTimeout(()=>s(new Error(t)),e);try{const f=await r;i(f)}catch(f){s(f)}clearTimeout(a)})}function lb(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function T7(r){return lb("topic",r)}function q7(r){return lb("id",r)}function db(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function pr(r,e){return Me.fromMiliseconds(Date.now()+Me.toMiliseconds(r))}function ns(r){return Date.now()>=Me.toMiliseconds(r)}function St(r,e){return`${r}${e?`:${e}`:""}`}function cu(r=[],e=[]){return[...new Set([...r,...e])]}async function F7({id:r,topic:e,wcDeepLink:t}){var i;try{if(!t)return;const s=typeof t=="string"?JSON.parse(t):t,a=s==null?void 0:s.href;if(typeof a!="string")return;const f=B7(a,r,e),l=qo();if(l===hi.browser){if(!((i=ya.getDocument())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}f.startsWith("https://")||f.startsWith("http://")?window.open(f,"_blank","noreferrer noopener"):window.open(f,U7()?"_blank":"_self","noreferrer noopener")}else l===hi.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(f)}catch(s){console.error(s)}}function B7(r,e,t){const i=`requestId=${e}&sessionTopic=${t}`;r.endsWith("/")&&(r=r.slice(0,-1));let s=`${r}`;if(r.startsWith("https://t.me")){const a=r.includes("?")?"&startapp=":"?startapp=";s=`${s}${a}${z7(i,!0)}`}else s=`${s}/wc?${i}`;return s}async function L7(r,e){let t="";try{if(To()&&(t=localStorage.getItem(e),t))return t;t=await r.getItem(e)}catch(i){console.error(i)}return t}function z1(r,e){if(!r.includes(e))return null;const t=r.split(/([&,?,=])/),i=t.indexOf(e);return t[i+2]}function j1(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function Ql(){return typeof process<"u"&&A7.IS_VITEST==="true"}function U7(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function z7(r,e=!1){const t=Buffer.from(r).toString("base64");return e?t.replace(/[=]/g,""):t}function pb(r){return Buffer.from(r,"base64").toString("utf-8")}var gb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j7(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};
15return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),t}var vb={exports:{}};/** 16* [js-sha3]{@link https://github.com/emn178/js-sha3} 17* 18* @version 0.8.0 19* @author Chen, Yi-Cyuan [[email protected]] 20* @copyright Chen, Yi-Cyuan 2015-2018 21* @license MIT 22*/(function(r){(function(){var e="input is invalid type",t="finalize already called",i=typeof window=="object",s=i?window:{};s.JS_SHA3_NO_WINDOW&&(i=!1);var a=!i&&typeof self=="object",f=!s.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;f?s=gb:a&&(s=self);var l=!s.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,p=!s.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),b=[31,7936,2031616,520093696],_=[4,1024,262144,67108864],M=[1,256,65536,16777216],I=[6,1536,393216,100663296],C=[0,8,16,24],R=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],U=[224,256,384,512],V=[128,256],F=["hex","buffer","arrayBuffer","array","digest"],K={128:168,256:136};(s.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),p&&(s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var B=function(O,Z,k){return function(W){return new N(O,Z,O).update(W)[k]()}},j=function(O,Z,k){return function(W,J){return new N(O,Z,J).update(W)[k]()}},q=function(O,Z,k){return function(W,J,S,G){return h["cshake"+O].update(W,J,S,G)[k]()}},E=function(O,Z,k){return function(W,J,S,G){return h["kmac"+O].update(W,J,S,G)[k]()}},L=function(O,Z,k,W){for(var J=0;J<F.length;++J){var S=F[J];O[S]=Z(k,W,S)}return O},te=function(O,Z){var k=B(O,Z,"hex");return k.create=function(){return new N(O,Z,O)},k.update=function(W){return k.create().update(W)},L(k,B,O,Z)},ae=function(O,Z){var k=j(O,Z,"hex");return k.create=function(W){return new N(O,Z,W)},k.update=function(W,J){return k.create(J).update(W)},L(k,j,O,Z)},z=function(O,Z){var k=K[O],W=q(O,Z,"hex");return W.create=function(J,S,G){return!S&&!G?h["shake"+O].create(J):new N(O,Z,J).bytepad([S,G],k)},W.update=function(J,S,G,oe){return W.create(S,G,oe).update(J)},L(W,q,O,Z)},w=function(O,Z){var k=K[O],W=E(O,Z,"hex");return W.create=function(J,S,G){return new Q(O,Z,S).bytepad(["KMAC",G],k).bytepad([J],k)},W.update=function(J,S,G,oe){return W.create(J,G,oe).update(S)},L(W,E,O,Z)},c=[{name:"keccak",padding:M,bits:U,createMethod:te},{name:"sha3",padding:I,bits:U,createMethod:te},{name:"shake",padding:b,bits:V,createMethod:ae},{name:"cshake",padding:_,bits:V,createMethod:z},{name:"kmac",padding:_,bits:V,createMethod:w}],h={},d=[],y=0;y<c.length;++y)for(var A=c[y],D=A.bits,x=0;x<D.length;++x){var g=A.name+"_"+D[x];if(d.push(g),h[g]=A.createMethod(D[x],A.padding),A.name!=="sha3"){var m=A.name+D[x];d.push(m),h[m]=h[g]}}function N(O,Z,k){this.blocks=[],this.s=[],this.padding=Z,this.outputBits=k,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(O<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=k>>5,this.extraBytes=(k&31)>>3;for(var W=0;W<50;++W)this.s[W]=0}N.prototype.update=function(O){if(this.finalized)throw new Error(t);var Z,k=typeof O;if(k!=="string"){if(k==="object"){if(O===null)throw new Error(e);
22if(p&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!p||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);Z=!0}for(var W=this.blocks,J=this.byteCount,S=O.length,G=this.blockCount,oe=0,ce=this.s,fe,be;oe<S;){if(this.reset)for(this.reset=!1,W[0]=this.block,fe=1;fe<G+1;++fe)W[fe]=0;if(Z)for(fe=this.start;oe<S&&fe<J;++oe)W[fe>>2]|=O[oe]<<C[fe++&3];else for(fe=this.start;oe<S&&fe<J;++oe)be=O.charCodeAt(oe),be<128?W[fe>>2]|=be<<C[fe++&3]:be<2048?(W[fe>>2]|=(192|be>>6)<<C[fe++&3],W[fe>>2]|=(128|be&63)<<C[fe++&3]):be<55296||be>=57344?(W[fe>>2]|=(224|be>>12)<<C[fe++&3],W[fe>>2]|=(128|be>>6&63)<<C[fe++&3],W[fe>>2]|=(128|be&63)<<C[fe++&3]):(be=65536+((be&1023)<<10|O.charCodeAt(++oe)&1023),W[fe>>2]|=(240|be>>18)<<C[fe++&3],W[fe>>2]|=(128|be>>12&63)<<C[fe++&3],W[fe>>2]|=(128|be>>6&63)<<C[fe++&3],W[fe>>2]|=(128|be&63)<<C[fe++&3]);if(this.lastByteIndex=fe,fe>=J){for(this.start=fe-J,this.block=W[G],fe=0;fe<G;++fe)ce[fe]^=W[fe];re(ce),this.reset=!0}else this.start=fe}return this},N.prototype.encode=function(O,Z){var k=O&255,W=1,J=[k];for(O=O>>8,k=O&255;k>0;)J.unshift(k),O=O>>8,k=O&255,++W;return Z?J.push(W):J.unshift(W),this.update(J),J.length},N.prototype.encodeString=function(O){var Z,k=typeof O;if(k!=="string"){if(k==="object"){if(O===null)throw new Error(e);
22if(p&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!p||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);Z=!0}var W=0,J=O.length;if(Z)W=J;else for(var S=0;S<O.length;++S){var G=O.charCodeAt(S);G<128?W+=1:G<2048?W+=2:G<55296||G>=57344?W+=3:(G=65536+((G&1023)<<10|O.charCodeAt(++S)&1023),W+=4)}return W+=this.encode(W*8),this.update(O),W},N.prototype.bytepad=function(O,Z){for(var k=this.encode(Z),W=0;W<O.length;++W)k+=this.encodeString(O[W]);var J=Z-k%Z,S=[];return S.length=J,this.update(S),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var O=this.blocks,Z=this.lastByteIndex,k=this.blockCount,W=this.s;if(O[Z>>2]|=this.padding[Z&3],this.lastByteIndex===this.byteCount)for(O[0]=O[k],Z=1;Z<k+1;++Z)O[Z]=0;for(O[k-1]|=2147483648,Z=0;Z<k;++Z)W[Z]^=O[Z];re(W)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var O=this.blockCount,Z=this.s,k=this.outputBlocks,W=this.extraBytes,J=0,S=0,G="",oe;S<k;){for(J=0;J<O&&S<k;++J,++S)oe=Z[J],G+=u[oe>>4&15]+u[oe&15]+u[oe>>12&15]+u[oe>>8&15]+u[oe>>20&15]+u[oe>>16&15]+u[oe>>28&15]+u[oe>>24&15];S%O===0&&(re(Z),J=0)}return W&&(oe=Z[J],G+=u[oe>>4&15]+u[oe&15],W>1&&(G+=u[oe>>12&15]+u[oe>>8&15]),W>2&&(G+=u[oe>>20&15]+u[oe>>16&15])),G},N.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,Z=this.s,k=this.outputBlocks,W=this.extraBytes,J=0,S=0,G=this.outputBits>>3,oe;W?oe=new ArrayBuffer(k+1<<2):oe=new ArrayBuffer(G);for(var ce=new Uint32Array(oe);S<k;){for(J=0;J<O&&S<k;++J,++S)ce[S]=Z[J];S%O===0&&re(Z)}return W&&(ce[J]=Z[J],oe=oe.slice(0,G)),oe},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var O=this.blockCount,Z=this.s,k=this.outputBlocks,W=this.extraBytes,J=0,S=0,G=[],oe,ce;S<k;){for(J=0;J<O&&S<k;++J,++S)oe=S<<2,ce=Z[J],G[oe]=ce&255,G[oe+1]=ce>>8&255,G[oe+2]=ce>>16&255,G[oe+3]=ce>>24&255;S%O===0&&re(Z)}return W&&(oe=S<<2,ce=Z[J],G[oe]=ce&255,W>1&&(G[oe+1]=ce>>8&255),W>2&&(G[oe+2]=ce>>16&255)),G};function Q(O,Z,k){N.call(this,O,Z,k)}Q.prototype=new N,Q.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var re=function(O){var Z,k,W,J,S,G,oe,ce,fe,be,we,Ie,Je,Ce,Te,Se,me,Oe,Re,ve,Ne,Ee,ye,Le,De,_e,He,Ve,xe,Ke,ht,Ge,wt,lt,Ye,Et,Mt,qe,Xe,tt,Fe,et,Ze,ze,ut,rt,je,it,st,Be,Qe,ft,$e,Rt,Nt,at,bt,Ir,Dr,Pr,Cr,Or,Zt;for(W=0;W<48;W+=2)J=O[0]^O[10]^O[20]^O[30]^O[40],S=O[1]^O[11]^O[21]^O[31]^O[41],G=O[2]^O[12]^O[22]^O[32]^O[42],oe=O[3]^O[13]^O[23]^O[33]^O[43],ce=O[4]^O[14]^O[24]^O[34]^O[44],fe=O[5]^O[15]^O[25]^O[35]^O[45],be=O[6]^O[16]^O[26]^O[36]^O[46],we=O[7]^O[17]^O[27]^O[37]^O[47],Ie=O[8]^O[18]^O[28]^O[38]^O[48],Je=O[9]^O[19]^O[29]^O[39]^O[49],Z=Ie^(G<<1|oe>>>31),k=Je^(oe<<1|G>>>31),O[0]^=Z,O[1]^=k,O[10]^=Z,O[11]^=k,O[20]^=Z,O[21]^=k,O[30]^=Z,O[31]^=k,O[40]^=Z,O[41]^=k,Z=J^(ce<<1|fe>>>31),k=S^(fe<<1|ce>>>31),O[2]^=Z,O[3]^=k,O[12]^=Z,O[13]^=k,O[22]^=Z,O[23]^=k,O[32]^=Z,O[33]^=k,O[42]^=Z,O[43]^=k,Z=G^(be<<1|we>>>31),k=oe^(we<<1|be>>>31),O[4]^=Z,O[5]^=k,O[14]^=Z,O[15]^=k,O[24]^=Z,O[25]^=k,O[34]^=Z,O[35]^=k,O[44]^=Z,O[45]^=k,Z=ce^(Ie<<1|Je>>>31),k=fe^(Je<<1|Ie>>>31),O[6]^=Z,O[7]^=k,O[16]^=Z,O[17]^=k,O[26]^=Z,O[27]^=k,O[36]^=Z,O[37]^=k,O[46]^=Z,O[47]^=k,Z=be^(J<<1|S>>>31),k=we^(S<<1|J>>>31),O[8]^=Z,O[9]^=k,O[18]^=Z,O[19]^=k,O[28]^=Z,O[29]^=k,O[38]^=Z,O[39]^=k,O[48]^=Z,O[49]^=k,Ce=O[0],Te=O[1],rt=O[11]<<4|O[10]>>>
2228,je=O[10]<<4|O[11]>>>28,Ve=O[20]<<3|O[21]>>>29,xe=O[21]<<3|O[20]>>>29,Pr=O[31]<<9|O[30]>>>23,Cr=O[30]<<9|O[31]>>>23,et=O[40]<<18|O[41]>>>14,Ze=O[41]<<18|O[40]>>>14,lt=O[2]<<1|O[3]>>>31,Ye=O[3]<<1|O[2]>>>31,Se=O[13]<<12|O[12]>>>20,me=O[12]<<12|O[13]>>>20,it=O[22]<<10|O[23]>>>22,st=O[23]<<10|O[22]>>>22,Ke=O[33]<<13|O[32]>>>19,ht=O[32]<<13|O[33]>>>19,Or=O[42]<<2|O[43]>>>30,Zt=O[43]<<2|O[42]>>>30,Rt=O[5]<<30|O[4]>>>2,Nt=O[4]<<30|O[5]>>>2,Et=O[14]<<6|O[15]>>>26,Mt=O[15]<<6|O[14]>>>26,Oe=O[25]<<11|O[24]>>>21,Re=O[24]<<11|O[25]>>>21,Be=O[34]<<15|O[35]>>>17,Qe=O[35]<<15|O[34]>>>17,Ge=O[45]<<29|O[44]>>>3,wt=O[44]<<29|O[45]>>>3,Le=O[6]<<28|O[7]>>>4,De=O[7]<<28|O[6]>>>4,at=O[17]<<23|O[16]>>>9,bt=O[16]<<23|O[17]>>>9,qe=O[26]<<25|O[27]>>>7,Xe=O[27]<<25|O[26]>>>7,ve=O[36]<<21|O[37]>>>11,Ne=O[37]<<21|O[36]>>>11,ft=O[47]<<24|O[46]>>>8,$e=O[46]<<24|O[47]>>>8,ze=O[8]<<27|O[9]>>>5,ut=O[9]<<27|O[8]>>>5,_e=O[18]<<20|O[19]>>>12,He=O[19]<<20|O[18]>>>12,Ir=O[29]<<7|O[28]>>>25,Dr=O[28]<<7|O[29]>>>25,tt=O[38]<<8|O[39]>>>24,Fe=O[39]<<8|O[38]>>>24,Ee=O[48]<<14|O[49]>>>18,ye=O[49]<<14|O[48]>>>18,O[0]=Ce^~Se&Oe,O[1]=Te^~me&Re,O[10]=Le^~_e&Ve,O[11]=De^~He&xe,O[20]=lt^~Et&qe,O[21]=Ye^~Mt&Xe,O[30]=ze^~rt&it,O[31]=ut^~je&st,O[40]=Rt^~at&Ir,O[41]=Nt^~bt&Dr,O[2]=Se^~Oe&ve,O[3]=me^~Re&Ne,O[12]=_e^~Ve&Ke,O[13]=He^~xe&ht,O[22]=Et^~qe&tt,O[23]=Mt^~Xe&Fe,O[32]=rt^~it&Be,O[33]=je^~st&Qe,O[42]=at^~Ir&Pr,O[43]=bt^~Dr&Cr,O[4]=Oe^~ve&Ee,O[5]=Re^~Ne&ye,O[14]=Ve^~Ke&Ge,O[15]=xe^~ht&wt,O[24]=qe^~tt&et,O[25]=Xe^~Fe&Ze,O[34]=it^~Be&ft,O[35]=st^~Qe&$e,O[44]=Ir^~Pr&Or,O[45]=Dr^~Cr&Zt,O[6]=ve^~Ee&Ce,O[7]=Ne^~ye&Te,O[16]=Ke^~Ge&Le,O[17]=ht^~wt&De,O[26]=tt^~et<,O[27]=Fe^~Ze&Ye,O[36]=Be^~ft&ze,O[37]=Qe^~$e&ut,O[46]=Pr^~Or&Rt,O[47]=Cr^~Zt&Nt,O[8]=Ee^~Ce&Se,O[9]=ye^~Te&me,O[18]=Ge^~Le&_e,O[19]=wt^~De&He,O[28]=et^~lt&Et,O[29]=Ze^~Ye&Mt,O[38]=ft^~ze&rt,O[39]=$e^~ut&je,O[48]=Or^~Rt&at,O[49]=Zt^~Nt&bt,O[0]^=R[W],O[1]^=R[W+1]};if(l)r.exports=h;else for(y=0;y<d.length;++y)s[d[y]]=h[d[y]]})()})(vb);var $7=vb.exports;const k7="logger/5.7.0";let $1=!1,k1=!1;const uu={debug:1,default:2,info:2,warning:3,error:4,off:5};let H1=uu.default,Vh=null;function H7(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="eÌ")throw new Error("broken implementation")}catch(r){return r.message}return null}const K1=H7();var Il;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(Il||(Il={}));var Wi;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(Wi||(Wi={}));const V1="0123456789abcdef";let xr=class dr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const i=e.toLowerCase();uu[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(H1>uu[i])&&console.log.apply(console,t)}debug(...e){this._log(dr.levels.DEBUG,e)}info(...e){this._log(dr.levels.INFO,e)}warn(...e){this._log(dr.levels.WARNING,e)}makeError(e,t,i){if(k1)return this.makeError("censored error",t,{});t||(t=dr.errors.UNKNOWN_ERROR),i||(i={});const s=[];
22Object.keys(i).forEach(p=>{const u=i[p];try{if(u instanceof Uint8Array){let b="";for(let _=0;_<u.length;_++)b+=V1[u[_]>>4],b+=V1[u[_]&15];s.push(p+"=Uint8Array(0x"+b+")")}else s.push(p+"="+JSON.stringify(u))}catch{s.push(p+"="+JSON.stringify(i[p].toString()))}}),s.push(`code=${t}`),s.push(`version=${this.version}`);const a=e;let f="";switch(t){case Wi.NUMERIC_FAULT:{f="NUMERIC_FAULT";const p=e;switch(p){case"overflow":case"underflow":case"division-by-zero":f+="-"+p;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result";break}break}case Wi.CALL_EXCEPTION:case Wi.INSUFFICIENT_FUNDS:case Wi.MISSING_NEW:case Wi.NONCE_EXPIRED:case Wi.REPLACEMENT_UNDERPRICED:case Wi.TRANSACTION_REPLACED:case Wi.UNPREDICTABLE_GAS_LIMIT:f=t;break}f&&(e+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),s.length&&(e+=" ("+s.join(", ")+")");const l=new Error(e);return l.reason=a,l.code=t,Object.keys(i).forEach(function(p){l[p]=i[p]}),l}throwError(e,t,i){throw this.makeError(e,t,i)}throwArgumentError(e,t,i){return this.throwError(e,dr.errors.INVALID_ARGUMENT,{argument:t,value:i})}assert(e,t,i,s){e||this.throwError(t,i,s)}assertArgument(e,t,i,s){e||this.throwArgumentError(t,i,s)}checkNormalize(e){K1&&this.throwError("platform missing String.prototype.normalize",dr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:K1})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,dr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,i){i?i=": "+i:i="",e<t&&this.throwError("missing argument"+i,dr.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+i,dr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",dr.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",dr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",dr.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Vh||(Vh=new dr(k7)),Vh}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),$1){if(!e)return;this.globalLogger().throwError("error censorship permanent",dr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k1=!!e,$1=!!t}static setLogLevel(e){const t=uu[e.toLowerCase()];if(t==null){dr.globalLogger().warn("invalid log level - "+e);return}H1=t}static from(e){return new dr(e)}};xr.errors=Wi,xr.levels=Il;const K7="bytes/5.7.0",ar=new xr(K7);function bb(r){return!!r.toHexString}function ba(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return ba(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function V7(r){return li(r)&&!(r.length%2)||Ea(r)}function G1(r){return typeof r=="number"&&r==r&&r%1===0}function Ea(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!G1(r.length)||r.length<0)return!1;for(let e=0;e<r.length;e++){const t=r[e];if(!G1(t)||t<0||t>=256)return!1}return!0}function rr(r,e){if(e||(e={}),typeof r=="number"){ar.checkSafeUint53(r,"invalid arrayify value");const t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),ba(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),bb(r)&&(r=r.toHexString()),li(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":ar.throwArgumentError("hex data is odd-length","value",r));const i=[];for(let s=0;s<t.length;s+=2)i.push(parseInt(t.substring(s,s+2),16));return ba(new Uint8Array(i))}return Ea(r)?ba(new Uint8Array(r)):ar.throwArgumentError("invalid arrayify value","value",r)}function G7(r){const e=r.map(s=>rr(s)),t=e.reduce((s,a)=>s+a.length,0),i=new Uint8Array(t);return e.reduce((s,a)=>(i.set(a,s),s+a.length),0),ba(i)}function W7(r,e){r=rr(r),r.length>e&&ar.throwArgumentError("value out of range","value",arguments[0]);const t=new Uint8Array(e);return t.set(r,e-r.length),ba(t)}function li(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}const Gh="0123456789abcdef";function ti(r,e){if(e||(e={}
22),typeof r=="number"){ar.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=Gh[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),bb(r))return r.toHexString();if(li(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":ar.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(Ea(r)){let t="0x";for(let i=0;i<r.length;i++){let s=r[i];t+=Gh[(s&240)>>4]+Gh[s&15]}return t}return ar.throwArgumentError("invalid hexlify value","value",r)}function J7(r){if(typeof r!="string")r=ti(r);else if(!li(r)||r.length%2)return null;return(r.length-2)/2}function W1(r,e,t){return typeof r!="string"?r=ti(r):(!li(r)||r.length%2)&&ar.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}function bn(r,e){for(typeof r!="string"?r=ti(r):li(r)||ar.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&ar.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}function mb(r){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(V7(r)){let t=rr(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=ti(t.slice(0,32)),e.s=ti(t.slice(32,64))):t.length===65?(e.r=ti(t.slice(0,32)),e.s=ti(t.slice(32,64)),e.v=t[64]):ar.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:ar.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=ti(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){const s=W7(rr(e._vs),32);e._vs=ti(s);const a=s[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&ar.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),s[0]&=127;const f=ti(s);e.s==null?e.s=f:e.s!==f&&ar.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?ar.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const s=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==s&&ar.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!li(e.r)?ar.throwArgumentError("signature missing or invalid r","signature",r):e.r=bn(e.r,32),e.s==null||!li(e.s)?ar.throwArgumentError("signature missing or invalid s","signature",r):e.s=bn(e.s,32);const t=rr(e.s);t[0]>=128&&ar.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);const i=ti(t);e._vs&&(li(e._vs)||ar.throwArgumentError("signature invalid _vs","signature",r),e._vs=bn(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&ar.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function Xl(r){return"0x"+$7.keccak_256(rr(r))}var yb={exports:{}},Y7={},Q7=Object.freeze({__proto__:null,default:Y7}),X7=j7(Q7);(function(r){(function(e,t){function i(c,h){if(!c)throw new Error(h||"Assertion failed")}function s(c,h){c.super_=h;var d=function(){};d.prototype=h.prototype,c.prototype=new d,c.prototype.constructor=c}function a(c,h,d){if(a.isBN(c))return c;this.negative=0,this.words=null,this.length=0,this.red=null,c!==null&&((h==="le"||h==="be")&&(d=h,h=10),this._init(c||0,h||10,d||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=X7.Buffer}catch{}a.isBN=function(c){return c instanceof a?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===a.wordSize&&Array.isArray(c.words)},a.max=function(c,h){return c.cmp(h)>0?c:h},a.min=function(c,h){return c.cmp(h)<0?c:h},a.prototype._init=function(c,h,d){if(typeof c=="number")return this._initNumber(c,h,d);if(typeof c=="object")return this._initArray(c,h,d);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),c=c.toString().replace(/\s+/g,"");var y=0;c[0]==="-"&&(y++,this.negative=1),y<c.length&&(h===16?this._parseHex(c,y,d):(this._parseBase(c,h,y),d==="le"&&this._initArray(this.toArray(),h,d)))},a.prototype._initNumber=function(c,h,d){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(i(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),d==="le"&&this._initArray(this.toArray(),h,d)},a.prototype._initArray=function(c,h,d){if(i(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var A,D,x=0;if(d==="be")for(y=c.length-1,A=0;y>=0;y-=3)D=c[y]|c[y-1]<<8|c[y-2]<<16,this.words[A]|=D<<x&67108863,this.words[A+1]=D>>>26-x&67108863,x+=24,x>=26&&(x-=26,A++);else if(d==="le")for(y=0,A=0;y<c.length;y+=3)D=c[y]|c[y+1]<<8|c[y+2]<<16,this.words[A]|=D<<x&67108863,this.words[A+1]=D>>>26-x&67108863,x+=24,x>=26&&(x-=26,A++);return this._strip()};function l(c,h){var d=c.charCodeAt(h);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;i(!1,"Invalid character in "+c)}function p(c,h,d){var y=l(c,d);return d-1>=h&&(y|=l(c,d-1)<<4),y}a.prototype._parseHex=function(c,h,d){this.length=Math.ceil((c.length-h)/6),this.words=new Array(this.length);for(var y=0;y<this.length;y++)this.words[y]=0;var A=0,D=0,x;if(d==="be")for(y=c.length-1;y>=h;y-=2)x=p(c,h,y)<<A,this.words[D]|=x&67108863,A>=18?(A-=18,D+=1,this.words[D]|=x>>>26):A+=8;else{var g=c.length-h;for(y=g%2===0?h+1:h;y<c.length;y+=2)x=p(c,h,y)<<A,this.words[D]|=x&67108863,A>=18?(A-=18,D+=1,this.words[D]|=x>>>26):A+=8}this._strip()};function u(c,h,d,y){for(var A=0,D=0,x=Math.min(c.length,d),g=h;g<x;g++){var m=c.charCodeAt(g)-48;A*=y,m>=49?D=m-49+10:m>=17?D=m-17+10:D=m,i(m>=0&&D<y,"Invalid character"),A+=D}return A}a.prototype._parseBase=function(c,h,d){this.words=[0],this.length=1;for(var y=0,A=1;A<=67108863;A*=h)y++;y--,A=A/h|0;for(var D=c.length-d,x=D%y,g=Math.min(D,D-x)+d,m=0,N=d;N<g;N+=y)m=u(c,N,N+y,h),this.imuln(A),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(x!==0){var Q=1;for(m=u(c,N,c.length,h),N=0;N<x;N++)Q*=h;this.imuln(Q),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this._strip()},a.prototype.copy=function(c){c.words=new Array(this.length);for(var h=0;h<this.length;h++)c.words[h]=this.words[h];c.length=this.length,c.negative=this.negative,c.red=this.red};function b(c,h){c.words=h.words,c.length=h.length,c.negative=h.negative,c.red=h.red}if(a.prototype._move=function(c){b(c,this)},a.prototype.clone=function(){var c=new a(null);return this.copy(c),c},a.prototype._expand=function(c){for(;this.length<c;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=_}catch{a.prototype.inspect=_}else a.prototype.inspect=_;function _(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var M=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],C=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16
vendor: 9,258 bytes, line 22
22777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(c,h){c=c||10,h=h|0||1;var d;if(c===16||c==="hex"){d="";for(var y=0,A=0,D=0;D<this.length;D++){var x=this.words[D],g=((x<<y|A)&16777215).toString(16);A=x>>>24-y&16777215,y+=2,y>=26&&(y-=26,D--),A!==0||D!==this.length-1?d=M[6-g.length]+g+d:d=g+d}for(A!==0&&(d=A.toString(16)+d);d.length%h!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}if(c===(c|0)&&c>=2&&c<=36){var m=I[c],N=C[c];d="";var Q=this.clone();for(Q.negative=0;!Q.isZero();){var re=Q.modrn(N).toString(c);Q=Q.idivn(N),Q.isZero()?d=re+d:d=M[m-re.length]+re+d}for(this.isZero()&&(d="0"+d);d.length%h!==0;)d="0"+d;return this.negative!==0&&(d="-"+d),d}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},a.prototype.toJSON=function(){return this.toString(16,2)},f&&(a.prototype.toBuffer=function(c,h){return this.toArrayLike(f,c,h)}),a.prototype.toArray=function(c,h){return this.toArrayLike(Array,c,h)};var R=function(c,h){return c.allocUnsafe?c.allocUnsafe(h):new c(h)};a.prototype.toArrayLike=function(c,h,d){this._strip();var y=this.byteLength(),A=d||Math.max(1,y);i(y<=A,"byte array longer than desired length"),i(A>0,"Requested array length <= 0");var D=R(c,A),x=h==="le"?"LE":"BE";return this["_toArrayLike"+x](D,y),D},a.prototype._toArrayLikeLE=function(c,h){for(var d=0,y=0,A=0,D=0;A<this.length;A++){var x=this.words[A]<<D|y;c[d++]=x&255,d<c.length&&(c[d++]=x>>8&255),d<c.length&&(c[d++]=x>>16&255),D===6?(d<c.length&&(c[d++]=x>>24&255),y=0,D=0):(y=x>>>24,D+=2)}if(d<c.length)for(c[d++]=y;d<c.length;)c[d++]=0},a.prototype._toArrayLikeBE=function(c,h){for(var d=c.length-1,y=0,A=0,D=0;A<this.length;A++){var x=this.words[A]<<D|y;c[d--]=x&255,d>=0&&(c[d--]=x>>8&255),d>=0&&(c[d--]=x>>16&255),D===6?(d>=0&&(c[d--]=x>>24&255),y=0,D=0):(y=x>>>24,D+=2)}if(d>=0)for(c[d--]=y;d>=0;)c[d--]=0},Math.clz32?a.prototype._countBits=function(c){return 32-Math.clz32(c)}:a.prototype._countBits=function(c){var h=c,d=0;return h>=4096&&(d+=13,h>>>=13),h>=64&&(d+=7,h>>>=7),h>=8&&(d+=4,h>>>=4),h>=2&&(d+=2,h>>>=2),d+h},a.prototype._zeroBits=function(c){if(c===0)return 26;var h=c,d=0;return h&8191||(d+=13,h>>>=13),h&127||(d+=7,h>>>=7),h&15||(d+=4,h>>>=4),h&3||(d+=2,h>>>=2),h&1||d++,d},a.prototype.bitLength=function(){var c=this.words[this.length-1],h=this._countBits(c);return(this.length-1)*26+h};function U(c){for(var h=new Array(c.bitLength()),d=0;d<h.length;d++){var y=d/26|0,A=d%26;h[d]=c.words[y]>>>A&1}return h}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,h=0;h<this.length;h++){var d=this._zeroBits(this.words[h]);if(c+=d,d!==26)break}return c},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},a.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var h=0;h<c.length;h++)this.words[h]=this.words[h]|c.words[h];return this._strip()},a.prototype.ior=function(c){return i((this.negative|c.negative)===0),this.iuor(c)},a.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},a.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},a.prototype.iuand=function(c){var h;this.length>c.length?h=c:h=this;for(var d=0;d<h.length;d++)this.words[d]=this.words[d]&c.words[d];return this.length=h.length,this._strip()},a.prototype.iand=function(c){return i((this.negative|c.negative)===0),this.iuand(c)},a.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},a.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},a.prototype.iuxor=function(c){var h,d;this.length>c.length?(h=this,d=c):(h=c,d=this);for(var y=0;y<d.length;y++)this.words[y]=h.words[y]^d.words[y];if(this!==h)for(;y<h.length;y++)this.words[y]=h.words[y];return this.length=h.length,this._strip()},a.prototype.ixor=function(c){return i((this.negative|c.negative)===0),this.iuxor(c)},a.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},a.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},a.prototype.inotn=function(c){i(typeof c=="number"&&c>=0);var h=Math.ceil(c/26)|0,d=c%26;this._expand(h),d>0&&h--;for(var y=0;y<h;y++)this.words[y]=~this.words[y]&67108863;return d>0&&(this.words[y]=~this.words[y]&67108863>>26-d),this._strip()},a.prototype.notn=function(c){return this.clone().inotn(c)},a.prototype.setn=function(c,h){i(typeof c=="number"&&c>=0);var d=c/26|0,y=c%26;return this._expand(d+1),h?this.words[d]=this.words[d]|1<<y:this.words[d]=this.words[d]&~(1<<y),this._strip()},a.prototype.iadd=function(c){var h;if(this.negative!==0&&c.negative===0)return this.negative=0,h=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,h=this.isub(c),c.negative=1,h._normSign();var d,y;this.length>c.length?(d=this,y=c):(d=c,y=this);for(var A=0,D=0;D<y.length;D++)h=(d.words[D]|0)+(y.words[D]|0)+A,this.words[D]=h&67108863,A=h>>>26;for(;A!==0&&D<d.length;D++)h=(d.words[D]|0)+A,this.words[D]=h&67108863,A=h>>>26;if(this.length=d.length,A!==0)this.words[this.length]=A,this.length++;else if(d!==this)for(;D<d.length;D++)this.words[D]=d.words[D];return this},a.prototype.add=function(c){var h;return c.negative!==0&&this.negative===0?(c.negative=0,h=this.sub(c),c.negative^=1,h):c.negative===0&&this.negative!==0?(this.negative=0,h=c.sub(this),this.negative=1,h):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},a.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var h=this.iadd(c);return c.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var d=this.cmp(c);if(d===0)return this.negative=0,this.length=1,this.words[0]=0,this;var y,A;d>0?(y=this,A=c):(y=c,A=this);for(var D=0,x=0;x<A.length;x++)h=(y.words[x]|0)-(A.words[x]|0)+D,D=h>>26,this.words[x]=h&67108863;for(;D!==0&&x<y.length;x++)h=(y.words[x]|0)+D,D=h>>26,this.words[x]=h&67108863;if(D===0&&x<y.length&&y!==this)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=Math.max(this.length,x),y!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(c){return this.clone().isub(c)};function V(c,h,d){d.negative=h.negative^c.negative;var y=c.length+h.length|0;d.length=y,y=y-1|0;var A=c.words[0]|0,D=h.words[0]|0,x=A*D,g=x&67108863,m=x/67108864|0;d.words[0]=g;for(var N=1;N<y;N++){for(var Q=m>>>26,re=m&67108863,O=Math.min(N,h.length-1),Z=Math.max(0,N-c.length+1);Z<=O;Z++){var k=N-Z|0;A=c.words[k]|0,D=h.words[Z]|0,x=A*D+re,Q+=x/67108864|0,re=x&67108863}d.words[N]=re|0,m=Q|0}return m!==0?d.words[N]=m|0:d.length--,d._strip()}var F=function(c,h,d){var y=c.words,A=h.words,D=d.words,x=0,g,m,N,Q=y[0]|0,re=Q&8191,O=Q>>>13,Z=y[1]|0,k=Z&8191,W=Z>>>13,J=y[2]|0,S=J&8191,G=J>>>13,oe=y[3]|0,ce=oe&8191,fe=oe>>>13,be=y[4]|0,we=be&8191,Ie=be>>>13,Je=y[5]|0,Ce=Je&8191,Te=Je>>>13,Se=y[6]|0,me=Se&8191,Oe=Se>>>13,Re=y[7]|0,ve=Re&8191,Ne=Re>>>13,Ee=y[8]|0,ye=Ee&8191,Le=Ee>>>13,De=y[9]|0,_e=De&8191,He=De>>>13,Ve=A[0]|0,xe=Ve&8191,Ke=Ve>>>13,ht=A[1]|0,Ge=ht&8191,wt=ht>>>13,lt=A[2]|0,Ye=lt&8191,Et=lt>>>13,Mt=A[3]|0,qe=Mt&8191,Xe=Mt>>>13,tt=A[4]|0,Fe=tt&8191,et=tt>>>13,Ze=A[5]|0,ze=Ze&8191,ut=Ze>>>13,rt=A[6]|0,je=rt&8191,it=rt>>>13,st=A[7]|0,Be=st&8191,Qe=st>>>13,ft=A[8]|0,$e=ft&8191,Rt=ft>>>13,Nt=A[9]|0,at=Nt&8191,bt=Nt>>>13;d.negative=c.negative^h.negative,d.length=19,g=Math.imul(re,xe),m=Math.imul(re,Ke),m=m+Math.imul(O,xe)|0,N=Math.imul(O,Ke);var Ir=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,g=Math.imul(k,xe),m=Math.imul(k,Ke),m=m+Math.imul(W,xe)|0,N=Math.imul(W,Ke),g=g+Math.imul(re,Ge)|0,m=m+Math.imul(re,wt)|0,m=m+Math.imul(O,Ge)|0,N=N+Math.imul(O,wt)|0;var Dr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,g=Math.imul(S,xe),m=Math.imul(S,Ke),m=m+Math.imul(G,xe)|0,N=Math.imul(G,Ke),g=g+Math.imul(k,Ge)|0,m=m+Math.imul(k,wt)|0,m=m+Math.imul(W,Ge)|0,N=N+Math.imul(W,wt)|0,g=g+Math.imul(re,Ye)|0,m=m+Math.imul(re,Et)|0,m=m+Math.imul(O,Ye)|0,N=N+Math.imul(O,Et)|0;var Pr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,g=Math.imul(ce,xe),m=Math.imul(ce,Ke),m=m+Math.imul(fe,xe)|0,N=Math.imul(fe,Ke),g=g+Math.imul(S,Ge)|0,m=m+Math.imul(S,wt)|0,m=m+Math.imul(G,Ge)|0,N=N+Math.imul(G,wt)|0,g=g+Math.imul(k,Ye)|0,m=m+Math.imul(k,Et)|0,m=m+Math.imul(W,Ye)|0,N=N+Math.imul(W,Et)|0,g=g+Math.imul(re,qe)|0,m=m+Math.imul(re,Xe)|0,m=m+Math.imul(O,qe)|0,N=N+Math.imul(O,Xe)|0;
22var Cr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,g=Math.imul(we,xe),m=Math.imul(we,Ke),m=m+Math.imul(Ie,xe)|0,N=Math.imul(Ie,Ke),g=g+Math.imul(ce,Ge)|0,m=m+Math.imul(ce,wt)|0,m=m+Math.imul(fe,Ge)|0,N=N+Math.imul(fe,wt)|0,g=g+Math.imul(S,Ye)|0,m=m+Math.imul(S,Et)|0,m=m+Math.imul(G,Ye)|0,N=N+Math.imul(G,Et)|0,g=g+Math.imul(k,qe)|0,m=m+Math.imul(k,Xe)|0,m=m+Math.imul(W,qe)|0,N=N+Math.imul(W,Xe)|0,g=g+Math.imul(re,Fe)|0,m=m+Math.imul(re,et)|0,m=m+Math.imul(O,Fe)|0,N=N+Math.imul(O,et)|0;var Or=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Or>>>26)|0,Or&=67108863,g=Math.imul(Ce,xe),m=Math.imul(Ce,Ke),m=m+Math.imul(Te,xe)|0,N=Math.imul(Te,Ke),g=g+Math.imul(we,Ge)|0,m=m+Math.imul(we,wt)|0,m=m+Math.imul(Ie,Ge)|0,N=N+Math.imul(Ie,wt)|0,g=g+Math.imul(ce,Ye)|0,m=m+Math.imul(ce,Et)|0,m=m+Math.imul(fe,Ye)|0,N=N+Math.imul(fe,Et)|0,g=g+Math.imul(S,qe)|0,m=m+Math.imul(S,Xe)|0,m=m+Math.imul(G,qe)|0,N=N+Math.imul(G,Xe)|0,g=g+Math.imul(k,Fe)|0,m=m+Math.imul(k,et)|0,m=m+Math.imul(W,Fe)|0,N=N+Math.imul(W,et)|0,g=g+Math.imul(re,ze)|0,m=m+Math.imul(re,ut)|0,m=m+Math.imul(O,ze)|0,N=N+Math.imul(O,ut)|0;var Zt=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,g=Math.imul(me,xe),m=Math.imul(me,Ke),m=m+Math.imul(Oe,xe)|0,N=Math.imul(Oe,Ke),g=g+Math.imul(Ce,Ge)|0,m=m+Math.imul(Ce,wt)|0,m=m+Math.imul(Te,Ge)|0,N=N+Math.imul(Te,wt)|0,g=g+Math.imul(we,Ye)|0,m=m+Math.imul(we,Et)|0,m=m+Math.imul(Ie,Ye)|0,N=N+Math.imul(Ie,Et)|0,g=g+Math.imul(ce,qe)|0,m=m+Math.imul(ce,Xe)|0,m=m+Math.imul(fe,qe)|0,N=N+Math.imul(fe,Xe)|0,g=g+Math.imul(S,Fe)|0,m=m+Math.imul(S,et)|0,m=m+Math.imul(G,Fe)|0,N=N+Math.imul(G,et)|0,g=g+Math.imul(k,ze)|0,m=m+Math.imul(k,ut)|0,m=m+Math.imul(W,ze)|0,N=N+Math.imul(W,ut)|0,g=g+Math.imul(re,je)|0,m=m+Math.imul(re,it)|0,m=m+Math.imul(O,je)|0,N=N+Math.imul(O,it)|0;var Hr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,g=Math.imul(ve,xe),m=Math.imul(ve,Ke),m=m+Math.imul(Ne,xe)|0,N=Math.imul(Ne,Ke),g=g+Math.imul(me,Ge)|0,m=m+Math.imul(me,wt)|0,m=m+Math.imul(Oe,Ge)|0,N=N+Math.imul(Oe,wt)|0,g=g+Math.imul(Ce,Ye)|0,m=m+Math.imul(Ce,Et)|0,m=m+Math.imul(Te,Ye)|0,N=N+Math.imul(Te,Et)|0,g=g+Math.imul(we,qe)|0,m=m+Math.imul(we,Xe)|0,m=m+Math.imul(Ie,qe)|0,N=N+Math.imul(Ie,Xe)|0,g=g+Math.imul(ce,Fe)|0,m=m+Math.imul(ce,et)|0,m=m+Math.imul(fe,Fe)|0,N=N+Math.imul(fe,et)|0,g=g+Math.imul(S,ze)|0,m=m+Math.imul(S,ut)|0,m=m+Math.imul(G,ze)|0,N=N+Math.imul(G,ut)|0,g=g+Math.imul(k,je)|0,m=m+Math.imul(k,it)|0,m=m+Math.imul(W,je)|0,N=N+Math.imul(W,it)|0,g=g+Math.imul(re,Be)|0,m=m+Math.imul(re,Qe)|0,m=m+Math.imul(O,Be)|0,N=N+Math.imul(O,Qe)|0;var Ni=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Ni>>>26)|0,Ni&=67108863,g=Math.imul(ye,xe),m=Math.imul(ye,Ke),m=m+Math.imul(Le,xe)|0,N=Math.imul(Le,Ke),g=g+Math.imul(ve,Ge)|0,m=m+Math.imul(ve,wt)|0,m=m+Math.imul(Ne,Ge)|0,N=N+Math.imul(Ne,wt)|0,g=g+Math.imul(me,Ye)|0,m=m+Math.imul(me,Et)|0,m=m+Math.imul(Oe,Ye)|0,N=N+Math.imul(Oe,Et)|0,g=g+Math.imul(Ce,qe)|0,m=m+Math.imul(Ce,Xe)|0,m=m+Math.imul(Te,qe)|0,N=N+Math.imul(Te,Xe)|0,g=g+Math.imul(we,Fe)|0,m=m+Math.imul(we,et)|0,m=m+Math.imul(Ie,Fe)|0,N=N+Math.imul(Ie,et)|0,g=g+Math.imul(ce,ze)|0,m=m+Math.imul(ce,ut)|0,m=m+Math.imul(fe,ze)|0,N=N+Math.imul(fe,ut)|0,g=g+Math.imul(S,je)|0,m=m+Math.imul(S,it)|0,m=m+Math.imul(G,je)|0,N=N+Math.imul(G,it)|0,g=g+Math.imul(k,Be)|0,m=m+Math.imul(k,Qe)|0,m=m+Math.imul(W,Be)|0,N=N+Math.imul(W,Qe)|0,g=g+Math.imul(re,$e)|0,m=m+Math.imul(re,Rt)|0,m=m+Math.imul(O,$e)|0,N=N+Math.imul(O,Rt)|0;var Kr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Kr>>>26)|0,Kr&=67108863,g=Math.imul(_e,xe),m=Math.imul(_e,Ke),m=m+Math.imul(He,xe)|0,N=Math.imul(He,Ke),g=g+Math.imul(ye,Ge)|0,m=m+Math.imul(ye,wt)|0,m=m+Math.imul(Le,Ge)|0,N=N+Math.imul(Le,wt)|0,g=g+Math.imul(ve,Ye)|0,m=m+Math.imul(ve,Et)|0,m=m+Math.imul(Ne,Ye)|0,N=N+Math.imul(Ne,Et)|0,g=g+Math.imul(me,qe)|0,m=m+Math.imul(me,Xe)|0,m=m+Math.imul(Oe,qe)|0,N=N+Math.imul(Oe,Xe)|0,g=g+Math.imul(Ce,Fe)|0,m=m+Math.imul(Ce,et)|0,m=m+Math.imul(Te,Fe)|0,N=N+Math.imul(Te,et)|0,g=g+Math.imul(we,ze)|0,m=m+Math.imul(we,ut)|0,m=m+Math.imul(Ie,ze)|0,N=N+Math.imul(Ie,ut)|0,g=g+Math.imul(ce,je)|0,m=m+Math.imul(ce,it)|0,m=m+Math.imul(fe,je)|0,N=N+Math.imul(fe,it)|0,g=g+Math.imul(S,Be)|0,m=m+Math.imul(S,Qe)|0,m=m+Math.imul(G,Be)|0,N=N+Math.imul(G,Qe)|0,g=g+Math.imul(k,$e)|0,m=m+Math.imul(k,Rt)|0,m=m+Math.imul(W,$e)|0,N=N+Math.imul(W,Rt)|0,g=g+Math.imul(re,at)|0,m=m+Math.imul(re,bt)|0,m=m+Math.imul(O,at)|0,N=N+Math.imul(O,bt)|0;var Ti=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,g=Math.imul(_e,Ge),m=Math.imul(_e,wt),m=m+Math.imul(He,Ge)|0,N=Math.imul(He,wt),g=g+Math.imul(ye,Ye)|0,m=m+Math.imul(ye,Et)|0,m=m+Math.imul(Le,Ye)|0,N=N+Math.imul(Le,Et)|0,g=g+Math.imul(ve,qe)|0,m=m+Math.imul(ve,Xe)|0,m=m+Math.imul(Ne,qe)|0,N=N+Math.imul(Ne,Xe)|0,g=g+Math.imul(me,Fe)|0,m=m+Math.imul(me,et)|0,m=m+Math.imul(Oe,Fe)|0,N=N+Math.imul(Oe,et)|0,g=g+Math.imul(Ce,ze)|0,m=m+Math.imul(Ce,ut)|0,m=m+Math.imul(Te,ze)|0,N=N+Math.imul(Te,ut)|0,g=g+Math.imul(we,je)|0,m=m+Math.imul(we,it)|0,m=m+Math.imul(Ie,je)|0,N=N+Math.imul(Ie,it)|0,g=g+Math.imul(ce,Be)|0,m=m+Math.imul(ce,Qe)|0,m=m+Math.imul(fe,Be)|0,N=N+Math.imul(fe,Qe)|0,g=g+Math.imul(S,$e)|0,m=m+Math.imul(S,Rt)|0,m=m+Math.imul(G,$e)|0,N=N+Math.imul(G,Rt)|0,g=g+Math.imul(k,at)|0,m=m+Math.imul(k,bt)|0,m=m+Math.imul(W,at)|0,N=N+Math.imul(W,bt)|0;var qi=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(qi>>>26)|0,qi&=67108863,g=Math.imul(_e,Ye),m=Math.imul(_e,Et),m=m+Math.imul(He,Ye)|0,N=Math.imul(He,Et),g=g+Math.imul(ye,qe)|0,m=m+Math.imul(ye,Xe)|0,m=m+Math.imul(Le,qe)|0,N=N+Math.imul(Le,Xe)|0,g=g+Math.imul(ve,Fe)|0,m=m+Math.imul(ve,et)|0,m=m+Math.imul(Ne,Fe)|0,N=N+Math.imul(Ne,et)|0,g=g+Math.imul(me,ze)|0,m=m+Math.imul(me,ut)|0,m=m+Math.imul(Oe,ze)|0,N=N+Math.imul(Oe,ut)|0,g=g+Math.imul(Ce,je)|0,m=m+Math.imul(Ce,it)|0,m=m+Math.imul(Te,je)|0,N=N+Math.imul(Te,it)|0,g=g+Math.imul(we,Be)|0,m=m+Math.imul(we,Qe)|0,m=m+Math.imul(Ie,Be)|0,N=N+Math.imul(Ie,Qe)|0,g=g+Math.imul(ce,$e)|0,m=m+Math.imul(ce,Rt)|0,m=m+Math.imul(fe,$e)|0,N=N+Math.imul(fe,Rt)|0,g=g+Math.imul(S,at)|0,m=m+Math.imul(S,bt)|0,m=m+Math.imul(G,at)|0,N=N+Math.imul(G,bt)|0;var Vr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,g=Math.imul(_e,qe),m=Math.imul(_e,Xe),m=m+Math.imul(He,qe)|0,N=Math.imul(He,Xe),g=g+Math.imul(ye,Fe)|0,m=m+Math.imul(ye,et)|0,m=m+Math.imul(Le,Fe)|0,N=N+Math.imul(Le,et)|0,g=g+Math.imul(ve,ze)|0,m=m+Math.imul(ve,ut)|0,m=m+Math.imul(Ne,ze)|0,N=N+Math.imul(Ne,ut)|0,g=g+Math.imul(me,je)|0,m=m+Math.imul(me,it)|0,m=m+Math.imul(Oe,je)|0,N=N+Math.imul(Oe,it)|0,g=g+Math.imul(Ce,Be)|0,m=m+Math.imul(Ce,Qe)|0,m=m+Math.imul(Te,Be)|0,N=N+Math.imul(Te,Qe)|0,g=g+Math.imul(we,$e)|0,m=m+Math.imul(we,Rt)|0,m=m+Math.imul(Ie,$e)|0,N=N+Math.imul(Ie,Rt)|0,g=g+Math.imul(ce,at)|0,m=m+Math.imul(ce,bt)|0,m=m+Math.imul(fe,at)|0,N=N+Math.imul(fe,bt)|0;var gi=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(gi>>>26)|0,gi&=67108863,g=Math.imul(_e,Fe),m=Math.imul(_e,et),m=m+Math.imul(He,Fe)|0,N=Math.imul(He,et),g=g+Math.imul(ye,ze)|0,m=m+Math.imul(ye,ut)|0,m=m+Math.imul(Le,ze)|0,N=N+Math.imul(Le,ut)|0,g=g+Math.imul(ve,je)|0,m=m+Math.imul(ve,it)|0,m=m+Math.imul(Ne,je)|0,N=N+Math.imul(Ne,it)|0,g=g+Math.imul(me,Be)|0,m=m+Math.imul(me,Qe)|0,m=m+Math.imul(Oe,Be)|0,N=N+Math.imul(Oe,Qe)|0,g=g+Math.imul(Ce,$e)|0,m=m+Math.imul(Ce,Rt)|0,m=m+Math.imul(Te,$e)|0,N=N+Math.imul(Te,Rt)|0,g=g+Math.imul(we,at)|0,m=m+Math.imul(we,bt)|0,m=m+Math.imul(Ie,at)|0,N=N+Math.imul(Ie,bt)|0;var vi=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(vi>>>26)|0,vi&=67108863,g=Math.imul(_e,ze),m=Math.imul(_e,ut),m=m+Math.imul(He,ze)|0,N=Math.imul(He,ut),g=g+Math.imul(ye,je)|0,m=m+Math.imul(ye,it)|0,m=m+Math.imul(Le,je)|0,N=N+Math.imul(Le,it)|0,g=g+Math.imul(ve,Be)|0,m=m+Math.imul(ve,Qe)|0,m=m+Math.imul(Ne,Be)|0,N=N+Math.imul(Ne,Qe)|0,g=g+Math.imul(me,$e)|0,m=m+Math.imul(me,Rt)|0,m=m+Math.imul(Oe,$e)|0,N=N+Math.imul(Oe,Rt)|0,g=g+Math.imul(Ce,at)|0,m=m+Math.imul(Ce,bt)|0,m=m+Math.imul(Te,at)|0,N=N+Math.imul(Te,bt)|0;var fr=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(fr>>>26)|0,fr&=67108863,g=Math.imul(_e,je),m=Math.imul(_e,it),m=m+Math.imul(He,je)|0,N=Math.imul(He,it),g=g+Math.imul(ye,Be)|0,m=m+Math.imul(ye,Qe)|0,m=m+Math.imul(Le,Be)|0,N=N+Math.imul(Le,Qe)|0,g=g+Math.imul(ve,$e)|0,m=m+Math.imul(ve,Rt)|0,m=m+Math.imul(Ne,$e)|0,N=N+Math.imul(Ne,Rt)|0,g=g+Math.imul(me,at)|0,m=m+Math.imul(me,bt)|0,m=m+Math.imul(Oe,at)|0,N=N+Math.imul(Oe,bt)|0;var Fi=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Fi>>>26)|0,Fi&=67108863,g=Math.imul(_e,Be),m=Math.imul(_e,Qe),m=m+Math.imul(He,Be)|0,N=Math.imul(He,Qe),g=g+Math.imul(ye,$e)|0,m=m+Math.imul(ye,Rt)|0,m=m+Math.imul(Le,$e)|0,N=N+Math.imul(Le,Rt)|0,g=g+Math.imul(ve,at)|0,m=m+Math.imul(ve,bt)|0,m=m+Math.imul(Ne,at)|0,N=N+Math.imul(Ne,bt)|0;var Bi=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Bi>>>
vendor: 18,404 bytes, line 22
2226)|0,Bi&=67108863,g=Math.imul(_e,$e),m=Math.imul(_e,Rt),m=m+Math.imul(He,$e)|0,N=Math.imul(He,Rt),g=g+Math.imul(ye,at)|0,m=m+Math.imul(ye,bt)|0,m=m+Math.imul(Le,at)|0,N=N+Math.imul(Le,bt)|0;var Li=(x+g|0)+((m&8191)<<13)|0;x=(N+(m>>>13)|0)+(Li>>>26)|0,Li&=67108863,g=Math.imul(_e,at),m=Math.imul(_e,bt),m=m+Math.imul(He,at)|0,N=Math.imul(He,bt);var hs=(x+g|0)+((m&8191)<<13)|0;return x=(N+(m>>>13)|0)+(hs>>>26)|0,hs&=67108863,D[0]=Ir,D[1]=Dr,D[2]=Pr,D[3]=Cr,D[4]=Or,D[5]=Zt,D[6]=Hr,D[7]=Ni,D[8]=Kr,D[9]=Ti,D[10]=qi,D[11]=Vr,D[12]=gi,D[13]=vi,D[14]=fr,D[15]=Fi,D[16]=Bi,D[17]=Li,D[18]=hs,x!==0&&(D[19]=x,d.length++),d};Math.imul||(F=V);function K(c,h,d){d.negative=h.negative^c.negative,d.length=c.length+h.length;for(var y=0,A=0,D=0;D<d.length-1;D++){var x=A;A=0;for(var g=y&67108863,m=Math.min(D,h.length-1),N=Math.max(0,D-c.length+1);N<=m;N++){var Q=D-N,re=c.words[Q]|0,O=h.words[N]|0,Z=re*O,k=Z&67108863;x=x+(Z/67108864|0)|0,k=k+g|0,g=k&67108863,x=x+(k>>>26)|0,A+=x>>>26,x&=67108863}d.words[D]=g,y=x,x=A}return y!==0?d.words[D]=y:d.length--,d._strip()}function B(c,h,d){return K(c,h,d)}a.prototype.mulTo=function(c,h){var d,y=this.length+c.length;return this.length===10&&c.length===10?d=F(this,c,h):y<63?d=V(this,c,h):y<1024?d=K(this,c,h):d=B(this,c,h),d},a.prototype.mul=function(c){var h=new a(null);return h.words=new Array(this.length+c.length),this.mulTo(c,h)},a.prototype.mulf=function(c){var h=new a(null);return h.words=new Array(this.length+c.length),B(this,c,h)},a.prototype.imul=function(c){return this.clone().mulTo(c,this)},a.prototype.imuln=function(c){var h=c<0;h&&(c=-c),i(typeof c=="number"),i(c<67108864);for(var d=0,y=0;y<this.length;y++){var A=(this.words[y]|0)*c,D=(A&67108863)+(d&67108863);d>>=26,d+=A/67108864|0,d+=D>>>26,this.words[y]=D&67108863}return d!==0&&(this.words[y]=d,this.length++),h?this.ineg():this},a.prototype.muln=function(c){return this.clone().imuln(c)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(c){var h=U(c);if(h.length===0)return new a(1);for(var d=this,y=0;y<h.length&&h[y]===0;y++,d=d.sqr());if(++y<h.length)for(var A=d.sqr();y<h.length;y++,A=A.sqr())h[y]!==0&&(d=d.mul(A));return d},a.prototype.iushln=function(c){i(typeof c=="number"&&c>=0);var h=c%26,d=(c-h)/26,y=67108863>>>26-h<<26-h,A;if(h!==0){var D=0;for(A=0;A<this.length;A++){var x=this.words[A]&y,g=(this.words[A]|0)-x<<h;this.words[A]=g|D,D=x>>>26-h}D&&(this.words[A]=D,this.length++)}if(d!==0){for(A=this.length-1;A>=0;A--)this.words[A+d]=this.words[A];for(A=0;A<d;A++)this.words[A]=0;this.length+=d}return this._strip()},a.prototype.ishln=function(c){return i(this.negative===0),this.iushln(c)},a.prototype.iushrn=function(c,h,d){i(typeof c=="number"&&c>=0);var y;h?y=(h-h%26)/26:y=0;var A=c%26,D=Math.min((c-A)/26,this.length),x=67108863^67108863>>>A<<A,g=d;if(y-=D,y=Math.max(0,y),g){for(var m=0;m<D;m++)g.words[m]=this.words[m];g.length=D}if(D!==0)if(this.length>D)for(this.length-=D,m=0;m<this.length;m++)this.words[m]=this.words[m+D];else this.words[0]=0,this.length=1;var N=0;for(m=this.length-1;m>=0&&(N!==0||m>=y);m--){var Q=this.words[m]|0;this.words[m]=N<<26-A|Q>>>A,N=Q&x}return g&&N!==0&&(g.words[g.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(c,h,d){return i(this.negative===0),this.iushrn(c,h,d)},a.prototype.shln=function(c){return this.clone().ishln(c)},a.prototype.ushln=function(c){return this.clone().iushln(c)},a.prototype.shrn=function(c){return this.clone().ishrn(c)},a.prototype.ushrn=function(c){return this.clone().iushrn(c)},a.prototype.testn=function(c){i(typeof c=="number"&&c>=0);var h=c%26,d=(c-h)/26,y=1<<h;if(this.length<=d)return!1;var A=this.words[d];return!!(A&y)},a.prototype.imaskn=function(c){i(typeof c=="number"&&c>=0);var h=c%26,d=(c-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=d)return this;if(h!==0&&d++,this.length=Math.min(d,this.length),h!==0){var y=67108863^67108863>>>h<<h;this.words[this.length-1]&=y}return this._strip()},a.prototype.maskn=function(c){return this.clone().imaskn(c)},a.prototype.iaddn=function(c){return i(typeof c=="number"),i(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},a.prototype._iaddn=function(c){this.words[0]+=c;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},a.prototype.isubn=function(c){if(i(typeof c=="number"),i(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},a.prototype.addn=function(c){return this.clone().iaddn(c)},a.prototype.subn=function(c){return this.clone().isubn(c)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(c,h,d){var y=c.length+d,A;this._expand(y);var D,x=0;for(A=0;A<c.length;A++){D=(this.words[A+d]|0)+x;var g=(c.words[A]|0)*h;D-=g&67108863,x=(D>>26)-(g/67108864|0),this.words[A+d]=D&67108863}for(;A<this.length-d;A++)D=(this.words[A+d]|0)+x,x=D>>26,this.words[A+d]=D&67108863;if(x===0)return this._strip();for(i(x===-1),x=0,A=0;A<this.length;A++)D=-(this.words[A]|0)+x,x=D>>26,this.words[A]=D&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(c,h){var d=this.length-c.length,y=this.clone(),A=c,D=A.words[A.length-1]|0,x=this._countBits(D);d=26-x,d!==0&&(A=A.ushln(d),y.iushln(d),D=A.words[A.length-1]|0);var g=y.length-A.length,m;if(h!=="mod"){m=new a(null),m.length=g+1,m.words=new Array(m.length);for(var N=0;N<m.length;N++)m.words[N]=0}var Q=y.clone()._ishlnsubmul(A,1,g);Q.negative===0&&(y=Q,m&&(m.words[g]=1));for(var re=g-1;re>=0;re--){var O=(y.words[A.length+re]|0)*67108864+(y.words[A.length+re-1]|0);for(O=Math.min(O/D|0,67108863),y._ishlnsubmul(A,O,re);y.negative!==0;)O--,y.negative=0,y._ishlnsubmul(A,1,re),y.isZero()||(y.negative^=1);m&&(m.words[re]=O)}return m&&m._strip(),y._strip(),h!=="div"&&d!==0&&y.iushrn(d),{div:m||null,mod:y}},a.prototype.divmod=function(c,h,d){if(i(!c.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var y,A,D;return this.negative!==0&&c.negative===0?(D=this.neg().divmod(c,h),h!=="mod"&&(y=D.div.neg()),h!=="div"&&(A=D.mod.neg(),d&&A.negative!==0&&A.iadd(c)),{div:y,mod:A}):this.negative===0&&c.negative!==0?(D=this.divmod(c.neg(),h),h!=="mod"&&(y=D.div.neg()),{div:y,mod:D.mod}):this.negative&c.negative?(D=this.neg().divmod(c.neg(),h),h!=="div"&&(A=D.mod.neg(),d&&A.negative!==0&&A.isub(c)),{div:D.div,mod:A}):c.length>this.length||this.cmp(c)<0?{div:new a(0),mod:this}:c.length===1?h==="div"?{div:this.divn(c.words[0]),mod:null}:h==="mod"?{div:null,mod:new a(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new a(this.modrn(c.words[0]))}:this._wordDiv(c,h)},a.prototype.div=function(c){return this.divmod(c,"div",!1).div},a.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},a.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},a.prototype.divRound=function(c){var h=this.divmod(c);if(h.mod.isZero())return h.div;var d=h.div.negative!==0?h.mod.isub(c):h.mod,y=c.ushrn(1),A=c.andln(1),D=d.cmp(y);return D<0||A===1&&D===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},a.prototype.modrn=function(c){var h=c<0;h&&(c=-c),i(c<=67108863);for(var d=(1<<26)%c,y=0,A=this.length-1;A>=0;A--)y=(d*y+(this.words[A]|0))%c;return h?-y:y},a.prototype.modn=function(c){return this.modrn(c)},a.prototype.idivn=function(c){var h=c<0;h&&(c=-c),i(c<=67108863);for(var d=0,y=this.length-1;y>=0;y--){var A=(this.words[y]|0)+d*67108864;this.words[y]=A/c|0,d=A%c}return this._strip(),h?this.ineg():this},a.prototype.divn=function(c){return this.clone().idivn(c)},a.prototype.egcd=function(c){i(c.negative===0),i(!c.isZero());var h=this,d=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var y=new a(1),A=new a(0),D=new a(0),x=new a(1),g=0;h.isEven()&&d.isEven();)h.iushrn(1),d.iushrn(1),++g;for(var m=d.clone(),N=h.clone();!h.isZero();){for(var Q=0,re=1;!(h.words[0]&re)&&Q<26;++Q,re<<=1);if(Q>0)for(h.iushrn(Q);Q-- >0;)(y.isOdd()||A.isOdd())&&(y.iadd(m),A.isub(N)),y.iushrn(1),A.iushrn(1);for(var O=0,Z=1;!(d.words[0]&Z)&&O<26;++O,Z<<=1);if(O>0)for(d.iushrn(O);O-- >0;)(D.isOdd()||x.isOdd())&&(D.iadd(m),x.isub(N)),D.iushrn(1),x.iushrn(1);h.cmp(d)>=0?(h.isub(d),y.isub(D),A.isub(x)):(d.isub(h),D.isub(y),x.isub(A))}return{a:D,b:x,gcd:d.iushln(g)}},a.prototype._invmp=function(c){i(c.negative===0),i(!c.isZero());var h=this,d=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var y=new a(1),A=new a(0),D=d.clone();h.cmpn(1)>0&&d.cmpn(1)>0;){for(var x=0,g=1;!(h.words[0]&g)&&x<26;++x,g<<=1);if(x>0)for(h.iushrn(x);x-- >0;)y.isOdd()&&y.iadd(D),y.iushrn(1);for(var m=0,N=1;!(d.words[0]&N)&&m<26;++m,N<<=1);if(m>0)for(d.iushrn(m);m-- >0;)A.isOdd()&&A.iadd(D),A.iushrn(1);h.cmp(d)>=0?(h.isub(d),y.isub(A)):(d.isub(h),A.isub(y))}var Q;return h.cmpn(1)===0?Q=y:Q=A,Q.cmpn(0)<0&&Q.iadd(c),Q},a.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var h=this.clone(),d=c.clone();h.negative=0,d.negative=0;for(var y=0;h.isEven()&&d.isEven();y++)h.iushrn(1),d.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;d.isEven();)d.iushrn(1);var A=h.cmp(d);if(A<0){var D=h;h=d,d=D}else if(A===0||d.cmpn(1)===0)break;h.isub(d)}while(!0);return d.iushln(y)},a.prototype.invm=function(c){return this.egcd(c).a.umod(c)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(c){return this.words[0]&c},a.prototype.bincn=function(c){i(typeof c=="number");var h=c%26,d=(c-h)/26,y=1<<h;if(this.length<=d)return this._expand(d+1),this.words[d]|=y,this;for(var A=y,D=d;A!==0&&D<this.length;D++){var x=this.words[D]|0;x+=A,A=x>>>26,x&=67108863,this.words[D]=x}return A!==0&&(this.words[D]=A,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(c){var h=c<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var d;if(this.length>1)d=1;else{h&&(c=-c),i(c<=67108863,"Number is too big");var y=this.words[0]|0;d=y===c?0:y<c?-1:1}return this.negative!==0?-d|0:d},a.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var h=this.ucmp(c);return this.negative!==0?-h|0:h},a.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var h=0,d=this.length-1;d>=0;d--){var y=this.words[d]|0,A=c.words[d]|0;if(y!==A){y<A?h=-1:y>A&&(h=1);break}}return h},a.prototype.gtn=function(c){return this.cmpn(c)===1},a.prototype.gt=function(c){return this.cmp(c)===1},a.prototype.gten=function(c){return this.cmpn(c)>=0},a.prototype.gte=function(c){return this.cmp(c)>=0},a.prototype.ltn=function(c){return this.cmpn(c)===-1},a.prototype.lt=function(c){return this.cmp(c)===-1},a.prototype.lten=function(c){return this.cmpn(c)<=0},a.prototype.lte=function(c){return this.cmp(c)<=0},a.prototype.eqn=function(c){return this.cmpn(c)===0},a.prototype.eq=function(c){return this.cmp(c)===0},a.red=function(c){return new z(c)},a.prototype.toRed=function(c){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(c){return this.red=c,this},a.prototype.forceRed=function(c){return i(!this.red,"Already a number in reduction context"),this._forceRed(c)},a.prototype.redAdd=function(c){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},a.prototype.redIAdd=function(c){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},a.prototype.redSub=function(c){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},a.prototype.redISub=function(c){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},a.prototype.redShl=function(c){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},a.prototype.redMul=function(c){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},a.prototype.redIMul=function(c){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(c){return i(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var j={k256:null,p224:null,p192:null,p25519:null};function q(c,h){this.name=c,this.p=new a(h,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var c=new a(null);return c.words=new Array(Math.ceil(this.n/13)),c},q.prototype.ireduce=function(c){var h=c,d;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),d=h.bitLength();while(d>this.n);var y=d<this.n?-1:h.ucmp(this.p);return y===0?(h.words[0]=0,h.length=1):y>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},q.prototype.split=function(c,h){c.iushrn(this.n,0,h)},q.prototype.imulK=function(c){return c.imul(this.k)};function E(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}s(E,q),E.prototype.split=function(c,h){for(var d=4194303,y=Math.min(c.length,9),A=0;A<y;A++)h.words[A]=c.words[A];if(h.length=y,c.length<=9){c.words[0]=0,c.length=1;return}var D=c.words[9];for(h.words[h.length++]=D&d,A=10;A<c.length;A++){var x=c.words[A]|0;c.words[A-10]=(x&d)<<4|D>>>22,D=x}D>>>=22,c.words[A-10]=D,D===0&&c.length>10?c.length-=10:c.length-=9},E.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var h=0,d=0;d<c.length;d++){var y=c.words[d]|0;h+=y*977,c.words[d]=h&67108863,h=y*64+(h/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function L(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}s(L,q);function te(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}s(te,q);function ae(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}s(ae,q),ae.prototype.imulK=function(c){for(var h=0,d=0;d<c.length;d++){var y=(c.words[d]|0)*19+h,A=y&67108863;y>>>=26,c.words[d]=A,h=y}return h!==0&&(c.words[c.length++]=h),c},a._prime=function(c){if(j[c])return j[c];var h;if(c==="k256")h=new E;else if(c==="p224")h=new L;else if(c==="p192")h=new te;else if(c==="p25519")h=new ae;else throw new Error("Unknown prime "+c);return j[c]=h,h};function z(c){if(typeof c=="string"){var h=a._prime(c);this.m=h.p,this.prime=h}else i(c.gtn(1),"modulus must be greater than 1"),this.m=c,this.prime=null}z.prototype._verify1=function(c){i(c.negative===0,"red works only with positives"),i(c.red,"red works only with red numbers")},z.prototype._verify2=function(c,h){i((c.negative|h.negative)===0,"red works only with positives"),i(c.red&&c.red===h.red,"red works only with red numbers")},z.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(b(c,c.umod(this.m)._forceRed(this)),c)},z.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},z.prototype.add=function(c,h){this._verify2(c,h);var d=c.add(h);return d.cmp(this.m)>=0&&d.isub(this.m),d._forceRed(this)},z.prototype.iadd=function(c,h){this._verify2(c,h);var d=c.iadd(h);return d.cmp(this.m)>=0&&d.isub(this.m),d},z.prototype.sub=function(c,h){this._verify2(c,h);var d=c.sub(h);return d.cmpn(0)<0&&d.iadd(this.m),d._forceRed(this)},z.prototype.isub=function(c,h){this._verify2(c,h);var d=c.isub(h);return d.cmpn(0)<0&&d.iadd(this.m),d},z.prototype.shl=function(c,h){return this._verify1(c),this.imod(c.ushln(h))},z.prototype.imul=function(c,h){return this._verify2(c,h),this.imod(c.imul(h))},z.prototype.mul=function(c,h){return this._verify2(c,h),this.imod(c.mul(h))},z.prototype.isqr=function(c){return this.imul(c,c.clone())},z.prototype.sqr=function(c){return this.mul(c,c)},z.prototype.sqrt=function(c){if(c.isZero())return c.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var d=this.m.add(new a(1)).iushrn(2);return this.pow(c,d)}for(var y=this.m.subn(1),A=0;!y.isZero()&&y.andln(1)===0;)A++,y.iushrn(1);i(!y.isZero());var D=new a(1).toRed(this),x=D.redNeg(),g=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new a(2*m*m).toRed(this);this.pow(m,g).cmp(x)!==0;)m.redIAdd(x);for(var N=this.pow(m,y),Q=this.pow(c,y.addn(1).iushrn(1)),re=this.pow(c,y),O=A;re.cmp(D)!==0;){for(var Z=re,k=0;Z.cmp(D)!==0;k++)Z=Z.redSqr();i(k<O);var W=this.pow(N,new a(1).iushln(O-k-1));Q=Q.redMul(W),N=W.redSqr(),re=re.redMul(N),O=k}return Q},z.prototype.invm=function(c){var h=c._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},z.prototype.pow=function(c,h){if(h.isZero())return new a(1).toRed(this);if(h.cmpn(1)===0)return c.clone();var d=4,y=new Array(1<<d);y[0]=new a(1).toRed(this),y[1]=c;for(var A=2;A<y.length;A++)y[A]=this.mul(y[A-1],c);var D=y[0],x=0,g=0,m=h.bitLength()%26;for(m===0&&(m=26),A=h.length-1;A>=0;A--){for(var N=h.words[A],Q=m-1;Q>=0;Q--){var re=N>>Q&1;if(D!==y[0]&&(D=this.sqr(D)),re===0&&x===0){g=0;continue}
22x<<=1,x|=re,g++,!(g!==d&&(A!==0||Q!==0))&&(D=this.mul(D,y[x]),g=0,x=0)}m=26}return D},z.prototype.convertTo=function(c){var h=c.umod(this.m);return h===c?h.clone():h},z.prototype.convertFrom=function(c){var h=c.clone();return h.red=null,h},a.mont=function(c){return new w(c)};function w(c){z.call(this,c),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}s(w,z),w.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},w.prototype.convertFrom=function(c){var h=this.imod(c.mul(this.rinv));return h.red=null,h},w.prototype.imul=function(c,h){if(c.isZero()||h.isZero())return c.words[0]=0,c.length=1,c;var d=c.imul(h),y=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=d.isub(y).iushrn(this.shift),D=A;return A.cmp(this.m)>=0?D=A.isub(this.m):A.cmpn(0)<0&&(D=A.iadd(this.m)),D._forceRed(this)},w.prototype.mul=function(c,h){if(c.isZero()||h.isZero())return new a(0)._forceRed(this);var d=c.mul(h),y=d.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=d.isub(y).iushrn(this.shift),D=A;return A.cmp(this.m)>=0?D=A.isub(this.m):A.cmpn(0)<0&&(D=A.iadd(this.m)),D._forceRed(this)},w.prototype.invm=function(c){var h=this.imod(c._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(r,gb)})(yb);var vt=yb.exports;const wb="bignumber/5.7.0";var _u=vt.BN;const zn=new xr(wb),Wh={},J1=9007199254740991;function Z7(r){return r!=null&&(Gt.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||li(r)||typeof r=="bigint"||Ea(r))}let Y1=!1;class Gt{constructor(e,t){e!==Wh&&zn.throwError("cannot call constructor directly; use BigNumber.from",xr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Xr(Dt(this).fromTwos(e))}toTwos(e){return Xr(Dt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Gt.from(this._hex.substring(1)):this}add(e){return Xr(Dt(this).add(Dt(e)))}sub(e){return Xr(Dt(this).sub(Dt(e)))}div(e){return Gt.from(e).isZero()&&Si("division-by-zero","div"),Xr(Dt(this).div(Dt(e)))}mul(e){return Xr(Dt(this).mul(Dt(e)))}mod(e){const t=Dt(e);return t.isNeg()&&Si("division-by-zero","mod"),Xr(Dt(this).umod(t))}pow(e){const t=Dt(e);return t.isNeg()&&Si("negative-power","pow"),Xr(Dt(this).pow(t))}and(e){const t=Dt(e);return(this.isNegative()||t.isNeg())&&Si("unbound-bitwise-result","and"),Xr(Dt(this).and(t))}or(e){const t=Dt(e);return(this.isNegative()||t.isNeg())&&Si("unbound-bitwise-result","or"),Xr(Dt(this).or(t))}xor(e){const t=Dt(e);return(this.isNegative()||t.isNeg())&&Si("unbound-bitwise-result","xor"),Xr(Dt(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Si("negative-width","mask"),Xr(Dt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Si("negative-width","shl"),Xr(Dt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Si("negative-width","shr"),Xr(Dt(this).shrn(e))}eq(e){return Dt(this).eq(Dt(e))}lt(e){return Dt(this).lt(Dt(e))}lte(e){return Dt(this).lte(Dt(e))}gt(e){return Dt(this).gt(Dt(e))}gte(e){return Dt(this).gte(Dt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Dt(this).isZero()}toNumber(){try{return Dt(this).toNumber()}catch{Si("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return zn.throwError("this platform does not support BigInt",xr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?Y1||(Y1=!0,zn.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?zn.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",xr.errors.UNEXPECTED_ARGUMENT,{}):zn.throwError("BigNumber.toString does not accept parameters",xr.errors.UNEXPECTED_ARGUMENT,{})),Dt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Gt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Gt(Wh,So(e)):e.match(/^-?[0-9]+$/)?new Gt(Wh,So(new _u(e))):zn.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Si("underflow","BigNumber.from",e),(e>=J1||e<=-J1)&&Si("overflow","BigNumber.from",e),Gt.from(String(e));const t=e;if(typeof t=="bigint")return Gt.from(t.toString());if(Ea(t))return Gt.from(ti(t));if(t)if(t.toHexString){const i=t.toHexString();if(typeof i=="string")return Gt.from(i)}else{let i=t._hex;if(i==null&&t.type==="BigNumber"&&(i=t.hex),typeof i=="string"&&(li(i)||i[0]==="-"&&li(i.substring(1))))return Gt.from(i)}return zn.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function So(r){if(typeof r!="string")return So(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&zn.throwArgumentError("invalid hex","value",r),r=So(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function Xr(r){return Gt.from(So(r))}function Dt(r){const e=Gt.from(r).toHexString();return e[0]==="-"?new _u("-"+e.substring(3),16):new _u(e.substring(2),16)}function Si(r,e,t){const i={fault:r,operation:e};return t!=null&&(i.value=t),zn.throwError(r,xr.errors.NUMERIC_FAULT,i)}function e9(r){return new _u(r,36).toString(16)}const jr=new xr(wb),yo={},_b=Gt.from(0),Ab=Gt.from(-1);function Eb(r,e,t,i){const s={fault:e,operation:t};return i!==void 0&&(s.value=i),jr.throwError(r,xr.errors.NUMERIC_FAULT,s)}let wo="0";for(;wo.length<256;)wo+=wo;function Zl(r){if(typeof r!="number")try{r=Gt.from(r).toNumber()}catch{}return typeof r=="number"&&r>=0&&r<=256&&!(r%1)?"1"+wo.substring(0,r):jr.throwArgumentError("invalid decimal size","decimals",r)}function Jh(r,e){e==null&&(e=0);const t=Zl(e);r=Gt.from(r);const i=r.lt(_b);i&&(r=r.mul(Ab));let s=r.mod(t).toString();for(;s.length<t.length-1;)s="0"+s;s=s.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=r.div(t).toString();return t.length===1?r=a:r=a+"."+s,i&&(r="-"+r),r}function Fn(r,e){e==null&&(e=0);const t=Zl(e);(typeof r!="string"||!r.match(/^-?[0-9.]+$/))&&jr.throwArgumentError("invalid decimal value","value",r);const i=r.substring(0,1)==="-";i&&(r=r.substring(1)),r==="."&&jr.throwArgumentError("missing value","value",r);const s=r.split(".");s.length>2&&jr.throwArgumentError("too many decimal points","value",r);let a=s[0],f=s[1];for(a||(a="0"),f||(f="0");f[f.length-1]==="0";)f=f.substring(0,f.length-1);for(f.length>t.length-1&&Eb("fractional component exceeds decimals","underflow","parseFixed"),f===""&&(f="0");f.length<t.length-1;)f+="0";const l=Gt.from(a),p=Gt.from(f);let u=l.mul(t).add(p);return i&&(u=u.mul(Ab)),u}let Yh=class Dl{constructor(e,t,i,s){e!==yo&&jr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",xr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=i,this.decimals=s,this.name=(t?"":"u")+"fixed"+String(i)+"x"+String(s),this._multiplier=Zl(s),Object.freeze(this)}static from(e){if(e instanceof Dl)return e;typeof e=="number"&&(e=`fixed128x${e}`);let t=!0,i=128,s=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")t=!1;else{const a=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);a||jr.throwArgumentError("invalid fixed format","format",e),t=a[1]!=="u",i=parseInt(a[2]),s=parseInt(a[3])}}else if(e){const a=(f,l,p)=>e[f]==null?p:(typeof e[f]!==l&&jr.throwArgumentError("invalid fixed format ("+f+" not "+l+")","format."+f,e[f]),e[f]);t=a("signed","boolean",t),i=a("width","number",i),s=a("decimals","number",s)}return i%8&&jr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),s>80&&jr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",s),new Dl(yo,t,i,s)}}
22,xb=class Ur{constructor(e,t,i,s){e!==yo&&jr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",xr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=s,this._hex=t,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&jr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Fn(this._value,this.format.decimals),i=Fn(e._value,e.format.decimals);return Ur.fromValue(t.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Fn(this._value,this.format.decimals),i=Fn(e._value,e.format.decimals);return Ur.fromValue(t.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Fn(this._value,this.format.decimals),i=Fn(e._value,e.format.decimals);return Ur.fromValue(t.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Fn(this._value,this.format.decimals),i=Fn(e._value,e.format.decimals);return Ur.fromValue(t.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Ur.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(t=t.subUnsafe(Q1.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Ur.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(t=t.addUnsafe(Q1.toFormat(t.format))),t}round(e){e==null&&(e=0);const t=this.toString().split(".");if(t.length===1&&t.push("0"),(e<0||e>80||e%1)&&jr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const i=Ur.from("1"+wo.substring(0,e),this.format),s=t9.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(s).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&jr.throwArgumentError("invalid byte width","width",e);const t=Gt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return bn(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Ur.fromString(this._value,e)}static fromValue(e,t,i){return i==null&&t!=null&&!Z7(t)&&(i=t,t=null),t==null&&(t=0),i==null&&(i="fixed"),Ur.fromString(Jh(e,t),Yh.from(i))}static fromString(e,t){t==null&&(t="fixed");const i=Yh.from(t),s=Fn(e,i.decimals);!i.signed&&s.lt(_b)&&Eb("unsigned value cannot be negative","overflow","value",e);let a=null;i.signed?a=s.toTwos(i.width).toHexString():(a=s.toHexString(),a=bn(a,i.width/8));const f=Jh(s,i.decimals);return new Ur(yo,a,f,i)}static fromBytes(e,t){t==null&&(t="fixed");const i=Yh.from(t);if(rr(e).length>i.width/8)throw new Error("overflow");let s=Gt.from(e);i.signed&&(s=s.fromTwos(i.width));const a=s.toTwos((i.signed?0:1)+i.width).toHexString(),f=Jh(s,i.decimals);return new Ur(yo,a,f,i)}static from(e,t){if(typeof e=="string")return Ur.fromString(e,t);if(Ea(e))return Ur.fromBytes(e,t);try{return Ur.fromValue(e,0,t)}catch(i){if(i.code!==xr.errors.INVALID_ARGUMENT)throw i}return jr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const Q1=xb.from(1),t9=xb.from("0.5"),r9="strings/5.7.0",i9=new xr(r9);var Au;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(Au||(Au={}));var X1;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(X1||(X1={}));function Qh(r,e=Au.current){e!=Au.current&&(i9.checkNormalize(),r=r.normalize(e));let t=[];for(let i=0;i<r.length;i++){const s=r.charCodeAt(i);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){i++;const a=r.charCodeAt(i);if(i>=r.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const f=65536+((s&1023)<<10)+(a&1023);t.push(f>>18|240),t.push(f>>12&63|128),t.push(f>>6&63|128),t.push(f&63|128)}else t.push(s>>
2212|224),t.push(s>>6&63|128),t.push(s&63|128)}return rr(t)}function n9(r){if(r.length%4!==0)throw new Error("bad data");let e=[];for(let t=0;t<r.length;t+=4)e.push(parseInt(r.substring(t,t+4),16));return e}function Xh(r,e){e||(e=function(s){return[parseInt(s,16)]});let t=0,i={};return r.split(",").forEach(s=>{let a=s.split(":");t+=parseInt(a[0],16),i[t]=e(a[1])}),i}function Z1(r){let e=0;return r.split(",").map(t=>{let i=t.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let s=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:s,h:e}})}Z1("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),Xh("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Xh("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Xh("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",n9),Z1("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function s9(r){r=atob(r);const e=[];for(let t=0;t<r.length;t++)e.push(r.charCodeAt(t));return rr(e)}function Sb(r,e){e==null&&(e=1);const t=[],i=t.forEach,s=function(a,f){i.call(a,function(l){f>0&&Array.isArray(l)?s(l,f-1):t.push(l)})};return s(r,e),t}function a9(r){const e={};for(let t=0;t<r.length;t++){const i=r[t];e[i[0]]=i[1]}return e}function o9(r){let e=0;function t(){return r[e++]<<8|r[e++]}let i=t(),s=1,a=[0,1];for(let j=1;j<i;j++)a.push(s+=t());let f=t(),l=e;e+=f;let p=0,u=0;function b(){return p==0&&(u=u<<8|r[e++],p=8),u>>--p&1}const _=31,M=Math.pow(2,_),I=M>>>1,C=I>>1,R=M-1;let U=0;for(let j=0;j<_;j++)U=U<<1|b();let V=[],F=0,K=M;for(;;){let j=Math.floor(((U-F+1)*s-1)/K),q=0,E=i;for(;E-q>1;){let ae=q+E>>>1;
22j<a[ae]?E=ae:q=ae}if(q==0)break;V.push(q);let L=F+Math.floor(K*a[q]/s),te=F+Math.floor(K*a[q+1]/s)-1;for(;!((L^te)&I);)U=U<<1&R|b(),L=L<<1&R,te=te<<1&R|1;for(;L&~te&C;)U=U&I|U<<1&R>>>1|b(),L=L<<1^I,te=(te^I)<<1|I|1;F=L,K=1+te-L}let B=i-4;return V.map(j=>{switch(j-B){case 3:return B+65792+(r[l++]<<16|r[l++]<<8|r[l++]);case 2:return B+256+(r[l++]<<8|r[l++]);case 1:return B+r[l++];default:return j-1}})}function c9(r){let e=0;return()=>r[e++]}function u9(r){return c9(o9(r))}function f9(r){return r&1?~r>>1:r>>1}function h9(r,e){let t=Array(r);for(let i=0;i<r;i++)t[i]=1+e();return t}function eg(r,e){let t=Array(r);for(let i=0,s=-1;i<r;i++)t[i]=s+=1+e();return t}function l9(r,e){let t=Array(r);for(let i=0,s=0;i<r;i++)t[i]=s+=f9(e());return t}function Eu(r,e){let t=eg(r(),r),i=r(),s=eg(i,r),a=h9(i,r);for(let f=0;f<i;f++)for(let l=0;l<a[f];l++)t.push(s[f]+l);return e?t.map(f=>e[f]):t}function d9(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(g9(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(v9(t,r))}return a9(Sb(e))}function p9(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(t)}return e}function Mb(r,e,t){let i=Array(r).fill(void 0).map(()=>[]);for(let s=0;s<e;s++)l9(r,t).forEach((a,f)=>i[f].push(a));return i}function g9(r,e){let t=1+e(),i=e(),s=p9(e),a=Mb(s.length,1+r,e);return Sb(a.map((f,l)=>{const p=f[0],u=f.slice(1);return Array(s[l]).fill(void 0).map((b,_)=>{let M=_*i;return[p+_*t,u.map(I=>I+M)]})}))}function v9(r,e){let t=1+e();return Mb(t,1+r,e).map(i=>[i[0],i.slice(1)])}function b9(r){let e=Eu(r).sort((i,s)=>i-s);return t();function t(){let i=[];for(;;){let u=Eu(r,e);if(u.length==0)break;i.push({set:new Set(u),node:t()})}i.sort((u,b)=>b.set.size-u.set.size);let s=r(),a=s%3;s=s/3|0;let f=!!(s&1);s>>=1;let l=s==1,p=s==2;return{branches:i,valid:a,fe0f:f,save:l,check:p}}}function m9(){return u9(s9
vendor: 14,757 bytes, line 22
22("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))
22}const Jc=m9();new Set(Eu(Jc)),new Set(Eu(Jc)),d9(Jc),b9(Jc);const y9=new Uint8Array(32);y9.fill(0);const w9=`�Ethereum Signed Message: 23`;function Ib(r){return typeof r=="string"&&(r=Qh(r)),Xl(G7([Qh(w9),Qh(String(r.length)),r]))}const _9="address/5.7.0",lo=new xr(_9);function tg(r){li(r,20)||lo.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);const i=rr(Xl(t));for(let s=0;s<40;s+=2)i[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(i[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}const A9=9007199254740991;function E9(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const ed={};for(let r=0;r<10;r++)ed[String(r)]=String(r);for(let r=0;r<26;r++)ed[String.fromCharCode(65+r)]=String(10+r);const rg=Math.floor(E9(A9));function x9(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>ed[i]).join("");for(;e.length>=rg;){let i=e.substring(0,rg);e=parseInt(i,10)%97+e.substring(i.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}function S9(r){let e=null;if(typeof r!="string"&&lo.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=tg(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&lo.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==x9(r)&&lo.throwArgumentError("bad icap checksum","address",r),e=e9(r.substring(4));e.length<40;)e="0"+e;e=tg("0x"+e)}else lo.throwArgumentError("invalid address","address",r);return e}function ro(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}const M9=new Uint8Array(32);M9.fill(0),Gt.from(-1);const I9=Gt.from(0),D9=Gt.from(1);Gt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),bn(D9.toHexString(),32),bn(I9.toHexString(),32);var fn={},Pt={},Fo=Db;function Db(r,e){if(!r)throw new Error(e||"Assertion failed")}Db.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var Pl={exports:{}};typeof Object.create=="function"?Pl.exports=function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:Pl.exports=function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}};var P9=Fo,C9=Pl.exports;Pt.inherits=C9;function O9(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function R9(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),s=0;s<r.length;s+=2)t.push(parseInt(r[s]+r[s+1],16))}else for(var i=0,s=0;s<r.length;s++){var a=r.charCodeAt(s);a<128?t[i++]=a:a<2048?(t[i++]=a>>6|192,t[i++]=a&63|128):O9(r,s)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++s)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(s=0;s<r.length;s++)t[s]=r[s]|0;return t}Pt.toArray=R9;function N9(r){for(var e="",t=0;t<r.length;t++)e+=Cb(r[t].toString(16));return e}Pt.toHex=N9;function Pb(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Pt.htonl=Pb;function T9(r,e){for(var t="",i=0;i<r.length;i++){var s=r[i];e==="little"&&(s=Pb(s)),t+=Ob(s.toString(16))}return t}Pt.toHex32=T9;function Cb(r){return r.length===1?"0"+r:r}Pt.zero2=Cb;function Ob(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}Pt.zero8=Ob;function q9(r,e,t,i){var s=t-e;P9(s%4===0);for(var a=new Array(s/4),f=0,l=e;f<a.length;f++,l+=4){var p;i==="big"?p=r[l]<<24|r[l+1]<<16|r[l+2]<<8|r[l+3]:p=r[l+3]<<24|r[l+2]<<16|r[l+1]<<8|r[l],a[f]=p>>>0}return a}Pt.join32=q9;function F9(r,e){for(var t=new Array(r.length*4),i=0,s=0;i<r.length;i++,s+=4){var a=r[i];e==="big"?(t[s]=a>>>24,t[s+1]=a>>>16&255,t[s+2]=a>>>8&255,t[s+3]=a&255):(t[s+3]=a>>>24,t[s+2]=a>>>16&255,t[s+1]=a>>>8&255,t[s]=a&255)}return t}Pt.split32=F9;function B9(r,e){return r>>>e|r<<32-e}Pt.rotr32=B9;function L9(r,e){return r<<e|r>>>32-e}Pt.rotl32=L9;function U9(r,e){return r+e>>>0}Pt.sum32=U9;function z9(r,e,t){return r+e+t>>>0}Pt.sum32_3=z9;function j9(r,e,t,i){return r+e+t+i>>>0}Pt.sum32_4=j9;function $9(r,e,t,i,s){return r+e+t+i+s>>>0}Pt.sum32_5=$9;function k9(r,e,t,i){var s=r[e],a=r[e+1],f=i+a>>>0,l=(f<i?1:0)+t+s;r[e]=l>>>0,r[e+1]=f}Pt.sum64=k9;function H9(r,e,t,i){var s=e+i>>>0,a=(s<e?1:0)+r+t;return a>>>0}Pt.sum64_hi=H9;function K9(r,e,t,i){var s=e+i;return s>>>0}Pt.sum64_lo=K9;function V9(r,e,t,i,s,a,f,l){var p=0,u=e;u=u+i>>>0,p+=u<e?1:0,u=u+a>>>0,p+=u<a?1:0,u=u+l>>>0,p+=u<l?1:0;var b=r+t+s+f+p;return b>>>0}Pt.sum64_4_hi=V9;function G9(r,e,t,i,s,a,f,l){var p=e+i+a+l;return p>>>0}Pt.sum64_4_lo=G9;function W9(r,e,t,i,s,a,f,l,p,u){var b=0,_=e;_=_+i>>>0,b+=_<e?1:0,_=_+a>>>0,b+=_<a?1:0,_=_+l>>>0,b+=_<l?1:0,_=_+u>>>0,b+=_<u?1:0;var M=r+t+s+f+p+b;return M>>>0}Pt.sum64_5_hi=W9;function J9(r,e,t,i,s,a,f,l,p,u){var b=e+i+a+l+u;return b>>>0}Pt.sum64_5_lo=J9;function Y9(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Pt.rotr64_hi=Y9;function Q9(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Pt.rotr64_lo=Q9;function X9(r,e,t){return r>>>t}Pt.shr64_hi=X9;function Z9(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Pt.shr64_lo=Z9;var xa={},ig=Pt,eA=Fo;function Yc(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}xa.BlockHash=Yc,Yc.prototype.update=function(r,e){if(r=ig.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){r=this.pending;var t=r.length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=ig.join32(r,0,r.length-t,this.endian);for(var i=0;i<r.length;i+=this._delta32)this._update(r,i,i+this._delta32)}return this},Yc.prototype.digest=function(r){return this.update(this._pad()),eA(this.pending===null),this._digest(r)},Yc.prototype._pad=function(){var r=this.pendingTotal,e=this._delta8,t=e-(r+this.padLength)%e,i=new Array(t+this.padLength);i[0]=128;for(var s=1;s<t;s++)i[s]=0;if(r<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)i[s++]=0;i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=r>>>24&255,i[s++]=r>>>16&255,i[s++]=r>>>8&255,i[s++]=r&255}else for(i[s++]=r&255,i[s++]=r>>>8&255,i[s++]=r>>>16&255,i[s++]=r>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,a=8;a<this.padLength;a++)i[s++]=0;return i};var la={},xn={},tA=Pt,mn=tA.rotr32;function rA(r,e,t,i){if(r===0)return Rb(e,t,i);if(r===1||r===3)return Tb(e,t,i);if(r===2)return Nb(e,t,i)}xn.ft_1=rA;function Rb(r,e,t){return r&e^~r&t}xn.ch32=Rb;function Nb(r,e,t){return r&e^r&t^e&t}xn.maj32=Nb;function Tb(r,e,t){return r^e^t}xn.p32=Tb;function iA(r){return mn(r,2)^mn(r,13)^mn(r,22)}xn.s0_256=iA;function nA(r){return mn(r,6)^mn(r,11)^mn(r,25)}xn.s1_256=nA;function sA(r){return mn(r,7)^mn(r,18)^r>>>3}xn.g0_256=sA;function aA(r){return mn(r,17)^mn(r,19)^r>>>10}xn.g1_256=aA;var wa=Pt,oA=xa,cA=xn,Zh=wa.rotl32,io=wa.sum32,uA=wa.sum32_5,fA=cA.ft_1,qb=oA.BlockHash,hA=[1518500249,1859775393,2400959708,3395469782];function gn(){if(!(this instanceof gn))return new gn;qb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}wa.inherits(gn,qb);var lA=gn;gn.blockSize=512,gn.outSize=160,gn.hmacStrength=80,gn.padLength=64,gn.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;i<t.length;i++)t[i]=Zh(t[i-3]^t[i-8]^t[i-14]^t[i-16],1);var s=this.h[0],a=this.h[1],f=this.h[2],l=this.h[3],p=this.h[4];for(i=0;i<t.length;i++){var u=~~(i/20),b=uA(Zh(s,5),fA(u,a,f,l),p,t[i],hA[u]);p=l,l=f,f=Zh(a,30),a=s,s=b}this.h[0]=io(this.h[0],s),this.h[1]=io(this.h[1],a),this.h[2]=io(this.h[2],f),this.h[3]=io(this.h[3],l),this.h[4]=io(this.h[4],p)},gn.prototype._digest=function(r){return r==="hex"?wa.toHex32(this.h,"big"):wa.split32(this.h,"big")};var _a=Pt,dA=xa,Sa=xn,pA=Fo,Hi=_a.sum32,gA=_a.sum32_4,vA=_a.sum32_5,bA=Sa.ch32,mA=Sa.maj32,yA=Sa.s0_256,wA=Sa.s1_256,_A=Sa.g0_256,AA=Sa.g1_256,Fb=dA.BlockHash,EA=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
23734187,3204031479,3329325298];function vn(){if(!(this instanceof vn))return new vn;Fb.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=EA,this.W=new Array(64)}_a.inherits(vn,Fb);var Bb=vn;vn.blockSize=512,vn.outSize=256,vn.hmacStrength=192,vn.padLength=64,vn.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;i<t.length;i++)t[i]=gA(AA(t[i-2]),t[i-7],_A(t[i-15]),t[i-16]);var s=this.h[0],a=this.h[1],f=this.h[2],l=this.h[3],p=this.h[4],u=this.h[5],b=this.h[6],_=this.h[7];for(pA(this.k.length===t.length),i=0;i<t.length;i++){var M=vA(_,wA(p),bA(p,u,b),this.k[i],t[i]),I=Hi(yA(s),mA(s,a,f));_=b,b=u,u=p,p=Hi(l,M),l=f,f=a,a=s,s=Hi(M,I)}this.h[0]=Hi(this.h[0],s),this.h[1]=Hi(this.h[1],a),this.h[2]=Hi(this.h[2],f),this.h[3]=Hi(this.h[3],l),this.h[4]=Hi(this.h[4],p),this.h[5]=Hi(this.h[5],u),this.h[6]=Hi(this.h[6],b),this.h[7]=Hi(this.h[7],_)},vn.prototype._digest=function(r){return r==="hex"?_a.toHex32(this.h,"big"):_a.split32(this.h,"big")};var Cl=Pt,Lb=Bb;function $n(){if(!(this instanceof $n))return new $n;Lb.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Cl.inherits($n,Lb);var xA=$n;$n.blockSize=512,$n.outSize=224,$n.hmacStrength=192,$n.padLength=64,$n.prototype._digest=function(r){return r==="hex"?Cl.toHex32(this.h.slice(0,7),"big"):Cl.split32(this.h.slice(0,7),"big")};var ii=Pt,SA=xa,MA=Fo,yn=ii.rotr64_hi,wn=ii.rotr64_lo,Ub=ii.shr64_hi,zb=ii.shr64_lo,is=ii.sum64,el=ii.sum64_hi,tl=ii.sum64_lo,IA=ii.sum64_4_hi,DA=ii.sum64_4_lo,PA=ii.sum64_5_hi,CA=ii.sum64_5_lo,jb=SA.BlockHash,OA=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,
231126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Ji(){if(!(this instanceof Ji))return new Ji;jb.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=OA,this.W=new Array(160)}ii.inherits(Ji,jb);var $b=Ji;Ji.blockSize=1024,Ji.outSize=512,Ji.hmacStrength=192,Ji.padLength=128,Ji.prototype._prepareBlock=function(r,e){for(var t=this.W,i=0;i<32;i++)t[i]=r[e+i];for(;i<t.length;i+=2){var s=$A(t[i-4],t[i-3]),a=kA(t[i-4],t[i-3]),f=t[i-14],l=t[i-13],p=zA(t[i-30],t[i-29]),u=jA(t[i-30],t[i-29]),b=t[i-32],_=t[i-31];t[i]=IA(s,a,f,l,p,u,b,_),t[i+1]=DA(s,a,f,l,p,u,b,_)}},Ji.prototype._update=function(r,e){this._prepareBlock(r,e);var t=this.W,i=this.h[0],s=this.h[1],a=this.h[2],f=this.h[3],l=this.h[4],p=this.h[5],u=this.h[6],b=this.h[7],_=this.h[8],M=this.h[9],I=this.h[10],C=this.h[11],R=this.h[12],U=this.h[13],V=this.h[14],F=this.h[15];MA(this.k.length===t.length);for(var K=0;K<t.length;K+=2){var B=V,j=F,q=LA(_,M),E=UA(_,M),L=RA(_,M,I,C,R),te=NA(_,M,I,C,R,U),ae=this.k[K],z=this.k[K+1],w=t[K],c=t[K+1],h=PA(B,j,q,E,L,te,ae,z,w,c),d=CA(B,j,q,E,L,te,ae,z,w,c);B=FA(i,s),j=BA(i,s),q=TA(i,s,a,f,l),E=qA(i,s,a,f,l,p);var y=el(B,j,q,E),A=tl(B,j,q,E);V=R,F=U,R=I,U=C,I=_,C=M,_=el(u,b,h,d),M=tl(b,b,h,d),u=l,b=p,l=a,p=f,a=i,f=s,i=el(h,d,y,A),s=tl(h,d,y,A)}is(this.h,0,i,s),is(this.h,2,a,f),is(this.h,4,l,p),is(this.h,6,u,b),is(this.h,8,_,M),is(this.h,10,I,C),is(this.h,12,R,U),is(this.h,14,V,F)},Ji.prototype._digest=function(r){return r==="hex"?ii.toHex32(this.h,"big"):ii.split32(this.h,"big")};function RA(r,e,t,i,s){var a=r&t^~r&s;return a<0&&(a+=4294967296),a}function NA(r,e,t,i,s,a){var f=e&i^~e&a;return f<0&&(f+=4294967296),f}function TA(r,e,t,i,s){var a=r&t^r&s^t&s;return a<0&&(a+=4294967296),a}function qA(r,e,t,i,s,a){var f=e&i^e&a^i&a;return f<0&&(f+=4294967296),f}function FA(r,e){var t=yn(r,e,28),i=yn(e,r,2),s=yn(e,r,7),a=t^i^s;return a<0&&(a+=4294967296),a}function BA(r,e){var t=wn(r,e,28),i=wn(e,r,2),s=wn(e,r,7),a=t^i^s;return a<0&&(a+=4294967296),a}function LA(r,e){var t=yn(r,e,14),i=yn(r,e,18),s=yn(e,r,9),a=t^i^s;return a<0&&(a+=4294967296),a}function UA(r,e){var t=wn(r,e,14),i=wn(r,e,18),s=wn(e,r,9),a=t^i^s;return a<0&&(a+=4294967296),a}function zA(r,e){var t=yn(r,e,1),i=yn(r,e,8),s=Ub(r,e,7),a=t^i^s;return a<0&&(a+=4294967296),a}function jA(r,e){var t=wn(r,e,1),i=wn(r,e,8),s=zb(r,e,7),a=t^i^s;return a<0&&(a+=4294967296),a}function $A(r,e){var t=yn(r,e,19),i=yn(e,r,29),s=Ub(r,e,6),a=t^i^s;return a<0&&(a+=4294967296),a}function kA(r,e){var t=wn(r,e,19),i=wn(e,r,29),s=zb(r,e,6),a=t^i^s;return a<0&&(a+=4294967296),a}var Ol=Pt,kb=$b;function kn(){if(!(this instanceof kn))return new kn;kb.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Ol.inherits(kn,kb);var HA=kn;kn.blockSize=1024,kn.outSize=384,kn.hmacStrength=192,kn.padLength=128,kn.prototype._digest=function(r){return r==="hex"?Ol.toHex32(this.h.slice(0,12),"big"):Ol.split32(this.h.slice(0,12),"big")},la.sha1=lA,la.sha224=xA,la.sha256=Bb,la.sha384=HA,la.sha512=$b;var Hb={},qs=Pt,KA=xa,Qc=qs.rotl32,ng=qs.sum32,no=qs.sum32_3,sg=qs.sum32_4,Kb=KA.BlockHash;function hn(){if(!(this instanceof hn))return new hn;Kb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}qs.inherits(hn,Kb),Hb.ripemd160=hn,hn.blockSize=512,hn.outSize=160,hn.hmacStrength=192,hn.padLength=64,hn.prototype._update=function(r,e){for(var t=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],f=this.h[4],l=t,p=i,u=s,b=a,_=f,M=0;M<80;M++){var I=ng(Qc(sg(t,ag(M,i,s,a),r[WA[M]+e],VA(M)),YA[M]),f);t=f,f=a,a=Qc(s,10),s=i,i=I,I=ng(Qc(sg(l,ag(79-M,p,u,b),r[JA[M]+e],GA(M)),QA[M]),_),l=_,_=b,b=Qc(u,10),u=p,p=I}I=no(this.h[1],s,b),this.h[1]=no(this.h[2],a,_),this.h[2]=no(this.h[3],f,l),this.h[3]=no(this.h[4],t,p),this.h[4]=no(this.h[0],i,u),this.h[0]=I},hn.prototype._digest=function(r){return r==="hex"?qs.toHex32(this.h,"little"):qs.split32(this.h,"little")};
23function ag(r,e,t,i){return r<=15?e^t^i:r<=31?e&t|~e&i:r<=47?(e|~t)^i:r<=63?e&i|t&~i:e^(t|~i)}function VA(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}function GA(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}var WA=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],JA=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],YA=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],QA=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],XA=Pt,ZA=Fo;function ma(r,e,t){if(!(this instanceof ma))return new ma(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(XA.toArray(e,t))}var eE=ma;ma.prototype._init=function(r){r.length>this.blockSize&&(r=new this.Hash().update(r).digest()),ZA(r.length<=this.blockSize);for(var e=r.length;e<this.blockSize;e++)r.push(0);for(e=0;e<r.length;e++)r[e]^=54;for(this.inner=new this.Hash().update(r),e=0;e<r.length;e++)r[e]^=106;this.outer=new this.Hash().update(r)},ma.prototype.update=function(r,e){return this.inner.update(r,e),this},ma.prototype.digest=function(r){return this.outer.update(this.inner.digest()),this.outer.digest(r)},function(r){var e=r;e.utils=Pt,e.common=xa,e.sha=la,e.ripemd=Hb,e.hmac=eE,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(fn);function Ma(r,e,t){return t={path:e,exports:{},require:function(i,s){return tE(i,s??t.path)}},r(t,t.exports),t.exports}function tE(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var td=Vb;function Vb(r,e){if(!r)throw new Error(e||"Assertion failed")}Vb.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var Yi=Ma(function(r,e){var t=e;function i(f,l){if(Array.isArray(f))return f.slice();if(!f)return[];var p=[];if(typeof f!="string"){for(var u=0;u<f.length;u++)p[u]=f[u]|0;return p}if(l==="hex"){f=f.replace(/[^a-z0-9]+/ig,""),f.length%2!==0&&(f="0"+f);for(var u=0;u<f.length;u+=2)p.push(parseInt(f[u]+f[u+1],16))}else for(var u=0;u<f.length;u++){var b=f.charCodeAt(u),_=b>>8,M=b&255;_?p.push(_,M):p.push(M)}return p}t.toArray=i;function s(f){return f.length===1?"0"+f:f}t.zero2=s;function a(f){for(var l="",p=0;p<f.length;p++)l+=s(f[p].toString(16));return l}t.toHex=a,t.encode=function(f,l){return l==="hex"?a(f):f}}),di=Ma(function(r,e){var t=e;t.assert=td,t.toArray=Yi.toArray,t.zero2=Yi.zero2,t.toHex=Yi.toHex,t.encode=Yi.encode;function i(p,u,b){var _=new Array(Math.max(p.bitLength(),b)+1);_.fill(0);for(var M=1<<u+1,I=p.clone(),C=0;C<_.length;C++){var R,U=I.andln(M-1);I.isOdd()?(U>(M>>1)-1?R=(M>>1)-U:R=U,I.isubn(R)):R=0,_[C]=R,I.iushrn(1)}return _}t.getNAF=i;function s(p,u){var b=[[],[]];p=p.clone(),u=u.clone();for(var _=0,M=0,I;p.cmpn(-_)>0||u.cmpn(-M)>0;){var C=p.andln(3)+_&3,R=u.andln(3)+M&3;C===3&&(C=-1),R===3&&(R=-1);var U;C&1?(I=p.andln(7)+_&7,(I===3||I===5)&&R===2?U=-C:U=C):U=0,b[0].push(U);var V;R&1?(I=u.andln(7)+M&7,(I===3||I===5)&&C===2?V=-R:V=R):V=0,b[1].push(V),2*_===U+1&&(_=1-_),2*M===V+1&&(M=1-M),p.iushrn(1),u.iushrn(1)}return b}t.getJSF=s;function a(p,u,b){var _="_"+u;p.prototype[u]=function(){return this[_]!==void 0?this[_]:this[_]=b.call(this)}}t.cachedProperty=a;function f(p){return typeof p=="string"?t.toArray(p,"hex"):p}t.parseBytes=f;function l(p){return new vt(p,"hex","le")}t.intFromLE=l}),Xc=di.getNAF,rE=di.getJSF,xu=di.assert;function os(r,e){this.type=r,this.p=new vt(e.p,16),this.red=e.prime?vt.red(e.prime):vt.mont(this.p),this.zero=new vt(0).toRed(this.red),this.one=new vt(1).toRed(this.red),this.two=new vt(2).toRed(this.red),this.n=e.n&&new vt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zs=os;os.prototype.point=function(){throw new Error("Not implemented")},os.prototype.validate=function(){throw new Error("Not implemented")},os.prototype._fixedNafMul=function(r,e){xu(r.precomputed);var t=r._getDoubles(),i=Xc(e,1,this._bitLength),s=(1<<t.step+1)-(t.step%2===0?2:1);s/=3;var a=[],f,l;for(f=0;f<i.length;f+=t.step){l=0;for(var p=f+t.step-1;p>=f;p--)l=(l<<1)+i[p];a.push(l)}for(var u=this.jpoint(null,null,null),b=this.jpoint(null,null,null),_=s;_>0;_--){for(f=0;f<a.length;f++)l=a[f],l===_?b=b.mixedAdd(t.points[f]):l===-_&&(b=b.mixedAdd(t.points[f].neg()));u=u.add(b)}return u.toP()},os.prototype._wnafMul=function(r,e){var t=4,i=r._getNAFPoints(t);t=i.wnd;for(var s=i.points,a=Xc(e,t,this._bitLength),f=this.jpoint(null,null,null),l=a.length-1;l>=0;l--){for(var p=0;l>=0&&a[l]===0;l--)p++;if(l>=0&&p++,f=f.dblp(p),l<0)break;var u=a[l];xu(u!==0),r.type==="affine"?u>0?f=f.mixedAdd(s[u-1>>1]):f=f.mixedAdd(s[-u-1>>1].neg()):u>0?f=f.add(s[u-1>>1]):f=f.add(s[-u-1>>1].neg())}return r.type==="affine"?f.toP():f},os.prototype._wnafMulAdd=function(r,e,t,i,s){var a=this._wnafT1,f=this._wnafT2,l=this._wnafT3,p=0,u,b,_;for(u=0;
23u<i;u++){_=e[u];var M=_._getNAFPoints(r);a[u]=M.wnd,f[u]=M.points}for(u=i-1;u>=1;u-=2){var I=u-1,C=u;if(a[I]!==1||a[C]!==1){l[I]=Xc(t[I],a[I],this._bitLength),l[C]=Xc(t[C],a[C],this._bitLength),p=Math.max(l[I].length,p),p=Math.max(l[C].length,p);continue}var R=[e[I],null,null,e[C]];e[I].y.cmp(e[C].y)===0?(R[1]=e[I].add(e[C]),R[2]=e[I].toJ().mixedAdd(e[C].neg())):e[I].y.cmp(e[C].y.redNeg())===0?(R[1]=e[I].toJ().mixedAdd(e[C]),R[2]=e[I].add(e[C].neg())):(R[1]=e[I].toJ().mixedAdd(e[C]),R[2]=e[I].toJ().mixedAdd(e[C].neg()));var U=[-3,-1,-5,-7,0,7,5,1,3],V=rE(t[I],t[C]);for(p=Math.max(V[0].length,p),l[I]=new Array(p),l[C]=new Array(p),b=0;b<p;b++){var F=V[0][b]|0,K=V[1][b]|0;l[I][b]=U[(F+1)*3+(K+1)],l[C][b]=0,f[I]=R}}var B=this.jpoint(null,null,null),j=this._wnafT4;for(u=p;u>=0;u--){for(var q=0;u>=0;){var E=!0;for(b=0;b<i;b++)j[b]=l[b][u]|0,j[b]!==0&&(E=!1);if(!E)break;q++,u--}if(u>=0&&q++,B=B.dblp(q),u<0)break;for(b=0;b<i;b++){var L=j[b];L!==0&&(L>0?_=f[b][L-1>>1]:L<0&&(_=f[b][-L-1>>1].neg()),_.type==="affine"?B=B.mixedAdd(_):B=B.add(_))}}for(u=0;u<i;u++)f[u]=null;return s?B:B.toP()};function Mi(r,e){this.curve=r,this.type=e,this.precomputed=null}os.BasePoint=Mi,Mi.prototype.eq=function(){throw new Error("Not implemented")},Mi.prototype.validate=function(){return this.curve.validate(this)},os.prototype.decodePoint=function(r,e){r=di.toArray(r,e);var t=this.p.byteLength();if((r[0]===4||r[0]===6||r[0]===7)&&r.length-1===2*t){r[0]===6?xu(r[r.length-1]%2===0):r[0]===7&&xu(r[r.length-1]%2===1);var i=this.point(r.slice(1,1+t),r.slice(1+t,1+2*t));return i}else if((r[0]===2||r[0]===3)&&r.length-1===t)return this.pointFromX(r.slice(1,1+t),r[0]===3);throw new Error("Unknown point format")},Mi.prototype.encodeCompressed=function(r){return this.encode(r,!0)},Mi.prototype._encode=function(r){var e=this.curve.p.byteLength(),t=this.getX().toArray("be",e);return r?[this.getY().isEven()?2:3].concat(t):[4].concat(t,this.getY().toArray("be",e))},Mi.prototype.encode=function(r,e){return di.encode(this._encode(e),r)},Mi.prototype.precompute=function(r){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,r),e.beta=this._getBeta(),this.precomputed=e,this},Mi.prototype._hasDoubles=function(r){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((r.bitLength()+1)/e.step):!1},Mi.prototype._getDoubles=function(r,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],i=this,s=0;s<e;s+=r){for(var a=0;a<r;a++)i=i.dbl();t.push(i)}return{step:r,points:t}},Mi.prototype._getNAFPoints=function(r){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],t=(1<<r)-1,i=t===1?null:this.dbl(),s=1;s<t;s++)e[s]=e[s-1].add(i);return{wnd:r,points:e}},Mi.prototype._getBeta=function(){return null},Mi.prototype.dblp=function(r){for(var e=this,t=0;t<r;t++)e=e.dbl();return e};var rd=Ma(function(r){typeof Object.create=="function"?r.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}}),iE=di.assert;function Oi(r){zs.call(this,"short",r),this.a=new vt(r.a,16).toRed(this.red),this.b=new vt(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}rd(Oi,zs);var nE=Oi;Oi.prototype._getEndomorphism=function(r){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,t;if(r.beta)e=new vt(r.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=i[0].cmp(i[1])<0?i[0]:i[1],e=e.toRed(this.red)}if(r.lambda)t=new vt(r.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(e))===0?t=s[0]:(t=s[1],iE(this.g.mul(t).x.cmp(this.g.x.redMul(e))===0))}var a;return r.basis?a=r.basis.map(function(f){return{a:new vt(f.a,16),b:new vt(f.b,16)}}):a=this._getEndoBasis(t),{beta:e,lambda:t,basis:a}}},Oi.prototype._getEndoRoots=function(r){var e=r===this.p?this.red:vt.mont(r),t=new vt(2).toRed(e).redInvm(),i=t.redNeg(),s=new vt(3).toRed(e).redNeg().redSqrt().redMul(t),a=i.redAdd(s).fromRed(),f=i.redSub(s).fromRed();return[a,f]},Oi.prototype._getEndoBasis=function(r){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),t=r,i=this.n.clone(),s=new vt(1),a=new vt(0),f=new vt(0),l=new vt(1),p,u,b,_,M,I,C,R=0,U,V;t.cmpn(0)!==0;){var F=i.div(t);U=i.sub(F.mul(t)),V=f.sub(F.mul(s));var K=l.sub(F.mul(a));if(!b&&U.cmp(e)<0)p=C.neg(),u=s,b=U.neg(),_=V;else if(b&&++R===2)break;C=U,i=t,t=U,f=s,s=V,l=a,a=K}M=U.neg(),I=V;var B=b.sqr().add(_.sqr()),j=M.sqr().add(I.sqr());return j.cmp(B)>=0&&(M=p,I=u),b.negative&&(b=b.neg(),_=_.neg()),M.negative&&(M=M.neg(),I=I.neg()),[{a:b,b:_},{a:M,b:I}]},Oi.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],i=e[1],s=i.b.mul(r).divRound(this.n),a=t.b.neg().mul(r).divRound(this.n),f=s.mul(t.a),l=a.mul(i.a),p=s.mul(t.b),u=a.mul(i.b),b=r.sub(f).sub(l),_=p.add(u).neg();return{k1:b,k2:_}},Oi.prototype.pointFromX=function(r,e){r=new vt(r,16),r.red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),i=t.redSqrt();if(i.redSqr().redSub(t).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(e&&!s||!e&&s)&&(i=i.redNeg()),this.point(r,i)},Oi.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,i=this.a.redMul(e),s=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return t.redSqr().redISub(s).cmpn(0)===0},Oi.prototype._endoWnafMulAdd=function(r,e,t){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<r.length;a++){var f=this._endoSplit(e[a]),l=r[a],p=l._getBeta();f.k1.negative&&(f.k1.ineg(),l=l.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=l,i[a*2+1]=p,s[a*2]=f.k1,s[a*2+1]=f.k2}for(var u=this._wnafMulAdd(1,i,s,a*2,t),b=0;b<a*2;b++)i[b]=null,s[b]=null;return u};function br(r,e,t,i){zs.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new vt(e,16),this.y=new vt(t,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}rd(br,zs.BasePoint),Oi.prototype.point=function(r,e,t){return new br(this,r,e,t)},Oi.prototype.pointFromJSON=function(r,e){return br.fromJSON(this,r,e)},br.prototype._getBeta=function(){if(this.curve.endo){var r=this.prec
23omputed;if(r&&r.beta)return r.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var t=this.curve,i=function(s){return t.point(s.x.redMul(t.endo.beta),s.y)};r.beta=e,e.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e}},br.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},br.fromJSON=function(r,e,t){typeof e=="string"&&(e=JSON.parse(e));var i=r.point(e[0],e[1],t);if(!e[2])return i;function s(f){return r.point(f[0],f[1],t)}var a=e[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i},br.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},br.prototype.isInfinity=function(){return this.inf},br.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var e=this.y.redSub(r.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),i=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,i)},br.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),i=r.redInvm(),s=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),f=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},br.prototype.getX=function(){return this.x.fromRed()},br.prototype.getY=function(){return this.y.fromRed()},br.prototype.mul=function(r){return r=new vt(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},br.prototype.mulAdd=function(r,e,t){var i=[this,e],s=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)},br.prototype.jmulAdd=function(r,e,t){var i=[this,e],s=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)},br.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)},br.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());
23if(r&&this.precomputed){var t=this.precomputed,i=function(s){return s.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e},br.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function Er(r,e,t,i){zs.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt(0)):(this.x=new vt(e,16),this.y=new vt(t,16),this.z=new vt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}rd(Er,zs.BasePoint),Oi.prototype.jpoint=function(r,e,t){return new Er(this,r,e,t)},Er.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),i=this.y.redMul(e).redMul(r);return this.curve.point(t,i)},Er.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Er.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),i=this.x.redMul(e),s=r.x.redMul(t),a=this.y.redMul(e.redMul(r.z)),f=r.y.redMul(t.redMul(this.z)),l=i.redSub(s),p=a.redSub(f);if(l.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),b=u.redMul(l),_=i.redMul(u),M=p.redSqr().redIAdd(b).redISub(_).redISub(_),I=p.redMul(_.redISub(M)).redISub(a.redMul(b)),C=this.z.redMul(r.z).redMul(l);return this.curve.jpoint(M,I,C)},Er.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,i=r.x.redMul(e),s=this.y,a=r.y.redMul(e).redMul(this.z),f=t.redSub(i),l=s.redSub(a);if(f.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),u=p.redMul(f),b=t.redMul(p),_=l.redSqr().redIAdd(u).redISub(b).redISub(b),M=l.redMul(b.redISub(_)).redISub(s.redMul(u)),I=this.z.redMul(f);return this.curve.jpoint(_,M,I)},Er.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var t=this;for(e=0;e<r;e++)t=t.dbl();return t}var i=this.curve.a,s=this.curve.tinv,a=this.x,f=this.y,l=this.z,p=l.redSqr().redSqr(),u=f.redAdd(f);for(e=0;e<r;e++){var b=a.redSqr(),_=u.redSqr(),M=_.redSqr(),I=b.redAdd(b).redIAdd(b).redIAdd(i.redMul(p)),C=a.redMul(_),R=I.redSqr().redISub(C.redAdd(C)),U=C.redISub(R),V=I.redMul(U);V=V.redIAdd(V).redISub(M);var F=u.redMul(l);e+1<r&&(p=p.redMul(M)),a=R,l=F,u=V}return this.curve.jpoint(a,u.redMul(s),l)},Er.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Er.prototype._zeroDbl=function(){var r,e,t;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var l=i.redAdd(i).redIAdd(i),p=l.redSqr().redISub(f).redISub(f),u=a.redIAdd(a);u=u.redIAdd(u),u=u.redIAdd(u),r=p,e=l.redMul(f.redISub(p)).redISub(u),t=this.y.redAdd(this.y)}else{var b=this.x.redSqr(),_=this.y.redSqr(),M=_.redSqr(),I=this.x.redAdd(_).redSqr().redISub(b).redISub(M);I=I.redIAdd(I);var C=b.redAdd(b).redIAdd(b),R=C.redSqr(),U=M.redIAdd(M);U=U.redIAdd(U),U=U.redIAdd(U),r=R.redISub(I).redISub(I),e=C.redMul(I.redISub(r)).redISub(U),t=this.y.redMul(this.z),t=t.redIAdd(t)}return this.curve.jpoint(r,e,t)},Er.prototype._threeDbl=function(){var r,e,t;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),f=this.x.redAdd(s).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var l=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),p=l.redSqr().redISub(f).redISub(f);r=p;var u=a.redIAdd(a);u=u.redIAdd(u),u=u.redIAdd(u),e=l.redMul(f.redISub(p)).redISub(u),t=this.y.redAdd(this.y)}else{var b=this.z.redSqr(),_=this.y.redSqr(),M=this.x.redMul(_),I=this.x.redSub(b).redMul(this.x.redAdd(b));I=I.redAdd(I).redIAdd(I);var C=M.redIAdd(M);C=C.redIAdd(C);var R=C.redAdd(C);r=I.redSqr().redISub(R),t=this.y.redAdd(this.z).redSqr().redISub(_).redISub(b);var U=_.redSqr();U=U.redIAdd(U),U=U.redIAdd(U),U=U.redIAdd(U),e=I.redMul(C.redISub(r)).redISub(U)}return this.curve.jpoint(r,e,t)},Er.prototype._dbl=function(){var r=this.curve.a,e=this.x,t=this.y,i=this.z,s=i.redSqr().redSqr(),a=e.redSqr(),f=t.redSqr(),l=a.redAdd(a).redIAdd(a).redIAdd(r.redMul(s)),p=e.redAdd(e);p=p.redIAdd(p);var u=p.redMul(f),b=l.redSqr().redISub(u.redAdd(u)),_=u.redISub(b),M=f.redSqr();M=M.redIAdd(M),M=M.redIAdd(M),M=M.redIAdd(M);var I=l.redMul(_).redISub(M),C=t.redAdd(t).redMul(i);return this.curve.jpoint(b,I,C)},Er.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),e=this.y.redSqr(),t=this.z.redSqr(),i=e.redSqr(),s=r.redAdd(r).redIAdd(r),a=s.redSqr(),f=this.x.redAdd(e).redSqr().redISub(r).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var l=f.redSqr(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var u=s.redIAdd(f).redSqr().redISub(a).redISub(l).redISub(p),b=e.redMul(u);b=b.redIAdd(b),b=b.redIAdd(b);var _=this.x.redMul(l).redISub(b);_=_.redIAdd(_),_=_.redIAdd(_);var M=this.y.redMul(u.redMul(p.redISub(u)).redISub(f.redMul(l)));M=M.redIAdd(M),M=M.redIAdd(M),M=M.redIAdd(M);var I=this.z.redAdd(f).redSqr().redISub(t).redISub(l);return this.curve.jpoint(_,M,I)},Er.prototype.mul=function(r,e){return r=new vt(r,e),this.curve._wnafMul(this,r)},Er.prototype.eq=function(r){if(r.type==="affine")return this.eq(r.toJ());if(this===r)return!0;var e=this.z.redSqr(),t=r.z.redSqr();if(this.x.redMul(t).redISub(r.x.redMul(e)).cmpn(0)!==0)return!1;var i=e.redMul(this.z),s=t.redMul(r.z);return this.y.redMul(s).redISub(r.y.redMul(i)).cmpn(0)===0},Er.prototype.eqXToP=function(r){var e=this.z.redSqr(),t=r.toRed(this.curve.red).redMul(e);
23if(this.x.cmp(t)===0)return!0;for(var i=r.clone(),s=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(s),this.x.cmp(t)===0)return!0}},Er.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Er.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var fu=Ma(function(r,e){var t=e;t.base=zs,t.short=nE,t.mont=null,t.edwards=null}),hu=Ma(function(r,e){var t=e,i=di.assert;function s(l){l.type==="short"?this.curve=new fu.short(l):l.type==="edwards"?this.curve=new fu.edwards(l):this.curve=new fu.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=s;function a(l,p){Object.defineProperty(t,l,{configurable:!0,enumerable:!0,get:function(){var u=new s(p);return Object.defineProperty(t,l,{configurable:!0,enumerable:!0,value:u}),u}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:fn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:fn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:fn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:fn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:fn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:fn.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:fn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:fn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
23,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function cs(r){if(!(this instanceof cs))return new cs(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Yi.toArray(r.entropy,r.entropyEnc||"hex"),t=Yi.toArray(r.nonce,r.nonceEnc||"hex"),i=Yi.toArray(r.pers,r.persEnc||"hex");td(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var og=cs;cs.prototype._init=function(r,e,t){var i=r.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},cs.prototype._hmac=function(){return new fn.hmac(this.hash,this.K)},cs.prototype._update=function(r){var e=this._hmac().update(this.V).update([0]);r&&(e=e.update(r)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())},cs.prototype.reseed=function(r,e,t,i){typeof e!="string"&&(i=t,t=e,e=null),r=Yi.toArray(r,e),t=Yi.toArray(t,i),td(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(t||[])),this._reseed=1},cs.prototype.generate=function(r,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=t,t=e,e=null),t&&(t=Yi.toArray(t,i||"hex"),this._update(t));for(var s=[];s.length<r;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,r);return this._update(t),this._reseed++,Yi.encode(a,e)};var rl=di.assert;function Tr(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var il=Tr;Tr.fromPublic=function(r,e,t){return e instanceof Tr?e:new Tr(r,{pub:e,pubEnc:t})},Tr.fromPrivate=function(r,e,t){return e instanceof Tr?e:new Tr(r,{priv:e,privEnc:t})},Tr.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Tr.prototype.getPublic=function(r,e){return typeof r=="string"&&(e=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,r):this.pub},Tr.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},Tr.prototype._importPrivate=function(r,e){this.priv=new vt(r,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Tr.prototype._importPublic=function(r,e){if(r.x||r.y){this.ec.curve.type==="mont"?rl(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&rl(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,e)},Tr.prototype.derive=function(r){return r.validate()||rl(r.validate(),"public point not validated"),r.mul(this.priv).getX()},Tr.prototype.sign=function(r,e,t){return this.ec.sign(r,this,e,t)},Tr.prototype.verify=function(r,e){return this.ec.verify(r,e,this)},Tr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var sE=di.assert;function Bu(r,e){if(r instanceof Bu)return r;this._importDER(r,e)||(sE(r.r&&r.s,"Signature without r or s"),this.r=new vt(r.r,16),this.s=new vt(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var Zc=Bu;function aE(){this.place=0}function nl(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4)return!1;for(var s=0,a=0,f=e.place;a<i;a++,f++)s<<=8,s|=r[f],s>>>=0;return s<=127?!1:(e.place=f,s)}function cg(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}Bu.prototype._importDER=function(r,e){r=di.toArray(r,e);var t=new aE;if(r[t.place++]!==48)return!1;var i=nl(r,t);if(i===!1||i+t.place!==r.length||r[t.place++]!==2)return!1;var s=nl(r,t);if(s===!1)return!1;var a=r.slice(t.place,s+t.place);if(t.place+=s,r[t.place++]!==2)return!1;var f=nl(r,t);if(f===!1||r.length!==f+t.place)return!1;var l=r.slice(t.place,f+t.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new vt(a),this.s=new vt(l),this.recoveryParam=null,!0};function sl(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Bu.prototype.toDER=function(r){var e=this.r.toArray(),t=this.s.toArray();
23for(e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t)),e=cg(e),t=cg(t);!t[0]&&!(t[1]&128);)t=t.slice(1);var i=[2];sl(i,e.length),i=i.concat(e),i.push(2),sl(i,t.length);var s=i.concat(t),a=[48];return sl(a,s.length),a=a.concat(s),di.encode(a,r)};var oE=function(){throw new Error("unsupported")},Gb=di.assert;function Pi(r){if(!(this instanceof Pi))return new Pi(r);typeof r=="string"&&(Gb(Object.prototype.hasOwnProperty.call(hu,r),"Unknown curve "+r),r=hu[r]),r instanceof hu.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var cE=Pi;Pi.prototype.keyPair=function(r){return new il(this,r)},Pi.prototype.keyFromPrivate=function(r,e){return il.fromPrivate(this,r,e)},Pi.prototype.keyFromPublic=function(r,e){return il.fromPublic(this,r,e)},Pi.prototype.genKeyPair=function(r){r||(r={});for(var e=new og({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||oE(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),i=this.n.sub(new vt(2));;){var s=new vt(e.generate(t));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},Pi.prototype._truncateToN=function(r,e){var t=r.byteLength()*8-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},Pi.prototype.sign=function(r,e,t,i){typeof t=="object"&&(i=t,t=null),i||(i={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new vt(r,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),f=r.toArray("be",s),l=new og({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new vt(1)),u=0;;u++){var b=i.k?i.k(u):new vt(l.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),!(b.cmpn(1)<=0||b.cmp(p)>=0)){var _=this.g.mul(b);if(!_.isInfinity()){var M=_.getX(),I=M.umod(this.n);if(I.cmpn(0)!==0){var C=b.invm(this.n).mul(I.mul(e.getPrivate()).iadd(r));if(C=C.umod(this.n),C.cmpn(0)!==0){var R=(_.getY().isOdd()?1:0)|(M.cmp(I)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),R^=1),new Zc({r:I,s:C,recoveryParam:R})}}}}}},Pi.prototype.verify=function(r,e,t,i){r=this._truncateToN(new vt(r,16)),t=this.keyFromPublic(t,i),e=new Zc(e,"hex");var s=e.r,a=e.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),l=f.mul(r).umod(this.n),p=f.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,t.getPublic(),p),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(l,t.getPublic(),p),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)},Pi.prototype.recoverPubKey=function(r,e,t,i){Gb((3&t)===t,"The recovery param is more than two bits"),e=new Zc(e,i);var s=this.n,a=new vt(r),f=e.r,l=e.s,p=t&1,u=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?f=this.curve.pointFromX(f.add(this.curve.n),p):f=this.curve.pointFromX(f,p);var b=e.r.invm(s),_=s.sub(a).mul(b).umod(s),M=l.mul(b).umod(s);return this.g.mulAdd(_,f,M)},Pi.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Zc(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var s=0;s<4;s++){var a;try{a=this.recoverPubKey(r,e,s)}catch{continue}if(a.eq(t))return s}throw new Error("Unable to find valid recovery factor")};var uE=Ma(function(r,e){var t=e;t.version="6.5.4",t.utils=di,t.rand=function(){throw new Error("unsupported")},t.curve=fu,t.curves=hu,t.ec=cE,t.eddsa=null}),fE=uE.ec;const hE="signing-key/5.7.0",Rl=new xr(hE);let al=null;function ss(){return al||(al=new fE("secp256k1")),al}class lE{constructor(e){ro(this,"curve","secp256k1"),ro(this,"privateKey",ti(e)),J7(this.privateKey)!==32&&Rl.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=ss().keyFromPrivate(rr(this.privateKey));ro(this,"publicKey","0x"+t.getPublic(!1,"hex")),ro(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ro(this,"_isSigningKey",!0)}_addPoint(e){const t=ss().keyFromPublic(rr(this.publicKey)),i=ss().keyFromPublic(rr(e));return"0x"+t.pub.add(i.pub).encodeCompressed("hex")}
23signDigest(e){const t=ss().keyFromPrivate(rr(this.privateKey)),i=rr(e);i.length!==32&&Rl.throwArgumentError("bad digest length","digest",e);const s=t.sign(i,{canonical:!0});return mb({recoveryParam:s.recoveryParam,r:bn("0x"+s.r.toString(16),32),s:bn("0x"+s.s.toString(16),32)})}computeSharedSecret(e){const t=ss().keyFromPrivate(rr(this.privateKey)),i=ss().keyFromPublic(rr(Wb(e)));return bn("0x"+t.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function dE(r,e){const t=mb(e),i={r:rr(t.r),s:rr(t.s)};return"0x"+ss().recoverPubKey(rr(r),i,t.recoveryParam).encode("hex",!1)}function Wb(r,e){const t=rr(r);return t.length===32?new lE(t).publicKey:t.length===33?"0x"+ss().keyFromPublic(t).getPublic(!1,"hex"):t.length===65?ti(t):Rl.throwArgumentError("invalid public or private key","key","[REDACTED]")}var ug;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(ug||(ug={}));function pE(r){const e=Wb(r);return S9(W1(Xl(W1(e,1)),12))}function gE(r,e){return pE(dE(rr(r),e))}const vE="https://rpc.walletconnect.org/v1";async function bE(r,e,t,i,s,a){switch(t.t){case"eip191":return mE(r,e,t.s);case"eip1271":return await yE(r,e,t.s,i,s,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function mE(r,e,t){return gE(Ib(e),t).toLowerCase()===r.toLowerCase()}async function yE(r,e,t,i,s,a){try{const f="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",p="0000000000000000000000000000000000000000000000000000000000000041",u=t.substring(2),b=Ib(e).substring(2),_=f+b+l+p+u,M=await fetch(`${a||vE}/?chainId=${i}&projectId=${s}`,{method:"POST",body:JSON.stringify({id:wE(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:_},"latest"]})}),{result:I}=await M.json();return I?I.slice(0,f.length).toLowerCase()===f.toLowerCase():!1}catch(f){return console.error("isValidEip1271Signature: ",f),!1}}function wE(){return Date.now()+Math.floor(Math.random()*1e3)}var _E=Object.defineProperty,AE=Object.defineProperties,EE=Object.getOwnPropertyDescriptors,fg=Object.getOwnPropertySymbols,xE=Object.prototype.hasOwnProperty,SE=Object.prototype.propertyIsEnumerable,hg=(r,e,t)=>e in r?_E(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ME=(r,e)=>{for(var t in e||(e={}))xE.call(e,t)&&hg(r,t,e[t]);if(fg)for(var t of fg(e))SE.call(e,t)&&hg(r,t,e[t]);return r},IE=(r,e)=>AE(r,EE(e));const DE="did:pkh:",id=r=>r==null?void 0:r.split(":"),Jb=r=>{const e=r&&id(r);if(e)return r.includes(DE)?e[3]:e[1]},lg=r=>{const e=r&&id(r);if(e)return e[2]+":"+e[3]},Su=r=>{const e=r&&id(r);if(e)return e.pop()};async function dg(r){const{cacao:e,projectId:t}=r,{s:i,p:s}=e,a=Yb(s,s.iss),f=Su(s.iss);return await bE(f,a,i,Jb(s.iss),t)}const Yb=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=Su(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=r.statement||void 0;const a=`URI: ${r.aud||r.uri}`,f=`Version: ${r.version}`,l=`Chain ID: ${Jb(e)}`,p=`Nonce: ${r.nonce}`,u=`Issued At: ${r.iat}`,b=r.exp?`Expiration Time: ${r.exp}`:void 0,_=r.nbf?`Not Before: ${r.nbf}`:void 0,M=r.requestId?`Request ID: ${r.requestId}`:void 0,I=r.resources?`Resources:${r.resources.map(R=>` 24- ${R}`).join("")}`:void 0,C=lu(r.resources);if(C){const R=Mo(C);s=BE(s,R)}return[t,i,"",s,"",a,f,l,p,u,b,_,M,I].filter(R=>R!=null).join(` 25`)};function PE(r){return Buffer.from(JSON.stringify(r)).toString("base64")}function CE(r){return JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}function Bs(r){if(!r)throw new Error("No recap provided, value is undefined");if(!r.att)throw new Error("No `att` property found");const e=Object.keys(r.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const i=r.att[t];if(Array.isArray(i))throw new Error(`Resource must be an object: ${t}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${t}`);
25Object.keys(i).forEach(s=>{const a=i[s];if(!Array.isArray(a))throw new Error(`Ability limits ${s} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${s} is empty array, must be an array with objects`);a.forEach(f=>{if(typeof f!="object")throw new Error(`Ability limits (${s}) must be an array of objects, found: ${f}`)})})})}function OE(r,e,t,i={}){return t==null||t.sort((s,a)=>s.localeCompare(a)),{att:{[r]:RE(e,t,i)}}}function RE(r,e,t={}){e=e==null?void 0:e.sort((s,a)=>s.localeCompare(a));const i=e.map(s=>({[`${r}/${s}`]:[t]}));return Object.assign({},...i)}function Qb(r){return Bs(r),`urn:recap:${PE(r).replace(/=/g,"")}`}function Mo(r){const e=CE(r.replace("urn:recap:",""));return Bs(e),e}function NE(r,e,t){const i=OE(r,e,t);return Qb(i)}function TE(r){return r&&r.includes("urn:recap:")}function qE(r,e){const t=Mo(r),i=Mo(e),s=FE(t,i);return Qb(s)}function FE(r,e){Bs(r),Bs(e);const t=Object.keys(r.att).concat(Object.keys(e.att)).sort((s,a)=>s.localeCompare(a)),i={att:{}};return t.forEach(s=>{var a,f;Object.keys(((a=r.att)==null?void 0:a[s])||{}).concat(Object.keys(((f=e.att)==null?void 0:f[s])||{})).sort((l,p)=>l.localeCompare(p)).forEach(l=>{var p,u;i.att[s]=IE(ME({},i.att[s]),{[l]:((p=r.att[s])==null?void 0:p[l])||((u=e.att[s])==null?void 0:u[l])})})}),i}function BE(r="",e){Bs(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(r.includes(t))return r;const i=[];let s=0;Object.keys(e.att).forEach(l=>{const p=Object.keys(e.att[l]).map(_=>({ability:_.split("/")[0],action:_.split("/")[1]}));p.sort((_,M)=>_.action.localeCompare(M.action));const u={};p.forEach(_=>{u[_.ability]||(u[_.ability]=[]),u[_.ability].push(_.action)});const b=Object.keys(u).map(_=>(s++,`(${s}) '${_}': '${u[_].join("', '")}' for '${l}'.`));i.push(b.join(", ").replace(".,","."))});const a=i.join(" "),f=`${t}${a}`;return`${r?r+" ":""}${f}`}function pg(r){var e;const t=Mo(r);Bs(t);const i=(e=t.att)==null?void 0:e.eip155;return i?Object.keys(i).map(s=>s.split("/")[1]):[]}function gg(r){const e=Mo(r);Bs(e);const t=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(s=>{var a;(a=s==null?void 0:s[0])!=null&&a.chains&&t.push(s[0].chains)})}),[...new Set(t.flat())]}function lu(r){if(!r)return;const e=r==null?void 0:r[r.length-1];return TE(e)?e:void 0}const Xb="base10",$r="base16",us="base64pad",so="base64url",Bo="utf8",Zb=0,Hn=1,Lo=2,LE=0,vg=1,_o=12,nd=32;function UE(){const r=Wv.generateKeyPair();return{privateKey:_r(r.secretKey,$r),publicKey:_r(r.publicKey,$r)}}function Nl(){const r=Ro.randomBytes(nd);return _r(r,$r)}function zE(r,e){const t=Wv.sharedKey(wr(r,$r),wr(e,$r),!0),i=new M4.HKDF(Nu.SHA256,t).expand(nd);return _r(i,$r)}function du(r){const e=Nu.hash(wr(r,$r));return _r(e,$r)}function jn(r){const e=Nu.hash(wr(r,Bo));return _r(e,$r)}function e2(r){return wr(`${r}`,Xb)}function Ls(r){return Number(_r(r,Xb))}function jE(r){const e=e2(typeof r.type<"u"?r.type:Zb);if(Ls(e)===Hn&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?wr(r.senderPublicKey,$r):void 0,i=typeof r.iv<"u"?wr(r.iv,$r):Ro.randomBytes(_o),s=new Gv.ChaCha20Poly1305(wr(r.symKey,$r)).seal(i,wr(r.message,Bo));return t2({type:e,sealed:s,iv:i,senderPublicKey:t,encoding:r.encoding})}function $E(r,e){const t=e2(Lo),i=Ro.randomBytes(_o),s=wr(r,Bo);return t2({type:t,sealed:s,iv:i,encoding:e})}function kE(r){const e=new Gv.ChaCha20Poly1305(wr(r.symKey,$r)),{sealed:t,iv:i}=Io({encoded:r.encoded,encoding:r==null?void 0:r.encoding}),s=e.open(i,t);if(s===null)throw new Error("Failed to decrypt");return _r(s,Bo)}function HE(r,e){const{sealed:t}=Io({encoded:r,encoding:e});return _r(t,Bo)}function t2(r){const{encoding:e=us}=r;if(Ls(r.type)===Lo)return _r(au([r.type,r.sealed]),e);if(Ls(r.type)===Hn){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return _r(au([r.type,r.senderPublicKey,r.iv,r.sealed]),e)}return _r(au([r.type,r.iv,r.sealed]),e)}function Io(r){const{encoded:e,encoding:t=us}=r,i=wr(e,t),s=i.slice(LE,vg),a=vg;if(Ls(s)===Hn){const u=a+nd,b=u+_o,_=i.slice(a,u),M=i.slice(u,b),I=i.slice(b);return{type:s,sealed:I,iv:M,senderPublicKey:_}}if(Ls(s)===Lo){const u=i.slice(a),b=Ro.randomBytes(_o);return{type:s,sealed:u,iv:b}}const f=a+_o,l=i.slice(a,f),p=i.slice(f);return{type:s,sealed:p,iv:l}}function KE(r,e){const t=Io({encoded:r,encoding:e==null?void 0:e.encoding});return r2({type:Ls(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?_r(t.senderPublicKey,$r):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function r2(r){const e=(r==null?void 0:r.type)||Zb;if(e===Hn){if(typeof(r==null?void 0:r.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(r==null?void 0:r.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r==null?void 0:r.senderPublicKey,receiverPublicKey:r==null?void 0:r.receiverPublicKey}}
25function bg(r){return r.type===Hn&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}function mg(r){return r.type===Lo}function VE(r){return new i7.ec("p256").keyFromPublic({x:Buffer.from(r.x,"base64").toString("hex"),y:Buffer.from(r.y,"base64").toString("hex")},"hex")}function GE(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");const t=e.length%4;return t>0&&(e+="=".repeat(4-t)),e}function WE(r){return Buffer.from(GE(r),"base64")}function JE(r,e){const[t,i,s]=r.split("."),a=WE(s);if(a.length!==64)throw new Error("Invalid signature length");const f=a.slice(0,32).toString("hex"),l=a.slice(32,64).toString("hex"),p=`${t}.${i}`,u=new Nu.SHA256().update(Buffer.from(p)).digest(),b=VE(e),_=Buffer.from(u).toString("hex");if(!b.verify(_,{r:f,s:l}))throw new Error("Invalid signature");return Ml(r).payload}const YE="irn";function Tl(r){return(r==null?void 0:r.relay)||{protocol:YE}}function po(r){const e=_7[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var QE=Object.defineProperty,XE=Object.defineProperties,ZE=Object.getOwnPropertyDescriptors,yg=Object.getOwnPropertySymbols,ex=Object.prototype.hasOwnProperty,tx=Object.prototype.propertyIsEnumerable,wg=(r,e,t)=>e in r?QE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_g=(r,e)=>{for(var t in e||(e={}))ex.call(e,t)&&wg(r,t,e[t]);if(yg)for(var t of yg(e))tx.call(e,t)&&wg(r,t,e[t]);return r},rx=(r,e)=>XE(r,ZE(e));function ix(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(s=>{if(s.startsWith(i)){const a=s.replace(i,""),f=r[s];t[a]=f}}),t}function Ag(r){if(!r.includes("wc:")){const p=pb(r);p!=null&&p.includes("wc:")&&(r=p)}r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),s=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",f=bu.parse(a),l=typeof f.methods=="str
25ing"?f.methods.split(","):void 0;return{protocol:i,topic:nx(s[0]),version:parseInt(s[1],10),symKey:f.symKey,relay:ix(f),methods:l,expiryTimestamp:f.expiryTimestamp?parseInt(f.expiryTimestamp,10):void 0}}function nx(r){return r.startsWith("//")?r.substring(2):r}function sx(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(s=>{const a=t+e+s;r[s]&&(i[a]=r[s])}),i}function Eg(r){return`${r.protocol}:${r.topic}@${r.version}?`+bu.stringify(_g(rx(_g({symKey:r.symKey},sx(r.relay)),{expiryTimestamp:r.expiryTimestamp}),r.methods?{methods:r.methods.join(",")}:{}))}function eu(r,e,t){return`${r}?wc_ev=${t}&topic=${e}`}function Ia(r){const e=[];return r.forEach(t=>{const[i,s]=t.split(":");e.push(`${i}:${s}`)}),e}function ax(r){const e=[];return Object.values(r).forEach(t=>{e.push(...Ia(t.accounts))}),e}function ox(r,e){const t=[];return Object.values(r).forEach(i=>{Ia(i.accounts).includes(e)&&t.push(...i.methods)}),t}function cx(r,e){const t=[];return Object.values(r).forEach(i=>{Ia(i.accounts).includes(e)&&t.push(...i.events)}),t}function sd(r){return r.includes(":")}function go(r){return sd(r)?r.split(":")[0]:r}function ux(r){const e={};return r==null||r.forEach(t=>{const[i,s]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(t),e[i].chains.push(`${i}:${s}`)}),e}function xg(r,e){e=e.map(i=>i.replace("did:pkh:",""));const t=ux(e);for(const[i,s]of Object.entries(t))s.methods?s.methods=cu(s.methods,r):s.methods=r,s.events=["chainChanged","accountsChanged"];return t}const fx={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},hx={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ae(r,e){const{message:t,code:i}=hx[r];return{message:e?`${t} ${e}`:t,code:i}}function Lt(r,e){const{message:t,code:i}=fx[r];return{message:e?`${t} ${e}`:t,code:i}}function _n(r,e){return!!Array.isArray(r)}function Do(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function ri(r){return typeof r>"u"}function or(r,e){return e&&ri(r)?!0:typeof r=="string"&&!!r.trim().length}function ad(r,e){return typeof r=="number"&&!isNaN(r)}function lx(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),s=Object.keys(t);let a=!0;return Ns(s,i)?(i.forEach(f=>{const{accounts:l,methods:p,events:u}=r.namespaces[f],b=Ia(l),_=t[f];(!Ns(ob(f,_),b)||!Ns(_.methods,p)||!Ns(_.events,u))&&(a=!1)}),a):!1}function Mu(r){return or(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function dx(r){if(or(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&Mu(t)}}return!1}function px(r){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(or(r,!1)){if(e(r))return!0;const t=pb(r);return e(t)}}catch{}return!1}function gx(r){var e;return(e=r==null?void 0:r.proposer)==null?void 0:e.publicKey}function vx(r){return r==null?void 0:r.topic}function bx(r,e){let t=null;return or(r==null?void 0:r.publicKey,!1)||(t=Ae("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function Sg(r){let e=!0;return _n(r)?r.length&&(e=r.every(t=>or(t,!1))):e=!1,e}function mx(r,e,t){let i=null;return _n(e)&&e.length?e.forEach(s=>{i||Mu(s)||(i=Lt("UNSUPPORTED_CHAINS",`${t}, chain ${s} should be a string and conform to "namespace:chainId" format`))}):Mu(r)||(i=Lt("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:
255"] }`)),i}function yx(r,e,t){let i=null;return Object.entries(r).forEach(([s,a])=>{if(i)return;const f=mx(s,ob(s,a),`${e} ${t}`);f&&(i=f)}),i}function wx(r,e){let t=null;return _n(r)?r.forEach(i=>{t||dx(i)||(t=Lt("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=Lt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function _x(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const s=wx(i==null?void 0:i.accounts,`${e} namespace`);s&&(t=s)}),t}function Ax(r,e){let t=null;return Sg(r==null?void 0:r.methods)?Sg(r==null?void 0:r.events)||(t=Lt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=Lt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function i2(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const s=Ax(i,`${e}, namespace`);s&&(t=s)}),t}function Ex(r,e,t){let i=null;if(r&&Do(r)){const s=i2(r,e);s&&(i=s);const a=yx(r,e,t);a&&(i=a)}else i=Ae("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function ol(r,e){let t=null;if(r&&Do(r)){const i=i2(r,e);i&&(t=i);const s=_x(r,e);s&&(t=s)}else t=Ae("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function n2(r){return or(r.protocol,!0)}function xx(r,e){let t=!1;return r?r&&_n(r)&&r.length&&r.forEach(i=>{t=n2(i)}):t=!0,t}function Sx(r){return typeof r=="number"}function ei(r){return typeof r<"u"&&typeof r!==null}function Mx(r){return!(!r||typeof r!="object"||!r.code||!ad(r.code)||!r.message||!or(r.message,!1))}function Ix(r){return!(ri(r)||!or(r.method,!1))}function Dx(r){return!(ri(r)||ri(r.result)&&ri(r.error)||!ad(r.id)||!or(r.jsonrpc,!1))}function Px(r){return!(ri(r)||!or(r.name,!1))}function Mg(r,e){return!(!Mu(e)||!ax(r).includes(e))}function Cx(r,e,t){return or(t,!1)?ox(r,e).includes(t):!1}function Ox(r,e,t){return or(t,!1)?cx(r,e).includes(t):!1}function Ig(r,e,t){let i=null;const s=Rx(r),a=Nx(e),f=Object.keys(s),l=Object.keys(a),p=Dg(Object.keys(r)),u=Dg(Object.keys(e)),b=p.filter(_=>!u.includes(_));return b.length&&(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. 26 Required: ${b.toString()} 27 Received: ${Object.keys(e).toString()}`)),Ns(f,l)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. 28 Required: ${f.toString()} 29 Approved: ${l.toString()}`)),Object.keys(e).forEach(_=>{if(!_.includes(":")||i)return;const M=Ia(e[_].accounts);M.includes(_)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${_} 30 Required: ${_} 31 Approved: ${M.toString()}`))}),f.forEach(_=>{i||(Ns(s[_].methods,a[_].methods)?Ns(s[_].events,a[_].events)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${_}`)):i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${_}`))}),i}function Rx(r){const e={};return Object.keys(r).forEach(t=>{var i;t.includes(":")?e[t]=r[t]:(i=r[t].chains)==null||i.forEach(s=>{e[s]={methods:r[t].methods,events:r[t].events}})}),e}function Dg(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function Nx(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const i=Ia(r[t].accounts);i==null||i.forEach(s=>{e[s]={accounts:r[t].accounts.filter(a=>a.includes(`${s}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function Tx(r,e){return ad(r)&&r<=e.max&&r>=e.min}function Pg(){const r=qo();return new Promise(e=>{switch(r){case hi.browser:e(qx());break;case hi.reactNative:e(Fx());break;case hi.node:e(Bx());break;default:e(!0)}})}function qx(){return To()&&(navigator==null?void 0:navigator.onLine)}async function Fx(){if(Aa()&&typeof global<"u"&&global!=null&&global.NetInfo){const r=await(global==null?void 0:global.NetInfo.fetch());return r==null?void 0:r.isConnected}return!0}function Bx(){return!0}function Lx(r){switch(qo()){case hi.browser:Ux(r);break;case hi.reactNative:zx(r);break}}function Ux(r){!Aa()&&To()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function zx(r){Aa()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>r(e==null?void 0:e.isConnected)))}const cl={};class ao{static get(e){return cl[e]}static set(e,t){cl[e]=t}static delete(e){delete cl[e]}}class js{}let jx=class extends js{constructor(e){super()}};const Cg=Me.FIVE_SECONDS,Da={pulse:"heartbeat_pulse"};let $x=class s2 extends jx{constructor(e){super(e),this.events=new pi.EventEmitter,this.interval=Cg,this.interval=(e==null?void 0:e.interval)||Cg}static async init(e){const t=new s2(e);return await t.init(),t}
31async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Me.toMiliseconds(this.interval))}pulse(){this.events.emit(Da.pulse)}};const kx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Hx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Kx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Vx(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Gx(r);return}return e}function Gx(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function tu(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.endsWith('"')&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const i=t.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!Kx.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(kx.test(r)||Hx.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,Vx)}return JSON.parse(r)}catch(i){if(e.strict)throw i;return r}}function Wx(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function yr(r,...e){try{return Wx(r(...e))}catch(t){return Promise.reject(t)}}function Jx(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function Yx(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function pu(r){if(Jx(r))return String(r);if(Yx(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return pu(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function a2(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const ql="base64:";function Qx(r){if(typeof r=="string")return r;a2();const e=Buffer.from(r).toString("base64");return ql+e}function Xx(r){return typeof r!="string"||!r.startsWith(ql)?r:(a2(),Buffer.from(r.slice(ql.length),"base64"))}function Zr(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Zx(...r){return Zr(r.join(":"))}function ru(r){return r=Zr(r),r?r+":":""}const eS="memory",tS=()=>{const r=new Map;return{name:eS,getInstance:()=>r,hasItem(e){return r.has(e)},getItem(e){return r.get(e)??null},getItemRaw(e){return r.get(e)??null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return[...r.keys()]},clear(){r.clear()},dispose(){r.clear()}}};function rS(r={}){const e={mounts:{"":r.driver||tS()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=u=>{for(const b of e.mountpoints)if(u.startsWith(b))return{base:b,relativeKey:u.slice(b.length),driver:e.mounts[b]};return{base:"",relativeKey:u,driver:e.mounts[""]}},i=(u,b)=>e.mountpoints.filter(_=>_.startsWith(u)||b&&u.startsWith(_)).map(_=>({relativeBase:u.length>_.length?u.slice(_.length):void 0,mountpoint:_,driver:e.mounts[_]})),s=(u,b)=>{if(e.watching){b=Zr(b);for(const _ of e.watchListeners)_(u,b)}},a=async()=>{if(!e.watching){e.watching=!0;for(const u in e.mounts)e.unwatch[u]=await Og(e.mounts[u],s,u)}},f=async()=>{if(e.watching){for(const u in e.unwatch)await e.unwatch[u]();e.unwatch={},e.watching=!1}},l=(u,b,_)=>{const M=new Map,I=C=>{let R=M.get(C.base);return R||(R={driver:C.driver,base:C.base,items:[]},M.set(C.base,R)),R};for(const C of u){const R=typeof C=="string",U=Zr(R?C:C.key),V=R?void 0:C.value,F=R||!C.options?b
vendor: 10,952 bytes, line 31
31:{...b,...C.options},K=t(U);I(K).items.push({key:U,value:V,relativeKey:K.relativeKey,options:F})}return Promise.all([...M.values()].map(C=>_(C))).then(C=>C.flat())},p={hasItem(u,b={}){u=Zr(u);const{relativeKey:_,driver:M}=t(u);return yr(M.hasItem,_,b)},getItem(u,b={}){u=Zr(u);const{relativeKey:_,driver:M}=t(u);return yr(M.getItem,_,b).then(I=>tu(I))},getItems(u,b){return l(u,b,_=>_.driver.getItems?yr(_.driver.getItems,_.items.map(M=>({key:M.relativeKey,options:M.options})),b).then(M=>M.map(I=>({key:Zx(_.base,I.key),value:tu(I.value)}))):Promise.all(_.items.map(M=>yr(_.driver.getItem,M.relativeKey,M.options).then(I=>({key:M.key,value:tu(I)})))))},getItemRaw(u,b={}){u=Zr(u);const{relativeKey:_,driver:M}=t(u);return M.getItemRaw?yr(M.getItemRaw,_,b):yr(M.getItem,_,b).then(I=>Xx(I))},async setItem(u,b,_={}){if(b===void 0)return p.removeItem(u);u=Zr(u);const{relativeKey:M,driver:I}=t(u);I.setItem&&(await yr(I.setItem,M,pu(b),_),I.watch||s("update",u))},async setItems(u,b){await l(u,b,async _=>{if(_.driver.setItems)return yr(_.driver.setItems,_.items.map(M=>({key:M.relativeKey,value:pu(M.value),options:M.options})),b);_.driver.setItem&&await Promise.all(_.items.map(M=>yr(_.driver.setItem,M.relativeKey,pu(M.value),M.options)))})},async setItemRaw(u,b,_={}){if(b===void 0)return p.removeItem(u,_);u=Zr(u);const{relativeKey:M,driver:I}=t(u);if(I.setItemRaw)await yr(I.setItemRaw,M,b,_);else if(I.setItem)await yr(I.setItem,M,Qx(b),_);else return;I.watch||s("update",u)},async removeItem(u,b={}){typeof b=="boolean"&&(b={removeMeta:b}),u=Zr(u);const{relativeKey:_,driver:M}=t(u);M.removeItem&&(await yr(M.removeItem,_,b),(b.removeMeta||b.removeMata)&&await yr(M.removeItem,_+"$",b),M.watch||s("remove",u))},async getMeta(u,b={}){typeof b=="boolean"&&(b={nativeOnly:b}),u=Zr(u);const{relativeKey:_,driver:M}=t(u),I=Object.create(null);if(M.getMeta&&Object.assign(I,await yr(M.getMeta,_,b)),!b.nativeOnly){const C=await yr(M.getItem,_+"$",b).then(R=>tu(R));C&&typeof C=="object"&&(typeof C.atime=="string"&&(C.atime=new Date(C.atime)),typeof C.mtime=="string"&&(C.mtime=new Date(C.mtime)),Object.assign(I,C))}return I},setMeta(u,b,_={}){return this.setItem(u+"$",b,_)},removeMeta(u,b={}){return this.removeItem(u+"$",b)},async getKeys(u,b={}){u=ru(u);const _=i(u,!0);let M=[];const I=[];for(const C of _){const R=await yr(C.driver.getKeys,C.relativeBase,b);for(const U of R){const V=C.mountpoint+Zr(U);M.some(F=>V.startsWith(F))||I.push(V)}M=[C.mountpoint,...M.filter(U=>!U.startsWith(C.mountpoint))]}return u?I.filter(C=>C.startsWith(u)&&C[C.length-1]!=="$"):I.filter(C=>C[C.length-1]!=="$")},async clear(u,b={}){u=ru(u),await Promise.all(i(u,!1).map(async _=>{if(_.driver.clear)return yr(_.driver.clear,_.relativeBase,b);if(_.driver.removeItem){const M=await _.driver.getKeys(_.relativeBase||"",b);return Promise.all(M.map(I=>_.driver.removeItem(I,b)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(u=>Rg(u)))},async watch(u){return await a(),e.watchListeners.push(u),async()=>{e.watchListeners=e.watchListeners.filter(b=>b!==u),e.watchListeners.length===0&&await f()}},async unwatch(){e.watchListeners=[],await f()},mount(u,b){if(u=ru(u),u&&e.mounts[u])throw new Error(`already mounted at ${u}`);return u&&(e.mountpoints.push(u),e.mountpoints.sort((_,M)=>M.length-_.length)),e.mounts[u]=b,e.watching&&Promise.resolve(Og(b,s,u)).then(_=>{e.unwatch[u]=_}).catch(console.error),p},async unmount(u,b=!0){u=ru(u),!(!u||!e.mounts[u])&&(e.watching&&u in e.unwatch&&(e.unwatch[u](),delete e.unwatch[u]),b&&await Rg(e.mounts[u]),e.mountpoints=e.mountpoints.filter(_=>_!==u),delete e.mounts[u])},getMount(u=""){u=Zr(u)+":";const b=t(u);return{driver:b.driver,base:b.base}},getMounts(u="",b={}){return u=Zr(u),i(u,b.parents).map(M=>({driver:M.driver,base:M.mountpoint}))},keys:(u,b={})=>p.getKeys(u,b),get:(u,b={})=>p.getItem(u,b),set:(u,b,_={})=>p.setItem(u,b,_),has:(u,b={})=>p.hasItem(u,b),del:(u,b={})=>p.removeItem(u,b),remove:(u,b={})=>p.removeItem(u,b)};return p}function Og(r,e,t){return r.watch?r.watch((i,s)=>e(i,t+s)):()=>{}}async function Rg(r){typeof r.dispose=="function"&&await yr(r.dispose)}function $s(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function o2(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const i=$s(t);return(s,a)=>i.then(f=>a(f.transaction(e,s).objectStore(e)))}let ul;function Uo(){return ul||(ul=o2("keyval-store","keyval")),ul}function Ng(r,e=Uo()){return e("readonly",t=>$s(t.get(r)))}function iS(r,e,t=Uo()){return t("readwrite",i=>(i.put(e,r),$s(i.transaction)))}function nS(r,e=Uo()){return e("readwrite",t=>(t.delete(r),$s(t.transaction)))}function sS(r=Uo()){return r("readwrite",e=>(e.clear(),$s(e.transaction)))}function aS(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},$s(r.transaction)}function oS(r=Uo()){return r("readonly",e=>{if(e.getAllKeys)return $s(e.getAllKeys());const t=[];return aS(e,i=>t.push(i.key)).then(()=>t)})}const cS="idb-keyval";var uS=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=s=>e+s;let i;return r.dbName&&r.storeName&&(i=o2(r.dbName,r.storeName)),{name:cS,options:r,async hasItem(s){return!(typeof await Ng(t(s),i)>"u")},async getItem(s){return await Ng(t(s),i)??null},setItem(s,a){return iS(t(s),a,i)},removeItem(s){return nS(t(s),i)},getKeys(){return oS(i)},clear(){return sS(i)}}};const fS="WALLET_CONNECT_V2_INDEXED_DB",hS="keyvaluestorage";let lS=class{constructor(){this.indexedDb=rS({driver:uS({dbName:fS,storeName:hS})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,Kn(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},gu={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof fl<"u"&&fl.localStorage?gu.exports=fl.localStorage:typeof window<"u"&&window.localStorage?gu.exports=window.localStorage:gu.exports=new e})();function dS(r){var e;return[r[0],Fs((e=r[1])!=null?e:"")]}class pS{constructor(){this.localStorage=gu.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(dS)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return Fs(t)}async setItem(e,t){this.localStorage.setItem(e,Kn(t))}async removeItem(e){this.localStorage.removeItem(e)}}const gS="wc_storage_version",Tg=1,vS=async(r,e,t)=>{const i=gS,s=await e.getItem(i);if(s&&s>=Tg){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const f=[];for(;a.length;){const l=a.shift();if(!l)continue;const p=l.toLowerCase();if(p.includes("wc@")||p.includes("walletconnect")||p.includes("wc_")||p.includes("wallet_connect")){const u=await r.getItem(l);await e.setItem(l,u),f.push(l)}}await e.setItem(i,Tg),t(e),bS(r,f)},bS=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};let mS=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new pS;this.storage=e;try{const t=new lS;vS(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};var hl,qg;function yS(){if(qg)return hl;qg=1;function r(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}hl=e;function e(t,i,s){var a=s&&s.stringify||r,f=1;if(typeof t=="object"&&t!==null){var l=i.length+f;if(l===1)return t;var p=new Array(l);p[0]=a(t);for(var u=1;u<l;u++)p[u]=a(i[u]);return p.join(" ")}if(typeof t!="string")return t;var b=i.length;if(b===0)return t;for(var _="",M=1-f,I=-1,C=t&&t.length||0,R=0;R<C;){if(t.charCodeAt(R)===37&&R+1<C){switch(I=I>-1?I:0,t.charCodeAt(R+1)){case 100:case 102:if(M>=b||i[M]==null)break;I<R&&(_+=t.slice(I,R)),_+=Number(i[M]),I=R+2,R++;break;case 105:if(M>=b||i[M]==null)break;I<R&&(_+=t.slice(I,R)),_+=Math.floor(Number(i[M])),I=R+2,R++;break;case 79:case 111:case 106:if(M>=b||i[M]===void 0)break;I<R&&(_+=t.slice(I,R));var U=typeof i[M];if(U==="string"){_+="'"+i[M]+"'",I=R+2,R++;break}if(U==="function"){_+=i[M].name||"<anonymous>",I=R+2,R++;break}_+=a(i[M]),I=R+2,R++;break;case 115:if(M>=b)break;I<R&&(_+=t.slice(I,R)),_+=String(i[M]),I=R+2,R++;break;case 37:I<R&&(_+=t.slice(I,R)),_+="%",I=R+2,R++,M--;break}++M}++R}return I===-1?t:(I<C&&(_+=t.slice(I)),_)}return hl}var ll,Fg;function wS(){if(Fg)return ll;Fg=1;const r=yS();ll=s;const e=j().console||{},t={mapHttpRequest:C,mapHttpResponse:C,wrapRequestSerializer:R,wrapResponseSerializer:R,wrapErrorSerializer:R,req:C,res:C,err:M};function i(q,E){return Array.isArray(q)?q.filter(function(te){return te!=="!stdSerializers.err"}):q===!0?Object.keys(E):!1}function s(q){q=q||{},q.browser=q.browser||{};const E=q.browser.transmit;if(E&&typeof E.send!="function")throw Error("pino: transmit option must have a send function");const L=q.browser.write||e;q.browser.write&&(q.browser.asObject=!0);const te=q.serializers||{},ae=i(q.browser.serialize,te);let z=q.browser.serialize;Array.isArray(q.browser.serialize)&&q.browser.serialize.indexOf("!stdSerializers.err")>-1&&(z=!1);const w=["error","fatal","warn","info","debug","trace"];typeof L=="function"&&(L.error=L.fatal=L.warn=L.info=L.debug=L.trace=L),q.enabled===!1&&(q.level="silent");const c=q.level||"info",h=Object.create(L);h.log||(h.log=U),Object.defineProperty(h,"levelVal",{get:y}),Object.defineProperty(h,"level",{get:A,set:D});const d={transmit:E,serialize:ae,asObject:q.browser.asObject,levels:w,timestamp:I(q)};h.levels=s.levels,h.level=c,h.setMaxListeners=h.getMaxListeners=h.emit=h.addListener=h.on=h.prependListener=h.once=h.prependOnceListener=h.removeListener=h.removeAllListeners=h.listeners=h.listenerCount=h.eventNames=h.write=h.flush=U,h.serializers=te,h._serialize=ae,h._stdErrSerialize=z,h.child=x,E&&(h._logEvent=_());
31function y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function A(){return this._level}function D(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,a(d,h,"error","log"),a(d,h,"fatal","error"),a(d,h,"warn","error"),a(d,h,"info","log"),a(d,h,"debug","log"),a(d,h,"trace","log")}function x(g,m){if(!g)throw new Error("missing bindings for child Pino");m=m||{},ae&&g.serializers&&(m.serializers=g.serializers);const N=m.serializers;if(ae&&N){var Q=Object.assign({},te,N),re=q.browser.serialize===!0?Object.keys(Q):ae;delete g.serializers,p([g],re,Q,this._stdErrSerialize)}function O(Z){this._childLevel=(Z._childLevel|0)+1,this.error=u(Z,g,"error"),this.fatal=u(Z,g,"fatal"),this.warn=u(Z,g,"warn"),this.info=u(Z,g,"info"),this.debug=u(Z,g,"debug"),this.trace=u(Z,g,"trace"),Q&&(this.serializers=Q,this._serialize=re),E&&(this._logEvent=_([].concat(Z._logEvent.bindings,g)))}return O.prototype=this,new O(this)}return h}s.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},s.stdSerializers=t,s.stdTimeFunctions=Object.assign({},{nullTime:V,epochTime:F,unixTime:K,isoTime:B});function a(q,E,L,te){const ae=Object.getPrototypeOf(E);E[L]=E.levelVal>E.levels.values[L]?U:ae[L]?ae[L]:e[L]||e[te]||U,f(q,E,L)}function f(q,E,L){!q.transmit&&E[L]===U||(E[L]=function(te){return function(){const z=q.timestamp(),w=new Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var h=0;h<w.length;h++)w[h]=arguments[h];if(q.serialize&&!q.asObject&&p(w,this._serialize,this.serializers,this._stdErrSerialize),q.asObject?te.call(c,l(this,L,w,z)):te.apply(c,w),q.transmit){const d=q.transmit.level||E.level,y=s.levels.values[d],A=s.levels.values[L];if(A<y)return;b(this,{ts:z,methodLevel:L,methodValue:A,transmitLevel:d,transmitValue:s.levels.values[q.transmit.level||E.level],send:q.transmit.send,val:E.levelVal},w)}}}(E[L]))}function l(q,E,L,te){q._serialize&&p(L,q._serialize,q.serializers,q._stdErrSerialize);const ae=L.slice();let z=ae[0];const w={};te&&(w.time=te),w.level=s.levels.values[E];let c=(q._childLevel|0)+1;if(c<1&&(c=1),z!==null&&typeof z=="object"){for(;c--&&typeof ae[0]=="object";)Object.assign(w,ae.shift());z=ae.length?r(ae.shift(),ae):void 0}else typeof z=="string"&&(z=r(ae.shift(),ae));return z!==void 0&&(w.msg=z),w}function p(q,E,L,te){for(const ae in q)if(te&&q[ae]instanceof Error)q[ae]=s.stdSerializers.err(q[ae]);else if(typeof q[ae]=="object"&&!Array.isArray(q[ae]))for(const z in q[ae])E&&E.indexOf(z)>-1&&z in L&&(q[ae][z]=L[z](q[ae][z]))}function u(q,E,L){return function(){const te=new Array(1+arguments.length);te[0]=E;for(var ae=1;ae<te.length;ae++)te[ae]=arguments[ae-1];return q[L].apply(this,te)}}function b(q,E,L){const te=E.send,ae=E.ts,z=E.methodLevel,w=E.methodValue,c=E.val,h=q._logEvent.bindings;p(L,q._serialize||Object.keys(q.serializers),q.serializers,q._stdErrSerialize===void 0?!0:q._stdErrSerialize),q._logEvent.ts=ae,q._logEvent.messages=L.filter(function(d){return h.indexOf(d)===-1}),q._logEvent.level.label=z,q._logEvent.level.value=w,te(z,q._logEvent,c),q._logEvent=_(h)}function _(q){return{ts:0,messages:[],bindings:q||[],level:{label:"",value:0}}}function M(q){const E={type:q.constructor.name,msg:q.message,stack:q.stack};for(const L in q)E[L]===void 0&&(E[L]=q[L]);return E}function I(q){return typeof q.timestamp=="function"?q.timestamp:q.timestamp===!1?V:F}function C(){return{}}function R(q){return q}function U(){}function V(){return!1}function F(){return Date.now()}function K(){return Math.round(Date.now()/1e3)}function B(){return new Date(Date.now()).toISOString()}function j(){function q(E){return typeof E<"u"&&E}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return q(self)||q(window)||q(this)||{}}}return ll}var da=wS();const zo=Cu(da),_S={level:"info"},jo="custom_context",od=1e3*1024;let AS=class{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},Bg=class{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const t=new AS(e);if(t.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=t),this.tail=t):(this.head=t,this.tail=t),this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let t=this.head;for(;t!==null;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const t=e.value;return e=e.next,{done:!1,value:t}}}}},c2=class{constructor(e,t=od){this.level=e??"error",this.levelValue=da.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Bg(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===da.levels.values.error?console.error(e):t===da.levels.values.warn?console.warn(e):t===da.levels.values.debug?console.debug(e):t===da.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Kn({timestamp:new Date().toISOString(),log:e}));const t=typeof e=="string"?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new Bg(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(Kn({extraMetadata:e})),new Blob(t,{type:"application/json"})}},ES=class{constructor(e,t=od){this.baseChunkLogger=new c2(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}};class xS{constructor(e,t=od){this.baseChunkLogger=new c2(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var SS=Object.defineProperty,MS=Object.defineProperties,IS=Object.getOwnPropertyDescriptors,Lg=Object.getOwnPropertySymbols,DS=Object.prototype.hasOwnProperty,PS=Object.prototype.propertyIsEnumerable,Ug=(r,e,t)=>e in r?SS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Iu=(r,e)=>{for(var t in e||(e={}))DS.call(e,t)&&Ug(r,t,e[t]);if(Lg)for(var t of Lg(e))PS.call(e,t)&&Ug(r,t,e[t]);return r},Du=(r,e)=>MS(r,IS(e));function Lu(r){return Du(Iu({},r),{level:(r==null?void 0:r.level)||_S.level})}function CS(r,e=jo){return r[e]||""}function OS(r,e,t=jo){return r[t]=e,r}function ni(r,e=jo){let t="";return typeof r.bindings>"u"?t=CS(r,e):t=r.bindings().context||"",t}function RS(r,e,t=jo){const i=ni(r,t);return i.trim()?`${i}/${e}`:e}function kr(r,e,t=jo){const i=RS(r,e,t),s=r.child({context:i});return OS(s,i,t)}function NS(r){var e,t;const i=new ES((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:zo(Du(Iu({},r.opts),{level:"trace",browser:Du(Iu({},(t=r.opts)==null?void 0:t.browser),{write:s=>i.write(s)})})),chunkLoggerController:i}}function TS(r){var e;const t=new xS((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:zo(Du(Iu({},r.opts),{level:"trace"}),t),chunkLoggerController:t}}function qS(r){return typeof r.loggerOverride<"u"&&typeof r.loggerOverride!="string"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<"u"?NS(r):TS(r)}let FS=class extends js{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},BS=class extends js{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},LS=class{constructor(e,t){this.logger=e,this.core=t}},US=class extends js{constructor(e,t){super(),this.relayer=e,this.logger=t}},zS=class extends js{constructor(e){super()}},jS=class{constructor(e,t,i,s){this.core=e,this.logger=t,this.name=i}},$S=class extends js{constructor(e,t){super(),this.relayer=e,this.logger=t}},kS=class extends js{constructor(e,t){super(),this.core=e,this.logger=t}},HS=class{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}},KS=class{constructor(e,t){this.projectId=e,this.logger=t}},VS=class{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}},GS=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},WS=class{constructor(e){this.client=e}};const JS="PARSE_ERROR",YS="INVALID_REQUEST",QS="METHOD_NOT_FOUND",XS="INVALID_PARAMS",u2="INTERNAL_ERROR",cd="SERVER_ERROR",ZS=[-32700,-32600,-32601,-32602,-32603],Ao={[JS]:{code:-32700,message:"Parse error"},[YS]:{code:-32600,message:"Invalid Request"},[QS]:{code:-32601,message:"Method not found"},[XS]:{code:-32602,message:"Invalid params"},[u2]:{code:-32603,message:"Internal error"},[cd]:{code:-32e3,message:"Server error"}},f2=cd;function eM(r){return ZS.includes(r)}function zg(r){return Object.keys(Ao).includes(r)?Ao[r]:Ao[f2]}function tM(r){const e=Object.values(Ao).find(t=>t.code===r);return e||Ao[f2]}function h2(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var dl={};/*! ***************************************************************************** 32Copyright (c) Microsoft Corporation. 33 34Permission to use, copy, modify, and/or distribute this software for any 35purpose with or without fee is hereby granted. 36 37THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 38REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 39AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 40INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 41LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 42OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 43PERFORMANCE OF THIS SOFTWARE. 44***************************************************************************** */var Fl=function(r,e){return Fl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)i.hasOwnProperty(s)&&(t[s]=i[s])},Fl(r,e)};function rM(r,e){Fl(r,e);function t(){this.constructor=r}
vendor: 10,821 bytes, line 44
44r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Bl=function(){return Bl=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Bl.apply(this,arguments)};function iM(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t}function nM(r,e,t,i){var s=arguments.length,a=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(f=r[l])&&(a=(s<3?f(a):s>3?f(e,t,a):f(e,t))||a);return s>3&&a&&Object.defineProperty(e,t,a),a}function sM(r,e){return function(t,i){e(t,i,r)}}function aM(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function oM(r,e,t,i){function s(a){return a instanceof t?a:new t(function(f){f(a)})}return new(t||(t=Promise))(function(a,f){function l(b){try{u(i.next(b))}catch(_){f(_)}}function p(b){try{u(i.throw(b))}catch(_){f(_)}}function u(b){b.done?a(b.value):s(b.value).then(l,p)}u((i=i.apply(r,e||[])).next())})}function cM(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,s,a,f;return f={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function l(u){return function(b){return p([u,b])}}function p(u){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,s&&(a=u[0]&2?s.return:u[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,u[1])).done)return a;switch(s=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){t.label=u[1];break}if(u[0]===6&&t.label<a[1]){t.label=a[1],a=u;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(u);break}a[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(b){u=[6,b],s=0}finally{i=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function uM(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}function fM(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function Ll(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function l2(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,a=[],f;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)a.push(s.value)}catch(l){f={error:l}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return a}function hM(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(l2(arguments[e]));return r}function lM(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),s=0,e=0;e<t;e++)for(var a=arguments[e],f=0,l=a.length;f<l;f++,s++)i[s]=a[f];return i}function Po(r){return this instanceof Po?(this.v=r,this):new Po(r)}function dM(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(r,e||[]),s,a=[];return s={},f("next"),f("throw"),f("return"),s[Symbol.asyncIterator]=function(){return this},s;function f(M){i[M]&&(s[M]=function(I){return new Promise(function(C,R){a.push([M,I,C,R])>1||l(M,I)})})}function l(M,I){try{p(i[M](I))}catch(C){_(a[0][3],C)}}function p(M){M.value instanceof Po?Promise.resolve(M.value.v).then(u,b):_(a[0][2],M)}function u(M){l("next",M)}function b(M){l("throw",M)}function _(M,I){M(I),a.shift(),a.length&&l(a[0][0],a[0][1])}}function pM(r){var e,t;return e={},i("next"),i("throw",function(s){throw s}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(s,a){e[s]=r[s]?function(f){return(t=!t)?{value:Po(r[s](f)),done:s==="return"}:a?a(f):f}:a}}function gM(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Ll=="function"?Ll(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(f){return new Promise(function(l,p){f=r[a](f),s(l,p,f.done,f.value)})}}function s(a,f,l,p){Promise.resolve(p).then(function(u){a({value:u,done:l})},f)}}function vM(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function bM(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function mM(r){return r&&r.__esModule?r:{default:r}}function yM(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function wM(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const _M=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Bl},__asyncDelegator:pM,__asyncGenerator:dM,__asyncValues:gM,__await:Po,__awaiter:oM,__classPrivateFieldGet:yM,__classPrivateFieldSet:wM,__createBinding:uM,__decorate:nM,__exportStar:fM,__extends:rM,__generator:cM,__importDefault:mM,__importStar:bM,__makeTemplateObject:vM,__metadata:aM,__param:sM,__read:l2,__rest:iM,__spread:hM,__spreadArrays:lM,__values:Ll},Symbol.toStringTag,{value:"Module"})),AM=zv(_M);var Bn={},jg;function EM(){if(jg)return Bn;jg=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.isBrowserCryptoAvailable=Bn.getSubtleCrypto=Bn.getBrowerCrypto=void 0;function r(){return(pn===null||pn===void 0?void 0:pn.crypto)||(pn===null||pn===void 0?void 0:pn.msCrypto)||{}}Bn.getBrowerCrypto=r;function e(){const i=r();return i.subtle||i.webkitSubtle}Bn.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return Bn.isBrowserCryptoAvailable=t,Bn}var Ln={},$g;function xM(){if($g)return Ln;$g=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.isBrowser=Ln.isNode=Ln.isReactNative=void 0;function r(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ln.isReactNative=r;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ln.isNode=e;function t(){return!r()&&!e()}return Ln.isBrowser=t,Ln}var kg;function SM(){return kg||(kg=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=AM;e.__exportStar(EM(),r),e.__exportStar(xM(),r)}(dl)),dl}var MM=SM();function as(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function Ts(r=6){return BigInt(as(r))}function fs(r,e,t){return{id:t||as(),jsonrpc:"2.0",method:r,params:e}}function Uu(r,e){return{id:r,jsonrpc:"2.0",result:e}}function zu(r,e,t){return{id:r,jsonrpc:"2.0",error:IM(e)}}function IM(r,e){return typeof r>"u"?zg(u2):(typeof r=="string"&&(r=Object.assign(Object.assign({},zg(cd)),{message:r})),eM(r.code)&&(r=tM(r.code)),r)}class DM{}class PM extends DM{constructor(){super()}}class CM extends PM{constructor(e){super()}}const OM="^https?:",RM="^wss?:";function NM(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function d2(r,e){const t=NM(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function Hg(r){return d2(r,OM)}function Kg(r){return d2(r,RM)}function TM(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function p2(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function ud(r){return p2(r)&&"method"in r}function ju(r){return p2(r)&&(ln(r)||Ci(r))}function ln(r){return"result"in r}function Ci(r){return"error"in r}let Zi=class extends CM{constructor(e){super(e),this.events=new pi.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(fs(e.method,e.params||[],e.id||Ts().toString()),t)}async requestStrict(e,t){return new Promise(async(i,s)=>{if(!this.connection.connected)try{await this.open()}catch(a){s(a)}this.events.on(`${e.id}`,a=>{Ci(a)?s(a.error):i(a.result)});try{await this.connection.send(e,t)}catch(a){s(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ju(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const qM=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),FM=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Vg=r=>r.split("?")[0],Gg=10,BM=qM();let LM=class{constructor(e){if(this.url=e,this.events=new pi.EventEmitter,this.registering=!1,!Kg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>
44{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Kn(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Kg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,s)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),s(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return s(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{const s=new URLSearchParams(e).get("origin"),a=MM.isReactNative()?{headers:{origin:s}}:{rejectUnauthorized:!TM(e)},f=new BM(e,[],a);FM()?f.onerror=l=>{const p=l;i(this.emitError(p.error))}:f.on("error",l=>{i(this.emitError(l))}),f.onopen=()=>{this.onOpen(f),t(f)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?Fs(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),s=i.message||i.toString(),a=zu(e,s);this.events.emit("payload",a)}parseError(e,t=this.url){return h2(e,Vg(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Gg&&this.events.setMaxListeners(Gg)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${Vg(this.url)}`));return this.events.emit("register_error",t),t}};var vo={exports:{}};vo.exports;var Wg;function UM(){return Wg||(Wg=1,function(r,e){var t=200,i="__lodash_hash_undefined__",s=1,a=2,f=9007199254740991,l="[object Arguments]",p="[object Array]",u="[object AsyncFunction]",b="[object Boolean]",_="[object Date]",M="[object Error]",I="[object Function]",C="[object GeneratorFunction]",R="[object Map]",U="[object Number]",V="[object Null]",F="[object Object]",K="[object Promise]",B="[object Proxy]",j="[object RegExp]",q="[object Set]",E="[object String]",L="[object Symbol]",te="[object Undefined]",ae="[object WeakMap]",z="[object ArrayBuffer]",w="[object DataView]",c="[object Float32Array]",h="[object Float64Array]",d="[object Int8Array]",y="[object Int16Array]",A="[object Int32Array]",D="[object Uint8Array]",x="[object Uint8ClampedArray]",g="[object Uint16Array]",m="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,Q=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,O={};O[c]=O[h]=O[d]=O[y]=O[A]=O[D]=O[x]=O[g]=O[m]=!0,O[l]=O[p]=O[z]=O[b]=O[w]=O[_]=O[M]=O[I]=O[R]=O[U]=O[F]=O[j]=O[q]=O[E]=O[ae]=!1;var Z=typeof pn=="object"&&pn&&pn.Object===Object&&pn,k=typeof self=="object"&&self&&self.Object===Object&&self,W=Z||k||Function("return this")(),J=e&&!e.nodeType&&e,S=J&&!0&&r&&!r.nodeType&&r,G=S&&S.exports===J,oe=G&&Z.process,ce=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),fe=ce&&ce.isTypedArray;function be(Y,ie){for(var pe=-1,Ue=Y==null?0:Y.length,$t=0,pt=[];++pe<Ue;){var Wt=Y[pe];ie(Wt,pe,Y)&&(pt[$t++]=Wt)}return pt}function we(Y,ie){for(var pe=-1,Ue=ie.length,$t=Y.length;++pe<Ue;)Y[$t+pe]=ie[pe];return Y}function Ie(Y,ie){for(var pe=-1,Ue=Y==null?0:Y.length;++pe<Ue;)if(ie(Y[pe],pe,Y))return!0;return!1}function Je(Y,ie){for(var pe=-1,Ue=Array(Y);++pe<Y;)Ue[pe]=ie(pe);return Ue}function Ce(Y){return function(ie){return Y(ie)}}function Te(Y,ie){return Y.has(ie)}function Se(Y,ie){return Y==null?void 0:Y[ie]}function me(Y){var ie=-1,pe=Array(Y.size);return Y.forEach(function(Ue,$t){pe[++ie]=[$t,Ue]}),pe}function Oe(Y,ie){return function(pe){return Y(ie(pe))}}function Re(Y){var ie=-1,pe=Array(Y.size);return Y.forEach(function(Ue){pe[++ie]=Ue}),pe}var ve=Array.prototype,Ne=Function.prototype,Ee=Object.prototype,ye=W["__core-js_shared__"],Le=Ne.toString,De=Ee.hasOwnProperty,_e=function(){var Y=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");
vendor: 8,461 bytes, line 44
44return Y?"Symbol(src)_1."+Y:""}(),He=Ee.toString,Ve=RegExp("^"+Le.call(De).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xe=G?W.Buffer:void 0,Ke=W.Symbol,ht=W.Uint8Array,Ge=Ee.propertyIsEnumerable,wt=ve.splice,lt=Ke?Ke.toStringTag:void 0,Ye=Object.getOwnPropertySymbols,Et=xe?xe.isBuffer:void 0,Mt=Oe(Object.keys,Object),qe=si(W,"DataView"),Xe=si(W,"Map"),tt=si(W,"Promise"),Fe=si(W,"Set"),et=si(W,"WeakMap"),Ze=si(Object,"create"),ze=Mn(qe),ut=Mn(Xe),rt=Mn(tt),je=Mn(Fe),it=Mn(et),st=Ke?Ke.prototype:void 0,Be=st?st.valueOf:void 0;function Qe(Y){var ie=-1,pe=Y==null?0:Y.length;for(this.clear();++ie<pe;){var Ue=Y[ie];this.set(Ue[0],Ue[1])}}function ft(){this.__data__=Ze?Ze(null):{},this.size=0}function $e(Y){var ie=this.has(Y)&&delete this.__data__[Y];return this.size-=ie?1:0,ie}function Rt(Y){var ie=this.__data__;if(Ze){var pe=ie[Y];return pe===i?void 0:pe}return De.call(ie,Y)?ie[Y]:void 0}function Nt(Y){var ie=this.__data__;return Ze?ie[Y]!==void 0:De.call(ie,Y)}function at(Y,ie){var pe=this.__data__;return this.size+=this.has(Y)?0:1,pe[Y]=Ze&&ie===void 0?i:ie,this}Qe.prototype.clear=ft,Qe.prototype.delete=$e,Qe.prototype.get=Rt,Qe.prototype.has=Nt,Qe.prototype.set=at;function bt(Y){var ie=-1,pe=Y==null?0:Y.length;for(this.clear();++ie<pe;){var Ue=Y[ie];this.set(Ue[0],Ue[1])}}function Ir(){this.__data__=[],this.size=0}function Dr(Y){var ie=this.__data__,pe=ls(ie,Y);if(pe<0)return!1;var Ue=ie.length-1;return pe==Ue?ie.pop():wt.call(ie,pe,1),--this.size,!0}function Pr(Y){var ie=this.__data__,pe=ls(ie,Y);return pe<0?void 0:ie[pe][1]}function Cr(Y){return ls(this.__data__,Y)>-1}function Or(Y,ie){var pe=this.__data__,Ue=ls(pe,Y);return Ue<0?(++this.size,pe.push([Y,ie])):pe[Ue][1]=ie,this}bt.prototype.clear=Ir,bt.prototype.delete=Dr,bt.prototype.get=Pr,bt.prototype.has=Cr,bt.prototype.set=Or;function Zt(Y){var ie=-1,pe=Y==null?0:Y.length;for(this.clear();++ie<pe;){var Ue=Y[ie];this.set(Ue[0],Ue[1])}}function Hr(){this.size=0,this.__data__={hash:new Qe,map:new(Xe||bt),string:new Qe}}function Ni(Y){var ie=Gn(this,Y).delete(Y);return this.size-=ie?1:0,ie}function Kr(Y){return Gn(this,Y).get(Y)}function Ti(Y){return Gn(this,Y).has(Y)}function qi(Y,ie){var pe=Gn(this,Y),Ue=pe.size;return pe.set(Y,ie),this.size+=pe.size==Ue?0:1,this}Zt.prototype.clear=Hr,Zt.prototype.delete=Ni,Zt.prototype.get=Kr,Zt.prototype.has=Ti,Zt.prototype.set=qi;function Vr(Y){var ie=-1,pe=Y==null?0:Y.length;for(this.__data__=new Zt;++ie<pe;)this.add(Y[ie])}function gi(Y){return this.__data__.set(Y,i),this}function vi(Y){return this.__data__.has(Y)}Vr.prototype.add=Vr.prototype.push=gi,Vr.prototype.has=vi;function fr(Y){var ie=this.__data__=new bt(Y);this.size=ie.size}function Fi(){this.__data__=new bt,this.size=0}function Bi(Y){var ie=this.__data__,pe=ie.delete(Y);return this.size=ie.size,pe}function Li(Y){return this.__data__.get(Y)}function hs(Y){return this.__data__.has(Y)}function ko(Y,ie){var pe=this.__data__;if(pe instanceof bt){var Ue=pe.__data__;if(!Xe||Ue.length<t-1)return Ue.push([Y,ie]),this.size=++pe.size,this;pe=this.__data__=new Zt(Ue)}return pe.set(Y,ie),this.size=pe.size,this}fr.prototype.clear=Fi,fr.prototype.delete=Bi,fr.prototype.get=Li,fr.prototype.has=hs,fr.prototype.set=ko;function Ho(Y,ie){var pe=Ws(Y),Ue=!pe&&rc(Y),$t=!pe&&!Ue&&Ra(Y),pt=!pe&&!Ue&&!$t&&sc(Y),Wt=pe||Ue||$t||pt,cr=Wt?Je(Y.length,String):[],Ct=cr.length;for(var kt in Y)De.call(Y,kt)&&!(Wt&&(kt=="length"||$t&&(kt=="offset"||kt=="parent")||pt&&(kt=="buffer"||kt=="byteLength"||kt=="byteOffset")||Qo(kt,Ct)))&&cr.push(kt);return cr}function ls(Y,ie){for(var pe=Y.length;pe--;)if(tc(Y[pe][0],ie))return pe;return-1}function Ca(Y,ie,pe){var Ue=ie(Y);return Ws(Y)?Ue:we(Ue,pe(Y))}function ds(Y){return Y==null?Y===void 0?te:V:lt&< in Object(Y)?Jo(Y):Vu(Y)}function Oa(Y){return gs(Y)&&ds(Y)==l}function ps(Y,ie,pe,Ue,$t){return Y===ie?!0:Y==null||ie==null||!gs(Y)&&!gs(ie)?Y!==Y&&ie!==ie:Ko(Y,ie,pe,Ue,ps,$t)}function Ko(Y,ie,pe,Ue,$t,pt){var Wt=Ws(Y),cr=Ws(ie),Ct=Wt?p:tn(Y),kt=cr?p:tn(ie);Ct=Ct==l?F:Ct,kt=kt==l?F:kt;var ir=Ct==F,Gr=kt==F,ur=Ct==kt;if(ur&&Ra(Y)){if(!Ra(ie))return!1;Wt=!0,ir=!1}if(ur&&!ir)return pt||(pt=new fr),Wt||sc(Y)?Vs(Y,ie,pe,Ue,$t,pt):Ku(Y,ie,Ct,pe,Ue,$t,pt);if(!(pe&s)){var Jt=ir&&De.call(Y,"__wrapped__"),qr=Gr&&De.call(ie,"__wrapped__");if(Jt||qr){var Ui=Jt?Y.value():Y,bi=qr?ie.value():ie;return pt||(pt=new fr),$t(Ui,bi,pe,Ue,pt)}}return ur?(pt||(pt=new fr),Wo(Y,ie,pe,Ue,$t,pt)):!1}function Hu(Y){if(!nc(Y)||Zo(Y))return!1;var ie=Js(Y)?Ve:Q;return ie.test(Mn(Y))}function Vo(Y){return gs(Y)&&ic(Y.length)&&!!O[ds(Y)]}function Go(Y){if(!ec(Y))return Mt(Y);var ie=[];for(var pe in Object(Y))De.call(Y,pe)&&pe!="constructor"&&ie.push(pe);return ie}function Vs(Y,ie,pe,Ue,$t,pt){var Wt=pe&s,cr=Y.length,Ct=ie.length;if(cr!=Ct&&!(Wt&&Ct>cr))return!1;var kt=pt.get(Y);if(kt&&pt.get(ie))return kt==ie;var ir=-1,Gr=!0,ur=pe&a?new Vr:void 0;for(pt.set(Y,ie),pt.set(ie,Y);++ir<cr;){var Jt=Y[ir],qr=ie[ir];if(Ue)var Ui=Wt?Ue(qr,Jt,ir,ie,Y,pt):Ue(Jt,qr,ir,Y,ie,pt);if(Ui!==void 0){if(Ui)continue;Gr=!1;break}if(ur){if(!Ie(ie,function(bi,rn){if(!Te(ur,rn)&&(Jt===bi||$t(Jt,bi,pe,Ue,pt)))return ur.push(rn)})){Gr=!1;break}}else if(!(Jt===qr||$t(Jt,qr,pe,Ue,pt))){Gr=!1;break}}return pt.delete(Y),pt.delete(ie),Gr}function Ku(Y,ie,pe,Ue,$t,pt,Wt){switch(pe){case w:if(Y.byteLength!=ie.byteLength||Y.byteOffset!=ie.byteOffset)return!1;Y=Y.buffer,ie=ie.buffer;case z:return!(Y.byteLength!=ie.byteLength||!pt(new ht(Y),new ht(ie)));case b:case _:case U:return tc(+Y,+ie);case M:return Y.name==ie.name&&Y.message==ie.message;case j:case E:return Y==ie+"";case R:var cr=me;case q:var Ct=Ue&s;if(cr||(cr=Re),Y.size!=ie.size&&!Ct)return!1;var kt=Wt.get(Y);if(kt)return kt==ie;Ue|=a,Wt.set(Y,ie);var ir=Vs(cr(Y),cr(ie),Ue,$t,pt,Wt);return Wt.delete(Y),ir;case L:if(Be)return Be.call(Y)==Be.call(ie)}return!1}function Wo(Y,ie,pe,Ue,$t,pt){var Wt=pe&s,cr=Gs(Y),Ct=cr.length,kt=Gs(ie),ir=kt.length;if(Ct!=ir&&!Wt)return!1;for(var Gr=Ct;Gr--;){var ur=cr[Gr];if(!(Wt?ur in ie:De.call(ie,ur)))return!1}var Jt=pt.get(Y);if(Jt&&pt.get(ie))return Jt==ie;var qr=!0;pt.set(Y,ie),pt.set(ie,Y);for(var Ui=Wt;++Gr<Ct;){ur=cr[Gr];var bi=Y[ur],rn=ie[ur];if(Ue)var Na=Wt?Ue(rn,bi,ur,ie,Y,pt):Ue(bi,rn,ur,Y,ie,pt);if(!(Na===void 0?bi===rn||$t(bi,rn,pe,Ue,pt):Na)){qr=!1;break}Ui||(Ui=ur=="constructor")}if(qr&&!Ui){var vs=Y.constructor,gr=ie.constructor;vs!=gr&&"constructor"in Y&&"constructor"in ie&&!(typeof vs=="function"&&vs instanceof vs&&typeof gr=="function"&&gr instanceof gr)&&(qr=!1)}return pt.delete(Y),pt.delete(ie),qr}function Gs(Y){return Ca(Y,Ju,Yo)}function Gn(Y,ie){var pe=Y.__data__;return Xo(ie)?pe[typeof ie=="string"?"string":"hash"]:pe.map}function si(Y,ie){var pe=Se(Y,ie);return Hu(pe)?pe:void 0}function Jo(Y){var ie=De.call(Y,lt),pe=Y[lt];try{Y[lt]=void 0;var Ue=!0}catch{}var $t=He.call(Y);return Ue&&(ie?Y[lt]=pe:delete Y[lt]),$t}var Yo=Ye?function(Y){return Y==null?[]:(Y=Object(Y),be(Ye(Y),function(ie){return Ge.call(Y,ie)}))}:jt,tn=ds;(qe&&tn(new qe(new ArrayBuffer(1)))!=w||Xe&&tn(new Xe)!=R||tt&&tn(tt.resolve())!=K||Fe&&tn(new Fe)!=q||et&&tn(new et)!=ae)&&(tn=function(Y){var ie=ds(Y),pe=ie==F?Y.constructor:void 0,Ue=pe?Mn(pe):"";if(Ue)switch(Ue){case ze:return w;case ut:return R;case rt:return K;case je:return q;case it:return ae}return ie});function Qo(Y,ie){return ie=ie??f,!!ie&&(typeof Y=="number"||re.test(Y))&&Y>-1&&Y%1==0&&Y<ie}function Xo(Y){var ie=typeof Y;return ie=="string"||ie=="number"||ie=="symbol"||ie=="boolean"?Y!=="__proto__":Y===null}function Zo(Y){return!!_e&&_e in Y}function ec(Y){var ie=Y&&Y.constructor,pe=typeof ie=="function"&&ie.prototype||Ee;return Y===pe}function Vu(Y){return He.call(Y)}function Mn(Y){if(Y!=null){try{return Le.call(Y)}catch{}try{return Y+""}catch{}}return""}function tc(Y,ie){return Y===ie||Y!==Y&&ie!==ie}var rc=Oa(function(){return arguments}())?Oa:function(Y){return gs(Y)&&De.call(Y,"callee")&&!Ge.call(Y,"callee")},Ws=Array.isArray;function Gu(Y){return Y!=null&&ic(Y.length)&&!Js(Y)}var Ra=Et||Ut;function Wu(Y,ie){return ps(Y,ie)}function Js(Y){if(!nc(Y))return!1;var ie=ds(Y);return ie==I||ie==C||ie==u||ie==B}function ic(Y){return typeof Y=="number"&&Y>-1&&Y%1==0&&Y<=f}function nc(Y){var ie=typeof Y;return Y!=null&&(ie=="object"||ie=="function")}function gs(Y){return Y!=null&&typeof Y=="object"}var sc=fe?Ce(fe):Vo;function Ju(Y){return Gu(Y)?Ho(Y):Go(Y)}function jt(){return[]}function Ut(){return!1}r.exports=Wu}
44(vo,vo.exports)),vo.exports}var zM=UM();const jM=Cu(zM),g2="wc",v2=2,fd="core",An=`${g2}@2:${fd}:`,$M={name:fd,logger:"error"},kM={database:":memory:"},HM="crypto",Jg="client_ed25519_seed",KM=Me.ONE_DAY,VM="keychain",GM="0.3",WM="messages",JM="0.3",YM=Me.SIX_HOURS,QM="publisher",b2="irn",XM="error",m2="wss://relay.walletconnect.org",ZM="relayer",zr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},eI="_subscription",Ii={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},tI=.1,Ul="2.17.0",Vt={link_mode:"link_mode",relay:"relay"},rI="0.3",iI="WALLETCONNECT_CLIENT_ID",Yg="WALLETCONNECT_LINK_MODE_APPS",dn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},nI="subscription",sI="0.3",aI=Me.FIVE_SECONDS*1e3,oI="pairing",cI="0.3",oo={wc_pairingDelete:{req:{ttl:Me.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Me.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Me.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Me.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Me.ONE_DAY,prompt:!1,tag:0},res:{ttl:Me.ONE_DAY,prompt:!1,tag:0}}},Rs={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Ki={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},uI="history",fI="0.3",hI="expirer",Di={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},lI="0.3",dI="verify-api",pI="https://verify.walletconnect.com",y2="https://verify.walletconnect.org",Eo=y2,gI=`${Eo}/v3`,vI=[pI,y2],bI="echo",mI="https://echo.walletconnect.com",un={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Un={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Vi={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Ps={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Cs={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},co={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},yI=.1,wI="event-client",_I=86400,AI="https://pulse.walletconnect.org/batch";function EI(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var s=0;s<r.length;
vendor: 5,995 bytes, line 44
44s++){var a=r.charAt(s),f=a.charCodeAt(0);if(t[f]!==255)throw new TypeError(a+" is ambiguous");t[f]=s}var l=r.length,p=r.charAt(0),u=Math.log(l)/Math.log(256),b=Math.log(256)/Math.log(l);function _(C){if(C instanceof Uint8Array||(ArrayBuffer.isView(C)?C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength):Array.isArray(C)&&(C=Uint8Array.from(C))),!(C instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(C.length===0)return"";for(var R=0,U=0,V=0,F=C.length;V!==F&&C[V]===0;)V++,R++;for(var K=(F-V)*b+1>>>0,B=new Uint8Array(K);V!==F;){for(var j=C[V],q=0,E=K-1;(j!==0||q<U)&&E!==-1;E--,q++)j+=256*B[E]>>>0,B[E]=j%l>>>0,j=j/l>>>0;if(j!==0)throw new Error("Non-zero carry");U=q,V++}for(var L=K-U;L!==K&&B[L]===0;)L++;for(var te=p.repeat(R);L<K;++L)te+=r.charAt(B[L]);return te}function M(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return new Uint8Array;var R=0;if(C[R]!==" "){for(var U=0,V=0;C[R]===p;)U++,R++;for(var F=(C.length-R)*u+1>>>0,K=new Uint8Array(F);C[R];){var B=t[C.charCodeAt(R)];if(B===255)return;for(var j=0,q=F-1;(B!==0||j<V)&&q!==-1;q--,j++)B+=l*K[q]>>>0,K[q]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");V=j,R++}if(C[R]!==" "){for(var E=F-V;E!==F&&K[E]===0;)E++;for(var L=new Uint8Array(U+(F-E)),te=U;E!==F;)L[te++]=K[E++];return L}}}function I(C){var R=M(C);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:_,decodeUnsafe:M,decode:I}}var xI=EI,SI=xI;const w2=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},MI=r=>new TextEncoder().encode(r),II=r=>new TextDecoder().decode(r);class DI{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class PI{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return _2(this,e)}}class CI{constructor(e){this.decoders=e}or(e){return _2(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const _2=(r,e)=>new CI({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class OI{constructor(e,t,i,s){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=s,this.encoder=new DI(e,t,i),this.decoder=new PI(e,t,s)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const $u=({name:r,prefix:e,encode:t,decode:i})=>new OI(r,e,t,i),$o=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:s}=SI(t,e);return $u({prefix:r,name:e,encode:i,decode:a=>w2(s(a))})},RI=(r,e,t,i)=>{const s={};for(let b=0;b<e.length;++b)s[e[b]]=b;let a=r.length;for(;r[a-1]==="=";)--a;const f=new Uint8Array(a*t/8|0);let l=0,p=0,u=0;for(let b=0;b<a;++b){const _=s[r[b]];if(_===void 0)throw new SyntaxError(`Non-${i} character`);p=p<<t|_,l+=t,l>=8&&(l-=8,f[u++]=255&p>>l)}if(l>=t||255&p<<8-l)throw new SyntaxError("Unexpected end of data");return f},NI=(r,e,t)=>{const i=e[e.length-1]==="=",s=(1<<t)-1;let a="",f=0,l=0;for(let p=0;p<r.length;++p)for(l=l<<8|r[p],f+=8;f>t;)f-=t,a+=e[s&l>>f];if(f&&(a+=e[s&l<<t-f]),i)for(;a.length*t&7;)a+="=";return a},Mr=({name:r,prefix:e,bitsPerChar:t,alphabet:i})=>$u({prefix:e,name:r,encode(s){return NI(s,i,t)},decode(s){return RI(s,i,t,r)}}),TI=$u({prefix:"\0",name:"identity",encode:r=>II(r),decode:r=>MI(r)});var qI=Object.freeze({__proto__:null,identity:TI});const FI=Mr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var BI=Object.freeze({__proto__:null,base2:FI});const LI=Mr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var UI=Object.freeze({__proto__:null,base8:LI});const zI=$o({prefix:"9",name:"base10",alphabet:"0123456789"});var jI=Object.freeze({__proto__:null,base10:zI});const $I=Mr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),kI=Mr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var HI=Object.freeze({__proto__:null,base16:$I,base16upper:kI});const KI=Mr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),VI=Mr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),GI=Mr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),WI=Mr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),JI=Mr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),YI=Mr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),QI=Mr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),XI=Mr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ZI=Mr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var eD=Object.freeze({__proto__:null,base32:KI,base32upper:VI,base32pad:GI,base32padupper:WI,base32hex:JI,base32hexupper:YI,base32hexpad:QI,base32hexpadupper:XI,base32z:ZI});const tD=$o({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rD=$o({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var iD=Object.freeze({__proto__:null,base36:tD,base36upper:rD}
vendor: 8,992 bytes, line 44
44);const nD=$o({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sD=$o({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var aD=Object.freeze({__proto__:null,base58btc:nD,base58flickr:sD});const oD=Mr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cD=Mr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),uD=Mr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fD=Mr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var hD=Object.freeze({__proto__:null,base64:oD,base64pad:cD,base64url:uD,base64urlpad:fD});const A2=Array.from("ððªâð°ðððððððððððððâð»ð¥ð¾ð¿ðâ¤ðð¤£ððððððð
ððð¥ð¥°ðððð¢ð¤ðððªðâºðð¤ððððð¹ð¤¦ððââ¨ð¤·ð±ðð¸ððððððððð¤©ððð¤ðð¯ððð¶ðð¤â£ððððªðð¥ððð©ð¡ð¤ªðð¥³ð¥ð¤¤ððð³âððð´ðð¬ððð·ð»ðââ
ð¥ºððð¤ð¦âð£ððâ¹ððð âððºðð»ððððð¹ð£ð«ðððµð¤ðð´ð¤ð¼ð«â½ð¤âðð¤«ðð®ðð»ðð¶ðð²ð¿ð§¡ðâ¡ððââðð°ð¤¨ð¶ð¤ð¶ð°ðð¢ð¤ðð¨ð¨ð¤¬âððºð¤ððð±ðð¶ð¥´â¶â¡âðð¸â¬ð¨ðð¦ð·ðºâ ð
ððµðð¤²ð¤ ð¤§ððµð
ð§ð¾ððð¤ðð¤¯ð·âð§ð¯ððð¤ððâð´ð£ð¸ððð¥ð¤¢ð
ð¡ð©ðð¸ð»ð¤ð¤®ð¼ð¥µð©ððð¼ðð£ð¥"),lD=A2.reduce((r,e,t)=>(r[t]=e,r),[]),dD=A2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function pD(r){return r.reduce((e,t)=>(e+=lD[t],e),"")}function gD(r){const e=[];for(const t of r){const i=dD[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const vD=$u({prefix:"ð",name:"base256emoji",encode:pD,decode:gD});var bD=Object.freeze({__proto__:null,base256emoji:vD}),mD=E2,Qg=128,yD=127,wD=~yD,_D=Math.pow(2,31);function E2(r,e,t){e=e||[],t=t||0;for(var i=t;r>=_D;)e[t++]=r&255|Qg,r/=128;for(;r&wD;)e[t++]=r&255|Qg,r>>>=7;return e[t]=r|0,E2.bytes=t-i+1,e}var AD=zl,ED=128,Xg=127;function zl(r,i){var t=0,i=i||0,s=0,a=i,f,l=r.length;do{if(a>=l)throw zl.bytes=0,new RangeError("Could not decode varint");f=r[a++],t+=s<28?(f&Xg)<<s:(f&Xg)*Math.pow(2,s),s+=7}while(f>=ED);return zl.bytes=a-i,t}var xD=Math.pow(2,7),SD=Math.pow(2,14),MD=Math.pow(2,21),ID=Math.pow(2,28),DD=Math.pow(2,35),PD=Math.pow(2,42),CD=Math.pow(2,49),OD=Math.pow(2,56),RD=Math.pow(2,63),ND=function(r){return r<xD?1:r<SD?2:r<MD?3:r<ID?4:r<DD?5:r<PD?6:r<CD?7:r<OD?8:r<RD?9:10},TD={encode:mD,decode:AD,encodingLength:ND},x2=TD;const Zg=(r,e,t=0)=>(x2.encode(r,e,t),e),ev=r=>x2.encodingLength(r),jl=(r,e)=>{const t=e.byteLength,i=ev(r),s=i+ev(t),a=new Uint8Array(s+t);return Zg(r,a,0),Zg(t,a,i),a.set(e,s),new qD(r,t,e,a)};class qD{constructor(e,t,i,s){this.code=e,this.size=t,this.digest=i,this.bytes=s}}const S2=({name:r,code:e,encode:t})=>new FD(r,e,t);class FD{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?jl(this.code,t):t.then(i=>jl(this.code,i))}else throw Error("Unknown type, must be binary type")}}const M2=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),BD=S2({name:"sha2-256",code:18,encode:M2("SHA-256")}),LD=S2({name:"sha2-512",code:19,encode:M2("SHA-512")});var UD=Object.freeze({__proto__:null,sha256:BD,sha512:LD});const I2=0,zD="identity",D2=w2,jD=r=>jl(I2,D2(r)),$D={code:I2,name:zD,encode:D2,digest:jD};var kD=Object.freeze({__proto__:null,identity:$D});new TextEncoder,new TextDecoder;const tv={...qI,...BI,...UI,...jI,...HI,...eD,...iD,...aD,...hD,...bD};({...UD,...kD});function HD(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function P2(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const rv=P2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),pl=P2("ascii","a",r=>{let e="a";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return e},r=>{r=r.substring(1);const e=HD(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return e}),KD={utf8:rv,"utf-8":rv,hex:tv.base16,latin1:pl,ascii:pl,binary:pl,...tv};function VD(r,e="utf8"){const t=KD[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r,"utf8"):t.decoder.decode(`${t.prefix}${r}`)}class GD{constructor(e,t){this.core=e,this.logger=t,this.keychain=new Map,this.name=VM,this.version=GM,this.initialized=!1,this.storagePrefix=An,this.init=async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,s)=>{this.isInitialized(),this.keychain.set(i,s),await this.persist()},this.get=i=>{this.isInitialized();const s=this.keychain.get(i);if(typeof s>"u"){const{message:a}=Ae("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(a)}return s},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=kr(t,this.name)}get context(){return ni(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,fb(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?hb(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class WD{constructor(e,t,i){this.core=e,this.logger=t,this.name=HM,this.randomSessionIdentifier=Nl(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=s=>(this.isInitialized(),this.keychain.has(s)),this.getClientId=async()=>{this.isInitialized();const s=await this.getClientSeed(),a=q1(s);return ab(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const s=UE();return this.setPrivateKey(s.publicKey,s.privateKey)},this.signJWT=async s=>{this.isInitialized();const a=await this.getClientSeed(),f=q1(a),l=this.randomSessionIdentifier;return await w7(l,s,KM,f)},this.generateSharedKey=(s,a,f)=>{this.isInitialized();const l=this.getPrivateKey(s),p=zE(l,a);return this.setSymKey(p,f)},this.setSymKey=async(s,a)=>{this.isInitialized();const f=a||du(s);return await this.keychain.set(f,s),f},this.deleteKeyPair=async s=>{this.isInitialized(),await this.keychain.del(s)},this.deleteSymKey=async s=>{this.isInitialized(),await this.keychain.del(s)},this.encode=async(s,a,f)=>{this.isInitialized();const l=r2(f),p=Kn(a);if(mg(l))return $E(p,f==null?void 0:f.encoding);if(bg(l)){const M=l.senderPublicKey,I=l.receiverPublicKey;s=await this.generateSharedKey(M,I)}const u=this.getSymKey(s),{type:b,senderPublicKey:_}=l;return jE({type:b,symKey:u,message:p,senderPublicKey:_,encoding:f==null?void 0:f.encoding})},this.decode=async(s,a,f)=>{this.isInitialized();const l=KE(a,f);if(mg(l)){const p=HE(a,f==null?void 0:f.encoding);return Fs(p)}if(bg(l)){const p=l.receiverPublicKey,u=l.senderPublicKey;s=await this.generateSharedKey(p,u)}try{const p=this.getSymKey(s),u=kE({symKey:p,encoded:a,encoding:f==null?void 0:f.encoding});return Fs(u)}catch(p){this.logger.error(`Failed to decode message from topic: '${s}', clientId: '${await this.getClientId()}'`),this.logger.error(p)}},this.getPayloadType=(s,a=us)=>{const f=Io({encoded:s,encoding:a});return Ls(f.type)},this.getPayloadSenderPublicKey=(s,a=us)=>{const f=Io({encoded:s,encoding:a});return f.senderPublicKey?_r(f.senderPublicKey,$r):void 0},this.core=e,this.logger=kr(t,this.name),this.keychain=i||new GD(this.core,this.logger)}get context(){return ni(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Jg)}catch{e=Nl(),await this.keychain.set(Jg,e)}return VD(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class JD extends LS{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=WM,this.version=JM,this.initialized=!1,this.storagePrefix=An,this.init=async()=>
44{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,s)=>{this.isInitialized();const a=jn(s);let f=this.messages.get(i);return typeof f>"u"&&(f={}),typeof f[a]<"u"||(f[a]=s,this.messages.set(i,f),await this.persist()),a},this.get=i=>{this.isInitialized();let s=this.messages.get(i);return typeof s>"u"&&(s={}),s},this.has=(i,s)=>{this.isInitialized();const a=this.get(i),f=jn(s);return typeof a[f]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=kr(e,this.name),this.core=t}get context(){return ni(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,fb(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?hb(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class YD extends US{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new pi.EventEmitter,this.name=QM,this.queue=new Map,this.publishTimeout=Me.toMiliseconds(Me.ONE_MINUTE),this.failedPublishTimeout=Me.toMiliseconds(Me.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,s,a)=>{var f;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:s,opts:a}});const l=(a==null?void 0:a.ttl)||YM,p=Tl(a),u=(a==null?void 0:a.prompt)||!1,b=(a==null?void 0:a.tag)||0,_=(a==null?void 0:a.id)||Ts().toString(),M={topic:i,message:s,opts:{ttl:l,relay:p,prompt:u,tag:b,id:_,attestation:a==null?void 0:a.attestation}},I=`Failed to publish payload, please try again. id:${_} tag:${b}`,C=Date.now();let R,U=1;try{for(;R===void 0;){if(Date.now()-C>this.publishTimeout)throw new Error(I);this.logger.trace({id:_,attempts:U},`publisher.publish - attempt ${U}`),R=await await va(this.rpcPublish(i,s,l,p,u,b,_,a==null?void 0:a.attestation).catch(V=>this.logger.warn(V)),this.publishTimeout,I),U++,R||await new Promise(V=>setTimeout(V,this.failedPublishTimeout))}this.relayer.events.emit(zr.publish,M),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:_,topic:i,message:s,opts:a}})}catch(V){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(V),(f=a==null?void 0:a.internal)!=null&&f.throwOnFailedPublish)throw V;this.queue.set(_,M)}},this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.relayer=e,this.logger=kr(t,this.name),this.registerEventListeners()}get context(){return ni(this.logger)}rpcPublish(e,t,i,s,a,f,l,p){var u,b,_,M;const I={method:po(s.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:a,tag:f,attestation:p},id:l};return ri((u=I.params)==null?void 0:u.prompt)&&((b=I.params)==null||delete b.prompt),ri((_=I.params)==null?void 0:_.tag)&&((M=I.params)==null||delete M.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:I}),this.relayer.request(I)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:s}=e;await this.publish(t,i,s)})}registerEventListeners(){this.relayer.core.heartbeat.on(Da.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(zr.connection_stalled);return}this.checkQueue()}),this.relayer.on(zr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class QD{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>
44{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const s=i.filter(a=>a!==t);if(!s.length){this.map.delete(e);return}this.map.set(e,s)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var XD=Object.defineProperty,ZD=Object.defineProperties,eP=Object.getOwnPropertyDescriptors,iv=Object.getOwnPropertySymbols,tP=Object.prototype.hasOwnProperty,rP=Object.prototype.propertyIsEnumerable,nv=(r,e,t)=>e in r?XD(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,uo=(r,e)=>{for(var t in e||(e={}))tP.call(e,t)&&nv(r,t,e[t]);if(iv)for(var t of iv(e))rP.call(e,t)&&nv(r,t,e[t]);return r},gl=(r,e)=>ZD(r,eP(e));class iP extends $S{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new QD,this.events=new pi.EventEmitter,this.name=nI,this.version=sI,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=An,this.subscribeTimeout=Me.toMiliseconds(Me.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(i,s)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:s}});try{const a=Tl(s),f={topic:i,relay:a,transportType:s==null?void 0:s.transportType};this.pending.set(i,f);const l=await this.rpcSubscribe(i,a,s==null?void 0:s.transportType);return typeof l=="string"&&(this.onSubscribe(l,f),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:s}})),l}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(i,s)=>{await this.restartToComplete(),this.isInitialized(),typeof(s==null?void 0:s.id)<"u"?await this.unsubscribeById(i,s.id,s):await this.unsubscribeByTopic(i,s)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const s=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((a,f)=>{const l=new Me.Watch;l.start(s);const p=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(p),l.stop(s),a(!0)),l.elapsed(s)>=aI&&(clearInterval(p),l.stop(s),f(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=kr(t,this.name),this.clientId=""}get context(){return ni(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async s=>await this.unsubscribeById(e,s,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{const s=Tl(i);await this.rpcUnsubscribe(e,t,s);const a=Lt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(s){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(s),s}}async rpcSubscribe(e,t,i=Vt.relay){i===Vt.relay&&await this.restartToComplete();const s={method:po(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{const a=jn(e+this.clientId);return i===Vt.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(f=>this.logger.warn(f))},Me.toMiliseconds(Me.ONE_SECOND)),a):await await va(this.relayer.request(s).catch(f=>this.logger.warn(f)),this.subscribeTimeout)?a:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(zr.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:po(t.protocol).batchSubscribe,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await va(this.relayer.request(i).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(zr.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t=e[0].relay,i={method:po(t.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let s;try{s=await await va(this.relayer.request(i).catch(a=>this.logger.warn(a)),this.subscribeTimeout)}catch{this.relayer.events.emit(zr.connection_stalled)}return s}rpcUnsubscribe(e,t,i){const s={method:po(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s}),this.relayer.request(s)}onSubscribe(e,t){this.setSubscription(e,gl(uo({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,uo({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}
44async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,uo({},t)),this.topicMap.set(t.topic,e),this.events.emit(dn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(dn.deleted,gl(uo({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(dn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t<e;t++){const i=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(i),await this.batchSubscribe(i)}}this.events.emit(dn.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);_n(t)&&this.onBatchSubscribe(t.map((i,s)=>gl(uo({},e[s]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(Da.pulse,async()=>{await this.checkPending()}),this.events.on(dn.created,async e=>{const t=dn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(dn.deleted,async e=>{const t=dn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var nP=Object.defineProperty,sv=Object.getOwnPropertySymbols,sP=Object.prototype.hasOwnProperty,aP=Object.prototype.propertyIsEnumerable,av=(r,e,t)=>e in r?nP(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,oP=(r,e)=>{for(var t in e||(e={}))sP.call(e,t)&&av(r,t,e[t]);if(sv)for(var t of sv(e))aP.call(e,t)&&av(r,t,e[t]);return r};class cP extends zS{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new pi.EventEmitter,this.name=ZM,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["s
44ocket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=Me.toMiliseconds(Me.THIRTY_SECONDS+Me.ONE_SECOND),this.request=async t=>{var i,s;this.logger.debug("Publishing Request Payload");const a=t.id||Ts().toString();await this.toEstablishConnection();try{const f=this.provider.request(t);this.requestsInFlight.set(a,{promise:f,request:t}),this.logger.trace({id:a,method:t.method,topic:(i=t.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const l=await new Promise(async(p,u)=>{const b=()=>{u(new Error(`relayer.request - publish interrupted, id: ${a}`))};this.provider.on(Ii.disconnect,b);const _=await f;this.provider.off(Ii.disconnect,b),p(_)});return this.logger.trace({id:a,method:t.method,topic:(s=t.params)==null?void 0:s.topic},"relayer.request - published"),l}catch(f){throw this.logger.debug(`Failed to Publish Request: ${a}`),f}finally{this.requestsInFlight.delete(a)}},this.resetPingTimeout=()=>{if(wu())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,i,s;(s=(i=(t=this.provider)==null?void 0:t.connection)==null?void 0:i.socket)==null||s.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(zr.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(zr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Ii.payload,this.onPayloadHandler),this.provider.on(Ii.connect,this.onConnectHandler),this.provider.on(Ii.disconnect,this.onDisconnectHandler),this.provider.on(Ii.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?kr(e.logger,this.name):zo(Lu({level:e.logger||XM})),this.messages=new JD(this.logger,e.core),this.subscriber=new iP(this,this.logger),this.publisher=new YD(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||m2,this.projectId=e.projectId,this.bundleId=P7(),this.provider={}}
44async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return ni(this.logger)}get connected(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===1}get connecting(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Vt.relay})}async subscribe(e,t){var i;this.isInitialized(),(t==null?void 0:t.transportType)==="relay"&&await this.toEstablishConnection();let s=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",a;const f=l=>{l.topic===e&&(this.subscriber.off(dn.created,f),a())};return await Promise.all([new Promise(l=>{a=l,this.subscriber.on(dn.created,f)}),new Promise(async l=>{s=await this.subscriber.subscribe(e,t)||s,l()})]),s}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await va(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,i)=>{const s=()=>{this.provider.off(Ii.disconnect,s),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Ii.disconnect,s),await va(this.provider.connect(),Me.toMiliseconds(Me.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(a=>{this.logger.error(a),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const i=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Pg())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const t=e.sort((i,s)=>i.publishedAt-s.publishedAt);this.logger.trace(`Batch of ${t.length} message events sorted`);for(const i of t)try{await this.onMessageEvent(i)}catch(s){this.logger.warn(s)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:i}=e;if(!t.sessionExists){const s=pr(Me.FIVE_MINUTES),a={topic:i,expiry:s,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(i,a)}this.events.emit(zr.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,i,s,a;
44if(wu())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((a=(s=(i=this.provider)==null?void 0:i.connection)==null?void 0:s.socket)==null||a.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(f){this.logger.warn(f)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Zi(new LM(N7({sdkVersion:Ul,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const s=this.messages.has(t,i);return s&&this.logger.debug(`Ignoring duplicate message: ${i}`),s}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),ud(e)){if(!e.method.endsWith(eI))return;const t=e.params,{topic:i,message:s,publishedAt:a,attestation:f}=t.data,l={topic:i,message:s,publishedAt:a,transportType:Vt.relay,attestation:f};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(oP({type:"event",event:t.id},l)),this.events.emit(t.id,l),await this.acknowledgePayload(e),await this.onMessageEvent(l)}else ju(e)&&this.events.emit(zr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(zr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Uu(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Ii.payload,this.onPayloadHandler),this.provider.off(Ii.connect,this.onConnectHandler),this.provider.off(Ii.disconnect,this.onDisconnectHandler),this.provider.off(Ii.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Pg();Lx(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(zr.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Me.toMiliseconds(tI))))}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var uP=Object.defineProperty,ov=Object.getOwnPropertySymbols,fP=Object.prototype.hasOwnProperty,hP=Object.prototype.propertyIsEnumerable,cv=(r,e,t)=>e in r?uP(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,uv=(r,e)=>{for(var t in e||(e={}))fP.call(e,t)&&cv(r,t,e[t]);if(ov)for(var t of ov(e))hP.call(e,t)&&cv(r,t,e[t]);return r};class ks extends jS{constructor(e,t,i,s=An,a=void 0){super(e,t,i,s),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=rI,this.cached=[],this.initialized=!1,this.storagePrefix=An,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(f=>{this.getKey&&f!==null&&!ri(f)?this.map.set(this.getKey(f),f):gx(f)?this.map.set(f.id,f):vx(f)&&this.map.set(f.topic,f)}),this.cached=[],this.initialized=!0)},this.set=async(f,l)=>{this.isInitialized(),this.map.has(f)?await this.update(f,l):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:f,value:l}),this.map.set(f,l),await this.persist())},this.get=f=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:f}),this.getData(f)),this.getAll=f=>(this.isInitialized(),f?this.values.filter(l=>Object.keys(f).every(p=>jM(l[p],f[p]))):this.values),this.update=async(f,l)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:f,update:l});const p=uv(uv({},this.getData(f)),l);this.map.set(f,p),await this.persist()},this.delete=async(f,l)=>{this.isInitialized(),this.map.has(f)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",ke
vendor: 4,270 bytes, line 44
44y:f,reason:l}),this.map.delete(f),this.addToRecentlyDeleted(f),await this.persist())},this.logger=kr(t,this.name),this.storagePrefix=s,this.getKey=a}get context(){return ni(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:s}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(s),new Error(s)}const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class lP{constructor(e,t){this.core=e,this.logger=t,this.name=oI,this.version=cI,this.events=new Gl,this.initialized=!1,this.storagePrefix=An,this.ignoredPayloadTypes=[Hn],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const s=Nl(),a=await this.core.crypto.setSymKey(s),f=pr(Me.FIVE_MINUTES),l={protocol:b2},p={topic:a,expiry:f,relay:l,active:!1,methods:i==null?void 0:i.methods},u=Eg({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:s,relay:l,expiryTimestamp:f,methods:i==null?void 0:i.methods});return this.events.emit(Rs.create,p),this.core.expirer.set(a,f),await this.pairings.set(a,p),await this.core.relayer.subscribe(a,{transportType:i==null?void 0:i.transportType}),{topic:a,uri:u}},this.pair=async i=>{this.isInitialized();const s=this.core.eventClient.createEvent({properties:{topic:i==null?void 0:i.uri,trace:[un.pairing_started]}});this.isValidPair(i,s);const{topic:a,symKey:f,relay:l,expiryTimestamp:p,methods:u}=Ag(i.uri);s.props.properties.topic=a,s.addTrace(un.pairing_uri_validation_success),s.addTrace(un.pairing_uri_not_expired);let b;if(this.pairings.keys.includes(a)){if(b=this.pairings.get(a),s.addTrace(un.existing_pairing),b.active)throw s.setError(Un.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);s.addTrace(un.pairing_not_expired)}const _=p||pr(Me.FIVE_MINUTES),M={topic:a,relay:l,expiry:_,active:!1,methods:u};this.core.expirer.set(a,_),await this.pairings.set(a,M),s.addTrace(un.store_new_pairing),i.activatePairing&&await this.activate({topic:a}),this.events.emit(Rs.create,M),s.addTrace(un.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(f,a),s.addTrace(un.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{s.setError(Un.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:l})}catch(I){throw s.setError(Un.subscribe_pairing_topic_failure),I}return s.addTrace(un.subscribe_pairing_topic_success),M},this.activate=async({topic:i})=>{this.isInitialized();const s=pr(Me.THIRTY_DAYS);this.core.expirer.set(i,s),await this.pairings.update(i,{active:!0,expiry:s})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:s}=i;
44if(this.pairings.keys.includes(s)){const a=await this.sendRequest(s,"wc_pairingPing",{}),{done:f,resolve:l,reject:p}=Os();this.events.once(St("pairing_ping",a),({error:u})=>{u?p(u):l()}),await f()}},this.updateExpiry=async({topic:i,expiry:s})=>{this.isInitialized(),await this.pairings.update(i,{expiry:s})},this.updateMetadata=async({topic:i,metadata:s})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:s})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:s}=i;this.pairings.keys.includes(s)&&(await this.sendRequest(s,"wc_pairingDelete",Lt("USER_DISCONNECTED")),await this.deletePairing(s))},this.formatUriFromPairing=i=>{this.isInitialized();const{topic:s,relay:a,expiry:f,methods:l}=i,p=this.core.crypto.keychain.get(s);return Eg({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:p,relay:a,expiryTimestamp:f,methods:l})},this.sendRequest=async(i,s,a)=>{const f=fs(s,a),l=await this.core.crypto.encode(i,f),p=oo[s].req;return this.core.history.set(i,f),this.core.relayer.publish(i,l,p),f.id},this.sendResult=async(i,s,a)=>{const f=Uu(i,a),l=await this.core.crypto.encode(s,f),p=await this.core.history.get(s,i),u=oo[p.request.method].res;await this.core.relayer.publish(s,l,u),await this.core.history.resolve(f)},this.sendError=async(i,s,a)=>{const f=zu(i,a),l=await this.core.crypto.encode(s,f),p=await this.core.history.get(s,i),u=oo[p.request.method]?oo[p.request.method].res:oo.unregistered_method.res;await this.core.relayer.publish(s,l,u),await this.core.history.resolve(f)},this.deletePairing=async(i,s)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Lt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),s?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(s=>ns(s.expiry));await Promise.all(i.map(s=>this.deletePairing(s.topic)))},this.onRelayEventRequest=i=>{const{topic:s,payload:a}=i;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(s,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(s,a);default:return this.onUnknownRpcMethodRequest(s,a)}},this.onRelayEventResponse=async i=>{const{topic:s,payload:a}=i,f=(await this.core.history.get(s,a.id)).request.method;switch(f){case"wc_pairingPing":return this.onPairingPingResponse(s,a);default:return this.onUnknownRpcMethodResponse(f)}},this.onPairingPingRequest=async(i,s)=>{const{id:a}=s;try{this.isValidPing({topic:i}),await this.sendResult(a,i,!0),this.events.emit(Rs.ping,{id:a,topic:i})}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onPairingPingResponse=(i,s)=>{const{id:a}=s;setTimeout(()=>{ln(s)?this.events.emit(St("pairing_ping",a),{}):Ci(s)&&this.events.emit(St("pairing_ping",a),{error:s.error})},500)},this.onPairingDeleteRequest=async(i,s)=>{const{id:a}=s;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(Rs.delete,{id:a,topic:i})}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onUnknownRpcMethodRequest=async(i,s)=>{const{id:a,method:f}=s;try{if(this.registeredMethods.includes(f))return;const l=Lt("WC_METHOD_UNSUPPORTED",f);await this.sendError(a,i,l),this.logger.error(l)}catch(l){await this.sendError(a,i,l),this.logger.error(l)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Lt("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=(i,s)=>{var a;if(!ei(i)){const{message:l}=Ae("MISSING_OR_INVALID",`pair() params: ${i}`);throw s.setError(Un.malformed_pairing_uri),new Error(l)}if(!px(i.uri)){const{message:l}=Ae("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw s.setError(Un.malformed_pairing_uri),new Error(l)}const f=Ag(i==null?void 0:i.uri);if(!((a=f==null?void 0:f.relay)!=null&&a.protocol)){const{message:l}=Ae("MISSING_OR_INVALID","pair() uri#relay-protocol");throw s.setError(Un.malformed_pairing_uri),new Error(l)}if(!(f!=null&&f.symKey)){const{message:l}=Ae("MISSING_OR_INVALID","pair() uri#symKey");throw s.setError(Un.malformed_pairing_uri),new Error(l)}if(f!=null&&f.expiryTimestamp&&Me.toMiliseconds(f==null?void 0:f.expiryTimestamp)<Date.now()){s.setError(Un.pairing_expired);const{message:l}=Ae("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(l)}},this.isValidPing=async i=>{if(!ei(i)){const{message:a}=Ae("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(a)}const{topic:s}=i;await this.isValidPairingTopic(s)},this.isValidDisconnect=async i=>{if(!ei(i)){const{message:a}=Ae("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(a)}const{topic:s}=i;await this.isValidPairingTopic(s)},this.isValidPairingTopic=async i=>{if(!or(i,!1)){const{message:s}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(s)}if(!this.pairings.keys.includes(i)){const{message:s}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(s)}if(ns(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:s}=Ae("EXPIRED",`pairing topic: ${i}`);throw new Error(s)}},this.core=e,this.logger=kr(t,this.name),this.pairings=new ks(this.core,this.logger,this.name,this.storagePrefix)}get context(){return ni(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(zr.message,async e=>{const{topic:t,message:i,transportType:s}=e;if(!this.pairings.keys.includes(t)||s===Vt.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const a=await this.core.crypto.decode(t,i);try{ud(a)?(this.core.history.set(t,a),this.onRelayEventRequest({topic:t,payload:a})):ju(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:t,payload:a}
vendor: 10,075 bytes, line 44
44),this.core.history.delete(t,a.id))}catch(f){this.logger.error(f)}})}registerExpirerEvents(){this.core.expirer.on(Di.expired,async e=>{const{topic:t}=db(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(Rs.expire,{topic:t}))})}}class dP extends BS{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new pi.EventEmitter,this.name=uI,this.version=fI,this.cached=[],this.initialized=!1,this.storagePrefix=An,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,s,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:s,chainId:a}),this.records.has(s.id))return;const f={id:s.id,topic:i,request:{method:s.method,params:s.params||null},chainId:a,expiry:pr(Me.THIRTY_DAYS)};this.records.set(f.id,f),this.persist(),this.events.emit(Ki.created,f)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const s=await this.getRecord(i.id);typeof s.response>"u"&&(s.response=Ci(i)?{error:i.error}:{result:i.result},this.records.set(s.id,s),this.persist(),this.events.emit(Ki.updated,s))},this.get=async(i,s)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:s}),await this.getRecord(s)),this.delete=(i,s)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:s}),this.values.forEach(a=>{if(a.topic===i){if(typeof s<"u"&&a.id!==s)return;this.records.delete(a.id),this.events.emit(Ki.deleted,a)}}),this.persist()},this.exists=async(i,s)=>(this.isInitialized(),this.records.has(s)?(await this.getRecord(s)).topic===i:!1),this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.logger=kr(t,this.name)}get context(){return ni(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const i={topic:t.topic,request:fs(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Ki.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Ki.created,e=>{const t=Ki.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(Ki.updated,e=>{const t=Ki.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(Ki.deleted,e=>{const t=Ki.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(Da.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{Me.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(Ki.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class pP extends kS{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new pi.EventEmitter,this.name=hI,this.version=lI,this.cached=[],this.initialized=!1,this.storagePrefix=An,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const s=this.formatTarget(i);return typeof this.getExpiration(s)<"u"}catch{return!1}},this.set=(i,s)=>{this.isInitialized();const a=this.formatTarget(i),f={target:a,expiry:s};this.expirations.set(a,f),this.checkExpiry(a,f),this.events.emit(Di.created,{target:a,expiration:f})},this.get=i=>{this.isInitialized();const s=this.formatTarget(i);return this.getExpiration(s)},this.del=i=>{if(this.isInitialized(),this.has(i)){const s=this.formatTarget(i),a=this.getExpiration(s);this.expirations.delete(s),this.events.emit(Di.deleted,{target:s,expiration:a})}},this.on=(i,s)=>{this.events.on(i,s)},this.once=(i,s)=>{this.events.once(i,s)},this.off=(i,s)=>{this.events.off(i,s)},this.removeListener=(i,s)=>{this.events.removeListener(i,s)},this.logger=kr(t,this.name)}get context(){return ni(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return T7(e);if(typeof e=="number")return q7(e);const{message:t}=Ae("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Di.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;Me.toMiliseconds(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Di.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Da.pulse,()=>this.checkExpirations()),this.events.on(Di.created,e=>{const t=Di.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Di.expired,e=>{const t=Di.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Di.deleted,e=>{const t=Di.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Yt={};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.getLocalStorage=Yt.getLocalStorageOrThrow=Yt.getCrypto=Yt.getCryptoOrThrow=Yt.getLocation=Yt.getLocationOrThrow=Yt.getNavigator=Yt.getNavigatorOrThrow=C2=Yt.getDocument=Yt.getDocumentOrThrow=Yt.getFromWindowOrThrow=Yt.getFromWindow=void 0;function Hs(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Yt.getFromWindow=Hs;function Pa(r){const e=Hs(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Yt.getFromWindowOrThrow=Pa;function gP(){return Pa("document")}Yt.getDocumentOrThrow=gP;function vP(){return Hs("document")}var C2=Yt.getDocument=vP;function bP(){return Pa("navigator")}Yt.getNavigatorOrThrow=bP;function mP(){return Hs("navigator")}Yt.getNavigator=mP;function yP(){return Pa("location")}Yt.getLocationOrThrow=yP;function wP(){return Hs("location")}Yt.getLocation=wP;function _P(){return Pa("crypto")}Yt.getCryptoOrThrow=_P;function AP(){return Hs("crypto")}Yt.getCrypto=AP;function EP(){return Pa("localStorage")}Yt.getLocalStorageOrThrow=EP;function xP(){return Hs("localStorage")}Yt.getLocalStorage=xP;class SP extends HS{constructor(e,t,i){super(e,t,i),this.core=e,this.logger=t,this.store=i,this.name=dI,this.verifyUrlV3=gI,this.storagePrefix=An,this.version=v2,this.init=async()=>{var s;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Me.toMiliseconds((s=this.publicKey)==null?void 0:s.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async s=>{if(!To()||this.isDevEnv)return;const a=window.location.origin,{id:f,decryptedId:l}=s,p=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${f}&decryptedId=${l}`;try{const u=C2(),b=this.startAbortTimer(Me.ONE_SECOND*5),_=await new Promise((M,I)=>{const C=()=>{window.removeEventListener("message",U),u.body.removeChild(R),I("attestation aborted")};this.abortController.signal.addEventListener("abort",C);const R=u.createElement("iframe");R.src=p,R.style.display="none",R.addEventListener("error",C,{signal:this.abortController.signal});const U=V=>
vendor: 4,492 bytes, line 44
44{if(V.data&&typeof V.data=="string")try{const F=JSON.parse(V.data);if(F.type==="verify_attestation"){if(Ml(F.attestation).payload.id!==f)return;clearInterval(b),u.body.removeChild(R),this.abortController.signal.removeEventListener("abort",C),window.removeEventListener("message",U),M(F.attestation===null?"":F.attestation)}}catch(F){this.logger.warn(F)}};u.body.appendChild(R),window.addEventListener("message",U,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",_),_}catch(u){this.logger.warn(u)}return""},this.resolve=async s=>{if(this.isDevEnv)return"";const{attestationId:a,hash:f,encryptedId:l}=s;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(Ml(a).payload.id!==l)return;const u=await this.isValidJwtAttestation(a);if(u){if(!u.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return u}}if(!f)return;const p=this.getVerifyUrl(s==null?void 0:s.verifyUrl);return this.fetchAttestation(f,p)},this.fetchAttestation=async(s,a)=>{this.logger.debug(`resolving attestation: ${s} from url: ${a}`);const f=this.startAbortTimer(Me.ONE_SECOND*5),l=await fetch(`${a}/attestation/${s}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(f),l.status===200?await l.json():void 0},this.getVerifyUrl=s=>{let a=s||Eo;return vI.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${Eo}`),a=Eo),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const s=this.startAbortTimer(Me.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(s),await a.json()}catch(s){this.logger.warn(s)}},this.persistPublicKey=async s=>{this.logger.debug("persisting public key to local storage",s),await this.store.setItem(this.storeKey,s),this.publicKey=s},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async s=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(s,a)}catch(l){this.logger.error(l),this.logger.warn("error validating attestation")}const f=await this.fetchAndPersistPublicKey();try{if(f)return this.validateAttestation(s,f)}catch(l){this.logger.error(l),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const f=await this.fetchPublicKey();f&&(await this.persistPublicKey(f),a(f))});const s=await this.fetchPromise;return this.fetchPromise=void 0,s},this.validateAttestation=(s,a)=>{const f=JE(s,a.publicKey),l={hasExpired:Me.toMiliseconds(f.exp)<Date.now(),payload:f};if(l.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:l.payload.origin,isScam:l.payload.isScam,isVerified:l.payload.isVerified}},this.logger=kr(t,this.name),this.abortController=new AbortController,this.isDevEnv=Ql(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return ni(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Me.toMiliseconds(e))}}class MP extends KS{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=bI,this.registerDeviceToken=async i=>{const{clientId:s,token:a,notificationType:f,enableEncrypted:l=!1}=i,p=`${mI}/${this.projectId}/clients`;await fetch(p,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:s,type:f,token:a,always_raw:l})})},this.logger=kr(t,this.context)}}var IP=Object.defineProperty,fv=Object.getOwnPropertySymbols,DP=Object.prototype.hasOwnProperty,PP=Object.prototype.propertyIsEnumerable,hv=(r,e,t)=>e in r?IP(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,fo=(r,e)=>{for(var t in e||(e={}))DP.call(e,t)&&hv(r,t,e[t]);if(fv)for(var t of fv(e))PP.call(e,t)&&hv(r,t,e[t]);return r};class CP extends VS{constructor(e,t,i=!0){super(e,t,i),this.core=e,this.logger=t,this.context=wI,this.storagePrefix=An,this.storageVersion=yI,this.events=new Map,this.shouldPersist=!1,this.init=async()=>
vendor: 5,637 bytes, line 44
44{if(!Ql())try{const s={eventId:j1(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:ub(this.core.relayer.protocol,this.core.relayer.version,Ul)}}};await this.sendEvent([s])}catch(s){this.logger.warn(s)}},this.createEvent=s=>{const{event:a="ERROR",type:f="",properties:{topic:l,trace:p}}=s,u=j1(),b=this.core.projectId||"",_=Date.now(),M=fo({eventId:u,timestamp:_,props:{event:a,type:f,properties:{topic:l,trace:p}},bundleId:b,domain:this.getAppDomain()},this.setMethods(u));return this.telemetryEnabled&&(this.events.set(u,M),this.shouldPersist=!0),M},this.getEvent=s=>{const{eventId:a,topic:f}=s;if(a)return this.events.get(a);const l=Array.from(this.events.values()).find(p=>p.props.properties.topic===f);if(l)return fo(fo({},l),this.setMethods(l.eventId))},this.deleteEvent=s=>{const{eventId:a}=s;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Da.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(s=>{Me.fromMiliseconds(Date.now())-Me.fromMiliseconds(s.timestamp)>_I&&(this.events.delete(s.eventId),this.shouldPersist=!0)})})},this.setMethods=s=>({addTrace:a=>this.addTrace(s,a),setError:a=>this.setError(s,a)}),this.addTrace=(s,a)=>{const f=this.events.get(s);f&&(f.props.properties.trace.push(a),this.events.set(s,f),this.shouldPersist=!0)},this.setError=(s,a)=>{const f=this.events.get(s);f&&(f.props.type=a,f.timestamp=Date.now(),this.events.set(s,f),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const s=await this.core.storage.getItem(this.storageKey)||[];if(!s.length)return;s.forEach(a=>{this.events.set(a.eventId,fo(fo({},a),this.setMethods(a.eventId)))})}catch(s){this.logger.warn(s)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const s=[];for(const[a,f]of this.events)f.props.type&&s.push(f);if(s.length!==0)try{if((await this.sendEvent(s)).ok)for(const a of s)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async s=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${AI}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Ul}${a}`,{method:"POST",body:JSON.stringify(s)})},this.getAppDomain=()=>cb().url,this.logger=kr(t,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var OP=Object.defineProperty,lv=Object.getOwnPropertySymbols,RP=Object.prototype.hasOwnProperty,NP=Object.prototype.propertyIsEnumerable,dv=(r,e,t)=>e in r?OP(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,pv=(r,e)=>{for(var t in e||(e={}))RP.call(e,t)&&dv(r,t,e[t]);if(lv)for(var t of lv(e))NP.call(e,t)&&dv(r,t,e[t]);return r};class hd extends FS{constructor(e){var t;super(e),this.protocol=g2,this.version=v2,this.name=fd,this.events=new pi.EventEmitter,this.initialized=!1,this.on=(f,l)=>this.events.on(f,l),this.once=(f,l)=>this.events.once(f,l),this.off=(f,l)=>this.events.off(f,l),this.removeListener=(f,l)=>this.events.removeListener(f,l),this.dispatchEnvelope=({topic:f,message:l,sessionExists:p})=>{if(!f||!l)return;const u={topic:f,message:l,publishedAt:Date.now(),transportType:Vt.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:p})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||m2,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Lu({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:$M.logger}),{logger:s,chunkLoggerController:a}=qS({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var f,l;(f=this.logChunkController)!=null&&f.downloadLogsBlobInBrowser&&((l=this.logChunkController)==null||l.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=kr(s,this.name),this.heartbeat=new $x,this.crypto=new WD(this,this.logger,e==null?void 0:e.keychain),this.history=new dP(this,this.logger),this.expirer=new pP(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new mS(pv(pv({},kM),e==null?void 0:e.storageOptions)),this.relayer=new cP({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new lP(this,this.logger),this.verify=new SP(this,this.logger,this.storage),this.echoClient=new MP(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new CP(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const t=new hd(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(iI,i),t}get context(){return ni(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(Yg,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
44),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Yg)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const TP=hd,O2="wc",R2=2,N2="client",ld=`${O2}@${R2}:${N2}:`,vl={name:N2,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},gv="WALLETCONNECT_DEEPLINK_CHOICE",qP="proposal",T2="Proposal expired",FP="session",ha=Me.SEVEN_DAYS,BP="engine",mr={wc_sessionPropose:{req:{ttl:Me.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Me.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Me.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Me.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Me.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Me.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Me.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Me.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Me.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Me.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Me.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Me.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Me.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Me.FIVE_MINUTES,prompt:!1,tag:1119}}},bl={min:Me.FIVE_MINUTES,max:Me.SEVEN_DAYS},cn={idle:"IDLE",active:"ACTIVE"},LP="request",UP=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],zP="wc",jP="auth",$P="authKeys",kP="pairingTopics",HP="requests",ku=`${zP}@${1.5}:${jP}:`,vu=`${ku}:PUB_KEY`;var KP=Object.defineProperty,VP=Object.defineProperties,GP=Object.getOwnPropertyDescriptors,vv=Object.getOwnPropertySymbols,WP=Object.prototype.hasOwnProperty,JP=Object.prototype.propertyIsEnumerable,bv=(r,e,t)=>e in r?KP(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,tr=(r,e)=>{for(var t in e||(e={}))WP.call(e,t)&&bv(r,t,e[t]);if(vv)for(var t of vv(e))JP.call(e,t)&&bv(r,t,e[t]);return r},Gi=(r,e)=>VP(r,GP(e));class YP extends WS{constructor(e){super(e),this.name=BP,this.events=new Gl,this.initialized=!1,this.requestQueue={state:cn.idle,queue:[]},this.sessionRequestQueue={state:cn.idle,queue:[]},this.requestQueueDelay=Me.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(mr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Me.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const i=Gi(tr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:s,requiredNamespaces:a,optionalNamespaces:f,sessionProperties:l,relays:p}=i;let u=s,b,_=!1;try{u&&(_=this.client.core.pairing.pairings.get(u).active)}catch(B){throw this.client.logger.error(`connect() -> pairing.get(${u}) failed`),B}if(!u||!_){const{topic:B,uri:j}=await this.client.core.pairing.create();u=B,b=j}if(!u){const{message:B}=Ae("NO_MATCHING_KEY",`connect() pairing topic: ${u}`);throw new Error(B)}const M=await this.client.core.crypto.generateKeyPair(),I=mr.wc_sessionPropose.req.ttl||Me.FIVE_MINUTES,C=pr(I),R=tr({requiredNamespaces:a,optionalNamespaces:f,relays:p??[{protocol:b2}],proposer:{publicKey:M,metadata:this.client.metadata},expiryTimestamp:C,pairingTopic:u},l&&{sessionProperties:l}),{reject:U,resolve:V,done:F}=Os(I,T2);this.events.once(St("session_connect"),async({error:B,session:j})=>{if(B)U(B);else if(j){j.self.publicKey=M;const q=Gi(tr({},j),{pairingTopic:R.pairingTopic,requiredNamespaces:R.requiredNamespaces,optionalNamespaces:R.optionalNamespaces,transportType:Vt.relay});await this.client.session.set(j.topic,q),await this.setExpiry(j.topic,j.expiry),u&&await this.client.core.pairing.updateMetadata({topic:u,metadata:j.peer.metadata}
44),this.cleanupDuplicatePairings(q),V(q)}});const K=await this.sendRequest({topic:u,method:"wc_sessionPropose",params:R,throwOnFailedPublish:!0});return await this.setProposal(K,tr({id:K},R)),{uri:b,approval:F}},this.pair=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async t=>{var i,s,a;const f=this.client.core.eventClient.createEvent({properties:{topic:(i=t==null?void 0:t.id)==null?void 0:i.toString(),trace:[Vi.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(L){throw f.setError(Ps.no_internet_connection),L}try{await this.isValidProposalId(t==null?void 0:t.id)}catch(L){throw this.client.logger.error(`approve() -> proposal.get(${t==null?void 0:t.id}) failed`),f.setError(Ps.proposal_not_found),L}try{await this.isValidApprove(t)}catch(L){throw this.client.logger.error("approve() -> isValidApprove() failed"),f.setError(Ps.session_approve_namespace_validation_failure),L}
44const{id:l,relayProtocol:p,namespaces:u,sessionProperties:b,sessionConfig:_}=t,M=this.client.proposal.get(l);this.client.core.eventClient.deleteEvent({eventId:f.eventId});const{pairingTopic:I,proposer:C,requiredNamespaces:R,optionalNamespaces:U}=M;let V=(s=this.client.core.eventClient)==null?void 0:s.getEvent({topic:I});V||(V=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:Vi.session_approve_started,properties:{topic:I,trace:[Vi.session_approve_started,Vi.session_namespaces_validation_success]}}));const F=await this.client.core.crypto.generateKeyPair(),K=C.publicKey,B=await this.client.core.crypto.generateSharedKey(F,K),j=tr(tr({relay:{protocol:p??"irn"},namespaces:u,controller:{publicKey:F,metadata:this.client.metadata},expiry:pr(ha)},b&&{sessionProperties:b}),_&&{sessionConfig:_}),q=Vt.relay;V.addTrace(Vi.subscribing_session_topic);try{await this.client.core.relayer.subscribe(B,{transportType:q})}catch(L){throw V.setError(Ps.subscribe_session_topic_failure),L}V.addTrace(Vi.subscribe_session_topic_success);const E=Gi(tr({},j),{topic:B,requiredNamespaces:R,optionalNamespaces:U,pairingTopic:I,acknowledged:!1,self:j.controller,peer:{publicKey:C.publicKey,metadata:C.metadata},controller:F,transportType:Vt.relay});await this.client.session.set(B,E),V.addTrace(Vi.store_session);try{V.addTrace(Vi.publishing_session_settle),await this.sendRequest({topic:B,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(L=>{throw V==null||V.setError(Ps.session_settle_publish_failure),L}),V.addTrace(Vi.session_settle_publish_success),V.addTrace(Vi.publishing_session_approve),await this.sendResult({id:l,topic:I,result:{relay:{protocol:p??"irn"},responderPublicKey:F},throwOnFailedPublish:!0}).catch(L=>{throw V==null||V.setError(Ps.session_approve_publish_failure),L}),V.addTrace(Vi.session_approve_publish_success)}catch(L){throw this.client.logger.error(L),this.client.session.delete(B,Lt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(B),L}return this.client.core.eventClient.deleteEvent({eventId:V.eventId}),await this.client.core.pairing.updateMetadata({topic:I,metadata:C.metadata}),await this.client.proposal.delete(l,Lt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:I}),await this.setExpiry(B,pr(ha)),{topic:B,acknowledged:()=>Promise.resolve(this.client.session.get(B))}},this.reject=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(f){throw this.client.logger.error("reject() -> isValidReject() failed"),f}const{id:i,reason:s}=t;let a;try{a=this.client.proposal.get(i).pairingTopic}catch(f){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),f}a&&(await this.sendError({id:i,topic:a,error:s,rpcOpts:mr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,Lt("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(_){throw this.client.logger.error("update() -> isValidUpdate() failed"),_}const{topic:i,namespaces:s}=t,{done:a,resolve:f,reject:l}=Os(),p=as(),u=Ts().toString(),b=this.client.session.get(i).namespaces;return this.events.once(St("session_update",p),({error:_})=>{_?l(_):f()}),await this.client.session.update(i,{namespaces:s}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:s},throwOnFailedPublish:!0,clientRpcId:p,relayRpcId:u}).catch(_=>{this.client.logger.error(_),this.client.session.update(i,{namespaces:b}),l(_)}),{acknowledged:a}},this.extend=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(p){throw this.client.logger.error("extend() -> isValidExtend() failed"),p}const{topic:i}=t,s=as(),{done:a,resolve:f,reject:l}=Os();return this.events.once(St("session_extend",s),({error:p})=>{p?l(p):f()}),await this.setExpiry(i,pr(ha)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:s,throwOnFailedPublish:!0}).catch(p=>{l(p)}),{acknowledged:a}},this.request=async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(C){throw this.client.logger.error("request() -> isValidRequest() failed"),C}
44const{chainId:i,request:s,topic:a,expiry:f=mr.wc_sessionRequest.req.ttl}=t,l=this.client.session.get(a);(l==null?void 0:l.transportType)===Vt.relay&&await this.confirmOnlineStateOrThrow();const p=as(),u=Ts().toString(),{done:b,resolve:_,reject:M}=Os(f,"Request expired. Please try again.");this.events.once(St("session_request",p),({error:C,result:R})=>{C?M(C):_(R)});const I=this.getAppLinkIfEnabled(l.peer.metadata,l.transportType);return I?(await this.sendRequest({clientRpcId:p,relayRpcId:u,topic:a,method:"wc_sessionRequest",params:{request:Gi(tr({},s),{expiryTimestamp:pr(f)}),chainId:i},expiry:f,throwOnFailedPublish:!0,appLink:I}).catch(C=>M(C)),this.client.events.emit("session_request_sent",{topic:a,request:s,chainId:i,id:p}),await b()):await Promise.all([new Promise(async C=>{await this.sendRequest({clientRpcId:p,relayRpcId:u,topic:a,method:"wc_sessionRequest",params:{request:Gi(tr({},s),{expiryTimestamp:pr(f)}),chainId:i},expiry:f,throwOnFailedPublish:!0}).catch(R=>M(R)),this.client.events.emit("session_request_sent",{topic:a,request:s,chainId:i,id:p}),C()}),new Promise(async C=>{var R;if(!((R=l.sessionConfig)!=null&&R.disableDeepLink)){const U=await L7(this.client.core.storage,gv);await F7({id:p,topic:a,wcDeepLink:U})}C()}),b()]).then(C=>C[2])},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:i,response:s}=t,{id:a}=s,f=this.client.session.get(i);f.transportType===Vt.relay&&await this.confirmOnlineStateOrThrow();const l=this.getAppLinkIfEnabled(f.peer.metadata,f.transportType);ln(s)?await this.sendResult({id:a,topic:i,result:s.result,throwOnFailedPublish:!0,appLink:l}):Ci(s)&&await this.sendError({id:a,topic:i,error:s.error,appLink:l}),this.cleanupAfterResponse(t)},this.ping=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(s){throw this.client.logger.error("ping() -> isValidPing() failed"),s}const{topic:i}=t;if(this.client.session.keys.includes(i)){const s=as(),a=Ts().toString(),{done:f,resolve:l,reject:p}=Os();this.events.once(St("session_ping",s),({error:u})=>{u?p(u):l()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:a}),f()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:i,event:s,chainId:a}=t,f=Ts().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:s,chainId:a},throwOnFailedPublish:!0,relayRpcId:f})},this.disconnect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:i}=t;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Lt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:s}=Ae("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(s)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(i=>lx(i,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(t,i)=>{var s;this.isInitialized(),this.isValidAuthenticate(t);const a=i&&this.client.core.linkModeSupportedApps.includes(i)&&((s=this.client.metadata.redirect)==null?void 0:s.linkMode),f=a?Vt.link_mode:Vt.relay;f===Vt.relay&&await this.confirmOnlineStateOrThrow();const{chains:l,statement:p="",uri:u,domain:b,nonce:_,type:M,exp:I,nbf:C,methods:R=[],expiry:U}=t,V=[...t.resources||[]],{topic:F,uri:K}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:f});this.client.logger.info({message:"Generated new pairing",pairing:{topic:F,uri:K}});const B=await this.client.core.crypto.generateKeyPair(),j=du(B);if(await Promise.all([this.client.auth.authKeys.set(vu,{responseTopic:j,publicKey:B}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:F})]),await this.client.core.relayer.subscribe(j,{transportType:f}),this.client.logger.info(`sending request to new pairing topic: ${F}`),R.length>0){const{namespace:D}=mo(l[0]);let x=NE(D,"request",R);lu(V)&&(x=qE(x,V.pop())),V.push(x)}const q=U&&U>
44mr.wc_sessionAuthenticate.req.ttl?U:mr.wc_sessionAuthenticate.req.ttl,E={authPayload:{type:M??"caip122",chains:l,statement:p,aud:u,domain:b,version:"1",nonce:_,iat:new Date().toISOString(),exp:I,nbf:C,resources:V},requester:{publicKey:B,metadata:this.client.metadata},expiryTimestamp:pr(q)},L={eip155:{chains:l,methods:[...new Set(["personal_sign",...R])],events:["chainChanged","accountsChanged"]}},te={requiredNamespaces:{},optionalNamespaces:L,relays:[{protocol:"irn"}],pairingTopic:F,proposer:{publicKey:B,metadata:this.client.metadata},expiryTimestamp:pr(mr.wc_sessionPropose.req.ttl)},{done:ae,resolve:z,reject:w}=Os(q,"Request expired"),c=async({error:D,session:x})=>{if(this.events.off(St("session_request",d),h),D)w(D);else if(x){x.self.publicKey=B,await this.client.session.set(x.topic,x),await this.setExpiry(x.topic,x.expiry),F&&await this.client.core.pairing.updateMetadata({topic:F,metadata:x.peer.metadata});const g=this.client.session.get(x.topic);await this.deleteProposal(y),z({session:g})}},h=async D=>{var x,g,m;if(await this.deletePendingAuthRequest(d,{message:"fulfilled",code:0}),D.error){const W=Lt("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return D.error.code===W.code?void 0:(this.events.off(St("session_connect"),c),w(D.error.message))}await this.deleteProposal(y),this.events.off(St("session_connect"),c);const{cacaos:N,responder:Q}=D.result,re=[],O=[];for(const W of N){await dg({cacao:W,projectId:this.client.core.projectId})||(this.client.logger.error(W,"Signature verification failed"),w(Lt("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:J}=W,S=lu(J.resources),G=[lg(J.iss)],oe=Su(J.iss);if(S){const ce=pg(S),fe=gg(S);
44re.push(...ce),G.push(...fe)}for(const ce of G)O.push(`${ce}:${oe}`)}const Z=await this.client.core.crypto.generateSharedKey(B,Q.publicKey);let k;re.length>0&&(k={topic:Z,acknowledged:!0,self:{publicKey:B,metadata:this.client.metadata},peer:Q,controller:Q.publicKey,expiry:pr(ha),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:F,namespaces:xg([...new Set(re)],[...new Set(O)]),transportType:f},await this.client.core.relayer.subscribe(Z,{transportType:f}),await this.client.session.set(Z,k),F&&await this.client.core.pairing.updateMetadata({topic:F,metadata:Q.metadata}),k=this.client.session.get(Z)),(x=this.client.metadata.redirect)!=null&&x.linkMode&&(g=Q.metadata.redirect)!=null&&g.linkMode&&(m=Q.metadata.redirect)!=null&&m.universal&&i&&(this.client.core.addLinkModeSupportedApp(Q.metadata.redirect.universal),this.client.session.update(Z,{transportType:Vt.link_mode})),z({auths:N,session:k})},d=as(),y=as();this.events.once(St("session_connect"),c),this.events.once(St("session_request",d),h);let A;try{if(a){const D=fs("wc_sessionAuthenticate",E,d);this.client.core.history.set(F,D);const x=await this.client.core.crypto.encode("",D,{type:Lo,encoding:so});A=eu(i,F,x)}else await Promise.all([this.sendRequest({topic:F,method:"wc_sessionAuthenticate",params:E,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:d}),this.sendRequest({topic:F,method:"wc_sessionPropose",params:te,expiry:mr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:y})])}catch(D){throw this.events.off(St("session_connect"),c),this.events.off(St("session_request",d),h),D}return await this.setProposal(y,tr({id:y},te)),await this.setAuthRequest(d,{request:Gi(tr({},E),{verifyContext:{}}),pairingTopic:F,transportType:f}),{uri:A??K,response:ae}},this.approveSessionAuthenticate=async t=>{const{id:i,auths:s}=t,a=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[Cs.authenticated_session_approve_started]}});try{this.isInitialized()}catch(U){throw a.setError(co.no_internet_connection),U}const f=this.getPendingAuthRequest(i);if(!f)throw a.setError(co.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const l=f.transportType||Vt.relay;l===Vt.relay&&await this.confirmOnlineStateOrThrow();const p=f.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),b=du(p),_={type:Hn,receiverPublicKey:p,senderPublicKey:u},M=[],I=[];for(const U of s){if(!await dg({cacao:U,projectId:this.client.core.projectId})){a.setError(co.invalid_cacao);const j=Lt("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:b,error:j,encodeOpts:_}),new Error(j.message)}a.addTrace(Cs.cacaos_verified);const{p:V}=U,F=lu(V.resources),K=[lg(V.iss)],B=Su(V.iss);if(F){const j=pg(F),q=gg(F);M.push(...j),K.push(...q)}for(const j of K)I.push(`${j}:${B}`)}const C=await this.client.core.crypto.generateSharedKey(u,p);a.addTrace(Cs.create_authenticated_session_topic);let R;if((M==null?void 0:M.length)>0){R={topic:C,acknowledged:!0,self:{publicKey:u,metadata:this.client.metadata},peer:{publicKey:p,metadata:f.requester.metadata},controller:p,expiry:pr(ha),authentication:s,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:f.pairingTopic,namespaces:xg([...new Set(M)],[...new Set(I)]),transportType:l},a.addTrace(Cs.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(C,{transportType:l})}catch(U){throw a.setError(co.subscribe_authenticated_session_topic_failure),U}a.addTrace(Cs.subscribe_authenticated_session_topic_success),await this.client.session.set(C,R),a.addTrace(Cs.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:f.pairingTopic,metadata:f.requester.metadata})}a.addTrace(Cs.publishing_authenticated_session_approve);try{await this.sendResult({topic:b,id:i,result:{cacaos:s,responder:{publicKey:u,metadata:this.client.metadata}},encodeOpts:_,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(f.requester.metadata,l)})}catch(U){throw a.setError(co.authenticated_session_approve_publish_failure),U}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:f.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:R}},this.rejectSessionAuthenticate=async t=>{this.isInitialized();const{id:i,reason:s}=t,a=this.getPendingAuthRequest(i);if(!a)throw new Error(`Could not find pending auth request with id ${i}`);a.transportType===Vt.relay&&await this.confirmOnlineStateOrThrow();const f=a.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),p=du(f),u={type:Hn,receiverPublicKey:f,senderPublicKey:l};
44await this.sendError({id:i,topic:p,error:s,encodeOpts:u,rpcOpts:mr.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Lt("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:i,iss:s}=t;return Yb(i,s)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}},50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const i=this.client.core.pairing.pairings.get(t.pairingTopic),s=this.client.core.pairing.pairings.getAll().filter(a=>{var f,l;return((f=a.peerMetadata)==null?void 0:f.url)&&((l=a.peerMetadata)==null?void 0:l.url)===t.peer.metadata.url&&a.topic&&a.topic!==i.topic});if(s.length===0)return;this.client.logger.info(`Cleaning up ${s.length} duplicate pairing(s)`),await Promise.all(s.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async t=>{var i;const{topic:s,expirerHasDeleted:a=!1,emitEvent:f=!0,id:l=0}=t,{self:p}=this.client.session.get(s);await this.client.core.relayer.unsubscribe(s),await this.client.session.delete(s,Lt("USER_DISCONNECTED")),this.addToRecentlyDeleted(s,"session"),this.client.core.crypto.keychain.has(p.publicKey)&&await this.client.core.crypto.deleteKeyPair(p.publicKey),this.client.core.crypto.keychain.has(s)&&await this.client.core.crypto.deleteSymKey(s),a||this.client.core.expirer.del(s),this.client.core.storage.removeItem(gv).catch(u=>this.client.logger.warn(u)),this.getPendingSessionRequests().forEach(u=>{u.topic===s&&this.deletePendingSessionRequest(u.id,Lt("USER_DISCONNECTED"))}),s===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=cn.idle),f&&this.client.events.emit("session_delete",{id:l,topic:s})},this.deleteProposal=async(t,i)=>{if(i)try{const s=this.client.proposal.get(t),a=this.client.core.eventClient.getEvent({topic:s.pairingTopic});a==null||a.setError(Ps.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(t,Lt("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,i,s=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,i),s?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),s&&(this.sessionRequestQueue.state=cn.idle,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,i,s=!1)=>{await Promise.all([this.client.auth.requests.delete(t,i),s?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,i)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,i),await this.client.session.update(t,{expiry:i}))},this.setProposal=async(t,i)=>{this.client.core.expirer.set(t,pr(mr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,i)},this.setAuthRequest=async(t,i)=>{const{request:s,pairingTopic:a,transportType:f=Vt.relay}=i;this.client.core.expirer.set(t,s.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:s.authPayload,requester:s.requester,expiryTimestamp:s.expiryTimestamp,id:t,pairingTopic:a,verifyContext:s.verifyContext,transportType:f})},this.setPendingSessionRequest=async t=>{const{id:i,topic:s,params:a,verifyContext:f}=t,l=a.request.expiryTimestamp||pr(mr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,l),await this.client.pendingRequest.set(i,{id:i,topic:s,params:a,verifyContext:f})},this.sendRequest=async t=>{const{topic:i,method:s,params:a,expiry:f,relayRpcId:l,clientRpcId:p,throwOnFailedPublish:u,appLink:b}=t,_=fs(s,a,p);let M;const I=!!b;try{const U=I?so:us;M=await this.client.core.crypto.encode(i,_,{encoding:U})}catch(U){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),U}let C;if(UP.includes(s)){const U=jn(JSON.stringify(_)),V=jn(M);C=await this.client.core.verify.register({id:V,decryptedId:U})}const R=mr[s].req;if(R.attestation=C,f&&(R.ttl=f),l&&(R.id=l),this.client.core.history.set(i,_),I){const U=eu(b,i,M);await global.Linking.openURL(U,this.client.name)}else{const U=mr[s].req;f&&(U.ttl=f),l&&(U.id=l),u?(U.internal=Gi(tr({},U.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,M,U)):this.client.core.relayer.publish(i,M,U).catch(V=>this.client.logger.error(V))}return _.id},this.sendResult=async t=>{const{id:i,topic:s,result:a,throwOnFailedPublish:f,encodeOpts:l,appLink:p}=t,u=Uu(i,a);let b;const _=p&&typeof(global==null?void 0:global.Linking)<"u";try{const I=_?so:us;b=await this.client.core.crypto.encode(s,u,Gi(tr({},l||{}),{encoding:I}))}catch(I){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),I}let M;try{M=await this.client.core.history.get(s,i)}catch(I){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${i}) failed`),I}if(_){const I=eu(p,s,b);await global.Linking.openURL(I,this.client.name)}else{const I=mr[M.request.method].res;f?(I.internal=Gi(tr({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,b,I)):this.client.core.relayer.publish(s,b,I).catch(C=>this.client.logger.error(C))}await this.client.core.history.resolve(u)},this.sendError=async t=>{const{id:i,topic:s,error:a,encodeOpts:f,rpcOpts:l,appLink:p}=t,u=zu(i,a);let b;const _=p&&typeof(global==null?void 0:global.Linking)<"u";try{const I=_?so:us;b=await this.client.core.crypto.encode(s,u,Gi(tr({},f||{}),{encoding:I}))}catch(I){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${s} failed`),I}let M;try{M=await this.client.core.history.get(s,i)}catch(I){throw this.client.logger.error(`sendError() -> history.get(${s}, ${i}) failed`),I}if(_){const I=eu(p,s,b);await global.Linking.openURL(I,this.client.name)}else{const I=l||mr[M.request.method].res;this.client.core.relayer.publish(s,b,I)}await this.client.core.history.resolve(u)},this.cleanup=async()=>{const t=[],i=[];
vendor: 1,150 bytes, line 44
44this.client.session.getAll().forEach(s=>{let a=!1;ns(s.expiry)&&(a=!0),this.client.core.crypto.keychain.has(s.topic)||(a=!0),a&&t.push(s.topic)}),this.client.proposal.getAll().forEach(s=>{ns(s.expiryTimestamp)&&i.push(s.id)}),await Promise.all([...t.map(s=>this.deleteSession({topic:s})),...i.map(s=>this.deleteProposal(s))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===cn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=cn.active;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=cn.idle},this.processRequest=async t=>{const{topic:i,payload:s,attestation:a,transportType:f,encryptedId:l}=t,p=s.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:p}))switch(p){case"wc_sessionPropose":return await this.onSessionProposeRequest
44({topic:i,payload:s,attestation:a,encryptedId:l});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,s);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,s);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,s);case"wc_sessionPing":return await this.onSessionPingRequest(i,s);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,s);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:s,attestation:a,encryptedId:l,transportType:f});case"wc_sessionEvent":return await this.onSessionEventRequest(i,s);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:s,attestation:a,encryptedId:l,transportType:f});default:return this.client.logger.info(`Unsupported request method ${p}`)}},this.onRelayEventResponse=async t=>{const{topic:i,payload:s,transportType:a}=t,f=(await this.client.core.history.get(i,s.id)).request.method;switch(f){case"wc_sessionPropose":return this.onSessionProposeResponse(i,s,a);case"wc_sessionSettle":return this.onSessionSettleResponse(i,s);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,s);case"wc_sessionExtend":return this.onSessionExtendResponse(i,s);case"wc_sessionPing":return this.onSessionPingResponse(i,s);case"wc_sessionRequest":return this.onSessionRequestResponse(i,s);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,s);default:return this.client.logger.info(`Unsupported response method ${f}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:i}=t,{message:s}=Ae("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(s)},this.shouldIgnorePairingRequest=t=>{const{topic:i,requestMethod:s}=t,a=this.expectedPairingMethodMap.get(i);return!a||a.includes(s)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async t=>{const{topic:i,payload:s,attestation:a,encryptedId:f}=t,{params:l,id:p}=s;try{const u=this.client.core.eventClient.getEvent({topic:i});this.isValidConnect(tr({},s.params));const b=l.expiryTimestamp||pr(mr.wc_sessionPropose.req.ttl),_=tr({id:p,pairingTopic:i,expiryTimestamp:b},l);await this.setProposal(p,_);const M=await this.getVerifyContext({attestationId:a,hash:jn(JSON.stringify(s)),encryptedId:f,metadata:_.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),u==null||u.setError(Un.proposal_listener_not_found)),u==null||u.addTrace(un.emit_session_proposal),this.client.events.emit("session_proposal",{id:p,params:_,verifyContext:M})}catch(u){await this.sendError({id:p,topic:i,error:u,rpcOpts:mr.wc_sessionPropose.autoReject}),this.client.logger.error(u)}},this.onSessionProposeResponse=async(t,i,s)=>{const{id:a}=i;if(ln(i)){const{result:f}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:f});const l=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:l});const p=l.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:p});const u=f.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:u});const b=await this.client.core.crypto.generateSharedKey(p,u);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:b});const _=await this.client.core.relayer.subscribe(b,{transportType:s});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:_}),await this.client.core.pairing.activate({topic:t})}else if(Ci(i)){await this.client.proposal.delete(a,Lt("USER_DISCONNECTED"));const f=St("session_connect");if(this.events.listenerCount(f)===0)throw new Error(`emitting ${f} without any listeners, 954`);this.events.emit(St("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(t,i)=>{const{id:s,params:a}=i;try{this.isValidSessionSettleRequest(a);const{relay:f,controller:l,expiry:p,namespaces:u,sessionProperties:b,
44sessionConfig:_}=i.params,M=Gi(tr(tr({topic:t,relay:f,expiry:p,namespaces:u,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:l.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:l.publicKey,metadata:l.metadata}},b&&{sessionProperties:b}),_&&{sessionConfig:_}),{transportType:Vt.relay}),I=St("session_connect");if(this.events.listenerCount(I)===0)throw new Error(`emitting ${I} without any listeners 997`);this.events.emit(St("session_connect"),{session:M}),await this.sendResult({id:i.id,topic:t,result:!0,throwOnFailedPublish:!0})}catch(f){await this.sendError({id:s,topic:t,error:f}),this.client.logger.error(f)}},this.onSessionSettleResponse=async(t,i)=>{const{id:s}=i;ln(i)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(St("session_approve",s),{})):Ci(i)&&(await this.client.session.delete(t,Lt("USER_DISCONNECTED")),this.events.emit(St("session_approve",s),{error:i.error}))},this.onSessionUpdateRequest=async(t,i)=>{const{params:s,id:a}=i;try{const f=`${t}_session_update`,l=ao.get(f);if(l&&this.isRequestOutOfSync(l,a)){this.client.logger.info(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:t,error:Lt("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(tr({topic:t},s));try{ao.set(f,a),await this.client.session.update(t,{namespaces:s.namespaces}),await this.sendResult({id:a,topic:t,result:!0,throwOnFailedPublish:!0})}catch(p){throw ao.delete(f),p}this.client.events.emit("session_update",{id:a,topic:t,params:s})}catch(f){await this.sendError({id:a,topic:t,error:f}),this.client.logger.error(f)}},this.isRequestOutOfSync=(t,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,i)=>{const{id:s}=i,a=St("session_update",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);ln(i)?this.events.emit(St("session_update",s),{}):Ci(i)&&this.events.emit(St("session_update",s),{error:i.error})},this.onSessionExtendRequest=async(t,i)=>{const{id:s}=i;try{this.isValidExtend({topic:t}),await this.setExpiry(t,pr(ha)),await this.sendResult({id:s,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:s,topic:t})}catch(a){await this.sendError({id:s,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,i)=>{const{id:s}=i,a=St("session_extend",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);ln(i)?this.events.emit(St("session_extend",s),{}):Ci(i)&&this.events.emit(St("session_extend",s),{error:i.error})},this.onSessionPingRequest=async(t,i)=>{const{id:s}=i;try{this.isValidPing({topic:t}),await this.sendResult({id:s,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:s,topic:t})}catch(a){await this.sendError({id:s,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(t,i)=>{const{id:s}=i,a=St("session_ping",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{ln(i)?this.events.emit(St("session_ping",s),{}):Ci(i)&&this.events.emit(St("session_ping",s),{error:i.error})},500)},this.onSessionDeleteRequest=async(t,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:t,reason:i.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(zr.publish,async()=>{a(await this.deleteSession({topic:t,id:s}))})}),this.sendResult({id:s,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:Lt("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async t=>{var i,s,a;const{topic:f,payload:l,attestation:p,encryptedId:u,transportType:b}=t,{id:_,params:M}=l;try{await this.isValidRequest(tr({topic:f},M));const I=this.client.session.get(f),C=await this.getVerifyContext({attestationId:p,hash:jn(JSON.stringify(fs("wc_sessionRequest",M,_))),encryptedId:u,metadata:I.peer.metadata,transportType:b}),R={id:_,topic:f,params:M,verifyContext:C};await this.setPendingSessionRequest(R),b===Vt.link_mode&&(i=I.peer.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp((s=I.peer.metadata.redirect)==null?void 0:s.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(R):(this.addSessionRequestToSessionRequestQueue(R),this.processSessionRequestQueue())}
vendor: 3,519 bytes, line 44
44catch(I){await this.sendError({id:_,topic:f,error:I}),this.client.logger.error(I)}},this.onSessionRequestResponse=(t,i)=>{const{id:s}=i,a=St("session_request",s);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);ln(i)?this.events.emit(St("session_request",s),{result:i.result}):Ci(i)&&this.events.emit(St("session_request",s),{error:i.error})},this.onSessionEventRequest=async(t,i)=>{const{id:s,params:a}=i;try{const f=`${t}_session_event_${a.event.name}`,l=ao.get(f);if(l&&this.isRequestOutOfSync(l,s)){this.client.logger.info(`Discarding out of sync request - ${s}`);return}this.isValidEmit(tr({topic:t},a)),this.client.events.emit("session_event",{id:s,topic:t,params:a}),ao.set(f,s)}catch(f){await this.sendError({id:s,topic:t,error:f}),this.client.logger.error(f)}},this.onSessionAuthenticateResponse=(t,i)=>{const{id:s}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:i}),ln(i)?this.events.emit(St("session_request",s),{result:i.result}):Ci(i)&&this.events.emit(St("session_request",s),{error:i.error})},this.onSessionAuthenticateRequest=async t=>{var i;const{topic:s,payload:a,attestation:f,encryptedId:l,transportType:p}=t;try{const{requester:u,authPayload:b,expiryTimestamp:_}=a.params,M=await this.getVerifyContext({attestationId:f,hash:jn(JSON.stringify(a)),encryptedId:l,metadata:u.metadata,transportType:p}),I={requester:u,pairingTopic:s,id:a.id,authPayload:b,verifyContext:M,expiryTimestamp:_};await this.setAuthRequest(a.id,{request:I,pairingTopic:s,transportType:p}),p===Vt.link_mode&&(i=u.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp(u.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:s,params:a.params,id:a.id,verifyContext:M})}catch(u){this.client.logger.error(u);const b=a.params.requester.publicKey,_=await this.client.core.crypto.generateKeyPair(),M=this.getAppLinkIfEnabled(a.params.requester.metadata,p),I={type:Hn,receiverPublicKey:b,senderPublicKey:_};await this.sendError({id:a.id,topic:s,error:u,encodeOpts:I,rpcOpts:mr.wc_sessionAuthenticate.autoReject,appLink:M})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=cn.idle,this.processSessionRequestQueue()},Me.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:i})=>{const s=this.client.core.history.pending;s.length>0&&s.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{const f=a.request.id,l=St("session_request",f);if(this.events.listenerCount(l)===0)throw new Error(`emitting ${l} without any listeners`);this.events.emit(St("session_request",a.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===cn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=cn.active,this.emitSessionRequest(t)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const i=this.client.proposal.getAll().find(s=>s.pairingTopic===t.topic);
44i&&this.onSessionProposeRequest({topic:t.topic,payload:fs("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id)})},this.isValidConnect=async t=>{if(!ei(t)){const{message:p}=Ae("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(p)}const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:f,relays:l}=t;if(ri(i)||await this.isValidPairingTopic(i),!xx(l)){const{message:p}=Ae("MISSING_OR_INVALID",`connect() relays: ${l}`);throw new Error(p)}!ri(s)&&Do(s)!==0&&this.validateNamespaces(s,"requiredNamespaces"),!ri(a)&&Do(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),ri(f)||this.validateSessionProps(f,"sessionProperties")},this.validateNamespaces=(t,i)=>{const s=Ex(t,"connect()",i);if(s)throw new Error(s.message)},this.isValidApprove=async t=>{if(!ei(t))throw new Error(Ae("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:i,namespaces:s,relayProtocol:a,sessionProperties:f}=t;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const l=this.client.proposal.get(i),p=ol(s,"approve()");if(p)throw new Error(p.message);const u=Ig(l.requiredNamespaces,s,"approve()");if(u)throw new Error(u.message);if(!or(a,!0)){const{message:b}=Ae("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(b)}ri(f)||this.validateSessionProps(f,"sessionProperties")},this.isValidReject=async t=>{if(!ei(t)){const{message:a}=Ae("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:i,reason:s}=t;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!Mx(s)){const{message:a}=Ae("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(s)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!ei(t)){const{message:u}=Ae("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(u)}const{relay:i,controller:s,namespaces:a,expiry:f}=t;if(!n2(i)){const{message:u}=Ae("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(u)}const l=bx(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);const p=ol(a,"onSessionSettleRequest()");if(p)throw new Error(p.message);if(ns(f)){const{message:u}=Ae("EXPIRED","onSessionSettleRequest()");throw new Error(u)}},this.isValidUpdate=async t=>{if(!ei(t)){const{message:p}=Ae("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(p)}const{topic:i,namespaces:s}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const a=this.client.session.get(i),f=ol(s,"update()");if(f)throw new Error(f.message);const l=Ig(a.requiredNamespaces,s,"update()");if(l)throw new Error(l.message)},this.isValidExtend=async t=>{if(!ei(t)){const{message:s}=Ae("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(s)}const{topic:i}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async t=>{if(!ei(t)){const{message:p}=Ae("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(p)}const{topic:i,request:s,chainId:a,expiry:f}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:l}=this.client.session.get(i);if(!Mg(l,a)){const{message:p}=Ae("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(p)}if(!Ix(s)){const{message:p}=Ae("MISSING_OR_INVALID",`request() ${JSON.stringify(s)}`);throw new Error(p)}if(!Cx(l,a,s.method)){const{message:p}=Ae("MISSING_OR_INVALID",`request() method: ${s.method}`);throw new Error(p)}if(f&&!Tx(f,bl)){const{message:p}=Ae("MISSING_OR_INVALID",`request() expiry: ${f}. Expiry must be a number (in seconds) between ${bl.min} and ${bl.max}`);throw new Error(p)}},this.isValidRespond=async t=>{var i;if(!ei(t)){const{message:f}=Ae("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(f)}const{topic:s,response:a}=t;try{await this.isValidSessionTopic(s)}catch(f){throw(i=t==null?void 0:t.response)!=null&&i.id&&this.cleanupAfterResponse(t),f}if(!Dx(a)){const{message:f}=Ae("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(f)}},this.isValidPing=async t=>{if(!ei(t)){const{message:s}=Ae("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(s)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async t=>{if(!ei(t)){const{message:l}=Ae("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(l)}const{topic:i,event:s,chainId:a}=t;await this.isValidSessionTopic(i);const{namespaces:f}=this.client.session.get(i);if(!Mg(f,a)){const{message:l}=Ae("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(l)}if(!Px(s)){const{message:l}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(s)}`);throw new Error(l)}if(!Ox(f,a,s.name)){const{message:l}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(s)}`);throw new Error(l)}},this.isValidDisconnect=async t=>{if(!ei(t)){const{message:s}=Ae("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(s)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=t=>{const{chains:i,uri:s,domain:a,nonce:f}=t;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!or(s,!1))throw new Error("uri is required parameter");if(!or(a,!1))throw new Error("domain is required parameter");if(!or(f,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(p=>mo(p).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:l}=mo(i[0]);if(l!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async t=>{const{attestationId:i,hash:s,encryptedId:a,metadata:f,transportType:l}=t,p={verified:{verifyUrl:f.verifyUrl||Eo,validation:"UNKNOWN",origin:f.url||""}};try{if(l===Vt.link_mode){const b=this.getAppLinkIfEnabled(f,l);return p.verified.validation=b&&new URL(b).origin===new URL(f.url).origin?"VALID":"INVALID",p}const u=await this.client.core.verify.resolve({attestationId:i,hash:s,encryptedId:a,verifyUrl:f.verifyUrl});u&&(p.verified.origin=u.origin,p.verified.isScam=u.isScam,p.verified.validation=u.origin===new URL(f.url).origin?"VALID":"INVALID")}catch(u){this.client.logger.warn(u)}return this.client.logger.debug(`Verify context: ${JSON.stringify(p)}`),p},this.validateSessionProps=(t,i)=>{Object.values(t).forEach(s=>{if(!or(s,!1)){const{message:a}=Ae("MISSING_OR_INVALID",`${i} must be in Record<string, string> format. Received: ${JSON.stringify(s)}`);throw new Error(a)}})},this.getPendingAuthRequest=t=>{const i=this.client.auth.requests.get(t);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(t,i)=>{if(this.recentlyDeletedMap.set(t,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let s=0;const a=this.recentlyDeletedLimit/2;
44for(const f of this.recentlyDeletedMap.keys()){if(s++>=a)break;this.recentlyDeletedMap.delete(f)}}},this.checkRecentlyDeleted=t=>{const i=this.recentlyDeletedMap.get(t);if(i){const{message:s}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${t}`);throw new Error(s)}},this.isLinkModeEnabled=(t,i)=>{var s,a,f,l,p,u,b,_,M;return!t||i!==Vt.link_mode?!1:((a=(s=this.client.metadata)==null?void 0:s.redirect)==null?void 0:a.linkMode)===!0&&((l=(f=this.client.metadata)==null?void 0:f.redirect)==null?void 0:l.universal)!==void 0&&((u=(p=this.client.metadata)==null?void 0:p.redirect)==null?void 0:u.universal)!==""&&((b=t==null?void 0:t.redirect)==null?void 0:b.universal)!==void 0&&((_=t==null?void 0:t.redirect)==null?void 0:_.universal)!==""&&((M=t==null?void 0:t.redirect)==null?void 0:M.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(t,i)=>{var s;return this.isLinkModeEnabled(t,i)?(s=t==null?void 0:t.redirect)==null?void 0:s.universal:void 0},this.handleLinkModeMessage=({url:t})=>{if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const i=z1(t,"topic")||"",s=decodeURIComponent(z1(t,"wc_ev")||""),a=this.client.session.keys.includes(i);a&&this.client.session.update(i,{transportType:Vt.link_mode}),this.client.core.dispatchEnvelope({topic:i,message:s,sessionExists:a})},this.registerLinkModeListeners=async()=>{var t;if(Ql()||Aa()&&(t=this.client.metadata.redirect)!=null&&t.linkMode){const i=global==null?void 0:global.Linking;if(typeof i<"u"){i.addEventListener("url",this.handleLinkModeMessage,this.client.name);const s=await i.getInitialURL();s&&setTimeout(()=>{this.handleLinkModeMessage({url:s})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(zr.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:t,message:i,attestation:s,transportType:a}=e,{publicKey:f}=this.client.auth.authKeys.keys.includes(vu)?this.client.auth.authKeys.get(vu):{responseTopic:void 0,publicKey:void 0},l=await this.client.core.crypto.decode(t,i,{receiverPublicKey:f,encoding:a===Vt.link_mode?so:us});try{ud(l)?(this.client.core.history.set(t,l),this.onRelayEventRequest({topic:t,payload:l,attestation:s,transportType:a,encryptedId:jn(i)})):ju(l)?(await this.client.core.history.resolve(l),await this.onRelayEventResponse({topic:t,payload:l,transportType:a}),this.client.core.history.delete(t,l.id)):this.onRelayEventUnknownPayload({topic:t,payload:l,transportType:a})}catch(p){this.client.logger.error(p)}}registerExpirerEvents(){this.client.core.expirer.on(Di.expired,async e=>
vendor: 3,360 bytes, line 44
44{const{topic:t,id:i}=db(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,Ae("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,Ae("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(Rs.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(Rs.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!or(e,!1)){const{message:t}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(ns(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=Ae("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!or(e,!1)){const{message:t}=Ae("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(ns(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=Ae("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=Ae("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(or(e,!1)){const{message:t}=Ae("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=Ae("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!Sx(e)){const{message:t}=Ae("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(ns(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=Ae("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class QP extends ks{constructor(e,t){super(e,t,qP,ld),this.core=e,this.logger=t}}class XP extends ks{constructor(e,t){super(e,t,FP,ld),this.core=e,this.logger=t}}class ZP extends ks{constructor(e,t){super(e,t,LP,ld,i=>i.id),this.core=e,this.logger=t}}class eC extends ks{constructor(e,t){super(e,t,$P,ku,()=>vu),this.core=e,this.logger=t}}class tC extends ks{constructor(e,t){super(e,t,kP,ku),this.core=e,this.logger=t}}class rC extends ks{constructor(e,t){super(e,t,HP,ku,i=>i.id),this.core=e,this.logger=t}}class iC{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new eC(this.core,this.logger),this.pairingTopics=new tC(this.core,this.logger),this.requests=new rC(this.core,this.logger)}
44async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class dd extends GS{constructor(e){super(e),this.protocol=O2,this.version=R2,this.name=vl.name,this.events=new pi.EventEmitter,this.on=(i,s)=>this.events.on(i,s),this.once=(i,s)=>this.events.once(i,s),this.off=(i,s)=>this.events.off(i,s),this.removeListener=(i,s)=>this.events.removeListener(i,s),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(s){throw this.logger.error(s.message),s}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(s){throw this.logger.error(s.message),s}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(s){throw this.logger.error(s.message),s}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(s){throw this.logger.error(s.message),s}},this.update=async i=>{try{return await this.engine.update(i)}catch(s){throw this.logger.error(s.message),s}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(s){throw this.logger.error(s.message),s}},this.request=async i=>{try{return await this.engine.request(i)}catch(s){throw this.logger.error(s.message),s}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(s){throw this.logger.error(s.message),s}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(s){throw this.logger.error(s.message),s}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(s){throw this.logger.error(s.message),s}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(s){throw this.logger.error(s.message),s}},this.find=i=>{try{return this.engine.find(i)}catch(s){throw this.logger.error(s.message),s}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async(i,s)=>{try{return await this.engine.authenticate(i,s)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(s){throw this.logger.error(s.message),s}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(s){throw this.logger.error(s.message),s}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(s){throw this.logger.error(s.message),s}},this.name=(e==null?void 0:e.name)||vl.name,this.metadata=(e==null?void 0:e.metadata)||cb(),this.signConfig=e==null?void 0:e.signConfig;const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:zo(Lu({level:(e==null?void 0:e.logger)||vl.logger}));this.core=(e==null?void 0:e.core)||new TP(e),this.logger=kr(t,this.name),this.session=new XP(this.core,this.logger),this.proposal=new QP(this.core,this.logger),this.pendingRequest=new ZP(this.core,this.logger),this.engine=new YP(this),this.auth=new iC(this.core,this.logger)}static async init(e){const t=new dd(e);return await t.initialize(),t}get context(){return ni(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var bo={exports:{}},nC=bo.exports,mv;function sC(){return mv||(mv=1,function(r,e){var t=typeof self<"u"?self:nC,i=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(f){var l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function p(h){return h&&DataView.prototype.isPrototypeOf(h)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
44]"],b=ArrayBuffer.isView||function(h){return h&&u.indexOf(Object.prototype.toString.call(h))>-1};function _(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function M(h){return typeof h!="string"&&(h=String(h)),h}function I(h){var d={next:function(){var y=h.shift();return{done:y===void 0,value:y}}};return l.iterable&&(d[Symbol.iterator]=function(){return d}),d}function C(h){this.map={},h instanceof C?h.forEach(function(d,y){this.append(y,d)},this):Array.isArray(h)?h.forEach(function(d){this.append(d[0],d[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(d){this.append(d,h[d])},this)}C.prototype.append=function(h,d){h=_(h),d=M(d);var y=this.map[h];this.map[h]=y?y+", "+d:d},C.prototype.delete=function(h){delete this.map[_(h)]},C.prototype.get=function(h){return h=_(h),this.has(h)?this.map[h]:null},C.prototype.has=function(h){return this.map.hasOwnProperty(_(h))},C.prototype.set=function(h,d){this.map[_(h)]=M(d)},C.prototype.forEach=function(h,d){for(var y in this.map)this.map.hasOwnProperty(y)&&h.call(d,this.map[y],y,this)},C.prototype.keys=function(){var h=[];return this.forEach(function(d,y){h.push(y)}),I(h)},C.prototype.values=function(){var h=[];return this.forEach(function(d){h.push(d)}),I(h)},C.prototype.entries=function(){var h=[];return this.forEach(function(d,y){h.push([y,d])}),I(h)},l.iterable&&(C.prototype[Symbol.iterator]=C.prototype.entries);function R(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function U(h){return new Promise(function(d,y){h.onload=function(){d(h.result)},h.onerror=function(){y(h.error)}})}function V(h){var d=new FileReader,y=U(d);return d.readAsArrayBuffer(h),y}function F(h){var d=new FileReader,y=U(d);return d.readAsText(h),y}function K(h){for(var d=new Uint8Array(h),y=new Array(d.length),A=0;A<d.length;A++)y[A]=String.fromCharCode(d[A]);return y.join("")}function B(h){if(h.slice)return h.slice(0);var d=new Uint8Array(h.byteLength);return d.set(new Uint8Array(h)),d.buffer}function j(){return this.bodyUsed=!1,this._initBody=function(h){this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:l.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:l.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():l.arrayBuffer&&l.blob&&p(h)?(this._bodyArrayBuffer=B(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||b(h))?this._bodyArrayBuffer=B(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var h=R(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?R(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(V)}),this.text=function(){var h=R(this);if(h)return h;if(this._bodyBlob)return F(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(K(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(te)}),this.json=function(){return this.text().then(JSON.parse)},this}var q=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function E(h){var d=h.toUpperCase();return q.indexOf(d)>-1?d:h}function L(h,d){d=d||{};var y=d.body;if(h instanceof L){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,d.headers||(this.headers=new C(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!y&&h._bodyInit!=null&&(y=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=d.credentials||this.credentials||"same-origin",(d.headers||!this.headers)&&(this.headers=new C(d.headers)),this.method=E(d.method||this.method||"GET"),this.mode=d.mode||this.mode||null,this.signal=d.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&y)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(y)}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function te(h){var d=new FormData;return h.trim().split("&").forEach(function(y){if(y){var A=y.split("="),D=A.shift().replace(/\+/g," "),x=A.join("=").replace(/\+/g," ");d.append(decodeURIComponent(D),decodeURIComponent(x))}}),d}function ae(h){var d=new C,y=h.replace(/\r?\n[\t ]+/g," ");
44return y.split(/\r?\n/).forEach(function(A){var D=A.split(":"),x=D.shift().trim();if(x){var g=D.join(":").trim();d.append(x,g)}}),d}j.call(L.prototype);function z(h,d){d||(d={}),this.type="default",this.status=d.status===void 0?200:d.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in d?d.statusText:"OK",this.headers=new C(d.headers),this.url=d.url||"",this._initBody(h)}j.call(z.prototype),z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new C(this.headers),url:this.url})},z.error=function(){var h=new z(null,{status:0,statusText:""});return h.type="error",h};var w=[301,302,303,307,308];z.redirect=function(h,d){if(w.indexOf(d)===-1)throw new RangeError("Invalid status code");return new z(null,{status:d,headers:{location:h}})},f.DOMException=a.DOMException;try{new f.DOMException}catch{f.DOMException=function(d,y){this.message=d,this.name=y;var A=Error(d);this.stack=A.stack},f.DOMException.prototype=Object.create(Error.prototype),f.DOMException.prototype.constructor=f.DOMException}function c(h,d){return new Promise(function(y,A){var D=new L(h,d);if(D.signal&&D.signal.aborted)return A(new f.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function g(){x.abort()}x.onload=function(){var m={status:x.status,statusText:x.statusText,headers:ae(x.getAllResponseHeaders()||"")};m.url="responseURL"in x?x.responseURL:m.headers.get("X-Request-URL");var N="response"in x?x.response:x.responseText;y(new z(N,m))},x.onerror=function(){A(new TypeError("Network request failed"))},x.ontimeout=function(){A(new TypeError("Network request failed"))},x.onabort=function(){A(new f.DOMException("Aborted","AbortError"))},x.open(D.method,D.url,!0),D.credentials==="include"?x.withCredentials=!0:D.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&l.blob&&(x.responseType="blob"),D.headers.forEach(function(m,N){x.setRequestHeader(N,m)}),D.signal&&(D.signal.addEventListener("abort",g),x.onreadystatechange=function(){x.readyState===4&&D.signal.removeEventListener("abort",g)}),x.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return c.polyfill=!0,a.fetch||(a.fetch=c,a.Headers=C,a.Request=L,a.Response=z),f.Headers=C,f.Request=L,f.Response=z,f.fetch=c,Object.defineProperty(f,"__esModule",{value:!0}),f})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=i;e=s.fetch,e.default=s.fetch,e.fetch=s.fetch,e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response,r.exports=e}(bo,bo.exports)),bo.exports}var aC=sC();const yv=Cu(aC);var oC=Object.defineProperty,cC=Object.defineProperties,uC=Object.getOwnPropertyDescriptors,wv=Object.getOwnPropertySymbols,fC=Object.prototype.hasOwnProperty,hC=Object.prototype.propertyIsEnumerable,_v=(r,e,t)=>e in r?oC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Av=(r,e)=>{for(var t in e||(e={}))fC.call(e,t)&&_v(r,t,e[t]);if(wv)for(var t of wv(e))hC.call(e,t)&&_v(r,t,e[t]);return r},Ev=(r,e)=>cC(r,uC(e));const lC={Accept:"application/json","Content-Type":"application/json"},dC="POST",xv={headers:lC,method:dC},Sv=10;class Sn{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new pi.EventEmitter,this.isAvailable=!1,this.registering=!1,!Hg(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=Kn(e),i=await(await yv(this.url,Ev(Av({},xv),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!Hg(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,s)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),s(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return s(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=Kn({id:1,jsonrpc:"2.0",method:"test",params:[]});await yv(e,Ev(Av({},xv),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;
44const t=typeof e.data=="string"?Fs(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),s=i.message||i.toString(),a=zu(e,s);this.events.emit("payload",a)}parseError(e,t=this.url){return h2(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Sv&&this.events.setMaxListeners(Sv)}}const Mv="error",pC="wss://relay.walletconnect.org",gC="wc",vC="universal_provider",Iv=`${gC}@2:${vC}:`,q2="https://rpc.walletconnect.org/v1/",pa="generic",bC=`${q2}bundler`,en={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},$l={exports:{}};/** 45* @license 46* Lodash <https://lodash.com/> 47* Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 48* Released under MIT license <https://lodash.com/license> 49* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 50* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 51*/(function(r,e){(function(){var t,i="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",l="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",u=500,b="__lodash_placeholder__",_=1,M=2,I=4,C=1,R=2,U=1,V=2,F=4,K=8,B=16,j=32,q=64,E=128,L=256,te=512,ae=30,z="...",w=800,c=16,h=1,d=2,y=3,A=1/0,D=9007199254740991,x=17976931348623157e292,g=NaN,m=4294967295,N=m-1,Q=m>>>1,re=[["ary",E],["bind",U],["bindKey",V],["curry",K],["curryRight",B],["flip",te],["partial",j],["partialRight",q],["rearg",L]],O="[object Arguments]",Z="[object Array]",k="[object AsyncFunction]",W="[object Boolean]",J="[object Date]",S="[object DOMException]",G="[object Error]",oe="[object Function]",ce="[object GeneratorFunction]",fe="[object Map]",be="[object Number]",we="[object Null]",Ie="[object Object]",Je="[object Promise]",Ce="[object Proxy]",Te="[object RegExp]",Se="[object Set]",me="[object String]",Oe="[object Symbol]",Re="[object Undefined]",ve="[object WeakMap]",Ne="[object WeakSet]",Ee="[object ArrayBuffer]",ye="[object DataView]",Le="[object Float32Array]",De="[object Float64Array]",_e="[object Int8Array]",He="[object Int16Array]",Ve="[object Int32Array]",xe="[object Uint8Array]",Ke="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ge="[object Uint32Array]",wt=/\b__p \+= '';/g,lt=/\b(__p \+=) '' \+/g,Ye=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Et=/&(?:amp|lt|gt|quot|#39);/g,Mt=/[&<>"']/g,qe=RegExp(Et.source),Xe=RegExp(Mt.source),tt=/<%-([\s\S]+?)%>/g,Fe=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Ze=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ze=/^\w*$/,ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,je=RegExp(rt.source),it=/^\s+/,st=/\s/,Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qe=/\{\n\/\* \[wrapped with (.+)\] \*/,ft=/,? & /,$e=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Rt=/[()=,{}\[\]\/\s]/,Nt=/\\(\\)?/g,at=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bt=/\w*$/,Ir=/^[-+]0x[0-9a-f]+$/i,Dr=/^0b[01]+$/i,Pr=/^\[object .+?Constructor\]$/,Cr=/^0o[0-7]+$/i,Or=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 4,123 bytes, line 51
517f]/g,Hr=/($^)/,Ni=/['\n\r\u2028\u2029\\]/g,Kr="\\ud800-\\udfff",Ti="\\u0300-\\u036f",qi="\\ufe20-\\ufe2f",Vr="\\u20d0-\\u20ff",gi=Ti+qi+Vr,vi="\\u2700-\\u27bf",fr="a-z\\xdf-\\xf6\\xf8-\\xff",Fi="\\xac\\xb1\\xd7\\xf7",Bi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Li="\\u2000-\\u206f",hs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ko="A-Z\\xc0-\\xd6\\xd8-\\xde",Ho="\\ufe0e\\ufe0f",ls=Fi+Bi+Li+hs,Ca="['â]",ds="["+Kr+"]",Oa="["+ls+"]",ps="["+gi+"]",Ko="\\d+",Hu="["+vi+"]",Vo="["+fr+"]",Go="[^"+Kr+ls+Ko+vi+fr+ko+"]",Vs="\\ud83c[\\udffb-\\udfff]",Ku="(?:"+ps+"|"+Vs+")",Wo="[^"+Kr+"]",Gs="(?:\\ud83c[\\udde6-\\uddff]){2}",Gn="[\\ud800-\\udbff][\\udc00-\\udfff]",si="["+ko+"]",Jo="\\u200d",Yo="(?:"+Vo+"|"+Go+")",tn="(?:"+si+"|"+Go+")",Qo="(?:"+Ca+"(?:d|ll|m|re|s|t|ve))?",Xo="(?:"+Ca+"(?:D|LL|M|RE|S|T|VE))?",Zo=Ku+"?",ec="["+Ho+"]?",Vu="(?:"+Jo+"(?:"+[Wo,Gs,Gn].join("|")+")"+ec+Zo+")*",Mn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rc=ec+Zo+Vu,Ws="(?:"+[Hu,Gs,Gn].join("|")+")"+rc,Gu="(?:"+[Wo+ps+"?",ps,Gs,Gn,ds].join("|")+")",Ra=RegExp(Ca,"g"),Wu=RegExp(ps,"g"),Js=RegExp(Vs+"(?="+Vs+")|"+Gu+rc,"g"),ic=RegExp([si+"?"+Vo+"+"+Qo+"(?="+[Oa,si,"$"].join("|")+")",tn+"+"+Xo+"(?="+[Oa,si+Yo,"$"].join("|")+")",si+"?"+Yo+"+"+Qo,si+"+"+Xo,tc,Mn,Ko,Ws].join("|"),"g"),nc=RegExp("["+Jo+Kr+gi+Ho+"]"),gs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,sc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ju=-1,jt={};jt[Le]=jt[De]=jt[_e]=jt[He]=jt[Ve]=jt[xe]=jt[Ke]=jt[ht]=jt[Ge]=!0,jt[O]=jt[Z]=jt[Ee]=jt[W]=jt[ye]=jt[J]=jt[G]=jt[oe]=jt[fe]=jt[be]=jt[Ie]=jt[Te]=jt[Se]=jt[me]=jt[ve]=!1;var Ut={};Ut[O]=Ut[Z]=Ut[Ee]=Ut[ye]=Ut[W]=Ut[J]=Ut[Le]=Ut[De]=Ut[_e]=Ut[He]=Ut[Ve]=Ut[fe]=Ut[be]=Ut[Ie]=Ut[Te]=Ut[Se]=Ut[me]=Ut[Oe]=Ut[xe]=Ut[Ke]=Ut[ht]=Ut[Ge]=!0,Ut[G]=Ut[oe]=Ut[ve]=!1;var Y={Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã
:"A",à :"a",á:"a",â:"a",ã:"a",ä:"a",Ã¥:"a",Ã:"C",ç:"c",Ã:"D",ð:"d",Ã:"E",Ã:"E",Ã:"E",Ã:"E",è:"e",é:"e",ê:"e",ë:"e",Ã:"I",Ã:"I",Ã:"I",Ã:"I",ì:"i",Ã:"i",î:"i",ï:"i",Ã:"N",ñ:"n",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ã:"U",Ã:"U",Ã:"U",Ã:"U",ù:"u",ú:"u",û:"u",ü:"u",Ã:"Y",ý:"y",ÿ:"y",Ã:"Ae",æ:"ae",Ã:"Th",þ:"th",Ã:"ss",Ä:"A",Ä:"A",Ä:"A",Ä:"a",Ä:"a",Ä
:"a",Ä:"C",Ä:"C",Ä:"C",Ä:"C",Ä:"c",Ä:"c",Ä:"c",Ä:"c",Ä:"D",Ä:"D",Ä:"d",Ä:"d",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"G",Ä:"G",Ä :"G",Ä¢:"G",Ä:"g",Ä:"g",Ä¡:"g",Ä£:"g",Ĥ:"H",Ħ:"H",Ä¥:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Ä®:"I",İ:"I",Ä©:"i",Ä«:"i",Ä:"i",į:"i",ı:"i",Ä´:"J",ĵ:"j",Ķ:"K",Ä·:"k",ĸ:"k",Ĺ:"L",Ä»:"L",Ľ:"L",Ä¿:"L",Å:"L",ĺ:"l",ļ:"l",ľ:"l",Å:"l",Å:"l",Å:"N",Å
:"N",Å:"N",Å:"N",Å:"n",Å:"n",Å:"n",Å:"n",Å:"O",Å:"O",Å:"O",Å:"o",Å:"o",Å:"o",Å:"R",Å:"R",Å:"R",Å:"r",Å:"r",Å:"r",Å:"S",Å:"S",Å:"S",Å :"S",Å:"s",Å:"s",Å:"s",Å¡:"s",Å¢:"T",Ť:"T",Ŧ:"T",Å£:"t",Å¥:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Å®:"U",Ű:"U",Ų:"U",Å©:"u",Å«:"u",Å:"u",ů:"u",ű:"u",ų:"u",Å´:"W",ŵ:"w",Ŷ:"Y",Å·:"y",Ÿ:"Y",Ź:"Z",Å»:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Å:"Oe",Å:"oe",Å:"'n",Å¿:"s"},ie={"&":"&","<":"<",">":">",'"':""","'":"'"},pe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ue={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=parseFloat,pt=parseInt,Wt=typeof ho=="object"&&ho&&ho.Object===Object&&ho,cr=typeof self=="object"&&self&&self.Object===Object&&self,Ct=Wt||cr||Function("return this")(),kt=e&&!e.nodeType&&e,ir=kt&&!0&&r&&!r.nodeType&&r,Gr=ir&&ir.exports===kt,ur=Gr&&Wt.process,Jt=function(){try{var ne=ir&&ir.require&&ir.require("util").t
vendor: 8,645 bytes, line 51
51ypes;return ne||ur&&ur.binding&&ur.binding("util")}catch{}}(),qr=Jt&&Jt.isArrayBuffer,Ui=Jt&&Jt.isDate,bi=Jt&&Jt.isMap,rn=Jt&&Jt.isRegExp,Na=Jt&&Jt.isSet,vs=Jt&&Jt.isTypedArray;function gr(ne,he,ue){switch(ue.length){case 0:return ne.call(he);case 1:return ne.call(he,ue[0]);case 2:return ne.call(he,ue[0],ue[1]);case 3:return ne.call(he,ue[0],ue[1],ue[2])}return ne.apply(he,ue)}function L2(ne,he,ue,ke){for(var dt=-1,Tt=ne==null?0:ne.length;++dt<Tt;){var hr=ne[dt];he(ke,hr,ue(hr),ne)}return ke}function mi(ne,he){for(var ue=-1,ke=ne==null?0:ne.length;++ue<ke&&he(ne[ue],ue,ne)!==!1;);return ne}function U2(ne,he){for(var ue=ne==null?0:ne.length;ue--&&he(ne[ue],ue,ne)!==!1;);return ne}function vd(ne,he){for(var ue=-1,ke=ne==null?0:ne.length;++ue<ke;)if(!he(ne[ue],ue,ne))return!1;return!0}function Wn(ne,he){for(var ue=-1,ke=ne==null?0:ne.length,dt=0,Tt=[];++ue<ke;){var hr=ne[ue];he(hr,ue,ne)&&(Tt[dt++]=hr)}return Tt}function ac(ne,he){var ue=ne==null?0:ne.length;return!!ue&&Ys(ne,he,0)>-1}function Yu(ne,he,ue){for(var ke=-1,dt=ne==null?0:ne.length;++ke<dt;)if(ue(he,ne[ke]))return!0;return!1}function Qt(ne,he){for(var ue=-1,ke=ne==null?0:ne.length,dt=Array(ke);++ue<ke;)dt[ue]=he(ne[ue],ue,ne);return dt}function Jn(ne,he){for(var ue=-1,ke=he.length,dt=ne.length;++ue<ke;)ne[dt+ue]=he[ue];return ne}function Qu(ne,he,ue,ke){var dt=-1,Tt=ne==null?0:ne.length;for(ke&&Tt&&(ue=ne[++dt]);++dt<Tt;)ue=he(ue,ne[dt],dt,ne);return ue}function z2(ne,he,ue,ke){var dt=ne==null?0:ne.length;for(ke&&dt&&(ue=ne[--dt]);dt--;)ue=he(ue,ne[dt],dt,ne);return ue}function Xu(ne,he){for(var ue=-1,ke=ne==null?0:ne.length;++ue<ke;)if(he(ne[ue],ue,ne))return!0;return!1}var j2=Zu("length");function $2(ne){return ne.split("")}function k2(ne){return ne.match($e)||[]}function bd(ne,he,ue){var ke;return ue(ne,function(dt,Tt,hr){if(he(dt,Tt,hr))return ke=Tt,!1}),ke}function oc(ne,he,ue,ke){for(var dt=ne.length,Tt=ue+(ke?1:-1);ke?Tt--:++Tt<dt;)if(he(ne[Tt],Tt,ne))return Tt;return-1}function Ys(ne,he,ue){return he===he?tm(ne,he,ue):oc(ne,md,ue)}function H2(ne,he,ue,ke){for(var dt=ue-1,Tt=ne.length;++dt<Tt;)if(ke(ne[dt],he))return dt;return-1}function md(ne){return ne!==ne}function yd(ne,he){var ue=ne==null?0:ne.length;return ue?tf(ne,he)/ue:g}function Zu(ne){return function(he){return he==null?t:he[ne]}}function ef(ne){return function(he){return ne==null?t:ne[he]}}function wd(ne,he,ue,ke,dt){return dt(ne,function(Tt,hr,Ht){ue=ke?(ke=!1,Tt):he(ue,Tt,hr,Ht)}),ue}function K2(ne,he){var ue=ne.length;for(ne.sort(he);ue--;)ne[ue]=ne[ue].value;return ne}function tf(ne,he){for(var ue,ke=-1,dt=ne.length;++ke<dt;){var Tt=he(ne[ke]);Tt!==t&&(ue=ue===t?Tt:ue+Tt)}return ue}function rf(ne,he){for(var ue=-1,ke=Array(ne);++ue<ne;)ke[ue]=he(ue);return ke}function V2(ne,he){return Qt(he,function(ue){return[ue,ne[ue]]})}function _d(ne){return ne&&ne.slice(0,Sd(ne)+1).replace(it,"")}function ai(ne){return function(he){return ne(he)}}function nf(ne,he){return Qt(he,function(ue){return ne[ue]})}function Ta(ne,he){return ne.has(he)}function Ad(ne,he){for(var ue=-1,ke=ne.length;++ue<ke&&Ys(he,ne[ue],0)>-1;);return ue}function Ed(ne,he){for(var ue=ne.length;ue--&&Ys(he,ne[ue],0)>-1;);return ue}function G2(ne,he){for(var ue=ne.length,ke=0;ue--;)ne[ue]===he&&++ke;return ke}var W2=ef(Y),J2=ef(ie);function Y2(ne){return"\\"+Ue[ne]}function Q2(ne,he){return ne==null?t:ne[he]}function Qs(ne){return nc.test(ne)}function X2(ne){return gs.test(ne)}function Z2(ne){for(var he,ue=[];!(he=ne.next()).done;)ue.push(he.value);return ue}function sf(ne){var he=-1,ue=Array(ne.size);return ne.forEach(function(ke,dt){ue[++he]=[dt,ke]}),ue}function xd(ne,he){return function(ue){return ne(he(ue))}}function Yn(ne,he){for(var ue=-1,ke=ne.length,dt=0,Tt=[];++ue<ke;){var hr=ne[ue];(hr===he||hr===b)&&(ne[ue]=b,Tt[dt++]=ue)}return Tt}function cc(ne){var he=-1,ue=Array(ne.size);return ne.forEach(function(ke){ue[++he]=ke}),ue}function em(ne){var he=-1,ue=Array(ne.size);return ne.forEach(function(ke){ue[++he]=[ke,ke]}),ue}function tm(ne,he,ue){for(var ke=ue-1,dt=ne.length;++ke<dt;)if(ne[ke]===he)return ke;return-1}function rm(ne,he,ue){for(var ke=ue+1;ke--;)if(ne[ke]===he)return ke;return ke}function Xs(ne){return Qs(ne)?nm(ne):j2(ne)}function zi(ne){return Qs(ne)?sm(ne):$2(ne)}function Sd(ne){for(var he=ne.length;he--&&st.test(ne.charAt(he)););return he}var im=ef(pe);function nm(ne){for(var he=Js.lastIndex=0;Js.test(ne);)++he;return he}function sm(ne){return ne.match(Js)||[]}function am(ne){return ne.match(ic)||[]}var om=function ne(he){he=he==null?Ct:Zs.defaults(Ct.Object(),he,Zs.pick(Ct,sc));var ue=he.Array,ke=he.Date,dt=he.Error,Tt=he.Function,hr=he.Math,Ht=he.Object,af=he.RegExp,cm=he.String,yi=he.TypeError,uc=ue.prototype,um=Tt.prototype,ea=Ht.prototype,fc=he["__core-js_shared__"],hc=um.toString,Bt=ea.hasOwnProperty,fm=0,Md=function(){var n=/[^.]+$/.exec(fc&&fc.keys&&fc.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),lc=ea.toString,hm=hc.call(Ht),lm=Ct._,dm=af("^"+hc.call(Bt).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dc=Gr?he.Buffer:t,Qn=he.Symbol,pc=he.Uint8Array,Id=dc?dc.allocUnsafe:t,gc=xd(Ht.getPrototypeOf,Ht),Dd=Ht.create,Pd=ea.propertyIsEnumerable,vc=uc.splice,Cd=Qn?Qn.isConcatSpreadable:t,qa=Qn?Qn.iterator:t,bs=Qn?Qn.toStringTag:t,bc=function(){try{var n=As(Ht,"defineProperty");return n({},"",{}),n}catch{}}(),pm=he.clearTimeout!==Ct.clearTimeout&&he.clearTimeout,gm=ke&&ke.now!==Ct.Date.now&&ke.now,vm=he.setTimeout!==Ct.setTimeout&&he.setTimeout,mc=hr.ceil,yc=hr.floor,of=Ht.getOwnPropertySymbols,bm=dc?dc.isBuffer:t,Od=he.isFinite,mm=uc.join,ym=xd(Ht.keys,Ht),lr=hr.max,Rr=hr.min,wm=ke.now,_m=he.parseInt,Rd=hr.random,Am=uc.reverse,cf=As(he,"DataView"),Fa=As(he,"Map"),uf=As(he,"Promise"),ta=As(he,"Set"),Ba=As(he,"WeakMap"),La=As(Ht,"create"),wc=Ba&&new Ba,ra={},Em=Es(cf),xm=Es(Fa),Sm=Es(uf),Mm=Es(ta),Im=Es(Ba),_c=Qn?Qn.prototype:t,Ua=_c?_c.valueOf:t,Nd=_c?_c.toString:t;function $(n){if(er(n)&&!gt(n)&&!(n instanceof It)){if(n instanceof wi)return n;if(Bt.call(n,"__wrapped__"))return T0(n)}return new wi(n)}var ia=function(){function n(){}return function(o){if(!Xt(o))return{};if(Dd)return Dd(o);n.prototype=o;var v=new n;return n.prototype=t,v}}();function Ac(){}function wi(n,o){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=t}$.templateSettings={escape:tt,evaluate:Fe,interpolate:et,variable:"",imports:{_:$}},$.prototype=Ac.prototype,$.prototype.constructor=$,wi.prototype=ia(Ac.prototype),wi.prototype.constructor=wi;function It(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Dm(){var n=new It(this.__wrapped__);return n.__actions__=Wr(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Wr(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Wr(this.__views__),n}function Pm(){if(this.__filtered__){var n=new It(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function Cm(){var n=this.__wrapped__.value(),o=this.__dir__,v=gt(n),P=o<0,T=v?n.length:0,H=$3(0,T,this.__views__),X=H.start,ee=H.end,se=ee-X,le=P?ee:X-1,de=this.__iteratees__,ge=de.length,Pe=0,We=Rr(se,this.__takeCount__);if(!v||!P&&T==se&&We==se)return i0(n,this.__actions__);var ot=[];e:for(;se--&&Pe<We;){le+=o;for(var yt=-1,ct=n[le];++yt<ge;){var xt=de[yt],Ot=xt.iteratee,ui=xt.type,Lr=Ot(ct);if(ui==d)ct=Lr;else if(!Lr){if(ui==h)continue e;break e}}ot[Pe++]=ct}return ot}It.prototype=ia(Ac.prototype),It.prototype.constructor=It;function ms(n){var o=-1,v=n==null?0:n.length;for(this.clear();++o<v;){var P=n[o];this.set(P[0],P[1])}}function Om(){this.__data__=La?La(null):{},this.size=0}function Rm(n){var o=this.has(n)&&delete this.__data__[n];return this.size-=o?1:0,o}function Nm(n){var o=this.__data__;if(La){var v=o[n];return v===p?t:v}return Bt.call(o,n)?o[n]:t}function Tm(n){var o=this.__data__;return La?o[n]!==t:Bt.call(o,n)}function qm(n,o){var v=this.__data__;return this.size+=this.has(n)?0:1,v[n]=La&&o===t?p:o,this}ms.prototype.clear=Om,ms.prototype.delete=Rm,ms.prototype.get=Nm,ms.prototype.has=Tm,ms.prototype.set=qm;function In(n){var o=-1,v=n==null?0:n.length;for(this.clear();++o<v;){var P=n[o];this.set(P[0],P[1])}}function Fm(){this.__data__=[],this.size=0}function Bm(n){var o=this.__data__,v=Ec(o,n);if(v<0)return!1;var P=o.length-1;return v==P?o.pop():vc.call(o,v,1),--this.size,!0}function Lm(n){var o=this.__data__,v=Ec(o,n);return v<0?t:o[v][1]}function Um(n){return Ec(this.__data__,n)>-1}function zm(n,o){var v=this.__data__,P=Ec(v,n);
vendor: 10,144 bytes, line 51
51return P<0?(++this.size,v.push([n,o])):v[P][1]=o,this}In.prototype.clear=Fm,In.prototype.delete=Bm,In.prototype.get=Lm,In.prototype.has=Um,In.prototype.set=zm;function Dn(n){var o=-1,v=n==null?0:n.length;for(this.clear();++o<v;){var P=n[o];this.set(P[0],P[1])}}function jm(){this.size=0,this.__data__={hash:new ms,map:new(Fa||In),string:new ms}}function $m(n){var o=qc(this,n).delete(n);return this.size-=o?1:0,o}function km(n){return qc(this,n).get(n)}function Hm(n){return qc(this,n).has(n)}function Km(n,o){var v=qc(this,n),P=v.size;return v.set(n,o),this.size+=v.size==P?0:1,this}Dn.prototype.clear=jm,Dn.prototype.delete=$m,Dn.prototype.get=km,Dn.prototype.has=Hm,Dn.prototype.set=Km;function ys(n){var o=-1,v=n==null?0:n.length;for(this.__data__=new Dn;++o<v;)this.add(n[o])}function Vm(n){return this.__data__.set(n,p),this}function Gm(n){return this.__data__.has(n)}ys.prototype.add=ys.prototype.push=Vm,ys.prototype.has=Gm;function ji(n){var o=this.__data__=new In(n);this.size=o.size}function Wm(){this.__data__=new In,this.size=0}function Jm(n){var o=this.__data__,v=o.delete(n);return this.size=o.size,v}function Ym(n){return this.__data__.get(n)}function Qm(n){return this.__data__.has(n)}function Xm(n,o){var v=this.__data__;if(v instanceof In){var P=v.__data__;if(!Fa||P.length<s-1)return P.push([n,o]),this.size=++v.size,this;v=this.__data__=new Dn(P)}return v.set(n,o),this.size=v.size,this}ji.prototype.clear=Wm,ji.prototype.delete=Jm,ji.prototype.get=Ym,ji.prototype.has=Qm,ji.prototype.set=Xm;function Td(n,o){var v=gt(n),P=!v&&xs(n),T=!v&&!P&&rs(n),H=!v&&!P&&!T&&oa(n),X=v||P||T||H,ee=X?rf(n.length,cm):[],se=ee.length;for(var le in n)(o||Bt.call(n,le))&&!(X&&(le=="length"||T&&(le=="offset"||le=="parent")||H&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Rn(le,se)))&&ee.push(le);return ee}function qd(n){var o=n.length;return o?n[wf(0,o-1)]:t}function Zm(n,o){return Fc(Wr(n),ws(o,0,n.length))}function e3(n){return Fc(Wr(n))}function ff(n,o,v){(v!==t&&!$i(n[o],v)||v===t&&!(o in n))&&Pn(n,o,v)}function za(n,o,v){var P=n[o];(!(Bt.call(n,o)&&$i(P,v))||v===t&&!(o in n))&&Pn(n,o,v)}function Ec(n,o){for(var v=n.length;v--;)if($i(n[v][0],o))return v;return-1}function t3(n,o,v,P){return Xn(n,function(T,H,X){o(P,T,v(T),X)}),P}function Fd(n,o){return n&&sn(o,vr(o),n)}function r3(n,o){return n&&sn(o,Yr(o),n)}function Pn(n,o,v){o=="__proto__"&&bc?bc(n,o,{configurable:!0,enumerable:!0,value:v,writable:!0}):n[o]=v}function hf(n,o){for(var v=-1,P=o.length,T=ue(P),H=n==null;++v<P;)T[v]=H?t:Kf(n,o[v]);return T}function ws(n,o,v){return n===n&&(v!==t&&(n=n<=v?n:v),o!==t&&(n=n>=o?n:o)),n}function _i(n,o,v,P,T,H){var X,ee=o&_,se=o&M,le=o&I;if(v&&(X=T?v(n,P,T,H):v(n)),X!==t)return X;if(!Xt(n))return n;var de=gt(n);if(de){if(X=H3(n),!ee)return Wr(n,X)}else{var ge=Nr(n),Pe=ge==oe||ge==ce;if(rs(n))return a0(n,ee);if(ge==Ie||ge==O||Pe&&!T){if(X=se||Pe?{}:S0(n),!ee)return se?N3(n,r3(X,n)):R3(n,Fd(X,n))}else{if(!Ut[ge])return T?n:{};X=K3(n,ge,ee)}}H||(H=new ji);var We=H.get(n);if(We)return We;H.set(n,X),ep(n)?n.forEach(function(ct){X.add(_i(ct,o,v,ct,n,H))}):X0(n)&&n.forEach(function(ct,xt){X.set(xt,_i(ct,o,v,xt,n,H))});var ot=le?se?Of:Cf:se?Yr:vr,yt=de?t:ot(n);return mi(yt||n,function(ct,xt){yt&&(xt=ct,ct=n[xt]),za(X,xt,_i(ct,o,v,xt,n,H))}),X}function i3(n){var o=vr(n);return function(v){return Bd(v,n,o)}}function Bd(n,o,v){var P=v.length;if(n==null)return!P;for(n=Ht(n);P--;){var T=v[P],H=o[T],X=n[T];if(X===t&&!(T in n)||!H(X))return!1}return!0}function Ld(n,o,v){if(typeof n!="function")throw new yi(f);return Ga(function(){n.apply(t,v)},o)}function ja(n,o,v,P){var T=-1,H=ac,X=!0,ee=n.length,se=[],le=o.length;if(!ee)return se;v&&(o=Qt(o,ai(v))),P?(H=Yu,X=!1):o.length>=s&&(H=Ta,X=!1,o=new ys(o));e:for(;++T<ee;){var de=n[T],ge=v==null?de:v(de);if(de=P||de!==0?de:0,X&&ge===ge){for(var Pe=le;Pe--;)if(o[Pe]===ge)continue e;se.push(de)}else H(o,ge,P)||se.push(de)}return se}var Xn=h0(nn),Ud=h0(df,!0);function n3(n,o){var v=!0;return Xn(n,function(P,T,H){return v=!!o(P,T,H),v}),v}function xc(n,o,v){for(var P=-1,T=n.length;++P<T;){var H=n[P],X=o(H);if(X!=null&&(ee===t?X===X&&!ci(X):v(X,ee)))var ee=X,se=H}return se}function s3(n,o,v,P){var T=n.length;for(v=mt(v),v<0&&(v=-v>T?0:T+v),P=P===t||P>T?T:mt(P),P<0&&(P+=T),P=v>P?0:rp(P);v<P;)n[v++]=o;return n}function zd(n,o){var v=[];return Xn(n,function(P,T,H){o(P,T,H)&&v.push(P)}),v}function Ar(n,o,v,P,T){var H=-1,X=n.length;for(v||(v=G3),T||(T=[]);++H<X;){var ee=n[H];o>0&&v(ee)?o>1?Ar(ee,o-1,v,P,T):Jn(T,ee):P||(T[T.length]=ee)}return T}var lf=l0(),jd=l0(!0);function nn(n,o){return n&&lf(n,o,vr)}function df(n,o){return n&&jd(n,o,vr)}function Sc(n,o){return Wn(o,function(v){return Nn(n[v])})}function _s(n,o){o=es(o,n);for(var v=0,P=o.length;n!=null&&v<P;)n=n[an(o[v++])];return v&&v==P?n:t}function $d(n,o,v){var P=o(n);return gt(n)?P:Jn(P,v(n))}function Fr(n){return n==null?n===t?Re:we:bs&&bs in Ht(n)?j3(n):ey(n)}function pf(n,o){return n>o}function a3(n,o){return n!=null&&Bt.call(n,o)}function o3(n,o){return n!=null&&o in Ht(n)}function c3(n,o,v){return n>=Rr(o,v)&&n<lr(o,v)}function gf(n,o,v){for(var P=v?Yu:ac,T=n[0].length,H=n.length,X=H,ee=ue(H),se=1/0,le=[];X--;){var de=n[X];X&&o&&(de=Qt(de,ai(o))),se=Rr(de.length,se),ee[X]=!v&&(o||T>=120&&de.length>=120)?new ys(X&&de):t}de=n[0];var ge=-1,Pe=ee[0];e:for(;++ge<T&&le.length<se;){var We=de[ge],ot=o?o(We):We;if(We=v||We!==0?We:0,!(Pe?Ta(Pe,ot):P(le,ot,v))){for(X=H;--X;){var yt=ee[X];if(!(yt?Ta(yt,ot):P(n[X],ot,v)))continue e}Pe&&Pe.push(ot),le.push(We)}}return le}function u3(n,o,v,P){return nn(n,function(T,H,X){o(P,v(T),H,X)}),P}function $a(n,o,v){o=es(o,n),n=P0(n,o);var P=n==null?n:n[an(Ei(o))];return P==null?t:gr(P,n,v)}function kd(n){return er(n)&&Fr(n)==O}function f3(n){return er(n)&&Fr(n)==Ee}function h3(n){return er(n)&&Fr(n)==J}function ka(n,o,v,P,T){return n===o?!0:n==null||o==null||!er(n)&&!er(o)?n!==n&&o!==o:l3(n,o,v,P,ka,T)}function l3(n,o,v,P,T,H){var X=gt(n),ee=gt(o),se=X?Z:Nr(n),le=ee?Z:Nr(o);se=se==O?Ie:se,le=le==O?Ie:le;var de=se==Ie,ge=le==Ie,Pe=se==le;if(Pe&&rs(n)){if(!rs(o))return!1;X=!0,de=!1}if(Pe&&!de)return H||(H=new ji),X||oa(n)?A0(n,o,v,P,T,H):U3(n,o,se,v,P,T,H);if(!(v&C)){var We=de&&Bt.call(n,"__wrapped__"),ot=ge&&Bt.call(o,"__wrapped__");if(We||ot){var yt=We?n.value():n,ct=ot?o.value():o;return H||(H=new ji),T(yt,ct,v,P,H)}}return Pe?(H||(H=new ji),z3(n,o,v,P,T,H)):!1}function d3(n){return er(n)&&Nr(n)==fe}function vf(n,o,v,P){var T=v.length,H=T,X=!P;if(n==null)return!H;for(n=Ht(n);T--;){var ee=v[T];if(X&&ee[2]?ee[1]!==n[ee[0]]:!(ee[0]in n))return!1}for(;++T<H;){ee=v[T];var se=ee[0],le=n[se],de=ee[1];if(X&&ee[2]){if(le===t&&!(se in n))return!1}else{var ge=new ji;if(P)var Pe=P(le,de,se,n,o,ge);if(!(Pe===t?ka(de,le,C|R,P,ge):Pe))return!1}}return!0}function Hd(n){if(!Xt(n)||J3(n))return!1;var o=Nn(n)?dm:Pr;return o.test(Es(n))}function p3(n){return er(n)&&Fr(n)==Te}function g3(n){return er(n)&&Nr(n)==Se}function v3(n){return er(n)&&$c(n.length)&&!!jt[Fr(n)]}function Kd(n){return typeof n=="function"?n:n==null?Qr:typeof n=="object"?gt(n)?Wd(n[0],n[1]):Gd(n):dp(n)}function bf(n){if(!Va(n))return ym(n);var o=[];for(var v in Ht(n))Bt.call(n,v)&&v!="constructor"&&o.push(v);return o}function b3(n){if(!Xt(n))return Z3(n);var o=Va(n),v=[];for(var P in n)P=="constructor"&&(o||!Bt.call(n,P))||v.push(P);return v}function mf(n,o){return n<o}function Vd(n,o){var v=-1,P=Jr(n)?ue(n.length):[];return Xn(n,function(T,H,X){P[++v]=o(T,H,X)}),P}function Gd(n){var o=Nf(n);return o.length==1&&o[0][2]?I0(o[0][0],o[0][1]):function(v){return v===n||vf(v,n,o)}}function Wd(n,o){return qf(n)&&M0(o)?I0(an(n),o):function(v){var P=Kf(v,n);return P===t&&P===o?Vf(v,n):ka(o,P,C|R)}}function Mc(n,o,v,P,T){n!==o&&lf(o,function(H,X){if(T||(T=new ji),Xt(H))m3(n,o,X,v,Mc,P,T);else{var ee=P?P(Bf(n,X),H,X+"",n,o,T):t;ee===t&&(ee=H),ff(n,X,ee)}},Yr)}function m3(n,o,v,P,T,H,X){var ee=Bf(n,v),se=Bf(o,v),le=X.get(se);if(le){ff(n,v,le);return}var de=H?H(ee,se,v+"",n,o,X):t,ge=de===t;if(ge){var Pe=gt(se),We=!Pe&&rs(se),ot=!Pe&&!We&&oa(se);de=se,Pe||We||ot?gt(ee)?de=ee:nr(ee)?de=Wr(ee):We?(ge=!1,de=a0(se,!0)):ot?(ge=!1,de=o0(se,!0)):de=[]:Wa(se)||xs(se)?(de=ee,xs(ee)?de=ip(ee):(!Xt(ee)||Nn(ee))&&(de=S0(se))):ge=!1}ge&&(X.set(se,de),T(de,se,P,H,X),X.delete(se)),ff(n,v,de)}function Jd(n,o){var v=n.length;if(v)return o+=o<0?v:0,Rn(o,v)?n[o]:t}function Yd(n,o,v){o.length?o=Qt(o,function(H){return gt(H)?function(X){return _s(X,H.length===1?H[0]:H)}:H}):o=[Qr];var P=-1;o=Qt(o,ai(nt()));var T=Vd(n,function(H,X,ee){var se=Qt(o,function(le){return le(H)});return{criteria:se,index:++P,value:H}});return K2(T,function(H,X){return O3(H,X,v)})}function y3(n,o){return Qd(n,o,function(v,P){return Vf(n,P)})}function Qd(n,o,v){for(var P=-1,T=o.length,H={};++P<T;){var X=o[P],ee=_s(n,X);v(ee,X)&&Ha(H,es(X,n),ee)}return H}function w3(n){return function(o){return _s(o,n)}}function yf(n,o,v,P){var T=P?H2:Ys,H=-1,X=o.length,ee=n;for(n===o&&(o=Wr(o)),v&&(ee=Qt(n,ai(v)));++H<X;)for(var se=0,le=o[H],de=v?v(le):le;(se=T(ee,de,se,P))>-1;)ee!==n&&vc.call(ee,se,1),vc.call(n,se,1);return n}function Xd(n,o){for(var v=n?o.length:0,P=v-1;v--;){var T=o[v];if(v==P||T!==H){var H=T;Rn(T)?vc.call(n,T,1):Ef(n,T)}}return n}function wf(n,o){return n+yc(Rd()*(o-n+1))}function _3(n,o,v,P){for(var T=-1,H=lr(mc((o-n)/(v||1)),0),X=ue(H);H--;)X[P?H:++T]=n,n+=v;return X}function _f(n,o){var v="";if(!n||o<1||o>D)return v;do o%2&&(v+=n),o=yc(o/2),o&&(n+=n);while(o);return v}function _t(n,o){return Lf(D0(n,o,Qr),n+"")}function A3(n){return qd(ca(n))}function E3(n,o){var v=ca(n);return Fc(v,ws(o,0,v.length))}function Ha(n,o,v,P){if(!Xt(n))return n;o=es(o,n);for(var T=-1,H=o.length,X=H-1,ee=n;ee!=null&&++T<H;){var se=an(o[T]),le=v;if(se==="__proto__"||se==="constructor"||se==="prototype")return n;if(T!=X){var de=ee[se];le=P?P(de,se,ee):t,le===t&&(le=Xt(de)?de:Rn(o[T+1])?[]:{})}za(ee,se,le),ee=ee[se]}return n}var Zd=wc?function(n,o){return wc.set(n,o),n}:Qr,x3=bc?function(n,o){return bc(n,"toString",{configurable:!0,enumerable:!1,value:Wf(o),writable:!0})}:Qr;function S3(n){return Fc(ca(n))}function Ai(n,o,v){var P=-1,T=n.length;o<0&&(o=-o>T?0:T+o),v=v>T?T:v,v<0&&(v+=T),T=o>
vendor: 19,601 bytes, lines 51-53
51v?0:v-o>>>0,o>>>=0;for(var H=ue(T);++P<T;)H[P]=n[P+o];return H}function M3(n,o){var v;return Xn(n,function(P,T,H){return v=o(P,T,H),!v}),!!v}function Ic(n,o,v){var P=0,T=n==null?P:n.length;if(typeof o=="number"&&o===o&&T<=Q){for(;P<T;){var H=P+T>>>1,X=n[H];X!==null&&!ci(X)&&(v?X<=o:X<o)?P=H+1:T=H}return T}return Af(n,o,Qr,v)}function Af(n,o,v,P){var T=0,H=n==null?0:n.length;if(H===0)return 0;o=v(o);for(var X=o!==o,ee=o===null,se=ci(o),le=o===t;T<H;){var de=yc((T+H)/2),ge=v(n[de]),Pe=ge!==t,We=ge===null,ot=ge===ge,yt=ci(ge);if(X)var ct=P||ot;else le?ct=ot&&(P||Pe):ee?ct=ot&&Pe&&(P||!We):se?ct=ot&&Pe&&!We&&(P||!yt):We||yt?ct=!1:ct=P?ge<=o:ge<o;ct?T=de+1:H=de}return Rr(H,N)}function e0(n,o){for(var v=-1,P=n.length,T=0,H=[];++v<P;){var X=n[v],ee=o?o(X):X;if(!v||!$i(ee,se)){var se=ee;H[T++]=X===0?0:X}}return H}function t0(n){return typeof n=="number"?n:ci(n)?g:+n}function oi(n){if(typeof n=="string")return n;if(gt(n))return Qt(n,oi)+"";if(ci(n))return Nd?Nd.call(n):"";var o=n+"";return o=="0"&&1/n==-A?"-0":o}function Zn(n,o,v){var P=-1,T=ac,H=n.length,X=!0,ee=[],se=ee;if(v)X=!1,T=Yu;else if(H>=s){var le=o?null:B3(n);if(le)return cc(le);X=!1,T=Ta,se=new ys}else se=o?[]:ee;e:for(;++P<H;){var de=n[P],ge=o?o(de):de;if(de=v||de!==0?de:0,X&&ge===ge){for(var Pe=se.length;Pe--;)if(se[Pe]===ge)continue e;o&&se.push(ge),ee.push(de)}else T(se,ge,v)||(se!==ee&&se.push(ge),ee.push(de))}return ee}function Ef(n,o){return o=es(o,n),n=P0(n,o),n==null||delete n[an(Ei(o))]}function r0(n,o,v,P){return Ha(n,o,v(_s(n,o)),P)}function Dc(n,o,v,P){for(var T=n.length,H=P?T:-1;(P?H--:++H<T)&&o(n[H],H,n););return v?Ai(n,P?0:H,P?H+1:T):Ai(n,P?H+1:0,P?T:H)}function i0(n,o){var v=n;return v instanceof It&&(v=v.value()),Qu(o,function(P,T){return T.func.apply(T.thisArg,Jn([P],T.args))},v)}function xf(n,o,v){var P=n.length;if(P<2)return P?Zn(n[0]):[];for(var T=-1,H=ue(P);++T<P;)for(var X=n[T],ee=-1;++ee<P;)ee!=T&&(H[T]=ja(H[T]||X,n[ee],o,v));return Zn(Ar(H,1),o,v)}function n0(n,o,v){for(var P=-1,T=n.length,H=o.length,X={};++P<T;){var ee=P<H?o[P]:t;v(X,n[P],ee)}return X}function Sf(n){return nr(n)?n:[]}function Mf(n){return typeof n=="function"?n:Qr}function es(n,o){return gt(n)?n:qf(n,o)?[n]:N0(qt(n))}var I3=_t;function ts(n,o,v){var P=n.length;return v=v===t?P:v,!o&&v>=P?n:Ai(n,o,v)}var s0=pm||function(n){return Ct.clearTimeout(n)};function a0(n,o){if(o)return n.slice();var v=n.length,P=Id?Id(v):new n.constructor(v);return n.copy(P),P}function If(n){var o=new n.constructor(n.byteLength);return new pc(o).set(new pc(n)),o}function D3(n,o){var v=o?If(n.buffer):n.buffer;return new n.constructor(v,n.byteOffset,n.byteLength)}function P3(n){var o=new n.constructor(n.source,bt.exec(n));return o.lastIndex=n.lastIndex,o}function C3(n){return Ua?Ht(Ua.call(n)):{}}function o0(n,o){var v=o?If(n.buffer):n.buffer;return new n.constructor(v,n.byteOffset,n.length)}function c0(n,o){if(n!==o){var v=n!==t,P=n===null,T=n===n,H=ci(n),X=o!==t,ee=o===null,se=o===o,le=ci(o);if(!ee&&!le&&!H&&n>o||H&&X&&se&&!ee&&!le||P&&X&&se||!v&&se||!T)return 1;if(!P&&!H&&!le&&n<o||le&&v&&T&&!P&&!H||ee&&v&&T||!X&&T||!se)return-1}return 0}function O3(n,o,v){for(var P=-1,T=n.criteria,H=o.criteria,X=T.length,ee=v.length;++P<X;){var se=c0(T[P],H[P]);if(se){if(P>=ee)return se;var le=v[P];return se*(le=="desc"?-1:1)}}return n.index-o.index}function u0(n,o,v,P){for(var T=-1,H=n.length,X=v.length,ee=-1,se=o.length,le=lr(H-X,0),de=ue(se+le),ge=!P;++ee<se;)de[ee]=o[ee];for(;++T<X;)(ge||T<H)&&(de[v[T]]=n[T]);for(;le--;)de[ee++]=n[T++];return de}function f0(n,o,v,P){for(var T=-1,H=n.length,X=-1,ee=v.length,se=-1,le=o.length,de=lr(H-ee,0),ge=ue(de+le),Pe=!P;++T<de;)ge[T]=n[T];for(var We=T;++se<le;)ge[We+se]=o[se];for(;++X<ee;)(Pe||T<H)&&(ge[We+v[X]]=n[T++]);return ge}function Wr(n,o){var v=-1,P=n.length;for(o||(o=ue(P));++v<P;)o[v]=n[v];return o}function sn(n,o,v,P){var T=!v;v||(v={});for(var H=-1,X=o.length;++H<X;){var ee=o[H],se=P?P(v[ee],n[ee],ee,v,n):t;se===t&&(se=n[ee]),T?Pn(v,ee,se):za(v,ee,se)}return v}function R3(n,o){return sn(n,Tf(n),o)}function N3(n,o){return sn(n,E0(n),o)}function Pc(n,o){return function(v,P){var T=gt(v)?L2:t3,H=o?o():{};return T(v,n,nt(P,2),H)}}function na(n){return _t(function(o,v){var P=-1,T=v.length,H=T>1?v[T-1]:t,X=T>2?v[2]:t;for(H=n.length>3&&typeof H=="function"?(T--,H):t,X&&Br(v[0],v[1],X)&&(H=T<3?t:H,T=1),o=Ht(o);++P<T;){var ee=v[P];ee&&n(o,ee,P,H)}return o})}function h0(n,o){return function(v,P){if(v==null)return v;if(!Jr(v))return n(v,P);for(var T=v.length,H=o?T:-1,X=Ht(v);(o?H--:++H<T)&&P(X[H],H,X)!==!1;);return v}}function l0(n){return function(o,v,P){for(var T=-1,H=Ht(o),X=P(o),ee=X.length;ee--;){var se=X[n?ee:++T];if(v(H[se],se,H)===!1)break}return o}}function T3(n,o,v){var P=o&U,T=Ka(n);function H(){var X=this&&this!==Ct&&this instanceof H?T:n;return X.apply(P?v:this,arguments)}return H}function d0(n){return function(o){o=qt(o);var v=Qs(o)?zi(o):t,P=v?v[0]:o.charAt(0),T=v?ts(v,1).join(""):o.slice(1);return P[n]()+T}}function sa(n){return function(o){return Qu(hp(fp(o).replace(Ra,"")),n,"")}}function Ka(n){return function(){var o=arguments;switch(o.length){case 0:return new n;case 1:return new n(o[0]);case 2:return new n(o[0],o[1]);case 3:return new n(o[0],o[1],o[2]);case 4:return new n(o[0],o[1],o[2],o[3]);case 5:return new n(o[0],o[1],o[2],o[3],o[4]);case 6:return new n(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new n(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var v=ia(n.prototype),P=n.apply(v,o);return Xt(P)?P:v}}function q3(n,o,v){var P=Ka(n);function T(){for(var H=arguments.length,X=ue(H),ee=H,se=aa(T);ee--;)X[ee]=arguments[ee];var le=H<3&&X[0]!==se&&X[H-1]!==se?[]:Yn(X,se);if(H-=le.length,H<v)return m0(n,o,Cc,T.placeholder,t,X,le,t,t,v-H);var de=this&&this!==Ct&&this instanceof T?P:n;return gr(de,this,X)}return T}function p0(n){return function(o,v,P){var T=Ht(o);if(!Jr(o)){var H=nt(v,3);o=vr(o),v=function(ee){return H(T[ee],ee,T)}}var X=n(o,v,P);return X>-1?T[H?o[X]:X]:t}}function g0(n){return On(function(o){var v=o.length,P=v,T=wi.prototype.thru;for(n&&o.reverse();P--;){var H=o[P];if(typeof H!="function")throw new yi(f);if(T&&!X&&Tc(H)=="wrapper")var X=new wi([],!0)}for(P=X?P:v;++P<v;){H=o[P];var ee=Tc(H),se=ee=="wrapper"?Rf(H):t;se&&Ff(se[0])&&se[1]==(E|K|j|L)&&!se[4].length&&se[9]==1?X=X[Tc(se[0])].apply(X,se[3]):X=H.length==1&&Ff(H)?X[ee]():X.thru(H)}return function(){var le=arguments,de=le[0];if(X&&le.length==1&>(de))return X.plant(de).value();for(var ge=0,Pe=v?o[ge].apply(this,le):de;++ge<v;)Pe=o[ge].call(this,Pe);return Pe}})}function Cc(n,o,v,P,T,H,X,ee,se,le){var de=o&E,ge=o&U,Pe=o&V,We=o&(K|B),ot=o&te,yt=Pe?t:Ka(n);function ct(){for(var xt=arguments.length,Ot=ue(xt),ui=xt;ui--;)Ot[ui]=arguments[ui];if(We)var Lr=aa(ct),fi=G2(Ot,Lr);if(P&&(Ot=u0(Ot,P,T,We)),H&&(Ot=f0(Ot,H,X,We)),xt-=fi,We&&xt<le){var sr=Yn(Ot,Lr);return m0(n,o,Cc,ct.placeholder,v,Ot,sr,ee,se,le-xt)}var ki=ge?v:this,qn=Pe?ki[n]:n;return xt=Ot.length,ee?Ot=ty(Ot,ee):ot&&xt>1&&Ot.reverse(),de&&se<xt&&(Ot.length=se),this&&this!==Ct&&this instanceof ct&&(qn=yt||Ka(qn)),qn.apply(ki,Ot)}return ct}function v0(n,o){return function(v,P){return u3(v,n,o(P),{})}}function Oc(n,o){return function(v,P){var T;if(v===t&&P===t)return o;if(v!==t&&(T=v),P!==t){if(T===t)return P;typeof v=="string"||typeof P=="string"?(v=oi(v),P=oi(P)):(v=t0(v),P=t0(P)),T=n(v,P)}return T}}function Df(n){return On(function(o){return o=Qt(o,ai(nt())),_t(function(v){var P=this;return n(o,function(T){return gr(T,P,v)})})})}function Rc(n,o){o=o===t?" ":oi(o);var v=o.length;if(v<2)return v?_f(o,n):o;var P=_f(o,mc(n/Xs(o)));return Qs(o)?ts(zi(P),0,n).join(""):P.slice(0,n)}function F3(n,o,v,P){var T=o&U,H=Ka(n);function X(){for(var ee=-1,se=arguments.length,le=-1,de=P.length,ge=ue(de+se),Pe=this&&this!==Ct&&this instanceof X?H:n;++le<de;)ge[le]=P[le];for(;se--;)ge[le++]=arguments[++ee];return gr(Pe,T?v:this,ge)}return X}function b0(n){return function(o,v,P){return P&&typeof P!="number"&&Br(o,v,P)&&(v=P=t),o=Tn(o),v===t?(v=o,o=0):v=Tn(v),P=P===t?o<v?1:-1:Tn(P),_3(o,v,P,n)}}function Nc(n){return function(o,v){return typeof o=="string"&&typeof v=="string"||(o=xi(o),v=xi(v)),n(o,v)}}function m0(n,o,v,P,T,H,X,ee,se,le){var de=o&K,ge=de?X:t,Pe=de?t:X,We=de?H:t,ot=de?t:H;o|=de?j:q,o&=~(de?q:j),o&F||(o&=~(U|V));var yt=[n,o,T,We,ge,ot,Pe,ee,se,le],ct=v.apply(t,yt);return Ff(n)&&C0(ct,yt),ct.placeholder=P,O0(ct,n,o)}function Pf(n){var o=hr[n];return function(v,P){if(v=xi(v),P=P==null?0:Rr(mt(P),292),P&&Od(v)){var T=(qt(v)+"e").split("e"),H=o(T[0]+"e"+(+T[1]+P));return T=(qt(H)+"e").split("e"),+(T[0]+"e"+(+T[1]-P))}return o(v)}}var B3=ta&&1/cc(new ta([,-0]))[1]==A?function(n){return new ta(n)}:Qf;function y0(n){return function(o){var v=Nr(o);return v==fe?sf(o):v==Se?em(o):V2(o,n(o))}}function Cn(n,o,v,P,T,H,X,ee){var se=o&V;if(!se&&typeof n!="function")throw new yi(f);var le=P?P.length:0;if(le||(o&=~(j|q),P=T=t),X=X===t?X:lr(mt(X),0),ee=ee===t?ee:mt(ee),le-=T?T.length:0,o&q){var de=P,ge=T;P=T=t}var Pe=se?t:Rf(n),We=[n,o,v,P,T,de,ge,H,X,ee];if(Pe&&X3(We,Pe),n=We[0],o=We[1],v=We[2],P=We[3],T=We[4],ee=We[9]=We[9]===t?se?0:n.length:lr(We[9]-le,0),!ee&&o&(K|B)&&(o&=~(K|B)),!o||o==U)var ot=T3(n,o,v);else o==K||o==B?ot=q3(n,o,ee):(o==j||o==(U|j))&&!T.length?ot=F3(n,o,v,P):ot=Cc.apply(t,We);var yt=Pe?Zd:C0;return O0(yt(ot,We),n,o)}function w0(n,o,v,P){return n===t||$i(n,ea[v])&&!Bt.call(P,v)?o:n}function _0(n,o,v,P,T,H){return Xt(n)&&Xt(o)&&(H.set(o,n),Mc(n,o,t,_0,H),H.delete(o)),n}function L3(n){return Wa(n)?t:n}function A0(n,o,v,P,T,H){var X=v&C,ee=n.length,se=o.length;if(ee!=se&&!(X&&se>ee))return!1;var le=H.get(n),de=H.get(o);if(le&&de)return le==o&&de==n;var ge=-1,Pe=!0,We=v&R?new ys:t;for(H.set(n,o),H.set(o,n);++ge<ee;){var ot=n[ge],yt=o[ge];if(P)var ct=X?P(yt,ot,ge,o,n,H):P(ot,yt,ge,n,o,H);if(ct!==t){if(ct)continue;Pe=!1;break}if(We){if(!Xu(o,function(xt,Ot){if(!Ta(We,Ot)&&(ot===xt||T(ot,xt,v,P,H)))return We.push(Ot)})){Pe=!1;break}}else if(!(ot===yt||T(ot,yt,v,P,H))){Pe=!1;break}}return H.delete(n),H.delete(o),Pe}function U3(n,o,v,P,T,H,X){switch(v){case ye:if(n.byteLength!=o.byteLength||n.byteOffset!=o.byteOffset)return!1;n=n.buffer,o=o.buffer;case Ee:return!(n.byteLength!=o.byteLength||!H(new pc(n),new pc(o)));case W:case J:case be:return $i(+n,+o);case G:return n.name==o.name&&n.message==o.message;case Te:case me:return n==o+"";case fe:var ee=sf;case Se:var se=P&C;if(ee||(ee=cc),n.size!=o.size&&!se)return!1;var le=X.get(n);if(le)return le==o;P|=R,X.set(n,o);var de=A0(ee(n),ee(o),P,T,H,X);return X.delete(n),de;case Oe:if(Ua)return Ua.call(n)==Ua.call(o)}return!1}function z3(n,o,v,P,T,H){var X=v&C,ee=Cf(n),se=ee.length,le=Cf(o),de=le.length;if(se!=de&&!X)return!1;for(var ge=se;ge--;){var Pe=ee[ge];if(!(X?Pe in o:Bt.call(o,Pe)))return!1}var We=H.get(n),ot=H.get(o);if(We&&ot)return We==o&&ot==n;var yt=!0;H.set(n,o),H.set(o,n);for(var ct=X;++ge<se;){Pe=ee[ge];var xt=n[Pe],Ot=o[Pe];if(P)var ui=X?P(Ot,xt,Pe,o,n,H):P(xt,Ot,Pe,n,o,H);if(!(ui===t?xt===Ot||T(xt,Ot,v,P,H):ui)){yt=!1;break}ct||(ct=Pe=="constructor")}if(yt&&!ct){var Lr=n.constructor,fi=o.constructor;Lr!=fi&&"constructor"in n&&"constructor"in o&&!(typeof Lr=="function"&&Lr instanceof Lr&&typeof fi=="function"&&fi instanceof fi)&&(yt=!1)}return H.delete(n),H.delete(o),yt}function On(n){return Lf(D0(n,t,B0),n+"")}function Cf(n){return $d(n,vr,Tf)}function Of(n){return $d(n,Yr,E0)}var Rf=wc?function(n){return wc.get(n)}:Qf;function Tc(n){for(var o=n.name+"",v=ra[o],P=Bt.call(ra,o)?v.length:0;P--;){var T=v[P],H=T.func;if(H==null||H==n)return T.name}return o}function aa(n){var o=Bt.call($,"placeholder")?$:n;return o.placeholder}function nt(){var n=$.iteratee||Jf;return n=n===Jf?Kd:n,arguments.length?n(arguments[0],arguments[1]):n}function qc(n,o){var v=n.__data__;return W3(o)?v[typeof o=="string"?"string":"hash"]:v.map}function Nf(n){for(var o=vr(n),v=o.length;v--;){var P=o[v],T=n[P];o[v]=[P,T,M0(T)]}return o}function As(n,o){var v=Q2(n,o);return Hd(v)?v:t}function j3(n){var o=Bt.call(n,bs),v=n[bs];try{n[bs]=t;var P=!0}catch{}var T=lc.call(n);return P&&(o?n[bs]=v:delete n[bs]),T}var Tf=of?function(n){return n==null?[]:(n=Ht(n),Wn(of(n),function(o){return Pd.call(n,o)}))}:Xf,E0=of?function(n){for(var o=[];n;)Jn(o,Tf(n)),n=gc(n);return o}:Xf,Nr=Fr;(cf&&Nr(new cf(new ArrayBuffer(1)))!=ye||Fa&&Nr(new Fa)!=fe||uf&&Nr(uf.resolve())!=Je||ta&&Nr(new ta)!=Se||Ba&&Nr(new Ba)!=ve)&&(Nr=function(n){var o=Fr(n),v=o==Ie?n.constructor:t,P=v?Es(v):"";if(P)switch(P){case Em:return ye;case xm:return fe;case Sm:return Je;case Mm:return Se;case Im:return ve}return o});function $3(n,o,v){for(var P=-1,T=v.length;++P<T;){var H=v[P],X=H.size;switch(H.type){case"drop":n+=X;break;case"dropRight":o-=X;break;case"take":o=Rr(o,n+X);break;case"takeRight":n=lr(n,o-X);break}}return{start:n,end:o}}function k3(n){var o=n.match(Qe);return o?o[1].split(ft):[]}function x0(n,o,v){o=es(o,n);for(var P=-1,T=o.length,H=!1;++P<T;){var X=an(o[P]);if(!(H=n!=null&&v(n,X)))break;n=n[X]}return H||++P!=T?H:(T=n==null?0:n.length,!!T&&$c(T)&&Rn(X,T)&&(gt(n)||xs(n)))}function H3(n){var o=n.length,v=new n.constructor(o);return o&&typeof n[0]=="string"&&Bt.call(n,"index")&&(v.index=n.index,v.input=n.input),v}function S0(n){return typeof n.constructor=="function"&&!Va(n)?ia(gc(n)):{}}function K3(n,o,v){var P=n.constructor;switch(o){case Ee:return If(n);case W:case J:return new P(+n);case ye:return D3(n,v);case Le:case De:case _e:case He:case Ve:case xe:case Ke:case ht:case Ge:return o0(n,v);case fe:return new P;case be:case me:return new P(n);case Te:return P3(n);case Se:return new P;case Oe:return C3(n)}}function V3(n,o){var v=o.length;if(!v)return n;var P=v-1;return o[P]=(v>1?"& ":"")+o[P],o=o.join(v>2?", ":" "),n.replace(Be,`{ 52/* [wrapped with `+o+`] */ 53`)}function G3(n){return gt(n)||xs(n)||!!(Cd&&n&&n[Cd])}function Rn(n,o){var v=typeof n;return o=o??D,!!o&&(v=="number"||v!="symbol"&&Or.test(n))&&n>-1&&n%1==0&&n<o}function Br(n,o,v){if(!Xt(v))return!1;var P=typeof o;return(P=="number"?Jr(v)&&Rn(o,v.length):P=="string"&&o in v)?$i(v[o],n):!1}function qf(n,o){if(gt(n))return!1;var v=typeof n;return v=="number"||v=="symbol"||v=="boolean"||n==null||ci(n)?!0:ze.test(n)||!Ze.test(n)||o!=null&&n in Ht(o)}function W3(n){var o=typeof n;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?n!=="__proto__":n===null}function Ff(n){var o=Tc(n),v=$[o];if(typeof v!="function"||!(o in It.prototype))return!1;if(n===v)return!0;var P=Rf(v);return!!P&&n===P[0]}function J3(n){return!!Md&&Md in n}var Y3=fc?Nn:Zf;function Va(n){var o=n&&n.constructor,v=typeof o=="function"&&o.prototype||ea;return n===v}function M0(n){return n===n&&!Xt(n)}function I0(n,o){return function(v){return v==null?!1:v[n]===o&&(o!==t||n in Ht(v))}}function Q3(n){var o=zc(n,function(P){return v.size===u&&v.clear(),P}),v=o.cache;return o}function X3(n,o){var v=n[1],P=o[1],T=v|P,H=T<(U|V|E),X=P==E&&v==K||P==E&&v==L&&n[7].length<=o[8]||P==(E|L)&&o[7].length<=o[8]&&v==K;if(!(H||X))return n;P&U&&(n[2]=o[2],T|=v&U?0:F);var ee=o[3];if(ee){var se=n[3];n[3]=se?u0(se,ee,o[4]):ee,n[4]=se?Yn(n[3],b):o[4]}return ee=o[5],ee&&(se=n[5],n[5]=se?f0(se,ee,o[6]):ee,n[6]=se?Yn(n[5],b):o[6]),ee=o[7],ee&&(n[7]=ee),P&E&&(n[8]=n[8]==null?o[8]:Rr(n[8],o[8])),n[9]==null&&(n[9]=o[9]),n[0]=o[0],n[1]=T,n}function Z3(n){var o=[];if(n!=null)for(var v in Ht(n))o.push(v);return o}function ey(n){return lc.call(n)}function D0(n,o,v){return o=lr(o===t?n.length-1:o,0),function(){for(var P=arguments,T=-1,H=lr(P.length-o,0),X=ue(H);++T<H;)X[T]=P[o+T];T=-1;for(var ee=ue(o+1);++T<o;)ee[T]=P[T];return ee[o]=v(X),gr(n,this,ee)}}function P0(n,o){return o.length<2?n:_s(n,Ai(o,0,-1))}function ty(n,o){for(var v=n.length,P=Rr(o.length,v),T=Wr(n);P--;){var H=o[P];n[P]=Rn(H,v)?T[H]:t}return n}function Bf(n,o){if(!(o==="constructor"&&typeof n[o]=="function")&&o!="__proto__")return n[o]}var C0=R0(Zd),Ga=vm||function(n,o){return Ct.setTimeout(n,o)},Lf=R0(x3);function O0(n,o,v){var P=o+"";return Lf(n,V3(P,ry(k3(P),v)))}function R0(n){var o=0,v=0;return function(){var P=wm(),T=c-(P-v);if(v=P,T>0){if(++o>=w)return arguments[0]}else o=0;return n.apply(t,arguments)}}function Fc(n,o){var v=-1,P=n.length,T=P-1;for(o=o===t?P:o;++v<o;){var H=wf(v,T),X=n[H];n[H]=n[v],n[v]=X}return n.length=o,n}var N0=Q3(function(n){var o=[];return n.charCodeAt(0)===46&&o.push(""),n.replace(ut,function(v,P,T,H){o.push(T?H.replace(Nt,"$1"):P||v)}),o});function an(n){if(typeof n=="string"||ci(n))return n;var o=n+"";return o=="0"&&1/n==-A?"-0":o}function Es(n){if(n!=null){try{return hc.call(n)}catch{}try{return n+""}catch{}}return""}function ry(n,o){return mi(re,function(v){var P="_."+v[0];o&v[1]&&!ac(n,P)&&n.push(P)}),n.sort()}function T0(n){if(n instanceof It)return n.clone();var o=new wi(n.__wrapped__,n.__chain__);return o.__actions__=Wr(n.__actions__),o.__index__=n.__index__,o.__values__=n.__values__,o}function iy(n,o,v){(v?Br(n,o,v):o===t)?o=1:o=lr(mt(o),0);var P=n==null?0:n.length;if(!P||o<1)return[];for(var T=0,H=0,X=ue(mc(P/o));T<P;)X[H++]=Ai(n,T,T+=o);return X}function ny(n){for(var o=-1,v=n==null?0:n.length,P=0,T=[];++o<v;){var H=n[o];H&&(T[P++]=H)}return T}function sy(){var n=arguments.length;if(!n)return[];for(var o=ue(n-1),v=arguments[0],P=n;P--;)o[P-1]=arguments[P];return Jn(gt(v)?Wr(v):[v],Ar(o,1))}var ay=_t(function(n,o){return nr(n)?ja(n,Ar(o,1,nr,!0)):[]}),oy=_t(function(n,o){var v=Ei(o);return nr(v)&&(v=t),nr(n)?ja(n,Ar(o,1,nr,!0),nt(v,2)):[]}),cy=_t(function(n,o){var v=Ei(o);return nr(v)&&(v=t),nr(n)?ja(n,Ar(o,1,nr,!0),t,v):[]});function uy(n,o,v){var P=n==null?0:n.length;return P?(o=v||o===t?1:mt(o),Ai(n,o<0?0:o,P)):[]}function fy(n,o,v){var P=n==null?0:n.length;return P?(o=v||o===t?1:mt(o),o=P-o,Ai(n,0,o<0?0:o)):[]}function hy(n,o){return n&&n.length?Dc(n,nt(o,3),!0,!0):[]}function ly(n,o){return n&&n.length?Dc(n,nt(o,3),!0):[]}function dy(n,o,v,P){var T=n==null?0:n.length;return T?(v&&typeof v!="number"&&Br(n,o,v)&&(v=0,P=T),s3(n,o,v,P)):[]}function q0(n,o,v){var P=n==null?0:n.length;if(!P)return-1;var T=v==null?0:mt(v);return T<0&&(T=lr(P+T,0)),oc(n,nt(o,3),T)}function F0(n,o,v){var P=n==null?0:n.length;if(!P)return-1;var T=P-1;return v!==t&&(T=mt(v),T=v<0?lr(P+T,0):Rr(T,P-1)),oc(n,nt(o,3),T,!0)}function B0(n){var o=n==null?0:n.length;return o?Ar(n,1):[]}function py(n){var o=n==null?0:n.length;return o?Ar(n,A):[]}function gy(n,o){var v=n==null?0:n.length;return v?(o=o===t?1:mt(o),Ar(n,o)):[]}function vy(n){for(var o=-1,v=n==null?0:n.length,P={};++o<v;){var T=n[o];P[T[0]]=T[1]}return P}function L0(n){return n&&n.length?n[0]:t}function by(n,o,v){var P=n==null?0:n.length;if(!P)return-1;var T=v==null?0:mt(v);return T<0&&(T=lr(P+T,0)),Ys(n,o,T)}function my(n){var o=n==null?0:n.length;return o?Ai(n,0,-1):[]}var yy=_t(function(n){var o=Qt(n,Sf);return o.length&&o[0]===n[0]?gf(o):[]}),wy=_t(function(n){var o=Ei(n),v=Qt(n,Sf);return o===Ei(v)?o=t:v.pop(),v.length&&v[0]===n[0]?gf(v,nt(o,2)):[]}),_y=_t(function(n){var o=Ei(n),v=Qt(n,Sf);return o=typeof o=="function"?o:t,o&&v.pop(),v.length&&v[0]===n[0]?gf(v,t,o):[]});function Ay(n,o){return n==null?"":mm.call(n,o)}function Ei(n){var o=n==null?0:n.length;return o?n[o-1]:t}function Ey(n,o,v){var P=n==null?0:n.length;if(!P)return-1;var T=P;return v!==t&&(T=mt(v),T=T<0?lr(P+T,0):Rr(T,P-1)),o===o?rm(n,o,T):oc(n,md,T,!0)}function xy(n,o){return n&&n.length?Jd(n,mt(o)):t}var Sy=_t(U0);function U0(n,o){return n&&n.length&&o&&o.length?yf(n,o):n}function My(n,o,v){return n&&n.length&&o&&o.length?yf(n,o,nt(v,2)):n}function Iy(n,o,v){return n&&n.length&&o&&o.length?yf(n,o,t,v):n}var Dy=On(function(n,o){var v=n==null?0:n.length,P=hf(n,o);return Xd(n,Qt(o,function(T){return Rn(T,v)?+T:T}).sort(c0)),P});function Py(n,o){var v=[];
vendor: 5,843 bytes, line 53
53if(!(n&&n.length))return v;var P=-1,T=[],H=n.length;for(o=nt(o,3);++P<H;){var X=n[P];o(X,P,n)&&(v.push(X),T.push(P))}return Xd(n,T),v}function Uf(n){return n==null?n:Am.call(n)}function Cy(n,o,v){var P=n==null?0:n.length;return P?(v&&typeof v!="number"&&Br(n,o,v)?(o=0,v=P):(o=o==null?0:mt(o),v=v===t?P:mt(v)),Ai(n,o,v)):[]}function Oy(n,o){return Ic(n,o)}function Ry(n,o,v){return Af(n,o,nt(v,2))}function Ny(n,o){var v=n==null?0:n.length;if(v){var P=Ic(n,o);if(P<v&&$i(n[P],o))return P}return-1}function Ty(n,o){return Ic(n,o,!0)}function qy(n,o,v){return Af(n,o,nt(v,2),!0)}function Fy(n,o){var v=n==null?0:n.length;if(v){var P=Ic(n,o,!0)-1;if($i(n[P],o))return P}return-1}function By(n){return n&&n.length?e0(n):[]}function Ly(n,o){return n&&n.length?e0(n,nt(o,2)):[]}function Uy(n){var o=n==null?0:n.length;return o?Ai(n,1,o):[]}function zy(n,o,v){return n&&n.length?(o=v||o===t?1:mt(o),Ai(n,0,o<0?0:o)):[]}function jy(n,o,v){var P=n==null?0:n.length;return P?(o=v||o===t?1:mt(o),o=P-o,Ai(n,o<0?0:o,P)):[]}function $y(n,o){return n&&n.length?Dc(n,nt(o,3),!1,!0):[]}function ky(n,o){return n&&n.length?Dc(n,nt(o,3)):[]}var Hy=_t(function(n){return Zn(Ar(n,1,nr,!0))}),Ky=_t(function(n){var o=Ei(n);return nr(o)&&(o=t),Zn(Ar(n,1,nr,!0),nt(o,2))}),Vy=_t(function(n){var o=Ei(n);return o=typeof o=="function"?o:t,Zn(Ar(n,1,nr,!0),t,o)});function Gy(n){return n&&n.length?Zn(n):[]}function Wy(n,o){return n&&n.length?Zn(n,nt(o,2)):[]}function Jy(n,o){return o=typeof o=="function"?o:t,n&&n.length?Zn(n,t,o):[]}function zf(n){if(!(n&&n.length))return[];var o=0;return n=Wn(n,function(v){if(nr(v))return o=lr(v.length,o),!0}),rf(o,function(v){return Qt(n,Zu(v))})}function z0(n,o){if(!(n&&n.length))return[];var v=zf(n);return o==null?v:Qt(v,function(P){return gr(o,t,P)})}var Yy=_t(function(n,o){return nr(n)?ja(n,o):[]}),Qy=_t(function(n){return xf(Wn(n,nr))}),Xy=_t(function(n){var o=Ei(n);return nr(o)&&(o=t),xf(Wn(n,nr),nt(o,2))}),Zy=_t(function(n){var o=Ei(n);return o=typeof o=="function"?o:t,xf(Wn(n,nr),t,o)}),e6=_t(zf);function t6(n,o){return n0(n||[],o||[],za)}function r6(n,o){return n0(n||[],o||[],Ha)}var i6=_t(function(n){var o=n.length,v=o>1?n[o-1]:t;return v=typeof v=="function"?(n.pop(),v):t,z0(n,v)});function j0(n){var o=$(n);return o.__chain__=!0,o}function n6(n,o){return o(n),n}function Bc(n,o){return o(n)}var s6=On(function(n){var o=n.length,v=o?n[0]:0,P=this.__wrapped__,T=function(H){return hf(H,n)};return o>1||this.__actions__.length||!(P instanceof It)||!Rn(v)?this.thru(T):(P=P.slice(v,+v+(o?1:0)),P.__actions__.push({func:Bc,args:[T],thisArg:t}),new wi(P,this.__chain__).thru(function(H){return o&&!H.length&&H.push(t),H}))});function a6(){return j0(this)}function o6(){return new wi(this.value(),this.__chain__)}function c6(){this.__values__===t&&(this.__values__=tp(this.value()));var n=this.__index__>=this.__values__.length,o=n?t:this.__values__[this.__index__++];return{done:n,value:o}}function u6(){return this}function f6(n){for(var o,v=this;v instanceof Ac;){var P=T0(v);P.__index__=0,P.__values__=t,o?T.__wrapped__=P:o=P;var T=P;v=v.__wrapped__}return T.__wrapped__=n,o}function h6(){var n=this.__wrapped__;if(n instanceof It){var o=n;return this.__actions__.length&&(o=new It(this)),o=o.reverse(),o.__actions__.push({func:Bc,args:[Uf],thisArg:t}),new wi(o,this.__chain__)}return this.thru(Uf)}function l6(){return i0(this.__wrapped__,this.__actions__)}var d6=Pc(function(n,o,v){Bt.call(n,v)?++n[v]:Pn(n,v,1)});function p6(n,o,v){var P=gt(n)?vd:n3;return v&&Br(n,o,v)&&(o=t),P(n,nt(o,3))}function g6(n,o){var v=gt(n)?Wn:zd;return v(n,nt(o,3))}var v6=p0(q0),b6=p0(F0);function m6(n,o){return Ar(Lc(n,o),1)}function y6(n,o){return Ar(Lc(n,o),A)}function w6(n,o,v){return v=v===t?1:mt(v),Ar(Lc(n,o),v)}function $0(n,o){var v=gt(n)?mi:Xn;return v(n,nt(o,3))}function k0(n,o){var v=gt(n)?U2:Ud;return v(n,nt(o,3))}var _6=Pc(function(n,o,v){Bt.call(n,v)?n[v].push(o):Pn(n,v,[o])});function A6(n,o,v,P){n=Jr(n)?n:ca(n),v=v&&!P?mt(v):0;var T=n.length;return v<0&&(v=lr(T+v,0)),kc(n)?v<=T&&n.indexOf(o,v)>-1:!!T&&Ys(n,o,v)>-1}var E6=_t(function(n,o,v){var P=-1,T=typeof o=="function",H=Jr(n)?ue(n.length):[];return Xn(n,function(X){H[++P]=T?gr(o,X,v):$a(X,o,v)}),H}),x6=Pc(function(n,o,v){Pn(n,v,o)});function Lc(n,o){var v=gt(n)?Qt:Vd;return v(n,nt(o,3))}function S6(n,o,v,P){return n==null?[]:(gt(o)||(o=o==null?[]:[o]),v=P?t:v,gt(v)||(v=v==null?[]:[v]),Yd(n,o,v))}var M6=Pc(function(n,o,v){n[v?0:1].push(o)},function(){return[[],[]]});function I6(n,o,v){var P=gt(n)?Qu:wd,T=arguments.length<3;return P(n,nt(o,4),v,T,Xn)}function D6(n,o,v){var P=gt(n)?z2:wd,T=arguments.length<3;return P(n,nt(o,4),v,T,Ud)}function P6(n,o){var v=gt(n)?Wn:zd;return v(n,jc(nt(o,3)))}function C6(n){var o=gt(n)?qd:A3;return o(n)}function O6(n,o,v){(v?Br(n,o,v):o===t)?o=1:o=mt(o);var P=gt(n)?Zm:E3;return P(n,o)}function R6(n){var o=gt(n)?e3:S3;return o(n)}function N6(n){if(n==null)return 0;if(Jr(n))return kc(n)?Xs(n):n.length;var o=Nr(n);return o==fe||o==Se?n.size:bf(n).length}function T6(n,o,v){var P=gt(n)?Xu:M3;return v&&Br(n,o,v)&&(o=t),P(n,nt(o,3))}var q6=_t(function(n,o){if(n==null)return[];var v=o.length;return v>1&&Br(n,o[0],o[1])?o=[]:v>2&&Br(o[0],o[1],o[2])&&(o=[o[0]]),Yd(n,Ar(o,1),[])}),Uc=gm||function(){return Ct.Date.now()};function F6(n,o){if(typeof o!="function")throw new yi(f);return n=mt(n),function(){if(--n<1)return o.apply(this,arguments)}}function H0(n,o,v){return o=v?t:o,o=n&&o==null?n.length:o,Cn(n,E,t,t,t,t,o)}function K0(n,o){var v;if(typeof o!="function")throw new yi(f);return n=mt(n),function(){return--n>0&&(v=o.apply(this,arguments)),n<=1&&(o=t),v}}var jf=_t(function(n,o,v){var P=U;if(v.length){var T=Yn(v,aa(jf));P|=j}return Cn(n,P,o,v,T)}),V0=_t(function(n,o,v){var P=U|V;if(v.length){var T=Yn(v,aa(V0));P|=j}return Cn(o,P,n,v,T)});function G0(n,o,v){o=v?t:o;var P=Cn(n,K,t,t,t,t,t,o);
vendor: 10,429 bytes, line 53
53return P.placeholder=G0.placeholder,P}function W0(n,o,v){o=v?t:o;var P=Cn(n,B,t,t,t,t,t,o);return P.placeholder=W0.placeholder,P}function J0(n,o,v){var P,T,H,X,ee,se,le=0,de=!1,ge=!1,Pe=!0;if(typeof n!="function")throw new yi(f);o=xi(o)||0,Xt(v)&&(de=!!v.leading,ge="maxWait"in v,H=ge?lr(xi(v.maxWait)||0,o):H,Pe="trailing"in v?!!v.trailing:Pe);function We(sr){var ki=P,qn=T;return P=T=t,le=sr,X=n.apply(qn,ki),X}function ot(sr){return le=sr,ee=Ga(xt,o),de?We(sr):X}function yt(sr){var ki=sr-se,qn=sr-le,pp=o-ki;return ge?Rr(pp,H-qn):pp}function ct(sr){var ki=sr-se,qn=sr-le;return se===t||ki>=o||ki<0||ge&&qn>=H}function xt(){var sr=Uc();if(ct(sr))return Ot(sr);ee=Ga(xt,yt(sr))}function Ot(sr){return ee=t,Pe&&P?We(sr):(P=T=t,X)}function ui(){ee!==t&&s0(ee),le=0,P=se=T=ee=t}function Lr(){return ee===t?X:Ot(Uc())}function fi(){var sr=Uc(),ki=ct(sr);if(P=arguments,T=this,se=sr,ki){if(ee===t)return ot(se);if(ge)return s0(ee),ee=Ga(xt,o),We(se)}return ee===t&&(ee=Ga(xt,o)),X}return fi.cancel=ui,fi.flush=Lr,fi}var B6=_t(function(n,o){return Ld(n,1,o)}),L6=_t(function(n,o,v){return Ld(n,xi(o)||0,v)});function U6(n){return Cn(n,te)}function zc(n,o){if(typeof n!="function"||o!=null&&typeof o!="function")throw new yi(f);var v=function(){var P=arguments,T=o?o.apply(this,P):P[0],H=v.cache;if(H.has(T))return H.get(T);var X=n.apply(this,P);return v.cache=H.set(T,X)||H,X};return v.cache=new(zc.Cache||Dn),v}zc.Cache=Dn;function jc(n){if(typeof n!="function")throw new yi(f);return function(){var o=arguments;switch(o.length){case 0:return!n.call(this);case 1:return!n.call(this,o[0]);case 2:return!n.call(this,o[0],o[1]);case 3:return!n.call(this,o[0],o[1],o[2])}return!n.apply(this,o)}}function z6(n){return K0(2,n)}var j6=I3(function(n,o){o=o.length==1&>(o[0])?Qt(o[0],ai(nt())):Qt(Ar(o,1),ai(nt()));var v=o.length;return _t(function(P){for(var T=-1,H=Rr(P.length,v);++T<H;)P[T]=o[T].call(this,P[T]);return gr(n,this,P)})}),$f=_t(function(n,o){var v=Yn(o,aa($f));return Cn(n,j,t,o,v)}),Y0=_t(function(n,o){var v=Yn(o,aa(Y0));return Cn(n,q,t,o,v)}),$6=On(function(n,o){return Cn(n,L,t,t,t,o)});function k6(n,o){if(typeof n!="function")throw new yi(f);return o=o===t?o:mt(o),_t(n,o)}function H6(n,o){if(typeof n!="function")throw new yi(f);return o=o==null?0:lr(mt(o),0),_t(function(v){var P=v[o],T=ts(v,0,o);return P&&Jn(T,P),gr(n,this,T)})}function K6(n,o,v){var P=!0,T=!0;if(typeof n!="function")throw new yi(f);return Xt(v)&&(P="leading"in v?!!v.leading:P,T="trailing"in v?!!v.trailing:T),J0(n,o,{leading:P,maxWait:o,trailing:T})}function V6(n){return H0(n,1)}function G6(n,o){return $f(Mf(o),n)}function W6(){if(!arguments.length)return[];var n=arguments[0];return gt(n)?n:[n]}function J6(n){return _i(n,I)}function Y6(n,o){return o=typeof o=="function"?o:t,_i(n,I,o)}function Q6(n){return _i(n,_|I)}function X6(n,o){return o=typeof o=="function"?o:t,_i(n,_|I,o)}function Z6(n,o){return o==null||Bd(n,o,vr(o))}function $i(n,o){return n===o||n!==n&&o!==o}var ew=Nc(pf),tw=Nc(function(n,o){return n>=o}),xs=kd(function(){return arguments}())?kd:function(n){return er(n)&&Bt.call(n,"callee")&&!Pd.call(n,"callee")},gt=ue.isArray,rw=qr?ai(qr):f3;function Jr(n){return n!=null&&$c(n.length)&&!Nn(n)}function nr(n){return er(n)&&Jr(n)}function iw(n){return n===!0||n===!1||er(n)&&Fr(n)==W}var rs=bm||Zf,nw=Ui?ai(Ui):h3;function sw(n){return er(n)&&n.nodeType===1&&!Wa(n)}function aw(n){if(n==null)return!0;if(Jr(n)&&(gt(n)||typeof n=="string"||typeof n.splice=="function"||rs(n)||oa(n)||xs(n)))return!n.length;var o=Nr(n);if(o==fe||o==Se)return!n.size;if(Va(n))return!bf(n).length;for(var v in n)if(Bt.call(n,v))return!1;return!0}function ow(n,o){return ka(n,o)}function cw(n,o,v){v=typeof v=="function"?v:t;var P=v?v(n,o):t;return P===t?ka(n,o,t,v):!!P}function kf(n){if(!er(n))return!1;var o=Fr(n);return o==G||o==S||typeof n.message=="string"&&typeof n.name=="string"&&!Wa(n)}function uw(n){return typeof n=="number"&&Od(n)}function Nn(n){if(!Xt(n))return!1;var o=Fr(n);return o==oe||o==ce||o==k||o==Ce}function Q0(n){return typeof n=="number"&&n==mt(n)}function $c(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=D}function Xt(n){var o=typeof n;return n!=null&&(o=="object"||o=="function")}function er(n){return n!=null&&typeof n=="object"}var X0=bi?ai(bi):d3;function fw(n,o){return n===o||vf(n,o,Nf(o))}function hw(n,o,v){return v=typeof v=="function"?v:t,vf(n,o,Nf(o),v)}function lw(n){return Z0(n)&&n!=+n}function dw(n){if(Y3(n))throw new dt(a);return Hd(n)}function pw(n){return n===null}function gw(n){return n==null}function Z0(n){return typeof n=="number"||er(n)&&Fr(n)==be}function Wa(n){if(!er(n)||Fr(n)!=Ie)return!1;var o=gc(n);if(o===null)return!0;var v=Bt.call(o,"constructor")&&o.constructor;return typeof v=="function"&&v instanceof v&&hc.call(v)==hm}var Hf=rn?ai(rn):p3;function vw(n){return Q0(n)&&n>=-D&&n<=D}var ep=Na?ai(Na):g3;function kc(n){return typeof n=="string"||!gt(n)&&er(n)&&Fr(n)==me}function ci(n){return typeof n=="symbol"||er(n)&&Fr(n)==Oe}var oa=vs?ai(vs):v3;function bw(n){return n===t}function mw(n){return er(n)&&Nr(n)==ve}function yw(n){return er(n)&&Fr(n)==Ne}var ww=Nc(mf),_w=Nc(function(n,o){return n<=o});function tp(n){if(!n)return[];if(Jr(n))return kc(n)?zi(n):Wr(n);if(qa&&n[qa])return Z2(n[qa]());var o=Nr(n),v=o==fe?sf:o==Se?cc:ca;return v(n)}function Tn(n){if(!n)return n===0?n:0;if(n=xi(n),n===A||n===-A){var o=n<0?-1:1;return o*x}return n===n?n:0}function mt(n){var o=Tn(n),v=o%1;return o===o?v?o-v:o:0}function rp(n){return n?ws(mt(n),0,m):0}function xi(n){if(typeof n=="number")return n;if(ci(n))return g;if(Xt(n)){var o=typeof n.valueOf=="function"?n.valueOf():n;n=Xt(o)?o+"":o}if(typeof n!="string")return n===0?n:+n;n=_d(n);var v=Dr.test(n);return v||Cr.test(n)?pt(n.slice(2),v?2:8):Ir.test(n)?g:+n}function ip(n){return sn(n,Yr(n))}function Aw(n){return n?ws(mt(n),-D,D):n===0?n:0}function qt(n){return n==null?"":oi(n)}var Ew=na(function(n,o){if(Va(o)||Jr(o)){sn(o,vr(o),n);return}for(var v in o)Bt.call(o,v)&&za(n,v,o[v])}),np=na(function(n,o){sn(o,Yr(o),n)}),Hc=na(function(n,o,v,P){sn(o,Yr(o),n,P)}),xw=na(function(n,o,v,P){sn(o,vr(o),n,P)}),Sw=On(hf);function Mw(n,o){var v=ia(n);return o==null?v:Fd(v,o)}var Iw=_t(function(n,o){n=Ht(n);var v=-1,P=o.length,T=P>2?o[2]:t;for(T&&Br(o[0],o[1],T)&&(P=1);++v<P;)for(var H=o[v],X=Yr(H),ee=-1,se=X.length;++ee<se;){var le=X[ee],de=n[le];(de===t||$i(de,ea[le])&&!Bt.call(n,le))&&(n[le]=H[le])}return n}),Dw=_t(function(n){return n.push(t,_0),gr(sp,t,n)});function Pw(n,o){return bd(n,nt(o,3),nn)}function Cw(n,o){return bd(n,nt(o,3),df)}function Ow(n,o){return n==null?n:lf(n,nt(o,3),Yr)}function Rw(n,o){return n==null?n:jd(n,nt(o,3),Yr)}function Nw(n,o){return n&&nn(n,nt(o,3))}function Tw(n,o){return n&&df(n,nt(o,3))}function qw(n){return n==null?[]:Sc(n,vr(n))}function Fw(n){return n==null?[]:Sc(n,Yr(n))}function Kf(n,o,v){var P=n==null?t:_s(n,o);return P===t?v:P}function Bw(n,o){return n!=null&&x0(n,o,a3)}function Vf(n,o){return n!=null&&x0(n,o,o3)}var Lw=v0(function(n,o,v){o!=null&&typeof o.toString!="function"&&(o=lc.call(o)),n[o]=v},Wf(Qr)),Uw=v0(function(n,o,v){o!=null&&typeof o.toString!="function"&&(o=lc.call(o)),Bt.call(n,o)?n[o].push(v):n[o]=[v]},nt),zw=_t($a);function vr(n){return Jr(n)?Td(n):bf(n)}function Yr(n){return Jr(n)?Td(n,!0):b3(n)}function jw(n,o){var v={};return o=nt(o,3),nn(n,function(P,T,H){Pn(v,o(P,T,H),P)}),v}function $w(n,o){var v={};return o=nt(o,3),nn(n,function(P,T,H){Pn(v,T,o(P,T,H))}),v}var kw=na(function(n,o,v){Mc(n,o,v)}),sp=na(function(n,o,v,P){Mc(n,o,v,P)}),Hw=On(function(n,o){var v={};if(n==null)return v;var P=!1;o=Qt(o,function(H){return H=es(H,n),P||(P=H.length>1),H}),sn(n,Of(n),v),P&&(v=_i(v,_|M|I,L3));for(var T=o.length;T--;)Ef(v,o[T]);return v});function Kw(n,o){return ap(n,jc(nt(o)))}var Vw=On(function(n,o){return n==null?{}:y3(n,o)});function ap(n,o){if(n==null)return{};var v=Qt(Of(n),function(P){return[P]});return o=nt(o),Qd(n,v,function(P,T){return o(P,T[0])})}function Gw(n,o,v){o=es(o,n);var P=-1,T=o.length;for(T||(T=1,n=t);++P<T;){var H=n==null?t:n[an(o[P])];H===t&&(P=T,H=v),n=Nn(H)?H.call(n):H}return n}function Ww(n,o,v){return n==null?n:Ha(n,o,v)}function Jw(n,o,v,P){return P=typeof P=="function"?P:t,n==null?n:Ha(n,o,v,P)}var op=y0(vr),cp=y0(Yr);function Yw(n,o,v){var P=gt(n),T=P||rs(n)||oa(n);if(o=nt(o,4),v==null){var H=n&&n.constructor;T?v=P?new H:[]:Xt(n)?v=Nn(H)?ia(gc(n)):{}:v={}}return(T?mi:nn)(n,function(X,ee,se){return o(v,X,ee,se)}),v}function Qw(n,o){return n==null?!0:Ef(n,o)}function Xw(n,o,v){return n==null?n:r0(n,o,Mf(v))}function Zw(n,o,v,P){return P=typeof P=="function"?P:t,n==null?n:r0(n,o,Mf(v),P)}function ca(n){return n==null?[]:nf(n,vr(n))}function e5(n){return n==null?[]:nf(n,Yr(n))}function t5(n,o,v){return v===t&&(v=o,o=t),v!==t&&(v=xi(v),v=v===v?v:0),o!==t&&(o=xi(o),o=o===o?o:0),ws(xi(n),o,v)}function r5(n,o,v){return o=Tn(o),v===t?(v=o,o=0):v=Tn(v),n=xi(n),c3(n,o,v)}function i5(n,o,v){if(v&&typeof v!="boolean"&&Br(n,o,v)&&(o=v=t),v===t&&(typeof o=="boolean"?(v=o,o=t):typeof n=="boolean"&&(v=n,n=t)),n===t&&o===t?(n=0,o=1):(n=Tn(n),o===t?(o=n,n=0):o=Tn(o)),n>o){var P=n;n=o,o=P}if(v||n%1||o%1){var T=Rd();return Rr(n+T*(o-n+$t("1e-"+((T+"").length-1))),o)}return wf(n,o)}var n5=sa(function(n,o,v){return o=o.toLowerCase(),n+(v?up(o):o)});function up(n){return Gf(qt(n).toLowerCase())}function fp(n){return n=qt(n),n&&n.replace(Zt,W2).replace(Wu,"")}function s5(n,o,v){n=qt(n),o=oi(o);var P=n.length;v=v===t?P:ws(mt(v),0,P);var T=v;return v-=o.length,v>=0&&n.slice(v,T)==o}function a5(n){return n=qt(n),n&&Xe.test(n)?n.replace(Mt,J2):n}function o5(n){return n=qt(n),n&&je.test(n)?n.replace(rt,"\\$&"):n}var c5=sa(function(n,o,v){return n+(v?"-":"")+o.toLowerCase()}),u5=sa(function(n,o,v){return n+(v?" ":"")+o.toLowerCase()}),f5=d0("toLowerCase");function h5(n,o,v){n=qt(n),o=mt(o);var P=o?Xs(n):0;if(!o||P>=o)return n;var T=(o-P)/2;return Rc(yc(T),v)+n+Rc(mc(T),v)}function l5(n,o,v){n=qt(n),o=mt(o);var P=o?Xs(n):0;return o&&P<o?n+Rc(o-P,v):n}function d5(n,o,v){n=qt(n),o=mt(o);var P=o?Xs(n):0;return o&&P<o?Rc(o-P,v)+n:n}function p5(n,o,v){return v||o==null?o=0:o&&(o=+o),_m(qt(n).replace(it,""),o||0)}function g5(n,o,v){return(v?Br(n,o,v):o===t)?o=1:o=mt(o),_f(qt(n),o)}function v5(){var n=arguments,o=qt(n[0]);return n.length<3?o:o.replace(n[1],n[2])}var b5=sa(function(n,o,v){return n+(v?"_":"")+o.toLowerCase()});function m5(n,o,v){return v&&typeof v!="number"&&Br(n,o,v)&&(o=v=t),v=v===t?m:v>>>
vendor: 12,670 bytes, lines 53-70
530,v?(n=qt(n),n&&(typeof o=="string"||o!=null&&!Hf(o))&&(o=oi(o),!o&&Qs(n))?ts(zi(n),0,v):n.split(o,v)):[]}var y5=sa(function(n,o,v){return n+(v?" ":"")+Gf(o)});function w5(n,o,v){return n=qt(n),v=v==null?0:ws(mt(v),0,n.length),o=oi(o),n.slice(v,v+o.length)==o}function _5(n,o,v){var P=$.templateSettings;v&&Br(n,o,v)&&(o=t),n=qt(n),o=Hc({},o,P,w0);var T=Hc({},o.imports,P.imports,w0),H=vr(T),X=nf(T,H),ee,se,le=0,de=o.interpolate||Hr,ge="__p += '",Pe=af((o.escape||Hr).source+"|"+de.source+"|"+(de===et?at:Hr).source+"|"+(o.evaluate||Hr).source+"|$","g"),We="//# sourceURL="+(Bt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ju+"]")+` 54`;n.replace(Pe,function(ct,xt,Ot,ui,Lr,fi){return Ot||(Ot=ui),ge+=n.slice(le,fi).replace(Ni,Y2),xt&&(ee=!0,ge+=`' + 55__e(`+xt+`) + 56'`),Lr&&(se=!0,ge+=`'; 57`+Lr+`; 58__p += '`),Ot&&(ge+=`' + 59((__t = (`+Ot+`)) == null ? '' : __t) + 60'`),le=fi+ct.length,ct}),ge+=`'; 61`;var ot=Bt.call(o,"variable")&&o.variable;if(!ot)ge=`with (obj) { 62`+ge+` 63} 64`;else if(Rt.test(ot))throw new dt(l);ge=(se?ge.replace(wt,""):ge).replace(lt,"$1").replace(Ye,"$1;"),ge="function("+(ot||"obj")+`) { 65`+(ot?"":`obj || (obj = {}); 66`)+"var __t, __p = ''"+(ee?", __e = _.escape":"")+(se?`, __j = Array.prototype.join; 67function print() { __p += __j.call(arguments, '') } 68`:`; 69`)+ge+`return __p 70}`;var yt=lp(function(){return Tt(H,We+"return "+ge).apply(t,X)});if(yt.source=ge,kf(yt))throw yt;return yt}function A5(n){return qt(n).toLowerCase()}function E5(n){return qt(n).toUpperCase()}function x5(n,o,v){if(n=qt(n),n&&(v||o===t))return _d(n);if(!n||!(o=oi(o)))return n;var P=zi(n),T=zi(o),H=Ad(P,T),X=Ed(P,T)+1;return ts(P,H,X).join("")}function S5(n,o,v){if(n=qt(n),n&&(v||o===t))return n.slice(0,Sd(n)+1);if(!n||!(o=oi(o)))return n;var P=zi(n),T=Ed(P,zi(o))+1;return ts(P,0,T).join("")}function M5(n,o,v){if(n=qt(n),n&&(v||o===t))return n.replace(it,"");if(!n||!(o=oi(o)))return n;var P=zi(n),T=Ad(P,zi(o));return ts(P,T).join("")}function I5(n,o){var v=ae,P=z;if(Xt(o)){var T="separator"in o?o.separator:T;v="length"in o?mt(o.length):v,P="omission"in o?oi(o.omission):P}n=qt(n);var H=n.length;if(Qs(n)){var X=zi(n);H=X.length}if(v>=H)return n;var ee=v-Xs(P);if(ee<1)return P;var se=X?ts(X,0,ee).join(""):n.slice(0,ee);if(T===t)return se+P;if(X&&(ee+=se.length-ee),Hf(T)){if(n.slice(ee).search(T)){var le,de=se;for(T.global||(T=af(T.source,qt(bt.exec(T))+"g")),T.lastIndex=0;le=T.exec(de);)var ge=le.index;se=se.slice(0,ge===t?ee:ge)}}else if(n.indexOf(oi(T),ee)!=ee){var Pe=se.lastIndexOf(T);Pe>-1&&(se=se.slice(0,Pe))}return se+P}function D5(n){return n=qt(n),n&&qe.test(n)?n.replace(Et,im):n}var P5=sa(function(n,o,v){return n+(v?" ":"")+o.toUpperCase()}),Gf=d0("toUpperCase");function hp(n,o,v){return n=qt(n),o=v?t:o,o===t?X2(n)?am(n):k2(n):n.match(o)||[]}var lp=_t(function(n,o){try{return gr(n,t,o)}catch(v){return kf(v)?v:new dt(v)}}),C5=On(function(n,o){return mi(o,function(v){v=an(v),Pn(n,v,jf(n[v],n))}),n});function O5(n){var o=n==null?0:n.length,v=nt();return n=o?Qt(n,function(P){if(typeof P[1]!="function")throw new yi(f);return[v(P[0]),P[1]]}):[],_t(function(P){for(var T=-1;++T<o;){var H=n[T];if(gr(H[0],this,P))return gr(H[1],this,P)}})}function R5(n){return i3(_i(n,_))}function Wf(n){return function(){return n}}function N5(n,o){return n==null||n!==n?o:n}var T5=g0(),q5=g0(!0);function Qr(n){return n}function Jf(n){return Kd(typeof n=="function"?n:_i(n,_))}function F5(n){return Gd(_i(n,_))}function B5(n,o){return Wd(n,_i(o,_))}var L5=_t(function(n,o){return function(v){return $a(v,n,o)}}),U5=_t(function(n,o){return function(v){return $a(n,v,o)}});function Yf(n,o,v){var P=vr(o),T=Sc(o,P);v==null&&!(Xt(o)&&(T.length||!P.length))&&(v=o,o=n,n=this,T=Sc(o,vr(o)));var H=!(Xt(v)&&"chain"in v)||!!v.chain,X=Nn(n);return mi(T,function(ee){var se=o[ee];n[ee]=se,X&&(n.prototype[ee]=function(){var le=this.__chain__;if(H||le){var de=n(this.__wrapped__),ge=de.__actions__=Wr(this.__actions__);return ge.push({func:se,args:arguments,thisArg:n}),de.__chain__=le,de}return se.apply(n,Jn([this.value()],arguments))})}),n}function z5(){return Ct._===this&&(Ct._=lm),this}function Qf(){}function j5(n){return n=mt(n),_t(function(o){return Jd(o,n)})}var $5=Df(Qt),k5=Df(vd),H5=Df(Xu);function dp(n){return qf(n)?Zu(an(n)):w3(n)}function K5(n){return function(o){return n==null?t:_s(n,o)}}var V5=b0(),G5=b0(!0);function Xf(){return[]}function Zf(){return!1}function W5(){return{}}function J5(){return""}function Y5(){return!0}function Q5(n,o){if(n=mt(n),n<1||n>D)return[];var v=m,P=Rr(n,m);o=nt(o),n-=m;for(var T=rf(P,o);++v<n;)o(v);return T}function X5(n){return gt(n)?Qt(n,an):ci(n)?[n]:Wr(N0(qt(n)))}function Z5(n){var o=++fm;return qt(n)+o}var e8=Oc(function(n,o){return n+o},0),t8=Pf("ceil"),r8=Oc(function(n,o){return n/o},1),i8=Pf("floor");function n8(n){return n&&n.length?xc(n,Qr,pf):t}function s8(n,o){return n&&n.length?xc(n,nt(o,2),pf):t}function a8(n){return yd(n,Qr)}function o8(n,o){return yd(n,nt(o,2))}function c8(n){return n&&n.length?xc(n,Qr,mf):t}function u8(n,o){return n&&n.length?xc(n,nt(o,2),mf):t}var f8=Oc(function(n,o){return n*o},1),h8=Pf("round"),l8=Oc(function(n,o){return n-o},0);function d8(n){return n&&n.length?tf(n,Qr):0}function p8(n,o){return n&&n.length?tf(n,nt(o,2)):0}return $.after=F6,$.ary=H0,$.assign=Ew,$.assignIn=np,$.assignInWith=Hc,$.assignWith=xw,$.at=Sw,$.before=K0,$.bind=jf,$.bindAll=C5,$.bindKey=V0,$.castArray=W6,$.chain=j0,$.chunk=iy,$.compact=ny,$.concat=sy,$.cond=O5,$.conforms=R5,$.constant=Wf,$.countBy=d6,$.create=Mw,$.curry=G0,$.curryRight=W0,$.debounce=J0,$.defaults=Iw,$.defaultsDeep=Dw,$.defer=B6,$.delay=L6,$.difference=ay,$.differenceBy=oy,$.differenceWith=cy,$.drop=uy,$.dropRight=fy,$.dropRightWhile=hy,$.dropWhile=ly,$.fill=dy,$.filter=g6,$.flatMap=m6,$.flatMapDeep=y6,$.flatMapDepth=w6,$.flatten=B0,$.flattenDeep=py,$.flattenDepth=gy,$.flip=U6,$.flow=T5,$.flowRight=q5,$.fromPairs=vy,$.functions=qw,$.functionsIn=Fw,$.groupBy=_6,$.initial=my,$.intersection=yy,$.intersectionBy=wy,$.intersectionWith=_y,$.invert=Lw,$.invertBy=Uw,$.invokeMap=E6,$.iteratee=Jf,$.keyBy=x6,$.keys=vr,$.keysIn=Yr,$.map=Lc,$.mapKeys=jw,$.mapValues=$w,$.matches=F5,$.matchesProperty=B5,$.memoize=zc,$.merge=kw,$.mergeWith=sp,$.method=L5,$.methodOf=U5,$.mixin=Yf,$.negate=jc,$.nthArg=j5,$.omit=Hw,$.omitBy=Kw,$.once=z6,$.orderBy=S6,$.over=$5,$.overArgs=j6,$.overEvery=k5,$.overSome=H5,$.partial=$f,$.partialRight=Y0,$.partition=M6,$.pick=Vw,$.pickBy=ap,$.property=dp,$.propertyOf=K5,$.pull=Sy,$.pullAll=U0,$.pullAllBy=My,$.pullAllWith=Iy,$.pullAt=Dy,$.range=V5,$.rangeRight=G5,$.rearg=$6,$.reject=P6,$.remove=Py,$.rest=k6,$.reverse=Uf,$.sampleSize=O6,$.set=Ww,$.setWith=Jw,$.shuffle=R6,$.slice=Cy,$.sortBy=q6,$.sortedUniq=By,$.sortedUniqBy=Ly,$.split=m5,$.spread=H6,$.tail=Uy,$.take=zy,$.takeRight=jy,$.takeRightWhile=$y,$.takeWhile=ky,$.tap=n6,$.throttle=K6,$.thru=Bc,$.toArray=tp,$.toPairs=op,$.toPairsIn=cp,$.toPath=X5,$.toPlainObject=ip,$.transform=Yw,$.unary=V6,$.union=Hy,$.unionBy=Ky,$.unionWith=Vy,$.uniq=Gy,$.uniqBy=Wy,$.uniqWith=Jy,$.unset=Qw,$.unzip=zf,$.unzipWith=z0,$.update=Xw,$.updateWith=Zw,$.values=ca,$.valuesIn=e5,$.without=Yy,$.words=hp,$.wrap=G6,$.xor=Qy,$.xorBy=Xy,$.xorWith=Zy,$.zip=e6,$.zipObject=t6,$.zipObjectDeep=r6,$.zipWith=i6,$.entries=op,$.entriesIn=cp,$.extend=np,$.extendWith=Hc,Yf($,$),$.add=e8,$.attempt=lp,$.camelCase=n5,$.capitalize=up,$.ceil=t8,$.clamp=t5,$.clone=J6,$.cloneDeep=Q6,$.cloneDeepWith=X6,$.cloneWith=Y6,$.conformsTo=Z6,$.deburr=fp,$.defaultTo=N5,$.divide=r8,$.endsWith=s5,$.eq=$i,$.escape=a5,$.escapeRegExp=o5,$.every=p6,$.find=v6,$.findIndex=q0,$.findKey=Pw,$.findLast=b6,$.findLastIndex=F0,$.findLastKey=Cw,$.floor=i8,$.forEach=$0,$.forEachRight=k0,$.forIn=Ow,$.forInRight=Rw,$.forOwn=Nw,$.forOwnRight=Tw,$.get=Kf,$.gt=ew,$.gte=tw,$.has=Bw,$.hasIn=Vf,$.head=L0,$.identity=Qr,$.includes=A6,$.indexOf=by,$.inRange=r5,$.invoke=zw,$.isArguments=xs,$.isArray=gt,$.isArrayBuffer=rw,$.isArrayLike=Jr,$.isArrayLikeObject=nr,$.isBoolean=iw,$.isBuffer=rs,$.isDate=nw,$.isElement=sw,$.isEmpty=aw,$.isEqual=ow,$.isEqualWith=cw,$.isError=kf,$.isFinite=uw,$.isFunction=Nn,$.isInteger=Q0,$.isLength=$c,$.isMap=X0,$.isMatch=fw,$.isMatchWith=hw,$.isNaN=lw,$.isNative=dw,$.isNil=gw,$.isNull=pw,$.isNumber=Z0,$.isObject=Xt,$.isObjectLike=er,$.isPlainObject=Wa,$.isRegExp=Hf,$.isSafeInteger=vw,$.isSet=ep,$.isString=kc,$.isSymbol=ci,$.isTypedArray=oa,$.isUndefined=bw,$.isWeakMap=mw,$.isWeakSet=yw,$.join=Ay,$.kebabCase=c5,$.last=Ei,$.lastIndexOf=Ey,$.lowerCase=u5,$.lowerFirst=f5,$.lt=ww,$.lte=_w,$.max=n8,$.maxBy=s8,$.mean=a8,$.meanBy=o8,$.min=c8,$.minBy=u8,$.stubArray=Xf,$.stubFalse=Zf,$.stubObject=W5,$.stubString=J5,$.stubTrue=Y5,$.multiply=f8,$.nth=xy,$.noConflict=z5,$.noop=Qf,$.now=Uc,$.pad=h5,$.padEnd=l5,$.padStart=d5,$.parseInt=p5,$.random=i5,$.reduce=I6,$.reduceRight=D6,$.repeat=g5,$.replace=v5,$.result=Gw,$.round=h8,$.runInContext=ne,$.sample=C6,$.size=N6,$.snakeCase=b5,$.some=T6,$.sortedIndex=Oy,$.sortedIndexBy=Ry,$.sortedIndexOf=Ny,$.sortedLastIndex=Ty,$.sortedLastIndexBy=qy,$.sortedLastIndexOf=Fy,$.startCase=y5,$.startsWith=w5,$.subtract=l8,$.sum=d8,$.sumBy=p8,$.template=_5,$.times=Q5,$.toFinite=Tn,$.toInteger=mt,$.toLength=rp,$.toLower=A5,$.toNumber=xi,$.toSafeInteger=Aw,$.toString=qt,$.toUpper=E5,$.trim=x5,$.trimEnd=S5,$.trimStart=M5,$.truncate=I5,$.unescape=D5,$.uniqueId=Z5,$.upperCase=P5,$.upperFirst=Gf,$.each=$0,$.eachRight=k0,$.first=L0,Yf($,function(){var n={};return nn($,function(o,v){Bt.call($.prototype,v)||(n[v]=o)}),n}(),{chain:!1}),$.VERSION=i,mi(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){$[n].placeholder=$}),mi(["drop","take"],function(n,o){It.prototype[n]=function(v){v=v===t?1:lr(mt(v),0);var P=this.__filtered__&&!o?new It(this):this.clone();return P.__filtered__?P.__takeCount__=Rr(v,P.__takeCount__):P.__views__.push({size:Rr(v,m),type:n+(P.__dir__<0?"Right":"")}),P},It.prototype[n+"Right"]=function(v){return this.reverse()[n](v).reverse()}}),mi(["filter","map","takeWhile"],function(n,o){var v=o+1,P=v==h||v==y;It.prototype[n]=function(T){var H=this.clone();return H.__iteratees__.push({iteratee:nt(T,3),type:v}),H.__filtered__=H.__filtered__||P,H}}),mi(["head","last"],function(n,o){var v="take"+(o?"Right":"");It.prototype[n]=function(){return this[v](1).value()[0]}}),mi(["initial","tail"],function(n,o){var v="drop"+(o?"":"Right");It.prototype[n]=function(){return this.__filtered__?new It(this):this[v](1)}}),It.prototype.compact=function(){return this.filter(Qr)},It.prototype.find=function(n){return this.filter(n).head()},It.prototype.findLast=function(n){return this.reverse().find(n)},It.prototype.invokeMap=_t(function(n,o){return typeof n=="function"?new It(this):this.map(function(v){return $a(v,n,o)})}),It.prototype.reject=function(n){return this.filter(jc(nt(n)))},It.prototype.slice=function(n,o){n=mt(n);var v=this;return v.__filtered__&&(n>0||o<0)?new It(v):(n<0?v=v.takeRight(-n):n&&(v=v.drop(n)),o!==t&&(o=mt(o),v=o<0?v.dropRight(-o):v.take(o-n)),v)},It.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},It.prototype.toArray=function(){return this.take(m)},nn(It.prototype,function(n,o){var v=/^(?:filter|find|map|reject)|While$/.test(o),P=/^(?:head|last)$/.test(o),T=$[P?"take"+(o=="last"?"Right":""):o],H=P||/^find/.test(o);T&&($.prototype[o]=function(){var X=this.__wrapped__,ee=P?[1]:arguments,se=X instanceof It,le=ee[0],de=se||gt(X),ge=function(xt){var Ot=T.apply($,Jn([xt],ee));return P&&Pe?Ot[0]:Ot};de&&v&&typeof le=="function"&&le.length!=1&&(se=de=!1);var Pe=this.__chain__,We=!!this.__actions__.length,ot=H&&!Pe,yt=se&&!We;if(!H&&de){X=yt?X:new It(this);var ct=n.apply(X,ee);return ct.__actions__.push({func:Bc,args:[ge],thisArg:t}),new wi(ct,Pe)}return ot&&yt?n.apply(this,ee):(ct=this.thru(ge),ot?P?ct.value()[0]:ct.value():ct)})}),mi(["pop","push","shift","sort","splice","unshift"],function(n){var o=uc[n],v=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",P=/^(?:pop|shift)$/.test(n);$.prototype[n]=function(){var T=arguments;if(P&&!this.__chain__){var H=this.value();return o.apply(gt(H)?H:[],T)}return this[v](function(X){return o.apply(gt(X)?X:[],T)})}}),nn(It.prototype,function(n,o){var v=$[o];if(v){var P=v.name+"";Bt.call(ra,P)||(ra[P]=[]),ra[P].push({name:o,func:v})}}),ra[Cc(t,V).name]=[{name:"wrapper",func:t}],It.prototype.clone=Dm,It.prototype.reverse=Pm,It.prototype.value=Cm,$.prototype.at=s6,$.prototype.chain=a6,$.prototype.commit=o6,$.prototype.next=c6,$.prototype.plant=f6,$.prototype.reverse=h6,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=l6,$.prototype.first=$.prototype.head,qa&&($.prototype[qa]=u6),$},Zs=om();ir?((ir.exports=Zs)._=Zs,kt._=Zs):Ct._=Zs}
70).call(ho)})($l,$l.exports);var mC=Object.defineProperty,yC=Object.defineProperties,wC=Object.getOwnPropertyDescriptors,Dv=Object.getOwnPropertySymbols,_C=Object.prototype.hasOwnProperty,AC=Object.prototype.propertyIsEnumerable,Pv=(r,e,t)=>e in r?mC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,iu=(r,e)=>{for(var t in e||(e={}))_C.call(e,t)&&Pv(r,t,e[t]);if(Dv)for(var t of Dv(e))AC.call(e,t)&&Pv(r,t,e[t]);return r},EC=(r,e)=>yC(r,wC(e));function Qi(r,e,t){var i;const s=mo(r);return((i=e.rpcMap)==null?void 0:i[s.reference])||`${q2}?chainId=${s.namespace}:${s.reference}&projectId=${t}`}function Ks(r){return r.includes(":")?r.split(":")[1]:r}function F2(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function xC(r,e){const t=Object.keys(e.namespaces).filter(s=>s.includes(r));if(!t.length)return[];const i=[];return t.forEach(s=>{const a=e.namespaces[s].accounts;i.push(...a)}),i}function ml(r={},e={}){const t=Cv(r),i=Cv(e);return $l.exports.merge(t,i)}function Cv(r){var e,t,i,s;const a={};if(!Do(r))return a;for(const[f,l]of Object.entries(r)){const p=sd(f)?[f]:l.chains,u=l.methods||[],b=l.events||[],_=l.rpcMap||{},M=go(f);a[M]=EC(iu(iu({},a[M]),l),{chains:cu(p,(e=a[M])==null?void 0:e.chains),methods:cu(u,(t=a[M])==null?void 0:t.methods),events:cu(b,(i=a[M])==null?void 0:i.events),rpcMap:iu(iu({},_),(s=a[M])==null?void 0:s.rpcMap)})}return a}function SC(r){return r.includes(":")?r.split(":")[2]:r}function Ov(r){const e={};for(const[t,i]of Object.entries(r)){const s=i.methods||[],a=i.events||[],f=i.accounts||[],l=sd(t)?[t]:i.chains?i.chains:F2(i.accounts);e[t]={chains:l,methods:s,events:a,accounts:f}}return e}function yl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const B2={},Ft=r=>B2[r],wl=(r,e)=>{B2[r]=e};class MC{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=Ks(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}var IC=Object.defineProperty,DC=Object.defineProperties,PC=Object.getOwnPropertyDescriptors,Rv=Object.getOwnPropertySymbols,CC=Object.prototype.hasOwnProperty,OC=Object.prototype.propertyIsEnumerable,Nv=(r,e,t)=>e in r?IC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Tv=(r,e)=>{for(var t in e||(e={}))CC.call(e,t)&&Nv(r,t,e[t]);if(Rv)for(var t of Rv(e))OC.call(e,t)&&Nv(r,t,e[t]);return r},qv=(r,e)=>DC(r,PC(e));class RC{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||Qi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=parseInt(Ks(t));e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let s=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";s=s.startsWith("0x")?s:`0x${s}`;const a=parseInt(s,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:s}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,s;const a=(i=(t=e.request)==null?void 0:t.params)==null?void 0:i[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),l=((s=f==null?void 0:f.sessionProperties)==null?void 0:s.capabilities)||{};if(l!=null&&l[a])return l==null?void 0:l[a];const p=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:qv(Tv({},f.sessionProperties||{}),{capabilities:qv(Tv({},l||{}),{[a]:p})})})}catch(u){console.warn("Failed to update session with capabilities",u)}return p}async getCallStatus(e){var t,i;const s=this.client.session.get(e.topic),a=(t=s.sessionProperties)==null?void 0:t.bundler_name;if(a){const l=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(l,e)}catch(p){console.warn("Failed to fetch call status from bundler",p,l)}}const f=(i=s.sessionProperties)==null?void 0:i.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(l){console.warn("Failed to fetch call status from custom bundler",l,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;const s=new URL(e),a=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(fs("eth_getUserOperationReceipt",[(i=t.request.params)==null?void 0:i[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}
70getBundlerUrl(e,t){return`${bC}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class NC{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=Ks(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}class TC{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=Ks(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}class qC{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const i=t||Qi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new Zi(new Sn(i,Ft("disableProviderPing")))}}class FC{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),s=Ks(t);e[s]=this.createHttpProvider(s,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}class BC{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=Ks(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}class LC{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const s=Ks(t);e[s]=this.createHttpProvider(s,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}class UC{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||Qi(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace);return typeof i>"u"?void 0:new Zi(new Sn(i,Ft("disableProviderPing")))}}class zC{constructor(e){this.name=pa,this.namespace=e.namespace,this.events=Ft("events"),this.client=Ft("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(en.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const i={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(s=>{const a=mo(s);i[`${a.namespace}:${a.reference}`]=this.createHttpProvider(s)}),i}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||Qi(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new Zi(new Sn(i,Ft("disableProviderPing")))}}var jC=Object.defineProperty,$C=Object.defineProperties,kC=Object.getOwnPropertyDescriptors,Fv=Object.getOwnPropertySymbols,HC=Object.prototype.hasOwnProperty,KC=Object.prototype.propertyIsEnumerable,Bv=(r,e,t)=>e in r?jC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,nu=(r,e)=>{for(var t in e||(e={}))HC.call(e,t)&&Bv(r,t,e[t]);if(Fv)for(var t of Fv(e))KC.call(e,t)&&Bv(r,t,e[t]);return r},_l=(r,e)=>$C(r,kC(e));class pd{constructor(e){this.events=new Gl,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:zo(Lu({level:(e==null?void 0:e.logger)||Mv})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new pd(e);return await t.initialize(),t}async request(e,t,i){const[s,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:nu({},e),chainId:`${s}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,s){const a=new Date().getTime();this.request(e,i,s).then(f=>t(null,Uu(a,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");
70return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Lt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:i,response:s}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));const a=await s();if(this.session=a.session,this.session){const f=Ov(this.session.namespaces);this.namespaces=ml(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:s}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await s().then(a=>{this.session=a;const f=Ov(a.namespaces);this.namespaces=ml(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==T2)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,s]=this.validateChain(e),a=this.getProvider(i);a.name===pa?a.setDefaultChain(`${i}:${s}`,t):a.setDefaultChain(s,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(_n(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await dd.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Mv,relayUrl:this.providerOpts.relayUrl||pC,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>go(t)))];wl("client",this.client),wl("events",this.events),wl("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=xC(t,this.session),s=F2(i),a=ml(this.namespaces,this.optionalNamespaces),f=_l(nu({},a[t]),{accounts:i,chains:s});switch(t){case"eip155":this.rpcProviders[t]=new RC({namespace:f});break;case"algorand":this.rpcProviders[t]=new qC({namespace:f});break;case"solana":this.rpcProviders[t]=new NC({namespace:f});break;case"cosmos":this.rpcProviders[t]=new TC({namespace:f});break;case"polkadot":this.rpcProviders[t]=new MC({namespace:f});break;case"cip34":this.rpcProviders[t]=new FC({namespace:f});break;case"elrond":this.rpcProviders[t]=new BC({namespace:f});break;
70case"multiversx":this.rpcProviders[t]=new LC({namespace:f});break;case"near":this.rpcProviders[t]=new UC({namespace:f});break;default:this.rpcProviders[pa]?this.rpcProviders[pa].updateNamespace(f):this.rpcProviders[pa]=new zC({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const s=i.data;s&&_n(s)&&this.events.emit("accountsChanged",s.map(SC))}else if(i.name==="chainChanged"){const s=t.chainId,a=t.event.data,f=go(s),l=yl(s)!==yl(a)?`${f}:${yl(a)}`:s;this.onChainChanged(l)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:s}=t,a=(i=this.client)==null?void 0:i.session.get(e);this.session=_l(nu({},a),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",_l(nu({},Lt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(en.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[pa]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:s}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=s,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(f=>go(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const s=go(Object.keys(this.namespaces)[0]),a=this.rpcProviders[s].getDefaultChain();return[s,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,s]=this.validateChain(e);s&&(t||this.getProvider(i).setDefaultChain(s),this.namespaces[i]?this.namespaces[i].defaultChain=s:this.namespaces[`${i}:${s}`]?this.namespaces[`${i}:${s}`].defaultChain=s:this.namespaces[`${i}:${s}`]={defaultChain:s},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Iv}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Iv}/${e}`)}}const VC=pd,GC="wc",WC="ethereum_provider",JC=`${GC}@2:${WC}:`,YC="https://rpc.walletconnect.org/v1/",kl=["eth_sendTransaction","personal_sign"],QC=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Hl=["chainChanged","accountsChanged"],XC=["chainChanged","accountsChanged","message","disconnect","connect"];var ZC=Object.defineProperty,eO=Object.defineProperties,tO=Object.getOwnPropertyDescriptors,Lv=Object.getOwnPropertySymbols,rO=Object.prototype.hasOwnProperty,iO=Object.prototype.propertyIsEnumerable,Uv=(r,e,t)=>e in r?ZC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ga=(r,e)=>{for(var t in e||(e={}))rO.call(e,t)&&Uv(r,t,e[t]);if(Lv)for(var t of Lv(e))iO.call(e,t)&&Uv(r,t,e[t]);return r},Al=(r,e)=>eO(r,tO(e));function Pu(r){return Number(r[0].split(":")[1])}function su(r){return`0x${r.toString(16)}`}function nO(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:s,events:a,optionalEvents:f,rpcMap:l}=r;if(!_n(e))throw new Error("Invalid chains");const p={chains:e,methods:i||kl,events:a||Hl,rpcMap:ga({},e.length?{[Pu(e)]:l[Pu(e)]}:{})},u=a==null?void 0:a.filter(I=>!Hl.includes(I)),b=i==null?void 0:i.filter(I=>!kl.includes(I));if(!t&&!f&&!s&&!(u!=null&&u.length)&&!(b!=null&&b.length))return{required:e.length?p:void 0};const _=(u==null?void 0:u.length)&&(b==null?void 0:b.length)||!t,M={chains:[...new Set(_?p.chains.concat(t||[]):t)],methods:[...new Set(p.methods.concat(s!=null&&s.length?s:QC))],events:[...new Set(p.events.concat(f!=null&&f.length?f:XC))],rpcMap:l};return{required:e.length?p:void 0,optional:t.length?M:void 0}}class gd{constructor(){this.events=new pi.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=JC,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new gd;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=nO(this.rpc);try{const s=await new Promise(async(f,l)=>{var p;this.rpc.showQrModal&&((p=this.modal)==null||p.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),l(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Al(ga({namespaces:ga({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(u=>{f(u)}).catch(u=>{l(new Error(u.message))})});if(!s)return;const a=F1(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:su(this.chainId)})}catch(s){throw this.signer.logger.error(s),s}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(a,f)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Al(ga({},e),{chains:this.rpc.chains}),t).then(p=>{a(p)}).catch(p=>{f(new Error(p.message))})}),s=i.session;if(s){const a=F1(s.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:su(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",su(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Al(ga({},Lt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",su(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,s]=e.split(":");return{chainId:`${t}:${i}`,address:s}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const s=(t=e==null?void 0:e.chains)!=null?t:[],a=(i=e==null?void 0:e.optionalChains)!=null?i:[],f=s.concat(a);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const l=s.length?(e==null?void 0:e.methods)||kl:[],p=s.length?(e==null?void 0:e.events)||Hl:[],u=(e==null?void 0:e.optionalMethods)||[],b=(e==null?void 0:e.optionalEvents)||[],_=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),M=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:s==null?void 0:s.map(I=>this.formatChainId(I)),optionalChains:a.map(I=>this.formatChainId(I)),methods:l,events:p,optionalMethods:u,optionalEvents:b,rpcMap:_,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:M,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(s=>{i[s]=this.getRpcUrl(s,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Pu(this.rpc.chains):Pu(this.rpc.optionalChains),this.signer=await VC.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;
70try{const{WalletConnectModal:i}=await g8(()=>import("./index-DyY49ZKk.js").then(s=>s.i),__vite__mapDeps([0,1,2]));t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(ga({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:s}=e;t&&_n(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)})),i&&_n(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(s==null?void 0:s[a])||this.getRpcUrl(a)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${YC}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const CO=gd;export{CO as EthereumProvider,XC as OPTIONAL_EVENTS,QC as OPTIONAL_METHODS,Hl as REQUIRED_EVENTS,kl as REQUIRED_METHODS,gd as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.