(()=>{function he(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Pe(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}function M(t,...e){if(!he(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function At(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Wt(t,e){M(t);let n=e.outputLen;if(t.length{function n(r,...o){if(M(r),!We)throw new Error("Non little-endian hardware is not yet supported");if(t.nonceLength!==void 0){let h=o[0];if(!h)throw new Error("nonce / iv required");t.varSizeNonce?M(h):M(h,t.nonceLength)}let i=t.tagLength;i&&o[1]!==void 0&&M(o[1]);let s=e(r,...o),c=(h,a)=>{if(a!==void 0){if(h!==2)throw new Error("cipher output not supported");M(a)}},f=!1;return{encrypt(h,a){if(f)throw new Error("cannot encrypt() twice with same key + nonce");return f=!0,M(h),c(s.encrypt.length,a),s.encrypt(h,a)},decrypt(h,a){if(M(h),i&&h.length>o&i),c=Number(n&i),f=r?4:0,u=r?0:4;t.setUint32(e+f,s,r),t.setUint32(e+u,c,r)}function ve(t,e,n){Pe(n);let r=new Uint8Array(16),o=pt(r);return Tt(o,0,BigInt(e),n),Tt(o,8,BigInt(t),n),r}function Ut(t){return t.byteOffset%4===0}function at(t){return Uint8Array.from(t)}var Q=16,Zt=new Uint8Array(16),Y=Z(Zt),Ze=225,je=(t,e,n,r)=>{let o=r&1;return{s3:n<<31|r>>>1,s2:e<<31|n>>>1,s1:t<<31|e>>>1,s0:t>>>1^Ze<<24&-(o&1)}},N=t=>(t>>>0&255)<<24|(t>>>8&255)<<16|(t>>>16&255)<<8|t>>>24&255|0;function Re(t){t.reverse();let e=t[15]&1,n=0;for(let r=0;r>>1|n,n=(o&1)<<7}return t[0]^=-e&225,t}var qe=t=>t>64*1024?8:t>1024?4:2,Ct=class{constructor(e,n){this.blockLen=Q,this.outputLen=Q,this.s0=0,this.s1=0,this.s2=0,this.s3=0,this.finished=!1,e=gt(e),M(e,16);let r=pt(e),o=r.getUint32(0,!1),i=r.getUint32(4,!1),s=r.getUint32(8,!1),c=r.getUint32(12,!1),f=[];for(let v=0;v<128;v++)f.push({s0:N(o),s1:N(i),s2:N(s),s3:N(c)}),{s0:o,s1:i,s2:s,s3:c}=je(o,i,s,c);let u=qe(n||1024);if(![1,2,4,8].includes(u))throw new Error("ghash: invalid window size, expected 2, 4 or 8");this.W=u;let a=128/u,l=this.windowSize=2**u,p=[];for(let v=0;v>>u-A-1&1))continue;let{s0:S,s1:z,s2:w,s3:x}=f[u*v+A];d^=S,m^=z,y^=w,U^=x}p.push({s0:d,s1:m,s2:y,s3:U})}this.t=p}_updateBlock(e,n,r,o){e^=this.s0,n^=this.s1,r^=this.s2,o^=this.s3;let{W:i,t:s,windowSize:c}=this,f=0,u=0,h=0,a=0,l=(1<>>8*g&255;for(let m=8/i-1;m>=0;m--){let y=d>>>i*m&l,{s0:U,s1:A,s2:B,s3:S}=s[p*c+y];f^=U,u^=A,h^=B,a^=S,p+=1}}this.s0=f,this.s1=u,this.s2=h,this.s3=a}update(e){At(this),e=gt(e),M(e);let n=Z(e),r=Math.floor(e.length/Q),o=e.length%Q;for(let i=0;it(o,r.length).update(gt(r)).digest(),n=t(new Uint8Array(16),0);return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=(r,o)=>t(r,o),e}var jt=xe((t,e)=>new Ct(t,e)),_e=xe((t,e)=>new Nt(t,e));var qt=16,$e=4,Ft=new Uint8Array(qt),Ye=283;function _t(t){return t<<1^Ye&-(t>>7)}function ye(t,e){let n=0;for(;e>0;e>>=1)n^=t&-(e&1),t=_t(t);return n}var Je=(()=>{let t=new Uint8Array(256);for(let n=0,r=1;n<256;n++,r^=_t(r))t[n]=r;let e=new Uint8Array(256);e[0]=99;for(let n=0;n<255;n++){let r=t[255-n];r|=r<<8,e[t[n]]=(r^r>>4^r>>5^r>>6^r>>7^99)&255}return j(t),e})();var Xe=t=>t<<24|t>>>8,Rt=t=>t<<8|t>>>24;function Qe(t,e){if(t.length!==256)throw new Error("Wrong sbox length");let n=new Uint32Array(256).map((u,h)=>e(t[h])),r=n.map(Rt),o=r.map(Rt),i=o.map(Rt),s=new Uint32Array(256*256),c=new Uint32Array(256*256),f=new Uint16Array(256*256);for(let u=0;u<256;u++)for(let h=0;h<256;h++){let a=u*256+h;s[a]=n[u]^r[h],c[a]=o[u]^i[h],f[a]=t[u]<<8|t[h]}return{sbox:t,sbox2:f,T0:n,T1:r,T2:o,T3:i,T01:s,T23:c}}var we=Qe(Je,t=>ye(t,3)<<24|t<<16|t<<8|ye(t,2));var tn=(()=>{let t=new Uint8Array(16);for(let e=0,n=1;e<16;e++,n=_t(n))t[e]=n;return t})();function en(t){M(t);let e=t.length;if(![16,24,32].includes(e))throw new Error("aes: invalid key size, should be 16, 24 or 32, got "+e);let{sbox2:n}=we,r=[];Ut(t)||r.push(t=at(t));let o=Z(t),i=o.length,s=f=>Bt(n,f,f,f,f),c=new Uint32Array(e+28);c.set(o);for(let f=i;f6&&f%i===4&&(u=s(u)),c[f]=c[f-i]^u}return j(...r),c}function Dt(t,e,n,r,o,i){return t[n<<8&65280|r>>>8&255]^e[o>>>8&65280|i>>>24&255]}function Bt(t,e,n,r,o){return t[e&255|n&65280]|t[r>>>16&255|o>>>16&65280]<<16}function de(t,e,n,r,o){let{sbox2:i,T01:s,T23:c}=we,f=0;e^=t[f++],n^=t[f++],r^=t[f++],o^=t[f++];let u=t.length/4-2;for(let v=0;v>>0,c.setUint32(h,l,e),{s0:p,s1:v,s2:g,s3:d}=de(t,s[0],s[1],s[2],s[3]);let m=qt*Math.floor(f.length/$e);if(m0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function Ot(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");vt(t.outputLen),vt(t.blockLen)}function yt(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function be(t,e){ct(t);let n=e.outputLen;if(t.length>>e}var on=async()=>{};async function me(t,e,n){let r=Date.now();for(let o=0;o=0&&it().update(Et(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function Jt(t=32){if(ft&&typeof ft.getRandomValues=="function")return ft.getRandomValues(new Uint8Array(t));if(ft&&typeof ft.randomBytes=="function")return Uint8Array.from(ft.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}var kt=class extends xt{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Ot(e);let r=Et(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,i=new Uint8Array(o);i.set(r.length>o?e.create().update(r).digest():r);for(let s=0;snew kt(t,e).update(n).digest();Xt.create=(t,e)=>new kt(t,e);function sn(t,e,n,r){Ot(t);let o=Ue({dkLen:32,asyncTick:10},r),{c:i,dkLen:s,asyncTick:c}=o;if(vt(i),vt(s),vt(c),i<1)throw new Error("iterations (c) should be >= 1");let f=Yt(e),u=Yt(n),h=new Uint8Array(s),a=Xt.create(t,f),l=a._cloneInto().update(u);return{c:i,dkLen:s,asyncTick:c,DK:h,PRF:a,PRFSalt:l}}function an(t,e,n,r,o){return t.destroy(),e.destroy(),r&&r.destroy(),tt(o),n}async function Ee(t,e,n,r){let{c:o,dkLen:i,asyncTick:s,DK:c,PRF:f,PRFSalt:u}=sn(t,e,n,r),h,a=new Uint8Array(4),l=dt(a),p=new Uint8Array(f.outputLen);for(let v=1,g=0;g{f._cloneInto(h).update(p).digestInto(p);for(let m=0;m>o&i),c=Number(n&i),f=r?4:0,u=r?0:4;t.setUint32(e+f,s,r),t.setUint32(e+u,c,r)}function Le(t,e,n){return t&e^~t&n}function Se(t,e,n){return t&e^t&n^e&n}var Kt=class extends xt{constructor(e,n,r,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(e),this.view=dt(this.buffer)}update(e){yt(this),e=Et(e),ct(e);let{view:n,buffer:r,blockLen:o}=this,i=e.length;for(let s=0;so-s&&(this.process(r,0),s=0);for(let a=s;ah.length)throw new Error("_sha2: outputLen bigger than state");for(let a=0;a>>3,g=R(p,17)^R(p,19)^p>>>10;it[a]=g+it[a-7]+v+it[a-16]|0}let{A:r,B:o,C:i,D:s,E:c,F:f,G:u,H:h}=this;for(let a=0;a<64;a++){let l=R(c,6)^R(c,11)^R(c,25),p=h+l+Le(c,f,u)+cn[a]+it[a]|0,g=(R(r,2)^R(r,13)^R(r,22))+Se(r,o,i)|0;h=u,u=f,f=c,c=s+p|0,s=i,i=o,o=r,r=p+g|0}r=r+this.A|0,o=o+this.B|0,i=i+this.C|0,s=s+this.D|0,c=c+this.E|0,f=f+this.F|0,u=u+this.G|0,h=h+this.H|0,this.set(r,o,i,s,c,f,u,h)}roundClean(){tt(it)}destroy(){this.set(0,0,0,0,0,0,0,0),tt(this.buffer)}};var ze=Be(()=>new Qt);var F=Uint8Array,P=Uint16Array,fe=Int32Array,Gt=new F([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Vt=new F([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),re=new F([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ce=function(t,e){for(var n=new P(31),r=0;r<31;++r)n[r]=e+=1<>1|(b&21845)<<1,nt=(nt&52428)>>2|(nt&13107)<<2,nt=(nt&61680)>>4|(nt&3855)<<4,ie[b]=((nt&65280)>>8|(nt&255)<<8)>>1;var nt,b,J=function(t,e,n){for(var r=t.length,o=0,i=new P(e);o>f]=u}else for(c=new P(r),o=0;o>15-t[o]);return c},st=new F(288);for(b=0;b<144;++b)st[b]=8;var b;for(b=144;b<256;++b)st[b]=9;var b;for(b=256;b<280;++b)st[b]=7;var b;for(b=280;b<288;++b)st[b]=8;var b,zt=new F(32);for(b=0;b<32;++b)zt[b]=5;var b,un=J(st,9,0),ln=J(st,9,1),pn=J(zt,5,0),gn=J(zt,5,1),te=function(t){for(var e=t[0],n=1;ne&&(e=t[n]);return e},q=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(e&7)&n},ee=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(e&7)},ce=function(t){return(t+7)/8|0},Oe=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new F(t.subarray(e,n))};var vn=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_=function(t,e,n){var r=new Error(e||vn[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,_),!n)throw r;return r},xn=function(t,e,n,r){var o=t.length,i=r?r.length:0;if(!o||e.f&&!e.l)return n||new F(0);var s=!n,c=s||e.i!=2,f=e.i;s&&(n=new F(o*3));var u=function(bt){var mt=n.length;if(bt>mt){var lt=new F(Math.max(mt*2,bt));lt.set(n),n=lt}},h=e.f||0,a=e.p||0,l=e.b||0,p=e.l,v=e.d,g=e.m,d=e.n,m=o*8;do{if(!p){h=q(t,a,1);var y=q(t,a+1,3);if(a+=3,y)if(y==1)p=ln,v=gn,g=9,d=5;else if(y==2){var S=q(t,a,31)+257,z=q(t,a+10,15)+4,w=S+q(t,a+5,31)+1;a+=14;for(var x=new F(w),I=new F(19),H=0;H>4;if(U<16)x[H++]=U;else{var T=0,E=0;for(U==16?(E=3+q(t,a,3),a+=2,T=x[H-1]):U==17?(E=3+q(t,a,7),a+=3):U==18&&(E=11+q(t,a,127),a+=7);E--;)x[H++]=T}}var k=x.subarray(0,S),C=x.subarray(S);g=te(k),d=te(C),p=J(k,g,1),v=J(C,d,1)}else _(1);else{var U=ce(a)+4,A=t[U-4]|t[U-3]<<8,B=U+A;if(B>o){f&&_(0);break}c&&u(l+A),n.set(t.subarray(U,B),l),e.b=l+=A,e.p=a=B*8,e.f=h;continue}if(a>m){f&&_(0);break}}c&&u(l+131072);for(var wt=(1<>4;if(a+=T&15,a>m){f&&_(0);break}if(T||_(2),G<256)n[l++]=G;else if(G==256){X=a,p=null;break}else{var V=G-254;if(G>264){var H=G-257,L=Gt[H];V=q(t,a,(1<>4;$||_(3),a+=$&15;var C=hn[ht];if(ht>3){var L=Vt[ht];C+=ee(t,a)&(1<m){f&&_(0);break}c&&u(l+131072);var ut=l+V;if(l>8},Lt=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},ne=function(t,e){for(var n=[],r=0;rl&&(l=i[r].s);var p=new P(l+1),v=se(n[h-1],p,0);if(v>e){var r=0,g=0,d=v-e,m=1<e)g+=m-(1<>=d;g>0;){var U=i[r].s;p[U]=0&&g;--r){var A=i[r].s;p[A]==e&&(--p[A],++g)}v=e}return{t:new F(p),l:v}},se=function(t,e,n){return t.s==-1?Math.max(se(t.l,e,n+1),se(t.r,e,n+1)):e[t.s]=n},Ie=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new P(++e),r=0,o=t[0],i=1,s=function(f){n[r++]=f},c=1;c<=e;++c)if(t[c]==o&&c!=e)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=t[c]}return{c:n.subarray(0,r),n:e}},St=function(t,e){for(var n=0,r=0;r>8,t[o+2]=t[o]^255,t[o+3]=t[o+1]^255;for(var i=0;i4&&!I[re[D-1]];--D);var ot=u+5<<3,K=St(o,st)+St(i,zt)+s,O=St(o,l)+St(i,g)+s+14+3*D+St(z,I)+2*z[16]+3*z[17]+7*z[18];if(f>=0&&ot<=K&&ot<=O)return ke(e,h,t.subarray(f,f+u));var T,E,k,C;if(rt(e,h,1+(O15&&(rt(e,h,G[w]>>5&127),h+=G[w]>>12)}}else T=un,E=st,k=pn,C=zt;for(var w=0;w255){var V=L>>18&31;Lt(e,h,T[V+257]),h+=E[V+257],V>7&&(rt(e,h,L>>23&31),h+=Gt[V]);var $=L&31;Lt(e,h,k[$]),h+=C[$],$>3&&(Lt(e,h,L>>5&8191),h+=Vt[$])}else Lt(e,h,T[L]),h+=E[L]}return Lt(e,h,T[256]),h+E[256]},yn=new fe([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ke=new F(0),dn=function(t,e,n,r,o,i){var s=i.z||t.length,c=new F(r+s+5*(1+Math.ceil(s/7e3))+o),f=c.subarray(r,c.length-o),u=i.l,h=(i.r||0)&7;if(e){h&&(f[0]=i.r>>3);for(var a=yn[e-1],l=a>>13,p=a&8191,v=(1<7e3||I>24576)&&(T>423||!u)){h=Te(t,f,0,A,B,S,w,I,D,x-D,h),I=z=w=0,D=x;for(var E=0;E<286;++E)B[E]=0;for(var E=0;E<30;++E)S[E]=0}var k=2,C=0,wt=p,W=K-O&32767;if(T>2&&ot==U(x-W))for(var X=Math.min(l,T)-1,G=Math.min(32767,x),V=Math.min(258,T);W<=G&&--wt&&K!=O;){if(t[x+k]==t[x+k-W]){for(var L=0;Lk){if(k=L,C=W,L>X)break;for(var $=Math.min(W,L-2),ht=0,E=0;E<$;++E){var ut=x-W+E&32767,Ht=g[ut],It=ut-Ht&32767;It>ht&&(ht=It,O=ut)}}}K=O,O=g[K],W+=K-O&32767}if(C){A[I++]=268435456|oe[k]<<18|He[C];var bt=oe[k]&31,mt=He[C]&31;w+=Gt[bt]+Vt[mt],++B[257+bt],++S[mt],H=x+k,++z}else A[I++]=t[x],++B[t[x]]}}for(x=Math.max(x,H);x=s&&(f[h/8|0]=u,lt=s),h=ke(f,h+1,t.subarray(x,lt))}i.i=s}return Oe(c,0,r+ce(h)+o)},wn=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),bn=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r>>8;t=n},d:function(){return~t}}};var mn=function(t,e,n,r,o){if(!o&&(o={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),s=new F(i.length+t.length);s.set(i),s.set(t,i.length),t=s,o.w=i.length}return dn(t,e.level==null?6:e.level,e.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,o)};var ae=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},An=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&ae(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},Un=function(t){(t[0]!=31||t[1]!=139||t[2]!=8)&&_(6,"invalid gzip data");var e=t[3],n=10;e&4&&(n+=(t[10]|t[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(e&2)},Bn=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},En=function(t){return 10+(t.filename?t.filename.length+1:0)};function Ge(t,e){e||(e={});var n=bn(),r=t.length;n.p(t);var o=mn(t,e,En(e),8),i=o.length;return An(o,e),ae(o,i-8,n.d()),ae(o,i-4,r),o}function Ve(t,e){var n=Un(t);return n+8>t.length&&_(6,"invalid gzip data"),xn(t.subarray(n,-8),{i:2},e&&e.out||new F(Bn(t)),e&&e.dictionary)}var Ln=typeof TextDecoder<"u"&&new TextDecoder,Sn=0;try{Ln.decode(Ke,{stream:!0}),Sn=1}catch{}var zn=new TextEncoder;window.devwsCrypto={deriveKey:(t,e,n)=>Ee(ze,zn.encode(String(t).normalize("NFKC")),e,{c:n,dkLen:32}),encrypt:(t,e)=>{let n=Jt(12);return{iv:n,ct:$t(t,n).encrypt(e)}},decrypt:(t,e,n)=>$t(t,e).decrypt(n),randomBytes:Jt,gzip:t=>Ge(t),gunzip:t=>Ve(t)};})(); /*! Bundled license information: @noble/ciphers/esm/utils.js: (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *) @noble/hashes/esm/utils.js: (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *) */