@ar.io/sdk 2.0.0-alpha.7 → 2.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,7 +135,7 @@ use chrome, FireFox or Internet Explorer 11`)}var n=Si(),h=_d(),a=n.Buffer,d=n.k
135
135
  `))},ri.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},ri}var bp,dj,y6,pj,vj,wp,mj,y7,gj,b7,yj,w7,bj,_7,wj,dn,M7,_j,qi,S7,Mj,ji,E7,Sj,Hr,A7,Ej,oa,R7,Aj,pr,x7,Rj,Ii,Uge,xj,T7,b6,Tj,k7,kj,I7,Ij,B7,Bj,O7,Oj,P7,Pj,N7,Nj,C7,L7,Cj,Fge,D7,Lj,$7,Dj,U7,$j,q7,Uj,j7,qj,Kge,F7,jj,z7,Fj,H7,zj,K7,Hj,Z7,yf,W7,Kj,Mn,G7,Zj,V7,Wj,Y7,Gj,J7,Vj,NG,X7,Yj,Q7,Jj,e9,Xj,w6,t9,Qj,r9,eF,af,i9,tF,Eo,_6,rF,Ao,iF,n9,nF,a9,aF,o9,oF,s9,sF,f9,fF,J0,uF,u9,hF,M6,S6,lF,h9,cF,E6,dF,l9,pF,c9,vF,d9,mF,p9,gF,v9,yF,m9,bF,zG,g9,_F,y9,MF,as,b9,SF,Aa,w9,EF,Kr,_9,AF,of,M9,RF,A6,xF,an,R6,TF,Bi,os,kF,Wf,IF,ss,BF,ZG,OF,S9,Fe,GG,PF,E9,ze,ao,NF,_p,CF,x6,LF,DF,A9,$F,R9,UF,x9,qF,T9,jF,pn,k9,FF,Fi,I9,zF,zi,B9,HF,Zr,O9,KF,sa,P9,ZF,vr,N9,WF,Oi,m6e,GF,C9,Wy,wf,QG,eV,lE,tV,T6,cE,b6e,w6e,X0,rV,_6e,iV,XF,D9,S6e,nV,E6e,Kh,ll,Gp,By,bl,pE,wl,x6e,T6e,k6e,$9,QF,I6e,U9,ez,B6e,q9,tz,P6e,rz,JE,k6,vE,D6e,$6e,Q0,oV,U6e,j9,sV,fV,q6e,Wh,cl,Vp,Oy,_l,gE,Ml,z6e,H6e,K6e,F9,az,Z6e,z9,oz,G6e,H9,sz,V6e,hV,lV,Gy,Y6e,J6e,X6e,Q6e,dy,cV,dV,pV,rye,K9,vV,iye,nye,fye,mV,yE,bE,Ss,Z9,lz,Sn,W9,cz,G9,dz,V9,pz,Y9,vz,bV,J9,mz,X9,gz,Q9,yz,I6,e_,bz,t_,wz,sf,r_,_z,Ro,B6,Mz,xo,Sz,i_,Ez,n_,Az,a_,Rz,o_,xz,s_,Tz,el,kz,f_,Iz,O6,P6,Bz,u_,Oz,N6,Pz,h_,Nz,l_,Cz,c_,Lz,d_,Dz,p_,$z,v_,Uz,TV,m_,jz,g_,Fz,us,y_,zz,Ra,b_,Hz,Wr,w_,Kz,ff,__,Zz,C6,Wz,on,L6,Gz,Pi,hs,Vz,Gf,Yz,ls,Jz,BV,Xz,M_,He,PV,Qz,S_,Ke,Ny,uo,Tye,id,tl,kye,eH,Xf,tH,Iye,Bye,D6,Rd,vy,NV,CV,Oye,LV,Pye,Nye,tA,E_,Cye,DV,Lye,Mp,Sp,Ep,Ap,Rp,xp,rA,vn,$V,xd,Gr,Dye,UV,$ye,Uye,qye,qV,Hi,Zye,jV,Wye,Gye,Vye,Xye,Ki,Qye,FV,ebe,tbe,rbe,obe,ca,sbe,fbe,ube,hbe,lbe,cbe,mr,dbe,zV,pbe,sH,vbe,HV,Ni,wbe,_be,Mbe,Sbe,Ebe,qh,Abe,KV,iA,xn,cH,ZV,Rbe,r0,xbe,Tbe,kbe,WV,l2,Ibe,GV,Bbe,Sl,VV,Obe,Pbe,Nbe,YV,qp,Cbe,wE,_E,Lbe,JV,XV,Dbe,$be,ME,QV,pH,eY,vf,Ube,qbe,jbe,Fbe,vH,gf,zbe,Sy,A_,rY,Jp,R_,Hbe,mH,gH,ud,Xp,Kbe,x_,Zbe,Cy,iY,Es,kl,$6,wH,_H,nY,Wbe,aY,nA,MH,Zn,oY,Vbe,sY,fY,Ybe,Jbe,U6,uY,Qbe,hY,Gh,t3e,hd,lY,Ly,cY,Uu,r3e,gl,jp,i3e,n3e,c2,dY,a3e,SE,SH,pY,Fp,o3e,vY,EE,mY,Ey,gY,h3e,l3e,AE,d3e,AH,p3e,yY,m3e,Ay,T_,aA,ws,d2,Dy,g3e,Un,Oa,bd,y3e,b3e,Vr,w3e,so,bY,TH,_3e,M3e,wY,mf,S3e,I_,_Y,MY,il,E3e,Xy,Ci,xE,A3e,wd,SY,R3e,EY,x3e,T3e,sn,TE,AY,k3e,Wu,I3e,RY,B3e,O3e,P3e,Io,BH,OH,N3e,jh,df,xY,oA,Vh,ju,PH,C3e,et,TY,kY,qn,IY,B_,L3e,ky,O_,sA,BY,OY,nl,D3e,PY,NY,$3e,Na,U3e,LH,q3e,kE,j3e,F3e,z3e,H3e,DH,P_,CY,LY,wi,nu,Ms,$H,Z3e,W3e,G3e,V3e,Y3e,UH,J3e,j6,e8e,ld,Ih,t8e,qH,C_,r8e,DY,i8e,Yh,jH,fA,uA,z6,Bo,uf,n8e,a8e,H6,qY,$y,OE,o8e,f8e,mi,u8e,h8e,Td,GH,c8e,jY,ho,d8e,p8e,au,ou,FY,zY,Bh,$_,U_,v8e,m8e,g8e,y8e,HY,b8e,KY,Qf,Vf,ZY,md,O8e,kd,P8e,hf,N8e,C8e,L8e,D8e,$8e,U8e,q8e,j8e,WY,F8e,GY,VY,gd,z8e,H8e,q_,Tp,K8e,Z8e,YY,W8e,JY,G8e,j_,XY,QY,V8e,F_,eJ,Y8e,cd,tJ,Rl,J8e,Z6,XH,kp,QH,rJ,iJ,e4e,t4e,r4e,i4e,n4e,a4e,o4e,Qy,ga,nJ,s4e,El,aJ,f4e,oJ,ol,i2,W6,u4e,G6,sJ,eb,Rn,z_,yd,h4e,fJ,l4e,pd,tK,Uy,c4e,uJ,d4e,Zu,rK,qy,p4e,v4e,hA,V6,PE,m4e,tb,NE,Fh,H_,iK,lJ,g4e,nK,cJ,y4e,sl,aK,K_,b4e,dJ,Z_,Y6,w4e,n2,oK,sK,ad,_4e,M4e,rb,S4e,J6,E4e,pJ,A4e,R4e,x4e,vd,T4e,fK,uK,hK,k4e,ib,fl,W_,lK,To,Yn,vJ,I4e,X6,cK,Cr,G_,pK,kr,V_,vK,Ph,mK,Y_,gK,J_,yK,Nh,X_,wK,Q_,eM,_K,tM,MK,Wn,rM,EK,iM,nM,AK,aM,RK,gJ,_f,xK,P4e,lA,N4e,C4e,L4e,TK,D4e,$4e,U4e,q4e,bf,Mf,j4e,F4e,z4e,yJ,H4e,K4e,Z4e,W4e,G4e,bJ,V4e,Y4e,J4e,X4e,Q4e,Q6,oo,e5e,t5e,r5e,i5e,oM,ab,wJ,CE,Pa,Al,n5e,a5e,jy,o5e,s5e,u5e,sM,Ip,h5e,OK,l5e,c5e,Tn,ey,_J,Fy,NK,d5e,p5e,yl,v5e,MJ,Jn,Ku,m5e,g5e,ko,y5e,b5e,LE,SJ,EJ,DK,_5e,AJ,M5e,uM,S5e,$K,UK,hM,E5e,A5e,lf,R5e,x5e,qK,jK,FK,T5e,k5e,I5e,Bp,B5e,ml,zy,Wp,DE,RJ,HK,KK,xJ,$E,TJ,ni,O5e,P5e,N5e,VK,Jf,Op,ty,ry,YK,iy,JK,ny,lM,XK,QK,cM,eZ,C5e,dM,tZ,yi,ul,rZ,BJ,iZ,pM,$e,vM,nZ,$5e,OJ,aZ,mM,Ze,gM,oZ,yM,sZ,bM,fZ,wM,uZ,_M,hZ,MM,lZ,SM,cZ,Ji,dZ,EM,pZ,vZ,mZ,AM,gZ,RM,yZ,xM,bZ,TM,wZ,kM,_Z,IM,MZ,BM,SZ,OM,EZ,PM,AZ,NM,RZ,CM,xZ,LM,TZ,DM,kZ,LJ,IZ,$M,We,UM,BZ,qM,OZ,ay,PZ,jM,NZ,Ch,CZ,FM,LZ,zM,DZ,HM,$Z,KM,UZ,ZM,qZ,WM,jZ,GM,FZ,VM,zZ,YM,HZ,JM,KZ,XM,ZZ,gs,WZ,owe,QM,GZ,eS,VZ,zJ,Pp,YZ,tS,JZ,rS,XZ,En,HJ,QZ,iS,Ge,nS,eW,Gn,aS,tW,oS,rW,WJ,iW,sS,Ve,fS,nW,uS,aW,hS,oW,Lh,sW,sd,fW,oy,ti,uW,ai,sy,hW,fy,lS,lW,cW,cS,dW,ywe,dS,pW,bi,hl,vW,Np,mW,JJ,gW,pS,Ue,vS,yW,_we,XJ,bW,mS,Ye,gS,wW,yS,_W,bS,MW,wS,SW,_S,EW,MS,AW,SS,RW,Xi,xW,ES,TW,kW,IW,AS,BW,RS,OW,xS,PW,TS,NW,kS,CW,IS,LW,BS,DW,OS,$W,PS,UW,NS,qW,CS,jW,LS,FW,DS,zW,rX,HW,$S,Je,US,KW,qS,ZW,uy,WW,jS,GW,Dh,VW,FS,YW,zS,JW,HS,XW,KS,QW,ZS,eG,WS,tG,GS,rG,VS,iG,YS,nG,JS,aG,XS,oG,ys,sG,zwe,QS,fG,eE,uG,uX,Cp,hG,tE,lG,rE,cG,An,hX,dG,iE,Xe,nE,pG,Vn,aE,vG,oE,mG,dX,gG,sE,Qe,fE,yG,uE,bG,hE,wG,$h,_G,fd,MG,hy,ri,SG,wr,t7e,r7e,i7e,n7e,a7e,o7e,s7e,f7e,u7e,h7e,l7e,c7e,d7e,p7e,v7e,m7e,g7e,y7e,b7e,w7e,_7e,M7e,S7e,E7e,A7e,R7e,x7e,T7e,k7e,I7e,B7e,O7e,P7e,N7e,C7e,L7e,D7e,$7e,U7e,q7e,mX=$i(()=>{"use strict";Be();Pe();Oe();ku();Ws();Zg();Zs();qf();Au();Zo();Ho();bp={},dj=!1;y6={},pj=!1,vj=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;wp={},mj=!1;y7={},gj=!1;b7={},yj=!1;w7={},bj=!1;_7={},wj=!1,dn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;M7={},_j=!1,qi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;S7={},Mj=!1,ji=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;E7={},Sj=!1,Hr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;A7={},Ej=!1,oa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;R7={},Aj=!1,pr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;x7={},Rj=!1,Ii=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Uge={},xj=!1,T7={exports:Uge};b6={},Tj=!1;k7={},kj=!1;I7={},Ij=!1;B7={},Bj=!1;O7={},Oj=!1;P7={},Pj=!1;N7={},Nj=!1,C7=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;L7={},Cj=!1,Fge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;D7={},Lj=!1;$7={},Dj=!1;U7={},$j=!1;q7={},Uj=!1;j7={},qj=!1,Kge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;F7={},jj=!1;z7={},Fj=!1;H7={},zj=!1;K7={},Hj=!1,Z7=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;yf=Zge();yf.Readable;yf.Writable;yf.Duplex;yf.Transform;yf.PassThrough;yf.finished;yf.pipeline;yf.Stream;G8(yf.finished),G8(yf.pipeline);W7={},Kj=!1,Mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;G7={},Zj=!1;V7={},Wj=!1;Y7={},Gj=!1;J7={},Vj=!1;NG={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},X7={},Yj=!1;Q7={},Jj=!1;e9={},Xj=!1,w6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;t9={},Qj=!1;r9={},eF=!1,af=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;i9={},tF=!1,Eo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;_6={},rF=!1;Ao={},iF=!1;n9={},nF=!1;a9={},aF=!1;o9={},oF=!1;s9={},sF=!1;f9={},fF=!1;J0={},uF=!1;u9={},hF=!1,M6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;S6={},lF=!1;h9={},cF=!1;E6={},dF=!1;l9={},pF=!1;c9={},vF=!1;d9={},mF=!1;p9={},gF=!1;v9={},yF=!1;m9={},bF=!1;zG={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},g9={},_F=!1;y9={},MF=!1,as=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;b9={},SF=!1,Aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;w9={},EF=!1,Kr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;_9={},AF=!1,of=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;M9={},RF=!1;A6={},xF=!1,an=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;R6={},TF=!1,Bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;os={},kF=!1;Wf={},IF=!1;ss={},BF=!1;ZG={},OF=!1,S9={exports:ZG},Fe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;GG={},PF=!1,E9={exports:GG},ze=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ao={},NF=!1;_p={},CF=!1;x6={},LF=!1,DF=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;A9={},$F=!1;R9={},UF=!1;x9={},qF=!1;T9={},jF=!1,pn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;k9={},FF=!1,Fi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;I9={},zF=!1,zi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;B9={},HF=!1,Zr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;O9={},KF=!1,sa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;P9={},ZF=!1,vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;N9={},WF=!1,Oi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;m6e={},GF=!1,C9={exports:m6e};Wy=Ui.EventEmitter,wf={},QG={};fs("ERR_INVALID_OPT_VALUE",function(e,r){return'The value "'+r+'" is invalid for option "'+e+'"'},TypeError),fs("ERR_INVALID_ARG_TYPE",function(e,r,n){let h;var a;let d;return typeof r=="string"&&(a="not ",r.substr(0,a.length)===a)?(h="must not be",r=r.replace(/^not /,"")):h="must be",function(c,v,w){return(w===void 0||w>c.length)&&(w=c.length),c.substring(w-v.length,w)===v}(e," argument")?d=`The ${e} ${h} ${VF(r,"type")}`:d=`The "${e}" ${function(c,v,w){return typeof w!="number"&&(w=0),!(w+v.length>c.length)&&c.indexOf(v,w)!==-1}(e,".")?"property":"argument"} ${h} ${VF(r,"type")}`,d+=`. Received type ${typeof n}`,d},TypeError),fs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),fs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),fs("ERR_STREAM_PREMATURE_CLOSE","Premature close"),fs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),fs("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),fs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),fs("ERR_STREAM_WRITE_AFTER_END","write after end"),fs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),fs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),fs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),wf.codes=QG;eV=function(){throw new Error("Readable.from is not available in the browser")},lE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;tV=function(e,r){if(L9("noDeprecation"))return e;var n=!1;return function(){if(!n){if(L9("throwDeprecation"))throw new Error(r);L9("traceDeprecation")?console.trace(r):console.warn(r),n=!0}return e.apply(this||lE,arguments)}};T6=Pr.Buffer,cE=Yt.inspect,b6e=cE&&cE.custom||"inspect",w6e=function(){function e(){(function(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}var r,n;return r=e,(n=[{key:"push",value:function(h){var a={data:h,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(h){var a={data:h,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var h=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,h}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(h){if(this.length===0)return"";for(var a=this.head,d=""+a.data;a=a.next;)d+=h+a.data;return d}},{key:"concat",value:function(h){if(this.length===0)return T6.alloc(0);for(var a,d,c,v=T6.allocUnsafe(h>>>0),w=this.head,m=0;w;)a=w.data,d=v,c=m,T6.prototype.copy.call(a,d,c),m+=w.data.length,w=w.next;return v}},{key:"consume",value:function(h,a){var d;return h<this.head.data.length?(d=this.head.data.slice(0,h),this.head.data=this.head.data.slice(h)):d=h===this.head.data.length?this.shift():a?this._getString(h):this._getBuffer(h),d}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(h){var a=this.head,d=1,c=a.data;for(h-=c.length;a=a.next;){var v=a.data,w=h>v.length?v.length:h;if(w===v.length?c+=v:c+=v.slice(0,h),(h-=w)==0){w===v.length?(++d,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=v.slice(w));break}++d}return this.length-=d,c}},{key:"_getBuffer",value:function(h){var a=T6.allocUnsafe(h),d=this.head,c=1;for(d.data.copy(a),h-=d.data.length;d=d.next;){var v=d.data,w=h>v.length?v.length:h;if(v.copy(a,a.length-h,0,w),(h-=w)==0){w===v.length?(++c,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=v.slice(w));break}++c}return this.length-=c,a}},{key:b6e,value:function(h,a){return cE(this,function(d){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?YF(Object(v),!0).forEach(function(w){g6e(d,w,v[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(v)):YF(Object(v)).forEach(function(w){Object.defineProperty(d,w,Object.getOwnPropertyDescriptor(v,w))})}return d}({},a,{depth:0,customInspect:!1}))}}])&&y6e(r.prototype,n),e}(),X0=Br;rV={destroy:function(e,r){var n=this,h=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return h||a?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,X0.nextTick(dE,this,e)):X0.nextTick(dE,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(d){!r&&d?n._writableState?n._writableState.errorEmitted?X0.nextTick(ly,n):(n._writableState.errorEmitted=!0,X0.nextTick(JF,n,d)):X0.nextTick(JF,n,d):r?(X0.nextTick(ly,n),r(d)):X0.nextTick(ly,n)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,r){var n=e._readableState,h=e._writableState;n&&n.autoDestroy||h&&h.autoDestroy?e.destroy(r):e.emit("error",r)}},_6e=wf.codes.ERR_INVALID_OPT_VALUE,iV={getHighWaterMark:function(e,r,n,h){var a=function(d,c,v){return d.highWaterMark!=null?d.highWaterMark:c?d[v]:null}(r,h,n);if(a!=null){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new _6e(h?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}},XF=wf.codes.ERR_STREAM_PREMATURE_CLOSE;S6e=function e(r,n,h){if(typeof n=="function")return e(r,null,n);n||(n={}),h=function(A){var k=!1;return function(){if(!k){k=!0;for(var I=arguments.length,B=new Array(I),P=0;P<I;P++)B[P]=arguments[P];A.apply(this,B)}}}(h||M6e);var a=n.readable||n.readable!==!1&&r.readable,d=n.writable||n.writable!==!1&&r.writable,c=function(){r.writable||w()},v=r._writableState&&r._writableState.finished,w=function(){d=!1,v=!0,a||h.call(r)},m=r._readableState&&r._readableState.endEmitted,y=function(){a=!1,m=!0,d||h.call(r)},g=function(A){h.call(r,A)},S=function(){var A;return a&&!m?(r._readableState&&r._readableState.ended||(A=new XF),h.call(r,A)):d&&!v?(r._writableState&&r._writableState.ended||(A=new XF),h.call(r,A)):void 0},R=function(){r.req.on("finish",w)};return function(A){return A.setHeader&&typeof A.abort=="function"}(r)?(r.on("complete",w),r.on("abort",S),r.req?R():r.on("request",R)):d&&!r._writableState&&(r.on("end",c),r.on("close",c)),r.on("end",y),r.on("finish",w),n.error!==!1&&r.on("error",g),r.on("close",S),function(){r.removeListener("complete",w),r.removeListener("abort",S),r.removeListener("request",R),r.req&&r.req.removeListener("finish",w),r.removeListener("end",c),r.removeListener("close",c),r.removeListener("finish",w),r.removeListener("end",y),r.removeListener("error",g),r.removeListener("close",S)}},nV=Br;E6e=S6e,Kh=Symbol("lastResolve"),ll=Symbol("lastReject"),Gp=Symbol("error"),By=Symbol("ended"),bl=Symbol("lastPromise"),pE=Symbol("handlePromise"),wl=Symbol("stream");x6e=Object.getPrototypeOf(function(){}),T6e=Object.setPrototypeOf((Hh(D9={get stream(){return this[wl]},next:function(){var e=this,r=this[Gp];if(r!==null)return Promise.reject(r);if(this[By])return Promise.resolve(Xh(void 0,!0));if(this[wl].destroyed)return new Promise(function(d,c){nV.nextTick(function(){e[Gp]?c(e[Gp]):d(Xh(void 0,!0))})});var n,h=this[bl];if(h)n=new Promise(function(d,c){return function(v,w){d.then(function(){if(c[By])return v(Xh(void 0,!0)),void 0;c[pE](v,w)},w)}}(h,this));else{var a=this[wl].read();if(a!==null)return Promise.resolve(Xh(a,!1));n=new Promise(this[pE])}return this[bl]=n,n}},Symbol.asyncIterator,function(){return this}),Hh(D9,"return",function(){var e=this;return new Promise(function(r,n){e[wl].destroy(null,function(h){if(h)return n(h),void 0;r(Xh(void 0,!0))})})}),D9),x6e),k6e=function(e){var r,n=Object.create(T6e,(Hh(r={},wl,{value:e,writable:!0}),Hh(r,Kh,{value:null,writable:!0}),Hh(r,ll,{value:null,writable:!0}),Hh(r,Gp,{value:null,writable:!0}),Hh(r,By,{value:e._readableState.endEmitted,writable:!0}),Hh(r,pE,{value:function(h,a){var d=n[wl].read();d?(n[bl]=null,n[Kh]=null,n[ll]=null,h(Xh(d,!1))):(n[Kh]=h,n[ll]=a)},writable:!0}),r));return n[bl]=null,E6e(e,function(h){if(h&&h.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[ll];return a!==null&&(n[bl]=null,n[Kh]=null,n[ll]=null,a(h)),n[Gp]=h,void 0}var d=n[Kh];d!==null&&(n[bl]=null,n[Kh]=null,n[ll]=null,d(Xh(void 0,!0))),n[By]=!0}),e.on("readable",R6e.bind(null,n)),n},$9={},QF=!1,I6e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;U9={},ez=!1,B6e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;q9={},tz=!1;P6e=aV(),rz=wf.codes.ERR_STREAM_PREMATURE_CLOSE;JE=function e(r,n,h){if(typeof n=="function")return e(r,null,n);n||(n={}),h=function(A){var k=!1;return function(){if(!k){k=!0;for(var I=arguments.length,B=new Array(I),P=0;P<I;P++)B[P]=arguments[P];A.apply(this,B)}}}(h||N6e);var a=n.readable||n.readable!==!1&&r.readable,d=n.writable||n.writable!==!1&&r.writable,c=function(){r.writable||w()},v=r._writableState&&r._writableState.finished,w=function(){d=!1,v=!0,a||h.call(r)},m=r._readableState&&r._readableState.endEmitted,y=function(){a=!1,m=!0,d||h.call(r)},g=function(A){h.call(r,A)},S=function(){var A;return a&&!m?(r._readableState&&r._readableState.ended||(A=new rz),h.call(r,A)):d&&!v?(r._writableState&&r._writableState.ended||(A=new rz),h.call(r,A)):void 0},R=function(){r.req.on("finish",w)};return function(A){return A.setHeader&&typeof A.abort=="function"}(r)?(r.on("complete",w),r.on("abort",S),r.req?R():r.on("request",R)):d&&!r._writableState&&(r.on("end",c),r.on("close",c)),r.on("end",y),r.on("finish",w),n.error!==!1&&r.on("error",g),r.on("close",S),function(){r.removeListener("complete",w),r.removeListener("abort",S),r.removeListener("request",R),r.req&&r.req.removeListener("finish",w),r.removeListener("end",c),r.removeListener("close",c),r.removeListener("finish",w),r.removeListener("end",y),r.removeListener("error",g),r.removeListener("close",S)}};k6=Pr.Buffer,vE=Yt.inspect,D6e=vE&&vE.custom||"inspect",$6e=function(){function e(){(function(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}var r,n;return r=e,(n=[{key:"push",value:function(h){var a={data:h,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length}},{key:"unshift",value:function(h){var a={data:h,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length}},{key:"shift",value:function(){if(this.length!==0){var h=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,h}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(h){if(this.length===0)return"";for(var a=this.head,d=""+a.data;a=a.next;)d+=h+a.data;return d}},{key:"concat",value:function(h){if(this.length===0)return k6.alloc(0);for(var a,d,c,v=k6.allocUnsafe(h>>>0),w=this.head,m=0;w;)a=w.data,d=v,c=m,k6.prototype.copy.call(a,d,c),m+=w.data.length,w=w.next;return v}},{key:"consume",value:function(h,a){var d;return h<this.head.data.length?(d=this.head.data.slice(0,h),this.head.data=this.head.data.slice(h)):d=h===this.head.data.length?this.shift():a?this._getString(h):this._getBuffer(h),d}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(h){var a=this.head,d=1,c=a.data;for(h-=c.length;a=a.next;){var v=a.data,w=h>v.length?v.length:h;if(w===v.length?c+=v:c+=v.slice(0,h),(h-=w)==0){w===v.length?(++d,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=v.slice(w));break}++d}return this.length-=d,c}},{key:"_getBuffer",value:function(h){var a=k6.allocUnsafe(h),d=this.head,c=1;for(d.data.copy(a),h-=d.data.length;d=d.next;){var v=d.data,w=h>v.length?v.length:h;if(v.copy(a,a.length-h,0,w),(h-=w)==0){w===v.length?(++c,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=v.slice(w));break}++c}return this.length-=c,a}},{key:D6e,value:function(h,a){return vE(this,function(d){for(var c=1;c<arguments.length;c++){var v=arguments[c]!=null?arguments[c]:{};c%2?iz(Object(v),!0).forEach(function(w){C6e(d,w,v[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(v)):iz(Object(v)).forEach(function(w){Object.defineProperty(d,w,Object.getOwnPropertyDescriptor(v,w))})}return d}({},a,{depth:0,customInspect:!1}))}}])&&L6e(r.prototype,n),e}(),Q0=Br;oV={destroy:function(e,r){var n=this,h=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return h||a?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Q0.nextTick(mE,this,e)):Q0.nextTick(mE,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(d){!r&&d?n._writableState?n._writableState.errorEmitted?Q0.nextTick(cy,n):(n._writableState.errorEmitted=!0,Q0.nextTick(nz,n,d)):Q0.nextTick(nz,n,d):r?(Q0.nextTick(cy,n),r(d)):Q0.nextTick(cy,n)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,r){var n=e._readableState,h=e._writableState;n&&n.autoDestroy||h&&h.autoDestroy?e.destroy(r):e.emit("error",r)}},U6e=wf.codes.ERR_INVALID_OPT_VALUE,sV={getHighWaterMark:function(e,r,n,h){var a=function(d,c,v){return d.highWaterMark!=null?d.highWaterMark:c?d[v]:null}(r,h,n);if(a!=null){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new U6e(h?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}},fV=Br;q6e=JE,Wh=Symbol("lastResolve"),cl=Symbol("lastReject"),Vp=Symbol("error"),Oy=Symbol("ended"),_l=Symbol("lastPromise"),gE=Symbol("handlePromise"),Ml=Symbol("stream");z6e=Object.getPrototypeOf(function(){}),H6e=Object.setPrototypeOf((Zh(j9={get stream(){return this[Ml]},next:function(){var e=this,r=this[Vp];if(r!==null)return Promise.reject(r);if(this[Oy])return Promise.resolve(Qh(void 0,!0));if(this[Ml].destroyed)return new Promise(function(d,c){fV.nextTick(function(){e[Vp]?c(e[Vp]):d(Qh(void 0,!0))})});var n,h=this[_l];if(h)n=new Promise(function(d,c){return function(v,w){d.then(function(){if(c[Oy])return v(Qh(void 0,!0)),void 0;c[gE](v,w)},w)}}(h,this));else{var a=this[Ml].read();if(a!==null)return Promise.resolve(Qh(a,!1));n=new Promise(this[gE])}return this[_l]=n,n}},Symbol.asyncIterator,function(){return this}),Zh(j9,"return",function(){var e=this;return new Promise(function(r,n){e[Ml].destroy(null,function(h){if(h)return n(h),void 0;r(Qh(void 0,!0))})})}),j9),z6e),K6e=function(e){var r,n=Object.create(H6e,(Zh(r={},Ml,{value:e,writable:!0}),Zh(r,Wh,{value:null,writable:!0}),Zh(r,cl,{value:null,writable:!0}),Zh(r,Vp,{value:null,writable:!0}),Zh(r,Oy,{value:e._readableState.endEmitted,writable:!0}),Zh(r,gE,{value:function(h,a){var d=n[Ml].read();d?(n[_l]=null,n[Wh]=null,n[cl]=null,h(Qh(d,!1))):(n[Wh]=h,n[cl]=a)},writable:!0}),r));return n[_l]=null,q6e(e,function(h){if(h&&h.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[cl];return a!==null&&(n[_l]=null,n[Wh]=null,n[cl]=null,a(h)),n[Vp]=h,void 0}var d=n[Wh];d!==null&&(n[_l]=null,n[Wh]=null,n[cl]=null,d(Qh(void 0,!0))),n[Oy]=!0}),e.on("readable",F6e.bind(null,n)),n},F9={},az=!1,Z6e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;z9={},oz=!1,G6e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;H9={},sz=!1;V6e=uV(),hV=e2();lV=Hu;Gy=wf.codes,Y6e=Gy.ERR_METHOD_NOT_IMPLEMENTED,J6e=Gy.ERR_MULTIPLE_CALLBACK,X6e=Gy.ERR_TRANSFORM_ALREADY_TRANSFORMING,Q6e=Gy.ERR_TRANSFORM_WITH_LENGTH_0,dy=hV;jr(Hu,dy),Hu.prototype.push=function(e,r){return this._transformState.needTransform=!1,dy.prototype.push.call(this,e,r)},Hu.prototype._transform=function(e,r,n){n(new Y6e("_transform()"))},Hu.prototype._write=function(e,r,n){var h=this._transformState;if(h.writecb=n,h.writechunk=e,h.writeencoding=r,!h.transforming){var a=this._readableState;(h.needTransform||a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}},Hu.prototype._read=function(e){var r=this._transformState;r.writechunk===null||r.transforming?r.needTransform=!0:(r.transforming=!0,this._transform(r.writechunk,r.writeencoding,r.afterTransform))},Hu.prototype._destroy=function(e,r){dy.prototype._destroy.call(this,e,function(n){r(n)})};cV=lV;dV=t2;pV=cV;jr(t2,pV),t2.prototype._transform=function(e,r,n){n(null,e)};rye=dV,vV=wf.codes,iye=vV.ERR_MISSING_ARGS,nye=vV.ERR_STREAM_DESTROYED;fye=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var h,a=sye(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new iye("streams");var d=r.map(function(c,v){var w=v<r.length-1;return aye(c,w,v>0,function(m){h||(h=m),m&&d.forEach(hz),w||(d.forEach(hz),a(h))})});return r.reduce(oye)},yE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;mV=bs;bE=Ui.EventEmitter;jr(bs,bE),bs.Readable=P6e,bs.Writable=V6e,bs.Duplex=hV,bs.Transform=cV,bs.PassThrough=rye,bs.finished=JE,bs.pipeline=fye,bs.Stream=bs,bs.prototype.pipe=function(e,r){var n=this||yE;function h(y){e.writable&&e.write(y)===!1&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",h),e.on("drain",a),e._isStdio||r&&r.end===!1||(n.on("end",c),n.on("close",v));var d=!1;function c(){d||(d=!0,e.end())}function v(){d||(d=!0,typeof e.destroy=="function"&&e.destroy())}function w(y){if(m(),bE.listenerCount(this||yE,"error")===0)throw y}function m(){n.removeListener("data",h),e.removeListener("drain",a),n.removeListener("end",c),n.removeListener("close",v),n.removeListener("error",w),e.removeListener("error",w),n.removeListener("end",m),n.removeListener("close",m),e.removeListener("close",m)}return n.on("error",w),e.on("error",w),n.on("end",m),n.on("close",m),e.on("close",m),e.emit("pipe",n),e};Ss=mV;Ss.Readable;Ss.Writable;Ss.Duplex;Ss.Transform;Ss.PassThrough;Ss.finished;Ss.pipeline;Ss.Stream;Z9={},lz=!1,Sn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;W9={},cz=!1;G9={},dz=!1;V9={},pz=!1;Y9={},vz=!1;bV={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},J9={},mz=!1;X9={},gz=!1;Q9={},yz=!1,I6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;e_={},bz=!1;t_={},wz=!1,sf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;r_={},_z=!1,Ro=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;B6={},Mz=!1;xo={},Sz=!1;i_={},Ez=!1;n_={},Az=!1;a_={},Rz=!1;o_={},xz=!1;s_={},Tz=!1;el={},kz=!1;f_={},Iz=!1,O6=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;P6={},Bz=!1;u_={},Oz=!1;N6={},Pz=!1;h_={},Nz=!1;l_={},Cz=!1;c_={},Lz=!1;d_={},Dz=!1;p_={},$z=!1;v_={},Uz=!1;TV={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},m_={},jz=!1;g_={},Fz=!1,us=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;y_={},zz=!1,Ra=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;b_={},Hz=!1,Wr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;w_={},Kz=!1,ff=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;__={},Zz=!1;C6={},Wz=!1,on=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;L6={},Gz=!1,Pi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;hs={},Vz=!1;Gf={},Yz=!1;ls={},Jz=!1;BV={},Xz=!1,M_={exports:BV},He=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;PV={},Qz=!1,S_={exports:PV},Ke=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Ny=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,uo={},Tye=function(e,r){if(e.indexOf)return e.indexOf(r);for(var n=0;n<e.length;n++)if(e[n]===r)return n;return-1},id=function(e){if(Object.keys)return Object.keys(e);var r=[];for(var n in e)r.push(n);return r},tl=function(e,r){if(e.forEach)return e.forEach(r);for(var n=0;n<e.length;n++)r(e[n],n,e)},kye=function(){try{return Object.defineProperty({},"_",{}),function(e,r,n){Object.defineProperty(e,r,{writable:!0,enumerable:!1,configurable:!0,value:n})}}catch{return function(r,n,h){r[n]=h}}}(),eH=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];py.prototype={};Xf=uo.Script=function(e){if(!((this||Ny)instanceof Xf))return new Xf(e);(this||Ny).code=e};Xf.prototype.runInContext=function(e){if(!(e instanceof py))throw new TypeError("needs a 'context' argument.");var r=document.createElement("iframe");r.style||(r.style={}),r.style.display="none",document.body.appendChild(r);var n=r.contentWindow,h=n.eval,a=n.execScript;!h&&a&&(a.call(n,"null"),h=n.eval),tl(id(e),function(v){n[v]=e[v]}),tl(eH,function(v){e[v]&&(n[v]=e[v])});var d=id(n),c=h.call(n,(this||Ny).code);return tl(id(n),function(v){(v in e||Tye(d,v)===-1)&&(e[v]=n[v])}),tl(eH,function(v){v in e||kye(e,v,n[v])}),document.body.removeChild(r),c},Xf.prototype.runInThisContext=function(){return eval((this||Ny).code)},Xf.prototype.runInNewContext=function(e){var r=Xf.createContext(e),n=this.runInContext(r);return e&&tl(id(r),function(h){e[h]=r[h]}),n},tl(id(Xf.prototype),function(e){uo[e]=Xf[e]=function(r){var n=Xf(r);return n[e].apply(n,[].slice.call(arguments,1))}}),uo.isContext=function(e){return e instanceof py},uo.createScript=function(e){return uo.Script(e)},uo.createContext=Xf.createContext=function(e){var r=new py;return typeof e=="object"&&tl(id(e),function(n){r[n]=e[n]}),r};uo.Script;uo.createContext;uo.createScript;uo.isContext;uo.runInContext;uo.runInNewContext;uo.runInThisContext;tH=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Iye=Br,Bye=vi.Buffer,D6=tH.crypto||tH.msCrypto,Rd=D6&&D6.getRandomValues?function(e,r){if(e>4294967295)throw new RangeError("requested too many random bytes");var n=Bye.allocUnsafe(e);if(e>0)if(e>65536)for(var h=0;h<e;h+=65536)D6.getRandomValues(n.slice(h,h+65536));else D6.getRandomValues(n);return typeof r=="function"?Iye.nextTick(function(){r(null,n)}):n}:function(){throw new Error(`Secure random number generation is not supported by this browser.
136
136
  Use Chrome, Firefox or Internet Explorer 11`)},vy=vi.Buffer,NV=Ss.Transform;jr(Uh,NV),Uh.prototype._transform=function(e,r,n){var h=null;try{this.update(e,r)}catch(a){h=a}n(h)},Uh.prototype._flush=function(e){var r=null;try{this.push(this.digest())}catch(n){r=n}e(r)},Uh.prototype.update=function(e,r){if(function(v,w){if(!vy.isBuffer(v)&&typeof v!="string")throw new TypeError(w+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");vy.isBuffer(e)||(e=vy.from(e,r));for(var n=this._block,h=0;this._blockOffset+e.length-h>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)n[a++]=e[h++];this._update(),this._blockOffset=0}for(;h<e.length;)n[this._blockOffset++]=e[h++];for(var d=0,c=8*e.length;c>0;++d)this._length[d]+=c,(c=this._length[d]/4294967296|0)>0&&(this._length[d]-=4294967296*c);return this},Uh.prototype._update=function(){throw new Error("_update is not implemented")},Uh.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var r=this._digest();e!==void 0&&(r=r.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return r},Uh.prototype._digest=function(){throw new Error("_digest is not implemented")};CV=Uh,Oye=jr,LV=CV,Pye=vi.Buffer,Nye=new Array(16);Oye(my,LV),my.prototype._update=function(){for(var e=Nye,r=0;r<16;++r)e[r]=this._block.readInt32LE(4*r);var n=this._a,h=this._b,a=this._c,d=this._d;n=xa(n,h,a,d,e[0],3614090360,7),d=xa(d,n,h,a,e[1],3905402710,12),a=xa(a,d,n,h,e[2],606105819,17),h=xa(h,a,d,n,e[3],3250441966,22),n=xa(n,h,a,d,e[4],4118548399,7),d=xa(d,n,h,a,e[5],1200080426,12),a=xa(a,d,n,h,e[6],2821735955,17),h=xa(h,a,d,n,e[7],4249261313,22),n=xa(n,h,a,d,e[8],1770035416,7),d=xa(d,n,h,a,e[9],2336552879,12),a=xa(a,d,n,h,e[10],4294925233,17),h=xa(h,a,d,n,e[11],2304563134,22),n=xa(n,h,a,d,e[12],1804603682,7),d=xa(d,n,h,a,e[13],4254626195,12),a=xa(a,d,n,h,e[14],2792965006,17),n=Ta(n,h=xa(h,a,d,n,e[15],1236535329,22),a,d,e[1],4129170786,5),d=Ta(d,n,h,a,e[6],3225465664,9),a=Ta(a,d,n,h,e[11],643717713,14),h=Ta(h,a,d,n,e[0],3921069994,20),n=Ta(n,h,a,d,e[5],3593408605,5),d=Ta(d,n,h,a,e[10],38016083,9),a=Ta(a,d,n,h,e[15],3634488961,14),h=Ta(h,a,d,n,e[4],3889429448,20),n=Ta(n,h,a,d,e[9],568446438,5),d=Ta(d,n,h,a,e[14],3275163606,9),a=Ta(a,d,n,h,e[3],4107603335,14),h=Ta(h,a,d,n,e[8],1163531501,20),n=Ta(n,h,a,d,e[13],2850285829,5),d=Ta(d,n,h,a,e[2],4243563512,9),a=Ta(a,d,n,h,e[7],1735328473,14),n=ka(n,h=Ta(h,a,d,n,e[12],2368359562,20),a,d,e[5],4294588738,4),d=ka(d,n,h,a,e[8],2272392833,11),a=ka(a,d,n,h,e[11],1839030562,16),h=ka(h,a,d,n,e[14],4259657740,23),n=ka(n,h,a,d,e[1],2763975236,4),d=ka(d,n,h,a,e[4],1272893353,11),a=ka(a,d,n,h,e[7],4139469664,16),h=ka(h,a,d,n,e[10],3200236656,23),n=ka(n,h,a,d,e[13],681279174,4),d=ka(d,n,h,a,e[0],3936430074,11),a=ka(a,d,n,h,e[3],3572445317,16),h=ka(h,a,d,n,e[6],76029189,23),n=ka(n,h,a,d,e[9],3654602809,4),d=ka(d,n,h,a,e[12],3873151461,11),a=ka(a,d,n,h,e[15],530742520,16),n=Ia(n,h=ka(h,a,d,n,e[2],3299628645,23),a,d,e[0],4096336452,6),d=Ia(d,n,h,a,e[7],1126891415,10),a=Ia(a,d,n,h,e[14],2878612391,15),h=Ia(h,a,d,n,e[5],4237533241,21),n=Ia(n,h,a,d,e[12],1700485571,6),d=Ia(d,n,h,a,e[3],2399980690,10),a=Ia(a,d,n,h,e[10],4293915773,15),h=Ia(h,a,d,n,e[1],2240044497,21),n=Ia(n,h,a,d,e[8],1873313359,6),d=Ia(d,n,h,a,e[15],4264355552,10),a=Ia(a,d,n,h,e[6],2734768916,15),h=Ia(h,a,d,n,e[13],1309151649,21),n=Ia(n,h,a,d,e[4],4149444226,6),d=Ia(d,n,h,a,e[11],3174756917,10),a=Ia(a,d,n,h,e[2],718787259,15),h=Ia(h,a,d,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+h|0,this._c=this._c+a|0,this._d=this._d+d|0},my.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=Pye.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};tA=my,E_=Pr.Buffer,Cye=jr,DV=CV,Lye=new Array(16),Mp=[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],Sp=[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],Ep=[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],Ap=[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],Rp=[0,1518500249,1859775393,2400959708,2840853838],xp=[1352829926,1548603684,1836072691,2053994217,0];Cye(gy,DV),gy.prototype._update=function(){for(var e=Lye,r=0;r<16;++r)e[r]=this._block.readInt32LE(4*r);for(var n=0|this._a,h=0|this._b,a=0|this._c,d=0|this._d,c=0|this._e,v=0|this._a,w=0|this._b,m=0|this._c,y=0|this._d,g=0|this._e,S=0;S<80;S+=1){var R,A;S<16?(R=rH(n,h,a,d,c,e[Mp[S]],Rp[0],Ep[S]),A=oH(v,w,m,y,g,e[Sp[S]],xp[0],Ap[S])):S<32?(R=iH(n,h,a,d,c,e[Mp[S]],Rp[1],Ep[S]),A=aH(v,w,m,y,g,e[Sp[S]],xp[1],Ap[S])):S<48?(R=nH(n,h,a,d,c,e[Mp[S]],Rp[2],Ep[S]),A=nH(v,w,m,y,g,e[Sp[S]],xp[2],Ap[S])):S<64?(R=aH(n,h,a,d,c,e[Mp[S]],Rp[3],Ep[S]),A=iH(v,w,m,y,g,e[Sp[S]],xp[3],Ap[S])):(R=oH(n,h,a,d,c,e[Mp[S]],Rp[4],Ep[S]),A=rH(v,w,m,y,g,e[Sp[S]],xp[4],Ap[S])),n=c,c=d,d=Tl(a,10),a=h,h=R,v=g,g=y,y=Tl(m,10),m=w,w=A}var k=this._b+a+y|0;this._b=this._c+d+g|0,this._c=this._d+c+v|0,this._d=this._e+n+w|0,this._e=this._a+h+m|0,this._a=k},gy.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=E_.alloc?E_.alloc(20):new E_(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};rA=gy,vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,$V=vi.Buffer;yy.prototype.update=function(e,r){typeof e=="string"&&(r=r||"utf8",e=$V.from(e,r));for(var n=(this||vn)._block,h=(this||vn)._blockSize,a=e.length,d=(this||vn)._len,c=0;c<a;){for(var v=d%h,w=Math.min(a-c,h-v),m=0;m<w;m++)n[v+m]=e[c+m];c+=w,(d+=w)%h==0&&this._update(n)}return(this||vn)._len+=a,this||vn},yy.prototype.digest=function(e){var r=(this||vn)._len%(this||vn)._blockSize;(this||vn)._block[r]=128,(this||vn)._block.fill(0,r+1),r>=(this||vn)._finalSize&&(this._update((this||vn)._block),(this||vn)._block.fill(0));var n=8*(this||vn)._len;if(n<=4294967295)(this||vn)._block.writeUInt32BE(n,(this||vn)._blockSize-4);else{var h=(4294967295&n)>>>0,a=(n-h)/4294967296;(this||vn)._block.writeUInt32BE(a,(this||vn)._blockSize-8),(this||vn)._block.writeUInt32BE(h,(this||vn)._blockSize-4)}this._update((this||vn)._block);var d=this._hash();return e?d.toString(e):d},yy.prototype._update=function(){throw new Error("_update must be implemented by subclass")};xd=yy,Gr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Dye=jr,UV=xd,$ye=vi.Buffer,Uye=[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],qye=new Array(64);Dye(Lp,UV),Lp.prototype.init=function(){return(this||Gr)._a=1779033703,(this||Gr)._b=3144134277,(this||Gr)._c=1013904242,(this||Gr)._d=2773480762,(this||Gr)._e=1359893119,(this||Gr)._f=2600822924,(this||Gr)._g=528734635,(this||Gr)._h=1541459225,this||Gr},Lp.prototype._update=function(e){for(var r,n=(this||Gr)._w,h=0|(this||Gr)._a,a=0|(this||Gr)._b,d=0|(this||Gr)._c,c=0|(this||Gr)._d,v=0|(this||Gr)._e,w=0|(this||Gr)._f,m=0|(this||Gr)._g,y=0|(this||Gr)._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((r=n[g-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+n[g-7]+Kye(n[g-15])+n[g-16];for(var S=0;S<64;++S){var R=y+Hye(v)+jye(v,w,m)+Uye[S]+n[S]|0,A=zye(h)+Fye(h,a,d)|0;y=m,m=w,w=v,v=c+R|0,c=d,d=a,a=h,h=R+A|0}(this||Gr)._a=h+(this||Gr)._a|0,(this||Gr)._b=a+(this||Gr)._b|0,(this||Gr)._c=d+(this||Gr)._c|0,(this||Gr)._d=c+(this||Gr)._d|0,(this||Gr)._e=v+(this||Gr)._e|0,(this||Gr)._f=w+(this||Gr)._f|0,(this||Gr)._g=m+(this||Gr)._g|0,(this||Gr)._h=y+(this||Gr)._h|0},Lp.prototype._hash=function(){var e=$ye.allocUnsafe(32);return e.writeInt32BE((this||Gr)._a,0),e.writeInt32BE((this||Gr)._b,4),e.writeInt32BE((this||Gr)._c,8),e.writeInt32BE((this||Gr)._d,12),e.writeInt32BE((this||Gr)._e,16),e.writeInt32BE((this||Gr)._f,20),e.writeInt32BE((this||Gr)._g,24),e.writeInt32BE((this||Gr)._h,28),e};qV=Lp,Hi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Zye=jr,jV=xd,Wye=vi.Buffer,Gye=[1518500249,1859775393,-1894007588,-899497514],Vye=new Array(80);Zye(Dp,jV),Dp.prototype.init=function(){return(this||Hi)._a=1732584193,(this||Hi)._b=4023233417,(this||Hi)._c=2562383102,(this||Hi)._d=271733878,(this||Hi)._e=3285377520,this||Hi},Dp.prototype._update=function(e){for(var r,n=(this||Hi)._w,h=0|(this||Hi)._a,a=0|(this||Hi)._b,d=0|(this||Hi)._c,c=0|(this||Hi)._d,v=0|(this||Hi)._e,w=0;w<16;++w)n[w]=e.readInt32BE(4*w);for(;w<80;++w)n[w]=n[w-3]^n[w-8]^n[w-14]^n[w-16];for(var m=0;m<80;++m){var y=~~(m/20),g=0|((r=h)<<5|r>>>27)+Jye(y,a,d,c)+v+n[m]+Gye[y];v=c,c=d,d=Yye(a),a=h,h=g}(this||Hi)._a=h+(this||Hi)._a|0,(this||Hi)._b=a+(this||Hi)._b|0,(this||Hi)._c=d+(this||Hi)._c|0,(this||Hi)._d=c+(this||Hi)._d|0,(this||Hi)._e=v+(this||Hi)._e|0},Dp.prototype._hash=function(){var e=Wye.allocUnsafe(20);return e.writeInt32BE(0|(this||Hi)._a,0),e.writeInt32BE(0|(this||Hi)._b,4),e.writeInt32BE(0|(this||Hi)._c,8),e.writeInt32BE(0|(this||Hi)._d,12),e.writeInt32BE(0|(this||Hi)._e,16),e};Xye=Dp,Ki=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qye=jr,FV=xd,ebe=vi.Buffer,tbe=[1518500249,1859775393,-1894007588,-899497514],rbe=new Array(80);Qye($p,FV),$p.prototype.init=function(){return(this||Ki)._a=1732584193,(this||Ki)._b=4023233417,(this||Ki)._c=2562383102,(this||Ki)._d=271733878,(this||Ki)._e=3285377520,this||Ki},$p.prototype._update=function(e){for(var r,n=(this||Ki)._w,h=0|(this||Ki)._a,a=0|(this||Ki)._b,d=0|(this||Ki)._c,c=0|(this||Ki)._d,v=0|(this||Ki)._e,w=0;w<16;++w)n[w]=e.readInt32BE(4*w);for(;w<80;++w)n[w]=(r=n[w-3]^n[w-8]^n[w-14]^n[w-16])<<1|r>>>31;for(var m=0;m<80;++m){var y=~~(m/20),g=ibe(h)+abe(y,a,d,c)+v+n[m]+tbe[y]|0;v=c,c=d,d=nbe(a),a=h,h=g}(this||Ki)._a=h+(this||Ki)._a|0,(this||Ki)._b=a+(this||Ki)._b|0,(this||Ki)._c=d+(this||Ki)._c|0,(this||Ki)._d=c+(this||Ki)._d|0,(this||Ki)._e=v+(this||Ki)._e|0},$p.prototype._hash=function(){var e=ebe.allocUnsafe(20);return e.writeInt32BE(0|(this||Ki)._a,0),e.writeInt32BE(0|(this||Ki)._b,4),e.writeInt32BE(0|(this||Ki)._c,8),e.writeInt32BE(0|(this||Ki)._d,12),e.writeInt32BE(0|(this||Ki)._e,16),e};obe=$p,ca=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,sbe=jr,fbe=qV,ube=xd,hbe=vi.Buffer,lbe=new Array(64);sbe(by,fbe),by.prototype.init=function(){return(this||ca)._a=3238371032,(this||ca)._b=914150663,(this||ca)._c=812702999,(this||ca)._d=4144912697,(this||ca)._e=4290775857,(this||ca)._f=1750603025,(this||ca)._g=1694076839,(this||ca)._h=3204075428,this||ca},by.prototype._hash=function(){var e=hbe.allocUnsafe(28);return e.writeInt32BE((this||ca)._a,0),e.writeInt32BE((this||ca)._b,4),e.writeInt32BE((this||ca)._c,8),e.writeInt32BE((this||ca)._d,12),e.writeInt32BE((this||ca)._e,16),e.writeInt32BE((this||ca)._f,20),e.writeInt32BE((this||ca)._g,24),e};cbe=by,mr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,dbe=jr,zV=xd,pbe=vi.Buffer,sH=[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,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],vbe=new Array(160);dbe(Up,zV),Up.prototype.init=function(){return(this||mr)._ah=1779033703,(this||mr)._bh=3144134277,(this||mr)._ch=1013904242,(this||mr)._dh=2773480762,(this||mr)._eh=1359893119,(this||mr)._fh=2600822924,(this||mr)._gh=528734635,(this||mr)._hh=1541459225,(this||mr)._al=4089235720,(this||mr)._bl=2227873595,(this||mr)._cl=4271175723,(this||mr)._dl=1595750129,(this||mr)._el=2917565137,(this||mr)._fl=725511199,(this||mr)._gl=4215389547,(this||mr)._hl=327033209,this||mr},Up.prototype._update=function(e){for(var r=(this||mr)._w,n=0|(this||mr)._ah,h=0|(this||mr)._bh,a=0|(this||mr)._ch,d=0|(this||mr)._dh,c=0|(this||mr)._eh,v=0|(this||mr)._fh,w=0|(this||mr)._gh,m=0|(this||mr)._hh,y=0|(this||mr)._al,g=0|(this||mr)._bl,S=0|(this||mr)._cl,R=0|(this||mr)._dl,A=0|(this||mr)._el,k=0|(this||mr)._fl,I=0|(this||mr)._gl,B=0|(this||mr)._hl,P=0;P<32;P+=2)r[P]=e.readInt32BE(4*P),r[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var C=r[P-30],q=r[P-30+1],K=mbe(C,q),V=gbe(q,C),j=ybe(C=r[P-4],q=r[P-4+1]),z=bbe(q,C),J=r[P-14],E=r[P-14+1],i=r[P-32],s=r[P-32+1],f=V+E|0,l=K+J+fa(f,V)|0;l=(l=l+j+fa(f=f+z|0,z)|0)+i+fa(f=f+s|0,s)|0,r[P]=l,r[P+1]=f}for(var p=0;p<160;p+=2){l=r[p],f=r[p+1];var _=uH(n,h,a),x=uH(y,g,S),o=hH(n,y),t=hH(y,n),u=lH(c,A),b=lH(A,c),M=sH[p],T=sH[p+1],D=fH(c,v,w),Q=fH(A,k,I),W=B+b|0,X=m+u+fa(W,B)|0;X=(X=(X=X+D+fa(W=W+Q|0,Q)|0)+M+fa(W=W+T|0,T)|0)+l+fa(W=W+f|0,f)|0;var G=t+x|0,Y=o+_+fa(G,t)|0;m=w,B=I,w=v,I=k,v=c,k=A,c=d+X+fa(A=R+W|0,R)|0,d=a,R=S,a=h,S=g,h=n,g=y,n=X+Y+fa(y=W+G|0,W)|0}(this||mr)._al=(this||mr)._al+y|0,(this||mr)._bl=(this||mr)._bl+g|0,(this||mr)._cl=(this||mr)._cl+S|0,(this||mr)._dl=(this||mr)._dl+R|0,(this||mr)._el=(this||mr)._el+A|0,(this||mr)._fl=(this||mr)._fl+k|0,(this||mr)._gl=(this||mr)._gl+I|0,(this||mr)._hl=(this||mr)._hl+B|0,(this||mr)._ah=(this||mr)._ah+n+fa((this||mr)._al,y)|0,(this||mr)._bh=(this||mr)._bh+h+fa((this||mr)._bl,g)|0,(this||mr)._ch=(this||mr)._ch+a+fa((this||mr)._cl,S)|0,(this||mr)._dh=(this||mr)._dh+d+fa((this||mr)._dl,R)|0,(this||mr)._eh=(this||mr)._eh+c+fa((this||mr)._el,A)|0,(this||mr)._fh=(this||mr)._fh+v+fa((this||mr)._fl,k)|0,(this||mr)._gh=(this||mr)._gh+w+fa((this||mr)._gl,I)|0,(this||mr)._hh=(this||mr)._hh+m+fa((this||mr)._hl,B)|0},Up.prototype._hash=function(){var e=pbe.allocUnsafe(64);function r(n,h,a){e.writeInt32BE(n,a),e.writeInt32BE(h,a+4)}return r((this||mr)._ah,(this||mr)._al,0),r((this||mr)._bh,(this||mr)._bl,8),r((this||mr)._ch,(this||mr)._cl,16),r((this||mr)._dh,(this||mr)._dl,24),r((this||mr)._eh,(this||mr)._el,32),r((this||mr)._fh,(this||mr)._fl,40),r((this||mr)._gh,(this||mr)._gl,48),r((this||mr)._hh,(this||mr)._hl,56),e};HV=Up,Ni=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,wbe=jr,_be=HV,Mbe=xd,Sbe=vi.Buffer,Ebe=new Array(160);wbe(wy,_be),wy.prototype.init=function(){return(this||Ni)._ah=3418070365,(this||Ni)._bh=1654270250,(this||Ni)._ch=2438529370,(this||Ni)._dh=355462360,(this||Ni)._eh=1731405415,(this||Ni)._fh=2394180231,(this||Ni)._gh=3675008525,(this||Ni)._hh=1203062813,(this||Ni)._al=3238371032,(this||Ni)._bl=914150663,(this||Ni)._cl=812702999,(this||Ni)._dl=4144912697,(this||Ni)._el=4290775857,(this||Ni)._fl=1750603025,(this||Ni)._gl=1694076839,(this||Ni)._hl=3204075428,this||Ni},wy.prototype._hash=function(){var e=Sbe.allocUnsafe(48);function r(n,h,a){e.writeInt32BE(n,a),e.writeInt32BE(h,a+4)}return r((this||Ni)._ah,(this||Ni)._al,0),r((this||Ni)._bh,(this||Ni)._bl,8),r((this||Ni)._ch,(this||Ni)._cl,16),r((this||Ni)._dh,(this||Ni)._dl,24),r((this||Ni)._eh,(this||Ni)._el,32),r((this||Ni)._fh,(this||Ni)._fl,40),e};Abe=wy,KV={exports:qh={}};(qh=KV.exports=function(e){e=e.toLowerCase();var r=qh[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=Xye,qh.sha1=obe,qh.sha224=cbe,qh.sha256=qV,qh.sha384=Abe,qh.sha512=HV;iA=KV.exports,xn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,cH=vi.Buffer,ZV=Ss.Transform,Rbe=$n.StringDecoder;jr(cf,ZV),cf.prototype.update=function(e,r,n){typeof e=="string"&&(e=cH.from(e,r));var h=this._update(e);return(this||xn).hashMode?this||xn:(n&&(h=this._toString(h,n)),h)},cf.prototype.setAutoPadding=function(){},cf.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},cf.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},cf.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},cf.prototype._transform=function(e,r,n){var h;try{(this||xn).hashMode?this._update(e):this.push(this._update(e))}catch(a){h=a}finally{n(h)}},cf.prototype._flush=function(e){var r;try{this.push(this.__final())}catch(n){r=n}e(r)},cf.prototype._finalOrDigest=function(e){var r=this.__final()||cH.alloc(0);return e&&(r=this._toString(r,e,!0)),r},cf.prototype._toString=function(e,r,n){if((this||xn)._decoder||((this||xn)._decoder=new Rbe(r),(this||xn)._encoding=r),(this||xn)._encoding!==r)throw new Error("can't switch encodings");var h=(this||xn)._decoder.write(e);return n&&(h+=(this||xn)._decoder.end()),h};r0=cf,xbe=tA,Tbe=rA,kbe=iA,WV=r0;jr(_y,WV),_y.prototype._update=function(e){this._hash.update(e)},_y.prototype._final=function(){return this._hash.digest()};l2=function(e){return(e=e.toLowerCase())==="md5"?new xbe:e==="rmd160"||e==="ripemd160"?new Tbe:new _y(kbe(e))},Ibe=tA,GV=function(e){return new Ibe().update(e).digest()},Bbe=jr,Sl=vi.Buffer,VV=r0,Obe=Sl.alloc(128);Bbe(My,VV),My.prototype._update=function(e){this._hash.push(e)},My.prototype._final=function(){var e=this._alg(Sl.concat(this._hash));return this._alg(Sl.concat([this._opad,e]))};Pbe=jr,Nbe=My,YV=r0,qp=vi.Buffer,Cbe=GV,wE=rA,_E=iA,Lbe=qp.alloc(128);Pbe(Yp,YV),Yp.prototype._update=function(e){this._hash.update(e)},Yp.prototype._final=function(){var e=this._hash.digest();return(this._alg==="rmd160"?new wE:_E(this._alg)).update(this._opad).update(e).digest()};JV=function(e,r){return(e=e.toLowerCase())==="rmd160"||e==="ripemd160"?new Yp("rmd160",r):e==="md5"?new Nbe(Cbe,r):new Yp(e,r)},XV={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}},Dbe=Pr.Buffer,$be=Math.pow(2,30)-1;QV=function(e,r,n,h){if(dH(e,"Password"),dH(r,"Salt"),typeof n!="number")throw new TypeError("Iterations not a number");if(n<0)throw new TypeError("Bad iterations");if(typeof h!="number")throw new TypeError("Key length not a number");if(h<0||h>$be||h!=h)throw new TypeError("Bad key length")},pH=Br;pH.browser?ME="utf-8":ME=parseInt(pH.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";eY=ME,vf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ube=GV,qbe=rA,jbe=iA,Fbe=QV,vH=eY,gf=vi.Buffer,zbe=gf.alloc(128),Sy={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};tY.prototype.run=function(e,r){return e.copy(r,(this||vf).blocksize),this.hash(r).copy((this||vf).opad,(this||vf).blocksize),this.hash((this||vf).opad)};rY=function(e,r,n,h,a){Fbe(e,r,n,h),gf.isBuffer(e)||(e=gf.from(e,vH)),gf.isBuffer(r)||(r=gf.from(r,vH));var d=new tY(a=a||"sha1",e,r.length),c=gf.allocUnsafe(h),v=gf.allocUnsafe(r.length+4);r.copy(v,0,0,r.length);for(var w=0,m=Sy[a],y=Math.ceil(h/m),g=1;g<=y;g++){v.writeUInt32BE(g,r.length);for(var S=d.run(v,d.ipad1),R=S,A=1;A<n;A++){R=d.run(R,d.ipad2);for(var k=0;k<m;k++)S[k]^=R[k]}S.copy(c,w),w+=m}return c},Jp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,R_=Br,Hbe=QV,mH=eY,gH=rY,ud=vi.Buffer,Xp=Jp.crypto&&Jp.crypto.subtle,Kbe={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},x_=[];Zbe=function(e,r,n,h,a,d){typeof a=="function"&&(d=a,a=void 0);var c=Kbe[(a=a||"sha1").toLowerCase()];if(!c||typeof Jp.Promise!="function")return R_.nextTick(function(){var v;try{v=gH(e,r,n,h,a)}catch(w){return d(w)}d(null,v)});if(Hbe(e,r,n,h),typeof d!="function")throw new Error("No callback provided to pbkdf2");ud.isBuffer(e)||(e=ud.from(e,mH)),ud.isBuffer(r)||(r=ud.from(r,mH)),function(v,w){v.then(function(m){R_.nextTick(function(){w(null,m)})},function(m){R_.nextTick(function(){w(m)})})}(function(v){if(Jp.process&&!Jp.process.browser||!Xp||!Xp.importKey||!Xp.deriveBits)return Promise.resolve(!1);if(x_[v]!==void 0)return x_[v];var w=yH(A_=A_||ud.alloc(8),A_,10,128,v).then(function(){return!0}).catch(function(){return!1});return x_[v]=w,w}(c).then(function(v){return v?yH(e,r,n,h,c):gH(e,r,n,h,a)}),d)},Cy={};Cy.pbkdf2=Zbe,Cy.pbkdf2Sync=rY;iY=bH,bH.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};Es=iY,kl={readUInt32BE:function(e,r){return(e[0+r]<<24|e[1+r]<<16|e[2+r]<<8|e[3+r])>>>0},writeUInt32BE:function(e,r,n){e[0+n]=r>>>24,e[1+n]=r>>>16&255,e[2+n]=r>>>8&255,e[3+n]=255&r},ip:function(e,r,n,h){for(var a=0,d=0,c=6;c>=0;c-=2){for(var v=0;v<=24;v+=8)a<<=1,a|=r>>>v+c&1;for(v=0;v<=24;v+=8)a<<=1,a|=e>>>v+c&1}for(c=6;c>=0;c-=2){for(v=1;v<=25;v+=8)d<<=1,d|=r>>>v+c&1;for(v=1;v<=25;v+=8)d<<=1,d|=e>>>v+c&1}n[h+0]=a>>>0,n[h+1]=d>>>0},rip:function(e,r,n,h){for(var a=0,d=0,c=0;c<4;c++)for(var v=24;v>=0;v-=8)a<<=1,a|=r>>>v+c&1,a<<=1,a|=e>>>v+c&1;for(c=4;c<8;c++)for(v=24;v>=0;v-=8)d<<=1,d|=r>>>v+c&1,d<<=1,d|=e>>>v+c&1;n[h+0]=a>>>0,n[h+1]=d>>>0},pc1:function(e,r,n,h){for(var a=0,d=0,c=7;c>=5;c--){for(var v=0;v<=24;v+=8)a<<=1,a|=r>>v+c&1;for(v=0;v<=24;v+=8)a<<=1,a|=e>>v+c&1}for(v=0;v<=24;v+=8)a<<=1,a|=r>>v+c&1;for(c=1;c<=3;c++){for(v=0;v<=24;v+=8)d<<=1,d|=r>>v+c&1;for(v=0;v<=24;v+=8)d<<=1,d|=e>>v+c&1}for(v=0;v<=24;v+=8)d<<=1,d|=e>>v+c&1;n[h+0]=a>>>0,n[h+1]=d>>>0},r28shl:function(e,r){return e<<r&268435455|e>>>28-r}},$6=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];kl.pc2=function(e,r,n,h){for(var a=0,d=0,c=$6.length>>>1,v=0;v<c;v++)a<<=1,a|=e>>>$6[v]&1;for(v=c;v<$6.length;v++)d<<=1,d|=r>>>$6[v]&1;n[h+0]=a>>>0,n[h+1]=d>>>0},kl.expand=function(e,r,n){var h=0,a=0;h=(1&e)<<5|e>>>27;for(var d=23;d>=15;d-=4)h<<=6,h|=e>>>d&63;for(d=11;d>=3;d-=4)a|=e>>>d&63,a<<=6;a|=(31&e)<<1|e>>>31,r[n+0]=h>>>0,r[n+1]=a>>>0};wH=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];kl.substitute=function(e,r){for(var n=0,h=0;h<4;h++)n<<=4,n|=wH[64*h+(e>>>18-6*h&63)];for(h=0;h<4;h++)n<<=4,n|=wH[256+64*h+(r>>>18-6*h&63)];return n>>>0};_H=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];kl.permute=function(e){for(var r=0,n=0;n<_H.length;n++)r<<=1,r|=e>>>_H[n]&1;return r>>>0},kl.padSplit=function(e,r,n){for(var h=e.toString(2);h.length<r;)h="0"+h;for(var a=[],d=0;d<r;d+=n)a.push(h.slice(d,d+n));return a.join(" ")};Wbe=Es;nY=cs,cs.prototype._init=function(){},cs.prototype.update=function(e){return e.length===0?[]:this.type==="decrypt"?this._updateDecrypt(e):this._updateEncrypt(e)},cs.prototype._buffer=function(e,r){for(var n=Math.min(this.buffer.length-this.bufferOff,e.length-r),h=0;h<n;h++)this.buffer[this.bufferOff+h]=e[r+h];return this.bufferOff+=n,n},cs.prototype._flushBuffer=function(e,r){return this._update(this.buffer,0,e,r),this.bufferOff=0,this.blockSize},cs.prototype._updateEncrypt=function(e){var r=0,n=0,h=(this.bufferOff+e.length)/this.blockSize|0,a=new Array(h*this.blockSize);this.bufferOff!==0&&(r+=this._buffer(e,r),this.bufferOff===this.buffer.length&&(n+=this._flushBuffer(a,n)));for(var d=e.length-(e.length-r)%this.blockSize;r<d;r+=this.blockSize)this._update(e,r,a,n),n+=this.blockSize;for(;r<e.length;r++,this.bufferOff++)this.buffer[this.bufferOff]=e[r];return a},cs.prototype._updateDecrypt=function(e){for(var r=0,n=0,h=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,a=new Array(h*this.blockSize);h>0;h--)r+=this._buffer(e,r),n+=this._flushBuffer(a,n);return r+=this._buffer(e,r),a},cs.prototype.final=function(e){var r,n;return e&&(r=this.update(e)),n=this.type==="encrypt"?this._finalEncrypt():this._finalDecrypt(),r?r.concat(n):n},cs.prototype._pad=function(e,r){if(r===0)return!1;for(;r<e.length;)e[r++]=0;return!0},cs.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},cs.prototype._unpad=function(e){return e},cs.prototype._finalDecrypt=function(){Wbe.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)};nA=nY,MH=Es,Zn=kl,oY=nA;jr(iu,oY),aY=iu,iu.create=function(e){return new iu(e)};Vbe=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];iu.prototype.deriveKeys=function(e,r){e.keys=new Array(32),MH.equal(r.length,this.blockSize,"Invalid key length");var n=Zn.readUInt32BE(r,0),h=Zn.readUInt32BE(r,4);Zn.pc1(n,h,e.tmp,0),n=e.tmp[0],h=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var d=Vbe[a>>>1];n=Zn.r28shl(n,d),h=Zn.r28shl(h,d),Zn.pc2(n,h,e.keys,a)}},iu.prototype._update=function(e,r,n,h){var a=this._desState,d=Zn.readUInt32BE(e,r),c=Zn.readUInt32BE(e,r+4);Zn.ip(d,c,a.tmp,0),d=a.tmp[0],c=a.tmp[1],this.type==="encrypt"?this._encrypt(a,d,c,a.tmp,0):this._decrypt(a,d,c,a.tmp,0),d=a.tmp[0],c=a.tmp[1],Zn.writeUInt32BE(n,d,h),Zn.writeUInt32BE(n,c,h+4)},iu.prototype._pad=function(e,r){for(var n=e.length-r,h=r;h<e.length;h++)e[h]=n;return!0},iu.prototype._unpad=function(e){for(var r=e[e.length-1],n=e.length-r;n<e.length;n++)MH.equal(e[n],r);return e.slice(0,e.length-r)},iu.prototype._encrypt=function(e,r,n,h,a){for(var d=r,c=n,v=0;v<e.keys.length;v+=2){var w=e.keys[v],m=e.keys[v+1];Zn.expand(c,e.tmp,0),w^=e.tmp[0],m^=e.tmp[1];var y=Zn.substitute(w,m),g=c;c=(d^Zn.permute(y))>>>0,d=g}Zn.rip(c,d,h,a)},iu.prototype._decrypt=function(e,r,n,h,a){for(var d=n,c=r,v=e.keys.length-2;v>=0;v-=2){var w=e.keys[v],m=e.keys[v+1];Zn.expand(d,e.tmp,0),w^=e.tmp[0],m^=e.tmp[1];var y=Zn.substitute(w,m),g=d;d=(c^Zn.permute(y))>>>0,c=g}Zn.rip(d,c,h,a)};sY=aY,fY={},Ybe=Es,Jbe=jr,U6={};fY.instantiate=function(e){function r(d){e.call(this,d),this._cbcInit()}Jbe(r,e);for(var n=Object.keys(U6),h=0;h<n.length;h++){var a=n[h];r.prototype[a]=U6[a]}return r.create=function(d){return new r(d)},r},U6._cbcInit=function(){var e=new Xbe(this.options.iv);this._cbcState=e},U6._update=function(e,r,n,h){var a=this._cbcState,d=this.constructor.super_.prototype,c=a.iv;if(this.type==="encrypt"){for(var v=0;v<this.blockSize;v++)c[v]^=e[r+v];for(d._update.call(this,c,0,n,h),v=0;v<this.blockSize;v++)c[v]=n[h+v]}else{for(d._update.call(this,e,r,n,h),v=0;v<this.blockSize;v++)n[h+v]^=c[v];for(v=0;v<this.blockSize;v++)c[v]=e[r+v]}};Qbe=Es,hY=nA,Gh=sY;jr(rl,hY),uY=rl,rl.create=function(e){return new rl(e)},rl.prototype._update=function(e,r,n,h){var a=this._edeState;a.ciphers[0]._update(e,r,n,h),a.ciphers[1]._update(n,h,n,h),a.ciphers[2]._update(n,h,n,h)},rl.prototype._pad=Gh.prototype._pad,rl.prototype._unpad=Gh.prototype._unpad;t3e=uY,hd={};hd.utils=kl,hd.Cipher=nA,hd.DES=sY,hd.CBC=fY,hd.EDE=t3e;Ly=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,cY=r0,Uu=hd,r3e=jr,gl=vi.Buffer,jp={"des-ede3-cbc":Uu.CBC.instantiate(Uu.EDE),"des-ede3":Uu.EDE,"des-ede-cbc":Uu.CBC.instantiate(Uu.EDE),"des-ede":Uu.EDE,"des-cbc":Uu.CBC.instantiate(Uu.DES),"des-ecb":Uu.DES};jp.des=jp["des-cbc"],jp.des3=jp["des-ede3-cbc"],lY=q6,r3e(q6,cY),q6.prototype._update=function(e){return gl.from((this||Ly)._des.update(e))},q6.prototype._final=function(){return gl.from((this||Ly)._des.final())};i3e=lY,n3e=Pr.Buffer,c2=function(e,r){for(var n=Math.min(e.length,r.length),h=new n3e(n),a=0;a<n;++a)h[a]=e[a]^r[a];return h},dY=function(e){for(var r,n=e.length;n--;){if((r=e.readUInt8(n))!==255){r++,e.writeUInt8(r,n);break}e.writeUInt8(0,n)}},a3e={encrypt:function(e,r){return e._cipher.encryptBlock(r)},decrypt:function(e,r){return e._cipher.decryptBlock(r)}},SE={},SH=c2;SE.encrypt=function(e,r){var n=SH(r,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},SE.decrypt=function(e,r){var n=e._prev;e._prev=r;var h=e._cipher.decryptBlock(r);return SH(h,n)};pY={},Fp=vi.Buffer,o3e=c2;pY.encrypt=function(e,r,n){for(var h,a=Fp.allocUnsafe(0);r.length;){if(e._cache.length===0&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Fp.allocUnsafe(0)),!(e._cache.length<=r.length)){a=Fp.concat([a,EH(e,r,n)]);break}h=e._cache.length,a=Fp.concat([a,EH(e,r.slice(0,h),n)]),r=r.slice(h)}return a};vY={},EE=vi.Buffer;vY.encrypt=function(e,r,n){for(var h=r.length,a=EE.allocUnsafe(h),d=-1;++d<h;)a[d]=s3e(e,r[d],n);return a};mY={},Ey=vi.Buffer;mY.encrypt=function(e,r,n){for(var h=r.length,a=Ey.allocUnsafe(h),d=-1;++d<h;)a[d]=f3e(e,r[d],n);return a};gY={},h3e=Pr.Buffer,l3e=c2;gY.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=h3e.concat([e._cache,c3e(e)]);var n=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),l3e(r,n)};AE={},d3e=c2,AH=vi.Buffer,p3e=dY;AE.encrypt=function(e,r){var n=Math.ceil(r.length/16),h=e._cache.length;e._cache=AH.concat([e._cache,AH.allocUnsafe(16*n)]);for(var a=0;a<n;a++){var d=v3e(e),c=h+16*a;e._cache.writeUInt32BE(d[0],c+0),e._cache.writeUInt32BE(d[1],c+4),e._cache.writeUInt32BE(d[2],c+8),e._cache.writeUInt32BE(d[3],c+12)}var v=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),d3e(r,v)};yY={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}},m3e={ECB:a3e,CBC:SE,CFB:pY,CFB8:vY,CFB1:mY,OFB:gY,CTR:AE,GCM:AE},Ay=yY;for(T_ in Ay)Ay[T_].module=m3e[Ay[T_].mode];aA=Ay,ws=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,d2={},Dy=vi.Buffer;g3e=[0,1,2,4,8,16,32,64,128,27,54],Un=function(){for(var e=new Array(256),r=0;r<256;r++)e[r]=r<128?r<<1:r<<1^283;for(var n=[],h=[],a=[[],[],[],[]],d=[[],[],[],[]],c=0,v=0,w=0;w<256;++w){var m=v^v<<1^v<<2^v<<3^v<<4;m=m>>>8^255&m^99,n[c]=m,h[m]=c;var y=e[c],g=e[y],S=e[g],R=257*e[m]^16843008*m;a[0][c]=R<<24|R>>>8,a[1][c]=R<<16|R>>>16,a[2][c]=R<<8|R>>>24,a[3][c]=R,R=16843009*S^65537*g^257*y^16843008*c,d[0][m]=R<<24|R>>>8,d[1][m]=R<<16|R>>>16,d[2][m]=R<<8|R>>>24,d[3][m]=R,c===0?c=v=1:(c=y^e[e[e[S^y]]],v^=e[e[v]])}return{SBOX:n,INV_SBOX:h,SUB_MIX:a,INV_SUB_MIX:d}}();ds.blockSize=16,ds.keySize=32,ds.prototype.blockSize=ds.blockSize,ds.prototype.keySize=ds.keySize,ds.prototype._reset=function(){for(var e=(this||ws)._key,r=e.length,n=r+6,h=4*(n+1),a=[],d=0;d<r;d++)a[d]=e[d];for(d=r;d<h;d++){var c=a[d-1];d%r==0?(c=c<<8|c>>>24,c=Un.SBOX[c>>>24]<<24|Un.SBOX[c>>>16&255]<<16|Un.SBOX[c>>>8&255]<<8|Un.SBOX[255&c],c^=g3e[d/r|0]<<24):r>6&&d%r==4&&(c=Un.SBOX[c>>>24]<<24|Un.SBOX[c>>>16&255]<<16|Un.SBOX[c>>>8&255]<<8|Un.SBOX[255&c]),a[d]=a[d-r]^c}for(var v=[],w=0;w<h;w++){var m=h-w,y=a[m-(w%4?0:4)];v[w]=w<4||m<=4?y:Un.INV_SUB_MIX[0][Un.SBOX[y>>>24]]^Un.INV_SUB_MIX[1][Un.SBOX[y>>>16&255]]^Un.INV_SUB_MIX[2][Un.SBOX[y>>>8&255]]^Un.INV_SUB_MIX[3][Un.SBOX[255&y]]}(this||ws)._nRounds=n,(this||ws)._keySchedule=a,(this||ws)._invKeySchedule=v},ds.prototype.encryptBlockRaw=function(e){return RH(e=RE(e),(this||ws)._keySchedule,Un.SUB_MIX,Un.SBOX,(this||ws)._nRounds)},ds.prototype.encryptBlock=function(e){var r=this.encryptBlockRaw(e),n=Dy.allocUnsafe(16);return n.writeUInt32BE(r[0],0),n.writeUInt32BE(r[1],4),n.writeUInt32BE(r[2],8),n.writeUInt32BE(r[3],12),n},ds.prototype.decryptBlock=function(e){var r=(e=RE(e))[1];e[1]=e[3],e[3]=r;var n=RH(e,(this||ws)._invKeySchedule,Un.INV_SUB_MIX,Un.INV_SBOX,(this||ws)._nRounds),h=Dy.allocUnsafe(16);return h.writeUInt32BE(n[0],0),h.writeUInt32BE(n[3],4),h.writeUInt32BE(n[2],8),h.writeUInt32BE(n[1],12),h},ds.prototype.scrub=function(){k_((this||ws)._keySchedule),k_((this||ws)._invKeySchedule),k_((this||ws)._key)},d2.AES=ds;Oa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,bd=vi.Buffer,y3e=bd.alloc(16,0);zp.prototype.ghash=function(e){for(var r=-1;++r<e.length;)(this||Oa).state[r]^=e[r];this._multiply()},zp.prototype._multiply=function(){for(var e,r,n,h=[(e=(this||Oa).h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],a=[0,0,0,0],d=-1;++d<128;){for((this||Oa).state[~~(d/8)]&1<<7-d%8&&(a[0]^=h[0],a[1]^=h[1],a[2]^=h[2],a[3]^=h[3]),n=(1&h[3])!=0,r=3;r>0;r--)h[r]=h[r]>>>1|(1&h[r-1])<<31;h[0]=h[0]>>>1,n&&(h[0]=h[0]^225<<24)}(this||Oa).state=xH(a)},zp.prototype.update=function(e){var r;for((this||Oa).cache=bd.concat([(this||Oa).cache,e]);(this||Oa).cache.length>=16;)r=(this||Oa).cache.slice(0,16),(this||Oa).cache=(this||Oa).cache.slice(16),this.ghash(r)},zp.prototype.final=function(e,r){return(this||Oa).cache.length&&this.ghash(bd.concat([(this||Oa).cache,y3e],16)),this.ghash(xH([0,e,0,r])),(this||Oa).state};b3e=zp,Vr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,w3e=d2,so=vi.Buffer,bY=r0,TH=b3e,_3e=c2,M3e=dY;jr(dl,bY),dl.prototype._update=function(e){if(!(this||Vr)._called&&(this||Vr)._alen){var r=16-(this||Vr)._alen%16;r<16&&(r=so.alloc(r,0),(this||Vr)._ghash.update(r))}(this||Vr)._called=!0;var n=(this||Vr)._mode.encrypt(this||Vr,e);return(this||Vr)._decrypt?(this||Vr)._ghash.update(e):(this||Vr)._ghash.update(n),(this||Vr)._len+=e.length,n},dl.prototype._final=function(){if((this||Vr)._decrypt&&!(this||Vr)._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=_3e((this||Vr)._ghash.final(8*(this||Vr)._alen,8*(this||Vr)._len),(this||Vr)._cipher.encryptBlock((this||Vr)._finID));if((this||Vr)._decrypt&&function(r,n){var h=0;r.length!==n.length&&h++;for(var a=Math.min(r.length,n.length),d=0;d<a;++d)h+=r[d]^n[d];return h}(e,(this||Vr)._authTag))throw new Error("Unsupported state or unable to authenticate data");(this||Vr)._authTag=e,(this||Vr)._cipher.scrub()},dl.prototype.getAuthTag=function(){if((this||Vr)._decrypt||!so.isBuffer((this||Vr)._authTag))throw new Error("Attempting to get auth tag in unsupported state");return(this||Vr)._authTag},dl.prototype.setAuthTag=function(e){if(!(this||Vr)._decrypt)throw new Error("Attempting to set auth tag in unsupported state");(this||Vr)._authTag=e},dl.prototype.setAAD=function(e){if((this||Vr)._called)throw new Error("Attempting to set AAD in unsupported state");(this||Vr)._ghash.update(e),(this||Vr)._alen+=e.length};wY=dl,mf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,S3e=d2,I_=vi.Buffer,_Y=r0;jr(Ry,_Y),Ry.prototype._update=function(e){return(this||mf)._mode.encrypt(this||mf,e,(this||mf)._decrypt)},Ry.prototype._final=function(){(this||mf)._cipher.scrub()};MY=Ry,il=vi.Buffer,E3e=tA,Xy=function(e,r,n,h){if(il.isBuffer(e)||(e=il.from(e,"binary")),r&&(il.isBuffer(r)||(r=il.from(r,"binary")),r.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,d=il.alloc(a),c=il.alloc(h||0),v=il.alloc(0);a>0||h>0;){var w=new E3e;w.update(v),w.update(e),r&&w.update(r),v=w.digest();var m=0;if(a>0){var y=d.length-a;m=Math.min(a,v.length),v.copy(d,y,0,m),a-=m}if(m<v.length&&h>0){var g=c.length-h,S=Math.min(h,v.length-m);v.copy(c,g,m,m+S),h-=S}}return v.fill(0),{key:d,iv:c}},Ci=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,xE={},A3e=wY,wd=vi.Buffer,SY=aA,R3e=MY,EY=r0,x3e=d2,T3e=Xy;jr(Hp,EY),Hp.prototype._update=function(e){var r,n;(this||Ci)._cache.add(e);for(var h=[];r=(this||Ci)._cache.get((this||Ci)._autopadding);)n=(this||Ci)._mode.decrypt(this||Ci,r),h.push(n);return wd.concat(h)},Hp.prototype._final=function(){var e=(this||Ci)._cache.flush();if((this||Ci)._autopadding)return function(r){var n=r[15];if(n<1||n>16)throw new Error("unable to decrypt data");for(var h=-1;++h<n;)if(r[h+(16-n)]!==n)throw new Error("unable to decrypt data");if(n!==16)return r.slice(0,16-n)}((this||Ci)._mode.decrypt(this||Ci,e));if(e)throw new Error("data not multiple of block length")},Hp.prototype.setAutoPadding=function(e){return(this||Ci)._autopadding=!!e,this||Ci},xy.prototype.add=function(e){(this||Ci).cache=wd.concat([(this||Ci).cache,e])},xy.prototype.get=function(e){var r;if(e){if((this||Ci).cache.length>16)return r=(this||Ci).cache.slice(0,16),(this||Ci).cache=(this||Ci).cache.slice(16),r}else if((this||Ci).cache.length>=16)return r=(this||Ci).cache.slice(0,16),(this||Ci).cache=(this||Ci).cache.slice(16),r;return null},xy.prototype.flush=function(){if((this||Ci).cache.length)return(this||Ci).cache},xE.createDecipher=function(e,r){var n=SY[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var h=T3e(r,!1,n.key,n.iv);return kH(e,h.key,h.iv)},xE.createDecipheriv=kH;sn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,TE={},AY=aA,k3e=wY,Wu=vi.Buffer,I3e=MY,RY=r0,B3e=d2,O3e=Xy;jr(r2,RY),r2.prototype._update=function(e){var r,n;(this||sn)._cache.add(e);for(var h=[];r=(this||sn)._cache.get();)n=(this||sn)._mode.encrypt(this||sn,r),h.push(n);return Wu.concat(h)};P3e=Wu.alloc(16,16);r2.prototype._final=function(){var e=(this||sn)._cache.flush();if((this||sn)._autopadding)return e=(this||sn)._mode.encrypt(this||sn,e),(this||sn)._cipher.scrub(),e;if(!e.equals(P3e))throw(this||sn)._cipher.scrub(),new Error("data not multiple of block length")},r2.prototype.setAutoPadding=function(e){return(this||sn)._autopadding=!!e,this||sn},Ty.prototype.add=function(e){(this||sn).cache=Wu.concat([(this||sn).cache,e])},Ty.prototype.get=function(){if((this||sn).cache.length>15){var e=(this||sn).cache.slice(0,16);return(this||sn).cache=(this||sn).cache.slice(16),e}return null},Ty.prototype.flush=function(){for(var e=16-(this||sn).cache.length,r=Wu.allocUnsafe(e),n=-1;++n<e;)r.writeUInt8(e,n);return Wu.concat([(this||sn).cache,r])},TE.createCipheriv=IH,TE.createCipher=function(e,r){var n=AY[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var h=O3e(r,!1,n.key,n.iv);return IH(e,h.key,h.iv)};Io={},BH=TE,OH=xE,N3e=yY;Io.createCipher=Io.Cipher=BH.createCipher,Io.createCipheriv=Io.Cipheriv=BH.createCipheriv,Io.createDecipher=Io.Decipher=OH.createDecipher,Io.createDecipheriv=Io.Decipheriv=OH.createDecipheriv,Io.listCiphers=Io.getCiphers=function(){return Object.keys(N3e)};jh={"des-ecb":{key:8,iv:0}};jh["des-cbc"]=jh.des={key:8,iv:8},jh["des-ede3-cbc"]=jh.des3={key:24,iv:8},jh["des-ede3"]={key:24,iv:0},jh["des-ede-cbc"]={key:16,iv:8},jh["des-ede"]={key:16,iv:0};df={},xY=i3e,oA=Io,Vh=aA,ju=jh,PH=Xy;df.createCipher=df.Cipher=function(e,r){var n,h;if(e=e.toLowerCase(),Vh[e])n=Vh[e].key,h=Vh[e].iv;else{if(!ju[e])throw new TypeError("invalid suite type");n=8*ju[e].key,h=ju[e].iv}var a=PH(r,!1,n,h);return NH(e,a.key,a.iv)},df.createCipheriv=df.Cipheriv=NH,df.createDecipher=df.Decipher=function(e,r){var n,h;if(e=e.toLowerCase(),Vh[e])n=Vh[e].key,h=Vh[e].iv;else{if(!ju[e])throw new TypeError("invalid suite type");n=8*ju[e].key,h=ju[e].iv}var a=PH(r,!1,n,h);return CH(e,a.key,a.iv)},df.createDecipheriv=df.Decipheriv=CH,df.listCiphers=df.getCiphers=function(){return Object.keys(ju).concat(oA.getCiphers())};C3e=Object.freeze({}),et=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,TY={},kY={exports:TY};(function(e,r){function n(j,z){if(!j)throw new Error(z||"Assertion failed")}function h(j,z){j.super_=z;var J=function(){};J.prototype=z.prototype,j.prototype=new J,j.prototype.constructor=j}function a(j,z,J){if(a.isBN(j))return j;(this||et).negative=0,(this||et).words=null,(this||et).length=0,(this||et).red=null,j!==null&&(z!=="le"&&z!=="be"||(J=z,z=10),this._init(j||0,z||10,J||"be"))}var d;typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{d=C3e.Buffer}catch{}function c(j,z,J){for(var E=0,i=Math.min(j.length,J),s=z;s<i;s++){var f=j.charCodeAt(s)-48;E<<=4,E|=f>=49&&f<=54?f-49+10:f>=17&&f<=22?f-17+10:15&f}return E}function v(j,z,J,E){for(var i=0,s=Math.min(j.length,J),f=z;f<s;f++){var l=j.charCodeAt(f)-48;i*=E,i+=l>=49?l-49+10:l>=17?l-17+10:l}return i}a.isBN=function(j){return j instanceof a||j!==null&&typeof j=="object"&&j.constructor.wordSize===a.wordSize&&Array.isArray(j.words)},a.max=function(j,z){return j.cmp(z)>0?j:z},a.min=function(j,z){return j.cmp(z)<0?j:z},a.prototype._init=function(j,z,J){if(typeof j=="number")return this._initNumber(j,z,J);if(typeof j=="object")return this._initArray(j,z,J);z==="hex"&&(z=16),n(z===(0|z)&&z>=2&&z<=36);var E=0;(j=j.toString().replace(/\s+/g,""))[0]==="-"&&E++,z===16?this._parseHex(j,E):this._parseBase(j,z,E),j[0]==="-"&&((this||et).negative=1),this.strip(),J==="le"&&this._initArray(this.toArray(),z,J)},a.prototype._initNumber=function(j,z,J){j<0&&((this||et).negative=1,j=-j),j<67108864?((this||et).words=[67108863&j],(this||et).length=1):j<4503599627370496?((this||et).words=[67108863&j,j/67108864&67108863],(this||et).length=2):(n(j<9007199254740992),(this||et).words=[67108863&j,j/67108864&67108863,1],(this||et).length=3),J==="le"&&this._initArray(this.toArray(),z,J)},a.prototype._initArray=function(j,z,J){if(n(typeof j.length=="number"),j.length<=0)return(this||et).words=[0],(this||et).length=1,this||et;(this||et).length=Math.ceil(j.length/3),(this||et).words=new Array((this||et).length);for(var E=0;E<(this||et).length;E++)(this||et).words[E]=0;var i,s,f=0;if(J==="be")for(E=j.length-1,i=0;E>=0;E-=3)s=j[E]|j[E-1]<<8|j[E-2]<<16,(this||et).words[i]|=s<<f&67108863,(this||et).words[i+1]=s>>>26-f&67108863,(f+=24)>=26&&(f-=26,i++);else if(J==="le")for(E=0,i=0;E<j.length;E+=3)s=j[E]|j[E+1]<<8|j[E+2]<<16,(this||et).words[i]|=s<<f&67108863,(this||et).words[i+1]=s>>>26-f&67108863,(f+=24)>=26&&(f-=26,i++);return this.strip()},a.prototype._parseHex=function(j,z){(this||et).length=Math.ceil((j.length-z)/6),(this||et).words=new Array((this||et).length);for(var J=0;J<(this||et).length;J++)(this||et).words[J]=0;var E,i,s=0;for(J=j.length-6,E=0;J>=z;J-=6)i=c(j,J,J+6),(this||et).words[E]|=i<<s&67108863,(this||et).words[E+1]|=i>>>26-s&4194303,(s+=24)>=26&&(s-=26,E++);J+6!==z&&(i=c(j,z,J+6),(this||et).words[E]|=i<<s&67108863,(this||et).words[E+1]|=i>>>26-s&4194303),this.strip()},a.prototype._parseBase=function(j,z,J){(this||et).words=[0],(this||et).length=1;for(var E=0,i=1;i<=67108863;i*=z)E++;E--,i=i/z|0;for(var s=j.length-J,f=s%E,l=Math.min(s,s-f)+J,p=0,_=J;_<l;_+=E)p=v(j,_,_+E,z),this.imuln(i),(this||et).words[0]+p<67108864?(this||et).words[0]+=p:this._iaddn(p);if(f!==0){var x=1;for(p=v(j,_,j.length,z),_=0;_<f;_++)x*=z;this.imuln(x),(this||et).words[0]+p<67108864?(this||et).words[0]+=p:this._iaddn(p)}},a.prototype.copy=function(j){j.words=new Array((this||et).length);for(var z=0;z<(this||et).length;z++)j.words[z]=(this||et).words[z];j.length=(this||et).length,j.negative=(this||et).negative,j.red=(this||et).red},a.prototype.clone=function(){var j=new a(null);return this.copy(j),j},a.prototype._expand=function(j){for(;(this||et).length<j;)(this||et).words[(this||et).length++]=0;return this||et},a.prototype.strip=function(){for(;(this||et).length>1&&(this||et).words[(this||et).length-1]===0;)(this||et).length--;return this._normSign()},a.prototype._normSign=function(){return(this||et).length===1&&(this||et).words[0]===0&&((this||et).negative=0),this||et},a.prototype.inspect=function(){return((this||et).red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],m=[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],y=[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];function g(j,z,J){J.negative=z.negative^j.negative;var E=j.length+z.length|0;J.length=E,E=E-1|0;var i=0|j.words[0],s=0|z.words[0],f=i*s,l=67108863&f,p=f/67108864|0;J.words[0]=l;for(var _=1;_<E;_++){for(var x=p>>>26,o=67108863&p,t=Math.min(_,z.length-1),u=Math.max(0,_-j.length+1);u<=t;u++){var b=_-u|0;x+=(f=(i=0|j.words[b])*(s=0|z.words[u])+o)/67108864|0,o=67108863&f}J.words[_]=0|o,p=0|x}return p!==0?J.words[_]=0|p:J.length--,J.strip()}a.prototype.toString=function(j,z){var J;if(z=0|z||1,(j=j||10)===16||j==="hex"){J="";for(var E=0,i=0,s=0;s<(this||et).length;s++){var f=(this||et).words[s],l=(16777215&(f<<E|i)).toString(16);J=(i=f>>>24-E&16777215)!==0||s!==(this||et).length-1?w[6-l.length]+l+J:l+J,(E+=2)>=26&&(E-=26,s--)}for(i!==0&&(J=i.toString(16)+J);J.length%z!=0;)J="0"+J;return(this||et).negative!==0&&(J="-"+J),J}if(j===(0|j)&&j>=2&&j<=36){var p=m[j],_=y[j];J="";var x=this.clone();for(x.negative=0;!x.isZero();){var o=x.modn(_).toString(j);J=(x=x.idivn(_)).isZero()?o+J:w[p-o.length]+o+J}for(this.isZero()&&(J="0"+J);J.length%z!=0;)J="0"+J;return(this||et).negative!==0&&(J="-"+J),J}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var j=(this||et).words[0];return(this||et).length===2?j+=67108864*(this||et).words[1]:(this||et).length===3&&(this||et).words[2]===1?j+=4503599627370496+67108864*(this||et).words[1]:(this||et).length>2&&n(!1,"Number can only safely store up to 53 bits"),(this||et).negative!==0?-j:j},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(j,z){return n(d!==void 0),this.toArrayLike(d,j,z)},a.prototype.toArray=function(j,z){return this.toArrayLike(Array,j,z)},a.prototype.toArrayLike=function(j,z,J){var E=this.byteLength(),i=J||Math.max(1,E);n(E<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var s,f,l=z==="le",p=new j(i),_=this.clone();if(l){for(f=0;!_.isZero();f++)s=_.andln(255),_.iushrn(8),p[f]=s;for(;f<i;f++)p[f]=0}else{for(f=0;f<i-E;f++)p[f]=0;for(f=0;!_.isZero();f++)s=_.andln(255),_.iushrn(8),p[i-f-1]=s}return p},Math.clz32?a.prototype._countBits=function(j){return 32-Math.clz32(j)}:a.prototype._countBits=function(j){var z=j,J=0;return z>=4096&&(J+=13,z>>>=13),z>=64&&(J+=7,z>>>=7),z>=8&&(J+=4,z>>>=4),z>=2&&(J+=2,z>>>=2),J+z},a.prototype._zeroBits=function(j){if(j===0)return 26;var z=j,J=0;return!(8191&z)&&(J+=13,z>>>=13),!(127&z)&&(J+=7,z>>>=7),!(15&z)&&(J+=4,z>>>=4),!(3&z)&&(J+=2,z>>>=2),!(1&z)&&J++,J},a.prototype.bitLength=function(){var j=(this||et).words[(this||et).length-1],z=this._countBits(j);return 26*((this||et).length-1)+z},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var j=0,z=0;z<(this||et).length;z++){var J=this._zeroBits((this||et).words[z]);if(j+=J,J!==26)break}return j},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(j){return(this||et).negative!==0?this.abs().inotn(j).iaddn(1):this.clone()},a.prototype.fromTwos=function(j){return this.testn(j-1)?this.notn(j).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return(this||et).negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||((this||et).negative^=1),this||et},a.prototype.iuor=function(j){for(;(this||et).length<j.length;)(this||et).words[(this||et).length++]=0;for(var z=0;z<j.length;z++)(this||et).words[z]=(this||et).words[z]|j.words[z];return this.strip()},a.prototype.ior=function(j){return n(((this||et).negative|j.negative)==0),this.iuor(j)},a.prototype.or=function(j){return(this||et).length>j.length?this.clone().ior(j):j.clone().ior(this||et)},a.prototype.uor=function(j){return(this||et).length>j.length?this.clone().iuor(j):j.clone().iuor(this||et)},a.prototype.iuand=function(j){var z;z=(this||et).length>j.length?j:this||et;for(var J=0;J<z.length;J++)(this||et).words[J]=(this||et).words[J]&j.words[J];return(this||et).length=z.length,this.strip()},a.prototype.iand=function(j){return n(((this||et).negative|j.negative)==0),this.iuand(j)},a.prototype.and=function(j){return(this||et).length>j.length?this.clone().iand(j):j.clone().iand(this||et)},a.prototype.uand=function(j){return(this||et).length>j.length?this.clone().iuand(j):j.clone().iuand(this||et)},a.prototype.iuxor=function(j){var z,J;(this||et).length>j.length?(z=this||et,J=j):(z=j,J=this||et);for(var E=0;E<J.length;E++)(this||et).words[E]=z.words[E]^J.words[E];if((this||et)!==z)for(;E<z.length;E++)(this||et).words[E]=z.words[E];return(this||et).length=z.length,this.strip()},a.prototype.ixor=function(j){return n(((this||et).negative|j.negative)==0),this.iuxor(j)},a.prototype.xor=function(j){return(this||et).length>j.length?this.clone().ixor(j):j.clone().ixor(this||et)},a.prototype.uxor=function(j){return(this||et).length>j.length?this.clone().iuxor(j):j.clone().iuxor(this||et)},a.prototype.inotn=function(j){n(typeof j=="number"&&j>=0);var z=0|Math.ceil(j/26),J=j%26;this._expand(z),J>0&&z--;for(var E=0;E<z;E++)(this||et).words[E]=67108863&~(this||et).words[E];return J>0&&((this||et).words[E]=~(this||et).words[E]&67108863>>26-J),this.strip()},a.prototype.notn=function(j){return this.clone().inotn(j)},a.prototype.setn=function(j,z){n(typeof j=="number"&&j>=0);var J=j/26|0,E=j%26;return this._expand(J+1),(this||et).words[J]=z?(this||et).words[J]|1<<E:(this||et).words[J]&~(1<<E),this.strip()},a.prototype.iadd=function(j){var z,J,E;if((this||et).negative!==0&&j.negative===0)return(this||et).negative=0,z=this.isub(j),(this||et).negative^=1,this._normSign();if((this||et).negative===0&&j.negative!==0)return j.negative=0,z=this.isub(j),j.negative=1,z._normSign();(this||et).length>j.length?(J=this||et,E=j):(J=j,E=this||et);for(var i=0,s=0;s<E.length;s++)z=(0|J.words[s])+(0|E.words[s])+i,(this||et).words[s]=67108863&z,i=z>>>26;for(;i!==0&&s<J.length;s++)z=(0|J.words[s])+i,(this||et).words[s]=67108863&z,i=z>>>26;if((this||et).length=J.length,i!==0)(this||et).words[(this||et).length]=i,(this||et).length++;else if(J!==(this||et))for(;s<J.length;s++)(this||et).words[s]=J.words[s];return this||et},a.prototype.add=function(j){var z;return j.negative!==0&&(this||et).negative===0?(j.negative=0,z=this.sub(j),j.negative^=1,z):j.negative===0&&(this||et).negative!==0?((this||et).negative=0,z=j.sub(this||et),(this||et).negative=1,z):(this||et).length>j.length?this.clone().iadd(j):j.clone().iadd(this||et)},a.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var z=this.iadd(j);return j.negative=1,z._normSign()}if((this||et).negative!==0)return(this||et).negative=0,this.iadd(j),(this||et).negative=1,this._normSign();var J,E,i=this.cmp(j);if(i===0)return(this||et).negative=0,(this||et).length=1,(this||et).words[0]=0,this||et;i>0?(J=this||et,E=j):(J=j,E=this||et);for(var s=0,f=0;f<E.length;f++)s=(z=(0|J.words[f])-(0|E.words[f])+s)>>26,(this||et).words[f]=67108863&z;for(;s!==0&&f<J.length;f++)s=(z=(0|J.words[f])+s)>>26,(this||et).words[f]=67108863&z;if(s===0&&f<J.length&&J!==(this||et))for(;f<J.length;f++)(this||et).words[f]=J.words[f];return(this||et).length=Math.max((this||et).length,f),J!==(this||et)&&((this||et).negative=1),this.strip()},a.prototype.sub=function(j){return this.clone().isub(j)};var S=function(j,z,J){var E,i,s,f=j.words,l=z.words,p=J.words,_=0,x=0|f[0],o=8191&x,t=x>>>13,u=0|f[1],b=8191&u,M=u>>>13,T=0|f[2],D=8191&T,Q=T>>>13,W=0|f[3],X=8191&W,G=W>>>13,Y=0|f[4],ae=8191&Y,te=Y>>>13,U=0|f[5],Z=8191&U,ie=U>>>13,fe=0|f[6],de=8191&fe,he=fe>>>13,pe=0|f[7],De=8191&pe,Ae=pe>>>13,_e=0|f[8],ut=8191&_e,qe=_e>>>13,ke=0|f[9],mt=8191&ke,ne=ke>>>13,O=0|l[0],N=8191&O,$=O>>>13,ee=0|l[1],re=8191&ee,se=ee>>>13,ce=0|l[2],st=8191&ce,ye=ce>>>13,be=0|l[3],me=8191&be,Te=be>>>13,je=0|l[4],le=8191&je,Ie=je>>>13,Se=0|l[5],Ee=8191&Se,Me=Se>>>13,xe=0|l[6],wt=8191&xe,Ne=xe>>>13,Ce=0|l[7],At=8191&Ce,dt=Ce>>>13,rt=0|l[8],Et=8191&rt,lt=rt>>>13,ot=0|l[9],It=8191&ot,pt=ot>>>13;J.negative=j.negative^z.negative,J.length=19;var ft=(_+(E=Math.imul(o,N))|0)+((8191&(i=(i=Math.imul(o,$))+Math.imul(t,N)|0))<<13)|0;_=((s=Math.imul(t,$))+(i>>>13)|0)+(ft>>>26)|0,ft&=67108863,E=Math.imul(b,N),i=(i=Math.imul(b,$))+Math.imul(M,N)|0,s=Math.imul(M,$);var kt=(_+(E=E+Math.imul(o,re)|0)|0)+((8191&(i=(i=i+Math.imul(o,se)|0)+Math.imul(t,re)|0))<<13)|0;_=((s=s+Math.imul(t,se)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,E=Math.imul(D,N),i=(i=Math.imul(D,$))+Math.imul(Q,N)|0,s=Math.imul(Q,$),E=E+Math.imul(b,re)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(M,re)|0,s=s+Math.imul(M,se)|0;var vt=(_+(E=E+Math.imul(o,st)|0)|0)+((8191&(i=(i=i+Math.imul(o,ye)|0)+Math.imul(t,st)|0))<<13)|0;_=((s=s+Math.imul(t,ye)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,E=Math.imul(X,N),i=(i=Math.imul(X,$))+Math.imul(G,N)|0,s=Math.imul(G,$),E=E+Math.imul(D,re)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(Q,re)|0,s=s+Math.imul(Q,se)|0,E=E+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ye)|0)+Math.imul(M,st)|0,s=s+Math.imul(M,ye)|0;var at=(_+(E=E+Math.imul(o,me)|0)|0)+((8191&(i=(i=i+Math.imul(o,Te)|0)+Math.imul(t,me)|0))<<13)|0;_=((s=s+Math.imul(t,Te)|0)+(i>>>13)|0)+(at>>>26)|0,at&=67108863,E=Math.imul(ae,N),i=(i=Math.imul(ae,$))+Math.imul(te,N)|0,s=Math.imul(te,$),E=E+Math.imul(X,re)|0,i=(i=i+Math.imul(X,se)|0)+Math.imul(G,re)|0,s=s+Math.imul(G,se)|0,E=E+Math.imul(D,st)|0,i=(i=i+Math.imul(D,ye)|0)+Math.imul(Q,st)|0,s=s+Math.imul(Q,ye)|0,E=E+Math.imul(b,me)|0,i=(i=i+Math.imul(b,Te)|0)+Math.imul(M,me)|0,s=s+Math.imul(M,Te)|0;var Bt=(_+(E=E+Math.imul(o,le)|0)|0)+((8191&(i=(i=i+Math.imul(o,Ie)|0)+Math.imul(t,le)|0))<<13)|0;_=((s=s+Math.imul(t,Ie)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,E=Math.imul(Z,N),i=(i=Math.imul(Z,$))+Math.imul(ie,N)|0,s=Math.imul(ie,$),E=E+Math.imul(ae,re)|0,i=(i=i+Math.imul(ae,se)|0)+Math.imul(te,re)|0,s=s+Math.imul(te,se)|0,E=E+Math.imul(X,st)|0,i=(i=i+Math.imul(X,ye)|0)+Math.imul(G,st)|0,s=s+Math.imul(G,ye)|0,E=E+Math.imul(D,me)|0,i=(i=i+Math.imul(D,Te)|0)+Math.imul(Q,me)|0,s=s+Math.imul(Q,Te)|0,E=E+Math.imul(b,le)|0,i=(i=i+Math.imul(b,Ie)|0)+Math.imul(M,le)|0,s=s+Math.imul(M,Ie)|0;var Wt=(_+(E=E+Math.imul(o,Ee)|0)|0)+((8191&(i=(i=i+Math.imul(o,Me)|0)+Math.imul(t,Ee)|0))<<13)|0;_=((s=s+Math.imul(t,Me)|0)+(i>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,E=Math.imul(de,N),i=(i=Math.imul(de,$))+Math.imul(he,N)|0,s=Math.imul(he,$),E=E+Math.imul(Z,re)|0,i=(i=i+Math.imul(Z,se)|0)+Math.imul(ie,re)|0,s=s+Math.imul(ie,se)|0,E=E+Math.imul(ae,st)|0,i=(i=i+Math.imul(ae,ye)|0)+Math.imul(te,st)|0,s=s+Math.imul(te,ye)|0,E=E+Math.imul(X,me)|0,i=(i=i+Math.imul(X,Te)|0)+Math.imul(G,me)|0,s=s+Math.imul(G,Te)|0,E=E+Math.imul(D,le)|0,i=(i=i+Math.imul(D,Ie)|0)+Math.imul(Q,le)|0,s=s+Math.imul(Q,Ie)|0,E=E+Math.imul(b,Ee)|0,i=(i=i+Math.imul(b,Me)|0)+Math.imul(M,Ee)|0,s=s+Math.imul(M,Me)|0;var Pt=(_+(E=E+Math.imul(o,wt)|0)|0)+((8191&(i=(i=i+Math.imul(o,Ne)|0)+Math.imul(t,wt)|0))<<13)|0;_=((s=s+Math.imul(t,Ne)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,E=Math.imul(De,N),i=(i=Math.imul(De,$))+Math.imul(Ae,N)|0,s=Math.imul(Ae,$),E=E+Math.imul(de,re)|0,i=(i=i+Math.imul(de,se)|0)+Math.imul(he,re)|0,s=s+Math.imul(he,se)|0,E=E+Math.imul(Z,st)|0,i=(i=i+Math.imul(Z,ye)|0)+Math.imul(ie,st)|0,s=s+Math.imul(ie,ye)|0,E=E+Math.imul(ae,me)|0,i=(i=i+Math.imul(ae,Te)|0)+Math.imul(te,me)|0,s=s+Math.imul(te,Te)|0,E=E+Math.imul(X,le)|0,i=(i=i+Math.imul(X,Ie)|0)+Math.imul(G,le)|0,s=s+Math.imul(G,Ie)|0,E=E+Math.imul(D,Ee)|0,i=(i=i+Math.imul(D,Me)|0)+Math.imul(Q,Ee)|0,s=s+Math.imul(Q,Me)|0,E=E+Math.imul(b,wt)|0,i=(i=i+Math.imul(b,Ne)|0)+Math.imul(M,wt)|0,s=s+Math.imul(M,Ne)|0;var Nt=(_+(E=E+Math.imul(o,At)|0)|0)+((8191&(i=(i=i+Math.imul(o,dt)|0)+Math.imul(t,At)|0))<<13)|0;_=((s=s+Math.imul(t,dt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,E=Math.imul(ut,N),i=(i=Math.imul(ut,$))+Math.imul(qe,N)|0,s=Math.imul(qe,$),E=E+Math.imul(De,re)|0,i=(i=i+Math.imul(De,se)|0)+Math.imul(Ae,re)|0,s=s+Math.imul(Ae,se)|0,E=E+Math.imul(de,st)|0,i=(i=i+Math.imul(de,ye)|0)+Math.imul(he,st)|0,s=s+Math.imul(he,ye)|0,E=E+Math.imul(Z,me)|0,i=(i=i+Math.imul(Z,Te)|0)+Math.imul(ie,me)|0,s=s+Math.imul(ie,Te)|0,E=E+Math.imul(ae,le)|0,i=(i=i+Math.imul(ae,Ie)|0)+Math.imul(te,le)|0,s=s+Math.imul(te,Ie)|0,E=E+Math.imul(X,Ee)|0,i=(i=i+Math.imul(X,Me)|0)+Math.imul(G,Ee)|0,s=s+Math.imul(G,Me)|0,E=E+Math.imul(D,wt)|0,i=(i=i+Math.imul(D,Ne)|0)+Math.imul(Q,wt)|0,s=s+Math.imul(Q,Ne)|0,E=E+Math.imul(b,At)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(M,At)|0,s=s+Math.imul(M,dt)|0;var cr=(_+(E=E+Math.imul(o,Et)|0)|0)+((8191&(i=(i=i+Math.imul(o,lt)|0)+Math.imul(t,Et)|0))<<13)|0;_=((s=s+Math.imul(t,lt)|0)+(i>>>13)|0)+(cr>>>26)|0,cr&=67108863,E=Math.imul(mt,N),i=(i=Math.imul(mt,$))+Math.imul(ne,N)|0,s=Math.imul(ne,$),E=E+Math.imul(ut,re)|0,i=(i=i+Math.imul(ut,se)|0)+Math.imul(qe,re)|0,s=s+Math.imul(qe,se)|0,E=E+Math.imul(De,st)|0,i=(i=i+Math.imul(De,ye)|0)+Math.imul(Ae,st)|0,s=s+Math.imul(Ae,ye)|0,E=E+Math.imul(de,me)|0,i=(i=i+Math.imul(de,Te)|0)+Math.imul(he,me)|0,s=s+Math.imul(he,Te)|0,E=E+Math.imul(Z,le)|0,i=(i=i+Math.imul(Z,Ie)|0)+Math.imul(ie,le)|0,s=s+Math.imul(ie,Ie)|0,E=E+Math.imul(ae,Ee)|0,i=(i=i+Math.imul(ae,Me)|0)+Math.imul(te,Ee)|0,s=s+Math.imul(te,Me)|0,E=E+Math.imul(X,wt)|0,i=(i=i+Math.imul(X,Ne)|0)+Math.imul(G,wt)|0,s=s+Math.imul(G,Ne)|0,E=E+Math.imul(D,At)|0,i=(i=i+Math.imul(D,dt)|0)+Math.imul(Q,At)|0,s=s+Math.imul(Q,dt)|0,E=E+Math.imul(b,Et)|0,i=(i=i+Math.imul(b,lt)|0)+Math.imul(M,Et)|0,s=s+Math.imul(M,lt)|0;var qt=(_+(E=E+Math.imul(o,It)|0)|0)+((8191&(i=(i=i+Math.imul(o,pt)|0)+Math.imul(t,It)|0))<<13)|0;_=((s=s+Math.imul(t,pt)|0)+(i>>>13)|0)+(qt>>>26)|0,qt&=67108863,E=Math.imul(mt,re),i=(i=Math.imul(mt,se))+Math.imul(ne,re)|0,s=Math.imul(ne,se),E=E+Math.imul(ut,st)|0,i=(i=i+Math.imul(ut,ye)|0)+Math.imul(qe,st)|0,s=s+Math.imul(qe,ye)|0,E=E+Math.imul(De,me)|0,i=(i=i+Math.imul(De,Te)|0)+Math.imul(Ae,me)|0,s=s+Math.imul(Ae,Te)|0,E=E+Math.imul(de,le)|0,i=(i=i+Math.imul(de,Ie)|0)+Math.imul(he,le)|0,s=s+Math.imul(he,Ie)|0,E=E+Math.imul(Z,Ee)|0,i=(i=i+Math.imul(Z,Me)|0)+Math.imul(ie,Ee)|0,s=s+Math.imul(ie,Me)|0,E=E+Math.imul(ae,wt)|0,i=(i=i+Math.imul(ae,Ne)|0)+Math.imul(te,wt)|0,s=s+Math.imul(te,Ne)|0,E=E+Math.imul(X,At)|0,i=(i=i+Math.imul(X,dt)|0)+Math.imul(G,At)|0,s=s+Math.imul(G,dt)|0,E=E+Math.imul(D,Et)|0,i=(i=i+Math.imul(D,lt)|0)+Math.imul(Q,Et)|0,s=s+Math.imul(Q,lt)|0;var Dt=(_+(E=E+Math.imul(b,It)|0)|0)+((8191&(i=(i=i+Math.imul(b,pt)|0)+Math.imul(M,It)|0))<<13)|0;_=((s=s+Math.imul(M,pt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,E=Math.imul(mt,st),i=(i=Math.imul(mt,ye))+Math.imul(ne,st)|0,s=Math.imul(ne,ye),E=E+Math.imul(ut,me)|0,i=(i=i+Math.imul(ut,Te)|0)+Math.imul(qe,me)|0,s=s+Math.imul(qe,Te)|0,E=E+Math.imul(De,le)|0,i=(i=i+Math.imul(De,Ie)|0)+Math.imul(Ae,le)|0,s=s+Math.imul(Ae,Ie)|0,E=E+Math.imul(de,Ee)|0,i=(i=i+Math.imul(de,Me)|0)+Math.imul(he,Ee)|0,s=s+Math.imul(he,Me)|0,E=E+Math.imul(Z,wt)|0,i=(i=i+Math.imul(Z,Ne)|0)+Math.imul(ie,wt)|0,s=s+Math.imul(ie,Ne)|0,E=E+Math.imul(ae,At)|0,i=(i=i+Math.imul(ae,dt)|0)+Math.imul(te,At)|0,s=s+Math.imul(te,dt)|0,E=E+Math.imul(X,Et)|0,i=(i=i+Math.imul(X,lt)|0)+Math.imul(G,Et)|0,s=s+Math.imul(G,lt)|0;var rr=(_+(E=E+Math.imul(D,It)|0)|0)+((8191&(i=(i=i+Math.imul(D,pt)|0)+Math.imul(Q,It)|0))<<13)|0;_=((s=s+Math.imul(Q,pt)|0)+(i>>>13)|0)+(rr>>>26)|0,rr&=67108863,E=Math.imul(mt,me),i=(i=Math.imul(mt,Te))+Math.imul(ne,me)|0,s=Math.imul(ne,Te),E=E+Math.imul(ut,le)|0,i=(i=i+Math.imul(ut,Ie)|0)+Math.imul(qe,le)|0,s=s+Math.imul(qe,Ie)|0,E=E+Math.imul(De,Ee)|0,i=(i=i+Math.imul(De,Me)|0)+Math.imul(Ae,Ee)|0,s=s+Math.imul(Ae,Me)|0,E=E+Math.imul(de,wt)|0,i=(i=i+Math.imul(de,Ne)|0)+Math.imul(he,wt)|0,s=s+Math.imul(he,Ne)|0,E=E+Math.imul(Z,At)|0,i=(i=i+Math.imul(Z,dt)|0)+Math.imul(ie,At)|0,s=s+Math.imul(ie,dt)|0,E=E+Math.imul(ae,Et)|0,i=(i=i+Math.imul(ae,lt)|0)+Math.imul(te,Et)|0,s=s+Math.imul(te,lt)|0;var sr=(_+(E=E+Math.imul(X,It)|0)|0)+((8191&(i=(i=i+Math.imul(X,pt)|0)+Math.imul(G,It)|0))<<13)|0;_=((s=s+Math.imul(G,pt)|0)+(i>>>13)|0)+(sr>>>26)|0,sr&=67108863,E=Math.imul(mt,le),i=(i=Math.imul(mt,Ie))+Math.imul(ne,le)|0,s=Math.imul(ne,Ie),E=E+Math.imul(ut,Ee)|0,i=(i=i+Math.imul(ut,Me)|0)+Math.imul(qe,Ee)|0,s=s+Math.imul(qe,Me)|0,E=E+Math.imul(De,wt)|0,i=(i=i+Math.imul(De,Ne)|0)+Math.imul(Ae,wt)|0,s=s+Math.imul(Ae,Ne)|0,E=E+Math.imul(de,At)|0,i=(i=i+Math.imul(de,dt)|0)+Math.imul(he,At)|0,s=s+Math.imul(he,dt)|0,E=E+Math.imul(Z,Et)|0,i=(i=i+Math.imul(Z,lt)|0)+Math.imul(ie,Et)|0,s=s+Math.imul(ie,lt)|0;var ir=(_+(E=E+Math.imul(ae,It)|0)|0)+((8191&(i=(i=i+Math.imul(ae,pt)|0)+Math.imul(te,It)|0))<<13)|0;_=((s=s+Math.imul(te,pt)|0)+(i>>>13)|0)+(ir>>>26)|0,ir&=67108863,E=Math.imul(mt,Ee),i=(i=Math.imul(mt,Me))+Math.imul(ne,Ee)|0,s=Math.imul(ne,Me),E=E+Math.imul(ut,wt)|0,i=(i=i+Math.imul(ut,Ne)|0)+Math.imul(qe,wt)|0,s=s+Math.imul(qe,Ne)|0,E=E+Math.imul(De,At)|0,i=(i=i+Math.imul(De,dt)|0)+Math.imul(Ae,At)|0,s=s+Math.imul(Ae,dt)|0,E=E+Math.imul(de,Et)|0,i=(i=i+Math.imul(de,lt)|0)+Math.imul(he,Et)|0,s=s+Math.imul(he,lt)|0;var hr=(_+(E=E+Math.imul(Z,It)|0)|0)+((8191&(i=(i=i+Math.imul(Z,pt)|0)+Math.imul(ie,It)|0))<<13)|0;_=((s=s+Math.imul(ie,pt)|0)+(i>>>13)|0)+(hr>>>26)|0,hr&=67108863,E=Math.imul(mt,wt),i=(i=Math.imul(mt,Ne))+Math.imul(ne,wt)|0,s=Math.imul(ne,Ne),E=E+Math.imul(ut,At)|0,i=(i=i+Math.imul(ut,dt)|0)+Math.imul(qe,At)|0,s=s+Math.imul(qe,dt)|0,E=E+Math.imul(De,Et)|0,i=(i=i+Math.imul(De,lt)|0)+Math.imul(Ae,Et)|0,s=s+Math.imul(Ae,lt)|0;var nr=(_+(E=E+Math.imul(de,It)|0)|0)+((8191&(i=(i=i+Math.imul(de,pt)|0)+Math.imul(he,It)|0))<<13)|0;_=((s=s+Math.imul(he,pt)|0)+(i>>>13)|0)+(nr>>>26)|0,nr&=67108863,E=Math.imul(mt,At),i=(i=Math.imul(mt,dt))+Math.imul(ne,At)|0,s=Math.imul(ne,dt),E=E+Math.imul(ut,Et)|0,i=(i=i+Math.imul(ut,lt)|0)+Math.imul(qe,Et)|0,s=s+Math.imul(qe,lt)|0;var ur=(_+(E=E+Math.imul(De,It)|0)|0)+((8191&(i=(i=i+Math.imul(De,pt)|0)+Math.imul(Ae,It)|0))<<13)|0;_=((s=s+Math.imul(Ae,pt)|0)+(i>>>13)|0)+(ur>>>26)|0,ur&=67108863,E=Math.imul(mt,Et),i=(i=Math.imul(mt,lt))+Math.imul(ne,Et)|0,s=Math.imul(ne,lt);var it=(_+(E=E+Math.imul(ut,It)|0)|0)+((8191&(i=(i=i+Math.imul(ut,pt)|0)+Math.imul(qe,It)|0))<<13)|0;_=((s=s+Math.imul(qe,pt)|0)+(i>>>13)|0)+(it>>>26)|0,it&=67108863;var we=(_+(E=Math.imul(mt,It))|0)+((8191&(i=(i=Math.imul(mt,pt))+Math.imul(ne,It)|0))<<13)|0;return _=((s=Math.imul(ne,pt))+(i>>>13)|0)+(we>>>26)|0,we&=67108863,p[0]=ft,p[1]=kt,p[2]=vt,p[3]=at,p[4]=Bt,p[5]=Wt,p[6]=Pt,p[7]=Nt,p[8]=cr,p[9]=qt,p[10]=Dt,p[11]=rr,p[12]=sr,p[13]=ir,p[14]=hr,p[15]=nr,p[16]=ur,p[17]=it,p[18]=we,_!==0&&(p[19]=_,J.length++),J};function R(j,z,J){return new A().mulp(j,z,J)}function A(j,z){(this||et).x=j,(this||et).y=z}Math.imul||(S=g),a.prototype.mulTo=function(j,z){var J=(this||et).length+j.length;return(this||et).length===10&&j.length===10?S(this||et,j,z):J<63?g(this||et,j,z):J<1024?function(E,i,s){s.negative=i.negative^E.negative,s.length=E.length+i.length;for(var f=0,l=0,p=0;p<s.length-1;p++){var _=l;l=0;for(var x=67108863&f,o=Math.min(p,i.length-1),t=Math.max(0,p-E.length+1);t<=o;t++){var u=p-t,b=(0|E.words[u])*(0|i.words[t]),M=67108863&b;x=67108863&(M=M+x|0),l+=(_=(_=_+(b/67108864|0)|0)+(M>>>26)|0)>>>26,_&=67108863}s.words[p]=x,f=_,_=l}return f!==0?s.words[p]=f:s.length--,s.strip()}(this||et,j,z):R(this||et,j,z)},A.prototype.makeRBT=function(j){for(var z=new Array(j),J=a.prototype._countBits(j)-1,E=0;E<j;E++)z[E]=this.revBin(E,J,j);return z},A.prototype.revBin=function(j,z,J){if(j===0||j===J-1)return j;for(var E=0,i=0;i<z;i++)E|=(1&j)<<z-i-1,j>>=1;return E},A.prototype.permute=function(j,z,J,E,i,s){for(var f=0;f<s;f++)E[f]=z[j[f]],i[f]=J[j[f]]},A.prototype.transform=function(j,z,J,E,i,s){this.permute(s,j,z,J,E,i);for(var f=1;f<i;f<<=1)for(var l=f<<1,p=Math.cos(2*Math.PI/l),_=Math.sin(2*Math.PI/l),x=0;x<i;x+=l)for(var o=p,t=_,u=0;u<f;u++){var b=J[x+u],M=E[x+u],T=J[x+u+f],D=E[x+u+f],Q=o*T-t*D;D=o*D+t*T,T=Q,J[x+u]=b+T,E[x+u]=M+D,J[x+u+f]=b-T,E[x+u+f]=M-D,u!==l&&(Q=p*o-_*t,t=p*t+_*o,o=Q)}},A.prototype.guessLen13b=function(j,z){var J=1|Math.max(z,j),E=1&J,i=0;for(J=J/2|0;J;J>>>=1)i++;return 1<<i+1+E},A.prototype.conjugate=function(j,z,J){if(!(J<=1))for(var E=0;E<J/2;E++){var i=j[E];j[E]=j[J-E-1],j[J-E-1]=i,i=z[E],z[E]=-z[J-E-1],z[J-E-1]=-i}},A.prototype.normalize13b=function(j,z){for(var J=0,E=0;E<z/2;E++){var i=8192*Math.round(j[2*E+1]/z)+Math.round(j[2*E]/z)+J;j[E]=67108863&i,J=i<67108864?0:i/67108864|0}return j},A.prototype.convert13b=function(j,z,J,E){for(var i=0,s=0;s<z;s++)i+=0|j[s],J[2*s]=8191&i,i>>>=13,J[2*s+1]=8191&i,i>>>=13;for(s=2*z;s<E;++s)J[s]=0;n(i===0),n((-8192&i)==0)},A.prototype.stub=function(j){for(var z=new Array(j),J=0;J<j;J++)z[J]=0;return z},A.prototype.mulp=function(j,z,J){var E=2*this.guessLen13b(j.length,z.length),i=this.makeRBT(E),s=this.stub(E),f=new Array(E),l=new Array(E),p=new Array(E),_=new Array(E),x=new Array(E),o=new Array(E),t=J.words;t.length=E,this.convert13b(j.words,j.length,f,E),this.convert13b(z.words,z.length,_,E),this.transform(f,s,l,p,E,i),this.transform(_,s,x,o,E,i);for(var u=0;u<E;u++){var b=l[u]*x[u]-p[u]*o[u];p[u]=l[u]*o[u]+p[u]*x[u],l[u]=b}return this.conjugate(l,p,E),this.transform(l,p,t,s,E,i),this.conjugate(t,s,E),this.normalize13b(t,E),J.negative=j.negative^z.negative,J.length=j.length+z.length,J.strip()},a.prototype.mul=function(j){var z=new a(null);return z.words=new Array((this||et).length+j.length),this.mulTo(j,z)},a.prototype.mulf=function(j){var z=new a(null);return z.words=new Array((this||et).length+j.length),R(this||et,j,z)},a.prototype.imul=function(j){return this.clone().mulTo(j,this||et)},a.prototype.imuln=function(j){n(typeof j=="number"),n(j<67108864);for(var z=0,J=0;J<(this||et).length;J++){var E=(0|(this||et).words[J])*j,i=(67108863&E)+(67108863&z);z>>=26,z+=E/67108864|0,z+=i>>>26,(this||et).words[J]=67108863&i}return z!==0&&((this||et).words[J]=z,(this||et).length++),this||et},a.prototype.muln=function(j){return this.clone().imuln(j)},a.prototype.sqr=function(){return this.mul(this||et)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(j){var z=function(s){for(var f=new Array(s.bitLength()),l=0;l<f.length;l++){var p=l/26|0,_=l%26;f[l]=(s.words[p]&1<<_)>>>_}return f}(j);if(z.length===0)return new a(1);for(var J=this||et,E=0;E<z.length&&z[E]===0;E++,J=J.sqr());if(++E<z.length)for(var i=J.sqr();E<z.length;E++,i=i.sqr())z[E]!==0&&(J=J.mul(i));return J},a.prototype.iushln=function(j){n(typeof j=="number"&&j>=0);var z,J=j%26,E=(j-J)/26,i=67108863>>>26-J<<26-J;if(J!==0){var s=0;for(z=0;z<(this||et).length;z++){var f=(this||et).words[z]&i,l=(0|(this||et).words[z])-f<<J;(this||et).words[z]=l|s,s=f>>>26-J}s&&((this||et).words[z]=s,(this||et).length++)}if(E!==0){for(z=(this||et).length-1;z>=0;z--)(this||et).words[z+E]=(this||et).words[z];for(z=0;z<E;z++)(this||et).words[z]=0;(this||et).length+=E}return this.strip()},a.prototype.ishln=function(j){return n((this||et).negative===0),this.iushln(j)},a.prototype.iushrn=function(j,z,J){var E;n(typeof j=="number"&&j>=0),E=z?(z-z%26)/26:0;var i=j%26,s=Math.min((j-i)/26,(this||et).length),f=67108863^67108863>>>i<<i,l=J;if(E-=s,E=Math.max(0,E),l){for(var p=0;p<s;p++)l.words[p]=(this||et).words[p];l.length=s}if(s!==0)if((this||et).length>s)for((this||et).length-=s,p=0;p<(this||et).length;p++)(this||et).words[p]=(this||et).words[p+s];else(this||et).words[0]=0,(this||et).length=1;var _=0;for(p=(this||et).length-1;p>=0&&(_!==0||p>=E);p--){var x=0|(this||et).words[p];(this||et).words[p]=_<<26-i|x>>>i,_=x&f}return l&&_!==0&&(l.words[l.length++]=_),(this||et).length===0&&((this||et).words[0]=0,(this||et).length=1),this.strip()},a.prototype.ishrn=function(j,z,J){return n((this||et).negative===0),this.iushrn(j,z,J)},a.prototype.shln=function(j){return this.clone().ishln(j)},a.prototype.ushln=function(j){return this.clone().iushln(j)},a.prototype.shrn=function(j){return this.clone().ishrn(j)},a.prototype.ushrn=function(j){return this.clone().iushrn(j)},a.prototype.testn=function(j){n(typeof j=="number"&&j>=0);var z=j%26,J=(j-z)/26,E=1<<z;return!((this||et).length<=J)&&!!((this||et).words[J]&E)},a.prototype.imaskn=function(j){n(typeof j=="number"&&j>=0);var z=j%26,J=(j-z)/26;if(n((this||et).negative===0,"imaskn works only with positive numbers"),(this||et).length<=J)return this||et;if(z!==0&&J++,(this||et).length=Math.min(J,(this||et).length),z!==0){var E=67108863^67108863>>>z<<z;(this||et).words[(this||et).length-1]&=E}return this.strip()},a.prototype.maskn=function(j){return this.clone().imaskn(j)},a.prototype.iaddn=function(j){return n(typeof j=="number"),n(j<67108864),j<0?this.isubn(-j):(this||et).negative!==0?(this||et).length===1&&(0|(this||et).words[0])<j?((this||et).words[0]=j-(0|(this||et).words[0]),(this||et).negative=0,this||et):((this||et).negative=0,this.isubn(j),(this||et).negative=1,this||et):this._iaddn(j)},a.prototype._iaddn=function(j){(this||et).words[0]+=j;for(var z=0;z<(this||et).length&&(this||et).words[z]>=67108864;z++)(this||et).words[z]-=67108864,z===(this||et).length-1?(this||et).words[z+1]=1:(this||et).words[z+1]++;return(this||et).length=Math.max((this||et).length,z+1),this||et},a.prototype.isubn=function(j){if(n(typeof j=="number"),n(j<67108864),j<0)return this.iaddn(-j);if((this||et).negative!==0)return(this||et).negative=0,this.iaddn(j),(this||et).negative=1,this||et;if((this||et).words[0]-=j,(this||et).length===1&&(this||et).words[0]<0)(this||et).words[0]=-(this||et).words[0],(this||et).negative=1;else for(var z=0;z<(this||et).length&&(this||et).words[z]<0;z++)(this||et).words[z]+=67108864,(this||et).words[z+1]-=1;return this.strip()},a.prototype.addn=function(j){return this.clone().iaddn(j)},a.prototype.subn=function(j){return this.clone().isubn(j)},a.prototype.iabs=function(){return(this||et).negative=0,this||et},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(j,z,J){var E,i,s=j.length+J;this._expand(s);var f=0;for(E=0;E<j.length;E++){i=(0|(this||et).words[E+J])+f;var l=(0|j.words[E])*z;f=((i-=67108863&l)>>26)-(l/67108864|0),(this||et).words[E+J]=67108863&i}for(;E<(this||et).length-J;E++)f=(i=(0|(this||et).words[E+J])+f)>>26,(this||et).words[E+J]=67108863&i;if(f===0)return this.strip();for(n(f===-1),f=0,E=0;E<(this||et).length;E++)f=(i=-(0|(this||et).words[E])+f)>>26,(this||et).words[E]=67108863&i;return(this||et).negative=1,this.strip()},a.prototype._wordDiv=function(j,z){var J=((this||et).length,j.length),E=this.clone(),i=j,s=0|i.words[i.length-1];(J=26-this._countBits(s))!==0&&(i=i.ushln(J),E.iushln(J),s=0|i.words[i.length-1]);var f,l=E.length-i.length;if(z!=="mod"){(f=new a(null)).length=l+1,f.words=new Array(f.length);for(var p=0;p<f.length;p++)f.words[p]=0}var _=E.clone()._ishlnsubmul(i,1,l);_.negative===0&&(E=_,f&&(f.words[l]=1));for(var x=l-1;x>=0;x--){var o=67108864*(0|E.words[i.length+x])+(0|E.words[i.length+x-1]);for(o=Math.min(o/s|0,67108863),E._ishlnsubmul(i,o,x);E.negative!==0;)o--,E.negative=0,E._ishlnsubmul(i,1,x),E.isZero()||(E.negative^=1);f&&(f.words[x]=o)}return f&&f.strip(),E.strip(),z!=="div"&&J!==0&&E.iushrn(J),{div:f||null,mod:E}},a.prototype.divmod=function(j,z,J){return n(!j.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:(this||et).negative!==0&&j.negative===0?(s=this.neg().divmod(j,z),z!=="mod"&&(E=s.div.neg()),z!=="div"&&(i=s.mod.neg(),J&&i.negative!==0&&i.iadd(j)),{div:E,mod:i}):(this||et).negative===0&&j.negative!==0?(s=this.divmod(j.neg(),z),z!=="mod"&&(E=s.div.neg()),{div:E,mod:s.mod}):(this||et).negative&j.negative?(s=this.neg().divmod(j.neg(),z),z!=="div"&&(i=s.mod.neg(),J&&i.negative!==0&&i.isub(j)),{div:s.div,mod:i}):j.length>(this||et).length||this.cmp(j)<0?{div:new a(0),mod:this||et}:j.length===1?z==="div"?{div:this.divn(j.words[0]),mod:null}:z==="mod"?{div:null,mod:new a(this.modn(j.words[0]))}:{div:this.divn(j.words[0]),mod:new a(this.modn(j.words[0]))}:this._wordDiv(j,z);var E,i,s},a.prototype.div=function(j){return this.divmod(j,"div",!1).div},a.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},a.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},a.prototype.divRound=function(j){var z=this.divmod(j);if(z.mod.isZero())return z.div;var J=z.div.negative!==0?z.mod.isub(j):z.mod,E=j.ushrn(1),i=j.andln(1),s=J.cmp(E);return s<0||i===1&&s===0?z.div:z.div.negative!==0?z.div.isubn(1):z.div.iaddn(1)},a.prototype.modn=function(j){n(j<=67108863);for(var z=(1<<26)%j,J=0,E=(this||et).length-1;E>=0;E--)J=(z*J+(0|(this||et).words[E]))%j;return J},a.prototype.idivn=function(j){n(j<=67108863);for(var z=0,J=(this||et).length-1;J>=0;J--){var E=(0|(this||et).words[J])+67108864*z;(this||et).words[J]=E/j|0,z=E%j}return this.strip()},a.prototype.divn=function(j){return this.clone().idivn(j)},a.prototype.egcd=function(j){n(j.negative===0),n(!j.isZero());var z=this||et,J=j.clone();z=z.negative!==0?z.umod(j):z.clone();for(var E=new a(1),i=new a(0),s=new a(0),f=new a(1),l=0;z.isEven()&&J.isEven();)z.iushrn(1),J.iushrn(1),++l;for(var p=J.clone(),_=z.clone();!z.isZero();){for(var x=0,o=1;!(z.words[0]&o)&&x<26;++x,o<<=1);if(x>0)for(z.iushrn(x);x-- >0;)(E.isOdd()||i.isOdd())&&(E.iadd(p),i.isub(_)),E.iushrn(1),i.iushrn(1);for(var t=0,u=1;!(J.words[0]&u)&&t<26;++t,u<<=1);if(t>0)for(J.iushrn(t);t-- >0;)(s.isOdd()||f.isOdd())&&(s.iadd(p),f.isub(_)),s.iushrn(1),f.iushrn(1);z.cmp(J)>=0?(z.isub(J),E.isub(s),i.isub(f)):(J.isub(z),s.isub(E),f.isub(i))}return{a:s,b:f,gcd:J.iushln(l)}},a.prototype._invmp=function(j){n(j.negative===0),n(!j.isZero());var z=this||et,J=j.clone();z=z.negative!==0?z.umod(j):z.clone();for(var E,i=new a(1),s=new a(0),f=J.clone();z.cmpn(1)>0&&J.cmpn(1)>0;){for(var l=0,p=1;!(z.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(z.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var _=0,x=1;!(J.words[0]&x)&&_<26;++_,x<<=1);if(_>0)for(J.iushrn(_);_-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);z.cmp(J)>=0?(z.isub(J),i.isub(s)):(J.isub(z),s.isub(i))}return(E=z.cmpn(1)===0?i:s).cmpn(0)<0&&E.iadd(j),E},a.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var z=this.clone(),J=j.clone();z.negative=0,J.negative=0;for(var E=0;z.isEven()&&J.isEven();E++)z.iushrn(1),J.iushrn(1);for(;;){for(;z.isEven();)z.iushrn(1);for(;J.isEven();)J.iushrn(1);var i=z.cmp(J);if(i<0){var s=z;z=J,J=s}else if(i===0||J.cmpn(1)===0)break;z.isub(J)}return J.iushln(E)},a.prototype.invm=function(j){return this.egcd(j).a.umod(j)},a.prototype.isEven=function(){return(1&(this||et).words[0])==0},a.prototype.isOdd=function(){return(1&(this||et).words[0])==1},a.prototype.andln=function(j){return(this||et).words[0]&j},a.prototype.bincn=function(j){n(typeof j=="number");var z=j%26,J=(j-z)/26,E=1<<z;if((this||et).length<=J)return this._expand(J+1),(this||et).words[J]|=E,this||et;for(var i=E,s=J;i!==0&&s<(this||et).length;s++){var f=0|(this||et).words[s];i=(f+=i)>>>26,f&=67108863,(this||et).words[s]=f}return i!==0&&((this||et).words[s]=i,(this||et).length++),this||et},a.prototype.isZero=function(){return(this||et).length===1&&(this||et).words[0]===0},a.prototype.cmpn=function(j){var z,J=j<0;if((this||et).negative!==0&&!J)return-1;if((this||et).negative===0&&J)return 1;if(this.strip(),(this||et).length>1)z=1;else{J&&(j=-j),n(j<=67108863,"Number is too big");var E=0|(this||et).words[0];z=E===j?0:E<j?-1:1}return(this||et).negative!==0?0|-z:z},a.prototype.cmp=function(j){if((this||et).negative!==0&&j.negative===0)return-1;if((this||et).negative===0&&j.negative!==0)return 1;var z=this.ucmp(j);return(this||et).negative!==0?0|-z:z},a.prototype.ucmp=function(j){if((this||et).length>j.length)return 1;if((this||et).length<j.length)return-1;for(var z=0,J=(this||et).length-1;J>=0;J--){var E=0|(this||et).words[J],i=0|j.words[J];if(E!==i){E<i?z=-1:E>i&&(z=1);break}}return z},a.prototype.gtn=function(j){return this.cmpn(j)===1},a.prototype.gt=function(j){return this.cmp(j)===1},a.prototype.gten=function(j){return this.cmpn(j)>=0},a.prototype.gte=function(j){return this.cmp(j)>=0},a.prototype.ltn=function(j){return this.cmpn(j)===-1},a.prototype.lt=function(j){return this.cmp(j)===-1},a.prototype.lten=function(j){return this.cmpn(j)<=0},a.prototype.lte=function(j){return this.cmp(j)<=0},a.prototype.eqn=function(j){return this.cmpn(j)===0},a.prototype.eq=function(j){return this.cmp(j)===0},a.red=function(j){return new K(j)},a.prototype.toRed=function(j){return n(!(this||et).red,"Already a number in reduction context"),n((this||et).negative===0,"red works only with positives"),j.convertTo(this||et)._forceRed(j)},a.prototype.fromRed=function(){return n((this||et).red,"fromRed works only with numbers in reduction context"),(this||et).red.convertFrom(this||et)},a.prototype._forceRed=function(j){return(this||et).red=j,this||et},a.prototype.forceRed=function(j){return n(!(this||et).red,"Already a number in reduction context"),this._forceRed(j)},a.prototype.redAdd=function(j){return n((this||et).red,"redAdd works only with red numbers"),(this||et).red.add(this||et,j)},a.prototype.redIAdd=function(j){return n((this||et).red,"redIAdd works only with red numbers"),(this||et).red.iadd(this||et,j)},a.prototype.redSub=function(j){return n((this||et).red,"redSub works only with red numbers"),(this||et).red.sub(this||et,j)},a.prototype.redISub=function(j){return n((this||et).red,"redISub works only with red numbers"),(this||et).red.isub(this||et,j)},a.prototype.redShl=function(j){return n((this||et).red,"redShl works only with red numbers"),(this||et).red.shl(this||et,j)},a.prototype.redMul=function(j){return n((this||et).red,"redMul works only with red numbers"),(this||et).red._verify2(this||et,j),(this||et).red.mul(this||et,j)},a.prototype.redIMul=function(j){return n((this||et).red,"redMul works only with red numbers"),(this||et).red._verify2(this||et,j),(this||et).red.imul(this||et,j)},a.prototype.redSqr=function(){return n((this||et).red,"redSqr works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.sqr(this||et)},a.prototype.redISqr=function(){return n((this||et).red,"redISqr works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.isqr(this||et)},a.prototype.redSqrt=function(){return n((this||et).red,"redSqrt works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.sqrt(this||et)},a.prototype.redInvm=function(){return n((this||et).red,"redInvm works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.invm(this||et)},a.prototype.redNeg=function(){return n((this||et).red,"redNeg works only with red numbers"),(this||et).red._verify1(this||et),(this||et).red.neg(this||et)},a.prototype.redPow=function(j){return n((this||et).red&&!j.red,"redPow(normalNum)"),(this||et).red._verify1(this||et),(this||et).red.pow(this||et,j)};var k={k256:null,p224:null,p192:null,p25519:null};function I(j,z){(this||et).name=j,(this||et).p=new a(z,16),(this||et).n=(this||et).p.bitLength(),(this||et).k=new a(1).iushln((this||et).n).isub((this||et).p),(this||et).tmp=this._tmp()}function B(){I.call(this||et,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P(){I.call(this||et,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function C(){I.call(this||et,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function q(){I.call(this||et,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function K(j){if(typeof j=="string"){var z=a._prime(j);(this||et).m=z.p,(this||et).prime=z}else n(j.gtn(1),"modulus must be greater than 1"),(this||et).m=j,(this||et).prime=null}function V(j){K.call(this||et,j),(this||et).shift=(this||et).m.bitLength(),(this||et).shift%26!=0&&((this||et).shift+=26-(this||et).shift%26),(this||et).r=new a(1).iushln((this||et).shift),(this||et).r2=this.imod((this||et).r.sqr()),(this||et).rinv=(this||et).r._invmp((this||et).m),(this||et).minv=(this||et).rinv.mul((this||et).r).isubn(1).div((this||et).m),(this||et).minv=(this||et).minv.umod((this||et).r),(this||et).minv=(this||et).r.sub((this||et).minv)}I.prototype._tmp=function(){var j=new a(null);return j.words=new Array(Math.ceil((this||et).n/13)),j},I.prototype.ireduce=function(j){var z,J=j;do this.split(J,(this||et).tmp),z=(J=(J=this.imulK(J)).iadd((this||et).tmp)).bitLength();while(z>(this||et).n);var E=z<(this||et).n?-1:J.ucmp((this||et).p);return E===0?(J.words[0]=0,J.length=1):E>0?J.isub((this||et).p):J.strip(),J},I.prototype.split=function(j,z){j.iushrn((this||et).n,0,z)},I.prototype.imulK=function(j){return j.imul((this||et).k)},h(B,I),B.prototype.split=function(j,z){for(var J=Math.min(j.length,9),E=0;E<J;E++)z.words[E]=j.words[E];if(z.length=J,j.length<=9)return j.words[0]=0,j.length=1,void 0;var i=j.words[9];for(z.words[z.length++]=4194303&i,E=10;E<j.length;E++){var s=0|j.words[E];j.words[E-10]=(4194303&s)<<4|i>>>22,i=s}i>>>=22,j.words[E-10]=i,i===0&&j.length>10?j.length-=10:j.length-=9},B.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;for(var z=0,J=0;J<j.length;J++){var E=0|j.words[J];z+=977*E,j.words[J]=67108863&z,z=64*E+(z/67108864|0)}return j.words[j.length-1]===0&&(j.length--,j.words[j.length-1]===0&&j.length--),j},h(P,I),h(C,I),h(q,I),q.prototype.imulK=function(j){for(var z=0,J=0;J<j.length;J++){var E=19*(0|j.words[J])+z,i=67108863&E;E>>>=26,j.words[J]=i,z=E}return z!==0&&(j.words[j.length++]=z),j},a._prime=function(j){if(k[j])return k[j];var z;if(j==="k256")z=new B;else if(j==="p224")z=new P;else if(j==="p192")z=new C;else{if(j!=="p25519")throw new Error("Unknown prime "+j);z=new q}return k[j]=z,z},K.prototype._verify1=function(j){n(j.negative===0,"red works only with positives"),n(j.red,"red works only with red numbers")},K.prototype._verify2=function(j,z){n((j.negative|z.negative)==0,"red works only with positives"),n(j.red&&j.red===z.red,"red works only with red numbers")},K.prototype.imod=function(j){return(this||et).prime?(this||et).prime.ireduce(j)._forceRed(this||et):j.umod((this||et).m)._forceRed(this||et)},K.prototype.neg=function(j){return j.isZero()?j.clone():(this||et).m.sub(j)._forceRed(this||et)},K.prototype.add=function(j,z){this._verify2(j,z);var J=j.add(z);return J.cmp((this||et).m)>=0&&J.isub((this||et).m),J._forceRed(this||et)},K.prototype.iadd=function(j,z){this._verify2(j,z);var J=j.iadd(z);return J.cmp((this||et).m)>=0&&J.isub((this||et).m),J},K.prototype.sub=function(j,z){this._verify2(j,z);var J=j.sub(z);return J.cmpn(0)<0&&J.iadd((this||et).m),J._forceRed(this||et)},K.prototype.isub=function(j,z){this._verify2(j,z);var J=j.isub(z);return J.cmpn(0)<0&&J.iadd((this||et).m),J},K.prototype.shl=function(j,z){return this._verify1(j),this.imod(j.ushln(z))},K.prototype.imul=function(j,z){return this._verify2(j,z),this.imod(j.imul(z))},K.prototype.mul=function(j,z){return this._verify2(j,z),this.imod(j.mul(z))},K.prototype.isqr=function(j){return this.imul(j,j.clone())},K.prototype.sqr=function(j){return this.mul(j,j)},K.prototype.sqrt=function(j){if(j.isZero())return j.clone();var z=(this||et).m.andln(3);if(n(z%2==1),z===3){var J=(this||et).m.add(new a(1)).iushrn(2);return this.pow(j,J)}for(var E=(this||et).m.subn(1),i=0;!E.isZero()&&E.andln(1)===0;)i++,E.iushrn(1);n(!E.isZero());var s=new a(1).toRed(this||et),f=s.redNeg(),l=(this||et).m.subn(1).iushrn(1),p=(this||et).m.bitLength();for(p=new a(2*p*p).toRed(this||et);this.pow(p,l).cmp(f)!==0;)p.redIAdd(f);for(var _=this.pow(p,E),x=this.pow(j,E.addn(1).iushrn(1)),o=this.pow(j,E),t=i;o.cmp(s)!==0;){for(var u=o,b=0;u.cmp(s)!==0;b++)u=u.redSqr();n(b<t);var M=this.pow(_,new a(1).iushln(t-b-1));x=x.redMul(M),_=M.redSqr(),o=o.redMul(_),t=b}return x},K.prototype.invm=function(j){var z=j._invmp((this||et).m);return z.negative!==0?(z.negative=0,this.imod(z).redNeg()):this.imod(z)},K.prototype.pow=function(j,z){if(z.isZero())return new a(1).toRed(this||et);if(z.cmpn(1)===0)return j.clone();var J=new Array(16);J[0]=new a(1).toRed(this||et),J[1]=j;for(var E=2;E<J.length;E++)J[E]=this.mul(J[E-1],j);var i=J[0],s=0,f=0,l=z.bitLength()%26;for(l===0&&(l=26),E=z.length-1;E>=0;E--){for(var p=z.words[E],_=l-1;_>=0;_--){var x=p>>_&1;i!==J[0]&&(i=this.sqr(i)),x!==0||s!==0?(s<<=1,s|=x,(++f===4||E===0&&_===0)&&(i=this.mul(i,J[s]),f=0,s=0)):f=0}l=26}return i},K.prototype.convertTo=function(j){var z=j.umod((this||et).m);return z===j?z.clone():z},K.prototype.convertFrom=function(j){var z=j.clone();return z.red=null,z},a.mont=function(j){return new V(j)},h(V,K),V.prototype.convertTo=function(j){return this.imod(j.ushln((this||et).shift))},V.prototype.convertFrom=function(j){var z=this.imod(j.mul((this||et).rinv));return z.red=null,z},V.prototype.imul=function(j,z){if(j.isZero()||z.isZero())return j.words[0]=0,j.length=1,j;var J=j.imul(z),E=J.maskn((this||et).shift).mul((this||et).minv).imaskn((this||et).shift).mul((this||et).m),i=J.isub(E).iushrn((this||et).shift),s=i;return i.cmp((this||et).m)>=0?s=i.isub((this||et).m):i.cmpn(0)<0&&(s=i.iadd((this||et).m)),s._forceRed(this||et)},V.prototype.mul=function(j,z){if(j.isZero()||z.isZero())return new a(0)._forceRed(this||et);var J=j.mul(z),E=J.maskn((this||et).shift).mul((this||et).minv).imaskn((this||et).shift).mul((this||et).m),i=J.isub(E).iushrn((this||et).shift),s=i;return i.cmp((this||et).m)>=0?s=i.isub((this||et).m):i.cmpn(0)<0&&(s=i.iadd((this||et).m)),s._forceRed(this||et)},V.prototype.invm=function(j){return this.imod(j._invmp((this||et).m).mul((this||et).r2))._forceRed(this||et)}})(kY,TY);qn=kY.exports,L3e=Object.freeze({}),ky=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;if((IY=function(e){return B_||(B_=new kh(null)),B_.generate(e)}).Rand=kh,kh.prototype.generate=function(e){return this._rand(e)},kh.prototype._rand=function(e){if((this||ky).rand.getBytes)return(this||ky).rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n<r.length;n++)r[n]=(this||ky).rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?kh.prototype._rand=function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?kh.prototype._rand=function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(kh.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(O_=L3e,typeof O_.randomBytes!="function")throw new Error("Not supported");kh.prototype._rand=function(e){return O_.randomBytes(e)}}catch(e){}sA=IY,OY=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,nl=qn,D3e=sA;BY=al,al.create=function(e){return new al(e)},al.prototype._randbelow=function(e){var r=e.bitLength(),n=Math.ceil(r/8);do var h=new nl((this||OY).rand.generate(n));while(h.cmp(e)>=0);return h},al.prototype._randrange=function(e,r){var n=r.sub(e);return e.add(this._randbelow(n))},al.prototype.test=function(e,r,n){var h=e.bitLength(),a=nl.mont(e),d=new nl(1).toRed(a);r||(r=Math.max(1,h/48|0));for(var c=e.subn(1),v=0;!c.testn(v);v++);for(var w=e.shrn(v),m=c.toRed(a);r>0;r--){var y=this._randrange(new nl(2),c);n&&n(y);var g=y.toRed(a).redPow(w);if(g.cmp(d)!==0&&g.cmp(m)!==0){for(var S=1;S<v;S++){if((g=g.redSqr()).cmp(d)===0)return!1;if(g.cmp(m)===0)break}if(S===v)return!1}}return!0},al.prototype.getDivisor=function(e,r){var n=e.bitLength(),h=nl.mont(e),a=new nl(1).toRed(h);r||(r=Math.max(1,n/48|0));for(var d=e.subn(1),c=0;!d.testn(c);c++);for(var v=e.shrn(c),w=d.toRed(h);r>0;r--){var m=this._randrange(new nl(2),d),y=e.gcd(m);if(y.cmpn(1)!==0)return y;var g=m.toRed(h).redPow(v);if(g.cmp(a)!==0&&g.cmp(w)!==0){for(var S=1;S<c;S++){if((g=g.redSqr()).cmp(a)===0)return g.fromRed().subn(1).gcd(e);if(g.cmp(w)===0)break}if(S===c)return(g=g.redSqr()).fromRed().subn(1).gcd(e)}}return!1};PY=BY,$3e=Rd;NY=N_,N_.simpleSieve=IE,N_.fermatTest=BE;Na=qn,U3e=new Na(24),LH=new PY,q3e=new Na(1),kE=new Na(2),j3e=new Na(5),F3e=(new Na(16),new Na(8),new Na(10)),z3e=new Na(3),H3e=(new Na(7),new Na(11)),DH=new Na(4),P_=(new Na(12),null);LY=NY,wi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,nu=Pr.Buffer,Ms=qn,$H=new PY,Z3e=new Ms(24),W3e=new Ms(11),G3e=new Ms(10),V3e=new Ms(3),Y3e=new Ms(7),UH=LY,J3e=Rd;CY=qu;j6={};Object.defineProperty(qu.prototype,"verifyError",{enumerable:!0,get:function(){return typeof(this||wi)._primeCode!="number"&&((this||wi)._primeCode=function(e,r){var n=r.toString("hex"),h=[n,e.toString(16)].join("_");if(h in j6)return j6[h];var a,d=0;if(e.isEven()||!UH.simpleSieve||!UH.fermatTest(e)||!$H.test(e))return d+=1,d+=n==="02"||n==="05"?8:4,j6[h]=d,d;switch($H.test(e.shrn(1))||(d+=2),n){case"02":e.mod(Z3e).cmp(W3e)&&(d+=8);break;case"05":(a=e.mod(G3e)).cmp(V3e)&&a.cmp(Y3e)&&(d+=8);break;default:d+=4}return j6[h]=d,d}((this||wi).__prime,(this||wi).__gen)),(this||wi)._primeCode}}),qu.prototype.generateKeys=function(){return(this||wi)._priv||((this||wi)._priv=new Ms(J3e((this||wi)._primeLen))),(this||wi)._pub=(this||wi)._gen.toRed((this||wi)._prime).redPow((this||wi)._priv).fromRed(),this.getPublicKey()},qu.prototype.computeSecret=function(e){var r=(e=(e=new Ms(e)).toRed((this||wi)._prime)).redPow((this||wi)._priv).fromRed(),n=new nu(r.toArray()),h=this.getPrime();if(n.length<h.length){var a=new nu(h.length-n.length);a.fill(0),n=nu.concat([a,n])}return n},qu.prototype.getPublicKey=function(e){return F6((this||wi)._pub,e)},qu.prototype.getPrivateKey=function(e){return F6((this||wi)._priv,e)},qu.prototype.getPrime=function(e){return F6((this||wi).__prime,e)},qu.prototype.getGenerator=function(e){return F6((this||wi)._gen,e)},qu.prototype.setGenerator=function(e,r){return r=r||"utf8",nu.isBuffer(e)||(e=new nu(e,r)),(this||wi).__gen=e,(this||wi)._gen=new Ms(e),this||wi};e8e=CY,ld={},Ih=Pr.Buffer,t8e=LY,qH={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},C_=e8e,r8e={binary:!0,hex:!0,base64:!0};ld.DiffieHellmanGroup=ld.createDiffieHellmanGroup=ld.getDiffieHellman=function(e){var r=new Ih(qH[e].prime,"hex"),n=new Ih(qH[e].gen,"hex");return new C_(r,n)},ld.createDiffieHellman=ld.DiffieHellman=function e(r,n,h,a){return Ih.isBuffer(n)||r8e[n]===void 0?e(r,"binary",n,h):(n=n||"binary",a=a||"binary",h=h||new Ih([2]),Ih.isBuffer(h)||(h=new Ih(h,a)),typeof r=="number"?new C_(t8e(r,h),h,!0):(Ih.isBuffer(r)||(r=new Ih(r,n)),new C_(r,h,!0)))};i8e=Pr.Buffer,Yh=qn,jH=Rd;DY=FH,FH.getr=$Y;fA=DY,uA={},z6=uA;z6.toArray=function(e,r){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if(typeof e!="string"){for(var h=0;h<e.length;h++)n[h]=0|e[h];return n}if(r==="hex")for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),h=0;h<e.length;h+=2)n.push(parseInt(e[h]+e[h+1],16));else for(h=0;h<e.length;h++){var a=e.charCodeAt(h),d=a>>8,c=255&a;d?n.push(d,c):n.push(c)}return n},z6.zero2=UY,z6.toHex=zH,z6.encode=function(e,r){return r==="hex"?zH(e):e};Bo={},uf=Bo,n8e=qn,a8e=Es,H6=uA;uf.assert=a8e,uf.toArray=H6.toArray,uf.zero2=H6.zero2,uf.toHex=H6.toHex,uf.encode=H6.encode,uf.getNAF=function(e,r,n){var h=new Array(Math.max(e.bitLength(),n)+1);h.fill(0);for(var a=1<<r+1,d=e.clone(),c=0;c<h.length;c++){var v,w=d.andln(a-1);d.isOdd()?(v=w>(a>>1)-1?(a>>1)-w:w,d.isubn(v)):v=0,h[c]=v,d.iushrn(1)}return h},uf.getJSF=function(e,r){var n=[[],[]];e=e.clone(),r=r.clone();for(var h=0,a=0;e.cmpn(-h)>0||r.cmpn(-a)>0;){var d,c,v,w=e.andln(3)+h&3,m=r.andln(3)+a&3;w===3&&(w=-1),m===3&&(m=-1),(1&w)==0?d=0:d=(v=e.andln(7)+h&7)!==3&&v!==5||m!==2?w:-w,n[0].push(d),(1&m)==0?c=0:c=(v=r.andln(7)+a&7)!==3&&v!==5||w!==2?m:-m,n[1].push(c),2*h===d+1&&(h=1-h),2*a===c+1&&(a=1-a),e.iushrn(1),r.iushrn(1)}return n},uf.cachedProperty=function(e,r,n){var h="_"+r;e.prototype[r]=function(){return this[h]!==void 0?this[h]:this[h]=n.call(this)}},uf.parseBytes=function(e){return typeof e=="string"?uf.toArray(e,"hex"):e},uf.intFromLE=function(e){return new n8e(e,"hex","le")};$y=qn,OE=Bo,o8e=OE.assert;qY=Iy,Iy.prototype._importDER=function(e,r){e=OE.toArray(e,r);var n=new s8e;if(e[n.place++]!==48||L_(e,n)+n.place!==e.length||e[n.place++]!==2)return!1;var h=L_(e,n),a=e.slice(n.place,h+n.place);if(n.place+=h,e[n.place++]!==2)return!1;var d=L_(e,n);if(e.length!==d+n.place)return!1;var c=e.slice(n.place,d+n.place);return a[0]===0&&128&a[1]&&(a=a.slice(1)),c[0]===0&&128&c[1]&&(c=c.slice(1)),this.r=new $y(a),this.s=new $y(c),this.recoveryParam=null,!0},Iy.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&n[0]&&(n=[0].concat(n)),r=HH(r),n=HH(n);!(n[0]||128&n[1]);)n=n.slice(1);var h=[2];D_(h,r.length),(h=h.concat(r)).push(2),D_(h,n.length);var a=h.concat(n),d=[48];return D_(d,a.length),d=d.concat(a),OE.encode(d,e)};f8e=qY,mi={},u8e=Es,h8e=jr;mi.inherits=h8e,mi.toArray=function(e,r){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if(typeof e=="string")if(r){if(r==="hex")for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)n.push(parseInt(e[a]+e[a+1],16))}else for(var h=0,a=0;a<e.length;a++){var d=e.charCodeAt(a);d<128?n[h++]=d:d<2048?(n[h++]=d>>6|192,n[h++]=63&d|128):l8e(e,a)?(d=65536+((1023&d)<<10)+(1023&e.charCodeAt(++a)),n[h++]=d>>18|240,n[h++]=d>>12&63|128,n[h++]=d>>6&63|128,n[h++]=63&d|128):(n[h++]=d>>12|224,n[h++]=d>>6&63|128,n[h++]=63&d|128)}else for(a=0;a<e.length;a++)n[a]=0|e[a];return n},mi.toHex=function(e){for(var r="",n=0;n<e.length;n++)r+=ZH(e[n].toString(16));return r},mi.htonl=KH,mi.toHex32=function(e,r){for(var n="",h=0;h<e.length;h++){var a=e[h];r==="little"&&(a=KH(a)),n+=WH(a.toString(16))}return n},mi.zero2=ZH,mi.zero8=WH,mi.join32=function(e,r,n,h){var a=n-r;u8e(a%4==0);for(var d=new Array(a/4),c=0,v=r;c<d.length;c++,v+=4){var w;w=h==="big"?e[v]<<24|e[v+1]<<16|e[v+2]<<8|e[v+3]:e[v+3]<<24|e[v+2]<<16|e[v+1]<<8|e[v],d[c]=w>>>0}return d},mi.split32=function(e,r){for(var n=new Array(4*e.length),h=0,a=0;h<e.length;h++,a+=4){var d=e[h];r==="big"?(n[a]=d>>>24,n[a+1]=d>>>16&255,n[a+2]=d>>>8&255,n[a+3]=255&d):(n[a+3]=d>>>24,n[a+2]=d>>>16&255,n[a+1]=d>>>8&255,n[a]=255&d)}return n},mi.rotr32=function(e,r){return e>>>r|e<<32-r},mi.rotl32=function(e,r){return e<<r|e>>>32-r},mi.sum32=function(e,r){return e+r>>>0},mi.sum32_3=function(e,r,n){return e+r+n>>>0},mi.sum32_4=function(e,r,n,h){return e+r+n+h>>>0},mi.sum32_5=function(e,r,n,h,a){return e+r+n+h+a>>>0},mi.sum64=function(e,r,n,h){var a=e[r],d=h+e[r+1]>>>0,c=(d<h?1:0)+n+a;e[r]=c>>>0,e[r+1]=d},mi.sum64_hi=function(e,r,n,h){return(r+h>>>0<r?1:0)+e+n>>>0},mi.sum64_lo=function(e,r,n,h){return r+h>>>0},mi.sum64_4_hi=function(e,r,n,h,a,d,c,v){var w=0,m=r;return w+=(m=m+h>>>0)<r?1:0,w+=(m=m+d>>>0)<d?1:0,e+n+a+c+(w+=(m=m+v>>>0)<v?1:0)>>>0},mi.sum64_4_lo=function(e,r,n,h,a,d,c,v){return r+h+d+v>>>0},mi.sum64_5_hi=function(e,r,n,h,a,d,c,v,w,m){var y=0,g=r;return y+=(g=g+h>>>0)<r?1:0,y+=(g=g+d>>>0)<d?1:0,y+=(g=g+v>>>0)<v?1:0,e+n+a+c+w+(y+=(g=g+m>>>0)<m?1:0)>>>0},mi.sum64_5_lo=function(e,r,n,h,a,d,c,v,w,m){return r+h+d+v+m>>>0},mi.rotr64_hi=function(e,r,n){return(r<<32-n|e>>>n)>>>0},mi.rotr64_lo=function(e,r,n){return(e<<32-n|r>>>n)>>>0},mi.shr64_hi=function(e,r,n){return e>>>n},mi.shr64_lo=function(e,r,n){return(e<<32-n|r>>>n)>>>0};Td={},GH=mi,c8e=Es;Td.BlockHash=K6,K6.prototype.update=function(e,r){if(e=GH.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=GH.join32(e,0,e.length-n,this.endian);for(var h=0;h<e.length;h+=this._delta32)this._update(e,h,h+this._delta32)}return this},K6.prototype.digest=function(e){return this.update(this._pad()),c8e(this.pending===null),this._digest(e)},K6.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,n=r-(e+this.padLength)%r,h=new Array(n+this.padLength);h[0]=128;for(var a=1;a<n;a++)h[a]=0;if(e<<=3,this.endian==="big"){for(var d=8;d<this.padLength;d++)h[a++]=0;h[a++]=0,h[a++]=0,h[a++]=0,h[a++]=0,h[a++]=e>>>24&255,h[a++]=e>>>16&255,h[a++]=e>>>8&255,h[a++]=255&e}else for(h[a++]=255&e,h[a++]=e>>>8&255,h[a++]=e>>>16&255,h[a++]=e>>>24&255,h[a++]=0,h[a++]=0,h[a++]=0,h[a++]=0,d=8;d<this.padLength;d++)h[a++]=0;return h};ho=mi,d8e=Td,p8e=Es,au=ho.rotr64_hi,ou=ho.rotr64_lo,FY=ho.shr64_hi,zY=ho.shr64_lo,Bh=ho.sum64,$_=ho.sum64_hi,U_=ho.sum64_lo,v8e=ho.sum64_4_hi,m8e=ho.sum64_4_lo,g8e=ho.sum64_5_hi,y8e=ho.sum64_5_lo,HY=d8e.BlockHash,b8e=[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,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];ho.inherits(pf,HY),jY=pf,pf.blockSize=1024,pf.outSize=512,pf.hmacStrength=192,pf.padLength=128,pf.prototype._prepareBlock=function(e,r){for(var n=this.W,h=0;h<32;h++)n[h]=e[r+h];for(;h<n.length;h+=2){var a=I8e(n[h-4],n[h-3]),d=B8e(n[h-4],n[h-3]),c=n[h-14],v=n[h-13],w=T8e(n[h-30],n[h-29]),m=k8e(n[h-30],n[h-29]),y=n[h-32],g=n[h-31];n[h]=v8e(a,d,c,v,w,m,y,g),n[h+1]=m8e(a,d,c,v,w,m,y,g)}},pf.prototype._update=function(e,r){this._prepareBlock(e,r);var n=this.W,h=this.h[0],a=this.h[1],d=this.h[2],c=this.h[3],v=this.h[4],w=this.h[5],m=this.h[6],y=this.h[7],g=this.h[8],S=this.h[9],R=this.h[10],A=this.h[11],k=this.h[12],I=this.h[13],B=this.h[14],P=this.h[15];p8e(this.k.length===n.length);for(var C=0;C<n.length;C+=2){var q=B,K=P,V=R8e(g,S),j=x8e(g,S),z=w8e(g,S,R,A,k),J=_8e(g,S,R,A,k,I),E=this.k[C],i=this.k[C+1],s=n[C],f=n[C+1],l=g8e(q,K,V,j,z,J,E,i,s,f),p=y8e(q,K,V,j,z,J,E,i,s,f);q=E8e(h,a),K=A8e(h,a),V=M8e(h,a,d,c,v),j=S8e(h,a,d,c,v,w);var _=$_(q,K,V,j),x=U_(q,K,V,j);B=k,P=I,k=R,I=A,R=g,A=S,g=$_(m,y,l,p),S=U_(y,y,l,p),m=v,y=w,v=d,w=c,d=h,c=a,h=$_(l,p,_,x),a=U_(l,p,_,x)}Bh(this.h,0,h,a),Bh(this.h,2,d,c),Bh(this.h,4,v,w),Bh(this.h,6,m,y),Bh(this.h,8,g,S),Bh(this.h,10,R,A),Bh(this.h,12,k,I),Bh(this.h,14,B,P)},pf.prototype._digest=function(e){return e==="hex"?ho.toHex32(this.h,"big"):ho.split32(this.h,"big")};KY=jY,Qf={},Vf=mi.rotr32;Qf.ft_1=function(e,r,n,h){return e===0?VH(r,n,h):e===1||e===3?JH(r,n,h):e===2?YH(r,n,h):void 0},Qf.ch32=VH,Qf.maj32=YH,Qf.p32=JH,Qf.s0_256=function(e){return Vf(e,2)^Vf(e,13)^Vf(e,22)},Qf.s1_256=function(e){return Vf(e,6)^Vf(e,11)^Vf(e,25)},Qf.g0_256=function(e){return Vf(e,7)^Vf(e,18)^e>>>3},Qf.g1_256=function(e){return Vf(e,17)^Vf(e,19)^e>>>10};md=mi,O8e=Td,kd=Qf,P8e=Es,hf=md.sum32,N8e=md.sum32_4,C8e=md.sum32_5,L8e=kd.ch32,D8e=kd.maj32,$8e=kd.s0_256,U8e=kd.s1_256,q8e=kd.g0_256,j8e=kd.g1_256,WY=O8e.BlockHash,F8e=[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];md.inherits(eu,WY),ZY=eu,eu.blockSize=512,eu.outSize=256,eu.hmacStrength=192,eu.padLength=64,eu.prototype._update=function(e,r){for(var n=this.W,h=0;h<16;h++)n[h]=e[r+h];for(;h<n.length;h++)n[h]=N8e(j8e(n[h-2]),n[h-7],q8e(n[h-15]),n[h-16]);var a=this.h[0],d=this.h[1],c=this.h[2],v=this.h[3],w=this.h[4],m=this.h[5],y=this.h[6],g=this.h[7];for(P8e(this.k.length===n.length),h=0;h<n.length;h++){var S=C8e(g,U8e(w),L8e(w,m,y),this.k[h],n[h]),R=hf($8e(a),D8e(a,d,c));g=y,y=m,m=w,w=hf(v,S),v=c,c=d,d=a,a=hf(S,R)}this.h[0]=hf(this.h[0],a),this.h[1]=hf(this.h[1],d),this.h[2]=hf(this.h[2],c),this.h[3]=hf(this.h[3],v),this.h[4]=hf(this.h[4],w),this.h[5]=hf(this.h[5],m),this.h[6]=hf(this.h[6],y),this.h[7]=hf(this.h[7],g)},eu.prototype._digest=function(e){return e==="hex"?md.toHex32(this.h,"big"):md.split32(this.h,"big")};GY=ZY,gd=mi,z8e=Td,H8e=Qf,q_=gd.rotl32,Tp=gd.sum32,K8e=gd.sum32_5,Z8e=H8e.ft_1,YY=z8e.BlockHash,W8e=[1518500249,1859775393,2400959708,3395469782];gd.inherits(tu,YY),VY=tu,tu.blockSize=512,tu.outSize=160,tu.hmacStrength=80,tu.padLength=64,tu.prototype._update=function(e,r){for(var n=this.W,h=0;h<16;h++)n[h]=e[r+h];for(;h<n.length;h++)n[h]=q_(n[h-3]^n[h-8]^n[h-14]^n[h-16],1);var a=this.h[0],d=this.h[1],c=this.h[2],v=this.h[3],w=this.h[4];for(h=0;h<n.length;h++){var m=~~(h/20),y=K8e(q_(a,5),Z8e(m,d,c,v),w,n[h],W8e[m]);w=v,v=c,c=q_(d,30),d=a,a=y}this.h[0]=Tp(this.h[0],a),this.h[1]=Tp(this.h[1],d),this.h[2]=Tp(this.h[2],c),this.h[3]=Tp(this.h[3],v),this.h[4]=Tp(this.h[4],w)},tu.prototype._digest=function(e){return e==="hex"?gd.toHex32(this.h,"big"):gd.split32(this.h,"big")};G8e=VY,j_=mi,XY=GY;j_.inherits(Fu,XY),JY=Fu,Fu.blockSize=512,Fu.outSize=224,Fu.hmacStrength=192,Fu.padLength=64,Fu.prototype._digest=function(e){return e==="hex"?j_.toHex32(this.h.slice(0,7),"big"):j_.split32(this.h.slice(0,7),"big")};V8e=JY,F_=mi,eJ=KY;F_.inherits(zu,eJ),QY=zu,zu.blockSize=1024,zu.outSize=384,zu.hmacStrength=192,zu.padLength=128,zu.prototype._digest=function(e){return e==="hex"?F_.toHex32(this.h.slice(0,12),"big"):F_.split32(this.h.slice(0,12),"big")};Y8e=QY,cd={};cd.sha1=G8e,cd.sha224=V8e,cd.sha256=GY,cd.sha384=Y8e,cd.sha512=KY;tJ={},Rl=mi,J8e=Td,Z6=Rl.rotl32,XH=Rl.sum32,kp=Rl.sum32_3,QH=Rl.sum32_4,rJ=J8e.BlockHash;Rl.inherits(ru,rJ),tJ.ripemd160=ru,ru.blockSize=512,ru.outSize=160,ru.hmacStrength=192,ru.padLength=64,ru.prototype._update=function(e,r){for(var n=this.h[0],h=this.h[1],a=this.h[2],d=this.h[3],c=this.h[4],v=n,w=h,m=a,y=d,g=c,S=0;S<80;S++){var R=XH(Z6(QH(n,eK(S,h,a,d),e[e4e[S]+r],X8e(S)),r4e[S]),c);n=c,c=d,d=Z6(a,10),a=h,h=R,R=XH(Z6(QH(v,eK(79-S,w,m,y),e[t4e[S]+r],Q8e(S)),i4e[S]),g),v=g,g=y,y=Z6(m,10),m=w,w=R}R=kp(this.h[1],a,y),this.h[1]=kp(this.h[2],d,g),this.h[2]=kp(this.h[3],c,v),this.h[3]=kp(this.h[4],n,w),this.h[4]=kp(this.h[0],h,m),this.h[0]=R},ru.prototype._digest=function(e){return e==="hex"?Rl.toHex32(this.h,"little"):Rl.split32(this.h,"little")};e4e=[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],t4e=[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],r4e=[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],i4e=[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],n4e=mi,a4e=Es;iJ=dd,dd.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),a4e(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},dd.prototype.update=function(e,r){return this.inner.update(e,r),this},dd.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};o4e=iJ,Qy={},ga=Qy;ga.utils=mi,ga.common=Td,ga.sha=cd,ga.ripemd=tJ,ga.hmac=o4e,ga.sha1=ga.sha.sha1,ga.sha256=ga.sha.sha256,ga.sha224=ga.sha.sha224,ga.sha384=ga.sha.sha384,ga.sha512=ga.sha.sha512,ga.ripemd160=ga.ripemd.ripemd160;s4e=Qy,El=uA,aJ=Es;nJ=Jh,Jh.prototype._init=function(e,r,n){var h=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(h),this._reseed=1,this.reseedInterval=281474976710656},Jh.prototype._hmac=function(){return new s4e.hmac(this.hash,this.K)},Jh.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Jh.prototype.reseed=function(e,r,n,h){typeof r!="string"&&(h=n,n=r,r=null),e=El.toArray(e,r),n=El.toArray(n,h),aJ(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},Jh.prototype.generate=function(e,r,n,h){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(h=n,n=r,r=null),n&&(n=El.toArray(n,h||"hex"),this._update(n));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var d=a.slice(0,e);return this._update(n),this._reseed++,El.encode(d,r)};f4e=nJ,ol=qn,i2=Bo,W6=i2.getNAF,u4e=i2.getJSF,G6=i2.assert;oJ=Oh,Oh.prototype.point=function(){throw new Error("Not implemented")},Oh.prototype.validate=function(){throw new Error("Not implemented")},Oh.prototype._fixedNafMul=function(e,r){G6(e.precomputed);var n=e._getDoubles(),h=W6(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2==0?2:1);a/=3;for(var d=[],c=0;c<h.length;c+=n.step){var v=0;for(r=c+n.step-1;r>=c;r--)v=(v<<1)+h[r];d.push(v)}for(var w=this.jpoint(null,null,null),m=this.jpoint(null,null,null),y=a;y>0;y--){for(c=0;c<d.length;c++)(v=d[c])===y?m=m.mixedAdd(n.points[c]):v===-y&&(m=m.mixedAdd(n.points[c].neg()));w=w.add(m)}return w.toP()},Oh.prototype._wnafMul=function(e,r){var n=4,h=e._getNAFPoints(n);n=h.wnd;for(var a=h.points,d=W6(r,n,this._bitLength),c=this.jpoint(null,null,null),v=d.length-1;v>=0;v--){for(r=0;v>=0&&d[v]===0;v--)r++;if(v>=0&&r++,c=c.dblp(r),v<0)break;var w=d[v];G6(w!==0),c=e.type==="affine"?w>0?c.mixedAdd(a[w-1>>1]):c.mixedAdd(a[-w-1>>1].neg()):w>0?c.add(a[w-1>>1]):c.add(a[-w-1>>1].neg())}return e.type==="affine"?c.toP():c},Oh.prototype._wnafMulAdd=function(e,r,n,h,a){for(var d=this._wnafT1,c=this._wnafT2,v=this._wnafT3,w=0,m=0;m<h;m++){var y=(j=r[m])._getNAFPoints(e);d[m]=y.wnd,c[m]=y.points}for(m=h-1;m>=1;m-=2){var g=m-1,S=m;if(d[g]===1&&d[S]===1){var R=[r[g],null,null,r[S]];r[g].y.cmp(r[S].y)===0?(R[1]=r[g].add(r[S]),R[2]=r[g].toJ().mixedAdd(r[S].neg())):r[g].y.cmp(r[S].y.redNeg())===0?(R[1]=r[g].toJ().mixedAdd(r[S]),R[2]=r[g].add(r[S].neg())):(R[1]=r[g].toJ().mixedAdd(r[S]),R[2]=r[g].toJ().mixedAdd(r[S].neg()));var A=[-3,-1,-5,-7,0,7,5,1,3],k=u4e(n[g],n[S]);w=Math.max(k[0].length,w),v[g]=new Array(w),v[S]=new Array(w);for(var I=0;I<w;I++){var B=0|k[0][I],P=0|k[1][I];v[g][I]=A[3*(B+1)+(P+1)],v[S][I]=0,c[g]=R}}else v[g]=W6(n[g],d[g],this._bitLength),v[S]=W6(n[S],d[S],this._bitLength),w=Math.max(v[g].length,w),w=Math.max(v[S].length,w)}var C=this.jpoint(null,null,null),q=this._wnafT4;for(m=w;m>=0;m--){for(var K=0;m>=0;){var V=!0;for(I=0;I<h;I++)q[I]=0|v[I][m],q[I]!==0&&(V=!1);if(!V)break;K++,m--}if(m>=0&&K++,C=C.dblp(K),m<0)break;for(I=0;I<h;I++){var j,z=q[I];z!==0&&(z>0?j=c[I][z-1>>1]:z<0&&(j=c[I][-z-1>>1].neg()),C=j.type==="affine"?C.mixedAdd(j):C.add(j))}}for(m=0;m<h;m++)c[m]=null;return a?C:C.toP()},Oh.BasePoint=ps,ps.prototype.eq=function(){throw new Error("Not implemented")},ps.prototype.validate=function(){return this.curve.validate(this)},Oh.prototype.decodePoint=function(e,r){e=i2.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1==2*n)return e[0]===6?G6(e[e.length-1]%2==0):e[0]===7&&G6(e[e.length-1]%2==1),this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")},ps.prototype.encodeCompressed=function(e){return this.encode(e,!0)},ps.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},ps.prototype.encode=function(e,r){return i2.encode(this._encode(r),e)},ps.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},ps.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return!!r&&r.points.length>=Math.ceil((e.bitLength()+1)/r.step)},ps.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],h=this,a=0;a<r;a+=e){for(var d=0;d<e;d++)h=h.dbl();n.push(h)}return{step:e,points:n}},ps.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,h=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(h);return{wnd:e,points:r}},ps.prototype._getBeta=function(){return null},ps.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r};eb=oJ,Rn=qn,z_=jr,yd=eb,h4e=Bo.assert;z_(vs,yd),sJ=vs,vs.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&this.p.modn(3)===1){var r,n;if(e.beta)r=new Rn(e.beta,16).toRed(this.red);else{var h=this._getEndoRoots(this.p);r=(r=h[0].cmp(h[1])<0?h[0]:h[1]).toRed(this.red)}if(e.lambda)n=new Rn(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],h4e(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}return{beta:r,lambda:n,basis:e.basis?e.basis.map(function(d){return{a:new Rn(d.a,16),b:new Rn(d.b,16)}}):this._getEndoBasis(n)}}},vs.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:Rn.mont(e),n=new Rn(2).toRed(r).redInvm(),h=n.redNeg(),a=new Rn(3).toRed(r).redNeg().redSqrt().redMul(n);return[h.redAdd(a).fromRed(),h.redSub(a).fromRed()]},vs.prototype._getEndoBasis=function(e){for(var r,n,h,a,d,c,v,w,m,y=this.n.ushrn(Math.floor(this.n.bitLength()/2)),g=e,S=this.n.clone(),R=new Rn(1),A=new Rn(0),k=new Rn(0),I=new Rn(1),B=0;g.cmpn(0)!==0;){var P=S.div(g);w=S.sub(P.mul(g)),m=k.sub(P.mul(R));var C=I.sub(P.mul(A));if(!h&&w.cmp(y)<0)r=v.neg(),n=R,h=w.neg(),a=m;else if(h&&++B==2)break;v=w,S=g,g=w,k=R,R=m,I=A,A=C}d=w.neg(),c=m;var q=h.sqr().add(a.sqr());return d.sqr().add(c.sqr()).cmp(q)>=0&&(d=r,c=n),h.negative&&(h=h.neg(),a=a.neg()),d.negative&&(d=d.neg(),c=c.neg()),[{a:h,b:a},{a:d,b:c}]},vs.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],h=r[1],a=h.b.mul(e).divRound(this.n),d=n.b.neg().mul(e).divRound(this.n),c=a.mul(n.a),v=d.mul(h.a),w=a.mul(n.b),m=d.mul(h.b);return{k1:e.sub(c).sub(v),k2:w.add(m).neg()}},vs.prototype.pointFromX=function(e,r){(e=new Rn(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),h=n.redSqrt();if(h.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=h.fromRed().isOdd();return(r&&!a||!r&&a)&&(h=h.redNeg()),this.point(e,h)},vs.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,h=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(h).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0},vs.prototype._endoWnafMulAdd=function(e,r,n){for(var h=this._endoWnafT1,a=this._endoWnafT2,d=0;d<e.length;d++){var c=this._endoSplit(r[d]),v=e[d],w=v._getBeta();c.k1.negative&&(c.k1.ineg(),v=v.neg(!0)),c.k2.negative&&(c.k2.ineg(),w=w.neg(!0)),h[2*d]=v,h[2*d+1]=w,a[2*d]=c.k1,a[2*d+1]=c.k2}for(var m=this._wnafMulAdd(1,h,a,2*d,n),y=0;y<2*d;y++)h[y]=null,a[y]=null;return m},z_(ua,yd.BasePoint),vs.prototype.point=function(e,r,n){return new ua(this,e,r,n)},vs.prototype.pointFromJSON=function(e,r){return ua.fromJSON(this,e,r)},ua.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,h=function(a){return n.point(a.x.redMul(n.endo.beta),a.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(h)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(h)}}}return r}},ua.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]},ua.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var h=e.point(r[0],r[1],n);if(!r[2])return h;function a(c){return e.point(c[0],c[1],n)}var d=r[2];return h.precomputed={beta:null,doubles:d.doubles&&{step:d.doubles.step,points:[h].concat(d.doubles.points.map(a))},naf:d.naf&&{wnd:d.naf.wnd,points:[h].concat(d.naf.points.map(a))}},h},ua.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)+">"},ua.prototype.isInfinity=function(){return this.inf},ua.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),h=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,h)},ua.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),h=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(h),d=a.redSqr().redISub(this.x.redAdd(this.x)),c=a.redMul(this.x.redSub(d)).redISub(this.y);return this.curve.point(d,c)},ua.prototype.getX=function(){return this.x.fromRed()},ua.prototype.getY=function(){return this.y.fromRed()},ua.prototype.mul=function(e){return e=new Rn(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},ua.prototype.mulAdd=function(e,r,n){var h=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(h,a):this.curve._wnafMulAdd(1,h,a,2)},ua.prototype.jmulAdd=function(e,r,n){var h=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(h,a,!0):this.curve._wnafMulAdd(1,h,a,2,!0)},ua.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},ua.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,h=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(h)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(h)}}}return r},ua.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},z_(ya,yd.BasePoint),vs.prototype.jpoint=function(e,r,n){return new ya(this,e,r,n)},ya.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),h=this.y.redMul(r).redMul(e);return this.curve.point(n,h)},ya.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},ya.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),h=this.x.redMul(r),a=e.x.redMul(n),d=this.y.redMul(r.redMul(e.z)),c=e.y.redMul(n.redMul(this.z)),v=h.redSub(a),w=d.redSub(c);if(v.cmpn(0)===0)return w.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=v.redSqr(),y=m.redMul(v),g=h.redMul(m),S=w.redSqr().redIAdd(y).redISub(g).redISub(g),R=w.redMul(g.redISub(S)).redISub(d.redMul(y)),A=this.z.redMul(e.z).redMul(v);return this.curve.jpoint(S,R,A)},ya.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,h=e.x.redMul(r),a=this.y,d=e.y.redMul(r).redMul(this.z),c=n.redSub(h),v=a.redSub(d);if(c.cmpn(0)===0)return v.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var w=c.redSqr(),m=w.redMul(c),y=n.redMul(w),g=v.redSqr().redIAdd(m).redISub(y).redISub(y),S=v.redMul(y.redISub(g)).redISub(a.redMul(m)),R=this.z.redMul(c);return this.curve.jpoint(g,S,R)},ya.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var r=this,n=0;n<e;n++)r=r.dbl();return r}var h=this.curve.a,a=this.curve.tinv,d=this.x,c=this.y,v=this.z,w=v.redSqr().redSqr(),m=c.redAdd(c);for(n=0;n<e;n++){var y=d.redSqr(),g=m.redSqr(),S=g.redSqr(),R=y.redAdd(y).redIAdd(y).redIAdd(h.redMul(w)),A=d.redMul(g),k=R.redSqr().redISub(A.redAdd(A)),I=A.redISub(k),B=R.redMul(I);B=B.redIAdd(B).redISub(S);var P=m.redMul(v);n+1<e&&(w=w.redMul(S)),d=k,v=P,m=B}return this.curve.jpoint(d,m.redMul(a),v)},ya.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},ya.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var h=this.x.redSqr(),a=this.y.redSqr(),d=a.redSqr(),c=this.x.redAdd(a).redSqr().redISub(h).redISub(d);c=c.redIAdd(c);var v=h.redAdd(h).redIAdd(h),w=v.redSqr().redISub(c).redISub(c),m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),e=w,r=v.redMul(c.redISub(w)).redISub(m),n=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),g=this.y.redSqr(),S=g.redSqr(),R=this.x.redAdd(g).redSqr().redISub(y).redISub(S);R=R.redIAdd(R);var A=y.redAdd(y).redIAdd(y),k=A.redSqr(),I=S.redIAdd(S);I=(I=I.redIAdd(I)).redIAdd(I),e=k.redISub(R).redISub(R),r=A.redMul(R.redISub(e)).redISub(I),n=(n=this.y.redMul(this.z)).redIAdd(n)}return this.curve.jpoint(e,r,n)},ya.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var h=this.x.redSqr(),a=this.y.redSqr(),d=a.redSqr(),c=this.x.redAdd(a).redSqr().redISub(h).redISub(d);c=c.redIAdd(c);var v=h.redAdd(h).redIAdd(h).redIAdd(this.curve.a),w=v.redSqr().redISub(c).redISub(c);e=w;var m=d.redIAdd(d);m=(m=m.redIAdd(m)).redIAdd(m),r=v.redMul(c.redISub(w)).redISub(m),n=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),g=this.y.redSqr(),S=this.x.redMul(g),R=this.x.redSub(y).redMul(this.x.redAdd(y));R=R.redAdd(R).redIAdd(R);var A=S.redIAdd(S),k=(A=A.redIAdd(A)).redAdd(A);e=R.redSqr().redISub(k),n=this.y.redAdd(this.z).redSqr().redISub(g).redISub(y);var I=g.redSqr();I=(I=(I=I.redIAdd(I)).redIAdd(I)).redIAdd(I),r=R.redMul(A.redISub(e)).redISub(I)}return this.curve.jpoint(e,r,n)},ya.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,h=this.z,a=h.redSqr().redSqr(),d=r.redSqr(),c=n.redSqr(),v=d.redAdd(d).redIAdd(d).redIAdd(e.redMul(a)),w=r.redAdd(r),m=(w=w.redIAdd(w)).redMul(c),y=v.redSqr().redISub(m.redAdd(m)),g=m.redISub(y),S=c.redSqr();S=(S=(S=S.redIAdd(S)).redIAdd(S)).redIAdd(S);var R=v.redMul(g).redISub(S),A=n.redAdd(n).redMul(h);return this.curve.jpoint(y,R,A)},ya.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),h=r.redSqr(),a=e.redAdd(e).redIAdd(e),d=a.redSqr(),c=this.x.redAdd(r).redSqr().redISub(e).redISub(h),v=(c=(c=(c=c.redIAdd(c)).redAdd(c).redIAdd(c)).redISub(d)).redSqr(),w=h.redIAdd(h);w=(w=(w=w.redIAdd(w)).redIAdd(w)).redIAdd(w);var m=a.redIAdd(c).redSqr().redISub(d).redISub(v).redISub(w),y=r.redMul(m);y=(y=y.redIAdd(y)).redIAdd(y);var g=this.x.redMul(v).redISub(y);g=(g=g.redIAdd(g)).redIAdd(g);var S=this.y.redMul(m.redMul(w.redISub(m)).redISub(c.redMul(v)));S=(S=(S=S.redIAdd(S)).redIAdd(S)).redIAdd(S);var R=this.z.redAdd(c).redSqr().redISub(n).redISub(v);return this.curve.jpoint(g,S,R)},ya.prototype.mul=function(e,r){return e=new Rn(e,r),this.curve._wnafMul(this,e)},ya.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var h=r.redMul(this.z),a=n.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(h)).cmpn(0)===0},ya.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var h=e.clone(),a=this.curve.redN.redMul(r);;){if(h.iadd(this.curve.n),h.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}},ya.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)+">"},ya.prototype.isInfinity=function(){return this.z.cmpn(0)===0};l4e=sJ,pd=qn,tK=jr,Uy=eb,c4e=Bo;tK(nd,Uy),fJ=nd,nd.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),h=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r);return h.redSqrt().redSqr().cmp(h)===0},tK(ha,Uy.BasePoint),nd.prototype.decodePoint=function(e,r){return this.point(c4e.toArray(e,r),1)},nd.prototype.point=function(e,r){return new ha(this,e,r)},nd.prototype.pointFromJSON=function(e){return ha.fromJSON(this,e)},ha.prototype.precompute=function(){},ha.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},ha.fromJSON=function(e,r){return new ha(e,r[0],r[1]||e.one)},ha.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)+">"},ha.prototype.isInfinity=function(){return this.z.cmpn(0)===0},ha.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),r=this.x.redSub(this.z).redSqr(),n=e.redSub(r),h=e.redMul(r),a=n.redMul(r.redAdd(this.curve.a24.redMul(n)));return this.curve.point(h,a)},ha.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},ha.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),h=this.x.redSub(this.z),a=e.x.redAdd(e.z),d=e.x.redSub(e.z).redMul(n),c=a.redMul(h),v=r.z.redMul(d.redAdd(c).redSqr()),w=r.x.redMul(d.redISub(c).redSqr());return this.curve.point(v,w)},ha.prototype.mul=function(e){for(var r=e.clone(),n=this,h=this.curve.point(null,null),a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var d=a.length-1;d>=0;d--)a[d]===0?(n=n.diffAdd(h,this),h=h.dbl()):(h=n.diffAdd(h,this),n=n.dbl());return h},ha.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},ha.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},ha.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},ha.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},ha.prototype.getX=function(){return this.normalize(),this.x.fromRed()};d4e=fJ,Zu=qn,rK=jr,qy=eb,p4e=Bo.assert;rK(Yf,qy),uJ=Yf,Yf.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},Yf.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},Yf.prototype.jpoint=function(e,r,n,h){return this.point(e,r,n,h)},Yf.prototype.pointFromX=function(e,r){(e=new Zu(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),h=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),d=h.redMul(a.redInvm()),c=d.redSqrt();if(c.redSqr().redSub(d).cmp(this.zero)!==0)throw new Error("invalid point");var v=c.fromRed().isOdd();return(r&&!v||!r&&v)&&(c=c.redNeg()),this.point(e,c)},Yf.prototype.pointFromY=function(e,r){(e=new Zu(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr(),h=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),d=h.redMul(a.redInvm());if(d.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var c=d.redSqrt();if(c.redSqr().redSub(d).cmp(this.zero)!==0)throw new Error("invalid point");return c.fromRed().isOdd()!==r&&(c=c.redNeg()),this.point(c,e)},Yf.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),h=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return h.cmp(a)===0},rK(un,qy.BasePoint),Yf.prototype.pointFromJSON=function(e){return un.fromJSON(this,e)},Yf.prototype.point=function(e,r,n,h){return new un(this,e,r,n,h)},un.fromJSON=function(e,r){return new un(e,r[0],r[1],r[2])},un.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)+">"},un.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},un.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var h=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),d=h.redAdd(r),c=d.redSub(n),v=h.redSub(r),w=a.redMul(c),m=d.redMul(v),y=a.redMul(v),g=c.redMul(d);return this.curve.point(w,m,g,y)},un.prototype._projDbl=function(){var e,r,n,h=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var c=(m=this.curve._mulA(a)).redAdd(d);if(this.zOne)e=h.redSub(a).redSub(d).redMul(c.redSub(this.curve.two)),r=c.redMul(m.redSub(d)),n=c.redSqr().redSub(c).redSub(c);else{var v=this.z.redSqr(),w=c.redSub(v).redISub(v);e=h.redSub(a).redISub(d).redMul(w),r=c.redMul(m.redSub(d)),n=c.redMul(w)}}else{var m=a.redAdd(d);v=this.curve._mulC(this.z).redSqr(),w=m.redSub(v).redSub(v),e=this.curve._mulC(h.redISub(m)).redMul(w),r=this.curve._mulC(m).redMul(a.redISub(d)),n=m.redMul(w)}return this.curve.point(e,r,n)},un.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},un.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),h=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),d=n.redSub(r),c=a.redSub(h),v=a.redAdd(h),w=n.redAdd(r),m=d.redMul(c),y=v.redMul(w),g=d.redMul(w),S=c.redMul(v);return this.curve.point(m,y,S,g)},un.prototype._projAdd=function(e){var r,n,h=this.z.redMul(e.z),a=h.redSqr(),d=this.x.redMul(e.x),c=this.y.redMul(e.y),v=this.curve.d.redMul(d).redMul(c),w=a.redSub(v),m=a.redAdd(v),y=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(d).redISub(c),g=h.redMul(w).redMul(y);return this.curve.twisted?(r=h.redMul(m).redMul(c.redSub(this.curve._mulA(d))),n=w.redMul(m)):(r=h.redMul(m).redMul(c.redSub(d)),n=this.curve._mulC(w).redMul(m)),this.curve.point(g,r,n)},un.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},un.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},un.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)},un.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)},un.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},un.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},un.prototype.getX=function(){return this.normalize(),this.x.fromRed()},un.prototype.getY=function(){return this.normalize(),this.y.fromRed()},un.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},un.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),h=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(h),this.x.cmp(r)===0)return!0}},un.prototype.toP=un.prototype.normalize,un.prototype.mixedAdd=un.prototype.add;v4e=uJ,hA={},V6=hA;V6.base=eb,V6.short=l4e,V6.mont=d4e,V6.edwards=v4e;m4e={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"]]}},tb={},NE=tb,Fh=Qy,H_=hA,iK=Bo.assert;NE.PresetCurve=hJ,zh("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:Fh.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),zh("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:Fh.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),zh("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:Fh.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),zh("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:Fh.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"]}),zh("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:Fh.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"]}),zh("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Fh.sha256,gRed:!1,g:["9"]}),zh("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:Fh.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{PE=m4e}catch(e){PE=void 0}zh("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:Fh.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",PE]});g4e=qn,nK=Bo.assert;lJ=Ba,Ba.fromPublic=function(e,r,n){return r instanceof Ba?r:new Ba(e,{pub:r,pubEnc:n})},Ba.fromPrivate=function(e,r,n){return r instanceof Ba?r:new Ba(e,{priv:r,privEnc:n})},Ba.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Ba.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},Ba.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},Ba.prototype._importPrivate=function(e,r){this.priv=new g4e(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},Ba.prototype._importPublic=function(e,r){if(e.x||e.y)return this.ec.curve.type==="mont"?nK(e.x,"Need x coordinate"):this.ec.curve.type!=="short"&&this.ec.curve.type!=="edwards"||nK(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y),void 0;this.pub=this.ec.curve.decodePoint(e,r)},Ba.prototype.derive=function(e){return e.mul(this.priv).getX()},Ba.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)},Ba.prototype.verify=function(e,r){return this.ec.verify(e,r,this)},Ba.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};y4e=lJ,sl=qn,aK=f4e,K_=tb,b4e=sA,dJ=Bo.assert,Z_=y4e,Y6=f8e;cJ=_s,_s.prototype.keyPair=function(e){return new Z_(this,e)},_s.prototype.keyFromPrivate=function(e,r){return Z_.fromPrivate(this,e,r)},_s.prototype.keyFromPublic=function(e,r){return Z_.fromPublic(this,e,r)},_s.prototype.genKeyPair=function(e){e||(e={});for(var r=new aK({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||b4e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),h=this.n.sub(new sl(2));;){var a=new sl(r.generate(n));if(!(a.cmp(h)>0))return a.iaddn(1),this.keyFromPrivate(a)}},_s.prototype._truncateToN=function(e,r){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},_s.prototype.sign=function(e,r,n,h){typeof n=="object"&&(h=n,n=null),h||(h={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new sl(e,16));for(var a=this.n.byteLength(),d=r.getPrivate().toArray("be",a),c=e.toArray("be",a),v=new aK({hash:this.hash,entropy:d,nonce:c,pers:h.pers,persEnc:h.persEnc||"utf8"}),w=this.n.sub(new sl(1)),m=0;;m++){var y=h.k?h.k(m):new sl(v.generate(this.n.byteLength()));if(!((y=this._truncateToN(y,!0)).cmpn(1)<=0||y.cmp(w)>=0)){var g=this.g.mul(y);if(!g.isInfinity()){var S=g.getX(),R=S.umod(this.n);if(R.cmpn(0)!==0){var A=y.invm(this.n).mul(R.mul(r.getPrivate()).iadd(e));if((A=A.umod(this.n)).cmpn(0)!==0){var k=(g.getY().isOdd()?1:0)|(S.cmp(R)!==0?2:0);return h.canonical&&A.cmp(this.nh)>0&&(A=this.n.sub(A),k^=1),new Y6({r:R,s:A,recoveryParam:k})}}}}}},_s.prototype.verify=function(e,r,n,h){e=this._truncateToN(new sl(e,16)),n=this.keyFromPublic(n,h);var a=(r=new Y6(r,"hex")).r,d=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||d.cmpn(1)<0||d.cmp(this.n)>=0)return!1;var c,v=d.invm(this.n),w=v.mul(e).umod(this.n),m=v.mul(a).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(w,n.getPublic(),m)).isInfinity()&&c.eqXToP(a):!(c=this.g.mulAdd(w,n.getPublic(),m)).isInfinity()&&c.getX().umod(this.n).cmp(a)===0},_s.prototype.recoverPubKey=function(e,r,n,h){dJ((3&n)===n,"The recovery param is more than two bits"),r=new Y6(r,h);var a=this.n,d=new sl(e),c=r.r,v=r.s,w=1&n,m=n>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");c=m?this.curve.pointFromX(c.add(this.curve.n),w):this.curve.pointFromX(c,w);var y=r.r.invm(a),g=a.sub(d).mul(y).umod(a),S=v.mul(y).umod(a);return this.g.mulAdd(g,c,S)},_s.prototype.getKeyRecoveryParam=function(e,r,n,h){if((r=new Y6(r,h)).recoveryParam!==null)return r.recoveryParam;for(var a=0;a<4;a++){var d;try{d=this.recoverPubKey(e,r,a)}catch{continue}if(d.eq(n))return a}throw new Error("Unable to find valid recovery factor")};w4e=cJ,n2=Bo,oK=n2.assert,sK=n2.parseBytes,ad=n2.cachedProperty;la.fromPublic=function(e,r){return r instanceof la?r:new la(e,{pub:r})},la.fromSecret=function(e,r){return r instanceof la?r:new la(e,{secret:r})},la.prototype.secret=function(){return this._secret},ad(la,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),ad(la,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),ad(la,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,h=r.slice(0,e.encodingLength);return h[0]&=248,h[n]&=127,h[n]|=64,h}),ad(la,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),ad(la,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),ad(la,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),la.prototype.sign=function(e){return oK(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},la.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)},la.prototype.getSecret=function(e){return oK(this._secret,"KeyPair is public only"),n2.encode(this.secret(),e)},la.prototype.getPublic=function(e){return n2.encode(this.pubBytes(),e)};_4e=la,M4e=qn,rb=Bo,S4e=rb.assert,J6=rb.cachedProperty,E4e=rb.parseBytes;J6(pl,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),J6(pl,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),J6(pl,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),J6(pl,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),pl.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},pl.prototype.toHex=function(){return rb.encode(this.toBytes(),"hex").toUpperCase()};A4e=pl,R4e=Qy,x4e=tb,vd=Bo,T4e=vd.assert,fK=vd.parseBytes,uK=_4e,hK=A4e;pJ=fo,fo.prototype.sign=function(e,r){e=fK(e);var n=this.keyFromSecret(r),h=this.hashInt(n.messagePrefix(),e),a=this.g.mul(h),d=this.encodePoint(a),c=this.hashInt(d,n.pubBytes(),e).mul(n.priv()),v=h.add(c).umod(this.curve.n);return this.makeSignature({R:a,S:v,Rencoded:d})},fo.prototype.verify=function(e,r,n){e=fK(e),r=this.makeSignature(r);var h=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),h.pubBytes(),e),d=this.g.mul(r.S());return r.R().add(h.pub().mul(a)).eq(d)},fo.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return vd.intFromLE(e.digest()).umod(this.curve.n)},fo.prototype.keyFromPublic=function(e){return uK.fromPublic(this,e)},fo.prototype.keyFromSecret=function(e){return uK.fromSecret(this,e)},fo.prototype.makeSignature=function(e){return e instanceof hK?e:new hK(this,e)},fo.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},fo.prototype.decodePoint=function(e){var r=(e=vd.parseBytes(e)).length-1,n=e.slice(0,r).concat(-129&e[r]),h=(128&e[r])!=0,a=vd.intFromLE(n);return this.curve.pointFromY(a,h)},fo.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},fo.prototype.decodeInt=function(e){return vd.intFromLE(e)},fo.prototype.isPoint=function(e){return e instanceof this.pointClass};k4e=pJ,ib={},fl=ib;fl.version=["elliptic","6.5.2","EC cryptography","lib/elliptic.js",["lib"],{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},{type:"git",url:"git@github.com:indutny/elliptic"},["EC","Elliptic","curve","Cryptography"],"Fedor Indutny <fedor@indutny.com>","MIT",{url:"https://github.com/indutny/elliptic/issues"},"https://github.com/indutny/elliptic",{brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}][1],fl.utils=Bo,fl.rand=sA,fl.curve=hA,fl.curves=tb,fl.ec=w4e,fl.eddsa=k4e;W_={},lK=!1,To=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Yn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,vJ={},I4e=jr;vJ.Reporter=ms,ms.prototype.isError=function(e){return e instanceof od},ms.prototype.save=function(){var e=(this||Yn)._reporterState;return{obj:e.obj,pathLen:e.path.length}},ms.prototype.restore=function(e){var r=(this||Yn)._reporterState;r.obj=e.obj,r.path=r.path.slice(0,e.pathLen)},ms.prototype.enterKey=function(e){return(this||Yn)._reporterState.path.push(e)},ms.prototype.exitKey=function(e){var r=(this||Yn)._reporterState;r.path=r.path.slice(0,e-1)},ms.prototype.leaveKey=function(e,r,n){var h=(this||Yn)._reporterState;this.exitKey(e),h.obj!==null&&(h.obj[r]=n)},ms.prototype.path=function(){return(this||Yn)._reporterState.path.join("/")},ms.prototype.enterObject=function(){var e=(this||Yn)._reporterState,r=e.obj;return e.obj={},r},ms.prototype.leaveObject=function(e){var r=(this||Yn)._reporterState,n=r.obj;return r.obj=e,n},ms.prototype.error=function(e){var r,n=(this||Yn)._reporterState,h=e instanceof od;if(r=h?e:new od(n.path.map(function(a){return"["+JSON.stringify(a)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw r;return h||n.errors.push(r),r},ms.prototype.wrapResult=function(e){var r=(this||Yn)._reporterState;return r.options.partial?{result:this.isError(e)?null:e,errors:r.errors}:e},I4e(od,Error),od.prototype.rethrow=function(e){if((this||Yn).message=e+" at: "+((this||Yn).path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this||Yn,od),!(this||Yn).stack)try{throw new Error((this||Yn).message)}catch(r){(this||Yn).stack=r.stack}return this||Yn};X6={},cK=!1,Cr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;G_={},pK=!1,kr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,V_={},vK=!1;Ph={},mK=!1,Y_={},gK=!1;J_={},yK=!1,Nh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;X_={},wK=!1,Q_=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,eM={},_K=!1;tM={},MK=!1,Wn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;rM={},EK=!1,iM=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,nM={},AK=!1;aM={},RK=!1;gJ=nb(),_f=gJ,xK=_f.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),P4e=_f.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),lA=_f.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),N4e=_f.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(lA),this.key("subjectPublicKey").bitstr())}),C4e=_f.define("RelativeDistinguishedName",function(){this.setof(P4e)}),L4e=_f.define("RDNSequence",function(){this.seqof(C4e)}),TK=_f.define("Name",function(){this.choice({rdnSequence:this.use(L4e)})}),D4e=_f.define("Validity",function(){this.seq().obj(this.key("notBefore").use(xK),this.key("notAfter").use(xK))}),$4e=_f.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),U4e=_f.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(lA),this.key("issuer").use(TK),this.key("validity").use(D4e),this.key("subject").use(TK),this.key("subjectPublicKeyInfo").use(N4e),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof($4e).optional())}),q4e=_f.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(U4e),this.key("signatureAlgorithm").use(lA),this.key("signatureValue").bitstr())}),bf={},Mf=gJ;bf.certificate=q4e;j4e=Mf.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});bf.RSAPrivateKey=j4e;F4e=Mf.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});bf.RSAPublicKey=F4e;z4e=Mf.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(yJ),this.key("subjectPublicKey").bitstr())});bf.PublicKey=z4e;yJ=Mf.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),H4e=Mf.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(yJ),this.key("subjectPrivateKey").octstr())});bf.PrivateKey=H4e;K4e=Mf.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});bf.EncryptedPrivateKey=K4e;Z4e=Mf.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});bf.DSAPrivateKey=Z4e,bf.DSAparam=Mf.define("DSAparam",function(){this.int()});W4e=Mf.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(G4e),this.key("publicKey").optional().explicit(1).bitstr())});bf.ECPrivateKey=W4e;G4e=Mf.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});bf.signature=Mf.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())});V4e=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m,Y4e=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,J4e=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m,X4e=Xy,Q4e=Io,Q6=vi.Buffer,oo=bf,e5e={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},t5e=function(e,r){var n,h=e.toString(),a=h.match(V4e);if(a){var d="aes"+a[1],c=Q6.from(a[2],"hex"),v=Q6.from(a[3].replace(/[\r\n]/g,""),"base64"),w=X4e(r,c.slice(0,8),parseInt(a[1],10)).key,m=[],y=Q4e.createDecipheriv(d,w,c);m.push(y.update(v)),m.push(y.final()),n=Q6.concat(m)}else{var g=h.match(J4e);n=new Q6(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(Y4e)[1],data:n}},r5e=Io,i5e=Cy,oM=vi.Buffer;bJ=kK,kK.signature=oo.signature;ab=bJ,wJ={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},CE={},Pa=Pr.Buffer,Al=JV,n5e=fA,a5e=ib.ec,jy=qn,o5e=ab,s5e=wJ;(CE=function(e,r,n,h,a){var d=o5e(r);if(d.curve){if(h!=="ecdsa"&&h!=="ecdsa/rsa")throw new Error("wrong private key type");return function(m,y){var g=s5e[y.curve.join(".")];if(!g)throw new Error("unknown curve "+y.curve.join("."));var S=new a5e(g).keyFromPrivate(y.privateKey).sign(m);return new Pa(S.toDER())}(e,d)}if(d.type==="dsa"){if(h!=="dsa")throw new Error("wrong private key type");return function(m,y,g){for(var S,R=y.params.priv_key,A=y.params.p,k=y.params.q,I=y.params.g,B=new jy(0),P=cA(m,k).mod(k),C=!1,q=IK(R,k,m,g);C===!1;)S=BK(k,q,g),B=f5e(I,S,A,k),(C=S.invm(k).imul(P.add(R.mul(B))).mod(k)).cmpn(0)===0&&(C=!1,B=new jy(0));return function(K,V){K=K.toArray(),V=V.toArray(),128&K[0]&&(K=[0].concat(K)),128&V[0]&&(V=[0].concat(V));var j=[48,K.length+V.length+4,2,K.length];return j=j.concat(K,[2,V.length],V),new Pa(j)}(B,C)}(e,d,n)}if(h!=="rsa"&&h!=="ecdsa/rsa")throw new Error("wrong private key type");e=Pa.concat([a,e]);for(var c=d.modulus.byteLength(),v=[0,1];e.length+v.length+1<c;)v.push(255);v.push(0);for(var w=-1;++w<e.length;)v.push(e[w]);return n5e(v,d)}).getKey=IK,CE.makeKey=BK;u5e=CE,sM=Pr.Buffer,Ip=qn,h5e=ib.ec,OK=ab,l5e=wJ;c5e=function(e,r,n,h,a){var d=OK(n);if(d.type==="ec"){if(h!=="ecdsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");return function(S,R,A){var k=l5e[A.data.algorithm.curve.join(".")];if(!k)throw new Error("unknown curve "+A.data.algorithm.curve.join("."));var I=new h5e(k),B=A.data.subjectPrivateKey.data;return I.verify(R,S,B)}(e,r,d)}if(d.type==="dsa"){if(h!=="dsa")throw new Error("wrong public key type");return function(S,R,A){var k=A.data.p,I=A.data.q,B=A.data.g,P=A.data.pub_key,C=OK.signature.decode(S,"der"),q=C.s,K=C.r;PK(q,I),PK(K,I);var V=Ip.mont(k),j=q.invm(I);return B.toRed(V).redPow(new Ip(R).mul(j).mod(I)).fromRed().mul(P.toRed(V).redPow(K.mul(j).mod(I)).fromRed()).mod(k).mod(I).cmp(K)===0}(e,r,d)}if(h!=="rsa"&&h!=="ecdsa/rsa")throw new Error("wrong public key type");r=sM.concat([a,r]);for(var c=d.modulus.byteLength(),v=[1],w=0;r.length+v.length+2<c;)v.push(255),w++;v.push(0);for(var m=-1;++m<r.length;)v.push(r[m]);v=new sM(v);var y=Ip.mont(d.modulus);e=(e=new Ip(e).toRed(y)).redPow(new Ip(d.publicExponent)),e=new sM(e.fromRed().toArray());var g=w<8?1:0;for(c=Math.min(e.length,v.length),e.length!==v.length&&(g=1),m=-1;++m<c;)g|=e[m]^v[m];return g===0},Tn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,ey=Pr.Buffer,_J=l2,Fy=Ss,NK=jr,d5e=u5e,p5e=c5e,yl=XV;Object.keys(yl).forEach(function(e){yl[e].id=new ey(yl[e].id,"hex"),yl[e.toLowerCase()]=yl[e]}),NK(Kp,Fy.Writable),Kp.prototype._write=function(e,r,n){(this||Tn)._hash.update(e),n()},Kp.prototype.update=function(e,r){return typeof e=="string"&&(e=new ey(e,r)),(this||Tn)._hash.update(e),this||Tn},Kp.prototype.sign=function(e,r){this.end();var n=(this||Tn)._hash.digest(),h=d5e(n,e,(this||Tn)._hashType,(this||Tn)._signType,(this||Tn)._tag);return r?h.toString(r):h},NK(Zp,Fy.Writable),Zp.prototype._write=function(e,r,n){(this||Tn)._hash.update(e),n()},Zp.prototype.update=function(e,r){return typeof e=="string"&&(e=new ey(e,r)),(this||Tn)._hash.update(e),this||Tn},Zp.prototype.verify=function(e,r,n){typeof r=="string"&&(r=new ey(r,n)),this.end();var h=(this||Tn)._hash.digest();return p5e(r,h,e,(this||Tn)._signType,(this||Tn)._tag)};v5e={Sign:CK,Verify:LK,createSign:CK,createVerify:LK},Jn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Ku=Pr.Buffer,m5e=ib,g5e=qn;MJ=function(e){return new vl(e)};ko={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};ko.p224=ko.secp224r1,ko.p256=ko.secp256r1=ko.prime256v1,ko.p192=ko.secp192r1=ko.prime192v1,ko.p384=ko.secp384r1,ko.p521=ko.secp521r1,vl.prototype.generateKeys=function(e,r){return(this||Jn).keys=(this||Jn).curve.genKeyPair(),this.getPublicKey(e,r)},vl.prototype.computeSecret=function(e,r,n){return r=r||"utf8",Ku.isBuffer(e)||(e=new Ku(e,r)),fM((this||Jn).curve.keyFromPublic(e).getPublic().mul((this||Jn).keys.getPrivate()).getX(),n,(this||Jn).curveType.byteLength)},vl.prototype.getPublicKey=function(e,r){var n=(this||Jn).keys.getPublic(r==="compressed",!0);return r==="hybrid"&&(n[n.length-1]%2?n[0]=7:n[0]=6),fM(n,e)},vl.prototype.getPrivateKey=function(e){return fM((this||Jn).keys.getPrivate(),e)},vl.prototype.setPublicKey=function(e,r){return r=r||"utf8",Ku.isBuffer(e)||(e=new Ku(e,r)),(this||Jn).keys._importPublic(e),this||Jn},vl.prototype.setPrivateKey=function(e,r){r=r||"utf8",Ku.isBuffer(e)||(e=new Ku(e,r));var n=new g5e(e);return n=n.toString(16),(this||Jn).keys=(this||Jn).curve.genKeyPair(),(this||Jn).keys._importPrivate(n),this||Jn};y5e=MJ,b5e=l2,LE=vi.Buffer;SJ=function(e,r){for(var n,h=LE.alloc(0),a=0;h.length<r;)n=w5e(a++),h=LE.concat([h,b5e("sha1").update(e).update(n).digest()]);return h.slice(0,r)},EJ=function(e,r){for(var n=e.length,h=-1;++h<n;)e[h]^=r[h];return e},DK=qn,_5e=vi.Buffer,AJ=function(e,r){return _5e.from(e.toRed(DK.mont(r.modulus)).redPow(new DK(r.publicExponent)).fromRed().toArray())},M5e=ab,uM=Rd,S5e=l2,$K=SJ,UK=EJ,hM=qn,E5e=AJ,A5e=fA,lf=vi.Buffer,R5e=function(e,r,n){var h;h=e.padding?e.padding:n?1:4;var a,d=M5e(e);if(h===4)a=function(c,v){var w=c.modulus.byteLength(),m=v.length,y=S5e("sha1").update(lf.alloc(0)).digest(),g=y.length,S=2*g;if(m>w-S-2)throw new Error("message too long");var R=lf.alloc(w-m-S-2),A=w-g-1,k=uM(g),I=UK(lf.concat([y,R,lf.alloc(1,1),v],A),$K(k,A)),B=UK(k,$K(I,g));return new hM(lf.concat([lf.alloc(1),B,I],w))}(d,r);else if(h===1)a=function(c,v,w){var m,y=v.length,g=c.modulus.byteLength();if(y>g-11)throw new Error("message too long");return m=w?lf.alloc(g-y-3,255):function(S){for(var R,A=lf.allocUnsafe(S),k=0,I=uM(2*S),B=0;k<S;)B===I.length&&(I=uM(2*S),B=0),(R=I[B++])&&(A[k++]=R);return A}(g-y-3),new hM(lf.concat([lf.from([0,w?1:2]),m,lf.alloc(1),v],g))}(d,r,n);else{if(h!==3)throw new Error("unknown padding");if((a=new hM(r)).cmp(d.modulus)>=0)throw new Error("data too long for modulus")}return n?A5e(a,d):E5e(a,d)},x5e=ab,qK=SJ,jK=EJ,FK=qn,T5e=fA,k5e=l2,I5e=AJ,Bp=vi.Buffer,B5e=function(e,r,n){var h;h=e.padding?e.padding:n?1:4;var a,d=x5e(e),c=d.modulus.byteLength();if(r.length>c||new FK(r).cmp(d.modulus)>=0)throw new Error("decryption error");a=n?I5e(new FK(r),d):T5e(r,d);var v=Bp.alloc(c-a.length);if(a=Bp.concat([v,a],c),h===4)return function(w,m){var y=w.modulus.byteLength(),g=k5e("sha1").update(Bp.alloc(0)).digest(),S=g.length;if(m[0]!==0)throw new Error("decryption error");var R=m.slice(1,S+1),A=m.slice(S+1),k=jK(R,qK(A,S)),I=jK(A,qK(k,y-S-1));if(function(P,C){P=Bp.from(P),C=Bp.from(C);var q=0,K=P.length;P.length!==C.length&&(q++,K=Math.min(P.length,C.length));for(var V=-1;++V<K;)q+=P[V]^C[V];return q}(g,I.slice(0,S)))throw new Error("decryption error");for(var B=S;I[B]===0;)B++;if(I[B++]!==1)throw new Error("decryption error");return I.slice(B)}(d,a);if(h===1)return function(w,m,y){for(var g=m.slice(0,2),S=2,R=0;m[S++]!==0;)if(S>=m.length){R++;break}var A=m.slice(2,S-1);if((g.toString("hex")!=="0002"&&!y||g.toString("hex")!=="0001"&&y)&&R++,A.length<8&&R++,R)throw new Error("decryption error");return m.slice(S)}(0,a,n);if(h===3)return a;throw new Error("unknown padding")},ml={};ml.publicEncrypt=R5e,ml.privateDecrypt=B5e,ml.privateEncrypt=function(e,r){return ml.publicEncrypt(e,r,!0)},ml.publicDecrypt=function(e,r){return ml.privateDecrypt(e,r,!0)};zy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Wp={},DE=Br;RJ=vi,HK=Rd,KK=RJ.Buffer,xJ=RJ.kMaxLength,$E=zy.crypto||zy.msCrypto,TJ=Math.pow(2,32)-1;$E&&$E.getRandomValues||!DE.browser?(Wp.randomFill=function(e,r,n,h){if(!(KK.isBuffer(e)||e instanceof zy.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof r=="function")h=r,r=0,n=e.length;else if(typeof n=="function")h=n,n=e.length-r;else if(typeof h!="function")throw new TypeError('"cb" argument must be a function');return ZK(r,e.length),WK(n,r,e.length),GK(e,r,n,h)},Wp.randomFillSync=function(e,r,n){if(r===void 0&&(r=0),!(KK.isBuffer(e)||e instanceof zy.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return ZK(r,e.length),n===void 0&&(n=e.length-r),WK(n,r,e.length),GK(e,r,n)}):(Wp.randomFill=zK,Wp.randomFillSync=zK);ni={};ni.randomBytes=ni.rng=ni.pseudoRandomBytes=ni.prng=Rd,ni.createHash=ni.Hash=l2,ni.createHmac=ni.Hmac=JV;O5e=XV,P5e=Object.keys(O5e),N5e=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(P5e);ni.getHashes=function(){return N5e};VK=Cy;ni.pbkdf2=VK.pbkdf2,ni.pbkdf2Sync=VK.pbkdf2Sync;Jf=df;ni.Cipher=Jf.Cipher,ni.createCipher=Jf.createCipher,ni.Cipheriv=Jf.Cipheriv,ni.createCipheriv=Jf.createCipheriv,ni.Decipher=Jf.Decipher,ni.createDecipher=Jf.createDecipher,ni.Decipheriv=Jf.Decipheriv,ni.createDecipheriv=Jf.createDecipheriv,ni.getCiphers=Jf.getCiphers,ni.listCiphers=Jf.listCiphers;Op=ld;ni.DiffieHellmanGroup=Op.DiffieHellmanGroup,ni.createDiffieHellmanGroup=Op.createDiffieHellmanGroup,ni.getDiffieHellman=Op.getDiffieHellman,ni.createDiffieHellman=Op.createDiffieHellman,ni.DiffieHellman=Op.DiffieHellman;ty=v5e;ni.createSign=ty.createSign,ni.Sign=ty.Sign,ni.createVerify=ty.createVerify,ni.Verify=ty.Verify,ni.createECDH=y5e;ry=ml;ni.publicEncrypt=ry.publicEncrypt,ni.privateEncrypt=ry.privateEncrypt,ni.publicDecrypt=ry.publicDecrypt,ni.privateDecrypt=ry.privateDecrypt;YK=Wp;ni.randomFill=YK.randomFill,ni.randomFillSync=YK.randomFillSync,ni.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join(`
137
137
  `))},ni.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6};iy={},JK=!1,ny=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;lM={},XK=!1,QK=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;cM={},eZ=!1;C5e={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},dM={},tZ=!1,yi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ul={},rZ=!1;BJ={},iZ=!1,pM={exports:BJ},$e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;vM={},nZ=!1;$5e={_args:[["elliptic@6.5.4","C:\\Users\\guybe\\Projects\\rollup-plugin-jspm"]],_from:"elliptic@6.5.4",_id:"elliptic@6.5.4",_inBundle:!1,_integrity:"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",_location:"/@jspm/core/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.5.4",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.4",saveSpec:null,fetchSpec:"6.5.4"},_requiredBy:["/@jspm/core/browserify-sign","/@jspm/core/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",_spec:"6.5.4",_where:"C:\\Users\\guybe\\Projects\\rollup-plugin-jspm",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"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"},description:"EC cryptography",devDependencies:{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"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.4"},OJ={},aZ=!1,mM={exports:OJ},Ze=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gM={},oZ=!1;yM={},sZ=!1;bM={},fZ=!1;wM={},uZ=!1;_M={},hZ=!1;MM={},lZ=!1;SM={},cZ=!1;Ji={},dZ=!1;EM={},pZ=!1;vZ={},mZ=!1;AM={},gZ=!1;RM={},yZ=!1;xM={},bZ=!1;TM={},wZ=!1;kM={},_Z=!1;IM={},MZ=!1;BM={},SZ=!1;OM={},EZ=!1;PM={},AZ=!1;NM={},RZ=!1;CM={},xZ=!1;LM={},TZ=!1;DM={},kZ=!1;LJ={},IZ=!1,$M={exports:LJ},We=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;UM={},BZ=!1;qM={},OZ=!1;ay={},PZ=!1;jM={},NZ=!1;Ch={},CZ=!1;FM={},LZ=!1;zM={},DZ=!1;HM={},$Z=!1;KM={},UZ=!1;ZM={},qZ=!1;WM={},jZ=!1;GM={},FZ=!1;VM={},zZ=!1;YM={},HZ=!1;JM={},KZ=!1;XM={},ZZ=!1;gs={},WZ=!1;owe={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},QM={},GZ=!1;eS={},VZ=!1;zJ={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},Pp={},YZ=!1;tS={},JZ=!1;rS={},XZ=!1,En=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;HJ={},QZ=!1,iS={exports:HJ},Ge=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;nS={},eW=!1,Gn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;aS={},tW=!1;oS={},rW=!1;WJ={},iW=!1,sS={exports:WJ},Ve=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;fS={},nW=!1;uS={},aW=!1;hS={},oW=!1;Lh={},sW=!1;sd={},fW=!1,oy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ti={},uW=!1;ai=gwe();ai.Cipher;ai.Cipheriv;ai.Decipher;ai.Decipheriv;ai.DiffieHellman;ai.DiffieHellmanGroup;ai.Hash;ai.Hmac;ai.Sign;ai.Verify;ai.constants;ai.createCipher;ai.createCipheriv;ai.createCredentials;ai.createDecipher;ai.createDecipheriv;ai.createDiffieHellman;ai.createDiffieHellmanGroup;ai.createECDH;ai.createHash;ai.createHmac;ai.createSign;ai.createVerify;ai.getCiphers;ai.getDiffieHellman;ai.getHashes;ai.listCiphers;ai.pbkdf2;ai.pbkdf2Sync;ai.privateDecrypt;ai.privateEncrypt;ai.prng;ai.pseudoRandomBytes;ai.publicDecrypt;ai.publicEncrypt;ai.randomBytes;ai.randomFill;ai.randomFillSync;ai.rng;sy={},hW=!1,fy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;lS={},lW=!1,cW=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;cS={},dW=!1;ywe={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}},dS={},pW=!1,bi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;hl={},vW=!1;Np={},mW=!1;JJ={},gW=!1,pS={exports:JJ},Ue=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;vS={},yW=!1;_we={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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"}},XJ={},bW=!1,mS={exports:XJ},Ye=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gS={},wW=!1;yS={},_W=!1;bS={},MW=!1;wS={},SW=!1;_S={},EW=!1;MS={},AW=!1;SS={},RW=!1;Xi={},xW=!1;ES={},TW=!1;kW={},IW=!1;AS={},BW=!1;RS={},OW=!1;xS={},PW=!1;TS={},NW=!1;kS={},CW=!1;IS={},LW=!1;BS={},DW=!1;OS={},$W=!1;PS={},UW=!1;NS={},qW=!1;CS={},jW=!1;LS={},FW=!1;DS={},zW=!1;rX={},HW=!1,$S={exports:rX},Je=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;US={},KW=!1;qS={},ZW=!1;uy={},WW=!1;jS={},GW=!1;Dh={},VW=!1;FS={},YW=!1;zS={},JW=!1;HS={},XW=!1;KS={},QW=!1;ZS={},eG=!1;WS={},tG=!1;GS={},rG=!1;VS={},iG=!1;YS={},nG=!1;JS={},aG=!1;XS={},oG=!1;ys={},sG=!1;zwe={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"},QS={},fG=!1;eE={},uG=!1;uX={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"},Cp={},hG=!1;tE={},lG=!1;rE={},cG=!1,An=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;hX={},dG=!1,iE={exports:hX},Xe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;nE={},pG=!1,Vn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;aE={},vG=!1;oE={},mG=!1;dX={},gG=!1,sE={exports:dX},Qe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;fE={},yG=!1;uE={},bG=!1;hE={},wG=!1;$h={},_G=!1;fd={},MG=!1,hy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;ri={},SG=!1;wr=e7e();wr.randomBytes;wr.rng;wr.pseudoRandomBytes;wr.prng;wr.createHash;wr.Hash;wr.createHmac;wr.Hmac;wr.getHashes;wr.pbkdf2;wr.pbkdf2Sync;wr.Cipher;wr.createCipher;wr.Cipheriv;wr.createCipheriv;wr.Decipher;wr.createDecipher;wr.Decipheriv;wr.createDecipheriv;wr.getCiphers;wr.listCiphers;wr.DiffieHellmanGroup;wr.createDiffieHellmanGroup;wr.getDiffieHellman;wr.createDiffieHellman;wr.DiffieHellman;wr.createSign;wr.Sign;wr.createVerify;wr.Verify;wr.createECDH;wr.publicEncrypt;wr.privateEncrypt;wr.publicDecrypt;wr.privateDecrypt;wr.randomFill;wr.randomFillSync;wr.createCredentials;wr.constants;wr.webcrypto=globalThis.crypto;t7e=wr.Cipher,r7e=wr.Cipheriv,i7e=wr.Decipher,n7e=wr.Decipheriv,a7e=wr.DiffieHellman,o7e=wr.DiffieHellmanGroup,s7e=wr.Hash,f7e=wr.Hmac,u7e=wr.Sign,h7e=wr.Verify,l7e=wr.constants,c7e=wr.createCipher,d7e=wr.createCipheriv,p7e=wr.createCredentials,v7e=wr.createDecipher,m7e=wr.createDecipheriv,g7e=wr.createDiffieHellman,y7e=wr.createDiffieHellmanGroup,b7e=wr.createECDH,w7e=wr.createHash,_7e=wr.createHmac,M7e=wr.createSign,S7e=wr.createVerify,E7e=wr.getCiphers,A7e=wr.getDiffieHellman,R7e=wr.getHashes,x7e=wr.listCiphers,T7e=wr.pbkdf2,k7e=wr.pbkdf2Sync,I7e=wr.privateDecrypt,B7e=wr.privateEncrypt,O7e=wr.prng,P7e=wr.pseudoRandomBytes,N7e=wr.publicDecrypt,C7e=wr.publicEncrypt,L7e=wr.randomBytes,D7e=wr.randomFill,$7e=wr.randomFillSync,U7e=wr.rng,q7e=wr.webcrypto});var yX=Ht(Yu=>{"use strict";Be();Pe();Oe();var j7e=Yu&&Yu.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),F7e=Yu&&Yu.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),z7e=Yu&&Yu.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&j7e(r,e,n);return F7e(r,e),r};Object.defineProperty(Yu,"__esModule",{value:!0});var gX=cj(),xs=z7e((mX(),Ri(vX))),LA=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";encryptionAlgorithm="aes-256-cbc";generateJWK(){if(typeof xs.generateKeyPair!="function")throw new Error("Keypair generation not supported in this version of Node, only supported in versions 10+");return new Promise((r,n)=>{xs.generateKeyPair("rsa",{modulusLength:this.keyLength,publicExponent:this.publicExponent,privateKeyEncoding:{type:"pkcs1",format:"pem"},publicKeyEncoding:{type:"pkcs1",format:"pem"}},(h,a,d)=>{h&&n(h),r(this.pemToJWK(d))})})}sign(r,n,{saltLength:h}={}){return new Promise((a,d)=>{a(xs.createSign(this.hashAlgorithm).update(n).sign({key:this.jwkToPem(r),padding:xs.constants.RSA_PKCS1_PSS_PADDING,saltLength:h}))})}verify(r,n,h){return new Promise((a,d)=>{let c={kty:"RSA",e:"AQAB",n:r},v=this.jwkToPem(c);a(xs.createVerify(this.hashAlgorithm).update(n).verify({key:v,padding:xs.constants.RSA_PKCS1_PSS_PADDING},h))})}hash(r,n="SHA-256"){if(typeof r=="string")throw new TypeError("Data must be a Uint8Array");return new Promise((h,a)=>{h(xs.createHash(this.parseHashAlgorithm(n)).update(r).digest())})}async encrypt(r,n,h){let a=xs.pbkdf2Sync(n,h=h||"salt",1e5,32,this.hashAlgorithm),d=xs.randomBytes(16),c=xs.createCipheriv(this.encryptionAlgorithm,a,d);return St.concat([d,c.update(r),c.final()])}async decrypt(r,n,h){try{let a=xs.pbkdf2Sync(n,h=h||"salt",1e5,32,this.hashAlgorithm),d=r.slice(0,16),c=r.slice(16),v=xs.createDecipheriv(this.encryptionAlgorithm,a,d);return St.concat([v.update(c),v.final()])}catch{throw new Error("Failed to decrypt")}}jwkToPem(r){return(0,gX.jwkTopem)(r)}pemToJWK(r){return(0,gX.pemTojwk)(r)}parseHashAlgorithm(r){switch(r){case"SHA-256":return"sha256";case"SHA-384":return"sha384";default:throw new Error(`Algorithm not supported: ${r}`)}}};Yu.default=LA});var bX=Ht($A=>{"use strict";Be();Pe();Oe();Object.defineProperty($A,"__esModule",{value:!0});var DA=class{api;constructor(r){this.api=r}getInfo(){return this.api.get("info").then(r=>r.data)}getPeers(){return this.api.get("peers").then(r=>r.data)}};$A.default=DA});var v2=Ht(p2=>{"use strict";Be();Pe();Oe();Object.defineProperty(p2,"__esModule",{value:!0});p2.getError=void 0;var UA=class extends Error{type;response;constructor(r,n={}){n.message?super(n.message):super(),this.type=r,this.response=n.response}getType(){return this.type}};p2.default=UA;function H7e(e){let r=e.data;if(typeof e.data=="string")try{r=JSON.parse(e.data)}catch{}if(e.data instanceof ArrayBuffer||e.data instanceof Uint8Array)try{r=JSON.parse(r.toString())}catch{}return r?r.error||r:e.statusText||"unknown"}p2.getError=H7e});var MX=Ht(cb=>{"use strict";Be();Pe();Oe();cb.byteLength=Z7e;cb.toByteArray=G7e;cb.fromByteArray=J7e;var uu=[],Ts=[],K7e=typeof Uint8Array<"u"?Uint8Array:Array,qA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Il=0,wX=qA.length;Il<wX;++Il)uu[Il]=qA[Il],Ts[qA.charCodeAt(Il)]=Il;var Il,wX;Ts[45]=62;Ts[95]=63;function _X(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=r);var h=n===r?0:4-n%4;return[n,h]}function Z7e(e){var r=_X(e),n=r[0],h=r[1];return(n+h)*3/4-h}function W7e(e,r,n){return(r+n)*3/4-n}function G7e(e){var r,n=_X(e),h=n[0],a=n[1],d=new K7e(W7e(e,h,a)),c=0,v=a>0?h-4:h,w;for(w=0;w<v;w+=4)r=Ts[e.charCodeAt(w)]<<18|Ts[e.charCodeAt(w+1)]<<12|Ts[e.charCodeAt(w+2)]<<6|Ts[e.charCodeAt(w+3)],d[c++]=r>>16&255,d[c++]=r>>8&255,d[c++]=r&255;return a===2&&(r=Ts[e.charCodeAt(w)]<<2|Ts[e.charCodeAt(w+1)]>>4,d[c++]=r&255),a===1&&(r=Ts[e.charCodeAt(w)]<<10|Ts[e.charCodeAt(w+1)]<<4|Ts[e.charCodeAt(w+2)]>>2,d[c++]=r>>8&255,d[c++]=r&255),d}function V7e(e){return uu[e>>18&63]+uu[e>>12&63]+uu[e>>6&63]+uu[e&63]}function Y7e(e,r,n){for(var h,a=[],d=r;d<n;d+=3)h=(e[d]<<16&16711680)+(e[d+1]<<8&65280)+(e[d+2]&255),a.push(V7e(h));return a.join("")}function J7e(e){for(var r,n=e.length,h=n%3,a=[],d=16383,c=0,v=n-h;c<v;c+=d)a.push(Y7e(e,c,c+d>v?v:c+d));return h===1?(r=e[n-1],a.push(uu[r>>2]+uu[r<<4&63]+"==")):h===2&&(r=(e[n-2]<<8)+e[n-1],a.push(uu[r>>10]+uu[r>>4&63]+uu[r<<2&63]+"=")),a.join("")}});var Ju=Ht(Qi=>{"use strict";Be();Pe();Oe();var X7e=Qi&&Qi.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),Q7e=Qi&&Qi.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),e9e=Qi&&Qi.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&X7e(r,e,n);return Q7e(r,e),r};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.b64UrlDecode=Qi.b64UrlEncode=Qi.bufferTob64Url=Qi.bufferTob64=Qi.b64UrlToBuffer=Qi.stringToB64Url=Qi.stringToBuffer=Qi.bufferToString=Qi.b64UrlToString=Qi.concatBuffers=void 0;var SX=e9e(MX());function t9e(e){let r=0;for(let a=0;a<e.length;a++)r+=e[a].byteLength;let n=new Uint8Array(r),h=0;n.set(new Uint8Array(e[0]),h),h+=e[0].byteLength;for(let a=1;a<e.length;a++)n.set(new Uint8Array(e[a]),h),h+=e[a].byteLength;return n}Qi.concatBuffers=t9e;function r9e(e){let r=RX(e);return EX(r)}Qi.b64UrlToString=r9e;function EX(e){return new TextDecoder("utf-8",{fatal:!0}).decode(e)}Qi.bufferToString=EX;function AX(e){return new TextEncoder().encode(e)}Qi.stringToBuffer=AX;function i9e(e){return TX(AX(e))}Qi.stringToB64Url=i9e;function RX(e){return new Uint8Array(SX.toByteArray(IX(e)))}Qi.b64UrlToBuffer=RX;function xX(e){return SX.fromByteArray(new Uint8Array(e))}Qi.bufferTob64=xX;function TX(e){return kX(xX(e))}Qi.bufferTob64Url=TX;function kX(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}Qi.b64UrlEncode=kX;function IX(e){e=e.replace(/\-/g,"+").replace(/\_/g,"/");let r;return e.length%4==0?r=0:r=4-e.length%4,e.concat("=".repeat(r))}Qi.b64UrlDecode=IX});var PX=Ht(m2=>{"use strict";Be();Pe();Oe();var n9e=m2&&m2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m2,"__esModule",{value:!0});var Oo=n9e(db());async function BX(e){if(Array.isArray(e)){let h=Oo.default.utils.concatBuffers([Oo.default.utils.stringToBuffer("list"),Oo.default.utils.stringToBuffer(e.length.toString())]);return await OX(e,await Oo.default.crypto.hash(h,"SHA-384"))}let r=Oo.default.utils.concatBuffers([Oo.default.utils.stringToBuffer("blob"),Oo.default.utils.stringToBuffer(e.byteLength.toString())]),n=Oo.default.utils.concatBuffers([await Oo.default.crypto.hash(r,"SHA-384"),await Oo.default.crypto.hash(e,"SHA-384")]);return await Oo.default.crypto.hash(n,"SHA-384")}m2.default=BX;async function OX(e,r){if(e.length<1)return r;let n=Oo.default.utils.concatBuffers([r,await BX(e[0])]),h=await Oo.default.crypto.hash(n,"SHA-384");return await OX(e.slice(1),h)}});var ZA=Ht(oi=>{"use strict";Be();Pe();Oe();var a9e=oi&&oi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(oi,"__esModule",{value:!0});oi.debug=oi.validatePath=oi.arrayCompare=oi.bufferToInt=oi.intToBuffer=oi.arrayFlatten=oi.generateProofs=oi.buildLayers=oi.generateTransactionChunks=oi.generateTree=oi.computeRootHash=oi.generateLeaves=oi.chunkData=oi.MIN_CHUNK_SIZE=oi.MAX_CHUNK_SIZE=void 0;var pb=a9e(db()),NX=Ju();oi.MAX_CHUNK_SIZE=256*1024;oi.MIN_CHUNK_SIZE=32*1024;var y2=32,Id=32;async function FA(e){let r=[],n=e,h=0;for(;n.byteLength>=oi.MAX_CHUNK_SIZE;){let a=oi.MAX_CHUNK_SIZE,d=n.byteLength-oi.MAX_CHUNK_SIZE;d>0&&d<oi.MIN_CHUNK_SIZE&&(a=Math.ceil(n.byteLength/2));let c=n.slice(0,a),v=await pb.default.crypto.hash(c);h+=c.byteLength,r.push({dataHash:v,minByteRange:h-c.byteLength,maxByteRange:h}),n=n.slice(a)}return r.push({dataHash:await pb.default.crypto.hash(n),minByteRange:h,maxByteRange:h+n.byteLength}),r}oi.chunkData=FA;async function zA(e){return Promise.all(e.map(async({dataHash:r,minByteRange:n,maxByteRange:h})=>({type:"leaf",id:await da(await Promise.all([da(r),da(b2(h))])),dataHash:r,minByteRange:n,maxByteRange:h})))}oi.generateLeaves=zA;async function o9e(e){return(await CX(e)).id}oi.computeRootHash=o9e;async function CX(e){return await vb(await zA(await FA(e)))}oi.generateTree=CX;async function s9e(e){let r=await FA(e),n=await zA(r),h=await vb(n),a=await LX(h),d=r.slice(-1)[0];return d.maxByteRange-d.minByteRange===0&&(r.splice(r.length-1,1),a.splice(a.length-1,1)),{data_root:h.id,chunks:r,proofs:a}}oi.generateTransactionChunks=s9e;async function vb(e,r=0){if(e.length<2)return e[0];let n=[];for(let h=0;h<e.length;h+=2)n.push(await f9e(e[h],e[h+1]));return vb(n,r+1)}oi.buildLayers=vb;function LX(e){let r=jA(e);return Array.isArray(r)?HA(r):[r]}oi.generateProofs=LX;function jA(e,r=new Uint8Array,n=0){if(e.type=="leaf")return{offset:e.maxByteRange-1,proof:(0,NX.concatBuffers)([r,e.dataHash,b2(e.maxByteRange)])};if(e.type=="branch"){let h=(0,NX.concatBuffers)([r,e.leftChild.id,e.rightChild.id,b2(e.byteRange)]);return[jA(e.leftChild,h,n+1),jA(e.rightChild,h,n+1)]}throw new Error("Unexpected node type")}function HA(e){let r=[];return e.forEach(n=>{Array.isArray(n)?r.push(...HA(n)):r.push(n)}),r}oi.arrayFlatten=HA;async function f9e(e,r){return r?{type:"branch",id:await da([await da(e.id),await da(r.id),await da(b2(e.maxByteRange))]),byteRange:e.maxByteRange,maxByteRange:r.maxByteRange,leftChild:e,rightChild:r}:e}async function da(e){return Array.isArray(e)&&(e=pb.default.utils.concatBuffers(e)),new Uint8Array(await pb.default.crypto.hash(e))}function b2(e){let r=new Uint8Array(y2);for(var n=r.length-1;n>=0;n--){var h=e%256;r[n]=h,e=(e-h)/256}return r}oi.intToBuffer=b2;function KA(e){let r=0;for(var n=0;n<e.length;n++)r*=256,r+=e[n];return r}oi.bufferToInt=KA;var u9e=(e,r)=>e.every((n,h)=>r[h]===n);oi.arrayCompare=u9e;async function g2(e,r,n,h,a){if(h<=0)return!1;if(r>=h)return g2(e,0,h-1,h,a);if(r<0)return g2(e,0,0,h,a);if(a.length==Id+y2){let g=a.slice(0,Id),S=a.slice(g.length,g.length+y2),R=await da([await da(g),await da(S)]);return(0,oi.arrayCompare)(e,R)?{offset:h-1,leftBound:n,rightBound:h,chunkSize:h-n}:!1}let d=a.slice(0,Id),c=a.slice(d.length,d.length+Id),v=a.slice(d.length+c.length,d.length+c.length+y2),w=KA(v),m=a.slice(d.length+c.length+v.length),y=await da([await da(d),await da(c),await da(v)]);return(0,oi.arrayCompare)(e,y)?r<w?await g2(d,r,n,Math.min(h,w),m):await g2(c,r,Math.max(n,w),h,m):!1}oi.validatePath=g2;async function DX(e,r=""){if(e.byteLength<1)return r;let n=e.slice(0,Id),h=e.slice(n.length,n.length+Id),a=e.slice(n.length+h.length,n.length+h.length+y2),d=KA(a),c=e.slice(n.length+h.length+a.length),v=await da([await da(n),await da(h),await da(a)]),w=`${r}
138
- ${JSON.stringify(St.from(n))},${JSON.stringify(St.from(h))},${d} => ${JSON.stringify(v)}`;return DX(c,w)}oi.debug=DX});var gb=Ht(Po=>{"use strict";Be();Pe();Oe();var h9e=Po&&Po.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),l9e=Po&&Po.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),c9e=Po&&Po.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&h9e(r,e,n);return l9e(r,e),r},d9e=Po&&Po.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Po,"__esModule",{value:!0});Po.Tag=void 0;var Xn=c9e(Ju()),p9e=d9e(PX()),v9e=ZA(),mb=class{get(r,n){if(!Object.getOwnPropertyNames(this).includes(r))throw new Error(`Field "${r}" is not a property of the Arweave Transaction class.`);if(this[r]instanceof Uint8Array)return n&&n.decode&&n.string?Xn.bufferToString(this[r]):n&&n.decode&&!n.string?this[r]:Xn.bufferTob64Url(this[r]);if(this[r]instanceof Array){if(n?.decode!==void 0||n?.string!==void 0)throw r==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[r]}return n&&n.decode==!0?n&&n.string?Xn.b64UrlToString(this[r]):Xn.b64UrlToBuffer(this[r]):this[r]}},w2=class extends mb{name;value;constructor(r,n,h=!1){super(),this.name=r,this.value=n}};Po.Tag=w2;var WA=class extends mb{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(r={}){super(),Object.assign(this,r),typeof this.data=="string"&&(this.data=Xn.b64UrlToBuffer(this.data)),r.tags&&(this.tags=r.tags.map(n=>new w2(n.name,n.value)))}addTag(r,n){this.tags.push(new w2(Xn.stringToB64Url(r),Xn.stringToB64Url(n)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:Xn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(r){this.owner=r}setSignature({id:r,owner:n,reward:h,tags:a,signature:d}){this.id=r,this.owner=n,h&&(this.reward=h),a&&(this.tags=a),this.signature=d}async prepareChunks(r){!this.chunks&&r.byteLength>0&&(this.chunks=await(0,v9e.generateTransactionChunks)(r),this.data_root=Xn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&r.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(r,n){if(!this.chunks)throw new Error("Chunks have not been prepared");let h=this.chunks.proofs[r],a=this.chunks.chunks[r];return{data_root:this.data_root,data_size:this.data_size,data_path:Xn.bufferTob64Url(h.proof),offset:h.offset.toString(),chunk:Xn.bufferTob64Url(n.slice(a.minByteRange,a.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let r=this.tags.reduce((h,a)=>Xn.concatBuffers([h,a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]),new Uint8Array);return Xn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),Xn.stringToBuffer(this.quantity),Xn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r]);case 2:this.data_root||await this.prepareChunks(this.data);let n=this.tags.map(h=>[h.get("name",{decode:!0,string:!1}),h.get("value",{decode:!0,string:!1})]);return await(0,p9e.default)([Xn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),Xn.stringToBuffer(this.quantity),Xn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),n,Xn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};Po.default=WA});var jX=Ht(ks=>{"use strict";Be();Pe();Oe();var m9e=ks&&ks.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),g9e=ks&&ks.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),y9e=ks&&ks.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&m9e(r,e,n);return g9e(r,e),r},b9e=ks&&ks.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.TransactionUploader=void 0;var $X=b9e(gb()),w9e=y9e(Ju()),GA=v2(),_9e=ZA(),UX=1,M9e=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],qX=1e3*40,VA=class e{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(r,n){if(this.api=r,!n.id)throw new Error("Transaction is not signed");if(!n.chunks)throw new Error("Transaction chunks not prepared");this.data=n.data,this.transaction=new $X.default(Object.assign({},n,{data:new Uint8Array(0)}))}async uploadChunk(r){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let n=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+qX-Date.now(),qX);if(n>0&&(n=n-n*Math.random()*.3,await new Promise(c=>setTimeout(c,n))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}r&&(this.chunkIndex=r);let h=this.transaction.getChunk(r||this.chunkIndex,this.data);if(!await(0,_9e.validatePath)(this.transaction.chunks.data_root,parseInt(h.offset),0,parseInt(h.data_size),w9e.b64UrlToBuffer(h.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let d=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(c=>(console.error(c.message),{status:-1,data:{error:c.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=d.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,GA.getError)(d),M9e.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(r,n,h){if(!n||typeof n.chunkIndex!="number"||typeof n.transaction!="object")throw new Error("Serialized object does not match expected format.");var a=new $X.default(n.transaction);a.chunks||await a.prepareChunks(h);let d=new e(r,a);if(d.chunkIndex=n.chunkIndex,d.lastRequestTimeEnd=n.lastRequestTimeEnd,d.lastResponseError=n.lastResponseError,d.lastResponseStatus=n.lastResponseStatus,d.txPosted=n.txPosted,d.data=h,d.transaction.data_root!==n.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return d}static async fromTransactionId(r,n){let h=await r.get(`tx/${n}`);if(h.status!==200)throw new Error(`Tx ${n} not found: ${h.status}`);let a=h.data;return a.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:a}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=UX){this.transaction.data=this.data;let h=await this.api.post("tx",this.transaction).catch(a=>(console.error(a),{status:-1,data:{error:a.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.transaction.data=new Uint8Array(0),h.status>=200&&h.status<300){this.txPosted=!0,this.chunkIndex=UX;return}throw this.lastResponseError=(0,GA.getError)(h),new Error(`Unable to upload transaction: ${h.status}, ${this.lastResponseError}`)}let n=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=n.status,!(n.status>=200&&n.status<300))throw this.lastResponseError=(0,GA.getError)(n),new Error(`Unable to upload transaction: ${n.status}, ${this.lastResponseError}`);this.txPosted=!0}};ks.TransactionUploader=VA});var yb=Ht((aKe,FX)=>{"use strict";Be();Pe();Oe();FX.exports={}});var HX=Ht(Sf=>{"use strict";Be();Pe();Oe();var S9e=Sf&&Sf.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),E9e=Sf&&Sf.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),A9e=Sf&&Sf.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&S9e(r,e,n);return E9e(r,e),r},zX=Sf&&Sf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sf,"__esModule",{value:!0});var YA=zX(v2()),Xu=zX(gb()),_2=A9e(Ju()),JA=jX();yb();var XA=class{api;crypto;chunks;constructor(r,n,h){this.api=r,this.crypto=n,this.chunks=h}async getTransactionAnchor(){let r=await this.api.get("tx_anchor");if(!r.data.match(/^[a-z0-9_-]{43,}/i)||!r.ok)throw new Error(`Could not getTransactionAnchor. Received: ${r.data}. Status: ${r.status}, ${r.statusText}`);return r.data}async getPrice(r,n){let h=n?`price/${r}/${n}`:`price/${r}`,a=await this.api.get(h);if(!/^\d+$/.test(a.data)||!a.ok)throw new Error(`Could not getPrice. Received: ${a.data}. Status: ${a.status}, ${a.statusText}`);return a.data}async get(r){let n=await this.api.get(`tx/${r}`);if(n.status==200){let h=parseInt(n.data.data_size);if(n.data.format>=2&&h>0&&h<=1024*1024*12){let a=await this.getData(r);return new Xu.default({...n.data,data:a})}return new Xu.default({...n.data,format:n.data.format||1})}throw n.status==404?new YA.default("TX_NOT_FOUND"):n.status==410?new YA.default("TX_FAILED"):new YA.default("TX_INVALID")}fromRaw(r){return new Xu.default(r)}async search(r,n){return this.api.post("arql",{op:"equals",expr1:r,expr2:n}).then(h=>h.data?h.data:[])}getStatus(r){return this.api.get(`tx/${r}/status`).then(n=>n.status==200?{status:200,confirmed:n.data}:{status:n.status,confirmed:null})}async getData(r,n){let h;try{h=await this.chunks.downloadChunkedData(r)}catch(a){console.error(`Error while trying to download chunked data for ${r}`),console.error(a)}if(!h){console.warn(`Falling back to gateway cache for ${r}`);try{let{data:a,ok:d,status:c,statusText:v}=await this.api.get(`/${r}`,{responseType:"arraybuffer"});if(!d)throw new Error("Bad http status code",{cause:{status:c,statusText:v}});h=a}catch(a){console.error(`Error while trying to download contiguous data from gateway cache for ${r}`),console.error(a)}}if(!h)throw new Error(`${r} data was not found!`);return n&&n.decode&&!n.string?h:n&&n.decode&&n.string?_2.bufferToString(h):_2.bufferTob64Url(h)}async sign(r,n,h){let d=typeof n=="object"&&(v=>{let w=!0;return["n","e","d","p","q","dp","dq","qi"].map(m=>!(m in v)&&(w=!1)),w})(n),c=typeof arweaveWallet=="object";if(!d&&!c)throw new Error("No valid JWK or external wallet found to sign transaction.");if(d){r.setOwner(n.n);let v=await r.getSignatureData(),w=await this.crypto.sign(n,v,h),m=await this.crypto.hash(w);r.setSignature({id:_2.bufferTob64Url(m),owner:n.n,signature:_2.bufferTob64Url(w)})}else if(c){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let v=await arweaveWallet.sign(r,h);r.setSignature({id:v.id,owner:v.owner,reward:v.reward,tags:v.tags,signature:v.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(r){let n=await r.getSignatureData(),h=r.get("signature",{decode:!0,string:!1}),a=_2.bufferTob64Url(await this.crypto.hash(h));if(r.id!==a)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(r.owner,n,h)}async post(r){if(typeof r=="string"?r=new Xu.default(JSON.parse(r)):typeof r.readInt32BE=="function"?r=new Xu.default(JSON.parse(r.toString())):typeof r=="object"&&!(r instanceof Xu.default)&&(r=new Xu.default(r)),!(r instanceof Xu.default))throw new Error("Must be Transaction object");r.chunks||await r.prepareChunks(r.data);let n=await this.getUploader(r,r.data);try{for(;!n.isComplete;)await n.uploadChunk()}catch(h){if(n.lastResponseStatus>0)return{status:n.lastResponseStatus,statusText:n.lastResponseError,data:{error:n.lastResponseError}};throw h}return{status:200,statusText:"OK",data:{}}}async getUploader(r,n){let h;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),r instanceof Xu.default){if(n||(n=r.data),!(n instanceof Uint8Array))throw new Error("Data format is invalid");r.chunks||await r.prepareChunks(n),h=new JA.TransactionUploader(this.api,r),(!h.data||h.data.length===0)&&(h.data=n)}else{if(typeof r=="string"&&(r=await JA.TransactionUploader.fromTransactionId(this.api,r)),!n||!(n instanceof Uint8Array))throw new Error("Must provide data when resuming upload");h=await JA.TransactionUploader.fromSerialized(this.api,r,n)}return h}async*upload(r,n){let h=await this.getUploader(r,n);for(;!h.isComplete;)await h.uploadChunk(),yield h;return h}};Sf.default=XA});var ZX=Ht(Qu=>{"use strict";Be();Pe();Oe();var R9e=Qu&&Qu.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),x9e=Qu&&Qu.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),T9e=Qu&&Qu.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&R9e(r,e,n);return x9e(r,e),r};Object.defineProperty(Qu,"__esModule",{value:!0});var KX=T9e(Ju());yb();var QA=class{api;crypto;constructor(r,n){this.api=r,this.crypto=n}getBalance(r){return this.api.get(`wallet/${r}/balance`).then(n=>n.data)}getLastTransactionID(r){return this.api.get(`wallet/${r}/last_tx`).then(n=>n.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(r){return!r||r==="use_wallet"?this.getAddress():this.getAddress(r)}async getAddress(r){if(!r||r==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(r.n)}async ownerToAddress(r){return KX.bufferTob64Url(await this.crypto.hash(KX.b64UrlToBuffer(r)))}};Qu.default=QA});var GX=Ht(Ef=>{"use strict";Be();Pe();Oe();var k9e=Ef&&Ef.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),I9e=Ef&&Ef.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),B9e=Ef&&Ef.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&k9e(r,e,n);return I9e(r,e),r};Object.defineProperty(Ef,"__esModule",{value:!0});Ef.SiloResource=void 0;var WX=B9e(Ju()),eR=class{api;crypto;transactions;constructor(r,n,h){this.api=r,this.crypto=n,this.transactions=h}async get(r){if(!r)throw new Error("No Silo URI specified");let n=await this.parseUri(r),h=await this.transactions.search("Silo-Name",n.getAccessKey());if(h.length==0)throw new Error(`No data could be found for the Silo URI: ${r}`);let a=await this.transactions.get(h[0]);if(!a)throw new Error(`No data could be found for the Silo URI: ${r}`);let d=a.get("data",{decode:!0,string:!1});return this.crypto.decrypt(d,n.getEncryptionKey())}async readTransactionData(r,n){if(!n)throw new Error("No Silo URI specified");let h=await this.parseUri(n),a=r.get("data",{decode:!0,string:!1});return this.crypto.decrypt(a,h.getEncryptionKey())}async parseUri(r){let n=r.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!n)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let h=n[1],a=Math.pow(2,parseInt(n[2])),d=await this.hash(WX.stringToBuffer(h),a),c=WX.bufferTob64(d.slice(0,15)),v=await this.hash(d.slice(16,31),1);return new bb(r,c,v)}async hash(r,n){let h=await this.crypto.hash(r);for(let a=0;a<n-1;a++)h=await this.crypto.hash(h);return h}};Ef.default=eR;var bb=class{uri;accessKey;encryptionKey;constructor(r,n,h){this.uri=r,this.accessKey=n,this.encryptionKey=h}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Ef.SiloResource=bb});var YX=Ht(eh=>{"use strict";Be();Pe();Oe();var O9e=eh&&eh.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),P9e=eh&&eh.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),N9e=eh&&eh.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&O9e(r,e,n);return P9e(r,e),r};Object.defineProperty(eh,"__esModule",{value:!0});var VX=v2(),C9e=N9e(Ju()),tR=class{api;constructor(r){this.api=r}async getTransactionOffset(r){let n=await this.api.get(`tx/${r}/offset`);if(n.status===200)return n.data;throw new Error(`Unable to get transaction offset: ${(0,VX.getError)(n)}`)}async getChunk(r){let n=await this.api.get(`chunk/${r}`);if(n.status===200)return n.data;throw new Error(`Unable to get chunk: ${(0,VX.getError)(n)}`)}async getChunkData(r){let n=await this.getChunk(r);return C9e.b64UrlToBuffer(n.chunk)}firstChunkOffset(r){return parseInt(r.offset)-parseInt(r.size)+1}async downloadChunkedData(r){let n=await this.getTransactionOffset(r),h=parseInt(n.size),d=parseInt(n.offset)-h+1,c=new Uint8Array(h),v=0;for(;v<h;){this.api.config.logging&&console.log(`[chunk] ${v}/${h}`);let w;try{w=await this.getChunkData(d+v)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${d+v}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(w)c.set(w,v),v+=w.length;else throw new Error(`Couldn't complete data download at ${v}/${h}`)}return c}};eh.default=tR});var XX=Ht(M2=>{"use strict";Be();Pe();Oe();var L9e=M2&&M2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(M2,"__esModule",{value:!0});var JX=L9e(v2());yb();var rR=class e{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(r,n){this.api=r,this.network=n}async get(r){let n=await this.api.get(`${e.HASH_ENDPOINT}${r}`);if(n.status===200)return n.data;throw n.status===404?new JX.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getByHeight(r){let n=await this.api.get(`${e.HEIGHT_ENDPOINT}${r}`);if(n.status===200)return n.data;throw n.status===404?new JX.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getCurrent(){let{current:r}=await this.network.getInfo();return await this.get(r)}};M2.default=rR});var db=Ht(Af=>{"use strict";Be();Pe();Oe();var D9e=Af&&Af.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),$9e=Af&&Af.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),U9e=Af&&Af.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&D9e(r,e,n);return $9e(r,e),r},hu=Af&&Af.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Af,"__esModule",{value:!0});var q9e=hu(Mq()),j9e=hu(Sq()),F9e=hu(yX()),z9e=hu(bX()),H9e=hu(HX()),K9e=hu(ZX()),QX=hu(gb()),S2=U9e(Ju()),Z9e=hu(GX()),W9e=hu(YX()),G9e=hu(XX()),iR=class e{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new F9e.default;static utils=S2;constructor(r){this.api=new j9e.default(r),this.wallets=new K9e.default(this.api,e.crypto),this.chunks=new W9e.default(this.api),this.transactions=new H9e.default(this.api,e.crypto,this.chunks),this.silo=new Z9e.default(this.api,this.crypto,this.transactions),this.network=new z9e.default(this.api),this.blocks=new G9e.default(this.api,this.network),this.ar=new q9e.default}get crypto(){return e.crypto}get utils(){return e.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(r,n){let h={};if(Object.assign(h,r),!r.data&&!(r.target&&r.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(r.owner==null&&n&&n!=="use_wallet"&&(h.owner=n.n),r.last_tx==null&&(h.last_tx=await this.transactions.getTransactionAnchor()),typeof r.data=="string"&&(r.data=S2.stringToBuffer(r.data)),r.data instanceof ArrayBuffer&&(r.data=new Uint8Array(r.data)),r.data&&!(r.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(r.reward==null){let d=r.data?r.data.byteLength:0;h.reward=await this.transactions.getPrice(d,h.target)}h.data_root="",h.data_size=r.data?r.data.byteLength.toString():"0",h.data=r.data||new Uint8Array(0);let a=new QX.default(h);return await a.getSignatureData(),a}async createSiloTransaction(r,n,h){let a={};if(Object.assign(a,r),!r.data)throw new Error("Silo transactions must have a 'data' value");if(!h)throw new Error("No Silo URI specified.");if(r.target||r.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(r.owner==null){if(!n||!n.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");a.owner=n.n}r.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor());let d=await this.silo.parseUri(h);if(typeof r.data=="string"){let v=await this.crypto.encrypt(S2.stringToBuffer(r.data),d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=S2.bufferTob64Url(v)}if(r.data instanceof Uint8Array){let v=await this.crypto.encrypt(r.data,d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=S2.bufferTob64Url(v)}let c=new QX.default(a);return c.addTag("Silo-Name",d.getAccessKey()),c.addTag("Silo-Version","0.1.0"),c}arql(r){return this.api.post("/arql",r).then(n=>n.data||[])}};Af.default=iR});var tQ=Ht((aR,eQ)=>{"use strict";Be();Pe();Oe();var V9e=aR&&aR.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nR=V9e(db());nR.default.init=function(e={}){return new nR.default(e)};eQ.exports=nR.default});var xte=Ht((CQe,Rte)=>{"use strict";Be();Pe();Oe();var ETe=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);Rte.exports=e=>!ETe.has(e&&e.code)});var Lte=Ht((ret,xx)=>{"use strict";Be();Pe();Oe();var CTe=Object.prototype.hasOwnProperty,Wa="~";function lv(){}Object.create&&(lv.prototype=Object.create(null),new lv().__proto__||(Wa=!1));function LTe(e,r,n){this.fn=e,this.context=r,this.once=n||!1}function Cte(e,r,n,h,a){if(typeof n!="function")throw new TypeError("The listener must be a function");var d=new LTe(n,h||e,a),c=Wa?Wa+r:r;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],d]:e._events[c].push(d):(e._events[c]=d,e._eventsCount++),e}function m3(e,r){--e._eventsCount===0?e._events=new lv:delete e._events[r]}function Ca(){this._events=new lv,this._eventsCount=0}Ca.prototype.eventNames=function(){var r=[],n,h;if(this._eventsCount===0)return r;for(h in n=this._events)CTe.call(n,h)&&r.push(Wa?h.slice(1):h);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r};Ca.prototype.listeners=function(r){var n=Wa?Wa+r:r,h=this._events[n];if(!h)return[];if(h.fn)return[h.fn];for(var a=0,d=h.length,c=new Array(d);a<d;a++)c[a]=h[a].fn;return c};Ca.prototype.listenerCount=function(r){var n=Wa?Wa+r:r,h=this._events[n];return h?h.fn?1:h.length:0};Ca.prototype.emit=function(r,n,h,a,d,c){var v=Wa?Wa+r:r;if(!this._events[v])return!1;var w=this._events[v],m=arguments.length,y,g;if(w.fn){switch(w.once&&this.removeListener(r,w.fn,void 0,!0),m){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,n),!0;case 3:return w.fn.call(w.context,n,h),!0;case 4:return w.fn.call(w.context,n,h,a),!0;case 5:return w.fn.call(w.context,n,h,a,d),!0;case 6:return w.fn.call(w.context,n,h,a,d,c),!0}for(g=1,y=new Array(m-1);g<m;g++)y[g-1]=arguments[g];w.fn.apply(w.context,y)}else{var S=w.length,R;for(g=0;g<S;g++)switch(w[g].once&&this.removeListener(r,w[g].fn,void 0,!0),m){case 1:w[g].fn.call(w[g].context);break;case 2:w[g].fn.call(w[g].context,n);break;case 3:w[g].fn.call(w[g].context,n,h);break;case 4:w[g].fn.call(w[g].context,n,h,a);break;default:if(!y)for(R=1,y=new Array(m-1);R<m;R++)y[R-1]=arguments[R];w[g].fn.apply(w[g].context,y)}}return!0};Ca.prototype.on=function(r,n,h){return Cte(this,r,n,h,!1)};Ca.prototype.once=function(r,n,h){return Cte(this,r,n,h,!0)};Ca.prototype.removeListener=function(r,n,h,a){var d=Wa?Wa+r:r;if(!this._events[d])return this;if(!n)return m3(this,d),this;var c=this._events[d];if(c.fn)c.fn===n&&(!a||c.once)&&(!h||c.context===h)&&m3(this,d);else{for(var v=0,w=[],m=c.length;v<m;v++)(c[v].fn!==n||a&&!c[v].once||h&&c[v].context!==h)&&w.push(c[v]);w.length?this._events[d]=w.length===1?w[0]:w:m3(this,d)}return this};Ca.prototype.removeAllListeners=function(r){var n;return r?(n=Wa?Wa+r:r,this._events[n]&&m3(this,n)):(this._events=new lv,this._eventsCount=0),this};Ca.prototype.off=Ca.prototype.removeListener;Ca.prototype.addListener=Ca.prototype.on;Ca.prefixed=Wa;Ca.EventEmitter=Ca;typeof xx<"u"&&(xx.exports=Ca)});Be();Pe();Oe();var Ute=fc(O8(),1);Be();Pe();Oe();Be();Pe();Oe();var cie=["gateway","gateways","prescribedObservers","record","auction","balance","epoch","priceForInteraction"],die=["delegateStake","decreaseDelegateStake","joinNetwork","increaseOperatorStake","decreaseOperatorStake","updateGatewaySettings","saveObservations","extendRecord","buyRecord","increaseUndernameCount","transfer"],ake=[...cie,...die],oke={GATEWAY:"gateway",GATEWAYS:"gateways",PRESCRIBED_OBSERVERS:"prescribedObservers",DELEGATE_STAKE:"delegateStake",DECREASE_DELEGATE_STAKE:"decreaseDelegateStake",JOIN_NETWORK:"joinNetwork",INCREASE_OPERATOR_STAKE:"increaseOperatorStake",DECREASE_OPERATOR_STAKE:"decreaseOperatorStake",UPDATE_GATEWAY_SETTINGS:"updateGatewaySettings",SAVE_OBSERVATIONS:"saveObservations",EXTEND_RECORD:"extendRecord",INCREASE_UNDERNAME_COUNT:"increaseUndernameCount",RECORD:"record",AUCTION:"auction",TRANSFER:"transfer",BALANCE:"balance",PRICE_FOR_INTERACTION:"priceForInteraction",EPOCH:"epoch",BUY_RECORD:"buyRecord"},pie=(n=>(n.IO="IO",n.MIO="mIO",n))(pie||{}),ske={TRANSFER:"transfer",SET_CONTROLLER:"setController",REMOVE_CONTROLLER:"removeController",SET_NAME:"setName",SET_TICKER:"setTicker",SET_RECORD:"setRecord",REMOVE_RECORD:"removeRecord",BALANCE:"balance",EVOLVE:"evolve"};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var iB=new RegExp("^[a-zA-Z0-9_-]{43}$"),vke=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),mke=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),gke=gt.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",yke="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",vie="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",bke=vie,lc="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",P8=1e6,nB="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",aB="3OlGzE5mrsN2GsxCYM0Tae1KzWepGOr5a94deOWmApM",oB="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var N8=class e{constructor(r){this.positiveFiniteInteger=r;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${r}`)}[Symbol.toPrimitive](r){return r==="string"&&this.toString(),this.positiveFiniteInteger}plus(r){return new e(this.positiveFiniteInteger+r.positiveFiniteInteger)}minus(r){return new e(this.positiveFiniteInteger-r.positiveFiniteInteger)}isGreaterThan(r){return this.positiveFiniteInteger>r.positiveFiniteInteger}isGreaterThanOrEqualTo(r){return this.positiveFiniteInteger>=r.positiveFiniteInteger}isLessThan(r){return this.positiveFiniteInteger<r.positiveFiniteInteger}isLessThanOrEqualTo(r){return this.positiveFiniteInteger<=r.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(r){return this.positiveFiniteInteger===r.positiveFiniteInteger}},C8=class{value;constructor(r){if(!Number.isFinite(r)||r<0)throw new Error("IOToken must be a non-negative finite number");this.value=+r.toFixed(6)}valueOf(){return this.value}toMIO(){return new L8(Math.floor(this.value*P8))}toString(){return`${this.value}`}},L8=class e extends N8{constructor(r){super(r)}multiply(r){let n=Math.floor(this.valueOf()*r.valueOf());return new e(n)}divide(r){if(r.valueOf()===0)throw new Error("Cannot divide by zero");let n=Math.floor(this.valueOf()/r.valueOf());return new e(n)}plus(r){let n=super.plus(r);return new e(n.valueOf())}minus(r){let n=super.minus(r);return new e(n.valueOf())}toIO(){return new C8(this.valueOf()/P8)}};Be();Pe();Oe();Be();Pe();Oe();var sB=e=>iB.test(e);function Ike(e){return e!==void 0&&!isNaN(parseInt(e.toString()))}function cc(e){return"process"in e}function dc(e){return"processId"in e&&typeof e.processId=="string"&&sB(e.processId)===!0}function Lke(e){return e.type==="lease"&&e.endTimestamp!==void 0}Be();Pe();Oe();Be();Pe();Oe();var zs=class extends Error{constructor(r){super(r),this.name=this.constructor.name}},fB=class extends zs{},uB=class extends zs{},hB=class extends zs{constructor(r,n){super(`Failed request: ${r}: ${n}`)}},lB=class extends zs{},vm=class extends zs{},cB=class extends zs{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},gh=class extends zs{constructor(){super("Invalid contract configuration")}},dB=class extends zs{constructor(){super("Invalid process configuration")}},pB=class extends zs{};Be();Pe();Oe();var rf=fc(bq(),1);Be();Pe();Oe();var Wc="2.0.0-alpha.6";var Gc=class e{logger;silent=!1;static default=new e;constructor({level:r="info"}={}){if(r==="none"){this.silent=!0;return}this.logger=(0,rf.createLogger)({level:r,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:Wc},format:rf.format.combine(rf.format.timestamp(),rf.format.json())}),typeof window<"u"?this.logger=console:this.logger.add(new rf.transports.Console({format:rf.format.combine(rf.format.timestamp(),rf.format.json())}))}info(r,...n){this.silent||this.logger.info(r,...n)}warn(r,...n){this.silent||this.logger.warn(r,...n)}error(r,...n){this.silent||this.logger.error(r,...n)}debug(r,...n){this.silent||this.logger.debug(r,...n)}setLogLevel(r){"silent"in this.logger&&(this.logger.silent=r==="none"),"level"in this.logger&&(this.logger.level=r)}};Be();Pe();Oe();var yp=class{static init({signer:r,...n}){if(cc(n)||dc(n))return r?new Xw({signer:r,...n}):new u6(n);throw new gh}},u6=class{process;constructor(r){if(cc(r))this.process=r.process;else if(dc(r))this.process=new Xo({processId:r.processId});else throw new gh}async getState(){let r=[{name:"Action",value:"State"}];return await this.process.read({tags:r})}async getInfo(){let r=[{name:"Action",value:"Info"}];return await this.process.read({tags:r})}async getRecord({undername:r}){let n=[{name:"Sub-Domain",value:r},{name:"Action",value:"Record"}];return await this.process.read({tags:n})}async getRecords(){let r=[{name:"Action",value:"Records"}];return await this.process.read({tags:r})}async getOwner(){return(await this.getInfo()).Owner}async getControllers(){let r=[{name:"Action",value:"Controllers"}];return await this.process.read({tags:r})}async getName(){return(await this.getInfo()).Name}async getTicker(){return(await this.getInfo()).Ticker}async getBalances(){let r=[{name:"Action",value:"Balances"}];return await this.process.read({tags:r})}async getBalance({address:r}){let n=[{name:"Action",value:"Balance"},{name:"Recipient",value:r}];return await this.process.read({tags:n})}},Xw=class extends u6{signer;constructor({signer:r,...n}){super(n),this.signer=r}async transfer({target:r}){let n=[{name:"Action",value:"Transfer"},{name:"Recipient",value:r}];return this.process.send({tags:n,data:{},signer:this.signer})}async addController({controller:r}){let n=[{name:"Action",value:"Add-Controller"},{name:"Controller",value:r}];return this.process.send({tags:n,data:{},signer:this.signer})}async removeController({controller:r}){let n=[{name:"Action",value:"Remove-Controller"},{name:"Controller",value:r}];return this.process.send({tags:n,data:{},signer:this.signer})}async setRecord({undername:r,transactionId:n,ttlSeconds:h}){return this.process.send({tags:[{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:r},{name:"Transaction-Id",value:n},{name:"TTL-Seconds",value:h.toString()}],data:{transactionId:n,ttlSeconds:h},signer:this.signer})}async removeRecord({undername:r}){return this.process.send({tags:[{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:r}],data:{undername:r},signer:this.signer})}async setTicker({ticker:r}){return this.process.send({tags:[{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:r}],data:{ticker:r},signer:this.signer})}async setName({name:r}){return this.process.send({tags:[{name:"Action",value:"Set-Name"},{name:"Name",value:r}],data:{name:r},signer:this.signer})}};Be();Pe();Oe();Be();Pe();Oe();var rQ=fc(tQ(),1),wb=rQ.default.init({host:"arweave.net",port:443,protocol:"https"});Be();Pe();Oe();Be();Pe();Oe();var Y9e=Object.create,IR=Object.defineProperty,J9e=Object.getOwnPropertyDescriptor,RQ=Object.getOwnPropertyNames,X9e=Object.getPrototypeOf,Q9e=Object.prototype.hasOwnProperty,No=(e,r)=>function(){return r||(0,e[RQ(e)[0]])((r={exports:{}}).exports,r),r.exports},xQ=(e,r)=>{for(var n in r)IR(e,n,{get:r[n],enumerable:!0})},e_e=(e,r,n,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of RQ(r))!Q9e.call(e,a)&&a!==n&&IR(e,a,{get:()=>r[a],enumerable:!(h=J9e(r,a))||h.enumerable});return e},BR=(e,r,n)=>(n=e!=null?Y9e(X9e(e)):{},e_e(r||!e||!e.__esModule?IR(n,"default",{value:e,enumerable:!0}):n,e)),t_e=No({"node_modules/obliterator/iterator.js"(e,r){function n(h){if(typeof h!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=h}typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var h=arguments,a=h.length,d=0;return new n(function(){return d>=a?{done:!0}:{done:!1,value:h[d++]}})},n.empty=function(){var h=new n(function(){return{done:!0}});return h},n.fromSequence=function(h){var a=0,d=h.length;return new n(function(){return a>=d?{done:!0}:{done:!1,value:h[a++]}})},n.is=function(h){return h instanceof n?!0:typeof h=="object"&&h!==null&&typeof h.next=="function"},r.exports=n}}),r_e=No({"node_modules/obliterator/support.js"(e){e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",e.SYMBOL_SUPPORT=typeof Symbol<"u"}}),OR=No({"node_modules/obliterator/foreach.js"(e,r){var n=r_e(),h=n.ARRAY_BUFFER_SUPPORT,a=n.SYMBOL_SUPPORT;r.exports=function(c,v){var w,m,y,g,S;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof v!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||h&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,g=c.length;y<g;y++)v(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(v);return}if(a&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(w=c,y=0;S=w.next(),S.done!==!0;)v(S.value,y),y++;return}for(m in c)c.hasOwnProperty(m)&&v(c[m],m)}}}),PR=No({"node_modules/mnemonist/utils/typed-arrays.js"(e){var r=Math.pow(2,8)-1,n=Math.pow(2,16)-1,h=Math.pow(2,32)-1,a=Math.pow(2,7)-1,d=Math.pow(2,15)-1,c=Math.pow(2,31)-1;e.getPointerArray=function(w){var m=w-1;if(m<=r)return Uint8Array;if(m<=n)return Uint16Array;if(m<=h)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(w){var m=w-1;return m<=a?Int8Array:m<=d?Int16Array:m<=c?Int32Array:Float64Array},e.getNumberType=function(w){return w===(w|0)?Math.sign(w)===-1?w<=127&&w>=-128?Int8Array:w<=32767&&w>=-32768?Int16Array:Int32Array:w<=255?Uint8Array:w<=65535?Uint16Array:Uint32Array:Float64Array};var v={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(w,m){var y=null,g=0,S,R,A,k,I;for(k=0,I=w.length;k<I;k++)A=m?m(w[k]):w[k],R=e.getNumberType(A),S=v[R.name],S>g&&(g=S,y=R);return y},e.isTypedArray=function(w){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(w)},e.concat=function(){var w=0,m,y,g;for(m=0,g=arguments.length;m<g;m++)w+=arguments[m].length;var S=new arguments[0].constructor(w);for(m=0,y=0;m<g;m++)S.set(arguments[m],y),y+=arguments[m].length;return S},e.indices=function(w){for(var m=e.getPointerArray(w),y=new m(w),g=0;g<w;g++)y[g]=g;return y}}}),TQ=No({"node_modules/mnemonist/utils/iterables.js"(e){var r=OR(),n=PR();function h(v){return Array.isArray(v)||n.isTypedArray(v)}function a(v){if(typeof v.length=="number")return v.length;if(typeof v.size=="number")return v.size}function d(v){var w=a(v),m=typeof w=="number"?new Array(w):[],y=0;return r(v,function(g){m[y++]=g}),m}function c(v){var w=a(v),m=typeof w=="number"?n.getPointerArray(w):Array,y=typeof w=="number"?new Array(w):[],g=typeof w=="number"?new m(w):[],S=0;return r(v,function(R){y[S]=R,g[S]=S++}),[y,g]}e.isArrayLike=h,e.guessLength=a,e.toArray=d,e.toArrayWithIndices=c}}),i_e=No({"node_modules/mnemonist/lru-cache.js"(e,r){var n=t_e(),h=OR(),a=PR(),d=TQ();function c(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(v){var w=this.head;if(this.head===v)return this;var m=this.backward[v],y=this.forward[v];return this.tail===v?this.tail=m:this.backward[y]=m,this.forward[m]=y,this.backward[w]=v,this.head=v,this.forward[v]=w,this},c.prototype.set=function(v,w){var m=this.items[v];if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],delete this.items[this.K[m]]),this.items[v]=m,this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},c.prototype.setpop=function(v,w){var m=null,y=null,g=this.items[v];return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],delete this.items[y]),this.items[v]=g,this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},c.prototype.has=function(v){return v in this.items},c.prototype.get=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},c.prototype.peek=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.V[w]},c.prototype.forEach=function(v,w){w=arguments.length>1?w:this;for(var m=0,y=this.size,g=this.head,S=this.K,R=this.V,A=this.forward;m<y;)v.call(w,R[g],S[g],this),g=A[g],m++},c.prototype.keys=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},c.prototype.values=function(){var v=0,w=this.size,m=this.head,y=this.V,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},c.prototype.entries=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.V,S=this.forward;return new n(function(){if(v>=w)return{done:!0};var R=y[m],A=g[m];return v++,v<w&&(m=S[m]),{done:!1,value:[R,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var v=new Map,w=this.entries(),m;m=w.next(),!m.done;)v.set(m.value[0],m.value[1]);return Object.defineProperty(v,"constructor",{value:c,enumerable:!1}),v},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new c(w,m,y);return h(v,function(S,R){g.set(R,S)}),g},r.exports=c}}),n_e=No({"node_modules/mnemonist/lru-map.js"(e,r){var n=i_e(),h=OR(),a=PR(),d=TQ();function c(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(v,w){var m=this.items.get(v);if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],this.items.delete(this.K[m])),this.items.set(v,m),this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},c.prototype.setpop=function(v,w){var m=null,y=null,g=this.items.get(v);return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],this.items.delete(y)),this.items.set(v,g),this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},c.prototype.has=function(v){return this.items.has(v)},c.prototype.get=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},c.prototype.peek=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.V[w]},c.prototype.splayOnTop=n.prototype.splayOnTop,c.prototype.forEach=n.prototype.forEach,c.prototype.keys=n.prototype.keys,c.prototype.values=n.prototype.values,c.prototype.entries=n.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=n.prototype.inspect,c.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new c(w,m,y);return h(v,function(S,R){g.set(R,S)}),g},r.exports=c}}),a_e=No({"node_modules/ms/index.js"(e,r){var n=1e3,h=n*60,a=h*60,d=a*24,c=d*7,v=d*365.25;r.exports=function(S,R){R=R||{};var A=typeof S;if(A==="string"&&S.length>0)return w(S);if(A==="number"&&isFinite(S))return R.long?y(S):m(S);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(S))};function w(S){if(S=String(S),!(S.length>100)){var R=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(S);if(R){var A=parseFloat(R[1]),k=(R[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*v;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*d;case"hours":case"hour":case"hrs":case"hr":case"h":return A*a;case"minutes":case"minute":case"mins":case"min":case"m":return A*h;case"seconds":case"second":case"secs":case"sec":case"s":return A*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function m(S){var R=Math.abs(S);return R>=d?Math.round(S/d)+"d":R>=a?Math.round(S/a)+"h":R>=h?Math.round(S/h)+"m":R>=n?Math.round(S/n)+"s":S+"ms"}function y(S){var R=Math.abs(S);return R>=d?g(S,R,d,"day"):R>=a?g(S,R,a,"hour"):R>=h?g(S,R,h,"minute"):R>=n?g(S,R,n,"second"):S+" ms"}function g(S,R,A,k){var I=R>=A*1.5;return Math.round(S/A)+" "+k+(I?"s":"")}}}),o_e=No({"node_modules/debug/src/common.js"(e,r){function n(h){d.debug=d,d.default=d,d.coerce=g,d.disable=w,d.enable=v,d.enabled=m,d.humanize=a_e(),d.destroy=S,Object.keys(h).forEach(R=>{d[R]=h[R]}),d.names=[],d.skips=[],d.formatters={};function a(R){let A=0;for(let k=0;k<R.length;k++)A=(A<<5)-A+R.charCodeAt(k),A|=0;return d.colors[Math.abs(A)%d.colors.length]}d.selectColor=a;function d(R){let A,k=null,I,B;function P(...C){if(!P.enabled)return;let q=P,K=Number(new Date),V=K-(A||K);q.diff=V,q.prev=A,q.curr=K,A=K,C[0]=d.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let j=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(J,E)=>{if(J==="%%")return"%";j++;let i=d.formatters[E];if(typeof i=="function"){let s=C[j];J=i.call(q,s),C.splice(j,1),j--}return J}),d.formatArgs.call(q,C),(q.log||d.log).apply(q,C)}return P.namespace=R,P.useColors=d.useColors(),P.color=d.selectColor(R),P.extend=c,P.destroy=d.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(I!==d.namespaces&&(I=d.namespaces,B=d.enabled(R)),B),set:C=>{k=C}}),typeof d.init=="function"&&d.init(P),P}function c(R,A){let k=d(this.namespace+(typeof A>"u"?":":A)+R);return k.log=this.log,k}function v(R){d.save(R),d.namespaces=R,d.names=[],d.skips=[];let A,k=(typeof R=="string"?R:"").split(/[\s,]+/),I=k.length;for(A=0;A<I;A++)k[A]&&(R=k[A].replace(/\*/g,".*?"),R[0]==="-"?d.skips.push(new RegExp("^"+R.slice(1)+"$")):d.names.push(new RegExp("^"+R+"$")))}function w(){let R=[...d.names.map(y),...d.skips.map(y).map(A=>"-"+A)].join(",");return d.enable(""),R}function m(R){if(R[R.length-1]==="*")return!0;let A,k;for(A=0,k=d.skips.length;A<k;A++)if(d.skips[A].test(R))return!1;for(A=0,k=d.names.length;A<k;A++)if(d.names[A].test(R))return!0;return!1}function y(R){return R.toString().substring(2,R.toString().length-2).replace(/\.\*\?$/,"*")}function g(R){return R instanceof Error?R.stack||R.message:R}function S(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d.enable(d.load()),d}r.exports=n}}),s_e=No({"node_modules/debug/src/browser.js"(e,r){e.formatArgs=h,e.save=a,e.load=d,e.useColors=n,e.storage=c(),e.destroy=(()=>{let w=!1;return()=>{w||(w=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function h(w){if(w[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+w[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;let m="color: "+this.color;w.splice(1,0,m,"color: inherit");let y=0,g=0;w[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(y++,S==="%c"&&(g=y))}),w.splice(g,0,m)}e.log=console.debug||console.log||(()=>{});function a(w){try{w?e.storage.setItem("debug",w):e.storage.removeItem("debug")}catch{}}function d(){let w;try{w=e.storage.getItem("debug")}catch{}return!w&&typeof gt<"u"&&"env"in gt&&(w=gt.env.DEBUG),w}function c(){try{return localStorage}catch{}}r.exports=o_e()(e);var{formatters:v}=r.exports;v.j=function(w){try{return JSON.stringify(w)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}}}),f_e=No({"node_modules/base64-js/index.js"(e){"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=R;var r=[],n=[],h=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,c=a.length;d<c;++d)r[d]=a[d],n[a.charCodeAt(d)]=d;var d,c;n[45]=62,n[95]=63;function v(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=k);var B=I===k?0:4-I%4;return[I,B]}function w(A){var k=v(A),I=k[0],B=k[1];return(I+B)*3/4-B}function m(A,k,I){return(k+I)*3/4-I}function y(A){var k,I=v(A),B=I[0],P=I[1],C=new h(m(A,B,P)),q=0,K=P>0?B-4:B,V;for(V=0;V<K;V+=4)k=n[A.charCodeAt(V)]<<18|n[A.charCodeAt(V+1)]<<12|n[A.charCodeAt(V+2)]<<6|n[A.charCodeAt(V+3)],C[q++]=k>>16&255,C[q++]=k>>8&255,C[q++]=k&255;return P===2&&(k=n[A.charCodeAt(V)]<<2|n[A.charCodeAt(V+1)]>>4,C[q++]=k&255),P===1&&(k=n[A.charCodeAt(V)]<<10|n[A.charCodeAt(V+1)]<<4|n[A.charCodeAt(V+2)]>>2,C[q++]=k>>8&255,C[q++]=k&255),C}function g(A){return r[A>>18&63]+r[A>>12&63]+r[A>>6&63]+r[A&63]}function S(A,k,I){for(var B,P=[],C=k;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function R(A){for(var k,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(k=A[I-1],P.push(r[k>>2]+r[k<<4&63]+"==")):B===2&&(k=(A[I-2]<<8)+A[I-1],P.push(r[k>>10]+r[k>>4&63]+r[k<<2&63]+"=")),P.join("")}}}),u_e=No({"node_modules/ieee754/index.js"(e){e.read=function(r,n,h,a,d){var c,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=h?d-1:0,R=h?-1:1,A=r[n+S];for(S+=R,c=A&(1<<-g)-1,A>>=-g,g+=w;g>0;c=c*256+r[n+S],S+=R,g-=8);for(v=c&(1<<-g)-1,c>>=-g,g+=a;g>0;v=v*256+r[n+S],S+=R,g-=8);if(c===0)c=1-y;else{if(c===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),c=c-y}return(A?-1:1)*v*Math.pow(2,c-a)},e.write=function(r,n,h,a,d,c){var v,w,m,y=c*8-d-1,g=(1<<y)-1,S=g>>1,R=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:c-1,k=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=R/m:n+=R*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;r[h+A]=w&255,A+=k,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;r[h+A]=v&255,A+=k,v/=256,y-=8);r[h+A-k]|=I*128}}}),h_e=No({"node_modules/buffer/index.js"(e){"use strict";var r=f_e(),n=u_e(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return k(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?c(O):N!==void 0?typeof $=="string"?c(O).fill(N,$):c(O).fill(N):c(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),c(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=c($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function R(O){let N=O.length<0?0:B(O.length)|0,$=c(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return k(N.buffer,N.byteOffset,N.byteLength)}return R(O)}function k(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=c(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?c(0):R(O);if(O.type==="Buffer"&&Array.isArray(O.data))return R(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==v.prototype},v.compare=function(N,$){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),ut($,Uint8Array)&&($=v.from($,$.offset,$.byteLength)),!v.isBuffer(N)||!v.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===$)return 0;let ee=N.length,re=$.length;for(let se=0,ce=Math.min(ee,re);se<ce;++se)if(N[se]!==$[se]){ee=N[se],re=$[se];break}return ee<re?-1:re<ee?1:0},v.isEncoding=function(N){switch(String(N).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(N,$){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return v.alloc(0);let ee;if($===void 0)for($=0,ee=0;ee<N.length;++ee)$+=N[ee].length;let re=v.allocUnsafe($),se=0;for(ee=0;ee<N.length;++ee){let ce=N[ee];if(ut(ce,Uint8Array))se+ce.length>re.length?(v.isBuffer(ce)||(ce=v.from(ce)),ce.copy(re,se)):Uint8Array.prototype.set.call(re,ce,se);else if(v.isBuffer(ce))ce.copy(re,se);else throw new TypeError('"list" argument must be an Array of Buffers');se+=ce.length}return re};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return t(this,N,$);case"utf8":case"utf-8":return l(this,N,$);case"ascii":return x(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return f(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$<N;$+=2)K(this,$,$+1);return this},v.prototype.swap32=function(){let N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let $=0;$<N;$+=4)K(this,$,$+3),K(this,$+1,$+2);return this},v.prototype.swap64=function(){let N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let $=0;$<N;$+=8)K(this,$,$+7),K(this,$+1,$+6),K(this,$+2,$+5),K(this,$+3,$+4);return this},v.prototype.toString=function(){let N=this.length;return N===0?"":arguments.length===0?l(this,0,N):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(N){if(!v.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:v.compare(this,N)===0},v.prototype.inspect=function(){let N="",$=e.INSPECT_MAX_BYTES;return N=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$&&(N+=" ... "),"<Buffer "+N+">"},h&&(v.prototype[h]=v.prototype.inspect),v.prototype.compare=function(N,$,ee,re,se){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if($===void 0&&($=0),ee===void 0&&(ee=N?N.length:0),re===void 0&&(re=0),se===void 0&&(se=this.length),$<0||ee>N.length||re<0||se>this.length)throw new RangeError("out of range index");if(re>=se&&$>=ee)return 0;if(re>=se)return-1;if($>=ee)return 1;if($>>>=0,ee>>>=0,re>>>=0,se>>>=0,this===N)return 0;let ce=se-re,st=ee-$,ye=Math.min(ce,st),be=this.slice(re,se),me=N.slice($,ee);for(let Te=0;Te<ye;++Te)if(be[Te]!==me[Te]){ce=be[Te],st=me[Te];break}return ce<st?-1:st<ce?1:0};function V(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,Te){return se===1?me[Te]:me.readUInt16BE(Te*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let Te=0;Te<st;Te++)if(ye(O,be+Te)!==ye(N,Te)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(N,$,ee){return this.indexOf(N,$,ee)!==-1},v.prototype.indexOf=function(N,$,ee){return V(this,N,$,ee,!0)},v.prototype.lastIndexOf=function(N,$,ee){return V(this,N,$,ee,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(N,$,ee,re){if($===void 0)re="utf8",ee=this.length,$=0;else if(ee===void 0&&typeof $=="string")re=$,ee=this.length,$=0;else if(isFinite($))$=$>>>0,isFinite(ee)?(ee=ee>>>0,re===void 0&&(re="utf8")):(re=ee,ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let se=this.length-$;if((ee===void 0||ee>se)&&(ee=se),N.length>0&&(ee<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let ce=!1;for(;;)switch(re){case"hex":return z(this,N,$,ee);case"utf8":case"utf-8":return J(this,N,$,ee);case"ascii":case"latin1":case"binary":return E(this,N,$,ee);case"base64":return i(this,N,$,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,N,$,ee);default:if(ce)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),ce=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(O,N,$){return N===0&&$===O.length?r.fromByteArray(O):r.fromByteArray(O.slice(N,$))}function l(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,Te;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(Te=(se&31)<<6|ye&63,Te>127&&(ce=Te));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(Te=(se&15)<<12|(ye&63)<<6|be&63,Te>2047&&(Te<55296||Te>57343)&&(ce=Te));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(Te=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,Te>65535&&Te<1114112&&(ce=Te))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function x(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function t(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=ke[O[se]];return re}function u(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(N,$){let ee=this.length;N=~~N,$=$===void 0?ee:~~$,N<0?(N+=ee,N<0&&(N=0)):N>ee&&(N=ee),$<0?($+=ee,$<0&&($=0)):$>ee&&($=ee),$<N&&($=N);let re=this.subarray(N,$);return Object.setPrototypeOf(re,v.prototype),re};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return re},v.prototype.readUintBE=v.prototype.readUIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N+--$],se=1;for(;$>0&&(se*=256);)re+=this[N+--$]*se;return re},v.prototype.readUint8=v.prototype.readUInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]|this[N+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]<<8|this[N+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},v.prototype.readBigUInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,se=this[++N]+this[++N]*2**8+this[++N]*2**16+ee*2**24;return BigInt(re)+(BigInt(se)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],se=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee;return(BigInt(re)<<BigInt(32))+BigInt(se)}),v.prototype.readIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return se*=128,re>=se&&(re-=Math.pow(2,8*$)),re},v.prototype.readIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=$,se=1,ce=this[N+--re];for(;re>0&&(se*=256);)ce+=this[N+--re]*se;return se*=128,ce>=se&&(ce-=Math.pow(2,8*$)),ce},v.prototype.readInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},v.prototype.readInt16LE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N]|this[N+1]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt16BE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N+1]|this[N]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},v.prototype.readInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},v.prototype.readBigInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(ee<<24);return(BigInt(re)<<BigInt(32))+BigInt($+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),v.prototype.readBigInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=($<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(re)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee)}),v.prototype.readFloatLE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!0,23,4)},v.prototype.readFloatBE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!1,23,4)},v.prototype.readDoubleLE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!0,52,8)},v.prototype.readDoubleBE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=1,ce=0;for(this[$]=N&255;++ce<ee&&(se*=256);)this[$+ce]=N/se&255;return $+ee},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=ee-1,ce=1;for(this[$+se]=N&255;--se>=0&&(ce*=256);)this[$+se]=N/ce&255;return $+ee},v.prototype.writeUint8=v.prototype.writeUInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,255,0),this[$]=N&255,$+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$+3]=N>>>24,this[$+2]=N>>>16,this[$+1]=N>>>8,this[$]=N&255,$+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4};function T(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(N,$=0){return T(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(N,$=0){return D(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=0,ce=1,st=0;for(this[$]=N&255;++se<ee&&(ce*=256);)N<0&&st===0&&this[$+se-1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=ee-1,ce=1,st=0;for(this[$+se]=N&255;--se>=0&&(ce*=256);)N<0&&st===0&&this[$+se+1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,127,-128),N<0&&(N=255+N+1),this[$]=N&255,$+1},v.prototype.writeInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),this[$]=N&255,this[$+1]=N>>>8,this[$+2]=N>>>16,this[$+3]=N>>>24,$+4},v.prototype.writeInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4},v.prototype.writeBigInt64LE=mt(function(N,$=0){return T(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(N,$=0){return D(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(N,$,ee){return W(this,N,$,!0,ee)},v.prototype.writeFloatBE=function(N,$,ee){return W(this,N,$,!1,ee)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(N,$,ee){return X(this,N,$,!0,ee)},v.prototype.writeDoubleBE=function(N,$,ee){return X(this,N,$,!1,ee)},v.prototype.copy=function(N,$,ee,re){if(!v.isBuffer(N))throw new TypeError("argument should be a Buffer");if(ee||(ee=0),!re&&re!==0&&(re=this.length),$>=N.length&&($=N.length),$||($=0),re>0&&re<ee&&(re=ee),re===ee||N.length===0||this.length===0)return 0;if($<0)throw new RangeError("targetStart out of bounds");if(ee<0||ee>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),N.length-$<re-ee&&(re=N.length-$+ee);let se=re-ee;return this===N&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin($,ee,re):Uint8Array.prototype.set.call(N,this.subarray(ee,re),$),se},v.prototype.fill=function(N,$,ee,re){if(typeof N=="string"){if(typeof $=="string"?(re=$,$=0,ee=this.length):typeof ee=="string"&&(re=ee,ee=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!v.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(N.length===1){let ce=N.charCodeAt(0);(re==="utf8"&&ce<128||re==="latin1")&&(N=ce)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if($<0||this.length<$||this.length<ee)throw new RangeError("Out of range index");if(ee<=$)return this;$=$>>>0,ee=ee===void 0?this.length:ee>>>0,N||(N=0);let se;if(typeof N=="number")for(se=$;se<ee;++se)this[se]=N;else{let ce=v.isBuffer(N)?N:v.from(N,re),st=ce.length;if(st===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(se=0;se<ee-$;++se)this[se+$]=ce[se%st]}return this};var G={};function Y(O,N,$){G[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new G.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new G.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new G.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return r.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var ke=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}});function ln(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ka(e){return function r(n){return arguments.length===0||ln(n)?r:e.apply(this,arguments)}}function Pn(e){return function r(n,h){switch(arguments.length){case 0:return r;case 1:return ln(n)?r:Ka(function(a){return e(n,a)});default:return ln(n)&&ln(h)?r:ln(n)?Ka(function(a){return e(a,h)}):ln(h)?Ka(function(a){return e(n,a)}):e(n,h)}}}function Fb(e,r){switch(e){case 0:return function(){return r.apply(this,arguments)};case 1:return function(n){return r.apply(this,arguments)};case 2:return function(n,h){return r.apply(this,arguments)};case 3:return function(n,h,a){return r.apply(this,arguments)};case 4:return function(n,h,a,d){return r.apply(this,arguments)};case 5:return function(n,h,a,d,c){return r.apply(this,arguments)};case 6:return function(n,h,a,d,c,v){return r.apply(this,arguments)};case 7:return function(n,h,a,d,c,v,w){return r.apply(this,arguments)};case 8:return function(n,h,a,d,c,v,w,m){return r.apply(this,arguments)};case 9:return function(n,h,a,d,c,v,w,m,y){return r.apply(this,arguments)};case 10:return function(n,h,a,d,c,v,w,m,y,g){return r.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function kQ(e,r,n){return function(){for(var h=[],a=0,d=e,c=0,v=!1;c<r.length||a<arguments.length;){var w;c<r.length&&(!ln(r[c])||a>=arguments.length)?w=r[c]:(w=arguments[a],a+=1),h[c]=w,ln(w)?v=!0:d-=1,c+=1}return!v&&d<=0?n.apply(this,h):Fb(Math.max(0,d),kQ(e,h,n))}}var l_e=Pn(function(e,r){return e===1?Ka(r):Fb(e,kQ(e,[],r))}),IQ=l_e;function NR(e){return function r(n,h,a){switch(arguments.length){case 0:return r;case 1:return ln(n)?r:Pn(function(d,c){return e(n,d,c)});case 2:return ln(n)&&ln(h)?r:ln(n)?Pn(function(d,c){return e(d,h,c)}):ln(h)?Pn(function(d,c){return e(n,d,c)}):Ka(function(d){return e(n,h,d)});default:return ln(n)&&ln(h)&&ln(a)?r:ln(n)&&ln(h)?Pn(function(d,c){return e(d,c,a)}):ln(n)&&ln(a)?Pn(function(d,c){return e(d,h,c)}):ln(h)&&ln(a)?Pn(function(d,c){return e(n,d,c)}):ln(n)?Ka(function(d){return e(d,h,a)}):ln(h)?Ka(function(d){return e(n,d,a)}):ln(a)?Ka(function(d){return e(n,h,d)}):e(n,h,a)}}}var CR=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function c_e(e){return e!=null&&typeof e["@@transducer/step"]=="function"}function LR(e,r,n){return function(){if(arguments.length===0)return n();var h=arguments[arguments.length-1];if(!CR(h)){for(var a=0;a<e.length;){if(typeof h[e[a]]=="function")return h[e[a]].apply(h,Array.prototype.slice.call(arguments,0,-1));a+=1}if(c_e(h)){var d=r.apply(null,Array.prototype.slice.call(arguments,0,-1));return d(h)}}return n.apply(this,arguments)}}function d_e(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var O2={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}};function iQ(e){for(var r=[],n;!(n=e.next()).done;)r.push(n.value);return r}function nQ(e,r,n){for(var h=0,a=n.length;h<a;){if(e(r,n[h]))return!0;h+=1}return!1}function p_e(e){var r=String(e).match(/^function (\w*)/);return r==null?"":r[1]}function Rb(e,r){return Object.prototype.hasOwnProperty.call(r,e)}function v_e(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}var oR=typeof Object.is=="function"?Object.is:v_e,aQ=Object.prototype.toString,m_e=function(){return aQ.call(arguments)==="[object Arguments]"?function(e){return aQ.call(e)==="[object Arguments]"}:function(e){return Rb("callee",e)}}(),g_e=m_e,y_e=!{toString:null}.propertyIsEnumerable("toString"),oQ=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],sQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),b_e=function(e,r){for(var n=0;n<e.length;){if(e[n]===r)return!0;n+=1}return!1},w_e=Ka(typeof Object.keys=="function"&&!sQ?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var r,n,h=[],a=sQ&&g_e(e);for(r in e)Rb(r,e)&&(!a||r!=="length")&&(h[h.length]=r);if(y_e)for(n=oQ.length-1;n>=0;)r=oQ[n],Rb(r,e)&&!b_e(h,r)&&(h[h.length]=r),n-=1;return h}),Ld=w_e,__e=Ka(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),fQ=__e;function uQ(e,r,n,h){var a=iQ(e),d=iQ(r);function c(v,w){return DR(v,w,n.slice(),h.slice())}return!nQ(function(v,w){return!nQ(c,w,v)},d,a)}function DR(e,r,n,h){if(oR(e,r))return!0;var a=fQ(e);if(a!==fQ(r))return!1;if(typeof e["fantasy-land/equals"]=="function"||typeof r["fantasy-land/equals"]=="function")return typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](r)&&typeof r["fantasy-land/equals"]=="function"&&r["fantasy-land/equals"](e);if(typeof e.equals=="function"||typeof r.equals=="function")return typeof e.equals=="function"&&e.equals(r)&&typeof r.equals=="function"&&r.equals(e);switch(a){case"Arguments":case"Array":case"Object":if(typeof e.constructor=="function"&&p_e(e.constructor)==="Promise")return e===r;break;case"Boolean":case"Number":case"String":if(!(typeof e==typeof r&&oR(e.valueOf(),r.valueOf())))return!1;break;case"Date":if(!oR(e.valueOf(),r.valueOf()))return!1;break;case"Error":return e.name===r.name&&e.message===r.message;case"RegExp":if(!(e.source===r.source&&e.global===r.global&&e.ignoreCase===r.ignoreCase&&e.multiline===r.multiline&&e.sticky===r.sticky&&e.unicode===r.unicode))return!1;break}for(var d=n.length-1;d>=0;){if(n[d]===e)return h[d]===r;d-=1}switch(a){case"Map":return e.size!==r.size?!1:uQ(e.entries(),r.entries(),n.concat([e]),h.concat([r]));case"Set":return e.size!==r.size?!1:uQ(e.values(),r.values(),n.concat([e]),h.concat([r]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=Ld(e);if(c.length!==Ld(r).length)return!1;var v=n.concat([e]),w=h.concat([r]);for(d=c.length-1;d>=0;){var m=c[d];if(!(Rb(m,r)&&DR(r[m],e[m],v,w)))return!1;d-=1}return!0}var M_e=Pn(function(e,r){return DR(e,r,[],[])}),BQ=M_e;function S_e(e,r,n){var h,a;if(typeof e.indexOf=="function")switch(typeof r){case"number":if(r===0){for(h=1/r;n<e.length;){if(a=e[n],a===0&&1/a===h)return n;n+=1}return-1}else if(r!==r){for(;n<e.length;){if(a=e[n],typeof a=="number"&&a!==a)return n;n+=1}return-1}return e.indexOf(r,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(r,n);case"object":if(r===null)return e.indexOf(r,n)}for(;n<e.length;){if(BQ(e[n],r))return n;n+=1}return-1}function E_e(e,r){return S_e(r,e,0)>=0}function I2(e,r){for(var n=0,h=r.length,a=Array(h);n<h;)a[n]=e(r[n]),n+=1;return a}function sR(e){var r=e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+r.replace(/"/g,'\\"')+'"'}var E2=function(e){return(e<10?"0":"")+e},A_e=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+E2(e.getUTCMonth()+1)+"-"+E2(e.getUTCDate())+"T"+E2(e.getUTCHours())+":"+E2(e.getUTCMinutes())+":"+E2(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},R_e=A_e;function x_e(e){return function(){return!e.apply(this,arguments)}}function OQ(e,r,n){for(var h=0,a=n.length;h<a;)r=e(r,n[h]),h+=1;return r}function T_e(e,r){for(var n=0,h=r.length,a=[];n<h;)e(r[n])&&(a[a.length]=r[n]),n+=1;return a}function k_e(e){return Object.prototype.toString.call(e)==="[object Object]"}var I_e=function(){function e(r,n){this.xf=n,this.f=r}return e.prototype["@@transducer/init"]=O2.init,e.prototype["@@transducer/result"]=O2.result,e.prototype["@@transducer/step"]=function(r,n){return this.f(n)?this.xf["@@transducer/step"](r,n):r},e}();function B_e(e){return function(r){return new I_e(e,r)}}var O_e=Pn(LR(["fantasy-land/filter","filter"],B_e,function(e,r){return k_e(r)?OQ(function(n,h){return e(r[h])&&(n[h]=r[h]),n},{},Ld(r)):T_e(e,r)})),P_e=O_e,N_e=Pn(function(e,r){return P_e(x_e(e),r)}),C_e=N_e;function PQ(e,r){var n=function(d){var c=r.concat([e]);return E_e(d,c)?"<Circular>":PQ(d,c)},h=function(d,c){return I2(function(v){return sR(v)+": "+n(d[v])},c.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+I2(n,e).join(", ")+"))";case"[object Array]":return"["+I2(n,e).concat(h(e,C_e(function(d){return/^\d+$/.test(d)},Ld(e)))).join(", ")+"]";case"[object Boolean]":return typeof e=="object"?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):sR(R_e(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return typeof e=="object"?"new Number("+n(e.valueOf())+")":1/e===-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return typeof e=="object"?"new String("+n(e.valueOf())+")":sR(e);case"[object Undefined]":return"undefined";default:if(typeof e.toString=="function"){var a=e.toString();if(a!=="[object Object]")return a}return"{"+h(e,Ld(e)).join(", ")+"}"}}var L_e=Ka(function(e){return PQ(e,[])}),hQ=L_e,D_e=Pn(function(e,r){if(e===r)return r;function n(v,w){if(v>w!=w>v)return w>v?w:v}var h=n(e,r);if(h!==void 0)return h;var a=n(typeof e,typeof r);if(a!==void 0)return a===typeof e?e:r;var d=hQ(e),c=n(d,hQ(r));return c!==void 0&&c===d?e:r}),$_e=D_e,U_e=function(){function e(r,n){this.xf=n,this.f=r}return e.prototype["@@transducer/init"]=O2.init,e.prototype["@@transducer/result"]=O2.result,e.prototype["@@transducer/step"]=function(r,n){return this.xf["@@transducer/step"](r,this.f(n))},e}(),q_e=function(e){return function(r){return new U_e(e,r)}},j_e=q_e,F_e=Pn(LR(["fantasy-land/map","map"],j_e,function(e,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return IQ(r.length,function(){return e.call(this,r.apply(this,arguments))});case"[object Object]":return OQ(function(n,h){return n[h]=e(r[h]),n},{},Ld(r));default:return I2(e,r)}})),z_e=F_e,NQ=Number.isInteger||function(e){return e<<0===e};function CQ(e){return Object.prototype.toString.call(e)==="[object String]"}var H_e=Pn(function(e,r){var n=e<0?r.length+e:e;return CQ(r)?r.charAt(n):r[n]}),LQ=H_e,K_e=Pn(function(e,r){if(r!=null)return NQ(e)?LQ(e,r):r[e]}),zb=K_e,Z_e=Pn(function(e,r){return z_e(zb(e),r)}),W_e=Z_e,G_e=Ka(function(e){return CR(e)?!0:!e||typeof e!="object"||CQ(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),V_e=G_e,lQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function Y_e(e,r,n){return function(h,a,d){if(V_e(d))return e(h,a,d);if(d==null)return a;if(typeof d["fantasy-land/reduce"]=="function")return r(h,a,d,"fantasy-land/reduce");if(d[lQ]!=null)return n(h,a,d[lQ]());if(typeof d.next=="function")return n(h,a,d);if(typeof d.reduce=="function")return r(h,a,d,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function J_e(e,r,n){for(var h=0,a=n.length;h<a;){if(r=e["@@transducer/step"](r,n[h]),r&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}h+=1}return e["@@transducer/result"](r)}var X_e=Pn(function(e,r){return Fb(e.length,function(){return e.apply(r,arguments)})}),Q_e=X_e;function eMe(e,r,n){for(var h=n.next();!h.done;){if(r=e["@@transducer/step"](r,h.value),r&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}h=n.next()}return e["@@transducer/result"](r)}function tMe(e,r,n,h){return e["@@transducer/result"](n[h](Q_e(e["@@transducer/step"],e),r))}var rMe=Y_e(J_e,tMe,eMe),iMe=rMe,nMe=function(){function e(r){this.f=r}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(r){return r},e.prototype["@@transducer/step"]=function(r,n){return this.f(r,n)},e}();function aMe(e){return new nMe(e)}var oMe=NR(function(e,r,n){return iMe(typeof e=="function"?aMe(e):e,r,n)}),DQ=oMe;function sMe(e,r){return function(){return r.call(this,e.apply(this,arguments))}}function $Q(e,r){return function(){var n=arguments.length;if(n===0)return r();var h=arguments[n-1];return CR(h)||typeof h[e]!="function"?r.apply(this,arguments):h[e].apply(h,Array.prototype.slice.call(arguments,0,n-1))}}var fMe=NR($Q("slice",function(e,r,n){return Array.prototype.slice.call(n,e,r)})),uMe=fMe,hMe=Ka($Q("tail",uMe(1,1/0))),lMe=hMe;function UQ(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Fb(arguments[0].length,DQ(sMe,arguments[0],lMe(arguments)))}var cMe=Pn(function(e,r){return IQ(DQ($_e,0,W_e("length",r)),function(){var n=arguments,h=this;return e.apply(h,I2(function(a){return a.apply(h,n)},r))})}),dMe=cMe,pMe=Pn(function(e,r){return r==null||r!==r?e:r}),pR=pMe,vMe=function(){function e(r,n){this.xf=n,this.f=r,this.found=!1}return e.prototype["@@transducer/init"]=O2.init,e.prototype["@@transducer/result"]=function(r){return this.found||(r=this.xf["@@transducer/step"](r,void 0)),this.xf["@@transducer/result"](r)},e.prototype["@@transducer/step"]=function(r,n){return this.f(n)&&(this.found=!0,r=d_e(this.xf["@@transducer/step"](r,n))),r},e}();function mMe(e){return function(r){return new vMe(e,r)}}var gMe=Pn(LR(["find"],mMe,function(e,r){for(var n=0,h=r.length;n<h;){if(e(r[n]))return r[n];n+=1}})),yMe=gMe,bMe=Ka(function(e){return dMe(function(){return Array.prototype.slice.call(arguments,0)},e)}),wMe=bMe,_Me=Pn(function(e,r){return e.map(function(n){for(var h=r,a=0,d;a<n.length;){if(h==null)return;d=n[a],h=NQ(d)?LQ(d,h):h[d],a+=1}return h})}),MMe=_Me,SMe=Pn(function(e,r){return MMe([e],r)[0]}),qQ=SMe,EMe=NR(function(e,r,n){return BQ(e,zb(r,n))}),AMe=EMe,xb=class extends Error{name="InvalidSchedulerLocation"},RMe=class extends Error{name="SchedulerTagNotFound"},xMe=class extends Error{name="TransactionNotFound"},TMe="Url",kMe="Time-To-Live",IMe="Scheduler",vR=e=>UQ(pR([]),yMe(AMe(e,"name")),pR({}),zb("value")),jQ=e=>UQ(r=>{if(!r)throw new xMe(e);return r},zb("tags"),pR([]));function FQ({fetch:e,GRAPHQL_URL:r}){return async({query:n,variables:h})=>e(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:h})}).then(a=>a.json())}function BMe({fetch:e,GRAPHQL_URL:r}){let n=FQ({fetch:e,GRAPHQL_URL:r}),h=zQ({fetch:e,GRAPHQL_URL:r}),a=`
138
+ ${JSON.stringify(St.from(n))},${JSON.stringify(St.from(h))},${d} => ${JSON.stringify(v)}`;return DX(c,w)}oi.debug=DX});var gb=Ht(Po=>{"use strict";Be();Pe();Oe();var h9e=Po&&Po.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),l9e=Po&&Po.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),c9e=Po&&Po.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&h9e(r,e,n);return l9e(r,e),r},d9e=Po&&Po.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Po,"__esModule",{value:!0});Po.Tag=void 0;var Xn=c9e(Ju()),p9e=d9e(PX()),v9e=ZA(),mb=class{get(r,n){if(!Object.getOwnPropertyNames(this).includes(r))throw new Error(`Field "${r}" is not a property of the Arweave Transaction class.`);if(this[r]instanceof Uint8Array)return n&&n.decode&&n.string?Xn.bufferToString(this[r]):n&&n.decode&&!n.string?this[r]:Xn.bufferTob64Url(this[r]);if(this[r]instanceof Array){if(n?.decode!==void 0||n?.string!==void 0)throw r==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[r]}return n&&n.decode==!0?n&&n.string?Xn.b64UrlToString(this[r]):Xn.b64UrlToBuffer(this[r]):this[r]}},w2=class extends mb{name;value;constructor(r,n,h=!1){super(),this.name=r,this.value=n}};Po.Tag=w2;var WA=class extends mb{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(r={}){super(),Object.assign(this,r),typeof this.data=="string"&&(this.data=Xn.b64UrlToBuffer(this.data)),r.tags&&(this.tags=r.tags.map(n=>new w2(n.name,n.value)))}addTag(r,n){this.tags.push(new w2(Xn.stringToB64Url(r),Xn.stringToB64Url(n)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:Xn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(r){this.owner=r}setSignature({id:r,owner:n,reward:h,tags:a,signature:d}){this.id=r,this.owner=n,h&&(this.reward=h),a&&(this.tags=a),this.signature=d}async prepareChunks(r){!this.chunks&&r.byteLength>0&&(this.chunks=await(0,v9e.generateTransactionChunks)(r),this.data_root=Xn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&r.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(r,n){if(!this.chunks)throw new Error("Chunks have not been prepared");let h=this.chunks.proofs[r],a=this.chunks.chunks[r];return{data_root:this.data_root,data_size:this.data_size,data_path:Xn.bufferTob64Url(h.proof),offset:h.offset.toString(),chunk:Xn.bufferTob64Url(n.slice(a.minByteRange,a.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let r=this.tags.reduce((h,a)=>Xn.concatBuffers([h,a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]),new Uint8Array);return Xn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),Xn.stringToBuffer(this.quantity),Xn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r]);case 2:this.data_root||await this.prepareChunks(this.data);let n=this.tags.map(h=>[h.get("name",{decode:!0,string:!1}),h.get("value",{decode:!0,string:!1})]);return await(0,p9e.default)([Xn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),Xn.stringToBuffer(this.quantity),Xn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),n,Xn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};Po.default=WA});var jX=Ht(ks=>{"use strict";Be();Pe();Oe();var m9e=ks&&ks.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),g9e=ks&&ks.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),y9e=ks&&ks.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&m9e(r,e,n);return g9e(r,e),r},b9e=ks&&ks.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ks,"__esModule",{value:!0});ks.TransactionUploader=void 0;var $X=b9e(gb()),w9e=y9e(Ju()),GA=v2(),_9e=ZA(),UX=1,M9e=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],qX=1e3*40,VA=class e{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(r,n){if(this.api=r,!n.id)throw new Error("Transaction is not signed");if(!n.chunks)throw new Error("Transaction chunks not prepared");this.data=n.data,this.transaction=new $X.default(Object.assign({},n,{data:new Uint8Array(0)}))}async uploadChunk(r){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let n=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+qX-Date.now(),qX);if(n>0&&(n=n-n*Math.random()*.3,await new Promise(c=>setTimeout(c,n))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}r&&(this.chunkIndex=r);let h=this.transaction.getChunk(r||this.chunkIndex,this.data);if(!await(0,_9e.validatePath)(this.transaction.chunks.data_root,parseInt(h.offset),0,parseInt(h.data_size),w9e.b64UrlToBuffer(h.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let d=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(c=>(console.error(c.message),{status:-1,data:{error:c.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=d.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,GA.getError)(d),M9e.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(r,n,h){if(!n||typeof n.chunkIndex!="number"||typeof n.transaction!="object")throw new Error("Serialized object does not match expected format.");var a=new $X.default(n.transaction);a.chunks||await a.prepareChunks(h);let d=new e(r,a);if(d.chunkIndex=n.chunkIndex,d.lastRequestTimeEnd=n.lastRequestTimeEnd,d.lastResponseError=n.lastResponseError,d.lastResponseStatus=n.lastResponseStatus,d.txPosted=n.txPosted,d.data=h,d.transaction.data_root!==n.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return d}static async fromTransactionId(r,n){let h=await r.get(`tx/${n}`);if(h.status!==200)throw new Error(`Tx ${n} not found: ${h.status}`);let a=h.data;return a.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:a}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=UX){this.transaction.data=this.data;let h=await this.api.post("tx",this.transaction).catch(a=>(console.error(a),{status:-1,data:{error:a.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.transaction.data=new Uint8Array(0),h.status>=200&&h.status<300){this.txPosted=!0,this.chunkIndex=UX;return}throw this.lastResponseError=(0,GA.getError)(h),new Error(`Unable to upload transaction: ${h.status}, ${this.lastResponseError}`)}let n=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=n.status,!(n.status>=200&&n.status<300))throw this.lastResponseError=(0,GA.getError)(n),new Error(`Unable to upload transaction: ${n.status}, ${this.lastResponseError}`);this.txPosted=!0}};ks.TransactionUploader=VA});var yb=Ht((aKe,FX)=>{"use strict";Be();Pe();Oe();FX.exports={}});var HX=Ht(Sf=>{"use strict";Be();Pe();Oe();var S9e=Sf&&Sf.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),E9e=Sf&&Sf.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),A9e=Sf&&Sf.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&S9e(r,e,n);return E9e(r,e),r},zX=Sf&&Sf.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Sf,"__esModule",{value:!0});var YA=zX(v2()),Xu=zX(gb()),_2=A9e(Ju()),JA=jX();yb();var XA=class{api;crypto;chunks;constructor(r,n,h){this.api=r,this.crypto=n,this.chunks=h}async getTransactionAnchor(){let r=await this.api.get("tx_anchor");if(!r.data.match(/^[a-z0-9_-]{43,}/i)||!r.ok)throw new Error(`Could not getTransactionAnchor. Received: ${r.data}. Status: ${r.status}, ${r.statusText}`);return r.data}async getPrice(r,n){let h=n?`price/${r}/${n}`:`price/${r}`,a=await this.api.get(h);if(!/^\d+$/.test(a.data)||!a.ok)throw new Error(`Could not getPrice. Received: ${a.data}. Status: ${a.status}, ${a.statusText}`);return a.data}async get(r){let n=await this.api.get(`tx/${r}`);if(n.status==200){let h=parseInt(n.data.data_size);if(n.data.format>=2&&h>0&&h<=1024*1024*12){let a=await this.getData(r);return new Xu.default({...n.data,data:a})}return new Xu.default({...n.data,format:n.data.format||1})}throw n.status==404?new YA.default("TX_NOT_FOUND"):n.status==410?new YA.default("TX_FAILED"):new YA.default("TX_INVALID")}fromRaw(r){return new Xu.default(r)}async search(r,n){return this.api.post("arql",{op:"equals",expr1:r,expr2:n}).then(h=>h.data?h.data:[])}getStatus(r){return this.api.get(`tx/${r}/status`).then(n=>n.status==200?{status:200,confirmed:n.data}:{status:n.status,confirmed:null})}async getData(r,n){let h;try{h=await this.chunks.downloadChunkedData(r)}catch(a){console.error(`Error while trying to download chunked data for ${r}`),console.error(a)}if(!h){console.warn(`Falling back to gateway cache for ${r}`);try{let{data:a,ok:d,status:c,statusText:v}=await this.api.get(`/${r}`,{responseType:"arraybuffer"});if(!d)throw new Error("Bad http status code",{cause:{status:c,statusText:v}});h=a}catch(a){console.error(`Error while trying to download contiguous data from gateway cache for ${r}`),console.error(a)}}if(!h)throw new Error(`${r} data was not found!`);return n&&n.decode&&!n.string?h:n&&n.decode&&n.string?_2.bufferToString(h):_2.bufferTob64Url(h)}async sign(r,n,h){let d=typeof n=="object"&&(v=>{let w=!0;return["n","e","d","p","q","dp","dq","qi"].map(m=>!(m in v)&&(w=!1)),w})(n),c=typeof arweaveWallet=="object";if(!d&&!c)throw new Error("No valid JWK or external wallet found to sign transaction.");if(d){r.setOwner(n.n);let v=await r.getSignatureData(),w=await this.crypto.sign(n,v,h),m=await this.crypto.hash(w);r.setSignature({id:_2.bufferTob64Url(m),owner:n.n,signature:_2.bufferTob64Url(w)})}else if(c){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let v=await arweaveWallet.sign(r,h);r.setSignature({id:v.id,owner:v.owner,reward:v.reward,tags:v.tags,signature:v.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(r){let n=await r.getSignatureData(),h=r.get("signature",{decode:!0,string:!1}),a=_2.bufferTob64Url(await this.crypto.hash(h));if(r.id!==a)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(r.owner,n,h)}async post(r){if(typeof r=="string"?r=new Xu.default(JSON.parse(r)):typeof r.readInt32BE=="function"?r=new Xu.default(JSON.parse(r.toString())):typeof r=="object"&&!(r instanceof Xu.default)&&(r=new Xu.default(r)),!(r instanceof Xu.default))throw new Error("Must be Transaction object");r.chunks||await r.prepareChunks(r.data);let n=await this.getUploader(r,r.data);try{for(;!n.isComplete;)await n.uploadChunk()}catch(h){if(n.lastResponseStatus>0)return{status:n.lastResponseStatus,statusText:n.lastResponseError,data:{error:n.lastResponseError}};throw h}return{status:200,statusText:"OK",data:{}}}async getUploader(r,n){let h;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),r instanceof Xu.default){if(n||(n=r.data),!(n instanceof Uint8Array))throw new Error("Data format is invalid");r.chunks||await r.prepareChunks(n),h=new JA.TransactionUploader(this.api,r),(!h.data||h.data.length===0)&&(h.data=n)}else{if(typeof r=="string"&&(r=await JA.TransactionUploader.fromTransactionId(this.api,r)),!n||!(n instanceof Uint8Array))throw new Error("Must provide data when resuming upload");h=await JA.TransactionUploader.fromSerialized(this.api,r,n)}return h}async*upload(r,n){let h=await this.getUploader(r,n);for(;!h.isComplete;)await h.uploadChunk(),yield h;return h}};Sf.default=XA});var ZX=Ht(Qu=>{"use strict";Be();Pe();Oe();var R9e=Qu&&Qu.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),x9e=Qu&&Qu.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),T9e=Qu&&Qu.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&R9e(r,e,n);return x9e(r,e),r};Object.defineProperty(Qu,"__esModule",{value:!0});var KX=T9e(Ju());yb();var QA=class{api;crypto;constructor(r,n){this.api=r,this.crypto=n}getBalance(r){return this.api.get(`wallet/${r}/balance`).then(n=>n.data)}getLastTransactionID(r){return this.api.get(`wallet/${r}/last_tx`).then(n=>n.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(r){return!r||r==="use_wallet"?this.getAddress():this.getAddress(r)}async getAddress(r){if(!r||r==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(r.n)}async ownerToAddress(r){return KX.bufferTob64Url(await this.crypto.hash(KX.b64UrlToBuffer(r)))}};Qu.default=QA});var GX=Ht(Ef=>{"use strict";Be();Pe();Oe();var k9e=Ef&&Ef.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),I9e=Ef&&Ef.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),B9e=Ef&&Ef.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&k9e(r,e,n);return I9e(r,e),r};Object.defineProperty(Ef,"__esModule",{value:!0});Ef.SiloResource=void 0;var WX=B9e(Ju()),eR=class{api;crypto;transactions;constructor(r,n,h){this.api=r,this.crypto=n,this.transactions=h}async get(r){if(!r)throw new Error("No Silo URI specified");let n=await this.parseUri(r),h=await this.transactions.search("Silo-Name",n.getAccessKey());if(h.length==0)throw new Error(`No data could be found for the Silo URI: ${r}`);let a=await this.transactions.get(h[0]);if(!a)throw new Error(`No data could be found for the Silo URI: ${r}`);let d=a.get("data",{decode:!0,string:!1});return this.crypto.decrypt(d,n.getEncryptionKey())}async readTransactionData(r,n){if(!n)throw new Error("No Silo URI specified");let h=await this.parseUri(n),a=r.get("data",{decode:!0,string:!1});return this.crypto.decrypt(a,h.getEncryptionKey())}async parseUri(r){let n=r.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!n)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let h=n[1],a=Math.pow(2,parseInt(n[2])),d=await this.hash(WX.stringToBuffer(h),a),c=WX.bufferTob64(d.slice(0,15)),v=await this.hash(d.slice(16,31),1);return new bb(r,c,v)}async hash(r,n){let h=await this.crypto.hash(r);for(let a=0;a<n-1;a++)h=await this.crypto.hash(h);return h}};Ef.default=eR;var bb=class{uri;accessKey;encryptionKey;constructor(r,n,h){this.uri=r,this.accessKey=n,this.encryptionKey=h}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Ef.SiloResource=bb});var YX=Ht(eh=>{"use strict";Be();Pe();Oe();var O9e=eh&&eh.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),P9e=eh&&eh.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),N9e=eh&&eh.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&O9e(r,e,n);return P9e(r,e),r};Object.defineProperty(eh,"__esModule",{value:!0});var VX=v2(),C9e=N9e(Ju()),tR=class{api;constructor(r){this.api=r}async getTransactionOffset(r){let n=await this.api.get(`tx/${r}/offset`);if(n.status===200)return n.data;throw new Error(`Unable to get transaction offset: ${(0,VX.getError)(n)}`)}async getChunk(r){let n=await this.api.get(`chunk/${r}`);if(n.status===200)return n.data;throw new Error(`Unable to get chunk: ${(0,VX.getError)(n)}`)}async getChunkData(r){let n=await this.getChunk(r);return C9e.b64UrlToBuffer(n.chunk)}firstChunkOffset(r){return parseInt(r.offset)-parseInt(r.size)+1}async downloadChunkedData(r){let n=await this.getTransactionOffset(r),h=parseInt(n.size),d=parseInt(n.offset)-h+1,c=new Uint8Array(h),v=0;for(;v<h;){this.api.config.logging&&console.log(`[chunk] ${v}/${h}`);let w;try{w=await this.getChunkData(d+v)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${d+v}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(w)c.set(w,v),v+=w.length;else throw new Error(`Couldn't complete data download at ${v}/${h}`)}return c}};eh.default=tR});var XX=Ht(M2=>{"use strict";Be();Pe();Oe();var L9e=M2&&M2.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(M2,"__esModule",{value:!0});var JX=L9e(v2());yb();var rR=class e{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(r,n){this.api=r,this.network=n}async get(r){let n=await this.api.get(`${e.HASH_ENDPOINT}${r}`);if(n.status===200)return n.data;throw n.status===404?new JX.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getByHeight(r){let n=await this.api.get(`${e.HEIGHT_ENDPOINT}${r}`);if(n.status===200)return n.data;throw n.status===404?new JX.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${n}`)}async getCurrent(){let{current:r}=await this.network.getInfo();return await this.get(r)}};M2.default=rR});var db=Ht(Af=>{"use strict";Be();Pe();Oe();var D9e=Af&&Af.__createBinding||(Object.create?function(e,r,n,h){h===void 0&&(h=n);var a=Object.getOwnPropertyDescriptor(r,n);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,h,a)}:function(e,r,n,h){h===void 0&&(h=n),e[h]=r[n]}),$9e=Af&&Af.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),U9e=Af&&Af.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&D9e(r,e,n);return $9e(r,e),r},hu=Af&&Af.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Af,"__esModule",{value:!0});var q9e=hu(Mq()),j9e=hu(Sq()),F9e=hu(yX()),z9e=hu(bX()),H9e=hu(HX()),K9e=hu(ZX()),QX=hu(gb()),S2=U9e(Ju()),Z9e=hu(GX()),W9e=hu(YX()),G9e=hu(XX()),iR=class e{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new F9e.default;static utils=S2;constructor(r){this.api=new j9e.default(r),this.wallets=new K9e.default(this.api,e.crypto),this.chunks=new W9e.default(this.api),this.transactions=new H9e.default(this.api,e.crypto,this.chunks),this.silo=new Z9e.default(this.api,this.crypto,this.transactions),this.network=new z9e.default(this.api),this.blocks=new G9e.default(this.api,this.network),this.ar=new q9e.default}get crypto(){return e.crypto}get utils(){return e.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(r,n){let h={};if(Object.assign(h,r),!r.data&&!(r.target&&r.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(r.owner==null&&n&&n!=="use_wallet"&&(h.owner=n.n),r.last_tx==null&&(h.last_tx=await this.transactions.getTransactionAnchor()),typeof r.data=="string"&&(r.data=S2.stringToBuffer(r.data)),r.data instanceof ArrayBuffer&&(r.data=new Uint8Array(r.data)),r.data&&!(r.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(r.reward==null){let d=r.data?r.data.byteLength:0;h.reward=await this.transactions.getPrice(d,h.target)}h.data_root="",h.data_size=r.data?r.data.byteLength.toString():"0",h.data=r.data||new Uint8Array(0);let a=new QX.default(h);return await a.getSignatureData(),a}async createSiloTransaction(r,n,h){let a={};if(Object.assign(a,r),!r.data)throw new Error("Silo transactions must have a 'data' value");if(!h)throw new Error("No Silo URI specified.");if(r.target||r.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(r.owner==null){if(!n||!n.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");a.owner=n.n}r.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor());let d=await this.silo.parseUri(h);if(typeof r.data=="string"){let v=await this.crypto.encrypt(S2.stringToBuffer(r.data),d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=S2.bufferTob64Url(v)}if(r.data instanceof Uint8Array){let v=await this.crypto.encrypt(r.data,d.getEncryptionKey());a.reward=await this.transactions.getPrice(v.byteLength),a.data=S2.bufferTob64Url(v)}let c=new QX.default(a);return c.addTag("Silo-Name",d.getAccessKey()),c.addTag("Silo-Version","0.1.0"),c}arql(r){return this.api.post("/arql",r).then(n=>n.data||[])}};Af.default=iR});var tQ=Ht((aR,eQ)=>{"use strict";Be();Pe();Oe();var V9e=aR&&aR.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},nR=V9e(db());nR.default.init=function(e={}){return new nR.default(e)};eQ.exports=nR.default});var xte=Ht((CQe,Rte)=>{"use strict";Be();Pe();Oe();var ETe=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);Rte.exports=e=>!ETe.has(e&&e.code)});var Lte=Ht((ret,xx)=>{"use strict";Be();Pe();Oe();var CTe=Object.prototype.hasOwnProperty,Wa="~";function lv(){}Object.create&&(lv.prototype=Object.create(null),new lv().__proto__||(Wa=!1));function LTe(e,r,n){this.fn=e,this.context=r,this.once=n||!1}function Cte(e,r,n,h,a){if(typeof n!="function")throw new TypeError("The listener must be a function");var d=new LTe(n,h||e,a),c=Wa?Wa+r:r;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],d]:e._events[c].push(d):(e._events[c]=d,e._eventsCount++),e}function m3(e,r){--e._eventsCount===0?e._events=new lv:delete e._events[r]}function Ca(){this._events=new lv,this._eventsCount=0}Ca.prototype.eventNames=function(){var r=[],n,h;if(this._eventsCount===0)return r;for(h in n=this._events)CTe.call(n,h)&&r.push(Wa?h.slice(1):h);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(n)):r};Ca.prototype.listeners=function(r){var n=Wa?Wa+r:r,h=this._events[n];if(!h)return[];if(h.fn)return[h.fn];for(var a=0,d=h.length,c=new Array(d);a<d;a++)c[a]=h[a].fn;return c};Ca.prototype.listenerCount=function(r){var n=Wa?Wa+r:r,h=this._events[n];return h?h.fn?1:h.length:0};Ca.prototype.emit=function(r,n,h,a,d,c){var v=Wa?Wa+r:r;if(!this._events[v])return!1;var w=this._events[v],m=arguments.length,y,g;if(w.fn){switch(w.once&&this.removeListener(r,w.fn,void 0,!0),m){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,n),!0;case 3:return w.fn.call(w.context,n,h),!0;case 4:return w.fn.call(w.context,n,h,a),!0;case 5:return w.fn.call(w.context,n,h,a,d),!0;case 6:return w.fn.call(w.context,n,h,a,d,c),!0}for(g=1,y=new Array(m-1);g<m;g++)y[g-1]=arguments[g];w.fn.apply(w.context,y)}else{var S=w.length,R;for(g=0;g<S;g++)switch(w[g].once&&this.removeListener(r,w[g].fn,void 0,!0),m){case 1:w[g].fn.call(w[g].context);break;case 2:w[g].fn.call(w[g].context,n);break;case 3:w[g].fn.call(w[g].context,n,h);break;case 4:w[g].fn.call(w[g].context,n,h,a);break;default:if(!y)for(R=1,y=new Array(m-1);R<m;R++)y[R-1]=arguments[R];w[g].fn.apply(w[g].context,y)}}return!0};Ca.prototype.on=function(r,n,h){return Cte(this,r,n,h,!1)};Ca.prototype.once=function(r,n,h){return Cte(this,r,n,h,!0)};Ca.prototype.removeListener=function(r,n,h,a){var d=Wa?Wa+r:r;if(!this._events[d])return this;if(!n)return m3(this,d),this;var c=this._events[d];if(c.fn)c.fn===n&&(!a||c.once)&&(!h||c.context===h)&&m3(this,d);else{for(var v=0,w=[],m=c.length;v<m;v++)(c[v].fn!==n||a&&!c[v].once||h&&c[v].context!==h)&&w.push(c[v]);w.length?this._events[d]=w.length===1?w[0]:w:m3(this,d)}return this};Ca.prototype.removeAllListeners=function(r){var n;return r?(n=Wa?Wa+r:r,this._events[n]&&m3(this,n)):(this._events=new lv,this._eventsCount=0),this};Ca.prototype.off=Ca.prototype.removeListener;Ca.prototype.addListener=Ca.prototype.on;Ca.prefixed=Wa;Ca.EventEmitter=Ca;typeof xx<"u"&&(xx.exports=Ca)});Be();Pe();Oe();var Ute=fc(O8(),1);Be();Pe();Oe();Be();Pe();Oe();var cie=["gateway","gateways","prescribedObservers","record","auction","balance","epoch","priceForInteraction"],die=["delegateStake","decreaseDelegateStake","joinNetwork","increaseOperatorStake","decreaseOperatorStake","updateGatewaySettings","saveObservations","extendRecord","buyRecord","increaseUndernameCount","transfer"],ake=[...cie,...die],oke={GATEWAY:"gateway",GATEWAYS:"gateways",PRESCRIBED_OBSERVERS:"prescribedObservers",DELEGATE_STAKE:"delegateStake",DECREASE_DELEGATE_STAKE:"decreaseDelegateStake",JOIN_NETWORK:"joinNetwork",INCREASE_OPERATOR_STAKE:"increaseOperatorStake",DECREASE_OPERATOR_STAKE:"decreaseOperatorStake",UPDATE_GATEWAY_SETTINGS:"updateGatewaySettings",SAVE_OBSERVATIONS:"saveObservations",EXTEND_RECORD:"extendRecord",INCREASE_UNDERNAME_COUNT:"increaseUndernameCount",RECORD:"record",AUCTION:"auction",TRANSFER:"transfer",BALANCE:"balance",PRICE_FOR_INTERACTION:"priceForInteraction",EPOCH:"epoch",BUY_RECORD:"buyRecord"},pie=(n=>(n.IO="IO",n.MIO="mIO",n))(pie||{}),ske={TRANSFER:"transfer",SET_CONTROLLER:"setController",REMOVE_CONTROLLER:"removeController",SET_NAME:"setName",SET_TICKER:"setTicker",SET_RECORD:"setRecord",REMOVE_RECORD:"removeRecord",BALANCE:"balance",EVOLVE:"evolve"};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var iB=new RegExp("^[a-zA-Z0-9_-]{43}$"),vke=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),mke=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),gke=gt.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",yke="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",vie="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",bke=vie,lc="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",P8=1e6,nB="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",aB="3OlGzE5mrsN2GsxCYM0Tae1KzWepGOr5a94deOWmApM",oB="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var N8=class e{constructor(r){this.positiveFiniteInteger=r;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${r}`)}[Symbol.toPrimitive](r){return r==="string"&&this.toString(),this.positiveFiniteInteger}plus(r){return new e(this.positiveFiniteInteger+r.positiveFiniteInteger)}minus(r){return new e(this.positiveFiniteInteger-r.positiveFiniteInteger)}isGreaterThan(r){return this.positiveFiniteInteger>r.positiveFiniteInteger}isGreaterThanOrEqualTo(r){return this.positiveFiniteInteger>=r.positiveFiniteInteger}isLessThan(r){return this.positiveFiniteInteger<r.positiveFiniteInteger}isLessThanOrEqualTo(r){return this.positiveFiniteInteger<=r.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(r){return this.positiveFiniteInteger===r.positiveFiniteInteger}},C8=class{value;constructor(r){if(!Number.isFinite(r)||r<0)throw new Error("IOToken must be a non-negative finite number");this.value=+r.toFixed(6)}valueOf(){return this.value}toMIO(){return new L8(Math.floor(this.value*P8))}toString(){return`${this.value}`}},L8=class e extends N8{constructor(r){super(r)}multiply(r){let n=Math.floor(this.valueOf()*r.valueOf());return new e(n)}divide(r){if(r.valueOf()===0)throw new Error("Cannot divide by zero");let n=Math.floor(this.valueOf()/r.valueOf());return new e(n)}plus(r){let n=super.plus(r);return new e(n.valueOf())}minus(r){let n=super.minus(r);return new e(n.valueOf())}toIO(){return new C8(this.valueOf()/P8)}};Be();Pe();Oe();Be();Pe();Oe();var sB=e=>iB.test(e);function Ike(e){return e!==void 0&&!isNaN(parseInt(e.toString()))}function cc(e){return"process"in e}function dc(e){return"processId"in e&&typeof e.processId=="string"&&sB(e.processId)===!0}function Lke(e){return e.type==="lease"&&e.endTimestamp!==void 0}Be();Pe();Oe();Be();Pe();Oe();var zs=class extends Error{constructor(r){super(r),this.name=this.constructor.name}},fB=class extends zs{},uB=class extends zs{},hB=class extends zs{constructor(r,n){super(`Failed request: ${r}: ${n}`)}},lB=class extends zs{},vm=class extends zs{},cB=class extends zs{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},gh=class extends zs{constructor(){super("Invalid contract configuration")}},dB=class extends zs{constructor(){super("Invalid process configuration")}},pB=class extends zs{};Be();Pe();Oe();var rf=fc(bq(),1);Be();Pe();Oe();var Wc="2.0.0-alpha.7";var Gc=class e{logger;silent=!1;static default=new e;constructor({level:r="info"}={}){if(r==="none"){this.silent=!0;return}this.logger=(0,rf.createLogger)({level:r,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:Wc},format:rf.format.combine(rf.format.timestamp(),rf.format.json())}),typeof window<"u"?this.logger=console:this.logger.add(new rf.transports.Console({format:rf.format.combine(rf.format.timestamp(),rf.format.json())}))}info(r,...n){this.silent||this.logger.info(r,...n)}warn(r,...n){this.silent||this.logger.warn(r,...n)}error(r,...n){this.silent||this.logger.error(r,...n)}debug(r,...n){this.silent||this.logger.debug(r,...n)}setLogLevel(r){"silent"in this.logger&&(this.logger.silent=r==="none"),"level"in this.logger&&(this.logger.level=r)}};Be();Pe();Oe();var yp=class{static init({signer:r,...n}){if(cc(n)||dc(n))return r?new Xw({signer:r,...n}):new u6(n);throw new gh}},u6=class{process;constructor(r){if(cc(r))this.process=r.process;else if(dc(r))this.process=new Xo({processId:r.processId});else throw new gh}async getState(){let r=[{name:"Action",value:"State"}];return await this.process.read({tags:r})}async getInfo(){let r=[{name:"Action",value:"Info"}];return await this.process.read({tags:r})}async getRecord({undername:r}){let n=[{name:"Sub-Domain",value:r},{name:"Action",value:"Record"}];return await this.process.read({tags:n})}async getRecords(){let r=[{name:"Action",value:"Records"}];return await this.process.read({tags:r})}async getOwner(){return(await this.getInfo()).Owner}async getControllers(){let r=[{name:"Action",value:"Controllers"}];return await this.process.read({tags:r})}async getName(){return(await this.getInfo()).Name}async getTicker(){return(await this.getInfo()).Ticker}async getBalances(){let r=[{name:"Action",value:"Balances"}];return await this.process.read({tags:r})}async getBalance({address:r}){let n=[{name:"Action",value:"Balance"},{name:"Recipient",value:r}];return await this.process.read({tags:n})}},Xw=class extends u6{signer;constructor({signer:r,...n}){super(n),this.signer=r}async transfer({target:r}){let n=[{name:"Action",value:"Transfer"},{name:"Recipient",value:r}];return this.process.send({tags:n,data:{},signer:this.signer})}async addController({controller:r}){let n=[{name:"Action",value:"Add-Controller"},{name:"Controller",value:r}];return this.process.send({tags:n,data:{},signer:this.signer})}async removeController({controller:r}){let n=[{name:"Action",value:"Remove-Controller"},{name:"Controller",value:r}];return this.process.send({tags:n,data:{},signer:this.signer})}async setRecord({undername:r,transactionId:n,ttlSeconds:h}){return this.process.send({tags:[{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:r},{name:"Transaction-Id",value:n},{name:"TTL-Seconds",value:h.toString()}],data:{transactionId:n,ttlSeconds:h},signer:this.signer})}async removeRecord({undername:r}){return this.process.send({tags:[{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:r}],data:{undername:r},signer:this.signer})}async setTicker({ticker:r}){return this.process.send({tags:[{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:r}],data:{ticker:r},signer:this.signer})}async setName({name:r}){return this.process.send({tags:[{name:"Action",value:"Set-Name"},{name:"Name",value:r}],data:{name:r},signer:this.signer})}};Be();Pe();Oe();Be();Pe();Oe();var rQ=fc(tQ(),1),wb=rQ.default.init({host:"arweave.net",port:443,protocol:"https"});Be();Pe();Oe();Be();Pe();Oe();var Y9e=Object.create,IR=Object.defineProperty,J9e=Object.getOwnPropertyDescriptor,RQ=Object.getOwnPropertyNames,X9e=Object.getPrototypeOf,Q9e=Object.prototype.hasOwnProperty,No=(e,r)=>function(){return r||(0,e[RQ(e)[0]])((r={exports:{}}).exports,r),r.exports},xQ=(e,r)=>{for(var n in r)IR(e,n,{get:r[n],enumerable:!0})},e_e=(e,r,n,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of RQ(r))!Q9e.call(e,a)&&a!==n&&IR(e,a,{get:()=>r[a],enumerable:!(h=J9e(r,a))||h.enumerable});return e},BR=(e,r,n)=>(n=e!=null?Y9e(X9e(e)):{},e_e(r||!e||!e.__esModule?IR(n,"default",{value:e,enumerable:!0}):n,e)),t_e=No({"node_modules/obliterator/iterator.js"(e,r){function n(h){if(typeof h!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=h}typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var h=arguments,a=h.length,d=0;return new n(function(){return d>=a?{done:!0}:{done:!1,value:h[d++]}})},n.empty=function(){var h=new n(function(){return{done:!0}});return h},n.fromSequence=function(h){var a=0,d=h.length;return new n(function(){return a>=d?{done:!0}:{done:!1,value:h[a++]}})},n.is=function(h){return h instanceof n?!0:typeof h=="object"&&h!==null&&typeof h.next=="function"},r.exports=n}}),r_e=No({"node_modules/obliterator/support.js"(e){e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",e.SYMBOL_SUPPORT=typeof Symbol<"u"}}),OR=No({"node_modules/obliterator/foreach.js"(e,r){var n=r_e(),h=n.ARRAY_BUFFER_SUPPORT,a=n.SYMBOL_SUPPORT;r.exports=function(c,v){var w,m,y,g,S;if(!c)throw new Error("obliterator/forEach: invalid iterable.");if(typeof v!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(c)||h&&ArrayBuffer.isView(c)||typeof c=="string"||c.toString()==="[object Arguments]"){for(y=0,g=c.length;y<g;y++)v(c[y],y);return}if(typeof c.forEach=="function"){c.forEach(v);return}if(a&&Symbol.iterator in c&&typeof c.next!="function"&&(c=c[Symbol.iterator]()),typeof c.next=="function"){for(w=c,y=0;S=w.next(),S.done!==!0;)v(S.value,y),y++;return}for(m in c)c.hasOwnProperty(m)&&v(c[m],m)}}}),PR=No({"node_modules/mnemonist/utils/typed-arrays.js"(e){var r=Math.pow(2,8)-1,n=Math.pow(2,16)-1,h=Math.pow(2,32)-1,a=Math.pow(2,7)-1,d=Math.pow(2,15)-1,c=Math.pow(2,31)-1;e.getPointerArray=function(w){var m=w-1;if(m<=r)return Uint8Array;if(m<=n)return Uint16Array;if(m<=h)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(w){var m=w-1;return m<=a?Int8Array:m<=d?Int16Array:m<=c?Int32Array:Float64Array},e.getNumberType=function(w){return w===(w|0)?Math.sign(w)===-1?w<=127&&w>=-128?Int8Array:w<=32767&&w>=-32768?Int16Array:Int32Array:w<=255?Uint8Array:w<=65535?Uint16Array:Uint32Array:Float64Array};var v={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(w,m){var y=null,g=0,S,R,A,k,I;for(k=0,I=w.length;k<I;k++)A=m?m(w[k]):w[k],R=e.getNumberType(A),S=v[R.name],S>g&&(g=S,y=R);return y},e.isTypedArray=function(w){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(w)},e.concat=function(){var w=0,m,y,g;for(m=0,g=arguments.length;m<g;m++)w+=arguments[m].length;var S=new arguments[0].constructor(w);for(m=0,y=0;m<g;m++)S.set(arguments[m],y),y+=arguments[m].length;return S},e.indices=function(w){for(var m=e.getPointerArray(w),y=new m(w),g=0;g<w;g++)y[g]=g;return y}}}),TQ=No({"node_modules/mnemonist/utils/iterables.js"(e){var r=OR(),n=PR();function h(v){return Array.isArray(v)||n.isTypedArray(v)}function a(v){if(typeof v.length=="number")return v.length;if(typeof v.size=="number")return v.size}function d(v){var w=a(v),m=typeof w=="number"?new Array(w):[],y=0;return r(v,function(g){m[y++]=g}),m}function c(v){var w=a(v),m=typeof w=="number"?n.getPointerArray(w):Array,y=typeof w=="number"?new Array(w):[],g=typeof w=="number"?new m(w):[],S=0;return r(v,function(R){y[S]=R,g[S]=S++}),[y,g]}e.isArrayLike=h,e.guessLength=a,e.toArray=d,e.toArrayWithIndices=c}}),i_e=No({"node_modules/mnemonist/lru-cache.js"(e,r){var n=t_e(),h=OR(),a=PR(),d=TQ();function c(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items={}}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},c.prototype.splayOnTop=function(v){var w=this.head;if(this.head===v)return this;var m=this.backward[v],y=this.forward[v];return this.tail===v?this.tail=m:this.backward[y]=m,this.forward[m]=y,this.backward[w]=v,this.head=v,this.forward[v]=w,this},c.prototype.set=function(v,w){var m=this.items[v];if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],delete this.items[this.K[m]]),this.items[v]=m,this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},c.prototype.setpop=function(v,w){var m=null,y=null,g=this.items[v];return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],delete this.items[y]),this.items[v]=g,this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},c.prototype.has=function(v){return v in this.items},c.prototype.get=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},c.prototype.peek=function(v){var w=this.items[v];if(!(typeof w>"u"))return this.V[w]},c.prototype.forEach=function(v,w){w=arguments.length>1?w:this;for(var m=0,y=this.size,g=this.head,S=this.K,R=this.V,A=this.forward;m<y;)v.call(w,R[g],S[g],this),g=A[g],m++},c.prototype.keys=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},c.prototype.values=function(){var v=0,w=this.size,m=this.head,y=this.V,g=this.forward;return new n(function(){if(v>=w)return{done:!0};var S=y[m];return v++,v<w&&(m=g[m]),{done:!1,value:S}})},c.prototype.entries=function(){var v=0,w=this.size,m=this.head,y=this.K,g=this.V,S=this.forward;return new n(function(){if(v>=w)return{done:!0};var R=y[m],A=g[m];return v++,v<w&&(m=S[m]),{done:!1,value:[R,A]}})},typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=function(){for(var v=new Map,w=this.entries(),m;m=w.next(),!m.done;)v.set(m.value[0],m.value[1]);return Object.defineProperty(v,"constructor",{value:c,enumerable:!1}),v},typeof Symbol<"u"&&(c.prototype[Symbol.for("nodejs.util.inspect.custom")]=c.prototype.inspect),c.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new c(w,m,y);return h(v,function(S,R){g.set(R,S)}),g},r.exports=c}}),n_e=No({"node_modules/mnemonist/lru-map.js"(e,r){var n=i_e(),h=OR(),a=PR(),d=TQ();function c(v,w,m){if(arguments.length<2&&(m=v,v=null,w=null),this.capacity=m,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=a.getPointerArray(m);this.forward=new y(m),this.backward=new y(m),this.K=typeof v=="function"?new v(m):new Array(m),this.V=typeof w=="function"?new w(m):new Array(m),this.size=0,this.head=0,this.tail=0,this.items=new Map}c.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},c.prototype.set=function(v,w){var m=this.items.get(v);if(typeof m<"u"){this.splayOnTop(m),this.V[m]=w;return}this.size<this.capacity?m=this.size++:(m=this.tail,this.tail=this.backward[m],this.items.delete(this.K[m])),this.items.set(v,m),this.K[m]=v,this.V[m]=w,this.forward[m]=this.head,this.backward[this.head]=m,this.head=m},c.prototype.setpop=function(v,w){var m=null,y=null,g=this.items.get(v);return typeof g<"u"?(this.splayOnTop(g),m=this.V[g],this.V[g]=w,{evicted:!1,key:v,value:m}):(this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],m=this.V[g],y=this.K[g],this.items.delete(y)),this.items.set(v,g),this.K[g]=v,this.V[g]=w,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g,y?{evicted:!0,key:y,value:m}:null)},c.prototype.has=function(v){return this.items.has(v)},c.prototype.get=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.splayOnTop(w),this.V[w]},c.prototype.peek=function(v){var w=this.items.get(v);if(!(typeof w>"u"))return this.V[w]},c.prototype.splayOnTop=n.prototype.splayOnTop,c.prototype.forEach=n.prototype.forEach,c.prototype.keys=n.prototype.keys,c.prototype.values=n.prototype.values,c.prototype.entries=n.prototype.entries,typeof Symbol<"u"&&(c.prototype[Symbol.iterator]=c.prototype.entries),c.prototype.inspect=n.prototype.inspect,c.from=function(v,w,m,y){if(arguments.length<2){if(y=d.guessLength(v),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=w,w=null,m=null);var g=new c(w,m,y);return h(v,function(S,R){g.set(R,S)}),g},r.exports=c}}),a_e=No({"node_modules/ms/index.js"(e,r){var n=1e3,h=n*60,a=h*60,d=a*24,c=d*7,v=d*365.25;r.exports=function(S,R){R=R||{};var A=typeof S;if(A==="string"&&S.length>0)return w(S);if(A==="number"&&isFinite(S))return R.long?y(S):m(S);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(S))};function w(S){if(S=String(S),!(S.length>100)){var R=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(S);if(R){var A=parseFloat(R[1]),k=(R[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*v;case"weeks":case"week":case"w":return A*c;case"days":case"day":case"d":return A*d;case"hours":case"hour":case"hrs":case"hr":case"h":return A*a;case"minutes":case"minute":case"mins":case"min":case"m":return A*h;case"seconds":case"second":case"secs":case"sec":case"s":return A*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function m(S){var R=Math.abs(S);return R>=d?Math.round(S/d)+"d":R>=a?Math.round(S/a)+"h":R>=h?Math.round(S/h)+"m":R>=n?Math.round(S/n)+"s":S+"ms"}function y(S){var R=Math.abs(S);return R>=d?g(S,R,d,"day"):R>=a?g(S,R,a,"hour"):R>=h?g(S,R,h,"minute"):R>=n?g(S,R,n,"second"):S+" ms"}function g(S,R,A,k){var I=R>=A*1.5;return Math.round(S/A)+" "+k+(I?"s":"")}}}),o_e=No({"node_modules/debug/src/common.js"(e,r){function n(h){d.debug=d,d.default=d,d.coerce=g,d.disable=w,d.enable=v,d.enabled=m,d.humanize=a_e(),d.destroy=S,Object.keys(h).forEach(R=>{d[R]=h[R]}),d.names=[],d.skips=[],d.formatters={};function a(R){let A=0;for(let k=0;k<R.length;k++)A=(A<<5)-A+R.charCodeAt(k),A|=0;return d.colors[Math.abs(A)%d.colors.length]}d.selectColor=a;function d(R){let A,k=null,I,B;function P(...C){if(!P.enabled)return;let q=P,K=Number(new Date),V=K-(A||K);q.diff=V,q.prev=A,q.curr=K,A=K,C[0]=d.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let j=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(J,E)=>{if(J==="%%")return"%";j++;let i=d.formatters[E];if(typeof i=="function"){let s=C[j];J=i.call(q,s),C.splice(j,1),j--}return J}),d.formatArgs.call(q,C),(q.log||d.log).apply(q,C)}return P.namespace=R,P.useColors=d.useColors(),P.color=d.selectColor(R),P.extend=c,P.destroy=d.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(I!==d.namespaces&&(I=d.namespaces,B=d.enabled(R)),B),set:C=>{k=C}}),typeof d.init=="function"&&d.init(P),P}function c(R,A){let k=d(this.namespace+(typeof A>"u"?":":A)+R);return k.log=this.log,k}function v(R){d.save(R),d.namespaces=R,d.names=[],d.skips=[];let A,k=(typeof R=="string"?R:"").split(/[\s,]+/),I=k.length;for(A=0;A<I;A++)k[A]&&(R=k[A].replace(/\*/g,".*?"),R[0]==="-"?d.skips.push(new RegExp("^"+R.slice(1)+"$")):d.names.push(new RegExp("^"+R+"$")))}function w(){let R=[...d.names.map(y),...d.skips.map(y).map(A=>"-"+A)].join(",");return d.enable(""),R}function m(R){if(R[R.length-1]==="*")return!0;let A,k;for(A=0,k=d.skips.length;A<k;A++)if(d.skips[A].test(R))return!1;for(A=0,k=d.names.length;A<k;A++)if(d.names[A].test(R))return!0;return!1}function y(R){return R.toString().substring(2,R.toString().length-2).replace(/\.\*\?$/,"*")}function g(R){return R instanceof Error?R.stack||R.message:R}function S(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return d.enable(d.load()),d}r.exports=n}}),s_e=No({"node_modules/debug/src/browser.js"(e,r){e.formatArgs=h,e.save=a,e.load=d,e.useColors=n,e.storage=c(),e.destroy=(()=>{let w=!1;return()=>{w||(w=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function h(w){if(w[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+w[0]+(this.useColors?"%c ":" ")+"+"+r.exports.humanize(this.diff),!this.useColors)return;let m="color: "+this.color;w.splice(1,0,m,"color: inherit");let y=0,g=0;w[0].replace(/%[a-zA-Z%]/g,S=>{S!=="%%"&&(y++,S==="%c"&&(g=y))}),w.splice(g,0,m)}e.log=console.debug||console.log||(()=>{});function a(w){try{w?e.storage.setItem("debug",w):e.storage.removeItem("debug")}catch{}}function d(){let w;try{w=e.storage.getItem("debug")}catch{}return!w&&typeof gt<"u"&&"env"in gt&&(w=gt.env.DEBUG),w}function c(){try{return localStorage}catch{}}r.exports=o_e()(e);var{formatters:v}=r.exports;v.j=function(w){try{return JSON.stringify(w)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}}}),f_e=No({"node_modules/base64-js/index.js"(e){"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=R;var r=[],n=[],h=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,c=a.length;d<c;++d)r[d]=a[d],n[a.charCodeAt(d)]=d;var d,c;n[45]=62,n[95]=63;function v(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=k);var B=I===k?0:4-I%4;return[I,B]}function w(A){var k=v(A),I=k[0],B=k[1];return(I+B)*3/4-B}function m(A,k,I){return(k+I)*3/4-I}function y(A){var k,I=v(A),B=I[0],P=I[1],C=new h(m(A,B,P)),q=0,K=P>0?B-4:B,V;for(V=0;V<K;V+=4)k=n[A.charCodeAt(V)]<<18|n[A.charCodeAt(V+1)]<<12|n[A.charCodeAt(V+2)]<<6|n[A.charCodeAt(V+3)],C[q++]=k>>16&255,C[q++]=k>>8&255,C[q++]=k&255;return P===2&&(k=n[A.charCodeAt(V)]<<2|n[A.charCodeAt(V+1)]>>4,C[q++]=k&255),P===1&&(k=n[A.charCodeAt(V)]<<10|n[A.charCodeAt(V+1)]<<4|n[A.charCodeAt(V+2)]>>2,C[q++]=k>>8&255,C[q++]=k&255),C}function g(A){return r[A>>18&63]+r[A>>12&63]+r[A>>6&63]+r[A&63]}function S(A,k,I){for(var B,P=[],C=k;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function R(A){for(var k,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(k=A[I-1],P.push(r[k>>2]+r[k<<4&63]+"==")):B===2&&(k=(A[I-2]<<8)+A[I-1],P.push(r[k>>10]+r[k>>4&63]+r[k<<2&63]+"=")),P.join("")}}}),u_e=No({"node_modules/ieee754/index.js"(e){e.read=function(r,n,h,a,d){var c,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=h?d-1:0,R=h?-1:1,A=r[n+S];for(S+=R,c=A&(1<<-g)-1,A>>=-g,g+=w;g>0;c=c*256+r[n+S],S+=R,g-=8);for(v=c&(1<<-g)-1,c>>=-g,g+=a;g>0;v=v*256+r[n+S],S+=R,g-=8);if(c===0)c=1-y;else{if(c===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),c=c-y}return(A?-1:1)*v*Math.pow(2,c-a)},e.write=function(r,n,h,a,d,c){var v,w,m,y=c*8-d-1,g=(1<<y)-1,S=g>>1,R=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:c-1,k=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=R/m:n+=R*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;r[h+A]=w&255,A+=k,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;r[h+A]=v&255,A+=k,v/=256,y-=8);r[h+A-k]|=I*128}}}),h_e=No({"node_modules/buffer/index.js"(e){"use strict";var r=f_e(),n=u_e(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return k(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?c(O):N!==void 0?typeof $=="string"?c(O).fill(N,$):c(O).fill(N):c(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),c(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=c($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function R(O){let N=O.length<0?0:B(O.length)|0,$=c(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return k(N.buffer,N.byteOffset,N.byteLength)}return R(O)}function k(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=c(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?c(0):R(O);if(O.type==="Buffer"&&Array.isArray(O.data))return R(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(N){return N!=null&&N._isBuffer===!0&&N!==v.prototype},v.compare=function(N,$){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),ut($,Uint8Array)&&($=v.from($,$.offset,$.byteLength)),!v.isBuffer(N)||!v.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(N===$)return 0;let ee=N.length,re=$.length;for(let se=0,ce=Math.min(ee,re);se<ce;++se)if(N[se]!==$[se]){ee=N[se],re=$[se];break}return ee<re?-1:re<ee?1:0},v.isEncoding=function(N){switch(String(N).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(N,$){if(!Array.isArray(N))throw new TypeError('"list" argument must be an Array of Buffers');if(N.length===0)return v.alloc(0);let ee;if($===void 0)for($=0,ee=0;ee<N.length;++ee)$+=N[ee].length;let re=v.allocUnsafe($),se=0;for(ee=0;ee<N.length;++ee){let ce=N[ee];if(ut(ce,Uint8Array))se+ce.length>re.length?(v.isBuffer(ce)||(ce=v.from(ce)),ce.copy(re,se)):Uint8Array.prototype.set.call(re,ce,se);else if(v.isBuffer(ce))ce.copy(re,se);else throw new TypeError('"list" argument must be an Array of Buffers');se+=ce.length}return re};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return t(this,N,$);case"utf8":case"utf-8":return l(this,N,$);case"ascii":return x(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return f(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let N=this.length;if(N%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$<N;$+=2)K(this,$,$+1);return this},v.prototype.swap32=function(){let N=this.length;if(N%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let $=0;$<N;$+=4)K(this,$,$+3),K(this,$+1,$+2);return this},v.prototype.swap64=function(){let N=this.length;if(N%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let $=0;$<N;$+=8)K(this,$,$+7),K(this,$+1,$+6),K(this,$+2,$+5),K(this,$+3,$+4);return this},v.prototype.toString=function(){let N=this.length;return N===0?"":arguments.length===0?l(this,0,N):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(N){if(!v.isBuffer(N))throw new TypeError("Argument must be a Buffer");return this===N?!0:v.compare(this,N)===0},v.prototype.inspect=function(){let N="",$=e.INSPECT_MAX_BYTES;return N=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$&&(N+=" ... "),"<Buffer "+N+">"},h&&(v.prototype[h]=v.prototype.inspect),v.prototype.compare=function(N,$,ee,re,se){if(ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(N))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof N);if($===void 0&&($=0),ee===void 0&&(ee=N?N.length:0),re===void 0&&(re=0),se===void 0&&(se=this.length),$<0||ee>N.length||re<0||se>this.length)throw new RangeError("out of range index");if(re>=se&&$>=ee)return 0;if(re>=se)return-1;if($>=ee)return 1;if($>>>=0,ee>>>=0,re>>>=0,se>>>=0,this===N)return 0;let ce=se-re,st=ee-$,ye=Math.min(ce,st),be=this.slice(re,se),me=N.slice($,ee);for(let Te=0;Te<ye;++Te)if(be[Te]!==me[Te]){ce=be[Te],st=me[Te];break}return ce<st?-1:st<ce?1:0};function V(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,Te){return se===1?me[Te]:me.readUInt16BE(Te*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let Te=0;Te<st;Te++)if(ye(O,be+Te)!==ye(N,Te)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(N,$,ee){return this.indexOf(N,$,ee)!==-1},v.prototype.indexOf=function(N,$,ee){return V(this,N,$,ee,!0)},v.prototype.lastIndexOf=function(N,$,ee){return V(this,N,$,ee,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(N,$,ee,re){if($===void 0)re="utf8",ee=this.length,$=0;else if(ee===void 0&&typeof $=="string")re=$,ee=this.length,$=0;else if(isFinite($))$=$>>>0,isFinite(ee)?(ee=ee>>>0,re===void 0&&(re="utf8")):(re=ee,ee=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let se=this.length-$;if((ee===void 0||ee>se)&&(ee=se),N.length>0&&(ee<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");re||(re="utf8");let ce=!1;for(;;)switch(re){case"hex":return z(this,N,$,ee);case"utf8":case"utf-8":return J(this,N,$,ee);case"ascii":case"latin1":case"binary":return E(this,N,$,ee);case"base64":return i(this,N,$,ee);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,N,$,ee);default:if(ce)throw new TypeError("Unknown encoding: "+re);re=(""+re).toLowerCase(),ce=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(O,N,$){return N===0&&$===O.length?r.fromByteArray(O):r.fromByteArray(O.slice(N,$))}function l(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,Te;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(Te=(se&31)<<6|ye&63,Te>127&&(ce=Te));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(Te=(se&15)<<12|(ye&63)<<6|be&63,Te>2047&&(Te<55296||Te>57343)&&(ce=Te));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(Te=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,Te>65535&&Te<1114112&&(ce=Te))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function x(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function t(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=ke[O[se]];return re}function u(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(N,$){let ee=this.length;N=~~N,$=$===void 0?ee:~~$,N<0?(N+=ee,N<0&&(N=0)):N>ee&&(N=ee),$<0?($+=ee,$<0&&($=0)):$>ee&&($=ee),$<N&&($=N);let re=this.subarray(N,$);return Object.setPrototypeOf(re,v.prototype),re};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return re},v.prototype.readUintBE=v.prototype.readUIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N+--$],se=1;for(;$>0&&(se*=256);)re+=this[N+--$]*se;return re},v.prototype.readUint8=v.prototype.readUInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]|this[N+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(N,$){return N=N>>>0,$||b(N,2,this.length),this[N]<<8|this[N+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),(this[N]|this[N+1]<<8|this[N+2]<<16)+this[N+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]*16777216+(this[N+1]<<16|this[N+2]<<8|this[N+3])},v.prototype.readBigUInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24,se=this[++N]+this[++N]*2**8+this[++N]*2**16+ee*2**24;return BigInt(re)+(BigInt(se)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=$*2**24+this[++N]*2**16+this[++N]*2**8+this[++N],se=this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee;return(BigInt(re)<<BigInt(32))+BigInt(se)}),v.prototype.readIntLE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=this[N],se=1,ce=0;for(;++ce<$&&(se*=256);)re+=this[N+ce]*se;return se*=128,re>=se&&(re-=Math.pow(2,8*$)),re},v.prototype.readIntBE=function(N,$,ee){N=N>>>0,$=$>>>0,ee||b(N,$,this.length);let re=$,se=1,ce=this[N+--re];for(;re>0&&(se*=256);)ce+=this[N+--re]*se;return se*=128,ce>=se&&(ce-=Math.pow(2,8*$)),ce},v.prototype.readInt8=function(N,$){return N=N>>>0,$||b(N,1,this.length),this[N]&128?(255-this[N]+1)*-1:this[N]},v.prototype.readInt16LE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N]|this[N+1]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt16BE=function(N,$){N=N>>>0,$||b(N,2,this.length);let ee=this[N+1]|this[N]<<8;return ee&32768?ee|4294901760:ee},v.prototype.readInt32LE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]|this[N+1]<<8|this[N+2]<<16|this[N+3]<<24},v.prototype.readInt32BE=function(N,$){return N=N>>>0,$||b(N,4,this.length),this[N]<<24|this[N+1]<<16|this[N+2]<<8|this[N+3]},v.prototype.readBigInt64LE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=this[N+4]+this[N+5]*2**8+this[N+6]*2**16+(ee<<24);return(BigInt(re)<<BigInt(32))+BigInt($+this[++N]*2**8+this[++N]*2**16+this[++N]*2**24)}),v.prototype.readBigInt64BE=mt(function(N){N=N>>>0,Z(N,"offset");let $=this[N],ee=this[N+7];($===void 0||ee===void 0)&&ie(N,this.length-8);let re=($<<24)+this[++N]*2**16+this[++N]*2**8+this[++N];return(BigInt(re)<<BigInt(32))+BigInt(this[++N]*2**24+this[++N]*2**16+this[++N]*2**8+ee)}),v.prototype.readFloatLE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!0,23,4)},v.prototype.readFloatBE=function(N,$){return N=N>>>0,$||b(N,4,this.length),n.read(this,N,!1,23,4)},v.prototype.readDoubleLE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!0,52,8)},v.prototype.readDoubleBE=function(N,$){return N=N>>>0,$||b(N,8,this.length),n.read(this,N,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=1,ce=0;for(this[$]=N&255;++ce<ee&&(se*=256);)this[$+ce]=N/se&255;return $+ee},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,ee=ee>>>0,!re){let st=Math.pow(2,8*ee)-1;M(this,N,$,ee,st,0)}let se=ee-1,ce=1;for(this[$+se]=N&255;--se>=0&&(ce*=256);)this[$+se]=N/ce&255;return $+ee},v.prototype.writeUint8=v.prototype.writeUInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,255,0),this[$]=N&255,$+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,65535,0),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$+3]=N>>>24,this[$+2]=N>>>16,this[$+1]=N>>>8,this[$]=N&255,$+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,4294967295,0),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4};function T(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(N,$=0){return T(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(N,$=0){return D(this,N,$,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=0,ce=1,st=0;for(this[$]=N&255;++se<ee&&(ce*=256);)N<0&&st===0&&this[$+se-1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeIntBE=function(N,$,ee,re){if(N=+N,$=$>>>0,!re){let ye=Math.pow(2,8*ee-1);M(this,N,$,ee,ye-1,-ye)}let se=ee-1,ce=1,st=0;for(this[$+se]=N&255;--se>=0&&(ce*=256);)N<0&&st===0&&this[$+se+1]!==0&&(st=1),this[$+se]=(N/ce>>0)-st&255;return $+ee},v.prototype.writeInt8=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,1,127,-128),N<0&&(N=255+N+1),this[$]=N&255,$+1},v.prototype.writeInt16LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N&255,this[$+1]=N>>>8,$+2},v.prototype.writeInt16BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,2,32767,-32768),this[$]=N>>>8,this[$+1]=N&255,$+2},v.prototype.writeInt32LE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),this[$]=N&255,this[$+1]=N>>>8,this[$+2]=N>>>16,this[$+3]=N>>>24,$+4},v.prototype.writeInt32BE=function(N,$,ee){return N=+N,$=$>>>0,ee||M(this,N,$,4,2147483647,-2147483648),N<0&&(N=4294967295+N+1),this[$]=N>>>24,this[$+1]=N>>>16,this[$+2]=N>>>8,this[$+3]=N&255,$+4},v.prototype.writeBigInt64LE=mt(function(N,$=0){return T(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(N,$=0){return D(this,N,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(N,$,ee){return W(this,N,$,!0,ee)},v.prototype.writeFloatBE=function(N,$,ee){return W(this,N,$,!1,ee)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(N,$,ee){return X(this,N,$,!0,ee)},v.prototype.writeDoubleBE=function(N,$,ee){return X(this,N,$,!1,ee)},v.prototype.copy=function(N,$,ee,re){if(!v.isBuffer(N))throw new TypeError("argument should be a Buffer");if(ee||(ee=0),!re&&re!==0&&(re=this.length),$>=N.length&&($=N.length),$||($=0),re>0&&re<ee&&(re=ee),re===ee||N.length===0||this.length===0)return 0;if($<0)throw new RangeError("targetStart out of bounds");if(ee<0||ee>=this.length)throw new RangeError("Index out of range");if(re<0)throw new RangeError("sourceEnd out of bounds");re>this.length&&(re=this.length),N.length-$<re-ee&&(re=N.length-$+ee);let se=re-ee;return this===N&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin($,ee,re):Uint8Array.prototype.set.call(N,this.subarray(ee,re),$),se},v.prototype.fill=function(N,$,ee,re){if(typeof N=="string"){if(typeof $=="string"?(re=$,$=0,ee=this.length):typeof ee=="string"&&(re=ee,ee=this.length),re!==void 0&&typeof re!="string")throw new TypeError("encoding must be a string");if(typeof re=="string"&&!v.isEncoding(re))throw new TypeError("Unknown encoding: "+re);if(N.length===1){let ce=N.charCodeAt(0);(re==="utf8"&&ce<128||re==="latin1")&&(N=ce)}}else typeof N=="number"?N=N&255:typeof N=="boolean"&&(N=Number(N));if($<0||this.length<$||this.length<ee)throw new RangeError("Out of range index");if(ee<=$)return this;$=$>>>0,ee=ee===void 0?this.length:ee>>>0,N||(N=0);let se;if(typeof N=="number")for(se=$;se<ee;++se)this[se]=N;else{let ce=v.isBuffer(N)?N:v.from(N,re),st=ce.length;if(st===0)throw new TypeError('The value "'+N+'" is invalid for argument "value"');for(se=0;se<ee-$;++se)this[se+$]=ce[se%st]}return this};var G={};function Y(O,N,$){G[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(re){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:re,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new G.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new G.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new G.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return r.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var ke=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}});function ln(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}function Ka(e){return function r(n){return arguments.length===0||ln(n)?r:e.apply(this,arguments)}}function Pn(e){return function r(n,h){switch(arguments.length){case 0:return r;case 1:return ln(n)?r:Ka(function(a){return e(n,a)});default:return ln(n)&&ln(h)?r:ln(n)?Ka(function(a){return e(a,h)}):ln(h)?Ka(function(a){return e(n,a)}):e(n,h)}}}function Fb(e,r){switch(e){case 0:return function(){return r.apply(this,arguments)};case 1:return function(n){return r.apply(this,arguments)};case 2:return function(n,h){return r.apply(this,arguments)};case 3:return function(n,h,a){return r.apply(this,arguments)};case 4:return function(n,h,a,d){return r.apply(this,arguments)};case 5:return function(n,h,a,d,c){return r.apply(this,arguments)};case 6:return function(n,h,a,d,c,v){return r.apply(this,arguments)};case 7:return function(n,h,a,d,c,v,w){return r.apply(this,arguments)};case 8:return function(n,h,a,d,c,v,w,m){return r.apply(this,arguments)};case 9:return function(n,h,a,d,c,v,w,m,y){return r.apply(this,arguments)};case 10:return function(n,h,a,d,c,v,w,m,y,g){return r.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function kQ(e,r,n){return function(){for(var h=[],a=0,d=e,c=0,v=!1;c<r.length||a<arguments.length;){var w;c<r.length&&(!ln(r[c])||a>=arguments.length)?w=r[c]:(w=arguments[a],a+=1),h[c]=w,ln(w)?v=!0:d-=1,c+=1}return!v&&d<=0?n.apply(this,h):Fb(Math.max(0,d),kQ(e,h,n))}}var l_e=Pn(function(e,r){return e===1?Ka(r):Fb(e,kQ(e,[],r))}),IQ=l_e;function NR(e){return function r(n,h,a){switch(arguments.length){case 0:return r;case 1:return ln(n)?r:Pn(function(d,c){return e(n,d,c)});case 2:return ln(n)&&ln(h)?r:ln(n)?Pn(function(d,c){return e(d,h,c)}):ln(h)?Pn(function(d,c){return e(n,d,c)}):Ka(function(d){return e(n,h,d)});default:return ln(n)&&ln(h)&&ln(a)?r:ln(n)&&ln(h)?Pn(function(d,c){return e(d,c,a)}):ln(n)&&ln(a)?Pn(function(d,c){return e(d,h,c)}):ln(h)&&ln(a)?Pn(function(d,c){return e(n,d,c)}):ln(n)?Ka(function(d){return e(d,h,a)}):ln(h)?Ka(function(d){return e(n,d,a)}):ln(a)?Ka(function(d){return e(n,h,d)}):e(n,h,a)}}}var CR=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"};function c_e(e){return e!=null&&typeof e["@@transducer/step"]=="function"}function LR(e,r,n){return function(){if(arguments.length===0)return n();var h=arguments[arguments.length-1];if(!CR(h)){for(var a=0;a<e.length;){if(typeof h[e[a]]=="function")return h[e[a]].apply(h,Array.prototype.slice.call(arguments,0,-1));a+=1}if(c_e(h)){var d=r.apply(null,Array.prototype.slice.call(arguments,0,-1));return d(h)}}return n.apply(this,arguments)}}function d_e(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}var O2={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}};function iQ(e){for(var r=[],n;!(n=e.next()).done;)r.push(n.value);return r}function nQ(e,r,n){for(var h=0,a=n.length;h<a;){if(e(r,n[h]))return!0;h+=1}return!1}function p_e(e){var r=String(e).match(/^function (\w*)/);return r==null?"":r[1]}function Rb(e,r){return Object.prototype.hasOwnProperty.call(r,e)}function v_e(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}var oR=typeof Object.is=="function"?Object.is:v_e,aQ=Object.prototype.toString,m_e=function(){return aQ.call(arguments)==="[object Arguments]"?function(e){return aQ.call(e)==="[object Arguments]"}:function(e){return Rb("callee",e)}}(),g_e=m_e,y_e=!{toString:null}.propertyIsEnumerable("toString"),oQ=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],sQ=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),b_e=function(e,r){for(var n=0;n<e.length;){if(e[n]===r)return!0;n+=1}return!1},w_e=Ka(typeof Object.keys=="function"&&!sQ?function(e){return Object(e)!==e?[]:Object.keys(e)}:function(e){if(Object(e)!==e)return[];var r,n,h=[],a=sQ&&g_e(e);for(r in e)Rb(r,e)&&(!a||r!=="length")&&(h[h.length]=r);if(y_e)for(n=oQ.length-1;n>=0;)r=oQ[n],Rb(r,e)&&!b_e(h,r)&&(h[h.length]=r),n-=1;return h}),Ld=w_e,__e=Ka(function(e){return e===null?"Null":e===void 0?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),fQ=__e;function uQ(e,r,n,h){var a=iQ(e),d=iQ(r);function c(v,w){return DR(v,w,n.slice(),h.slice())}return!nQ(function(v,w){return!nQ(c,w,v)},d,a)}function DR(e,r,n,h){if(oR(e,r))return!0;var a=fQ(e);if(a!==fQ(r))return!1;if(typeof e["fantasy-land/equals"]=="function"||typeof r["fantasy-land/equals"]=="function")return typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](r)&&typeof r["fantasy-land/equals"]=="function"&&r["fantasy-land/equals"](e);if(typeof e.equals=="function"||typeof r.equals=="function")return typeof e.equals=="function"&&e.equals(r)&&typeof r.equals=="function"&&r.equals(e);switch(a){case"Arguments":case"Array":case"Object":if(typeof e.constructor=="function"&&p_e(e.constructor)==="Promise")return e===r;break;case"Boolean":case"Number":case"String":if(!(typeof e==typeof r&&oR(e.valueOf(),r.valueOf())))return!1;break;case"Date":if(!oR(e.valueOf(),r.valueOf()))return!1;break;case"Error":return e.name===r.name&&e.message===r.message;case"RegExp":if(!(e.source===r.source&&e.global===r.global&&e.ignoreCase===r.ignoreCase&&e.multiline===r.multiline&&e.sticky===r.sticky&&e.unicode===r.unicode))return!1;break}for(var d=n.length-1;d>=0;){if(n[d]===e)return h[d]===r;d-=1}switch(a){case"Map":return e.size!==r.size?!1:uQ(e.entries(),r.entries(),n.concat([e]),h.concat([r]));case"Set":return e.size!==r.size?!1:uQ(e.values(),r.values(),n.concat([e]),h.concat([r]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=Ld(e);if(c.length!==Ld(r).length)return!1;var v=n.concat([e]),w=h.concat([r]);for(d=c.length-1;d>=0;){var m=c[d];if(!(Rb(m,r)&&DR(r[m],e[m],v,w)))return!1;d-=1}return!0}var M_e=Pn(function(e,r){return DR(e,r,[],[])}),BQ=M_e;function S_e(e,r,n){var h,a;if(typeof e.indexOf=="function")switch(typeof r){case"number":if(r===0){for(h=1/r;n<e.length;){if(a=e[n],a===0&&1/a===h)return n;n+=1}return-1}else if(r!==r){for(;n<e.length;){if(a=e[n],typeof a=="number"&&a!==a)return n;n+=1}return-1}return e.indexOf(r,n);case"string":case"boolean":case"function":case"undefined":return e.indexOf(r,n);case"object":if(r===null)return e.indexOf(r,n)}for(;n<e.length;){if(BQ(e[n],r))return n;n+=1}return-1}function E_e(e,r){return S_e(r,e,0)>=0}function I2(e,r){for(var n=0,h=r.length,a=Array(h);n<h;)a[n]=e(r[n]),n+=1;return a}function sR(e){var r=e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+r.replace(/"/g,'\\"')+'"'}var E2=function(e){return(e<10?"0":"")+e},A_e=typeof Date.prototype.toISOString=="function"?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+E2(e.getUTCMonth()+1)+"-"+E2(e.getUTCDate())+"T"+E2(e.getUTCHours())+":"+E2(e.getUTCMinutes())+":"+E2(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},R_e=A_e;function x_e(e){return function(){return!e.apply(this,arguments)}}function OQ(e,r,n){for(var h=0,a=n.length;h<a;)r=e(r,n[h]),h+=1;return r}function T_e(e,r){for(var n=0,h=r.length,a=[];n<h;)e(r[n])&&(a[a.length]=r[n]),n+=1;return a}function k_e(e){return Object.prototype.toString.call(e)==="[object Object]"}var I_e=function(){function e(r,n){this.xf=n,this.f=r}return e.prototype["@@transducer/init"]=O2.init,e.prototype["@@transducer/result"]=O2.result,e.prototype["@@transducer/step"]=function(r,n){return this.f(n)?this.xf["@@transducer/step"](r,n):r},e}();function B_e(e){return function(r){return new I_e(e,r)}}var O_e=Pn(LR(["fantasy-land/filter","filter"],B_e,function(e,r){return k_e(r)?OQ(function(n,h){return e(r[h])&&(n[h]=r[h]),n},{},Ld(r)):T_e(e,r)})),P_e=O_e,N_e=Pn(function(e,r){return P_e(x_e(e),r)}),C_e=N_e;function PQ(e,r){var n=function(d){var c=r.concat([e]);return E_e(d,c)?"<Circular>":PQ(d,c)},h=function(d,c){return I2(function(v){return sR(v)+": "+n(d[v])},c.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+I2(n,e).join(", ")+"))";case"[object Array]":return"["+I2(n,e).concat(h(e,C_e(function(d){return/^\d+$/.test(d)},Ld(e)))).join(", ")+"]";case"[object Boolean]":return typeof e=="object"?"new Boolean("+n(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?n(NaN):sR(R_e(e)))+")";case"[object Map]":return"new Map("+n(Array.from(e))+")";case"[object Null]":return"null";case"[object Number]":return typeof e=="object"?"new Number("+n(e.valueOf())+")":1/e===-1/0?"-0":e.toString(10);case"[object Set]":return"new Set("+n(Array.from(e).sort())+")";case"[object String]":return typeof e=="object"?"new String("+n(e.valueOf())+")":sR(e);case"[object Undefined]":return"undefined";default:if(typeof e.toString=="function"){var a=e.toString();if(a!=="[object Object]")return a}return"{"+h(e,Ld(e)).join(", ")+"}"}}var L_e=Ka(function(e){return PQ(e,[])}),hQ=L_e,D_e=Pn(function(e,r){if(e===r)return r;function n(v,w){if(v>w!=w>v)return w>v?w:v}var h=n(e,r);if(h!==void 0)return h;var a=n(typeof e,typeof r);if(a!==void 0)return a===typeof e?e:r;var d=hQ(e),c=n(d,hQ(r));return c!==void 0&&c===d?e:r}),$_e=D_e,U_e=function(){function e(r,n){this.xf=n,this.f=r}return e.prototype["@@transducer/init"]=O2.init,e.prototype["@@transducer/result"]=O2.result,e.prototype["@@transducer/step"]=function(r,n){return this.xf["@@transducer/step"](r,this.f(n))},e}(),q_e=function(e){return function(r){return new U_e(e,r)}},j_e=q_e,F_e=Pn(LR(["fantasy-land/map","map"],j_e,function(e,r){switch(Object.prototype.toString.call(r)){case"[object Function]":return IQ(r.length,function(){return e.call(this,r.apply(this,arguments))});case"[object Object]":return OQ(function(n,h){return n[h]=e(r[h]),n},{},Ld(r));default:return I2(e,r)}})),z_e=F_e,NQ=Number.isInteger||function(e){return e<<0===e};function CQ(e){return Object.prototype.toString.call(e)==="[object String]"}var H_e=Pn(function(e,r){var n=e<0?r.length+e:e;return CQ(r)?r.charAt(n):r[n]}),LQ=H_e,K_e=Pn(function(e,r){if(r!=null)return NQ(e)?LQ(e,r):r[e]}),zb=K_e,Z_e=Pn(function(e,r){return z_e(zb(e),r)}),W_e=Z_e,G_e=Ka(function(e){return CR(e)?!0:!e||typeof e!="object"||CQ(e)?!1:e.length===0?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1}),V_e=G_e,lQ=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function Y_e(e,r,n){return function(h,a,d){if(V_e(d))return e(h,a,d);if(d==null)return a;if(typeof d["fantasy-land/reduce"]=="function")return r(h,a,d,"fantasy-land/reduce");if(d[lQ]!=null)return n(h,a,d[lQ]());if(typeof d.next=="function")return n(h,a,d);if(typeof d.reduce=="function")return r(h,a,d,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function J_e(e,r,n){for(var h=0,a=n.length;h<a;){if(r=e["@@transducer/step"](r,n[h]),r&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}h+=1}return e["@@transducer/result"](r)}var X_e=Pn(function(e,r){return Fb(e.length,function(){return e.apply(r,arguments)})}),Q_e=X_e;function eMe(e,r,n){for(var h=n.next();!h.done;){if(r=e["@@transducer/step"](r,h.value),r&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}h=n.next()}return e["@@transducer/result"](r)}function tMe(e,r,n,h){return e["@@transducer/result"](n[h](Q_e(e["@@transducer/step"],e),r))}var rMe=Y_e(J_e,tMe,eMe),iMe=rMe,nMe=function(){function e(r){this.f=r}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(r){return r},e.prototype["@@transducer/step"]=function(r,n){return this.f(r,n)},e}();function aMe(e){return new nMe(e)}var oMe=NR(function(e,r,n){return iMe(typeof e=="function"?aMe(e):e,r,n)}),DQ=oMe;function sMe(e,r){return function(){return r.call(this,e.apply(this,arguments))}}function $Q(e,r){return function(){var n=arguments.length;if(n===0)return r();var h=arguments[n-1];return CR(h)||typeof h[e]!="function"?r.apply(this,arguments):h[e].apply(h,Array.prototype.slice.call(arguments,0,n-1))}}var fMe=NR($Q("slice",function(e,r,n){return Array.prototype.slice.call(n,e,r)})),uMe=fMe,hMe=Ka($Q("tail",uMe(1,1/0))),lMe=hMe;function UQ(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Fb(arguments[0].length,DQ(sMe,arguments[0],lMe(arguments)))}var cMe=Pn(function(e,r){return IQ(DQ($_e,0,W_e("length",r)),function(){var n=arguments,h=this;return e.apply(h,I2(function(a){return a.apply(h,n)},r))})}),dMe=cMe,pMe=Pn(function(e,r){return r==null||r!==r?e:r}),pR=pMe,vMe=function(){function e(r,n){this.xf=n,this.f=r,this.found=!1}return e.prototype["@@transducer/init"]=O2.init,e.prototype["@@transducer/result"]=function(r){return this.found||(r=this.xf["@@transducer/step"](r,void 0)),this.xf["@@transducer/result"](r)},e.prototype["@@transducer/step"]=function(r,n){return this.f(n)&&(this.found=!0,r=d_e(this.xf["@@transducer/step"](r,n))),r},e}();function mMe(e){return function(r){return new vMe(e,r)}}var gMe=Pn(LR(["find"],mMe,function(e,r){for(var n=0,h=r.length;n<h;){if(e(r[n]))return r[n];n+=1}})),yMe=gMe,bMe=Ka(function(e){return dMe(function(){return Array.prototype.slice.call(arguments,0)},e)}),wMe=bMe,_Me=Pn(function(e,r){return e.map(function(n){for(var h=r,a=0,d;a<n.length;){if(h==null)return;d=n[a],h=NQ(d)?LQ(d,h):h[d],a+=1}return h})}),MMe=_Me,SMe=Pn(function(e,r){return MMe([e],r)[0]}),qQ=SMe,EMe=NR(function(e,r,n){return BQ(e,zb(r,n))}),AMe=EMe,xb=class extends Error{name="InvalidSchedulerLocation"},RMe=class extends Error{name="SchedulerTagNotFound"},xMe=class extends Error{name="TransactionNotFound"},TMe="Url",kMe="Time-To-Live",IMe="Scheduler",vR=e=>UQ(pR([]),yMe(AMe(e,"name")),pR({}),zb("value")),jQ=e=>UQ(r=>{if(!r)throw new xMe(e);return r},zb("tags"),pR([]));function FQ({fetch:e,GRAPHQL_URL:r}){return async({query:n,variables:h})=>e(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:h})}).then(a=>a.json())}function BMe({fetch:e,GRAPHQL_URL:r}){let n=FQ({fetch:e,GRAPHQL_URL:r}),h=zQ({fetch:e,GRAPHQL_URL:r}),a=`
139
139
  query GetTransactions ($transactionIds: [ID!]!) {
140
140
  transactions(ids: $transactionIds) {
141
141
  edges {
@@ -190,7 +190,7 @@ ${JSON.stringify(St.from(n))},${JSON.stringify(St.from(h))},${d} => ${JSON.strin
190
190
  }
191
191
  }
192
192
  }
193
- }`,a=Jt.object({data:Jt.object({transactions:Jt.object({edges:Jt.array(Jt.object({node:Jt.record(Jt.any())}))})})});return d=>ui(d).chain(tn(c=>e(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:h,variables:{transactionIds:[c]}})}).then(async v=>{if(v.ok)return v.json();throw n('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${v.status}: ${await v.text()}`)}).then(a.parse).then(UEe(["data","transactions","edges","0","node"])))).toPromise()}var ZAe=BR(s_e(),1),Aee=(e="@permaweb/aoconnect")=>{let r=(0,ZAe.default)(e);return r.child=n=>Aee(`${r.namespace}:${n}`),r.tap=(n,...h)=>ZEe((...a)=>r(n,...h,...a)),r},Ree=({url:e,path:r})=>r?r.startsWith("/")?Ree({url:e,path:r.slice(1)}):(e=new URL(e),e.pathname+=r,e.toString()):e;function WAe(e){return jd(Gb([]),qd((r,n)=>jd(FEe([],n.name),FR(n.value),Ps(n.name,nh,r))(r),{}),Zb(r=>r.length>1?r:r[0]))(e)}function Bs(e,r){return n=>XQ(YSe([_Q(e,"name"),HR(jR(r),_Q(r,"value"),$R)]),n)}function EQ(e){return fee([[B2(String),Nd(e)],[B2(Array),kEe(e)],[$R,aSe]])}function Ul(e){let r;return B2(Os,e)?(r=new Error(GAe(e)),r.stack+=e.stack):B2(Error,e)?r=e:REe("message",e)?r=new Error(e.message):B2(String,e)?r=new Error(e):r=new Error("An error occurred"),r}function GAe(e){return jd(r=>function n(h,a,d){return qd((c,v)=>jd(fee([[Nd(gr.invalid_arguments),()=>n(v.argumentsError,422,"Invalid Arguments")],[Nd(gr.invalid_return_type),()=>n(v.returnTypeError,500,"Invalid Return")],[Nd(gr.invalid_union),()=>cEe(w=>n(w,400,"Invalid Union"),v.unionErrors)],[$R,()=>[{...v,status:a,contextCode:d}]]]),zR(c))(v.code),[],h.issues)}(r,400,""),r=>qd((n,h)=>{let{message:a,path:d,contextCode:c}=h,v=d[1]||d[0],w=c?`${c} `:"";return n.push(`${w}'${v}': ${a}.`),n},[],r),CEe(" | "))(e)}var VAe=Jt.object({id:Jt.string().min(1,{message:"message is required to be a message id"}),processId:Jt.string().min(1,{message:"process is required to be a process id"})});function YAe(){return e=>ui(e).map(VAe.parse).map(()=>e)}var J2=Jt.object({name:Jt.string(),value:Jt.string()}),JAe=Jt.function().args(Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))})).returns(Jt.promise(Jt.any())),XAe=Jt.function().args(Jt.object({id:Jt.string().min(1,{message:"message id is required"}),processId:Jt.string().min(1,{message:"process id is required"})})).returns(Jt.promise(Jt.any())),QAe=Jt.function().args(Jt.object({process:Jt.string().min(1,{message:"process id is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()})).returns(Jt.promise(Jt.object({edges:Jt.array(Jt.object({cursor:Jt.string(),node:Jt.object({Output:Jt.any().optional(),Messages:Jt.array(Jt.any()).optional(),Spawns:Jt.array(Jt.any()).optional(),Error:Jt.any().optional()})}))}))),xee=Jt.function().args(Jt.object({processId:Jt.string(),data:Jt.any(),tags:Jt.array(J2),anchor:Jt.string().optional(),signer:Jt.any()})).returns(Jt.promise(Jt.object({messageId:Jt.string()}).passthrough())),eRe=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(J2),signer:Jt.any()})).returns(Jt.promise(Jt.object({processId:Jt.string()}).passthrough())),tRe=Jt.function().args(Jt.object({process:Jt.string(),message:Jt.string(),baseLayer:Jt.boolean().optional(),exclude:Jt.array(Jt.string()).optional()})).returns(Jt.promise(Jt.object({assignmentId:Jt.string()}).passthrough())),Tee=xee,KKe=Jt.function().args(Jt.object({suUrl:Jt.string().url(),processId:Jt.string()})).returns(Jt.promise(Jt.object({tags:Jt.array(J2)}).passthrough())),ZKe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({url:Jt.string()}))),rRe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.boolean())),iRe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({tags:Jt.array(J2)}).passthrough())),Vb=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(J2),target:Jt.string().optional(),anchor:Jt.string().optional()})).returns(Jt.promise(Jt.object({id:Jt.string(),raw:Jt.any()})));function nRe({loadResult:e}){return e=tn(XAe.implement(e)),r=>ui({id:r.id,processId:r.processId}).chain(e)}function aRe(e){let r=YAe(e),n=nRe(e);return({message:h,process:a})=>ui({id:h,processId:a}).chain(r).chain(n).map(e.logger.tap('readResult result for message "%s": %O',h)).map(d=>d).bimap(Ul,$l).toPromise()}var oRe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function sRe(){return e=>ui(e.tags).map(Gb([])).map(Bs("Data-Protocol","ao")).map(Bs("Variant")).map(Bs("Type")).map(Bs("SDK")).map(zR(nh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(oRe.parse).map(Ps("tags",nh,e))}function fRe({logger:e}){return r=>ui(r).chain(HR(jR(r.data),()=>Pl(r),()=>Pl(Math.random().toString().slice(-4)).map(Ps("data",nh,r)).map(n=>jd(Dl("tags"),Bs("Content-Type"),FR({name:"Content-Type",value:"text/plain"}),Ps("tags",nh,n))(n)).map(e.tap('added pseudo-random string as message "data"'))))}function uRe(e){let r=sRe(e),n=fRe(e),h=xee.implement(e.deployMessage);return a=>ui(a).chain(r).chain(n).chain(tn(({id:d,data:c,tags:v,anchor:w,signer:m})=>h({processId:d,data:c,tags:v,anchor:w,signer:Vb.implement(m)}))).map(d=>Ps("messageId",d.messageId,a))}function hRe(e){let r=uRe(e);return({process:n,data:h,tags:a,anchor:d,signer:c})=>ui({id:n,data:h,tags:a,anchor:d,signer:c}).chain(r).map(v=>v.messageId).bimap(Ul,$l).toPromise()}var R2=(e,r,n)=>h=>r(h[e])?Pl(h):s0(`Tag '${e}': ${n}`);function lRe({loadTransactionMeta:e,logger:r}){return e=tn(iRe.implement(e)),n=>ui(n).chain(e).map(Dl("tags")).map(WAe).chain(R2("Data-Protocol",EQ("ao"),"value 'ao' was not found on module")).chain(R2("Type",EQ("Module"),"value 'Module' was not found on module")).chain(R2("Module-Format",lR,"was not found on module")).chain(R2("Input-Encoding",lR,"was not found on module")).chain(R2("Output-Encoding",lR,"was not found on module")).bimap(r.tap("Verifying module source failed: %s"),r.tap("Verified module source"))}function cRe({logger:e,validateScheduler:r}){return r=tn(rRe.implement(r)),n=>ui(n).chain(h=>r(h).chain(a=>a?Pl(h):s0(`Valid Scheduler-Location owned by ${h} not found`))).bimap(e.tap("Verifying scheduler failed: %s"),e.tap("Verified scheduler"))}function dRe({logger:e}){return r=>ui(r).map(e.tap("Checking for signer")).chain(n=>n?Pl(n):s0("signer not found"))}function pRe(e){let r=e.logger.child("verifyInput");e={...e,logger:r};let n=lRe(e),h=cRe(e),a=dRe(e);return d=>ui(d).chain(c=>n(c.module).map(()=>c)).chain(c=>h(c.scheduler)).map(()=>d).chain(c=>a(c.signer).map(()=>c)).bimap(r.tap("Error when verify input: %s"),r.tap("Successfully verified inputs"))}var vRe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function mRe(){return e=>ui(e).map(Dl("tags")).map(Gb([])).map(Bs("Data-Protocol","ao")).map(Bs("Variant")).map(Bs("Type")).map(Bs("Module")).map(Bs("Scheduler")).map(Bs("SDK")).map(zR(nh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:e.module},{name:"Scheduler",value:e.scheduler},{name:"SDK",value:"aoconnect"}])).map(vRe.parse).map(Ps("tags",nh,e))}function gRe({logger:e}){return r=>ui(r).chain(HR(jR(r.data),()=>Pl(r),()=>Pl(Math.random().toString().slice(-4)).map(Ps("data",nh,r)).map(n=>jd(Dl("tags"),Bs("Content-Type"),FR({name:"Content-Type",value:"text/plain"}),Ps("tags",nh,n))(n)).map(e.tap('added pseudo-random string as process "data"'))))}function yRe(e){let r=e.logger.child("uploadProcess");e={...e,logger:r};let n=mRe(e),h=gRe(e),a=eRe.implement(e.deployProcess);return d=>ui(d).chain(n).chain(h).chain(tn(({data:c,tags:v,signer:w})=>a({data:c,tags:v,signer:Vb.implement(w)}))).map(c=>Ps("processId",c.processId,d))}function bRe(e){let r=pRe(e),n=yRe(e);return({module:h,scheduler:a,signer:d,tags:c,data:v})=>ui({module:h,scheduler:a,signer:d,tags:c,data:v}).chain(r).chain(n).map(w=>w.processId).bimap(Ul,$l).toPromise()}function wRe(e){let r=Tee.implement(e.deployMonitor);return n=>ui(n).chain(tn(({id:h,signer:a})=>r({processId:h,signer:Vb.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Ps("monitorId",h.messageId,n))}function _Re(e){let r=wRe(e);return({process:n,signer:h})=>ui({id:n,signer:h}).chain(r).map(a=>a.monitorId).bimap(Ul,$l).toPromise()}function MRe(e){let r=Tee.implement(e.deployUnmonitor);return n=>ui(n).chain(tn(({id:h,signer:a})=>r({processId:h,signer:Vb.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Ps("monitorId",h.messageId,n))}function SRe(e){let r=MRe(e);return({process:n,signer:h})=>ui({id:n,signer:h}).chain(r).map(a=>a.monitorId).bimap(Ul,$l).toPromise()}var ERe=Jt.object({process:Jt.string().min(1,{message:"process identifier is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()});function ARe(){return e=>ui(e).map(ERe.parse).map(()=>e)}function RRe({queryResults:e}){return e=tn(QAe.implement(e)),r=>ui({process:r.process,from:r.from,to:r.to,sort:r.sort,limit:r.limit}).chain(e)}function xRe(e){let r=ARe(e),n=RRe(e);return({process:h,from:a,to:d,sort:c,limit:v})=>ui({process:h,from:a,to:d,sort:c,limit:v}).chain(r).chain(n).map(e.logger.tap('readResults result for message "%s": %O',h)).map(w=>w).bimap(Ul,$l).toPromise()}var TRe=Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))});function kRe(){return e=>ui(e).map(TRe.parse).map(r=>(r.Tags=r.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),r))}function IRe({dryrunFetch:e}){return tn(JAe.implement(e))}function BRe(e){let r=kRe(e),n=IRe(e);return h=>ui(h).map(ORe).chain(r).chain(n).toPromise()}function ORe({process:e,data:r,tags:n,anchor:h,...a}){return{Id:"1234",Owner:"1234",...a,Target:e,Data:r||"1234",Tags:n||[],Anchor:h||"0"}}function PRe(e){let r=tRe.implement(e.deployAssign);return n=>ui(n).chain(tn(({process:h,message:a,baseLayer:d,exclude:c})=>r({process:h,message:a,baseLayer:d,exclude:c}))).map(h=>Ps("assignmentId",h.assignmentId,n))}function NRe(e){let r=PRe(e);return({process:n,message:h,baseLayer:a,exclude:d})=>ui({process:n,message:h,baseLayer:a,exclude:d}).chain(r).map(c=>c.assignmentId).bimap(Ul,$l).toPromise()}var CRe="https://arweave.net",LRe="https://mu.ao-testnet.xyz",DRe="https://cu.ao-testnet.xyz";function X2({GRAPHQL_URL:e,GATEWAY_URL:r=CRe,MU_URL:n=LRe,CU_URL:h=DRe}={}){let a=Aee();e||(e=Ree({url:r,path:"/graphql"}));let{validate:d}=GQ({cacheSize:100,GRAPHQL_URL:e}),c=iSe({MAX_SIZE:25}),v=a.child("result"),w=aRe({loadResult:eSe({fetch,CU_URL:h,logger:v}),logger:v}),m=a.child("message"),y=hRe({loadProcessMeta:fR({fetch,cache:c,logger:m}),deployMessage:GMe({fetch,MU_URL:n,logger:m}),logger:m}),g=a.child("spawn"),S=bRe({loadTransactionMeta:KAe({fetch,GRAPHQL_URL:e,logger:g}),validateScheduler:d,deployProcess:VMe({fetch,MU_URL:n,logger:g}),logger:g}),R=a.child("monitor"),A=_Re({loadProcessMeta:fR({fetch,cache:c,logger:R}),deployMonitor:YMe({fetch,MU_URL:n,logger:R}),logger:R}),k=a.child("unmonitor"),I=SRe({loadProcessMeta:fR({fetch,cache:c,logger:k}),deployUnmonitor:JMe({fetch,MU_URL:n,logger:k}),logger:R}),B=a.child("results"),P=xRe({queryResults:tSe({fetch,CU_URL:h,logger:B}),logger:B}),C=a.child("dryrun"),q=BRe({dryrunFetch:QMe({fetch,CU_URL:h,logger:C}),logger:C}),K=a.child("assign"),V=NRe({deployAssign:XMe({fetch,MU_URL:n,logger:K}),logger:m});return{result:w,results:P,message:y,spawn:S,monitor:A,unmonitor:I,dryrun:q,assign:V}}var kee={};xQ(kee,{createDataItemSigner:()=>fxe});var Iee=BR(h_e(),1),Bee={};xQ(Bee,{AVSCTap:()=>Q2,ArweaveSigner:()=>GR,DataItem:()=>W2,MAX_TAG_BYTES:()=>Yb,MIN_BINARY_SIZE:()=>JR,SIG_CONFIG:()=>Kd,SignatureConfig:()=>Is,Signer:()=>Cee,createData:()=>Uee,default:()=>axe,deserializeTags:()=>jb,indexToType:()=>VR,serializeTags:()=>YR,tagsExceedLimit:()=>$ee,warparbundles:()=>oxe});var $Re=Object.create,ZR=Object.defineProperty,URe=Object.getOwnPropertyDescriptor,qRe=Object.getOwnPropertyNames,jRe=Object.getPrototypeOf,FRe=Object.prototype.hasOwnProperty,oh=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),zRe=(e,r)=>{for(var n in r)ZR(e,n,{get:r[n],enumerable:!0})},HRe=(e,r,n,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of qRe(r))!FRe.call(e,a)&&a!==n&&ZR(e,a,{get:()=>r[a],enumerable:!(h=URe(r,a))||h.enumerable});return e},ql=(e,r,n)=>(n=e!=null?$Re(jRe(e)):{},HRe(r||!e||!e.__esModule?ZR(n,"default",{value:e,enumerable:!0}):n,e)),KRe=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function r(n){var h=4,a=n.length,d=a%h;if(!d)return n;var c=a,v=h-d,w=a+v,m=St.alloc(w);for(m.write(n);v--;)m.write("=",c++);return m.toString()}e.default=r}),ZRe=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=KRe();function n(w,m){return m===void 0&&(m="utf8"),St.isBuffer(w)?d(w.toString("base64")):d(St.from(w,m).toString("base64"))}function h(w,m){return m===void 0&&(m="utf8"),St.from(a(w),"base64").toString(m)}function a(w){return w=w.toString(),r.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function d(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(w){return St.from(a(w),"base64")}var v=n;v.encode=n,v.decode=h,v.toBase64=a,v.fromBase64=d,v.toBuffer=c,e.default=v}),WR=oh((e,r)=>{r.exports=ZRe().default,r.exports.default=r.exports}),Oee=oh(e=>{"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=R;var r=[],n=[],h=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,c=a.length;d<c;++d)r[d]=a[d],n[a.charCodeAt(d)]=d;var d,c;n[45]=62,n[95]=63;function v(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=k);var B=I===k?0:4-I%4;return[I,B]}function w(A){var k=v(A),I=k[0],B=k[1];return(I+B)*3/4-B}function m(A,k,I){return(k+I)*3/4-I}function y(A){var k,I=v(A),B=I[0],P=I[1],C=new h(m(A,B,P)),q=0,K=P>0?B-4:B,V;for(V=0;V<K;V+=4)k=n[A.charCodeAt(V)]<<18|n[A.charCodeAt(V+1)]<<12|n[A.charCodeAt(V+2)]<<6|n[A.charCodeAt(V+3)],C[q++]=k>>16&255,C[q++]=k>>8&255,C[q++]=k&255;return P===2&&(k=n[A.charCodeAt(V)]<<2|n[A.charCodeAt(V+1)]>>4,C[q++]=k&255),P===1&&(k=n[A.charCodeAt(V)]<<10|n[A.charCodeAt(V+1)]<<4|n[A.charCodeAt(V+2)]>>2,C[q++]=k>>8&255,C[q++]=k&255),C}function g(A){return r[A>>18&63]+r[A>>12&63]+r[A>>6&63]+r[A&63]}function S(A,k,I){for(var B,P=[],C=k;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function R(A){for(var k,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(k=A[I-1],P.push(r[k>>2]+r[k<<4&63]+"==")):B===2&&(k=(A[I-2]<<8)+A[I-1],P.push(r[k>>10]+r[k>>4&63]+r[k<<2&63]+"=")),P.join("")}}),Pee=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.b64UrlDecode=e.b64UrlEncode=e.bufferTob64Url=e.bufferTob64=e.b64UrlToBuffer=e.stringToB64Url=e.stringToBuffer=e.bufferToString=e.b64UrlToString=e.concatBuffers=void 0;var r=Oee();function n(S){let R=0;for(let I=0;I<S.length;I++)R+=S[I].byteLength;let A=new Uint8Array(R),k=0;A.set(new Uint8Array(S[0]),k),k+=S[0].byteLength;for(let I=1;I<S.length;I++)A.set(new Uint8Array(S[I]),k),k+=S[I].byteLength;return A}e.concatBuffers=n;function h(S){let R=v(S);return a(R)}e.b64UrlToString=h;function a(S){return new TextDecoder("utf-8",{fatal:!0}).decode(S)}e.bufferToString=a;function d(S){return new TextEncoder().encode(S)}e.stringToBuffer=d;function c(S){return m(d(S))}e.stringToB64Url=c;function v(S){return new Uint8Array(r.toByteArray(g(S)))}e.b64UrlToBuffer=v;function w(S){return r.fromByteArray(new Uint8Array(S))}e.bufferTob64=w;function m(S){return y(w(S))}e.bufferTob64Url=m;function y(S){return S.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}e.b64UrlEncode=y;function g(S){S=S.replace(/\-/g,"+").replace(/\_/g,"/");let R;return S.length%4==0?R=0:R=4-S.length%4,S.concat("=".repeat(R))}e.b64UrlDecode=g}),WRe=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Pee(),n=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let h=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),a=await this.driver.exportKey("jwk",h.privateKey);return{kty:a.kty,e:a.e,n:a.n,d:a.d,p:a.p,q:a.q,dp:a.dp,dq:a.dq,qi:a.qi}}async sign(h,a,{saltLength:d}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(h),a);return new Uint8Array(c)}async hash(h,a="SHA-256"){let d=await this.driver.digest(a,h);return new Uint8Array(d)}async verify(h,a,d){let c={kty:"RSA",e:"AQAB",n:h},v=await this.jwkToPublicCryptoKey(c),w=await this.driver.digest("SHA-256",a),m=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,d,a),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,d,a),g=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-w.byteLength-2},v,d,a);return m||y||g}async jwkToCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let h=crypto?.subtle;return h===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(a=>typeof h[a]=="function")}async encrypt(h,a,d){let c=await this.driver.importKey("raw",typeof a=="string"?r.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let m=await this.driver.encrypt({name:"AES-CBC",iv:w},v,h);return r.concatBuffers([w,m])}async decrypt(h,a,d){let c=await this.driver.importKey("raw",typeof a=="string"?r.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=h.slice(0,16),m=await this.driver.decrypt({name:"AES-CBC",iv:w},v,h.slice(16));return r.concatBuffers([m])}};e.default=n}),GRe=oh(e=>{e.read=function(r,n,h,a,d){var c,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=h?d-1:0,R=h?-1:1,A=r[n+S];for(S+=R,c=A&(1<<-g)-1,A>>=-g,g+=w;g>0;c=c*256+r[n+S],S+=R,g-=8);for(v=c&(1<<-g)-1,c>>=-g,g+=a;g>0;v=v*256+r[n+S],S+=R,g-=8);if(c===0)c=1-y;else{if(c===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),c=c-y}return(A?-1:1)*v*Math.pow(2,c-a)},e.write=function(r,n,h,a,d,c){var v,w,m,y=c*8-d-1,g=(1<<y)-1,S=g>>1,R=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:c-1,k=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=R/m:n+=R*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;r[h+A]=w&255,A+=k,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;r[h+A]=v&255,A+=k,v/=256,y-=8);r[h+A-k]|=I*128}}),TR=oh(e=>{"use strict";var r=Oee(),n=GRe(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return k(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?c(O):N!==void 0?typeof $=="string"?c(O).fill(N,$):c(O).fill(N):c(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),c(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=c($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function R(O){let N=O.length<0?0:B(O.length)|0,$=c(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return k(N.buffer,N.byteOffset,N.byteLength)}return R(O)}function k(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=c(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?c(0):R(O);if(O.type==="Buffer"&&Array.isArray(O.data))return R(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(O){return O!=null&&O._isBuffer===!0&&O!==v.prototype},v.compare=function(O,N){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(O)||!v.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(O===N)return 0;let $=O.length,ee=N.length;for(let re=0,se=Math.min($,ee);re<se;++re)if(O[re]!==N[re]){$=O[re],ee=N[re];break}return $<ee?-1:ee<$?1:0},v.isEncoding=function(O){switch(String(O).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(O,N){if(!Array.isArray(O))throw new TypeError('"list" argument must be an Array of Buffers');if(O.length===0)return v.alloc(0);let $;if(N===void 0)for(N=0,$=0;$<O.length;++$)N+=O[$].length;let ee=v.allocUnsafe(N),re=0;for($=0;$<O.length;++$){let se=O[$];if(ut(se,Uint8Array))re+se.length>ee.length?(v.isBuffer(se)||(se=v.from(se)),se.copy(ee,re)):Uint8Array.prototype.set.call(ee,se,re);else if(v.isBuffer(se))se.copy(ee,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=se.length}return ee};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return t(this,N,$);case"utf8":case"utf-8":return l(this,N,$);case"ascii":return x(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return f(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let O=this.length;if(O%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<O;N+=2)K(this,N,N+1);return this},v.prototype.swap32=function(){let O=this.length;if(O%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<O;N+=4)K(this,N,N+3),K(this,N+1,N+2);return this},v.prototype.swap64=function(){let O=this.length;if(O%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<O;N+=8)K(this,N,N+7),K(this,N+1,N+6),K(this,N+2,N+5),K(this,N+3,N+4);return this},v.prototype.toString=function(){let O=this.length;return O===0?"":arguments.length===0?l(this,0,O):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(O){if(!v.isBuffer(O))throw new TypeError("Argument must be a Buffer");return this===O?!0:v.compare(this,O)===0},v.prototype.inspect=function(){let O="",N=e.INSPECT_MAX_BYTES;return O=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(O+=" ... "),"<Buffer "+O+">"},h&&(v.prototype[h]=v.prototype.inspect),v.prototype.compare=function(O,N,$,ee,re){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(N===void 0&&(N=0),$===void 0&&($=O?O.length:0),ee===void 0&&(ee=0),re===void 0&&(re=this.length),N<0||$>O.length||ee<0||re>this.length)throw new RangeError("out of range index");if(ee>=re&&N>=$)return 0;if(ee>=re)return-1;if(N>=$)return 1;if(N>>>=0,$>>>=0,ee>>>=0,re>>>=0,this===O)return 0;let se=re-ee,ce=$-N,st=Math.min(se,ce),ye=this.slice(ee,re),be=O.slice(N,$);for(let me=0;me<st;++me)if(ye[me]!==be[me]){se=ye[me],ce=be[me];break}return se<ce?-1:ce<se?1:0};function V(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,Te){return se===1?me[Te]:me.readUInt16BE(Te*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let Te=0;Te<st;Te++)if(ye(O,be+Te)!==ye(N,Te)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(O,N,$){return this.indexOf(O,N,$)!==-1},v.prototype.indexOf=function(O,N,$){return V(this,O,N,$,!0)},v.prototype.lastIndexOf=function(O,N,$){return V(this,O,N,$,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(O,N,$,ee){if(N===void 0)ee="utf8",$=this.length,N=0;else if($===void 0&&typeof N=="string")ee=N,$=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite($)?($=$>>>0,ee===void 0&&(ee="utf8")):(ee=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let re=this.length-N;if(($===void 0||$>re)&&($=re),O.length>0&&($<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let se=!1;for(;;)switch(ee){case"hex":return z(this,O,N,$);case"utf8":case"utf-8":return J(this,O,N,$);case"ascii":case"latin1":case"binary":return E(this,O,N,$);case"base64":return i(this,O,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,O,N,$);default:if(se)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),se=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(O,N,$){return N===0&&$===O.length?r.fromByteArray(O):r.fromByteArray(O.slice(N,$))}function l(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,Te;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(Te=(se&31)<<6|ye&63,Te>127&&(ce=Te));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(Te=(se&15)<<12|(ye&63)<<6|be&63,Te>2047&&(Te<55296||Te>57343)&&(ce=Te));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(Te=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,Te>65535&&Te<1114112&&(ce=Te))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function x(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function t(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=ke[O[se]];return re}function u(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(O,N){let $=this.length;O=~~O,N=N===void 0?$:~~N,O<0?(O+=$,O<0&&(O=0)):O>$&&(O=$),N<0?(N+=$,N<0&&(N=0)):N>$&&(N=$),N<O&&(N=O);let ee=this.subarray(O,N);return Object.setPrototypeOf(ee,v.prototype),ee};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return ee},v.prototype.readUintBE=v.prototype.readUIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O+--N],re=1;for(;N>0&&(re*=256);)ee+=this[O+--N]*re;return ee},v.prototype.readUint8=v.prototype.readUInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]|this[O+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]<<8|this[O+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+this[O+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]*16777216+(this[O+1]<<16|this[O+2]<<8|this[O+3])},v.prototype.readBigUInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24,re=this[++O]+this[++O]*2**8+this[++O]*2**16+$*2**24;return BigInt(ee)+(BigInt(re)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N*2**24+this[++O]*2**16+this[++O]*2**8+this[++O],re=this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$;return(BigInt(ee)<<BigInt(32))+BigInt(re)}),v.prototype.readIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return re*=128,ee>=re&&(ee-=Math.pow(2,8*N)),ee},v.prototype.readIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=N,re=1,se=this[O+--ee];for(;ee>0&&(re*=256);)se+=this[O+--ee]*re;return re*=128,se>=re&&(se-=Math.pow(2,8*N)),se},v.prototype.readInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]&128?(255-this[O]+1)*-1:this[O]},v.prototype.readInt16LE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O]|this[O+1]<<8;return $&32768?$|4294901760:$},v.prototype.readInt16BE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O+1]|this[O]<<8;return $&32768?$|4294901760:$},v.prototype.readInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},v.prototype.readInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},v.prototype.readBigInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=this[O+4]+this[O+5]*2**8+this[O+6]*2**16+($<<24);return(BigInt(ee)<<BigInt(32))+BigInt(N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24)}),v.prototype.readBigInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=(N<<24)+this[++O]*2**16+this[++O]*2**8+this[++O];return(BigInt(ee)<<BigInt(32))+BigInt(this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$)}),v.prototype.readFloatLE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!0,23,4)},v.prototype.readFloatBE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!1,23,4)},v.prototype.readDoubleLE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!0,52,8)},v.prototype.readDoubleBE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=1,se=0;for(this[N]=O&255;++se<$&&(re*=256);)this[N+se]=O/re&255;return N+$},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=$-1,se=1;for(this[N+re]=O&255;--re>=0&&(se*=256);)this[N+re]=O/se&255;return N+$},v.prototype.writeUint8=v.prototype.writeUInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,255,0),this[N]=O&255,N+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N+3]=O>>>24,this[N+2]=O>>>16,this[N+1]=O>>>8,this[N]=O&255,N+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4};function T(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(O,N=0){return T(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(O,N=0){return D(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=0,se=1,ce=0;for(this[N]=O&255;++re<$&&(se*=256);)O<0&&ce===0&&this[N+re-1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=$-1,se=1,ce=0;for(this[N+re]=O&255;--re>=0&&(se*=256);)O<0&&ce===0&&this[N+re+1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,127,-128),O<0&&(O=255+O+1),this[N]=O&255,N+1},v.prototype.writeInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),this[N]=O&255,this[N+1]=O>>>8,this[N+2]=O>>>16,this[N+3]=O>>>24,N+4},v.prototype.writeInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4},v.prototype.writeBigInt64LE=mt(function(O,N=0){return T(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(O,N=0){return D(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(O,N,$){return W(this,O,N,!0,$)},v.prototype.writeFloatBE=function(O,N,$){return W(this,O,N,!1,$)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(O,N,$){return X(this,O,N,!0,$)},v.prototype.writeDoubleBE=function(O,N,$){return X(this,O,N,!1,$)},v.prototype.copy=function(O,N,$,ee){if(!v.isBuffer(O))throw new TypeError("argument should be a Buffer");if($||($=0),!ee&&ee!==0&&(ee=this.length),N>=O.length&&(N=O.length),N||(N=0),ee>0&&ee<$&&(ee=$),ee===$||O.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),O.length-N<ee-$&&(ee=O.length-N+$);let re=ee-$;return this===O&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,$,ee):Uint8Array.prototype.set.call(O,this.subarray($,ee),N),re},v.prototype.fill=function(O,N,$,ee){if(typeof O=="string"){if(typeof N=="string"?(ee=N,N=0,$=this.length):typeof $=="string"&&(ee=$,$=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!v.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(O.length===1){let se=O.charCodeAt(0);(ee==="utf8"&&se<128||ee==="latin1")&&(O=se)}}else typeof O=="number"?O=O&255:typeof O=="boolean"&&(O=Number(O));if(N<0||this.length<N||this.length<$)throw new RangeError("Out of range index");if($<=N)return this;N=N>>>0,$=$===void 0?this.length:$>>>0,O||(O=0);let re;if(typeof O=="number")for(re=N;re<$;++re)this[re]=O;else{let se=v.isBuffer(O)?O:v.from(O,ee),ce=se.length;if(ce===0)throw new TypeError('The value "'+O+'" is invalid for argument "value"');for(re=0;re<$-N;++re)this[re+N]=se[re%ce]}return this};var G={};function Y(O,N,$){G[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new G.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new G.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new G.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return r.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var ke=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}),VRe=oh((e,r)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,r.exports={Buffer:TR().Buffer,Crypto:window.crypto}):r.exports={Buffer:TR().Buffer,Crypto:crypto}}),Nee={};zRe(Nee,{AVSCTap:()=>Q2,ArweaveSigner:()=>GR,DataItem:()=>W2,MAX_TAG_BYTES:()=>Yb,MIN_BINARY_SIZE:()=>JR,SIG_CONFIG:()=>Kd,SignatureConfig:()=>Is,Signer:()=>Cee,createData:()=>Uee,deserializeTags:()=>jb,indexToType:()=>VR,serializeTags:()=>YR,tagsExceedLimit:()=>$ee});var Cee=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,n,h){throw new Error("You must implement verify method on child")}},YRe=ql(WR(),1),xf=ql(Pee(),1);async function Lee(e){if(Array.isArray(e)){let a=(0,xf.concatBuffers)([(0,xf.stringToBuffer)("list"),(0,xf.stringToBuffer)(e.length.toString())]);return await Dee(e,await rh().hash(a,"SHA-384"))}let r=e,n=(0,xf.concatBuffers)([(0,xf.stringToBuffer)("blob"),(0,xf.stringToBuffer)(r.byteLength.toString())]),h=(0,xf.concatBuffers)([await rh().hash(n,"SHA-384"),await rh().hash(r,"SHA-384")]);return await rh().hash(h,"SHA-384")}async function Dee(e,r){if(e.length<1)return r;let n=(0,xf.concatBuffers)([r,await Lee(e[0])]),h=await rh().hash(n,"SHA-384");return await Dee(e.slice(1),h)}var dR=ql(WRe(),1),JRe=dR.default.default?dR.default.default:dR.default,XRe=class extends JRe{getPublicKey(e){throw new Error("Unimplemented")}},QRe;function rh(){return QRe??=new XRe}var Is;(function(e){e[e.ARWEAVE=1]="ARWEAVE",e[e.ED25519=2]="ED25519",e[e.ETHEREUM=3]="ETHEREUM",e[e.SOLANA=4]="SOLANA",e[e.INJECTEDAPTOS=5]="INJECTEDAPTOS",e[e.MULTIAPTOS=6]="MULTIAPTOS",e[e.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Is||(Is={}));var Kd={[Is.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Is.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Is.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Is.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Is.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Is.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Is.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},GR=class{signatureType=1;ownerLength=Kd[1].pubLength;signatureLength=Kd[1].sigLength;jwk;pk;constructor(e){this.pk=e.n,this.jwk=e}get publicKey(){return YRe.default.toBuffer(this.pk)}sign(e){return rh().sign(this.jwk,e)}static async verify(e,r,n){return await rh().verify(e,r,n)}},VR={1:GR},lu=ql(WR(),1);async function kR(e){return Lee([(0,xf.stringToBuffer)("dataitem"),(0,xf.stringToBuffer)("1"),(0,xf.stringToBuffer)(e.signatureType.toString()),e.rawOwner,e.rawTarget,e.rawAnchor,e.rawTags,e.rawData])}async function exe(e,r){let n=await kR(e),h=await r.sign(n),a=await rh().hash(h);return{signature:St.from(h),id:St.from(a)}}async function txe(e,r){let{signature:n,id:h}=await exe(e,r);return e.getRaw().set(n,2),h}var Q2=class{buf;pos;constructor(e=St.alloc(Yb),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,n;if(r)for(this.writeLong(r),n=0;n<r;n++){let h=e[n];if(h?.name===void 0||h?.value===void 0)throw new Error(`Invalid tag format for ${h}, expected {name:string, value: string}`);this.writeString(h.name),this.writeString(h.value)}this.writeLong(0)}toBuffer(){let e=St.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(e){let r=this.buf,n,h;if(e>=-1073741824&&e<1073741824){h=e>=0?e<<1:~e<<1|1;do r[this.pos]=h&127,h>>=7;while(h&&(r[this.pos++]|=128))}else{n=e>=0?e*2:-e*2-1;do r[this.pos]=n&127,n/=128;while(n>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=St.byteLength(e),n=this.buf;this.writeLong(r);let h=this.pos;if(this.pos+=r,!(this.pos>n.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let a,d,c,v;for(a=0,d=r;a<d;a++)c=e.charCodeAt(a),c<128?n[h++]=c:c<2048?(n[h++]=c>>6|192,n[h++]=c&63|128):(c&64512)===55296&&((v=e.charCodeAt(a+1))&64512)===56320?(c=65536+((c&1023)<<10)+(v&1023),a++,n[h++]=c>>18|240,n[h++]=c>>12&63|128,n[h++]=c>>6&63|128,n[h++]=c&63|128):(n[h++]=c>>12|224,n[h++]=c>>6&63|128,n[h++]=c&63|128)}this.buf=n}}readLong(){let e=0,r=0,n=this.buf,h,a,d,c;do h=n[this.pos++],a=h&128,e|=(h&127)<<r,r+=7;while(a&&r<28);if(a){d=e,c=268435456;do h=n[this.pos++],d+=(h&127)*c,c*=128;while(h&128);return(d%2?-(d+1):d)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let n=this.readString(),h=this.readString();e.push({name:n,value:h})}return e}readString(){let e=this.readLong(),r=this.pos,n=this.buf;if(this.pos+=e,!(this.pos>n.length))return this.buf.slice(r,r+e).toString()}};function YR(e){let r=new Q2;return r.writeTags(e),r.toBuffer()}function $ee(e){let r=new Q2;return r.writeTags(e),r.tagsExceedLimit()}function jb(e){return new Q2(e).readTags()}function i0(e){let r=0;for(let n=e.length-1;n>=0;n--)r=r*256+e[n];return r}function rxe(e){if(e>29)throw new Error("Short too long");let r=[0,0];for(let n=0;n<r.length;n++){let h=e&255;r[n]=h,e=(e-h)/256}return Uint8Array.from(r)}function AQ(e){let r=[0,0,0,0,0,0,0,0];for(let n=0;n<r.length;n++){let h=e&255;r[n]=h,e=(e-h)/256}return Uint8Array.from(r)}var ixe=ql(VRe(),1),Od=ql(TR(),1),Yb=4096,JR=80,W2=class{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=i0(this.binary.subarray(0,2));if(Is?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return W2.verify(this.binary)}get id(){return(async()=>lu.default.encode(await this.rawId))()}set id(e){this._id=lu.default.toBuffer(e)}get rawId(){return(async()=>Od.Buffer.from(await ixe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return lu.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Kd[this.signatureType].sigLength}get owner(){return lu.default.encode(this.rawOwner)}get ownerLength(){return Kd[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Od.Buffer.alloc(0)}get target(){return lu.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Od.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let e=this.getTagsStart(),r=i0(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(i0(this.binary.subarray(e,e+8))==0)return[];let r=i0(this.binary.subarray(e+8,e+16));return jb(Od.Buffer.from(this.binary.subarray(e+16,e+16+r)))}get tagsB64Url(){return this.tags.map(e=>({name:lu.default.encode(e.name),value:lu.default.encode(e.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),n=i0(r);return e+16+n}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),n=i0(r),h=e+16+n;return this.binary.subarray(h,this.binary.length)}get data(){return lu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await txe(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Od.Buffer.from(await rh().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:lu.default.encode(e.name),value:lu.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<JR)return!1;let r=new W2(e),n=r.signatureType,h=r.getTagsStart(),a=i0(e.subarray(h,h+8)),d=e.subarray(h+8,h+16),c=i0(d);if(c>Yb)return!1;if(a>0)try{if(jb(Od.Buffer.from(e.subarray(h+16,h+16+c))).length!==a)return!1}catch{return!1}let v=VR[n],w=await kR(r);return await v.verify(r.rawOwner,w,r.rawSignature)}async getSignatureData(){return kR(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,n=e+(r?33:1),h=this.binary[n]==1;return n+=h?33:1,n}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},nxe=ql(WR(),1);function Uee(e,r,n){let h=r.publicKey,a=n?.target?nxe.default.toBuffer(n.target):null,d=1+(a?.byteLength??0),c=n?.anchor?St.from(n.anchor):null,v=1+(c?.byteLength??0),w=(n?.tags?.length??0)>0?YR(n.tags):null,m=16+(w?w.byteLength:0),y=St.from(e),g=y.byteLength,S=2+r.signatureLength+r.ownerLength+d+v+m+g,R=St.alloc(S);if(R.set(rxe(r.signatureType),0),R.set(new Uint8Array(r.signatureLength).fill(0),2),h.byteLength!==r.ownerLength)throw new Error(`Owner must be ${r.ownerLength} bytes, but was incorrectly ${h.byteLength}`);R.set(h,2+r.signatureLength);let A=2+r.signatureLength+r.ownerLength;if(R[A]=a?1:0,a){if(a.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${a.byteLength}`);R.set(a,A+1)}let k=A+d,I=k+1;if(R[k]=c?1:0,c){if(I+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");R.set(c,k+1)}R.set(AQ(n?.tags?.length??0),I);let B=AQ(w?.byteLength??0);R.set(B,I+8),w&&R.set(w,I+16);let P=I+m;return R.set(y,P),new W2(R)}var XR={...Nee};globalThis.arbundles??=XR;var axe=XR,oxe=XR;globalThis.Buffer||(globalThis.Buffer=Iee.Buffer);var{DataItem:sxe}=Bee;function fxe(e){return async({data:n,tags:h,target:a,anchor:d,createDataItem:c=v=>new sxe(v)})=>{let v=await e.signDataItem({data:n,tags:h,target:a,anchor:d}),w=c(Iee.Buffer.from(v));return{id:await w.id,raw:await w.getRaw()}}}var uxe=globalThis.GATEWAY_URL||void 0,hxe=globalThis.MU_URL||void 0,lxe=globalThis.CU_URL||void 0,cxe=globalThis.GRAPHQL_URL||void 0,{result:WKe,results:GKe,message:VKe,spawn:YKe,monitor:JKe,unmonitor:XKe,dryrun:QKe,assign:eZe}=X2({GATEWAY_URL:uxe,MU_URL:hxe,CU_URL:lxe,GRAPHQL_URL:cxe}),tZe=kee.createDataItemSigner;var qee=fc(O8(),1);Be();Pe();Oe();function QR(e){try{return JSON.parse(e)}catch{return e}}var Xo=class e{logger;processId;ao;constructor({processId:r,ao:n=X2(),logger:h=Gc.default}){this.processId=r,this.logger=h,this.ao=n}static async createAoSigner(r){return r.publicKey===void 0&&"setPublicKey"in r&&await r.setPublicKey(),async({data:h,tags:a,target:d,anchor:c})=>{let v=(0,qee.createData)(h,r,{tags:a,target:d,anchor:c});return v.sign(r).then(async()=>({id:await v.id,raw:await v.getRaw()}))}}async read({tags:r,retries:n=3}){let h=0,a;for(;h<n;)try{this.logger.debug("Evaluating read interaction on contract",{tags:r});let d=await this.ao.dryrun({process:this.processId,tags:r});if(d.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let v=d.Messages[0].Tags.find(m=>m.name==="Error");if(v)throw new Error(`${v.Value}: ${d.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:d.Messages[0].Data}),d.Messages[0].Data===void 0?{}:QR(d.Messages[0].Data)}catch(d){h++,this.logger.debug(`Read attempt ${h} failed`,{error:d,tags:r}),a=d,await new Promise(c=>setTimeout(c,2**h*1e3))}throw a}async send({tags:r,data:n,signer:h,retries:a=3}){let d=0,c;for(;d<a;)try{this.logger.debug("Evaluating send interaction on contract",{tags:r,data:n,processId:this.processId});let v=await this.ao.message({process:this.processId,tags:[...r,{name:"AR-IO-SDK",value:Wc}],data:typeof n!="string"?JSON.stringify(n):n,signer:await e.createAoSigner(h)});this.logger.debug("Sent message to process",{messageId:v,processId:this.processId});let w=await this.ao.result({message:v,process:this.processId});if(this.logger.debug("Message result",{output:w,messageId:v,processId:this.processId}),w.Messages?.length===0||w.Messages===void 0)return{id:v};let y=w.Messages[0].Tags.find(S=>S.name==="Error");if(y){let S=w.Messages[0].Data;throw new vm(`${y.Value}: ${S}`)}if(w.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(w.Messages[0].Data===void 0)return{id:v};let g=QR(w.Messages[0].Data);return this.logger.debug("Message result data",{resultData:g,messageId:v,processId:this.processId}),{id:v,result:g}}catch(v){if(this.logger.error("Error sending message to process",{error:v.message,processId:this.processId,tags:r}),v.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:d,retries:a,error:v.message,processId:this.processId}),await new Promise(w=>setTimeout(w,2**d*2e3)),d++,c=v;else throw v}throw c}};var ev=class{static init(r){if(r&&r.signer){let{signer:n,...h}=r;return new ex({...h,signer:n})}return new Jb(r)}},Jb=class{process;arweave;constructor(r,n=wb){if(!r)this.process=new Xo({processId:lc});else if(cc(r))this.process=r.process;else if(dc(r))this.process=new Xo({processId:r.processId});else throw new gh;this.arweave=n}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getEpochSettings(r){let h=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getEpoch(r){let h=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getArNSRecord({name:r}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:r}]})}async getArNSRecords(){return this.process.read({tags:[{name:"Action",value:"Records"}]})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:r}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:r}]})}async getBalance({address:r}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:r}]})}async getBalances(){return this.process.read({tags:[{name:"Action",value:"Balances"}]})}async getGateway({address:r}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:r}]})}async getGateways(){return this.process.read({tags:[{name:"Action",value:"Gateways"}]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(r){let h=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getPrescribedNames(r){let h=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getObservations(r){let h=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getDistributions(r){let h=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getTokenCost({intent:r,purchaseType:n,years:h,name:a,quantity:d}){let v=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:r},{name:"Name",value:a},{name:"Years",value:h?.toString()},{name:"Quantity",value:d?.toString()},{name:"Purchase-Type",value:n},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()}].filter(w=>w.value!==void 0);return this.process.read({tags:v})}},ex=class extends Jb{signer;constructor({signer:r,...n}){if(Object.keys(n).length===0)super({process:new Xo({processId:lc})}),this.signer=r;else if(cc(n))super({process:n.process}),this.signer=r;else if(dc(n))super({process:new Xo({processId:n.processId})}),this.signer=r;else throw new gh}async transfer({target:r,qty:n},h){let{tags:a=[]}=h||{};return this.process.send({tags:[...a,{name:"Action",value:"Transfer"},{name:"Recipient",value:r},{name:"Quantity",value:n.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:r,allowDelegatedStaking:n,delegateRewardShareRatio:h,fqdn:a,label:d,minDelegatedStake:c,note:v,port:w,properties:m,protocol:y,autoStake:g,observerAddress:S},R){let{tags:A=[]}=R||{},I=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:r.valueOf().toString()},{name:"Allow-Delegated-Staking",value:n.toString()},{name:"Delegate-Reward-Share-Ratio",value:h.toString()},{name:"FQDN",value:a},{name:"Label",value:d},{name:"Min-Delegated-Stake",value:c.valueOf().toString()},{name:"Note",value:v},{name:"Port",value:w.toString()},{name:"Properties",value:m},{name:"Protocol",value:y},{name:"Auto-Stake",value:g.toString()},{name:"Observer-Address",value:S}].filter(B=>B.value!==void 0);return this.process.send({signer:this.signer,tags:I})}async updateGatewaySettings({allowDelegatedStaking:r,delegateRewardShareRatio:n,fqdn:h,label:a,minDelegatedStake:d,note:c,port:v,properties:w,protocol:m,autoStake:y,observerAddress:g},S){let{tags:R=[]}=S||{},k=[...R,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:a},{name:"Note",value:c},{name:"FQDN",value:h},{name:"Port",value:v?.toString()},{name:"Properties",value:w},{name:"Protocol",value:m},{name:"Observer-Address",value:g},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Delegate-Reward-Share-Ratio",value:n?.toString()},{name:"Min-Delegated-Stake",value:d?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(I=>I.value!==void 0);return this.process.send({signer:this.signer,tags:k})}async delegateStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:r.target},{name:"Quantity",value:r.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:r.target},{name:"Quantity",value:r.decreaseQty.valueOf().toString()}]})}async increaseOperatorStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:r.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:r.decreaseQty.valueOf().toString()}]})}async saveObservations(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:r.reportTxId},{name:"Failed-Gateways",value:r.failedGateways.join(",")}],data:{reportTxId:r.reportTxId,failedGateways:r.failedGateways}})}async buyRecord(r,n){let{tags:h=[]}=n||{},d=[...h,{name:"Action",value:"Buy-Record"},{name:"Name",value:r.name},{name:"Years",value:r.years?.toString()??"1"},{name:"Process-Id",value:r.processId},{name:"Purchase-Type",value:r.type||"lease"}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:d})}async extendLease(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Extend-Lease"},{name:"Name",value:r.name},{name:"Years",value:r.years.toString()}]})}async increaseUndernameLimit(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:r.name},{name:"Quantity",value:r.increaseCount.toString()}]})}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function tv(e,r){return function(){return e.apply(r,arguments)}}var{toString:dxe}=Object.prototype,{getPrototypeOf:ix}=Object,Qb=(e=>r=>{let n=dxe.call(r);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kf=e=>(e=e.toLowerCase(),r=>Qb(r)===e),e3=e=>r=>typeof r===e,{isArray:Zd}=Array,rv=e3("undefined");function pxe(e){return e!==null&&!rv(e)&&e.constructor!==null&&!rv(e.constructor)&&Cs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var zee=kf("ArrayBuffer");function vxe(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&zee(e.buffer),r}var mxe=e3("string"),Cs=e3("function"),Hee=e3("number"),t3=e=>e!==null&&typeof e=="object",gxe=e=>e===!0||e===!1,Xb=e=>{if(Qb(e)!=="object")return!1;let r=ix(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},yxe=kf("Date"),bxe=kf("File"),wxe=kf("Blob"),_xe=kf("FileList"),Mxe=e=>t3(e)&&Cs(e.pipe),Sxe=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Cs(e.append)&&((r=Qb(e))==="formdata"||r==="object"&&Cs(e.toString)&&e.toString()==="[object FormData]"))},Exe=kf("URLSearchParams"),[Axe,Rxe,xxe,Txe]=["ReadableStream","Request","Response","Headers"].map(kf),kxe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function iv(e,r,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let h,a;if(typeof e!="object"&&(e=[e]),Zd(e))for(h=0,a=e.length;h<a;h++)r.call(null,e[h],h,e);else{let d=n?Object.getOwnPropertyNames(e):Object.keys(e),c=d.length,v;for(h=0;h<c;h++)v=d[h],r.call(null,e[v],v,e)}}function Kee(e,r){r=r.toLowerCase();let n=Object.keys(e),h=n.length,a;for(;h-- >0;)if(a=n[h],r===a.toLowerCase())return a;return null}var Zee=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wee=e=>!rv(e)&&e!==Zee;function rx(){let{caseless:e}=Wee(this)&&this||{},r={},n=(h,a)=>{let d=e&&Kee(r,a)||a;Xb(r[d])&&Xb(h)?r[d]=rx(r[d],h):Xb(h)?r[d]=rx({},h):Zd(h)?r[d]=h.slice():r[d]=h};for(let h=0,a=arguments.length;h<a;h++)arguments[h]&&iv(arguments[h],n);return r}var Ixe=(e,r,n,{allOwnKeys:h}={})=>(iv(r,(a,d)=>{n&&Cs(a)?e[d]=tv(a,n):e[d]=a},{allOwnKeys:h}),e),Bxe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Oxe=(e,r,n,h)=>{e.prototype=Object.create(r.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),n&&Object.assign(e.prototype,n)},Pxe=(e,r,n,h)=>{let a,d,c,v={};if(r=r||{},e==null)return r;do{for(a=Object.getOwnPropertyNames(e),d=a.length;d-- >0;)c=a[d],(!h||h(c,e,r))&&!v[c]&&(r[c]=e[c],v[c]=!0);e=n!==!1&&ix(e)}while(e&&(!n||n(e,r))&&e!==Object.prototype);return r},Nxe=(e,r,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=r.length;let h=e.indexOf(r,n);return h!==-1&&h===n},Cxe=e=>{if(!e)return null;if(Zd(e))return e;let r=e.length;if(!Hee(r))return null;let n=new Array(r);for(;r-- >0;)n[r]=e[r];return n},Lxe=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&ix(Uint8Array)),Dxe=(e,r)=>{let h=(e&&e[Symbol.iterator]).call(e),a;for(;(a=h.next())&&!a.done;){let d=a.value;r.call(e,d[0],d[1])}},$xe=(e,r)=>{let n,h=[];for(;(n=e.exec(r))!==null;)h.push(n);return h},Uxe=kf("HTMLFormElement"),qxe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,h,a){return h.toUpperCase()+a}),jee=(({hasOwnProperty:e})=>(r,n)=>e.call(r,n))(Object.prototype),jxe=kf("RegExp"),Gee=(e,r)=>{let n=Object.getOwnPropertyDescriptors(e),h={};iv(n,(a,d)=>{let c;(c=r(a,d,e))!==!1&&(h[d]=c||a)}),Object.defineProperties(e,h)},Fxe=e=>{Gee(e,(r,n)=>{if(Cs(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let h=e[n];if(Cs(h)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zxe=(e,r)=>{let n={},h=a=>{a.forEach(d=>{n[d]=!0})};return Zd(e)?h(e):h(String(e).split(r)),n},Hxe=()=>{},Kxe=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r,tx="abcdefghijklmnopqrstuvwxyz",Fee="0123456789",Vee={DIGIT:Fee,ALPHA:tx,ALPHA_DIGIT:tx+tx.toUpperCase()+Fee},Zxe=(e=16,r=Vee.ALPHA_DIGIT)=>{let n="",{length:h}=r;for(;e--;)n+=r[Math.random()*h|0];return n};function Wxe(e){return!!(e&&Cs(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Gxe=e=>{let r=new Array(10),n=(h,a)=>{if(t3(h)){if(r.indexOf(h)>=0)return;if(!("toJSON"in h)){r[a]=h;let d=Zd(h)?[]:{};return iv(h,(c,v)=>{let w=n(c,a+1);!rv(w)&&(d[v]=w)}),r[a]=void 0,d}}return h};return n(e,0)},Vxe=kf("AsyncFunction"),Yxe=e=>e&&(t3(e)||Cs(e))&&Cs(e.then)&&Cs(e.catch),Kt={isArray:Zd,isArrayBuffer:zee,isBuffer:pxe,isFormData:Sxe,isArrayBufferView:vxe,isString:mxe,isNumber:Hee,isBoolean:gxe,isObject:t3,isPlainObject:Xb,isReadableStream:Axe,isRequest:Rxe,isResponse:xxe,isHeaders:Txe,isUndefined:rv,isDate:yxe,isFile:bxe,isBlob:wxe,isRegExp:jxe,isFunction:Cs,isStream:Mxe,isURLSearchParams:Exe,isTypedArray:Lxe,isFileList:_xe,forEach:iv,merge:rx,extend:Ixe,trim:kxe,stripBOM:Bxe,inherits:Oxe,toFlatObject:Pxe,kindOf:Qb,kindOfTest:kf,endsWith:Nxe,toArray:Cxe,forEachEntry:Dxe,matchAll:$xe,isHTMLForm:Uxe,hasOwnProperty:jee,hasOwnProp:jee,reduceDescriptors:Gee,freezeMethods:Fxe,toObjectSet:zxe,toCamelCase:qxe,noop:Hxe,toFiniteNumber:Kxe,findKey:Kee,global:Zee,isContextDefined:Wee,ALPHABET:Vee,generateString:Zxe,isSpecCompliantForm:Wxe,toJSONObject:Gxe,isAsyncFn:Vxe,isThenable:Yxe};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function Wd(e,r,n,h,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),h&&(this.request=h),a&&(this.response=a)}Kt.inherits(Wd,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Kt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Yee=Wd.prototype,Jee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Jee[e]={value:e}});Object.defineProperties(Wd,Jee);Object.defineProperty(Yee,"isAxiosError",{value:!0});Wd.from=(e,r,n,h,a,d)=>{let c=Object.create(Yee);return Kt.toFlatObject(e,c,function(w){return w!==Error.prototype},v=>v!=="isAxiosError"),Wd.call(c,e.message,r,n,h,a),c.cause=e,c.name=e.name,d&&Object.assign(c,d),c};var Lr=Wd;Be();Pe();Oe();var r3=null;function nx(e){return Kt.isPlainObject(e)||Kt.isArray(e)}function Qee(e){return Kt.endsWith(e,"[]")?e.slice(0,-2):e}function Xee(e,r,n){return e?e.concat(r).map(function(a,d){return a=Qee(a),!n&&d?"["+a+"]":a}).join(n?".":""):r}function Jxe(e){return Kt.isArray(e)&&!e.some(nx)}var Xxe=Kt.toFlatObject(Kt,{},null,function(r){return/^is[A-Z]/.test(r)});function Qxe(e,r,n){if(!Kt.isObject(e))throw new TypeError("target must be an object");r=r||new(r3||FormData),n=Kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,I){return!Kt.isUndefined(I[k])});let h=n.metaTokens,a=n.visitor||y,d=n.dots,c=n.indexes,w=(n.Blob||typeof Blob<"u"&&Blob)&&Kt.isSpecCompliantForm(r);if(!Kt.isFunction(a))throw new TypeError("visitor must be a function");function m(A){if(A===null)return"";if(Kt.isDate(A))return A.toISOString();if(!w&&Kt.isBlob(A))throw new Lr("Blob is not supported. Use a Buffer instead.");return Kt.isArrayBuffer(A)||Kt.isTypedArray(A)?w&&typeof Blob=="function"?new Blob([A]):St.from(A):A}function y(A,k,I){let B=A;if(A&&!I&&typeof A=="object"){if(Kt.endsWith(k,"{}"))k=h?k:k.slice(0,-2),A=JSON.stringify(A);else if(Kt.isArray(A)&&Jxe(A)||(Kt.isFileList(A)||Kt.endsWith(k,"[]"))&&(B=Kt.toArray(A)))return k=Qee(k),B.forEach(function(C,q){!(Kt.isUndefined(C)||C===null)&&r.append(c===!0?Xee([k],q,d):c===null?k:k+"[]",m(C))}),!1}return nx(A)?!0:(r.append(Xee(I,k,d),m(A)),!1)}let g=[],S=Object.assign(Xxe,{defaultVisitor:y,convertValue:m,isVisitable:nx});function R(A,k){if(!Kt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+k.join("."));g.push(A),Kt.forEach(A,function(B,P){(!(Kt.isUndefined(B)||B===null)&&a.call(r,B,Kt.isString(P)?P.trim():P,k,S))===!0&&R(B,k?k.concat(P):[P])}),g.pop()}}if(!Kt.isObject(e))throw new TypeError("data must be an object");return R(e),r}var f0=Qxe;function ete(e){let r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return r[h]})}function tte(e,r){this._pairs=[],e&&f0(e,this,r)}var rte=tte.prototype;rte.append=function(r,n){this._pairs.push([r,n])};rte.toString=function(r){let n=r?function(h){return r.call(this,h,ete)}:ete;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var i3=tte;function eTe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nv(e,r,n){if(!r)return e;let h=n&&n.encode||eTe,a=n&&n.serialize,d;if(a?d=a(r,n):d=Kt.isURLSearchParams(r)?r.toString():new i3(r,n).toString(h),d){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+d}return e}Be();Pe();Oe();var ax=class{constructor(){this.handlers=[]}use(r,n,h){return this.handlers.push({fulfilled:r,rejected:n,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Kt.forEach(this.handlers,function(h){h!==null&&r(h)})}},ox=ax;Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var n3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var ite=typeof URLSearchParams<"u"?URLSearchParams:i3;Be();Pe();Oe();var nte=typeof FormData<"u"?FormData:null;Be();Pe();Oe();var ate=typeof Blob<"u"?Blob:null;var ote={isBrowser:!0,classes:{URLSearchParams:ite,FormData:nte,Blob:ate},protocols:["http","https","file","blob","url","data"]};var fx={};go(fx,{hasBrowserEnv:()=>sx,hasStandardBrowserEnv:()=>tTe,hasStandardBrowserWebWorkerEnv:()=>rTe,origin:()=>iTe});Be();Pe();Oe();var sx=typeof window<"u"&&typeof document<"u",tTe=(e=>sx&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),rTe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iTe=sx&&window.location.href||"http://localhost";var pa={...fx,...ote};function ux(e,r){return f0(e,new pa.classes.URLSearchParams,Object.assign({visitor:function(n,h,a,d){return pa.isNode&&Kt.isBuffer(n)?(this.append(h,n.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},r))}Be();Pe();Oe();function nTe(e){return Kt.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function aTe(e){let r={},n=Object.keys(e),h,a=n.length,d;for(h=0;h<a;h++)d=n[h],r[d]=e[d];return r}function oTe(e){function r(n,h,a,d){let c=n[d++];if(c==="__proto__")return!0;let v=Number.isFinite(+c),w=d>=n.length;return c=!c&&Kt.isArray(a)?a.length:c,w?(Kt.hasOwnProp(a,c)?a[c]=[a[c],h]:a[c]=h,!v):((!a[c]||!Kt.isObject(a[c]))&&(a[c]=[]),r(n,h,a[c],d)&&Kt.isArray(a[c])&&(a[c]=aTe(a[c])),!v)}if(Kt.isFormData(e)&&Kt.isFunction(e.entries)){let n={};return Kt.forEachEntry(e,(h,a)=>{r(nTe(h),a,n,0)}),n}return null}var a3=oTe;function sTe(e,r,n){if(Kt.isString(e))try{return(r||JSON.parse)(e),Kt.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(n||JSON.stringify)(e)}var hx={transitional:n3,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){let h=n.getContentType()||"",a=h.indexOf("application/json")>-1,d=Kt.isObject(r);if(d&&Kt.isHTMLForm(r)&&(r=new FormData(r)),Kt.isFormData(r))return a?JSON.stringify(a3(r)):r;if(Kt.isArrayBuffer(r)||Kt.isBuffer(r)||Kt.isStream(r)||Kt.isFile(r)||Kt.isBlob(r)||Kt.isReadableStream(r))return r;if(Kt.isArrayBufferView(r))return r.buffer;if(Kt.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let v;if(d){if(h.indexOf("application/x-www-form-urlencoded")>-1)return ux(r,this.formSerializer).toString();if((v=Kt.isFileList(r))||h.indexOf("multipart/form-data")>-1){let w=this.env&&this.env.FormData;return f0(v?{"files[]":r}:r,w&&new w,this.formSerializer)}}return d||a?(n.setContentType("application/json",!1),sTe(r)):r}],transformResponse:[function(r){let n=this.transitional||hx.transitional,h=n&&n.forcedJSONParsing,a=this.responseType==="json";if(Kt.isResponse(r)||Kt.isReadableStream(r))return r;if(r&&Kt.isString(r)&&(h&&!this.responseType||a)){let c=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(r)}catch(v){if(c)throw v.name==="SyntaxError"?Lr.from(v,Lr.ERR_BAD_RESPONSE,this,null,this.response):v}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pa.classes.FormData,Blob:pa.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kt.forEach(["delete","get","head","post","put","patch"],e=>{hx.headers[e]={}});var Gd=hx;Be();Pe();Oe();Be();Pe();Oe();var fTe=Kt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ste=e=>{let r={},n,h,a;return e&&e.split(`
193
+ }`,a=Jt.object({data:Jt.object({transactions:Jt.object({edges:Jt.array(Jt.object({node:Jt.record(Jt.any())}))})})});return d=>ui(d).chain(tn(c=>e(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:h,variables:{transactionIds:[c]}})}).then(async v=>{if(v.ok)return v.json();throw n('Error Encountered when querying gateway for transaction "%s"',c),new Error(`${v.status}: ${await v.text()}`)}).then(a.parse).then(UEe(["data","transactions","edges","0","node"])))).toPromise()}var ZAe=BR(s_e(),1),Aee=(e="@permaweb/aoconnect")=>{let r=(0,ZAe.default)(e);return r.child=n=>Aee(`${r.namespace}:${n}`),r.tap=(n,...h)=>ZEe((...a)=>r(n,...h,...a)),r},Ree=({url:e,path:r})=>r?r.startsWith("/")?Ree({url:e,path:r.slice(1)}):(e=new URL(e),e.pathname+=r,e.toString()):e;function WAe(e){return jd(Gb([]),qd((r,n)=>jd(FEe([],n.name),FR(n.value),Ps(n.name,nh,r))(r),{}),Zb(r=>r.length>1?r:r[0]))(e)}function Bs(e,r){return n=>XQ(YSe([_Q(e,"name"),HR(jR(r),_Q(r,"value"),$R)]),n)}function EQ(e){return fee([[B2(String),Nd(e)],[B2(Array),kEe(e)],[$R,aSe]])}function Ul(e){let r;return B2(Os,e)?(r=new Error(GAe(e)),r.stack+=e.stack):B2(Error,e)?r=e:REe("message",e)?r=new Error(e.message):B2(String,e)?r=new Error(e):r=new Error("An error occurred"),r}function GAe(e){return jd(r=>function n(h,a,d){return qd((c,v)=>jd(fee([[Nd(gr.invalid_arguments),()=>n(v.argumentsError,422,"Invalid Arguments")],[Nd(gr.invalid_return_type),()=>n(v.returnTypeError,500,"Invalid Return")],[Nd(gr.invalid_union),()=>cEe(w=>n(w,400,"Invalid Union"),v.unionErrors)],[$R,()=>[{...v,status:a,contextCode:d}]]]),zR(c))(v.code),[],h.issues)}(r,400,""),r=>qd((n,h)=>{let{message:a,path:d,contextCode:c}=h,v=d[1]||d[0],w=c?`${c} `:"";return n.push(`${w}'${v}': ${a}.`),n},[],r),CEe(" | "))(e)}var VAe=Jt.object({id:Jt.string().min(1,{message:"message is required to be a message id"}),processId:Jt.string().min(1,{message:"process is required to be a process id"})});function YAe(){return e=>ui(e).map(VAe.parse).map(()=>e)}var J2=Jt.object({name:Jt.string(),value:Jt.string()}),JAe=Jt.function().args(Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))})).returns(Jt.promise(Jt.any())),XAe=Jt.function().args(Jt.object({id:Jt.string().min(1,{message:"message id is required"}),processId:Jt.string().min(1,{message:"process id is required"})})).returns(Jt.promise(Jt.any())),QAe=Jt.function().args(Jt.object({process:Jt.string().min(1,{message:"process id is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()})).returns(Jt.promise(Jt.object({edges:Jt.array(Jt.object({cursor:Jt.string(),node:Jt.object({Output:Jt.any().optional(),Messages:Jt.array(Jt.any()).optional(),Spawns:Jt.array(Jt.any()).optional(),Error:Jt.any().optional()})}))}))),xee=Jt.function().args(Jt.object({processId:Jt.string(),data:Jt.any(),tags:Jt.array(J2),anchor:Jt.string().optional(),signer:Jt.any()})).returns(Jt.promise(Jt.object({messageId:Jt.string()}).passthrough())),eRe=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(J2),signer:Jt.any()})).returns(Jt.promise(Jt.object({processId:Jt.string()}).passthrough())),tRe=Jt.function().args(Jt.object({process:Jt.string(),message:Jt.string(),baseLayer:Jt.boolean().optional(),exclude:Jt.array(Jt.string()).optional()})).returns(Jt.promise(Jt.object({assignmentId:Jt.string()}).passthrough())),Tee=xee,KKe=Jt.function().args(Jt.object({suUrl:Jt.string().url(),processId:Jt.string()})).returns(Jt.promise(Jt.object({tags:Jt.array(J2)}).passthrough())),ZKe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({url:Jt.string()}))),rRe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.boolean())),iRe=Jt.function().args(Jt.string()).returns(Jt.promise(Jt.object({tags:Jt.array(J2)}).passthrough())),Vb=Jt.function().args(Jt.object({data:Jt.any(),tags:Jt.array(J2),target:Jt.string().optional(),anchor:Jt.string().optional()})).returns(Jt.promise(Jt.object({id:Jt.string(),raw:Jt.any()})));function nRe({loadResult:e}){return e=tn(XAe.implement(e)),r=>ui({id:r.id,processId:r.processId}).chain(e)}function aRe(e){let r=YAe(e),n=nRe(e);return({message:h,process:a})=>ui({id:h,processId:a}).chain(r).chain(n).map(e.logger.tap('readResult result for message "%s": %O',h)).map(d=>d).bimap(Ul,$l).toPromise()}var oRe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function sRe(){return e=>ui(e.tags).map(Gb([])).map(Bs("Data-Protocol","ao")).map(Bs("Variant")).map(Bs("Type")).map(Bs("SDK")).map(zR(nh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(oRe.parse).map(Ps("tags",nh,e))}function fRe({logger:e}){return r=>ui(r).chain(HR(jR(r.data),()=>Pl(r),()=>Pl(Math.random().toString().slice(-4)).map(Ps("data",nh,r)).map(n=>jd(Dl("tags"),Bs("Content-Type"),FR({name:"Content-Type",value:"text/plain"}),Ps("tags",nh,n))(n)).map(e.tap('added pseudo-random string as message "data"'))))}function uRe(e){let r=sRe(e),n=fRe(e),h=xee.implement(e.deployMessage);return a=>ui(a).chain(r).chain(n).chain(tn(({id:d,data:c,tags:v,anchor:w,signer:m})=>h({processId:d,data:c,tags:v,anchor:w,signer:Vb.implement(m)}))).map(d=>Ps("messageId",d.messageId,a))}function hRe(e){let r=uRe(e);return({process:n,data:h,tags:a,anchor:d,signer:c})=>ui({id:n,data:h,tags:a,anchor:d,signer:c}).chain(r).map(v=>v.messageId).bimap(Ul,$l).toPromise()}var R2=(e,r,n)=>h=>r(h[e])?Pl(h):s0(`Tag '${e}': ${n}`);function lRe({loadTransactionMeta:e,logger:r}){return e=tn(iRe.implement(e)),n=>ui(n).chain(e).map(Dl("tags")).map(WAe).chain(R2("Data-Protocol",EQ("ao"),"value 'ao' was not found on module")).chain(R2("Type",EQ("Module"),"value 'Module' was not found on module")).chain(R2("Module-Format",lR,"was not found on module")).chain(R2("Input-Encoding",lR,"was not found on module")).chain(R2("Output-Encoding",lR,"was not found on module")).bimap(r.tap("Verifying module source failed: %s"),r.tap("Verified module source"))}function cRe({logger:e,validateScheduler:r}){return r=tn(rRe.implement(r)),n=>ui(n).chain(h=>r(h).chain(a=>a?Pl(h):s0(`Valid Scheduler-Location owned by ${h} not found`))).bimap(e.tap("Verifying scheduler failed: %s"),e.tap("Verified scheduler"))}function dRe({logger:e}){return r=>ui(r).map(e.tap("Checking for signer")).chain(n=>n?Pl(n):s0("signer not found"))}function pRe(e){let r=e.logger.child("verifyInput");e={...e,logger:r};let n=lRe(e),h=cRe(e),a=dRe(e);return d=>ui(d).chain(c=>n(c.module).map(()=>c)).chain(c=>h(c.scheduler)).map(()=>d).chain(c=>a(c.signer).map(()=>c)).bimap(r.tap("Error when verify input: %s"),r.tap("Successfully verified inputs"))}var vRe=Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}));function mRe(){return e=>ui(e).map(Dl("tags")).map(Gb([])).map(Bs("Data-Protocol","ao")).map(Bs("Variant")).map(Bs("Type")).map(Bs("Module")).map(Bs("Scheduler")).map(Bs("SDK")).map(zR(nh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:e.module},{name:"Scheduler",value:e.scheduler},{name:"SDK",value:"aoconnect"}])).map(vRe.parse).map(Ps("tags",nh,e))}function gRe({logger:e}){return r=>ui(r).chain(HR(jR(r.data),()=>Pl(r),()=>Pl(Math.random().toString().slice(-4)).map(Ps("data",nh,r)).map(n=>jd(Dl("tags"),Bs("Content-Type"),FR({name:"Content-Type",value:"text/plain"}),Ps("tags",nh,n))(n)).map(e.tap('added pseudo-random string as process "data"'))))}function yRe(e){let r=e.logger.child("uploadProcess");e={...e,logger:r};let n=mRe(e),h=gRe(e),a=eRe.implement(e.deployProcess);return d=>ui(d).chain(n).chain(h).chain(tn(({data:c,tags:v,signer:w})=>a({data:c,tags:v,signer:Vb.implement(w)}))).map(c=>Ps("processId",c.processId,d))}function bRe(e){let r=pRe(e),n=yRe(e);return({module:h,scheduler:a,signer:d,tags:c,data:v})=>ui({module:h,scheduler:a,signer:d,tags:c,data:v}).chain(r).chain(n).map(w=>w.processId).bimap(Ul,$l).toPromise()}function wRe(e){let r=Tee.implement(e.deployMonitor);return n=>ui(n).chain(tn(({id:h,signer:a})=>r({processId:h,signer:Vb.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Ps("monitorId",h.messageId,n))}function _Re(e){let r=wRe(e);return({process:n,signer:h})=>ui({id:n,signer:h}).chain(r).map(a=>a.monitorId).bimap(Ul,$l).toPromise()}function MRe(e){let r=Tee.implement(e.deployUnmonitor);return n=>ui(n).chain(tn(({id:h,signer:a})=>r({processId:h,signer:Vb.implement(a),data:Math.random().toString().slice(-4),tags:[]}))).map(h=>Ps("monitorId",h.messageId,n))}function SRe(e){let r=MRe(e);return({process:n,signer:h})=>ui({id:n,signer:h}).chain(r).map(a=>a.monitorId).bimap(Ul,$l).toPromise()}var ERe=Jt.object({process:Jt.string().min(1,{message:"process identifier is required"}),from:Jt.string().optional(),to:Jt.string().optional(),sort:Jt.enum(["ASC","DESC"]).default("ASC"),limit:Jt.number().optional()});function ARe(){return e=>ui(e).map(ERe.parse).map(()=>e)}function RRe({queryResults:e}){return e=tn(QAe.implement(e)),r=>ui({process:r.process,from:r.from,to:r.to,sort:r.sort,limit:r.limit}).chain(e)}function xRe(e){let r=ARe(e),n=RRe(e);return({process:h,from:a,to:d,sort:c,limit:v})=>ui({process:h,from:a,to:d,sort:c,limit:v}).chain(r).chain(n).map(e.logger.tap('readResults result for message "%s": %O',h)).map(w=>w).bimap(Ul,$l).toPromise()}var TRe=Jt.object({Id:Jt.string(),Target:Jt.string(),Owner:Jt.string(),Anchor:Jt.string().optional(),Data:Jt.any().default("1234"),Tags:Jt.array(Jt.object({name:Jt.string(),value:Jt.string()}))});function kRe(){return e=>ui(e).map(TRe.parse).map(r=>(r.Tags=r.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),r))}function IRe({dryrunFetch:e}){return tn(JAe.implement(e))}function BRe(e){let r=kRe(e),n=IRe(e);return h=>ui(h).map(ORe).chain(r).chain(n).toPromise()}function ORe({process:e,data:r,tags:n,anchor:h,...a}){return{Id:"1234",Owner:"1234",...a,Target:e,Data:r||"1234",Tags:n||[],Anchor:h||"0"}}function PRe(e){let r=tRe.implement(e.deployAssign);return n=>ui(n).chain(tn(({process:h,message:a,baseLayer:d,exclude:c})=>r({process:h,message:a,baseLayer:d,exclude:c}))).map(h=>Ps("assignmentId",h.assignmentId,n))}function NRe(e){let r=PRe(e);return({process:n,message:h,baseLayer:a,exclude:d})=>ui({process:n,message:h,baseLayer:a,exclude:d}).chain(r).map(c=>c.assignmentId).bimap(Ul,$l).toPromise()}var CRe="https://arweave.net",LRe="https://mu.ao-testnet.xyz",DRe="https://cu.ao-testnet.xyz";function X2({GRAPHQL_URL:e,GATEWAY_URL:r=CRe,MU_URL:n=LRe,CU_URL:h=DRe}={}){let a=Aee();e||(e=Ree({url:r,path:"/graphql"}));let{validate:d}=GQ({cacheSize:100,GRAPHQL_URL:e}),c=iSe({MAX_SIZE:25}),v=a.child("result"),w=aRe({loadResult:eSe({fetch,CU_URL:h,logger:v}),logger:v}),m=a.child("message"),y=hRe({loadProcessMeta:fR({fetch,cache:c,logger:m}),deployMessage:GMe({fetch,MU_URL:n,logger:m}),logger:m}),g=a.child("spawn"),S=bRe({loadTransactionMeta:KAe({fetch,GRAPHQL_URL:e,logger:g}),validateScheduler:d,deployProcess:VMe({fetch,MU_URL:n,logger:g}),logger:g}),R=a.child("monitor"),A=_Re({loadProcessMeta:fR({fetch,cache:c,logger:R}),deployMonitor:YMe({fetch,MU_URL:n,logger:R}),logger:R}),k=a.child("unmonitor"),I=SRe({loadProcessMeta:fR({fetch,cache:c,logger:k}),deployUnmonitor:JMe({fetch,MU_URL:n,logger:k}),logger:R}),B=a.child("results"),P=xRe({queryResults:tSe({fetch,CU_URL:h,logger:B}),logger:B}),C=a.child("dryrun"),q=BRe({dryrunFetch:QMe({fetch,CU_URL:h,logger:C}),logger:C}),K=a.child("assign"),V=NRe({deployAssign:XMe({fetch,MU_URL:n,logger:K}),logger:m});return{result:w,results:P,message:y,spawn:S,monitor:A,unmonitor:I,dryrun:q,assign:V}}var kee={};xQ(kee,{createDataItemSigner:()=>fxe});var Iee=BR(h_e(),1),Bee={};xQ(Bee,{AVSCTap:()=>Q2,ArweaveSigner:()=>GR,DataItem:()=>W2,MAX_TAG_BYTES:()=>Yb,MIN_BINARY_SIZE:()=>JR,SIG_CONFIG:()=>Kd,SignatureConfig:()=>Is,Signer:()=>Cee,createData:()=>Uee,default:()=>axe,deserializeTags:()=>jb,indexToType:()=>VR,serializeTags:()=>YR,tagsExceedLimit:()=>$ee,warparbundles:()=>oxe});var $Re=Object.create,ZR=Object.defineProperty,URe=Object.getOwnPropertyDescriptor,qRe=Object.getOwnPropertyNames,jRe=Object.getPrototypeOf,FRe=Object.prototype.hasOwnProperty,oh=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),zRe=(e,r)=>{for(var n in r)ZR(e,n,{get:r[n],enumerable:!0})},HRe=(e,r,n,h)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of qRe(r))!FRe.call(e,a)&&a!==n&&ZR(e,a,{get:()=>r[a],enumerable:!(h=URe(r,a))||h.enumerable});return e},ql=(e,r,n)=>(n=e!=null?$Re(jRe(e)):{},HRe(r||!e||!e.__esModule?ZR(n,"default",{value:e,enumerable:!0}):n,e)),KRe=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function r(n){var h=4,a=n.length,d=a%h;if(!d)return n;var c=a,v=h-d,w=a+v,m=St.alloc(w);for(m.write(n);v--;)m.write("=",c++);return m.toString()}e.default=r}),ZRe=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=KRe();function n(w,m){return m===void 0&&(m="utf8"),St.isBuffer(w)?d(w.toString("base64")):d(St.from(w,m).toString("base64"))}function h(w,m){return m===void 0&&(m="utf8"),St.from(a(w),"base64").toString(m)}function a(w){return w=w.toString(),r.default(w).replace(/\-/g,"+").replace(/_/g,"/")}function d(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(w){return St.from(a(w),"base64")}var v=n;v.encode=n,v.decode=h,v.toBase64=a,v.fromBase64=d,v.toBuffer=c,e.default=v}),WR=oh((e,r)=>{r.exports=ZRe().default,r.exports.default=r.exports}),Oee=oh(e=>{"use strict";e.byteLength=w,e.toByteArray=y,e.fromByteArray=R;var r=[],n=[],h=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(d=0,c=a.length;d<c;++d)r[d]=a[d],n[a.charCodeAt(d)]=d;var d,c;n[45]=62,n[95]=63;function v(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=A.indexOf("=");I===-1&&(I=k);var B=I===k?0:4-I%4;return[I,B]}function w(A){var k=v(A),I=k[0],B=k[1];return(I+B)*3/4-B}function m(A,k,I){return(k+I)*3/4-I}function y(A){var k,I=v(A),B=I[0],P=I[1],C=new h(m(A,B,P)),q=0,K=P>0?B-4:B,V;for(V=0;V<K;V+=4)k=n[A.charCodeAt(V)]<<18|n[A.charCodeAt(V+1)]<<12|n[A.charCodeAt(V+2)]<<6|n[A.charCodeAt(V+3)],C[q++]=k>>16&255,C[q++]=k>>8&255,C[q++]=k&255;return P===2&&(k=n[A.charCodeAt(V)]<<2|n[A.charCodeAt(V+1)]>>4,C[q++]=k&255),P===1&&(k=n[A.charCodeAt(V)]<<10|n[A.charCodeAt(V+1)]<<4|n[A.charCodeAt(V+2)]>>2,C[q++]=k>>8&255,C[q++]=k&255),C}function g(A){return r[A>>18&63]+r[A>>12&63]+r[A>>6&63]+r[A&63]}function S(A,k,I){for(var B,P=[],C=k;C<I;C+=3)B=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),P.push(g(B));return P.join("")}function R(A){for(var k,I=A.length,B=I%3,P=[],C=16383,q=0,K=I-B;q<K;q+=C)P.push(S(A,q,q+C>K?K:q+C));return B===1?(k=A[I-1],P.push(r[k>>2]+r[k<<4&63]+"==")):B===2&&(k=(A[I-2]<<8)+A[I-1],P.push(r[k>>10]+r[k>>4&63]+r[k<<2&63]+"=")),P.join("")}}),Pee=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.b64UrlDecode=e.b64UrlEncode=e.bufferTob64Url=e.bufferTob64=e.b64UrlToBuffer=e.stringToB64Url=e.stringToBuffer=e.bufferToString=e.b64UrlToString=e.concatBuffers=void 0;var r=Oee();function n(S){let R=0;for(let I=0;I<S.length;I++)R+=S[I].byteLength;let A=new Uint8Array(R),k=0;A.set(new Uint8Array(S[0]),k),k+=S[0].byteLength;for(let I=1;I<S.length;I++)A.set(new Uint8Array(S[I]),k),k+=S[I].byteLength;return A}e.concatBuffers=n;function h(S){let R=v(S);return a(R)}e.b64UrlToString=h;function a(S){return new TextDecoder("utf-8",{fatal:!0}).decode(S)}e.bufferToString=a;function d(S){return new TextEncoder().encode(S)}e.stringToBuffer=d;function c(S){return m(d(S))}e.stringToB64Url=c;function v(S){return new Uint8Array(r.toByteArray(g(S)))}e.b64UrlToBuffer=v;function w(S){return r.fromByteArray(new Uint8Array(S))}e.bufferTob64=w;function m(S){return y(w(S))}e.bufferTob64Url=m;function y(S){return S.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}e.b64UrlEncode=y;function g(S){S=S.replace(/\-/g,"+").replace(/\_/g,"/");let R;return S.length%4==0?R=0:R=4-S.length%4,S.concat("=".repeat(R))}e.b64UrlDecode=g}),WRe=oh(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Pee(),n=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let h=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),a=await this.driver.exportKey("jwk",h.privateKey);return{kty:a.kty,e:a.e,n:a.n,d:a.d,p:a.p,q:a.q,dp:a.dp,dq:a.dq,qi:a.qi}}async sign(h,a,{saltLength:d}={}){let c=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(h),a);return new Uint8Array(c)}async hash(h,a="SHA-256"){let d=await this.driver.digest(a,h);return new Uint8Array(d)}async verify(h,a,d){let c={kty:"RSA",e:"AQAB",n:h},v=await this.jwkToPublicCryptoKey(c),w=await this.driver.digest("SHA-256",a),m=await this.driver.verify({name:"RSA-PSS",saltLength:0},v,d,a),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},v,d,a),g=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((v.algorithm.modulusLength-1)/8)-w.byteLength-2},v,d,a);return m||y||g}async jwkToCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(h){return this.driver.importKey("jwk",h,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let h=crypto?.subtle;return h===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(a=>typeof h[a]=="function")}async encrypt(h,a,d){let c=await this.driver.importKey("raw",typeof a=="string"?r.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=new Uint8Array(16);crypto.getRandomValues(w);let m=await this.driver.encrypt({name:"AES-CBC",iv:w},v,h);return r.concatBuffers([w,m])}async decrypt(h,a,d){let c=await this.driver.importKey("raw",typeof a=="string"?r.stringToBuffer(a):a,{name:"PBKDF2",length:32},!1,["deriveKey"]),v=await this.driver.deriveKey({name:"PBKDF2",salt:d?r.stringToBuffer(d):r.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},c,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),w=h.slice(0,16),m=await this.driver.decrypt({name:"AES-CBC",iv:w},v,h.slice(16));return r.concatBuffers([m])}};e.default=n}),GRe=oh(e=>{e.read=function(r,n,h,a,d){var c,v,w=d*8-a-1,m=(1<<w)-1,y=m>>1,g=-7,S=h?d-1:0,R=h?-1:1,A=r[n+S];for(S+=R,c=A&(1<<-g)-1,A>>=-g,g+=w;g>0;c=c*256+r[n+S],S+=R,g-=8);for(v=c&(1<<-g)-1,c>>=-g,g+=a;g>0;v=v*256+r[n+S],S+=R,g-=8);if(c===0)c=1-y;else{if(c===m)return v?NaN:(A?-1:1)*(1/0);v=v+Math.pow(2,a),c=c-y}return(A?-1:1)*v*Math.pow(2,c-a)},e.write=function(r,n,h,a,d,c){var v,w,m,y=c*8-d-1,g=(1<<y)-1,S=g>>1,R=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=a?0:c-1,k=a?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(w=isNaN(n)?1:0,v=g):(v=Math.floor(Math.log(n)/Math.LN2),n*(m=Math.pow(2,-v))<1&&(v--,m*=2),v+S>=1?n+=R/m:n+=R*Math.pow(2,1-S),n*m>=2&&(v++,m/=2),v+S>=g?(w=0,v=g):v+S>=1?(w=(n*m-1)*Math.pow(2,d),v=v+S):(w=n*Math.pow(2,S-1)*Math.pow(2,d),v=0));d>=8;r[h+A]=w&255,A+=k,w/=256,d-=8);for(v=v<<d|w,y+=d;y>0;r[h+A]=v&255,A+=k,v/=256,y-=8);r[h+A-k]|=I*128}}),TR=oh(e=>{"use strict";var r=Oee(),n=GRe(),h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=v,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;var a=2147483647;e.kMaxLength=a,v.TYPED_ARRAY_SUPPORT=d(),!v.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function d(){try{let O=new Uint8Array(1),N={foo:function(){return 42}};return Object.setPrototypeOf(N,Uint8Array.prototype),Object.setPrototypeOf(O,N),O.foo()===42}catch{return!1}}Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}});function c(O){if(O>a)throw new RangeError('The value "'+O+'" is invalid for option "size"');let N=new Uint8Array(O);return Object.setPrototypeOf(N,v.prototype),N}function v(O,N,$){if(typeof O=="number"){if(typeof N=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(O)}return w(O,N,$)}v.poolSize=8192;function w(O,N,$){if(typeof O=="string")return S(O,N);if(ArrayBuffer.isView(O))return A(O);if(O==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O);if(ut(O,ArrayBuffer)||O&&ut(O.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(O,SharedArrayBuffer)||O&&ut(O.buffer,SharedArrayBuffer)))return k(O,N,$);if(typeof O=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let ee=O.valueOf&&O.valueOf();if(ee!=null&&ee!==O)return v.from(ee,N,$);let re=I(O);if(re)return re;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof O[Symbol.toPrimitive]=="function")return v.from(O[Symbol.toPrimitive]("string"),N,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof O)}v.from=function(O,N,$){return w(O,N,$)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array);function m(O){if(typeof O!="number")throw new TypeError('"size" argument must be of type number');if(O<0)throw new RangeError('The value "'+O+'" is invalid for option "size"')}function y(O,N,$){return m(O),O<=0?c(O):N!==void 0?typeof $=="string"?c(O).fill(N,$):c(O).fill(N):c(O)}v.alloc=function(O,N,$){return y(O,N,$)};function g(O){return m(O),c(O<0?0:B(O)|0)}v.allocUnsafe=function(O){return g(O)},v.allocUnsafeSlow=function(O){return g(O)};function S(O,N){if((typeof N!="string"||N==="")&&(N="utf8"),!v.isEncoding(N))throw new TypeError("Unknown encoding: "+N);let $=C(O,N)|0,ee=c($),re=ee.write(O,N);return re!==$&&(ee=ee.slice(0,re)),ee}function R(O){let N=O.length<0?0:B(O.length)|0,$=c(N);for(let ee=0;ee<N;ee+=1)$[ee]=O[ee]&255;return $}function A(O){if(ut(O,Uint8Array)){let N=new Uint8Array(O);return k(N.buffer,N.byteOffset,N.byteLength)}return R(O)}function k(O,N,$){if(N<0||O.byteLength<N)throw new RangeError('"offset" is outside of buffer bounds');if(O.byteLength<N+($||0))throw new RangeError('"length" is outside of buffer bounds');let ee;return N===void 0&&$===void 0?ee=new Uint8Array(O):$===void 0?ee=new Uint8Array(O,N):ee=new Uint8Array(O,N,$),Object.setPrototypeOf(ee,v.prototype),ee}function I(O){if(v.isBuffer(O)){let N=B(O.length)|0,$=c(N);return $.length===0||O.copy($,0,0,N),$}if(O.length!==void 0)return typeof O.length!="number"||qe(O.length)?c(0):R(O);if(O.type==="Buffer"&&Array.isArray(O.data))return R(O.data)}function B(O){if(O>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return O|0}function P(O){return+O!=O&&(O=0),v.alloc(+O)}v.isBuffer=function(O){return O!=null&&O._isBuffer===!0&&O!==v.prototype},v.compare=function(O,N){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),ut(N,Uint8Array)&&(N=v.from(N,N.offset,N.byteLength)),!v.isBuffer(O)||!v.isBuffer(N))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(O===N)return 0;let $=O.length,ee=N.length;for(let re=0,se=Math.min($,ee);re<se;++re)if(O[re]!==N[re]){$=O[re],ee=N[re];break}return $<ee?-1:ee<$?1:0},v.isEncoding=function(O){switch(String(O).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},v.concat=function(O,N){if(!Array.isArray(O))throw new TypeError('"list" argument must be an Array of Buffers');if(O.length===0)return v.alloc(0);let $;if(N===void 0)for(N=0,$=0;$<O.length;++$)N+=O[$].length;let ee=v.allocUnsafe(N),re=0;for($=0;$<O.length;++$){let se=O[$];if(ut(se,Uint8Array))re+se.length>ee.length?(v.isBuffer(se)||(se=v.from(se)),se.copy(ee,re)):Uint8Array.prototype.set.call(ee,se,re);else if(v.isBuffer(se))se.copy(ee,re);else throw new TypeError('"list" argument must be an Array of Buffers');re+=se.length}return ee};function C(O,N){if(v.isBuffer(O))return O.length;if(ArrayBuffer.isView(O)||ut(O,ArrayBuffer))return O.byteLength;if(typeof O!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof O);let $=O.length,ee=arguments.length>2&&arguments[2]===!0;if(!ee&&$===0)return 0;let re=!1;for(;;)switch(N){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return he(O).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Ae(O).length;default:if(re)return ee?-1:he(O).length;N=(""+N).toLowerCase(),re=!0}}v.byteLength=C;function q(O,N,$){let ee=!1;if((N===void 0||N<0)&&(N=0),N>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,N>>>=0,$<=N))return"";for(O||(O="utf8");;)switch(O){case"hex":return t(this,N,$);case"utf8":case"utf-8":return l(this,N,$);case"ascii":return x(this,N,$);case"latin1":case"binary":return o(this,N,$);case"base64":return f(this,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u(this,N,$);default:if(ee)throw new TypeError("Unknown encoding: "+O);O=(O+"").toLowerCase(),ee=!0}}v.prototype._isBuffer=!0;function K(O,N,$){let ee=O[N];O[N]=O[$],O[$]=ee}v.prototype.swap16=function(){let O=this.length;if(O%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let N=0;N<O;N+=2)K(this,N,N+1);return this},v.prototype.swap32=function(){let O=this.length;if(O%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let N=0;N<O;N+=4)K(this,N,N+3),K(this,N+1,N+2);return this},v.prototype.swap64=function(){let O=this.length;if(O%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let N=0;N<O;N+=8)K(this,N,N+7),K(this,N+1,N+6),K(this,N+2,N+5),K(this,N+3,N+4);return this},v.prototype.toString=function(){let O=this.length;return O===0?"":arguments.length===0?l(this,0,O):q.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(O){if(!v.isBuffer(O))throw new TypeError("Argument must be a Buffer");return this===O?!0:v.compare(this,O)===0},v.prototype.inspect=function(){let O="",N=e.INSPECT_MAX_BYTES;return O=this.toString("hex",0,N).replace(/(.{2})/g,"$1 ").trim(),this.length>N&&(O+=" ... "),"<Buffer "+O+">"},h&&(v.prototype[h]=v.prototype.inspect),v.prototype.compare=function(O,N,$,ee,re){if(ut(O,Uint8Array)&&(O=v.from(O,O.offset,O.byteLength)),!v.isBuffer(O))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof O);if(N===void 0&&(N=0),$===void 0&&($=O?O.length:0),ee===void 0&&(ee=0),re===void 0&&(re=this.length),N<0||$>O.length||ee<0||re>this.length)throw new RangeError("out of range index");if(ee>=re&&N>=$)return 0;if(ee>=re)return-1;if(N>=$)return 1;if(N>>>=0,$>>>=0,ee>>>=0,re>>>=0,this===O)return 0;let se=re-ee,ce=$-N,st=Math.min(se,ce),ye=this.slice(ee,re),be=O.slice(N,$);for(let me=0;me<st;++me)if(ye[me]!==be[me]){se=ye[me],ce=be[me];break}return se<ce?-1:ce<se?1:0};function V(O,N,$,ee,re){if(O.length===0)return-1;if(typeof $=="string"?(ee=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,qe($)&&($=re?0:O.length-1),$<0&&($=O.length+$),$>=O.length){if(re)return-1;$=O.length-1}else if($<0)if(re)$=0;else return-1;if(typeof N=="string"&&(N=v.from(N,ee)),v.isBuffer(N))return N.length===0?-1:j(O,N,$,ee,re);if(typeof N=="number")return N=N&255,typeof Uint8Array.prototype.indexOf=="function"?re?Uint8Array.prototype.indexOf.call(O,N,$):Uint8Array.prototype.lastIndexOf.call(O,N,$):j(O,[N],$,ee,re);throw new TypeError("val must be string, number or Buffer")}function j(O,N,$,ee,re){let se=1,ce=O.length,st=N.length;if(ee!==void 0&&(ee=String(ee).toLowerCase(),ee==="ucs2"||ee==="ucs-2"||ee==="utf16le"||ee==="utf-16le")){if(O.length<2||N.length<2)return-1;se=2,ce/=2,st/=2,$/=2}function ye(me,Te){return se===1?me[Te]:me.readUInt16BE(Te*se)}let be;if(re){let me=-1;for(be=$;be<ce;be++)if(ye(O,be)===ye(N,me===-1?0:be-me)){if(me===-1&&(me=be),be-me+1===st)return me*se}else me!==-1&&(be-=be-me),me=-1}else for($+st>ce&&($=ce-st),be=$;be>=0;be--){let me=!0;for(let Te=0;Te<st;Te++)if(ye(O,be+Te)!==ye(N,Te)){me=!1;break}if(me)return be}return-1}v.prototype.includes=function(O,N,$){return this.indexOf(O,N,$)!==-1},v.prototype.indexOf=function(O,N,$){return V(this,O,N,$,!0)},v.prototype.lastIndexOf=function(O,N,$){return V(this,O,N,$,!1)};function z(O,N,$,ee){$=Number($)||0;let re=O.length-$;ee?(ee=Number(ee),ee>re&&(ee=re)):ee=re;let se=N.length;ee>se/2&&(ee=se/2);let ce;for(ce=0;ce<ee;++ce){let st=parseInt(N.substr(ce*2,2),16);if(qe(st))return ce;O[$+ce]=st}return ce}function J(O,N,$,ee){return _e(he(N,O.length-$),O,$,ee)}function E(O,N,$,ee){return _e(pe(N),O,$,ee)}function i(O,N,$,ee){return _e(Ae(N),O,$,ee)}function s(O,N,$,ee){return _e(De(N,O.length-$),O,$,ee)}v.prototype.write=function(O,N,$,ee){if(N===void 0)ee="utf8",$=this.length,N=0;else if($===void 0&&typeof N=="string")ee=N,$=this.length,N=0;else if(isFinite(N))N=N>>>0,isFinite($)?($=$>>>0,ee===void 0&&(ee="utf8")):(ee=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let re=this.length-N;if(($===void 0||$>re)&&($=re),O.length>0&&($<0||N<0)||N>this.length)throw new RangeError("Attempt to write outside buffer bounds");ee||(ee="utf8");let se=!1;for(;;)switch(ee){case"hex":return z(this,O,N,$);case"utf8":case"utf-8":return J(this,O,N,$);case"ascii":case"latin1":case"binary":return E(this,O,N,$);case"base64":return i(this,O,N,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,O,N,$);default:if(se)throw new TypeError("Unknown encoding: "+ee);ee=(""+ee).toLowerCase(),se=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(O,N,$){return N===0&&$===O.length?r.fromByteArray(O):r.fromByteArray(O.slice(N,$))}function l(O,N,$){$=Math.min(O.length,$);let ee=[],re=N;for(;re<$;){let se=O[re],ce=null,st=se>239?4:se>223?3:se>191?2:1;if(re+st<=$){let ye,be,me,Te;switch(st){case 1:se<128&&(ce=se);break;case 2:ye=O[re+1],(ye&192)===128&&(Te=(se&31)<<6|ye&63,Te>127&&(ce=Te));break;case 3:ye=O[re+1],be=O[re+2],(ye&192)===128&&(be&192)===128&&(Te=(se&15)<<12|(ye&63)<<6|be&63,Te>2047&&(Te<55296||Te>57343)&&(ce=Te));break;case 4:ye=O[re+1],be=O[re+2],me=O[re+3],(ye&192)===128&&(be&192)===128&&(me&192)===128&&(Te=(se&15)<<18|(ye&63)<<12|(be&63)<<6|me&63,Te>65535&&Te<1114112&&(ce=Te))}}ce===null?(ce=65533,st=1):ce>65535&&(ce-=65536,ee.push(ce>>>10&1023|55296),ce=56320|ce&1023),ee.push(ce),re+=st}return _(ee)}var p=4096;function _(O){let N=O.length;if(N<=p)return String.fromCharCode.apply(String,O);let $="",ee=0;for(;ee<N;)$+=String.fromCharCode.apply(String,O.slice(ee,ee+=p));return $}function x(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]&127);return ee}function o(O,N,$){let ee="";$=Math.min(O.length,$);for(let re=N;re<$;++re)ee+=String.fromCharCode(O[re]);return ee}function t(O,N,$){let ee=O.length;(!N||N<0)&&(N=0),(!$||$<0||$>ee)&&($=ee);let re="";for(let se=N;se<$;++se)re+=ke[O[se]];return re}function u(O,N,$){let ee=O.slice(N,$),re="";for(let se=0;se<ee.length-1;se+=2)re+=String.fromCharCode(ee[se]+ee[se+1]*256);return re}v.prototype.slice=function(O,N){let $=this.length;O=~~O,N=N===void 0?$:~~N,O<0?(O+=$,O<0&&(O=0)):O>$&&(O=$),N<0?(N+=$,N<0&&(N=0)):N>$&&(N=$),N<O&&(N=O);let ee=this.subarray(O,N);return Object.setPrototypeOf(ee,v.prototype),ee};function b(O,N,$){if(O%1!==0||O<0)throw new RangeError("offset is not uint");if(O+N>$)throw new RangeError("Trying to access beyond buffer length")}v.prototype.readUintLE=v.prototype.readUIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return ee},v.prototype.readUintBE=v.prototype.readUIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O+--N],re=1;for(;N>0&&(re*=256);)ee+=this[O+--N]*re;return ee},v.prototype.readUint8=v.prototype.readUInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]|this[O+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(O,N){return O=O>>>0,N||b(O,2,this.length),this[O]<<8|this[O+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),(this[O]|this[O+1]<<8|this[O+2]<<16)+this[O+3]*16777216},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]*16777216+(this[O+1]<<16|this[O+2]<<8|this[O+3])},v.prototype.readBigUInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24,re=this[++O]+this[++O]*2**8+this[++O]*2**16+$*2**24;return BigInt(ee)+(BigInt(re)<<BigInt(32))}),v.prototype.readBigUInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=N*2**24+this[++O]*2**16+this[++O]*2**8+this[++O],re=this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$;return(BigInt(ee)<<BigInt(32))+BigInt(re)}),v.prototype.readIntLE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=this[O],re=1,se=0;for(;++se<N&&(re*=256);)ee+=this[O+se]*re;return re*=128,ee>=re&&(ee-=Math.pow(2,8*N)),ee},v.prototype.readIntBE=function(O,N,$){O=O>>>0,N=N>>>0,$||b(O,N,this.length);let ee=N,re=1,se=this[O+--ee];for(;ee>0&&(re*=256);)se+=this[O+--ee]*re;return re*=128,se>=re&&(se-=Math.pow(2,8*N)),se},v.prototype.readInt8=function(O,N){return O=O>>>0,N||b(O,1,this.length),this[O]&128?(255-this[O]+1)*-1:this[O]},v.prototype.readInt16LE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O]|this[O+1]<<8;return $&32768?$|4294901760:$},v.prototype.readInt16BE=function(O,N){O=O>>>0,N||b(O,2,this.length);let $=this[O+1]|this[O]<<8;return $&32768?$|4294901760:$},v.prototype.readInt32LE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]|this[O+1]<<8|this[O+2]<<16|this[O+3]<<24},v.prototype.readInt32BE=function(O,N){return O=O>>>0,N||b(O,4,this.length),this[O]<<24|this[O+1]<<16|this[O+2]<<8|this[O+3]},v.prototype.readBigInt64LE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=this[O+4]+this[O+5]*2**8+this[O+6]*2**16+($<<24);return(BigInt(ee)<<BigInt(32))+BigInt(N+this[++O]*2**8+this[++O]*2**16+this[++O]*2**24)}),v.prototype.readBigInt64BE=mt(function(O){O=O>>>0,Z(O,"offset");let N=this[O],$=this[O+7];(N===void 0||$===void 0)&&ie(O,this.length-8);let ee=(N<<24)+this[++O]*2**16+this[++O]*2**8+this[++O];return(BigInt(ee)<<BigInt(32))+BigInt(this[++O]*2**24+this[++O]*2**16+this[++O]*2**8+$)}),v.prototype.readFloatLE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!0,23,4)},v.prototype.readFloatBE=function(O,N){return O=O>>>0,N||b(O,4,this.length),n.read(this,O,!1,23,4)},v.prototype.readDoubleLE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!0,52,8)},v.prototype.readDoubleBE=function(O,N){return O=O>>>0,N||b(O,8,this.length),n.read(this,O,!1,52,8)};function M(O,N,$,ee,re,se){if(!v.isBuffer(O))throw new TypeError('"buffer" argument must be a Buffer instance');if(N>re||N<se)throw new RangeError('"value" argument is out of bounds');if($+ee>O.length)throw new RangeError("Index out of range")}v.prototype.writeUintLE=v.prototype.writeUIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=1,se=0;for(this[N]=O&255;++se<$&&(re*=256);)this[N+se]=O/re&255;return N+$},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,$=$>>>0,!ee){let ce=Math.pow(2,8*$)-1;M(this,O,N,$,ce,0)}let re=$-1,se=1;for(this[N+re]=O&255;--re>=0&&(se*=256);)this[N+re]=O/se&255;return N+$},v.prototype.writeUint8=v.prototype.writeUInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,255,0),this[N]=O&255,N+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,65535,0),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N+3]=O>>>24,this[N+2]=O>>>16,this[N+1]=O>>>8,this[N]=O&255,N+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,4294967295,0),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4};function T(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se,se=se>>8,O[$++]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,ce=ce>>8,O[$++]=ce,$}function D(O,N,$,ee,re){U(N,ee,re,O,$,7);let se=Number(N&BigInt(4294967295));O[$+7]=se,se=se>>8,O[$+6]=se,se=se>>8,O[$+5]=se,se=se>>8,O[$+4]=se;let ce=Number(N>>BigInt(32)&BigInt(4294967295));return O[$+3]=ce,ce=ce>>8,O[$+2]=ce,ce=ce>>8,O[$+1]=ce,ce=ce>>8,O[$]=ce,$+8}v.prototype.writeBigUInt64LE=mt(function(O,N=0){return T(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeBigUInt64BE=mt(function(O,N=0){return D(this,O,N,BigInt(0),BigInt("0xffffffffffffffff"))}),v.prototype.writeIntLE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=0,se=1,ce=0;for(this[N]=O&255;++re<$&&(se*=256);)O<0&&ce===0&&this[N+re-1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeIntBE=function(O,N,$,ee){if(O=+O,N=N>>>0,!ee){let st=Math.pow(2,8*$-1);M(this,O,N,$,st-1,-st)}let re=$-1,se=1,ce=0;for(this[N+re]=O&255;--re>=0&&(se*=256);)O<0&&ce===0&&this[N+re+1]!==0&&(ce=1),this[N+re]=(O/se>>0)-ce&255;return N+$},v.prototype.writeInt8=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,1,127,-128),O<0&&(O=255+O+1),this[N]=O&255,N+1},v.prototype.writeInt16LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O&255,this[N+1]=O>>>8,N+2},v.prototype.writeInt16BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,2,32767,-32768),this[N]=O>>>8,this[N+1]=O&255,N+2},v.prototype.writeInt32LE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),this[N]=O&255,this[N+1]=O>>>8,this[N+2]=O>>>16,this[N+3]=O>>>24,N+4},v.prototype.writeInt32BE=function(O,N,$){return O=+O,N=N>>>0,$||M(this,O,N,4,2147483647,-2147483648),O<0&&(O=4294967295+O+1),this[N]=O>>>24,this[N+1]=O>>>16,this[N+2]=O>>>8,this[N+3]=O&255,N+4},v.prototype.writeBigInt64LE=mt(function(O,N=0){return T(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),v.prototype.writeBigInt64BE=mt(function(O,N=0){return D(this,O,N,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Q(O,N,$,ee,re,se){if($+ee>O.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function W(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,4,34028234663852886e22,-34028234663852886e22),n.write(O,N,$,ee,23,4),$+4}v.prototype.writeFloatLE=function(O,N,$){return W(this,O,N,!0,$)},v.prototype.writeFloatBE=function(O,N,$){return W(this,O,N,!1,$)};function X(O,N,$,ee,re){return N=+N,$=$>>>0,re||Q(O,N,$,8,17976931348623157e292,-17976931348623157e292),n.write(O,N,$,ee,52,8),$+8}v.prototype.writeDoubleLE=function(O,N,$){return X(this,O,N,!0,$)},v.prototype.writeDoubleBE=function(O,N,$){return X(this,O,N,!1,$)},v.prototype.copy=function(O,N,$,ee){if(!v.isBuffer(O))throw new TypeError("argument should be a Buffer");if($||($=0),!ee&&ee!==0&&(ee=this.length),N>=O.length&&(N=O.length),N||(N=0),ee>0&&ee<$&&(ee=$),ee===$||O.length===0||this.length===0)return 0;if(N<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(ee<0)throw new RangeError("sourceEnd out of bounds");ee>this.length&&(ee=this.length),O.length-N<ee-$&&(ee=O.length-N+$);let re=ee-$;return this===O&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(N,$,ee):Uint8Array.prototype.set.call(O,this.subarray($,ee),N),re},v.prototype.fill=function(O,N,$,ee){if(typeof O=="string"){if(typeof N=="string"?(ee=N,N=0,$=this.length):typeof $=="string"&&(ee=$,$=this.length),ee!==void 0&&typeof ee!="string")throw new TypeError("encoding must be a string");if(typeof ee=="string"&&!v.isEncoding(ee))throw new TypeError("Unknown encoding: "+ee);if(O.length===1){let se=O.charCodeAt(0);(ee==="utf8"&&se<128||ee==="latin1")&&(O=se)}}else typeof O=="number"?O=O&255:typeof O=="boolean"&&(O=Number(O));if(N<0||this.length<N||this.length<$)throw new RangeError("Out of range index");if($<=N)return this;N=N>>>0,$=$===void 0?this.length:$>>>0,O||(O=0);let re;if(typeof O=="number")for(re=N;re<$;++re)this[re]=O;else{let se=v.isBuffer(O)?O:v.from(O,ee),ce=se.length;if(ce===0)throw new TypeError('The value "'+O+'" is invalid for argument "value"');for(re=0;re<$-N;++re)this[re+N]=se[re%ce]}return this};var G={};function Y(O,N,$){G[O]=class extends ${constructor(){super(),Object.defineProperty(this,"message",{value:N.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${O}]`,this.stack,delete this.name}get code(){return O}set code(ee){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ee,writable:!0})}toString(){return`${this.name} [${O}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(O){return O?`${O} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(O,N){return`The "${O}" argument must be of type number. Received type ${typeof N}`},TypeError),Y("ERR_OUT_OF_RANGE",function(O,N,$){let ee=`The value of "${O}" is out of range.`,re=$;return Number.isInteger($)&&Math.abs($)>2**32?re=ae(String($)):typeof $=="bigint"&&(re=String($),($>BigInt(2)**BigInt(32)||$<-(BigInt(2)**BigInt(32)))&&(re=ae(re)),re+="n"),ee+=` It must be ${N}. Received ${re}`,ee},RangeError);function ae(O){let N="",$=O.length,ee=O[0]==="-"?1:0;for(;$>=ee+4;$-=3)N=`_${O.slice($-3,$)}${N}`;return`${O.slice(0,$)}${N}`}function te(O,N,$){Z(N,"offset"),(O[N]===void 0||O[N+$]===void 0)&&ie(N,O.length-($+1))}function U(O,N,$,ee,re,se){if(O>$||O<N){let ce=typeof N=="bigint"?"n":"",st;throw se>3?N===0||N===BigInt(0)?st=`>= 0${ce} and < 2${ce} ** ${(se+1)*8}${ce}`:st=`>= -(2${ce} ** ${(se+1)*8-1}${ce}) and < 2 ** ${(se+1)*8-1}${ce}`:st=`>= ${N}${ce} and <= ${$}${ce}`,new G.ERR_OUT_OF_RANGE("value",st,O)}te(ee,re,se)}function Z(O,N){if(typeof O!="number")throw new G.ERR_INVALID_ARG_TYPE(N,"number",O)}function ie(O,N,$){throw Math.floor(O)!==O?(Z(O,$),new G.ERR_OUT_OF_RANGE($||"offset","an integer",O)):N<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE($||"offset",`>= ${$?1:0} and <= ${N}`,O)}var fe=/[^+/0-9A-Za-z-_]/g;function de(O){if(O=O.split("=")[0],O=O.trim().replace(fe,""),O.length<2)return"";for(;O.length%4!==0;)O=O+"=";return O}function he(O,N){N=N||1/0;let $,ee=O.length,re=null,se=[];for(let ce=0;ce<ee;++ce){if($=O.charCodeAt(ce),$>55295&&$<57344){if(!re){if($>56319){(N-=3)>-1&&se.push(239,191,189);continue}else if(ce+1===ee){(N-=3)>-1&&se.push(239,191,189);continue}re=$;continue}if($<56320){(N-=3)>-1&&se.push(239,191,189),re=$;continue}$=(re-55296<<10|$-56320)+65536}else re&&(N-=3)>-1&&se.push(239,191,189);if(re=null,$<128){if((N-=1)<0)break;se.push($)}else if($<2048){if((N-=2)<0)break;se.push($>>6|192,$&63|128)}else if($<65536){if((N-=3)<0)break;se.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((N-=4)<0)break;se.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return se}function pe(O){let N=[];for(let $=0;$<O.length;++$)N.push(O.charCodeAt($)&255);return N}function De(O,N){let $,ee,re,se=[];for(let ce=0;ce<O.length&&!((N-=2)<0);++ce)$=O.charCodeAt(ce),ee=$>>8,re=$%256,se.push(re),se.push(ee);return se}function Ae(O){return r.toByteArray(de(O))}function _e(O,N,$,ee){let re;for(re=0;re<ee&&!(re+$>=N.length||re>=O.length);++re)N[re+$]=O[re];return re}function ut(O,N){return O instanceof N||O!=null&&O.constructor!=null&&O.constructor.name!=null&&O.constructor.name===N.name}function qe(O){return O!==O}var ke=function(){let O="0123456789abcdef",N=new Array(256);for(let $=0;$<16;++$){let ee=$*16;for(let re=0;re<16;++re)N[ee+re]=O[$]+O[re]}return N}();function mt(O){return typeof BigInt>"u"?ne:O}function ne(){throw new Error("BigInt not supported")}}),VRe=oh((e,r)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,r.exports={Buffer:TR().Buffer,Crypto:window.crypto}):r.exports={Buffer:TR().Buffer,Crypto:crypto}}),Nee={};zRe(Nee,{AVSCTap:()=>Q2,ArweaveSigner:()=>GR,DataItem:()=>W2,MAX_TAG_BYTES:()=>Yb,MIN_BINARY_SIZE:()=>JR,SIG_CONFIG:()=>Kd,SignatureConfig:()=>Is,Signer:()=>Cee,createData:()=>Uee,deserializeTags:()=>jb,indexToType:()=>VR,serializeTags:()=>YR,tagsExceedLimit:()=>$ee});var Cee=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,n,h){throw new Error("You must implement verify method on child")}},YRe=ql(WR(),1),xf=ql(Pee(),1);async function Lee(e){if(Array.isArray(e)){let a=(0,xf.concatBuffers)([(0,xf.stringToBuffer)("list"),(0,xf.stringToBuffer)(e.length.toString())]);return await Dee(e,await rh().hash(a,"SHA-384"))}let r=e,n=(0,xf.concatBuffers)([(0,xf.stringToBuffer)("blob"),(0,xf.stringToBuffer)(r.byteLength.toString())]),h=(0,xf.concatBuffers)([await rh().hash(n,"SHA-384"),await rh().hash(r,"SHA-384")]);return await rh().hash(h,"SHA-384")}async function Dee(e,r){if(e.length<1)return r;let n=(0,xf.concatBuffers)([r,await Lee(e[0])]),h=await rh().hash(n,"SHA-384");return await Dee(e.slice(1),h)}var dR=ql(WRe(),1),JRe=dR.default.default?dR.default.default:dR.default,XRe=class extends JRe{getPublicKey(e){throw new Error("Unimplemented")}},QRe;function rh(){return QRe??=new XRe}var Is;(function(e){e[e.ARWEAVE=1]="ARWEAVE",e[e.ED25519=2]="ED25519",e[e.ETHEREUM=3]="ETHEREUM",e[e.SOLANA=4]="SOLANA",e[e.INJECTEDAPTOS=5]="INJECTEDAPTOS",e[e.MULTIAPTOS=6]="MULTIAPTOS",e[e.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Is||(Is={}));var Kd={[Is.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Is.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Is.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Is.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Is.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Is.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Is.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},GR=class{signatureType=1;ownerLength=Kd[1].pubLength;signatureLength=Kd[1].sigLength;jwk;pk;constructor(e){this.pk=e.n,this.jwk=e}get publicKey(){return YRe.default.toBuffer(this.pk)}sign(e){return rh().sign(this.jwk,e)}static async verify(e,r,n){return await rh().verify(e,r,n)}},VR={1:GR},lu=ql(WR(),1);async function kR(e){return Lee([(0,xf.stringToBuffer)("dataitem"),(0,xf.stringToBuffer)("1"),(0,xf.stringToBuffer)(e.signatureType.toString()),e.rawOwner,e.rawTarget,e.rawAnchor,e.rawTags,e.rawData])}async function exe(e,r){let n=await kR(e),h=await r.sign(n),a=await rh().hash(h);return{signature:St.from(h),id:St.from(a)}}async function txe(e,r){let{signature:n,id:h}=await exe(e,r);return e.getRaw().set(n,2),h}var Q2=class{buf;pos;constructor(e=St.alloc(Yb),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,n;if(r)for(this.writeLong(r),n=0;n<r;n++){let h=e[n];if(h?.name===void 0||h?.value===void 0)throw new Error(`Invalid tag format for ${h}, expected {name:string, value: string}`);this.writeString(h.name),this.writeString(h.value)}this.writeLong(0)}toBuffer(){let e=St.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(e){let r=this.buf,n,h;if(e>=-1073741824&&e<1073741824){h=e>=0?e<<1:~e<<1|1;do r[this.pos]=h&127,h>>=7;while(h&&(r[this.pos++]|=128))}else{n=e>=0?e*2:-e*2-1;do r[this.pos]=n&127,n/=128;while(n>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=St.byteLength(e),n=this.buf;this.writeLong(r);let h=this.pos;if(this.pos+=r,!(this.pos>n.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let a,d,c,v;for(a=0,d=r;a<d;a++)c=e.charCodeAt(a),c<128?n[h++]=c:c<2048?(n[h++]=c>>6|192,n[h++]=c&63|128):(c&64512)===55296&&((v=e.charCodeAt(a+1))&64512)===56320?(c=65536+((c&1023)<<10)+(v&1023),a++,n[h++]=c>>18|240,n[h++]=c>>12&63|128,n[h++]=c>>6&63|128,n[h++]=c&63|128):(n[h++]=c>>12|224,n[h++]=c>>6&63|128,n[h++]=c&63|128)}this.buf=n}}readLong(){let e=0,r=0,n=this.buf,h,a,d,c;do h=n[this.pos++],a=h&128,e|=(h&127)<<r,r+=7;while(a&&r<28);if(a){d=e,c=268435456;do h=n[this.pos++],d+=(h&127)*c,c*=128;while(h&128);return(d%2?-(d+1):d)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let n=this.readString(),h=this.readString();e.push({name:n,value:h})}return e}readString(){let e=this.readLong(),r=this.pos,n=this.buf;if(this.pos+=e,!(this.pos>n.length))return this.buf.slice(r,r+e).toString()}};function YR(e){let r=new Q2;return r.writeTags(e),r.toBuffer()}function $ee(e){let r=new Q2;return r.writeTags(e),r.tagsExceedLimit()}function jb(e){return new Q2(e).readTags()}function i0(e){let r=0;for(let n=e.length-1;n>=0;n--)r=r*256+e[n];return r}function rxe(e){if(e>29)throw new Error("Short too long");let r=[0,0];for(let n=0;n<r.length;n++){let h=e&255;r[n]=h,e=(e-h)/256}return Uint8Array.from(r)}function AQ(e){let r=[0,0,0,0,0,0,0,0];for(let n=0;n<r.length;n++){let h=e&255;r[n]=h,e=(e-h)/256}return Uint8Array.from(r)}var ixe=ql(VRe(),1),Od=ql(TR(),1),Yb=4096,JR=80,W2=class{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=i0(this.binary.subarray(0,2));if(Is?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return W2.verify(this.binary)}get id(){return(async()=>lu.default.encode(await this.rawId))()}set id(e){this._id=lu.default.toBuffer(e)}get rawId(){return(async()=>Od.Buffer.from(await ixe.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return lu.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Kd[this.signatureType].sigLength}get owner(){return lu.default.encode(this.rawOwner)}get ownerLength(){return Kd[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Od.Buffer.alloc(0)}get target(){return lu.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Od.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let e=this.getTagsStart(),r=i0(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(i0(this.binary.subarray(e,e+8))==0)return[];let r=i0(this.binary.subarray(e+8,e+16));return jb(Od.Buffer.from(this.binary.subarray(e+16,e+16+r)))}get tagsB64Url(){return this.tags.map(e=>({name:lu.default.encode(e.name),value:lu.default.encode(e.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),n=i0(r);return e+16+n}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),n=i0(r),h=e+16+n;return this.binary.subarray(h,this.binary.length)}get data(){return lu.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await txe(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Od.Buffer.from(await rh().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:lu.default.encode(e.name),value:lu.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<JR)return!1;let r=new W2(e),n=r.signatureType,h=r.getTagsStart(),a=i0(e.subarray(h,h+8)),d=e.subarray(h+8,h+16),c=i0(d);if(c>Yb)return!1;if(a>0)try{if(jb(Od.Buffer.from(e.subarray(h+16,h+16+c))).length!==a)return!1}catch{return!1}let v=VR[n],w=await kR(r);return await v.verify(r.rawOwner,w,r.rawSignature)}async getSignatureData(){return kR(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,n=e+(r?33:1),h=this.binary[n]==1;return n+=h?33:1,n}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},nxe=ql(WR(),1);function Uee(e,r,n){let h=r.publicKey,a=n?.target?nxe.default.toBuffer(n.target):null,d=1+(a?.byteLength??0),c=n?.anchor?St.from(n.anchor):null,v=1+(c?.byteLength??0),w=(n?.tags?.length??0)>0?YR(n.tags):null,m=16+(w?w.byteLength:0),y=St.from(e),g=y.byteLength,S=2+r.signatureLength+r.ownerLength+d+v+m+g,R=St.alloc(S);if(R.set(rxe(r.signatureType),0),R.set(new Uint8Array(r.signatureLength).fill(0),2),h.byteLength!==r.ownerLength)throw new Error(`Owner must be ${r.ownerLength} bytes, but was incorrectly ${h.byteLength}`);R.set(h,2+r.signatureLength);let A=2+r.signatureLength+r.ownerLength;if(R[A]=a?1:0,a){if(a.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${a.byteLength}`);R.set(a,A+1)}let k=A+d,I=k+1;if(R[k]=c?1:0,c){if(I+=c.byteLength,c.byteLength!==32)throw new Error("Anchor must be 32 bytes");R.set(c,k+1)}R.set(AQ(n?.tags?.length??0),I);let B=AQ(w?.byteLength??0);R.set(B,I+8),w&&R.set(w,I+16);let P=I+m;return R.set(y,P),new W2(R)}var XR={...Nee};globalThis.arbundles??=XR;var axe=XR,oxe=XR;globalThis.Buffer||(globalThis.Buffer=Iee.Buffer);var{DataItem:sxe}=Bee;function fxe(e){return async({data:n,tags:h,target:a,anchor:d,createDataItem:c=v=>new sxe(v)})=>{let v=await e.signDataItem({data:n,tags:h,target:a,anchor:d}),w=c(Iee.Buffer.from(v));return{id:await w.id,raw:await w.getRaw()}}}var uxe=globalThis.GATEWAY_URL||void 0,hxe=globalThis.MU_URL||void 0,lxe=globalThis.CU_URL||void 0,cxe=globalThis.GRAPHQL_URL||void 0,{result:WKe,results:GKe,message:VKe,spawn:YKe,monitor:JKe,unmonitor:XKe,dryrun:QKe,assign:eZe}=X2({GATEWAY_URL:uxe,MU_URL:hxe,CU_URL:lxe,GRAPHQL_URL:cxe}),tZe=kee.createDataItemSigner;var qee=fc(O8(),1);Be();Pe();Oe();function QR(e){try{return JSON.parse(e)}catch{return e}}var Xo=class e{logger;processId;ao;constructor({processId:r,ao:n=X2(),logger:h=Gc.default}){this.processId=r,this.logger=h,this.ao=n}static async createAoSigner(r){return r.publicKey===void 0&&"setPublicKey"in r&&await r.setPublicKey(),async({data:h,tags:a,target:d,anchor:c})=>{let v=(0,qee.createData)(h,r,{tags:a,target:d,anchor:c});return v.sign(r).then(async()=>({id:await v.id,raw:await v.getRaw()}))}}async read({tags:r,retries:n=3}){let h=0,a;for(;h<n;)try{this.logger.debug("Evaluating read interaction on contract",{tags:r});let d=await this.ao.dryrun({process:this.processId,tags:r});if(d.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);let v=d.Messages[0].Tags.find(m=>m.name==="Error");if(v)throw new Error(`${v.Value}: ${d.Messages[0].Data}`);return this.logger.debug("Read interaction result",{result:d.Messages[0].Data}),d.Messages[0].Data===void 0?{}:QR(d.Messages[0].Data)}catch(d){h++,this.logger.debug(`Read attempt ${h} failed`,{error:d,tags:r}),a=d,await new Promise(c=>setTimeout(c,2**h*1e3))}throw a}async send({tags:r,data:n,signer:h,retries:a=3}){let d=0,c;for(;d<a;)try{this.logger.debug("Evaluating send interaction on contract",{tags:r,data:n,processId:this.processId});let v=await this.ao.message({process:this.processId,tags:[...r,{name:"AR-IO-SDK",value:Wc}],data:typeof n!="string"?JSON.stringify(n):n,signer:await e.createAoSigner(h)});this.logger.debug("Sent message to process",{messageId:v,processId:this.processId});let w=await this.ao.result({message:v,process:this.processId});if(this.logger.debug("Message result",{output:w,messageId:v,processId:this.processId}),w.Messages?.length===0||w.Messages===void 0)return{id:v};let y=w.Messages[0].Tags.find(S=>S.name==="Error");if(y){let S=w.Messages[0].Data;throw new vm(`${y.Value}: ${S}`)}if(w.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(w.Messages[0].Data===void 0)return{id:v};let g=QR(w.Messages[0].Data);return this.logger.debug("Message result data",{resultData:g,messageId:v,processId:this.processId}),{id:v,result:g}}catch(v){if(this.logger.error("Error sending message to process",{error:v.message,processId:this.processId,tags:r}),v.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:d,retries:a,error:v.message,processId:this.processId}),await new Promise(w=>setTimeout(w,2**d*2e3)),d++,c=v;else throw v}throw c}};var ev=class{static init(r){if(r&&r.signer){let{signer:n,...h}=r;return new ex({...h,signer:n})}return new Jb(r)}},Jb=class{process;arweave;constructor(r,n=wb){if(!r)this.process=new Xo({processId:lc});else if(cc(r))this.process=r.process;else if(dc(r))this.process=new Xo({processId:r.processId});else throw new gh;this.arweave=n}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getEpochSettings(r){let h=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getEpoch(r){let h=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getArNSRecord({name:r}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:r}]})}async getArNSRecords(){return this.process.read({tags:[{name:"Action",value:"Records"}]})}async getArNSReservedNames(){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"}]})}async getArNSReservedName({name:r}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:r}]})}async getBalance({address:r}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:r}]})}async getBalances(){return this.process.read({tags:[{name:"Action",value:"Balances"}]})}async getGateway({address:r}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:r}]})}async getGateways(){return this.process.read({tags:[{name:"Action",value:"Gateways"}]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()}]})}async getPrescribedObservers(r){let h=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getPrescribedNames(r){let h=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getObservations(r){let h=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:`${Date.now()}`}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getDistributions(r){let h=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:r?.timestamp?.toString()??(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()},{name:"Epoch-Index",value:r?.epochIndex?.toString()}].filter(a=>a.value!==void 0);return this.process.read({tags:h})}async getTokenCost({intent:r,purchaseType:n,years:h,name:a,quantity:d}){let v=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:r},{name:"Name",value:a},{name:"Years",value:h?.toString()},{name:"Quantity",value:d?.toString()},{name:"Purchase-Type",value:n},{name:"Timestamp",value:(await this.arweave.blocks.getCurrent().catch(()=>({timestamp:Date.now()}))).timestamp.toString()}].filter(w=>w.value!==void 0);return this.process.read({tags:v})}},ex=class extends Jb{signer;constructor({signer:r,...n}){if(Object.keys(n).length===0)super({process:new Xo({processId:lc})}),this.signer=r;else if(cc(n))super({process:n.process}),this.signer=r;else if(dc(n))super({process:new Xo({processId:n.processId})}),this.signer=r;else throw new gh}async transfer({target:r,qty:n},h){let{tags:a=[]}=h||{};return this.process.send({tags:[...a,{name:"Action",value:"Transfer"},{name:"Recipient",value:r},{name:"Quantity",value:n.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:r,allowDelegatedStaking:n,delegateRewardShareRatio:h,fqdn:a,label:d,minDelegatedStake:c,note:v,port:w,properties:m,protocol:y,autoStake:g,observerAddress:S},R){let{tags:A=[]}=R||{},I=[...A,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:r.valueOf().toString()},{name:"Allow-Delegated-Staking",value:n.toString()},{name:"Delegate-Reward-Share-Ratio",value:h.toString()},{name:"FQDN",value:a},{name:"Label",value:d},{name:"Min-Delegated-Stake",value:c.valueOf().toString()},{name:"Note",value:v},{name:"Port",value:w.toString()},{name:"Properties",value:m},{name:"Protocol",value:y},{name:"Auto-Stake",value:g.toString()},{name:"Observer-Address",value:S}].filter(B=>B.value!==void 0);return this.process.send({signer:this.signer,tags:I})}async leaveNetwork(r){let{tags:n=[]}=r||{};return this.process.send({signer:this.signer,tags:[...n,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:r,delegateRewardShareRatio:n,fqdn:h,label:a,minDelegatedStake:d,note:c,port:v,properties:w,protocol:m,autoStake:y,observerAddress:g},S){let{tags:R=[]}=S||{},k=[...R,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:a},{name:"Note",value:c},{name:"FQDN",value:h},{name:"Port",value:v?.toString()},{name:"Properties",value:w},{name:"Protocol",value:m},{name:"Observer-Address",value:g},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Delegate-Reward-Share-Ratio",value:n?.toString()},{name:"Min-Delegated-Stake",value:d?.valueOf().toString()},{name:"Auto-Stake",value:y?.toString()}].filter(I=>I.value!==void 0);return this.process.send({signer:this.signer,tags:k})}async delegateStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:r.target},{name:"Quantity",value:r.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:r.target},{name:"Quantity",value:r.decreaseQty.valueOf().toString()}]})}async increaseOperatorStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:r.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:r.decreaseQty.valueOf().toString()}]})}async saveObservations(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:r.reportTxId},{name:"Failed-Gateways",value:r.failedGateways.join(",")}],data:{reportTxId:r.reportTxId,failedGateways:r.failedGateways}})}async buyRecord(r,n){let{tags:h=[]}=n||{},d=[...h,{name:"Action",value:"Buy-Record"},{name:"Name",value:r.name},{name:"Years",value:r.years?.toString()??"1"},{name:"Process-Id",value:r.processId},{name:"Purchase-Type",value:r.type||"lease"}].filter(c=>c.value!==void 0);return this.process.send({signer:this.signer,tags:d})}async extendLease(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Extend-Lease"},{name:"Name",value:r.name},{name:"Years",value:r.years.toString()}]})}async increaseUndernameLimit(r,n){let{tags:h=[]}=n||{};return this.process.send({signer:this.signer,tags:[...h,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:r.name},{name:"Quantity",value:r.increaseCount.toString()}]})}};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function tv(e,r){return function(){return e.apply(r,arguments)}}var{toString:dxe}=Object.prototype,{getPrototypeOf:ix}=Object,Qb=(e=>r=>{let n=dxe.call(r);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kf=e=>(e=e.toLowerCase(),r=>Qb(r)===e),e3=e=>r=>typeof r===e,{isArray:Zd}=Array,rv=e3("undefined");function pxe(e){return e!==null&&!rv(e)&&e.constructor!==null&&!rv(e.constructor)&&Cs(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var zee=kf("ArrayBuffer");function vxe(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&zee(e.buffer),r}var mxe=e3("string"),Cs=e3("function"),Hee=e3("number"),t3=e=>e!==null&&typeof e=="object",gxe=e=>e===!0||e===!1,Xb=e=>{if(Qb(e)!=="object")return!1;let r=ix(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},yxe=kf("Date"),bxe=kf("File"),wxe=kf("Blob"),_xe=kf("FileList"),Mxe=e=>t3(e)&&Cs(e.pipe),Sxe=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Cs(e.append)&&((r=Qb(e))==="formdata"||r==="object"&&Cs(e.toString)&&e.toString()==="[object FormData]"))},Exe=kf("URLSearchParams"),[Axe,Rxe,xxe,Txe]=["ReadableStream","Request","Response","Headers"].map(kf),kxe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function iv(e,r,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let h,a;if(typeof e!="object"&&(e=[e]),Zd(e))for(h=0,a=e.length;h<a;h++)r.call(null,e[h],h,e);else{let d=n?Object.getOwnPropertyNames(e):Object.keys(e),c=d.length,v;for(h=0;h<c;h++)v=d[h],r.call(null,e[v],v,e)}}function Kee(e,r){r=r.toLowerCase();let n=Object.keys(e),h=n.length,a;for(;h-- >0;)if(a=n[h],r===a.toLowerCase())return a;return null}var Zee=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Wee=e=>!rv(e)&&e!==Zee;function rx(){let{caseless:e}=Wee(this)&&this||{},r={},n=(h,a)=>{let d=e&&Kee(r,a)||a;Xb(r[d])&&Xb(h)?r[d]=rx(r[d],h):Xb(h)?r[d]=rx({},h):Zd(h)?r[d]=h.slice():r[d]=h};for(let h=0,a=arguments.length;h<a;h++)arguments[h]&&iv(arguments[h],n);return r}var Ixe=(e,r,n,{allOwnKeys:h}={})=>(iv(r,(a,d)=>{n&&Cs(a)?e[d]=tv(a,n):e[d]=a},{allOwnKeys:h}),e),Bxe=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Oxe=(e,r,n,h)=>{e.prototype=Object.create(r.prototype,h),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),n&&Object.assign(e.prototype,n)},Pxe=(e,r,n,h)=>{let a,d,c,v={};if(r=r||{},e==null)return r;do{for(a=Object.getOwnPropertyNames(e),d=a.length;d-- >0;)c=a[d],(!h||h(c,e,r))&&!v[c]&&(r[c]=e[c],v[c]=!0);e=n!==!1&&ix(e)}while(e&&(!n||n(e,r))&&e!==Object.prototype);return r},Nxe=(e,r,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=r.length;let h=e.indexOf(r,n);return h!==-1&&h===n},Cxe=e=>{if(!e)return null;if(Zd(e))return e;let r=e.length;if(!Hee(r))return null;let n=new Array(r);for(;r-- >0;)n[r]=e[r];return n},Lxe=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&ix(Uint8Array)),Dxe=(e,r)=>{let h=(e&&e[Symbol.iterator]).call(e),a;for(;(a=h.next())&&!a.done;){let d=a.value;r.call(e,d[0],d[1])}},$xe=(e,r)=>{let n,h=[];for(;(n=e.exec(r))!==null;)h.push(n);return h},Uxe=kf("HTMLFormElement"),qxe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,h,a){return h.toUpperCase()+a}),jee=(({hasOwnProperty:e})=>(r,n)=>e.call(r,n))(Object.prototype),jxe=kf("RegExp"),Gee=(e,r)=>{let n=Object.getOwnPropertyDescriptors(e),h={};iv(n,(a,d)=>{let c;(c=r(a,d,e))!==!1&&(h[d]=c||a)}),Object.defineProperties(e,h)},Fxe=e=>{Gee(e,(r,n)=>{if(Cs(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let h=e[n];if(Cs(h)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zxe=(e,r)=>{let n={},h=a=>{a.forEach(d=>{n[d]=!0})};return Zd(e)?h(e):h(String(e).split(r)),n},Hxe=()=>{},Kxe=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r,tx="abcdefghijklmnopqrstuvwxyz",Fee="0123456789",Vee={DIGIT:Fee,ALPHA:tx,ALPHA_DIGIT:tx+tx.toUpperCase()+Fee},Zxe=(e=16,r=Vee.ALPHA_DIGIT)=>{let n="",{length:h}=r;for(;e--;)n+=r[Math.random()*h|0];return n};function Wxe(e){return!!(e&&Cs(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var Gxe=e=>{let r=new Array(10),n=(h,a)=>{if(t3(h)){if(r.indexOf(h)>=0)return;if(!("toJSON"in h)){r[a]=h;let d=Zd(h)?[]:{};return iv(h,(c,v)=>{let w=n(c,a+1);!rv(w)&&(d[v]=w)}),r[a]=void 0,d}}return h};return n(e,0)},Vxe=kf("AsyncFunction"),Yxe=e=>e&&(t3(e)||Cs(e))&&Cs(e.then)&&Cs(e.catch),Kt={isArray:Zd,isArrayBuffer:zee,isBuffer:pxe,isFormData:Sxe,isArrayBufferView:vxe,isString:mxe,isNumber:Hee,isBoolean:gxe,isObject:t3,isPlainObject:Xb,isReadableStream:Axe,isRequest:Rxe,isResponse:xxe,isHeaders:Txe,isUndefined:rv,isDate:yxe,isFile:bxe,isBlob:wxe,isRegExp:jxe,isFunction:Cs,isStream:Mxe,isURLSearchParams:Exe,isTypedArray:Lxe,isFileList:_xe,forEach:iv,merge:rx,extend:Ixe,trim:kxe,stripBOM:Bxe,inherits:Oxe,toFlatObject:Pxe,kindOf:Qb,kindOfTest:kf,endsWith:Nxe,toArray:Cxe,forEachEntry:Dxe,matchAll:$xe,isHTMLForm:Uxe,hasOwnProperty:jee,hasOwnProp:jee,reduceDescriptors:Gee,freezeMethods:Fxe,toObjectSet:zxe,toCamelCase:qxe,noop:Hxe,toFiniteNumber:Kxe,findKey:Kee,global:Zee,isContextDefined:Wee,ALPHABET:Vee,generateString:Zxe,isSpecCompliantForm:Wxe,toJSONObject:Gxe,isAsyncFn:Vxe,isThenable:Yxe};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function Wd(e,r,n,h,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),n&&(this.config=n),h&&(this.request=h),a&&(this.response=a)}Kt.inherits(Wd,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Kt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Yee=Wd.prototype,Jee={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Jee[e]={value:e}});Object.defineProperties(Wd,Jee);Object.defineProperty(Yee,"isAxiosError",{value:!0});Wd.from=(e,r,n,h,a,d)=>{let c=Object.create(Yee);return Kt.toFlatObject(e,c,function(w){return w!==Error.prototype},v=>v!=="isAxiosError"),Wd.call(c,e.message,r,n,h,a),c.cause=e,c.name=e.name,d&&Object.assign(c,d),c};var Lr=Wd;Be();Pe();Oe();var r3=null;function nx(e){return Kt.isPlainObject(e)||Kt.isArray(e)}function Qee(e){return Kt.endsWith(e,"[]")?e.slice(0,-2):e}function Xee(e,r,n){return e?e.concat(r).map(function(a,d){return a=Qee(a),!n&&d?"["+a+"]":a}).join(n?".":""):r}function Jxe(e){return Kt.isArray(e)&&!e.some(nx)}var Xxe=Kt.toFlatObject(Kt,{},null,function(r){return/^is[A-Z]/.test(r)});function Qxe(e,r,n){if(!Kt.isObject(e))throw new TypeError("target must be an object");r=r||new(r3||FormData),n=Kt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,I){return!Kt.isUndefined(I[k])});let h=n.metaTokens,a=n.visitor||y,d=n.dots,c=n.indexes,w=(n.Blob||typeof Blob<"u"&&Blob)&&Kt.isSpecCompliantForm(r);if(!Kt.isFunction(a))throw new TypeError("visitor must be a function");function m(A){if(A===null)return"";if(Kt.isDate(A))return A.toISOString();if(!w&&Kt.isBlob(A))throw new Lr("Blob is not supported. Use a Buffer instead.");return Kt.isArrayBuffer(A)||Kt.isTypedArray(A)?w&&typeof Blob=="function"?new Blob([A]):St.from(A):A}function y(A,k,I){let B=A;if(A&&!I&&typeof A=="object"){if(Kt.endsWith(k,"{}"))k=h?k:k.slice(0,-2),A=JSON.stringify(A);else if(Kt.isArray(A)&&Jxe(A)||(Kt.isFileList(A)||Kt.endsWith(k,"[]"))&&(B=Kt.toArray(A)))return k=Qee(k),B.forEach(function(C,q){!(Kt.isUndefined(C)||C===null)&&r.append(c===!0?Xee([k],q,d):c===null?k:k+"[]",m(C))}),!1}return nx(A)?!0:(r.append(Xee(I,k,d),m(A)),!1)}let g=[],S=Object.assign(Xxe,{defaultVisitor:y,convertValue:m,isVisitable:nx});function R(A,k){if(!Kt.isUndefined(A)){if(g.indexOf(A)!==-1)throw Error("Circular reference detected in "+k.join("."));g.push(A),Kt.forEach(A,function(B,P){(!(Kt.isUndefined(B)||B===null)&&a.call(r,B,Kt.isString(P)?P.trim():P,k,S))===!0&&R(B,k?k.concat(P):[P])}),g.pop()}}if(!Kt.isObject(e))throw new TypeError("data must be an object");return R(e),r}var f0=Qxe;function ete(e){let r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(h){return r[h]})}function tte(e,r){this._pairs=[],e&&f0(e,this,r)}var rte=tte.prototype;rte.append=function(r,n){this._pairs.push([r,n])};rte.toString=function(r){let n=r?function(h){return r.call(this,h,ete)}:ete;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};var i3=tte;function eTe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nv(e,r,n){if(!r)return e;let h=n&&n.encode||eTe,a=n&&n.serialize,d;if(a?d=a(r,n):d=Kt.isURLSearchParams(r)?r.toString():new i3(r,n).toString(h),d){let c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+d}return e}Be();Pe();Oe();var ax=class{constructor(){this.handlers=[]}use(r,n,h){return this.handlers.push({fulfilled:r,rejected:n,synchronous:h?h.synchronous:!1,runWhen:h?h.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){Kt.forEach(this.handlers,function(h){h!==null&&r(h)})}},ox=ax;Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var n3={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();var ite=typeof URLSearchParams<"u"?URLSearchParams:i3;Be();Pe();Oe();var nte=typeof FormData<"u"?FormData:null;Be();Pe();Oe();var ate=typeof Blob<"u"?Blob:null;var ote={isBrowser:!0,classes:{URLSearchParams:ite,FormData:nte,Blob:ate},protocols:["http","https","file","blob","url","data"]};var fx={};go(fx,{hasBrowserEnv:()=>sx,hasStandardBrowserEnv:()=>tTe,hasStandardBrowserWebWorkerEnv:()=>rTe,origin:()=>iTe});Be();Pe();Oe();var sx=typeof window<"u"&&typeof document<"u",tTe=(e=>sx&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),rTe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iTe=sx&&window.location.href||"http://localhost";var pa={...fx,...ote};function ux(e,r){return f0(e,new pa.classes.URLSearchParams,Object.assign({visitor:function(n,h,a,d){return pa.isNode&&Kt.isBuffer(n)?(this.append(h,n.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},r))}Be();Pe();Oe();function nTe(e){return Kt.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function aTe(e){let r={},n=Object.keys(e),h,a=n.length,d;for(h=0;h<a;h++)d=n[h],r[d]=e[d];return r}function oTe(e){function r(n,h,a,d){let c=n[d++];if(c==="__proto__")return!0;let v=Number.isFinite(+c),w=d>=n.length;return c=!c&&Kt.isArray(a)?a.length:c,w?(Kt.hasOwnProp(a,c)?a[c]=[a[c],h]:a[c]=h,!v):((!a[c]||!Kt.isObject(a[c]))&&(a[c]=[]),r(n,h,a[c],d)&&Kt.isArray(a[c])&&(a[c]=aTe(a[c])),!v)}if(Kt.isFormData(e)&&Kt.isFunction(e.entries)){let n={};return Kt.forEachEntry(e,(h,a)=>{r(nTe(h),a,n,0)}),n}return null}var a3=oTe;function sTe(e,r,n){if(Kt.isString(e))try{return(r||JSON.parse)(e),Kt.trim(e)}catch(h){if(h.name!=="SyntaxError")throw h}return(n||JSON.stringify)(e)}var hx={transitional:n3,adapter:["xhr","http","fetch"],transformRequest:[function(r,n){let h=n.getContentType()||"",a=h.indexOf("application/json")>-1,d=Kt.isObject(r);if(d&&Kt.isHTMLForm(r)&&(r=new FormData(r)),Kt.isFormData(r))return a?JSON.stringify(a3(r)):r;if(Kt.isArrayBuffer(r)||Kt.isBuffer(r)||Kt.isStream(r)||Kt.isFile(r)||Kt.isBlob(r)||Kt.isReadableStream(r))return r;if(Kt.isArrayBufferView(r))return r.buffer;if(Kt.isURLSearchParams(r))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let v;if(d){if(h.indexOf("application/x-www-form-urlencoded")>-1)return ux(r,this.formSerializer).toString();if((v=Kt.isFileList(r))||h.indexOf("multipart/form-data")>-1){let w=this.env&&this.env.FormData;return f0(v?{"files[]":r}:r,w&&new w,this.formSerializer)}}return d||a?(n.setContentType("application/json",!1),sTe(r)):r}],transformResponse:[function(r){let n=this.transitional||hx.transitional,h=n&&n.forcedJSONParsing,a=this.responseType==="json";if(Kt.isResponse(r)||Kt.isReadableStream(r))return r;if(r&&Kt.isString(r)&&(h&&!this.responseType||a)){let c=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(r)}catch(v){if(c)throw v.name==="SyntaxError"?Lr.from(v,Lr.ERR_BAD_RESPONSE,this,null,this.response):v}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:pa.classes.FormData,Blob:pa.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Kt.forEach(["delete","get","head","post","put","patch"],e=>{hx.headers[e]={}});var Gd=hx;Be();Pe();Oe();Be();Pe();Oe();var fTe=Kt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ste=e=>{let r={},n,h,a;return e&&e.split(`
194
194
  `).forEach(function(c){a=c.indexOf(":"),n=c.substring(0,a).trim().toLowerCase(),h=c.substring(a+1).trim(),!(!n||r[n]&&fTe[n])&&(n==="set-cookie"?r[n]?r[n].push(h):r[n]=[h]:r[n]=r[n]?r[n]+", "+h:h)}),r};var fte=Symbol("internals");function av(e){return e&&String(e).trim().toLowerCase()}function o3(e){return e===!1||e==null?e:Kt.isArray(e)?e.map(o3):String(e)}function uTe(e){let r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,h;for(;h=n.exec(e);)r[h[1]]=h[2];return r}var hTe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lx(e,r,n,h,a){if(Kt.isFunction(h))return h.call(this,r,n);if(a&&(r=n),!!Kt.isString(r)){if(Kt.isString(h))return r.indexOf(h)!==-1;if(Kt.isRegExp(h))return h.test(r)}}function lTe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,n,h)=>n.toUpperCase()+h)}function cTe(e,r){let n=Kt.toCamelCase(" "+r);["get","set","has"].forEach(h=>{Object.defineProperty(e,h+n,{value:function(a,d,c){return this[h].call(this,r,a,d,c)},configurable:!0})})}var Vd=class{constructor(r){r&&this.set(r)}set(r,n,h){let a=this;function d(v,w,m){let y=av(w);if(!y)throw new Error("header name must be a non-empty string");let g=Kt.findKey(a,y);(!g||a[g]===void 0||m===!0||m===void 0&&a[g]!==!1)&&(a[g||w]=o3(v))}let c=(v,w)=>Kt.forEach(v,(m,y)=>d(m,y,w));if(Kt.isPlainObject(r)||r instanceof this.constructor)c(r,n);else if(Kt.isString(r)&&(r=r.trim())&&!hTe(r))c(ste(r),n);else if(Kt.isHeaders(r))for(let[v,w]of r.entries())d(w,v,h);else r!=null&&d(n,r,h);return this}get(r,n){if(r=av(r),r){let h=Kt.findKey(this,r);if(h){let a=this[h];if(!n)return a;if(n===!0)return uTe(a);if(Kt.isFunction(n))return n.call(this,a,h);if(Kt.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,n){if(r=av(r),r){let h=Kt.findKey(this,r);return!!(h&&this[h]!==void 0&&(!n||lx(this,this[h],h,n)))}return!1}delete(r,n){let h=this,a=!1;function d(c){if(c=av(c),c){let v=Kt.findKey(h,c);v&&(!n||lx(h,h[v],v,n))&&(delete h[v],a=!0)}}return Kt.isArray(r)?r.forEach(d):d(r),a}clear(r){let n=Object.keys(this),h=n.length,a=!1;for(;h--;){let d=n[h];(!r||lx(this,this[d],d,r,!0))&&(delete this[d],a=!0)}return a}normalize(r){let n=this,h={};return Kt.forEach(this,(a,d)=>{let c=Kt.findKey(h,d);if(c){n[c]=o3(a),delete n[d];return}let v=r?lTe(d):String(d).trim();v!==d&&delete n[d],n[v]=o3(a),h[v]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){let n=Object.create(null);return Kt.forEach(this,(h,a)=>{h!=null&&h!==!1&&(n[a]=r&&Kt.isArray(h)?h.join(", "):h)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,n])=>r+": "+n).join(`
195
195
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...n){let h=new this(r);return n.forEach(a=>h.set(a)),h}static accessor(r){let h=(this[fte]=this[fte]={accessors:{}}).accessors,a=this.prototype;function d(c){let v=av(c);h[v]||(cTe(a,c),h[v]=!0)}return Kt.isArray(r)?r.forEach(d):d(r),this}};Vd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Kt.reduceDescriptors(Vd.prototype,({value:e},r)=>{let n=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(h){this[n]=h}}});Kt.freezeMethods(Vd);var Qn=Vd;function ov(e,r){let n=this||Gd,h=r||n,a=Qn.from(h.headers),d=h.data;return Kt.forEach(e,function(v){d=v.call(n,d,a.normalize(),r?r.status:void 0)}),a.normalize(),d}Be();Pe();Oe();function sv(e){return!!(e&&e.__CANCEL__)}Be();Pe();Oe();function ute(e,r,n){Lr.call(this,e??"canceled",Lr.ERR_CANCELED,r,n),this.name="CanceledError"}Kt.inherits(ute,Lr,{__CANCEL__:!0});var pu=ute;Be();Pe();Oe();Be();Pe();Oe();Be();Pe();Oe();function fv(e,r,n){let h=n.config.validateStatus;!n.status||!h||h(n.status)?e(n):r(new Lr("Request failed with status code "+n.status,[Lr.ERR_BAD_REQUEST,Lr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}Be();Pe();Oe();function cx(e){let r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}Be();Pe();Oe();Be();Pe();Oe();function dTe(e,r){e=e||10;let n=new Array(e),h=new Array(e),a=0,d=0,c;return r=r!==void 0?r:1e3,function(w){let m=Date.now(),y=h[d];c||(c=m),n[a]=w,h[a]=m;let g=d,S=0;for(;g!==a;)S+=n[g++],g=g%e;if(a=(a+1)%e,a===d&&(d=(d+1)%e),m-c<r)return;let R=y&&m-y;return R?Math.round(S*1e3/R):void 0}}var hte=dTe;Be();Pe();Oe();function pTe(e,r){let n=0,h=1e3/r,a=null;return function(){let c=this===!0,v=Date.now();if(c||v-n>h)return a&&(clearTimeout(a),a=null),n=v,e.apply(null,arguments);a||(a=setTimeout(()=>(a=null,n=Date.now(),e.apply(null,arguments)),h-(v-n)))}}var lte=pTe;var Yd=(e,r,n=3)=>{let h=0,a=hte(50,250);return lte(d=>{let c=d.loaded,v=d.lengthComputable?d.total:void 0,w=c-h,m=a(w),y=c<=v;h=c;let g={loaded:c,total:v,progress:v?c/v:void 0,bytes:w,rate:m||void 0,estimated:m&&v&&y?(v-c)/m:void 0,event:d,lengthComputable:v!=null};g[r?"download":"upload"]=!0,e(g)},n)};Be();Pe();Oe();Be();Pe();Oe();var cte=pa.hasStandardBrowserEnv?function(){let r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),h;function a(d){let c=d;return r&&(n.setAttribute("href",c),c=n.href),n.setAttribute("href",c),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return h=a(window.location.href),function(c){let v=Kt.isString(c)?a(c):c;return v.protocol===h.protocol&&v.host===h.host}}():function(){return function(){return!0}}();Be();Pe();Oe();var dte=pa.hasStandardBrowserEnv?{write(e,r,n,h,a,d){let c=[e+"="+encodeURIComponent(r)];Kt.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),Kt.isString(h)&&c.push("path="+h),Kt.isString(a)&&c.push("domain="+a),d===!0&&c.push("secure"),document.cookie=c.join("; ")},read(e){let r=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};Be();Pe();Oe();Be();Pe();Oe();function dx(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}Be();Pe();Oe();function px(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function uv(e,r){return e&&!dx(r)?px(e,r):r}Be();Pe();Oe();var pte=e=>e instanceof Qn?{...e}:e;function If(e,r){r=r||{};let n={};function h(m,y,g){return Kt.isPlainObject(m)&&Kt.isPlainObject(y)?Kt.merge.call({caseless:g},m,y):Kt.isPlainObject(y)?Kt.merge({},y):Kt.isArray(y)?y.slice():y}function a(m,y,g){if(Kt.isUndefined(y)){if(!Kt.isUndefined(m))return h(void 0,m,g)}else return h(m,y,g)}function d(m,y){if(!Kt.isUndefined(y))return h(void 0,y)}function c(m,y){if(Kt.isUndefined(y)){if(!Kt.isUndefined(m))return h(void 0,m)}else return h(void 0,y)}function v(m,y,g){if(g in r)return h(m,y);if(g in e)return h(void 0,m)}let w={url:d,method:d,data:d,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:v,headers:(m,y)=>a(pte(m),pte(y),!0)};return Kt.forEach(Object.keys(Object.assign({},e,r)),function(y){let g=w[y]||a,S=g(e[y],r[y],y);Kt.isUndefined(S)&&g!==v||(n[y]=S)}),n}var s3=e=>{let r=If({},e),{data:n,withXSRFToken:h,xsrfHeaderName:a,xsrfCookieName:d,headers:c,auth:v}=r;r.headers=c=Qn.from(c),r.url=nv(uv(r.baseURL,r.url),e.params,e.paramsSerializer),v&&c.set("Authorization","Basic "+btoa((v.username||"")+":"+(v.password?unescape(encodeURIComponent(v.password)):"")));let w;if(Kt.isFormData(n)){if(pa.hasStandardBrowserEnv||pa.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((w=c.getContentType())!==!1){let[m,...y]=w?w.split(";").map(g=>g.trim()).filter(Boolean):[];c.setContentType([m||"multipart/form-data",...y].join("; "))}}if(pa.hasStandardBrowserEnv&&(h&&Kt.isFunction(h)&&(h=h(r)),h||h!==!1&&cte(r.url))){let m=a&&d&&dte.read(d);m&&c.set(a,m)}return r};var vTe=typeof XMLHttpRequest<"u",vte=vTe&&function(e){return new Promise(function(n,h){let a=s3(e),d=a.data,c=Qn.from(a.headers).normalize(),{responseType:v}=a,w;function m(){a.cancelToken&&a.cancelToken.unsubscribe(w),a.signal&&a.signal.removeEventListener("abort",w)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function g(){if(!y)return;let R=Qn.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),k={data:!v||v==="text"||v==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:R,config:e,request:y};fv(function(B){n(B),m()},function(B){h(B),m()},k),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(h(new Lr("Request aborted",Lr.ECONNABORTED,a,y)),y=null)},y.onerror=function(){h(new Lr("Network Error",Lr.ERR_NETWORK,a,y)),y=null},y.ontimeout=function(){let A=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",k=a.transitional||n3;a.timeoutErrorMessage&&(A=a.timeoutErrorMessage),h(new Lr(A,k.clarifyTimeoutError?Lr.ETIMEDOUT:Lr.ECONNABORTED,a,y)),y=null},d===void 0&&c.setContentType(null),"setRequestHeader"in y&&Kt.forEach(c.toJSON(),function(A,k){y.setRequestHeader(k,A)}),Kt.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),v&&v!=="json"&&(y.responseType=a.responseType),typeof a.onDownloadProgress=="function"&&y.addEventListener("progress",Yd(a.onDownloadProgress,!0)),typeof a.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",Yd(a.onUploadProgress)),(a.cancelToken||a.signal)&&(w=R=>{y&&(h(!R||R.type?new pu(null,e,y):R),y.abort(),y=null)},a.cancelToken&&a.cancelToken.subscribe(w),a.signal&&(a.signal.aborted?w():a.signal.addEventListener("abort",w)));let S=cx(a.url);if(S&&pa.protocols.indexOf(S)===-1){h(new Lr("Unsupported protocol "+S+":",Lr.ERR_BAD_REQUEST,e));return}y.send(d||null)})};Be();Pe();Oe();Be();Pe();Oe();var mTe=(e,r)=>{let n=new AbortController,h,a=function(w){if(!h){h=!0,c();let m=w instanceof Error?w:this.reason;n.abort(m instanceof Lr?m:new pu(m instanceof Error?m.message:m))}},d=r&&setTimeout(()=>{a(new Lr(`timeout ${r} of ms exceeded`,Lr.ETIMEDOUT))},r),c=()=>{e&&(d&&clearTimeout(d),d=null,e.forEach(w=>{w&&(w.removeEventListener?w.removeEventListener("abort",a):w.unsubscribe(a))}),e=null)};e.forEach(w=>w&&w.addEventListener&&w.addEventListener("abort",a));let{signal:v}=n;return v.unsubscribe=c,[v,()=>{d&&clearTimeout(d),d=null}]},mte=mTe;Be();Pe();Oe();var gTe=function*(e,r){let n=e.byteLength;if(!r||n<r){yield e;return}let h=0,a;for(;h<n;)a=h+r,yield e.slice(h,a),h=a},yTe=async function*(e,r,n){for await(let h of e)yield*gTe(ArrayBuffer.isView(h)?h:await n(String(h)),r)},vx=(e,r,n,h,a)=>{let d=yTe(e,r,a),c=0;return new ReadableStream({type:"bytes",async pull(v){let{done:w,value:m}=await d.next();if(w){v.close(),h();return}let y=m.byteLength;n&&n(c+=y),v.enqueue(new Uint8Array(m))},cancel(v){return h(v),d.return()}},{highWaterMark:2})};var gte=(e,r)=>{let n=e!=null;return h=>setTimeout(()=>r({lengthComputable:n,total:e,loaded:h}))},u3=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",bte=u3&&typeof ReadableStream=="function",mx=u3&&(typeof TextEncoder=="function"?(e=>r=>e.encode(r))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),bTe=bte&&(()=>{let e=!1,r=new Request(pa.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!r})(),yte=64*1024,gx=bte&&!!(()=>{try{return Kt.isReadableStream(new Response("").body)}catch{}})(),f3={stream:gx&&(e=>e.body)};u3&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(r=>{!f3[r]&&(f3[r]=Kt.isFunction(e[r])?n=>n[r]():(n,h)=>{throw new Lr(`Response type '${r}' is not supported`,Lr.ERR_NOT_SUPPORT,h)})})})(new Response);var wTe=async e=>{if(e==null)return 0;if(Kt.isBlob(e))return e.size;if(Kt.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(Kt.isArrayBufferView(e))return e.byteLength;if(Kt.isURLSearchParams(e)&&(e=e+""),Kt.isString(e))return(await mx(e)).byteLength},_Te=async(e,r)=>{let n=Kt.toFiniteNumber(e.getContentLength());return n??wTe(r)},wte=u3&&(async e=>{let{url:r,method:n,data:h,signal:a,cancelToken:d,timeout:c,onDownloadProgress:v,onUploadProgress:w,responseType:m,headers:y,withCredentials:g="same-origin",fetchOptions:S}=s3(e);m=m?(m+"").toLowerCase():"text";let[R,A]=a||d||c?mte([a,d],c):[],k,I,B=()=>{!k&&setTimeout(()=>{R&&R.unsubscribe()}),k=!0},P;try{if(w&&bTe&&n!=="get"&&n!=="head"&&(P=await _Te(y,h))!==0){let V=new Request(r,{method:"POST",body:h,duplex:"half"}),j;Kt.isFormData(h)&&(j=V.headers.get("content-type"))&&y.setContentType(j),V.body&&(h=vx(V.body,yte,gte(P,Yd(w)),null,mx))}Kt.isString(g)||(g=g?"cors":"omit"),I=new Request(r,{...S,signal:R,method:n.toUpperCase(),headers:y.normalize().toJSON(),body:h,duplex:"half",withCredentials:g});let C=await fetch(I),q=gx&&(m==="stream"||m==="response");if(gx&&(v||q)){let V={};["status","statusText","headers"].forEach(z=>{V[z]=C[z]});let j=Kt.toFiniteNumber(C.headers.get("content-length"));C=new Response(vx(C.body,yte,v&&gte(j,Yd(v,!0)),q&&B,mx),V)}m=m||"text";let K=await f3[Kt.findKey(f3,m)||"text"](C,e);return!q&&B(),A&&A(),await new Promise((V,j)=>{fv(V,j,{data:K,headers:Qn.from(C.headers),status:C.status,statusText:C.statusText,config:e,request:I})})}catch(C){throw B(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new Lr("Network Error",Lr.ERR_NETWORK,e,I),{cause:C.cause||C}):Lr.from(C,C&&C.code,e,I)}});var yx={http:r3,xhr:vte,fetch:wte};Kt.forEach(yx,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});var _te=e=>`- ${e}`,MTe=e=>Kt.isFunction(e)||e===null||e===!1,h3={getAdapter:e=>{e=Kt.isArray(e)?e:[e];let{length:r}=e,n,h,a={};for(let d=0;d<r;d++){n=e[d];let c;if(h=n,!MTe(n)&&(h=yx[(c=String(n)).toLowerCase()],h===void 0))throw new Lr(`Unknown adapter '${c}'`);if(h)break;a[c||"#"+d]=h}if(!h){let d=Object.entries(a).map(([v,w])=>`adapter ${v} `+(w===!1?"is not supported by the environment":"is not available in the build")),c=r?d.length>1?`since :
196
196
  `+d.map(_te).join(`