@zip.js/zip.js 2.6.18 → 2.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +0 -0
- package/README.md +0 -0
- package/cli-deno/mc-zip.js +0 -0
- package/dist/README.md +0 -0
- package/dist/z-worker-fflate.js +1 -1
- package/dist/z-worker-pako.js +1 -1
- package/dist/z-worker.js +1 -1
- package/dist/zip-fs-full.js +264 -153
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +264 -153
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +259 -153
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker-inflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +259 -153
- package/dist/zip.min.js +1 -1
- package/index-fflate.js +0 -0
- package/index.d.ts +11 -18
- package/index.js +0 -0
- package/lib/core/codec-interface.js +14 -1
- package/lib/core/codec-pool-worker.js +3 -0
- package/lib/core/codec-pool.js +0 -0
- package/lib/core/configuration.js +0 -0
- package/lib/core/constants.js +0 -0
- package/lib/core/io.js +11 -19
- package/lib/core/streams/aes-crypto-stream.js +0 -0
- package/lib/core/streams/codec-stream.js +0 -0
- package/lib/core/streams/codecs/crc32.js +0 -0
- package/lib/core/streams/codecs/deflate.js +0 -0
- package/lib/core/streams/codecs/inflate.js +0 -0
- package/lib/core/streams/codecs/sjcl.js +0 -0
- package/lib/core/streams/common-crypto.js +0 -0
- package/lib/core/streams/crc32-stream.js +0 -0
- package/lib/core/streams/zip-crypto-stream.js +0 -0
- package/lib/core/streams/zip-entry-stream.js +1 -9
- package/lib/core/util/cp437-decode.js +0 -0
- package/lib/core/util/decode-text.js +0 -0
- package/lib/core/util/default-mime-type.js +0 -0
- package/lib/core/util/encode-text.js +0 -0
- package/lib/core/util/mime-type.js +0 -0
- package/lib/core/util/stream-codec-shim.js +0 -0
- package/lib/core/z-worker-core.js +18 -7
- package/lib/core/zip-entry.js +0 -0
- package/lib/core/zip-fs-core.js +5 -0
- package/lib/core/zip-reader.js +1 -0
- package/lib/core/zip-writer.js +231 -123
- package/lib/z-worker-bootstrap-fflate.js +0 -0
- package/lib/z-worker-bootstrap-pako.js +0 -0
- package/lib/z-worker-fflate.js +0 -0
- package/lib/z-worker-inline-template-base64.js +0 -0
- package/lib/z-worker-inline-template.js +0 -0
- package/lib/z-worker-inline.js +1 -1
- package/lib/z-worker.js +0 -0
- package/lib/zip-fflate-shim.js +0 -0
- package/lib/zip-fs.js +0 -0
- package/lib/zip-full-fflate.js +0 -0
- package/lib/zip-full.js +0 -0
- package/lib/zip-no-worker-deflate.js +0 -0
- package/lib/zip-no-worker-fflate-deflate.js +0 -0
- package/lib/zip-no-worker-fflate-inflate.js +0 -0
- package/lib/zip-no-worker-fflate.js +0 -0
- package/lib/zip-no-worker-inflate.js +0 -0
- package/lib/zip-no-worker.js +0 -0
- package/lib/zip.js +0 -0
- package/package.json +1 -1
- package/rollup-fflate.config.dev.js +0 -0
- package/rollup-fflate.config.js +0 -0
- package/rollup.config.dev.js +0 -0
- package/rollup.config.js +0 -0
- package/tests/all/loader.html +0 -0
- package/tests/all/test-abort-signal-read.js +0 -0
- package/tests/all/test-abort-signal-write.js +0 -0
- package/tests/all/test-array.js +0 -0
- package/tests/all/test-base64.js +0 -0
- package/tests/all/test-blob.js +0 -0
- package/tests/all/test-codecs-interoperability.js +0 -0
- package/tests/all/test-crc.js +0 -0
- package/tests/all/test-crypto.js +0 -0
- package/tests/all/test-custom-io.js +0 -1
- package/tests/all/test-data-descriptor-signature.js +0 -0
- package/tests/all/test-data-descriptor.js +0 -0
- package/tests/all/test-duplicated-filename.js +0 -0
- package/tests/all/test-empty.js +0 -0
- package/tests/all/test-extended-timestamp.js +0 -0
- package/tests/all/test-extra-field.js +0 -0
- package/tests/all/test-fflate-no-worker.js +0 -0
- package/tests/all/test-fflate.js +0 -0
- package/tests/all/test-fs-base64.js +0 -0
- package/tests/all/test-fs-export-options.js +0 -0
- package/tests/all/test-fs-http-import.js +0 -0
- package/tests/all/test-fs-http-reader.js +0 -0
- package/tests/all/test-fs-replace.js +0 -0
- package/tests/all/test-fs-streams.js +0 -0
- package/tests/all/test-fs-text.js +0 -0
- package/tests/all/test-fs-unzip-store.js +0 -0
- package/tests/all/test-fs.js +0 -0
- package/tests/all/test-http-crypto.js +0 -0
- package/tests/all/test-http-range.js +0 -0
- package/tests/all/test-http-zip64.js +0 -0
- package/tests/all/test-invalid-crc.js +0 -0
- package/tests/all/test-multiple-writers.js +0 -0
- package/tests/all/test-no-worker.js +0 -0
- package/tests/all/test-pako-no-worker.js +0 -0
- package/tests/all/test-pako.js +0 -0
- package/tests/all/test-parallel-reads.js +0 -0
- package/tests/all/test-parallel-writes-auto-buffered.js +0 -0
- package/tests/all/test-parallel-writes-ordered.js +0 -0
- package/tests/all/test-parallel-writes.js +0 -0
- package/tests/all/test-readable-stream.js +0 -0
- package/tests/all/test-readable-zip-stream.js +0 -0
- package/tests/all/test-safe-closing.js +0 -0
- package/tests/all/test-store.js +0 -0
- package/tests/all/test-sw-worker.js +0 -0
- package/tests/all/test-sw.js +0 -0
- package/tests/all/test-worker-timeout.js +0 -0
- package/tests/all/test-wrapped.js +2 -2
- package/tests/all/test-writable-stream.js +0 -0
- package/tests/all/test-zip64-auto.js +3 -2
- package/tests/all/test-zip64-crypto.js +0 -0
- package/tests/all/test-zip64.js +0 -0
- package/tests/all/test-zipcrypto.js +0 -0
- package/tests/data/lorem-encrypted.zip +0 -0
- package/tests/data/lorem-invalid-crc.zip +0 -0
- package/tests/data/lorem-store.zip +0 -0
- package/tests/data/lorem-zip64.zip +0 -0
- package/tests/data/lorem.txt +0 -0
- package/tests/data/lorem.zip +0 -0
- package/tests/deno-runner.js +0 -0
- package/tests/index.html +0 -0
- package/tests/node-runner.js +0 -0
- package/tests/tests-data.js +0 -0
- package/tests/vendor/fflate-es2019.min.js +0 -0
- package/tests/vendor/fflate.min.js +0 -0
- package/tests/vendor/pako.min.js +0 -0
- package/tests/vendor/pako_deflate.min.js +0 -0
- package/tests/vendor/pako_inflate.min.js +0 -0
- package/tests/web-runner.js +0 -0
- package/tsconfig.json +0 -0
package/.eslintrc.json
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/cli-deno/mc-zip.js
CHANGED
|
File without changes
|
package/dist/README.md
CHANGED
|
File without changes
|
package/dist/z-worker-fflate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";const{Array:e,Object:t,Math:n,Error:s,Uint8Array:r,Uint16Array:a,Uint32Array:i,Int32Array:o,DataView:c,Promise:l,TextEncoder:h,crypto:u,postMessage:p,TransformStream:f,ReadableStream:d,WritableStream:g,CompressionStream:w,DecompressionStream:y}=globalThis,_=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;_[e]=t}class m{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^_[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class b extends f{constructor(){super({start(){this.crc32=new m},transform(e){this.crc32.append(e)},flush(e){const t=new r(4);new c(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}const k={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=k.getPartial(n);return 32===s?e.concat(t):k._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+k.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const s=(e=e.slice(0,n.ceil(t/32))).length;return t&=31,s>0&&t&&(e[s-1]=k.partial(t,e[s-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>n.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=k.getPartial(r);return s.push(k.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},v={bytes:{fromBits(e){const t=k.bitLength(e)/8,n=new r(t);let s;for(let r=0;t>r;r++)0==(3&r)&&(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3==(3&n)&&(t.push(s),s=0);return 3&n&&t.push(k.partial(8*(3&n),s)),t}}},S={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};S.sha1.prototype={blockSize:512,reset(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update(e){const t=this;"string"==typeof e&&(e=v.utf8String.toBits(e));const n=t._buffer=k.concat(t._buffer,e),r=t._length,a=t._length=r+k.bitLength(e);if(a>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t},finalize(){const e=this;let t=e._buffer;const s=e._h;t=k.concat(t,[k.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(n.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,s)=>e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s,_S:(e,t)=>t<<e|t>>>32-e,_block(t){const s=this,r=s._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let i=r[0],o=r[1],c=r[2],l=r[3],h=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=s._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=s._S(5,i)+s._f(e,o,c,l)+h+a[e]+s._key[n.floor(e/20)]|0;h=l,l=c,c=s._S(30,o),o=i,i=t}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+h|0}};const z={getRandomValues(e){const t=new i(e.buffer),s=e=>{let t=987654321;const s=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&s,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&s)&s)/4294967296+.5)*(n.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=s(4294967296*(r||n.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},T={importKey:e=>new T.hmacSha1(v.bytes.toBits(e)),pbkdf2(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const a=1+(r>>5)<<2;let i,o,l,h,u;const p=new ArrayBuffer(a),f=new c(p);let d=0;const g=k;for(t=v.bytes.toBits(t),u=1;(a||1)>d;u++){for(i=o=e.encrypt(g.concat(t,[u])),l=1;n>l;l++)for(o=e.encrypt(o),h=0;h<o.length;h++)i[h]^=o[h];for(l=0;(a||1)>d&&l<i.length;l++)f.setInt32(d,i[l]),d+=4}return p.slice(0,r/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=S.sha1,s=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},C=void 0!==u&&"function"==typeof u.getRandomValues,D="Invalid password";function I(e){return C?u.getRandomValues(e):z.getRandomValues(e)}const R=16,V={name:"PBKDF2"},A=t.assign({hash:{name:"HMAC"}},V),q=t.assign({iterations:1e3,hash:{name:"SHA-1"}},V),B=["deriveBits"],H=[8,12,16],K=[16,24,32],x=10,W=[0,0,0,0],P="undefined",U="function",E=typeof u!=P,M=E&&typeof u.subtle!=P,L=E&&M&&typeof u.subtle.importKey==U,j=E&&M&&typeof u.subtle.deriveBits==U,F=v.bytes,N=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],r=t._tables[1],a=e.length;let i,o,c,l=1;if(4!==a&&6!==a&&8!==a)throw new s("invalid aes key size");for(t._key=[o=e.slice(0),c=[]],i=a;4*a+28>i;i++){let e=o[i-1];(i%a==0||8===a&&i%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],i%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),o[i]=o[i-a]^e}for(let e=0;i;e++,i--){const t=o[3&e?i:i-4];c[e]=4>=i||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let i,o,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let h=i=0;!n[h];h^=o||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,n[h]=a,s[a]=h,l=r[c=r[o=r[h]]];let u=16843009*l^65537*c^257*o^16843008*h,p=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][h]=p=p<<24^p>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this._key[t],r=n.length/4-2,a=[0,0,0,0],i=this._tables[t],o=i[0],c=i[1],l=i[2],h=i[3],u=i[4];let p,f,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],_=e[t?1:3]^n[3],m=4;for(let e=0;r>e;e++)p=o[g>>>24]^c[w>>16&255]^l[y>>8&255]^h[255&_]^n[m],f=o[w>>>24]^c[y>>16&255]^l[_>>8&255]^h[255&g]^n[m+1],d=o[y>>>24]^c[_>>16&255]^l[g>>8&255]^h[255&w]^n[m+2],_=o[_>>>24]^c[g>>16&255]^l[w>>8&255]^h[255&y]^n[m+3],m+=4,g=p,w=f,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=u[g>>>24]<<24^u[w>>16&255]<<16^u[y>>8&255]<<8^u[255&_]^n[m++],p=g,g=w,w=y,y=_,_=p;return a}},O=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=k.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return k.clamp(t,r)}},G=T.hmacSha1;class X extends f{constructor(n,a,i){let o;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,signed:a,strength:i-1,pending:new r})},async transform(t,n){const a=this;if(a.password){const n=a.password;a.password=null;const r=$(t,0,H[a.strength]+2);await(async(e,t,n)=>{await Y(e,n,$(t,0,H[e.strength]));const r=$(t,H[e.strength]),a=e.keys.passwordVerification;if(a[0]!=r[0]||a[1]!=r[1])throw new s(D)})(a,r,n),a.ctr=new O(new N(a.keys.key),e.from(W)),a.hmac=new G(a.keys.authentication),t=$(t,H[a.strength]+2),a.resolveReady()}else await a.ready;const i=new r(t.length-x-(t.length-x)%R);n.enqueue(Q(a,t,i,0,x,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,s=$(n,0,n.length-x),a=$(n,n.length-x);let i=new r;if(s.length){const e=te(F,s);t.hmac.update(e);const n=t.ctr.update(e);i=ee(F,n)}if(o.valid=!0,t.signed){const e=$(ee(F,t.hmac.digest()),0,x);for(let t=0;x>t;t++)e[t]!=a[t]&&(o.valid=!1)}e.enqueue(i)}}),o=this}}class J extends f{constructor(n,s){let a;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,strength:s-1,pending:new r})},async transform(t,n){const s=this;let a=new r;if(s.password){const t=s.password;s.password=null,a=await(async(e,t)=>{const n=I(new r(H[e.strength]));return await Y(e,t,n),Z(n,e.keys.passwordVerification)})(s,t),s.ctr=new O(new N(s.keys.key),e.from(W)),s.hmac=new G(s.keys.authentication),s.resolveReady()}else await s.ready;const i=new r(a.length+t.length-t.length%R);i.set(a,0),n.enqueue(Q(s,t,i,a.length,0))},async flush(e){const t=this;await t.ready;let n=new r;if(t.pending.length){const e=t.ctr.update(te(F,t.pending));t.hmac.update(e),n=ee(F,e)}a.signature=ee(F,t.hmac.digest()).slice(0,x),e.enqueue(Z(n,a.signature))}}),a=this}}function Q(e,t,n,s,a,i){const o=t.length-a;let c;for(e.pending.length&&(t=Z(e.pending,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new r(t)).set(n,0)}return e})(n,o-o%R)),c=0;o-R>=c;c+=R){const r=te(F,$(t,c,c+R));i&&e.hmac.update(r);const a=e.ctr.update(r);i||e.hmac.update(a),n.set(ee(F,a),c+s)}return e.pending=$(t,c),n}async function Y(e,n,s){const a=(e=>{if(void 0===h){const t=new r((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new h).encode(e)})(n),i=await((e,t,n,s,r)=>L?u.subtle.importKey("raw",t,n,!1,r):T.importKey(t))(0,a,A,0,B),o=await(async(e,t,n)=>j?await u.subtle.deriveBits(e,t,n):T.pbkdf2(t,e.salt,q.iterations,n))(t.assign({salt:s},q),i,8*(2*K[e.strength]+2)),c=new r(o);e.keys={key:te(F,$(c,0,K[e.strength])),authentication:te(F,$(c,K[e.strength],2*K[e.strength])),passwordVerification:$(c,2*K[e.strength])}}function Z(e,t){let n=e;return e.length+t.length&&(n=new r(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $(e,t,n){return e.subarray(t,n)}function ee(e,t){return e.fromBits(t)}function te(e,t){return e.toBits(t)}class ne extends f{constructor(e,n){let r;super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;if(n.password){const t=re(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(D);e=e.subarray(12)}t.enqueue(re(n,e))},flush(){r.valid=!0}}),r=this}}class se extends f{constructor(e,n){super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;let s,a;if(n.password){n.password=null;const t=I(new r(12));t[11]=n.passwordVerification,s=new r(e.length+t.length),s.set(ae(n,t),0),a=12}else s=new r(e.length),a=0;s.set(ae(n,e),a),t.enqueue(s)},flush(){}})}}function re(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,n[s]);return n}function ae(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,t[s]);return n}function ie(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new m(e.keys[0]),e.crcKey2=new m(e.keys[2]);for(let n=0;n<t.length;n++)oe(e,t.charCodeAt(n))}function oe(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=he(e.keys[1]+le(e.keys[0])),e.keys[1]=he(n.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function ce(e){const t=2|e.keys[2];return le(n.imul(t,1^t)>>>8)}function le(e){return 255&e}function he(e){return 4294967295&e}class ue extends f{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}const pe="Invalid signature",fe="deflate-raw",de="undefined",ge=typeof w==de,we=typeof y==de;let ye=!0,_e=!0;class me extends f{constructor(e,t,{chunkSize:n},...s){super({},...s);const{compressed:r,encrypted:a,useCompressionStream:i,password:o,passwordVerification:l,encryptionStrength:h,zipCrypto:u,signed:p,level:f}=t,d=this;let g,y,_=ve(super.readable);if(a&&!u||!p||([_,g]=_.tee(),g=g.pipeThrough(new b)),r)if(void 0!==i&&!i||ge&&!_e)_=ke(e,_,{chunkSize:n,level:f});else try{_=_.pipeThrough(new w(fe))}catch(t){_e=!1,_=ke(e,_,{chunkSize:n,level:f})}a&&(u?_=_.pipeThrough(new se(o,l)):(y=new J(o,h),_=_.pipeThrough(y))),Se(d,_,(async()=>{let e;a&&!u&&(e=y.signature),a&&!u||!p||(e=await g.getReader().read(),e=new c(e.value.buffer).getUint32(0)),d.signature=e}))}}class be extends f{constructor(e,t,{chunkSize:n},...r){super({},...r);const{zipCrypto:a,encrypted:i,password:o,passwordVerification:l,signed:h,encryptionStrength:u,compressed:p,useCompressionStream:f}=t;let d,g,w=ve(super.readable);if(i&&(a?w=w.pipeThrough(new ne(o,l)):(g=new X(o,h,u),w=w.pipeThrough(g))),p)if(void 0!==f&&!f||we&&!ye)w=ke(e,w,{chunkSize:n});else try{w=w.pipeThrough(new y(fe))}catch(t){ye=!1,w=ke(e,w,{chunkSize:n})}i&&!a||!h||([w,d]=w.tee(),d=d.pipeThrough(new b)),Se(this,w,(async()=>{if(i&&!a&&!g.valid)throw new s(pe);if((!i||a)&&h){const e=await d.getReader().read(),n=new c(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new s(pe)}}))}}function ke(e,t,n){return t.pipeThrough(new ue(e,n))}function ve(e){return e.pipeThrough(new f({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Se(e,n,s){e.size=0,n=n.pipeThrough(new f({transform(t,n){t&&t.length&&(e.size+=t.length,n.enqueue(t))},flush:s})),t.defineProperty(e,"readable",{get:()=>n})}const ze="deflate",Te="inflate",Ce="data";class De{constructor(e,t,n,s,r){const{codecType:a}=s;async function i(a){const i=new a(e,s,r);await t.pipeThrough(i).pipeTo(n,{preventClose:!0,preventAbort:!0});const{size:o,signature:c}=i;return{size:o,signature:c}}a.startsWith(ze)?this.run=()=>i(me):a.startsWith(Te)&&(this.run=()=>i(be))}}const Ie=new Map;let Re,Ve=0;async function Ae(e){try{const{options:t,scripts:n,config:s}=e,{codecType:r}=t;let a;n&&n.length&&importScripts.apply(void 0,n),self.initCodec&&self.initCodec(),r.startsWith(ze)?a=self.Deflate:r.startsWith(Te)&&(a=self.Inflate);const i={highWaterMark:1,size:()=>s.chunkSize},o=new d({async pull(e){let t=new l(((e,t)=>Ie.set(Ve,{resolve:e,reject:t})));qe({type:"pull",messageId:Ve}),Ve=(Ve+1)%Number.MAX_SAFE_INTEGER;const{value:n,done:s}=await t;e.enqueue(n),s&&e.close()}},i),c=new g({write(e){qe({type:Ce,data:e})}},i);Re=new De(a,o,c,t,s),qe({type:"close",result:await Re.run()})}catch(e){const{message:t,stack:n}=e;p({error:{message:t,stack:n}})}}function qe(e){if(e.data){let{data:t}=e;if(t&&t.length)try{t=new r(t),e.data=t.buffer,p(e,[e.data])}catch(t){p(e)}else p(e)}else p(e)}function Be(e,n,s){return class{constructor(a){const i=this;t.hasOwn(a,"level")&&void 0===a.level&&delete a.level,i.codec=new e(t.assign({},n,a)),s(i.codec,(e=>{if(i.pendingData){const{pendingData:t}=i;i.pendingData=new r(t.length+e.length),t.set(t,0),t.set(e,t.length)}else i.pendingData=new r(e)}))}append(e){return this.codec.push(e),a(this)}flush(){return this.codec.push(new r,!0),a(this)}};function a(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new r}}addEventListener("message",(async e=>{const t=e.data,{type:n,messageId:s,data:a,done:i}=t;try{if("start"==n&&Ae(t),n==Ce){const{resolve:e}=Ie.get(s);Ie.delete(s),e({value:new r(a),done:i})}}catch(e){p({error:{message:e.message,stack:e.stack}})}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:Be(e.Deflate,t.deflate,n),Inflate:Be(e.Inflate,t.inflate,n)}))(fflate,void 0,((e,t)=>e.ondata=t));self.Deflate=e,self.Inflate=t}}();
|
|
1
|
+
!function(){"use strict";const{Array:e,Object:t,Math:n,Error:s,Uint8Array:r,Uint16Array:a,Uint32Array:i,Int32Array:o,DataView:c,Promise:l,TextEncoder:h,crypto:u,postMessage:p,TransformStream:f,ReadableStream:d,WritableStream:g,CompressionStream:w,DecompressionStream:y}=globalThis,_=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;_[e]=t}class m{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^_[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class b extends f{constructor(){super({start(){this.crc32=new m},transform(e){this.crc32.append(e)},flush(e){const t=new r(4);new c(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}const k={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=k.getPartial(n);return 32===s?e.concat(t):k._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+k.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const s=(e=e.slice(0,n.ceil(t/32))).length;return t&=31,s>0&&t&&(e[s-1]=k.partial(t,e[s-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>n.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=k.getPartial(r);return s.push(k.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},v={bytes:{fromBits(e){const t=k.bitLength(e)/8,n=new r(t);let s;for(let r=0;t>r;r++)0==(3&r)&&(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3==(3&n)&&(t.push(s),s=0);return 3&n&&t.push(k.partial(8*(3&n),s)),t}}},S={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};S.sha1.prototype={blockSize:512,reset(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update(e){const t=this;"string"==typeof e&&(e=v.utf8String.toBits(e));const n=t._buffer=k.concat(t._buffer,e),r=t._length,a=t._length=r+k.bitLength(e);if(a>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t},finalize(){const e=this;let t=e._buffer;const s=e._h;t=k.concat(t,[k.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(n.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,s)=>e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s,_S:(e,t)=>t<<e|t>>>32-e,_block(t){const s=this,r=s._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let i=r[0],o=r[1],c=r[2],l=r[3],h=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=s._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=s._S(5,i)+s._f(e,o,c,l)+h+a[e]+s._key[n.floor(e/20)]|0;h=l,l=c,c=s._S(30,o),o=i,i=t}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+h|0}};const z={getRandomValues(e){const t=new i(e.buffer),s=e=>{let t=987654321;const s=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&s,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&s)&s)/4294967296+.5)*(n.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=s(4294967296*(r||n.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},T={importKey:e=>new T.hmacSha1(v.bytes.toBits(e)),pbkdf2(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const a=1+(r>>5)<<2;let i,o,l,h,u;const p=new ArrayBuffer(a),f=new c(p);let d=0;const g=k;for(t=v.bytes.toBits(t),u=1;(a||1)>d;u++){for(i=o=e.encrypt(g.concat(t,[u])),l=1;n>l;l++)for(o=e.encrypt(o),h=0;h<o.length;h++)i[h]^=o[h];for(l=0;(a||1)>d&&l<i.length;l++)f.setInt32(d,i[l]),d+=4}return p.slice(0,r/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=S.sha1,s=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},I=void 0!==u&&"function"==typeof u.getRandomValues,C="Invalid password";function R(e){return I?u.getRandomValues(e):z.getRandomValues(e)}const A=16,D={name:"PBKDF2"},V=t.assign({hash:{name:"HMAC"}},D),q=t.assign({iterations:1e3,hash:{name:"SHA-1"}},D),B=["deriveBits"],H=[8,12,16],K=[16,24,32],x=10,E=[0,0,0,0],W="undefined",M="function",P=typeof u!=W,U=P&&typeof u.subtle!=W,L=P&&U&&typeof u.subtle.importKey==M,N=P&&U&&typeof u.subtle.deriveBits==M,F=v.bytes,G=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],r=t._tables[1],a=e.length;let i,o,c,l=1;if(4!==a&&6!==a&&8!==a)throw new s("invalid aes key size");for(t._key=[o=e.slice(0),c=[]],i=a;4*a+28>i;i++){let e=o[i-1];(i%a==0||8===a&&i%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],i%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),o[i]=o[i-a]^e}for(let e=0;i;e++,i--){const t=o[3&e?i:i-4];c[e]=4>=i||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let i,o,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let h=i=0;!n[h];h^=o||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,n[h]=a,s[a]=h,l=r[c=r[o=r[h]]];let u=16843009*l^65537*c^257*o^16843008*h,p=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][h]=p=p<<24^p>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this._key[t],r=n.length/4-2,a=[0,0,0,0],i=this._tables[t],o=i[0],c=i[1],l=i[2],h=i[3],u=i[4];let p,f,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],_=e[t?1:3]^n[3],m=4;for(let e=0;r>e;e++)p=o[g>>>24]^c[w>>16&255]^l[y>>8&255]^h[255&_]^n[m],f=o[w>>>24]^c[y>>16&255]^l[_>>8&255]^h[255&g]^n[m+1],d=o[y>>>24]^c[_>>16&255]^l[g>>8&255]^h[255&w]^n[m+2],_=o[_>>>24]^c[g>>16&255]^l[w>>8&255]^h[255&y]^n[m+3],m+=4,g=p,w=f,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=u[g>>>24]<<24^u[w>>16&255]<<16^u[y>>8&255]<<8^u[255&_]^n[m++],p=g,g=w,w=y,y=_,_=p;return a}},O=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=k.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return k.clamp(t,r)}},X=T.hmacSha1;class j extends f{constructor(n,a,i){let o;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,signed:a,strength:i-1,pending:new r})},async transform(t,n){const a=this;if(a.password){const n=a.password;a.password=null;const r=$(t,0,H[a.strength]+2);await(async(e,t,n)=>{await Y(e,n,$(t,0,H[e.strength]));const r=$(t,H[e.strength]),a=e.keys.passwordVerification;if(a[0]!=r[0]||a[1]!=r[1])throw new s(C)})(a,r,n),a.ctr=new O(new G(a.keys.key),e.from(E)),a.hmac=new X(a.keys.authentication),t=$(t,H[a.strength]+2),a.resolveReady()}else await a.ready;const i=new r(t.length-x-(t.length-x)%A);n.enqueue(Q(a,t,i,0,x,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,s=$(n,0,n.length-x),a=$(n,n.length-x);let i=new r;if(s.length){const e=te(F,s);t.hmac.update(e);const n=t.ctr.update(e);i=ee(F,n)}if(o.valid=!0,t.signed){const e=$(ee(F,t.hmac.digest()),0,x);for(let t=0;x>t;t++)e[t]!=a[t]&&(o.valid=!1)}e.enqueue(i)}}),o=this}}class J extends f{constructor(n,s){let a;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,strength:s-1,pending:new r})},async transform(t,n){const s=this;let a=new r;if(s.password){const t=s.password;s.password=null,a=await(async(e,t)=>{const n=R(new r(H[e.strength]));return await Y(e,t,n),Z(n,e.keys.passwordVerification)})(s,t),s.ctr=new O(new G(s.keys.key),e.from(E)),s.hmac=new X(s.keys.authentication),s.resolveReady()}else await s.ready;const i=new r(a.length+t.length-t.length%A);i.set(a,0),n.enqueue(Q(s,t,i,a.length,0))},async flush(e){const t=this;await t.ready;let n=new r;if(t.pending.length){const e=t.ctr.update(te(F,t.pending));t.hmac.update(e),n=ee(F,e)}a.signature=ee(F,t.hmac.digest()).slice(0,x),e.enqueue(Z(n,a.signature))}}),a=this}}function Q(e,t,n,s,a,i){const o=t.length-a;let c;for(e.pending.length&&(t=Z(e.pending,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new r(t)).set(n,0)}return e})(n,o-o%A)),c=0;o-A>=c;c+=A){const r=te(F,$(t,c,c+A));i&&e.hmac.update(r);const a=e.ctr.update(r);i||e.hmac.update(a),n.set(ee(F,a),c+s)}return e.pending=$(t,c),n}async function Y(e,n,s){const a=(e=>{if(void 0===h){const t=new r((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new h).encode(e)})(n),i=await((e,t,n,s,r)=>L?u.subtle.importKey("raw",t,n,!1,r):T.importKey(t))(0,a,V,0,B),o=await(async(e,t,n)=>N?await u.subtle.deriveBits(e,t,n):T.pbkdf2(t,e.salt,q.iterations,n))(t.assign({salt:s},q),i,8*(2*K[e.strength]+2)),c=new r(o);e.keys={key:te(F,$(c,0,K[e.strength])),authentication:te(F,$(c,K[e.strength],2*K[e.strength])),passwordVerification:$(c,2*K[e.strength])}}function Z(e,t){let n=e;return e.length+t.length&&(n=new r(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $(e,t,n){return e.subarray(t,n)}function ee(e,t){return e.fromBits(t)}function te(e,t){return e.toBits(t)}class ne extends f{constructor(e,n){let r;super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;if(n.password){const t=re(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(C);e=e.subarray(12)}t.enqueue(re(n,e))},flush(){r.valid=!0}}),r=this}}class se extends f{constructor(e,n){super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;let s,a;if(n.password){n.password=null;const t=R(new r(12));t[11]=n.passwordVerification,s=new r(e.length+t.length),s.set(ae(n,t),0),a=12}else s=new r(e.length),a=0;s.set(ae(n,e),a),t.enqueue(s)},flush(){}})}}function re(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,n[s]);return n}function ae(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,t[s]);return n}function ie(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new m(e.keys[0]),e.crcKey2=new m(e.keys[2]);for(let n=0;n<t.length;n++)oe(e,t.charCodeAt(n))}function oe(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=he(e.keys[1]+le(e.keys[0])),e.keys[1]=he(n.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function ce(e){const t=2|e.keys[2];return le(n.imul(t,1^t)>>>8)}function le(e){return 255&e}function he(e){return 4294967295&e}class ue extends f{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}const pe="Invalid signature",fe="deflate-raw",de="undefined",ge=typeof w==de,we=typeof y==de;let ye=!0,_e=!0;class me extends f{constructor(e,t,{chunkSize:n},...s){super({},...s);const{compressed:r,encrypted:a,useCompressionStream:i,password:o,passwordVerification:l,encryptionStrength:h,zipCrypto:u,signed:p,level:f}=t,d=this;let g,y,_=ve(super.readable);if(a&&!u||!p||([_,g]=_.tee(),g=g.pipeThrough(new b)),r)if(void 0!==i&&!i||ge&&!_e)_=ke(e,_,{chunkSize:n,level:f});else try{_=_.pipeThrough(new w(fe))}catch(t){_e=!1,_=ke(e,_,{chunkSize:n,level:f})}a&&(u?_=_.pipeThrough(new se(o,l)):(y=new J(o,h),_=_.pipeThrough(y))),Se(d,_,(async()=>{let e;a&&!u&&(e=y.signature),a&&!u||!p||(e=await g.getReader().read(),e=new c(e.value.buffer).getUint32(0)),d.signature=e}))}}class be extends f{constructor(e,t,{chunkSize:n},...r){super({},...r);const{zipCrypto:a,encrypted:i,password:o,passwordVerification:l,signed:h,encryptionStrength:u,compressed:p,useCompressionStream:f}=t;let d,g,w=ve(super.readable);if(i&&(a?w=w.pipeThrough(new ne(o,l)):(g=new j(o,h,u),w=w.pipeThrough(g))),p)if(void 0!==f&&!f||we&&!ye)w=ke(e,w,{chunkSize:n});else try{w=w.pipeThrough(new y(fe))}catch(t){ye=!1,w=ke(e,w,{chunkSize:n})}i&&!a||!h||([w,d]=w.tee(),d=d.pipeThrough(new b)),Se(this,w,(async()=>{if(i&&!a&&!g.valid)throw new s(pe);if((!i||a)&&h){const e=await d.getReader().read(),n=new c(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new s(pe)}}))}}function ke(e,t,n){return t.pipeThrough(new ue(e,n))}function ve(e){return e.pipeThrough(new f({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Se(e,n,s){n=n.pipeThrough(new f({flush:s})),t.defineProperty(e,"readable",{get:()=>n})}const ze="deflate",Te="inflate",Ie="data";class Ce{constructor(e,t,n,s,r){const{codecType:a}=s;async function i(a){const i=new a(e,s,r);await t.pipeThrough(i).pipeThrough(new f({transform(e,t){e&&e.length&&(n.size+=e.length,t.enqueue(e))}})).pipeTo(n,{preventClose:!0,preventAbort:!0});const{size:o,signature:c}=i;return{size:o,signature:c}}a.startsWith(ze)?this.run=()=>i(me):a.startsWith(Te)&&(this.run=()=>i(be))}}const Re=new Map,Ae=new Map;let De,Ve=0;async function qe(e){try{const{options:t,scripts:n,config:s}=e,{codecType:r}=t;let a;n&&n.length&&importScripts.apply(void 0,n),self.initCodec&&self.initCodec(),r.startsWith(ze)?a=self.Deflate:r.startsWith(Te)&&(a=self.Inflate);const i={highWaterMark:1,size:()=>s.chunkSize},o=new d({async pull(e){let t=new l((e=>Re.set(Ve,e)));Be({type:"pull",messageId:Ve}),Ve=(Ve+1)%Number.MAX_SAFE_INTEGER;const{value:n,done:s}=await t;e.enqueue(n),s&&e.close()}},i),c=new g({async write(e){let t;const n=new l((e=>t=e));Ae.set(Ve,t),Be({type:Ie,data:e,messageId:Ve}),Ve=(Ve+1)%Number.MAX_SAFE_INTEGER,await n}},i);De=new Ce(a,o,c,t,s),Be({type:"close",result:await De.run()})}catch(e){const{message:t,stack:n}=e;p({error:{message:t,stack:n}})}}function Be(e){if(e.data){let{data:t}=e;if(t&&t.length)try{t=new r(t),e.data=t.buffer,p(e,[e.data])}catch(t){p(e)}else p(e)}else p(e)}function He(e,n,s){return class{constructor(a){const i=this;t.hasOwn(a,"level")&&void 0===a.level&&delete a.level,i.codec=new e(t.assign({},n,a)),s(i.codec,(e=>{if(i.pendingData){const{pendingData:t}=i;i.pendingData=new r(t.length+e.length),t.set(t,0),t.set(e,t.length)}else i.pendingData=new r(e)}))}append(e){return this.codec.push(e),a(this)}flush(){return this.codec.push(new r,!0),a(this)}};function a(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new r}}addEventListener("message",(async e=>{const t=e.data,{type:n,messageId:s,data:a,done:i}=t;try{if("start"==n&&qe(t),n==Ie){const e=Re.get(s);Re.delete(s),e({value:new r(a),done:i})}if("ack"==n){const e=Ae.get(s);Ae.delete(s),e()}}catch(e){p({error:{message:e.message,stack:e.stack}})}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:He(e.Deflate,t.deflate,n),Inflate:He(e.Inflate,t.inflate,n)}))(fflate,void 0,((e,t)=>e.ondata=t));self.Deflate=e,self.Inflate=t}}();
|
package/dist/z-worker-pako.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";const{Array:e,Object:t,Math:n,Error:s,Uint8Array:r,Uint16Array:a,Uint32Array:i,Int32Array:o,DataView:c,Promise:l,TextEncoder:h,crypto:u,postMessage:p,TransformStream:f,ReadableStream:d,WritableStream:g,CompressionStream:w,DecompressionStream:y}=globalThis,_=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;_[e]=t}class m{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^_[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class b extends f{constructor(){super({start(){this.crc32=new m},transform(e){this.crc32.append(e)},flush(e){const t=new r(4);new c(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}const k={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=k.getPartial(n);return 32===s?e.concat(t):k._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+k.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const s=(e=e.slice(0,n.ceil(t/32))).length;return t&=31,s>0&&t&&(e[s-1]=k.partial(t,e[s-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>n.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=k.getPartial(r);return s.push(k.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},v={bytes:{fromBits(e){const t=k.bitLength(e)/8,n=new r(t);let s;for(let r=0;t>r;r++)0==(3&r)&&(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3==(3&n)&&(t.push(s),s=0);return 3&n&&t.push(k.partial(8*(3&n),s)),t}}},S={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};S.sha1.prototype={blockSize:512,reset(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update(e){const t=this;"string"==typeof e&&(e=v.utf8String.toBits(e));const n=t._buffer=k.concat(t._buffer,e),r=t._length,a=t._length=r+k.bitLength(e);if(a>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t},finalize(){const e=this;let t=e._buffer;const s=e._h;t=k.concat(t,[k.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(n.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,s)=>e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s,_S:(e,t)=>t<<e|t>>>32-e,_block(t){const s=this,r=s._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let i=r[0],o=r[1],c=r[2],l=r[3],h=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=s._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=s._S(5,i)+s._f(e,o,c,l)+h+a[e]+s._key[n.floor(e/20)]|0;h=l,l=c,c=s._S(30,o),o=i,i=t}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+h|0}};const z={getRandomValues(e){const t=new i(e.buffer),s=e=>{let t=987654321;const s=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&s,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&s)&s)/4294967296+.5)*(n.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=s(4294967296*(r||n.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},T={importKey:e=>new T.hmacSha1(v.bytes.toBits(e)),pbkdf2(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const a=1+(r>>5)<<2;let i,o,l,h,u;const p=new ArrayBuffer(a),f=new c(p);let d=0;const g=k;for(t=v.bytes.toBits(t),u=1;(a||1)>d;u++){for(i=o=e.encrypt(g.concat(t,[u])),l=1;n>l;l++)for(o=e.encrypt(o),h=0;h<o.length;h++)i[h]^=o[h];for(l=0;(a||1)>d&&l<i.length;l++)f.setInt32(d,i[l]),d+=4}return p.slice(0,r/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=S.sha1,s=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},C=void 0!==u&&"function"==typeof u.getRandomValues,D="Invalid password";function I(e){return C?u.getRandomValues(e):z.getRandomValues(e)}const R=16,V={name:"PBKDF2"},A=t.assign({hash:{name:"HMAC"}},V),q=t.assign({iterations:1e3,hash:{name:"SHA-1"}},V),B=["deriveBits"],H=[8,12,16],K=[16,24,32],x=10,W=[0,0,0,0],P="undefined",U="function",E=typeof u!=P,M=E&&typeof u.subtle!=P,L=E&&M&&typeof u.subtle.importKey==U,j=E&&M&&typeof u.subtle.deriveBits==U,F=v.bytes,N=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],r=t._tables[1],a=e.length;let i,o,c,l=1;if(4!==a&&6!==a&&8!==a)throw new s("invalid aes key size");for(t._key=[o=e.slice(0),c=[]],i=a;4*a+28>i;i++){let e=o[i-1];(i%a==0||8===a&&i%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],i%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),o[i]=o[i-a]^e}for(let e=0;i;e++,i--){const t=o[3&e?i:i-4];c[e]=4>=i||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let i,o,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let h=i=0;!n[h];h^=o||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,n[h]=a,s[a]=h,l=r[c=r[o=r[h]]];let u=16843009*l^65537*c^257*o^16843008*h,p=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][h]=p=p<<24^p>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this._key[t],r=n.length/4-2,a=[0,0,0,0],i=this._tables[t],o=i[0],c=i[1],l=i[2],h=i[3],u=i[4];let p,f,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],_=e[t?1:3]^n[3],m=4;for(let e=0;r>e;e++)p=o[g>>>24]^c[w>>16&255]^l[y>>8&255]^h[255&_]^n[m],f=o[w>>>24]^c[y>>16&255]^l[_>>8&255]^h[255&g]^n[m+1],d=o[y>>>24]^c[_>>16&255]^l[g>>8&255]^h[255&w]^n[m+2],_=o[_>>>24]^c[g>>16&255]^l[w>>8&255]^h[255&y]^n[m+3],m+=4,g=p,w=f,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=u[g>>>24]<<24^u[w>>16&255]<<16^u[y>>8&255]<<8^u[255&_]^n[m++],p=g,g=w,w=y,y=_,_=p;return a}},O=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=k.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return k.clamp(t,r)}},G=T.hmacSha1;class X extends f{constructor(n,a,i){let o;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,signed:a,strength:i-1,pending:new r})},async transform(t,n){const a=this;if(a.password){const n=a.password;a.password=null;const r=$(t,0,H[a.strength]+2);await(async(e,t,n)=>{await Y(e,n,$(t,0,H[e.strength]));const r=$(t,H[e.strength]),a=e.keys.passwordVerification;if(a[0]!=r[0]||a[1]!=r[1])throw new s(D)})(a,r,n),a.ctr=new O(new N(a.keys.key),e.from(W)),a.hmac=new G(a.keys.authentication),t=$(t,H[a.strength]+2),a.resolveReady()}else await a.ready;const i=new r(t.length-x-(t.length-x)%R);n.enqueue(Q(a,t,i,0,x,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,s=$(n,0,n.length-x),a=$(n,n.length-x);let i=new r;if(s.length){const e=te(F,s);t.hmac.update(e);const n=t.ctr.update(e);i=ee(F,n)}if(o.valid=!0,t.signed){const e=$(ee(F,t.hmac.digest()),0,x);for(let t=0;x>t;t++)e[t]!=a[t]&&(o.valid=!1)}e.enqueue(i)}}),o=this}}class J extends f{constructor(n,s){let a;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,strength:s-1,pending:new r})},async transform(t,n){const s=this;let a=new r;if(s.password){const t=s.password;s.password=null,a=await(async(e,t)=>{const n=I(new r(H[e.strength]));return await Y(e,t,n),Z(n,e.keys.passwordVerification)})(s,t),s.ctr=new O(new N(s.keys.key),e.from(W)),s.hmac=new G(s.keys.authentication),s.resolveReady()}else await s.ready;const i=new r(a.length+t.length-t.length%R);i.set(a,0),n.enqueue(Q(s,t,i,a.length,0))},async flush(e){const t=this;await t.ready;let n=new r;if(t.pending.length){const e=t.ctr.update(te(F,t.pending));t.hmac.update(e),n=ee(F,e)}a.signature=ee(F,t.hmac.digest()).slice(0,x),e.enqueue(Z(n,a.signature))}}),a=this}}function Q(e,t,n,s,a,i){const o=t.length-a;let c;for(e.pending.length&&(t=Z(e.pending,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new r(t)).set(n,0)}return e})(n,o-o%R)),c=0;o-R>=c;c+=R){const r=te(F,$(t,c,c+R));i&&e.hmac.update(r);const a=e.ctr.update(r);i||e.hmac.update(a),n.set(ee(F,a),c+s)}return e.pending=$(t,c),n}async function Y(e,n,s){const a=(e=>{if(void 0===h){const t=new r((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new h).encode(e)})(n),i=await((e,t,n,s,r)=>L?u.subtle.importKey("raw",t,n,!1,r):T.importKey(t))(0,a,A,0,B),o=await(async(e,t,n)=>j?await u.subtle.deriveBits(e,t,n):T.pbkdf2(t,e.salt,q.iterations,n))(t.assign({salt:s},q),i,8*(2*K[e.strength]+2)),c=new r(o);e.keys={key:te(F,$(c,0,K[e.strength])),authentication:te(F,$(c,K[e.strength],2*K[e.strength])),passwordVerification:$(c,2*K[e.strength])}}function Z(e,t){let n=e;return e.length+t.length&&(n=new r(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $(e,t,n){return e.subarray(t,n)}function ee(e,t){return e.fromBits(t)}function te(e,t){return e.toBits(t)}class ne extends f{constructor(e,n){let r;super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;if(n.password){const t=re(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(D);e=e.subarray(12)}t.enqueue(re(n,e))},flush(){r.valid=!0}}),r=this}}class se extends f{constructor(e,n){super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;let s,a;if(n.password){n.password=null;const t=I(new r(12));t[11]=n.passwordVerification,s=new r(e.length+t.length),s.set(ae(n,t),0),a=12}else s=new r(e.length),a=0;s.set(ae(n,e),a),t.enqueue(s)},flush(){}})}}function re(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,n[s]);return n}function ae(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,t[s]);return n}function ie(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new m(e.keys[0]),e.crcKey2=new m(e.keys[2]);for(let n=0;n<t.length;n++)oe(e,t.charCodeAt(n))}function oe(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=he(e.keys[1]+le(e.keys[0])),e.keys[1]=he(n.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function ce(e){const t=2|e.keys[2];return le(n.imul(t,1^t)>>>8)}function le(e){return 255&e}function he(e){return 4294967295&e}class ue extends f{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}const pe="Invalid signature",fe="deflate-raw",de="undefined",ge=typeof w==de,we=typeof y==de;let ye=!0,_e=!0;class me extends f{constructor(e,t,{chunkSize:n},...s){super({},...s);const{compressed:r,encrypted:a,useCompressionStream:i,password:o,passwordVerification:l,encryptionStrength:h,zipCrypto:u,signed:p,level:f}=t,d=this;let g,y,_=ve(super.readable);if(a&&!u||!p||([_,g]=_.tee(),g=g.pipeThrough(new b)),r)if(void 0!==i&&!i||ge&&!_e)_=ke(e,_,{chunkSize:n,level:f});else try{_=_.pipeThrough(new w(fe))}catch(t){_e=!1,_=ke(e,_,{chunkSize:n,level:f})}a&&(u?_=_.pipeThrough(new se(o,l)):(y=new J(o,h),_=_.pipeThrough(y))),Se(d,_,(async()=>{let e;a&&!u&&(e=y.signature),a&&!u||!p||(e=await g.getReader().read(),e=new c(e.value.buffer).getUint32(0)),d.signature=e}))}}class be extends f{constructor(e,t,{chunkSize:n},...r){super({},...r);const{zipCrypto:a,encrypted:i,password:o,passwordVerification:l,signed:h,encryptionStrength:u,compressed:p,useCompressionStream:f}=t;let d,g,w=ve(super.readable);if(i&&(a?w=w.pipeThrough(new ne(o,l)):(g=new X(o,h,u),w=w.pipeThrough(g))),p)if(void 0!==f&&!f||we&&!ye)w=ke(e,w,{chunkSize:n});else try{w=w.pipeThrough(new y(fe))}catch(t){ye=!1,w=ke(e,w,{chunkSize:n})}i&&!a||!h||([w,d]=w.tee(),d=d.pipeThrough(new b)),Se(this,w,(async()=>{if(i&&!a&&!g.valid)throw new s(pe);if((!i||a)&&h){const e=await d.getReader().read(),n=new c(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new s(pe)}}))}}function ke(e,t,n){return t.pipeThrough(new ue(e,n))}function ve(e){return e.pipeThrough(new f({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Se(e,n,s){e.size=0,n=n.pipeThrough(new f({transform(t,n){t&&t.length&&(e.size+=t.length,n.enqueue(t))},flush:s})),t.defineProperty(e,"readable",{get:()=>n})}const ze="deflate",Te="inflate",Ce="data";class De{constructor(e,t,n,s,r){const{codecType:a}=s;async function i(a){const i=new a(e,s,r);await t.pipeThrough(i).pipeTo(n,{preventClose:!0,preventAbort:!0});const{size:o,signature:c}=i;return{size:o,signature:c}}a.startsWith(ze)?this.run=()=>i(me):a.startsWith(Te)&&(this.run=()=>i(be))}}const Ie=new Map;let Re,Ve=0;async function Ae(e){try{const{options:t,scripts:n,config:s}=e,{codecType:r}=t;let a;n&&n.length&&importScripts.apply(void 0,n),self.initCodec&&self.initCodec(),r.startsWith(ze)?a=self.Deflate:r.startsWith(Te)&&(a=self.Inflate);const i={highWaterMark:1,size:()=>s.chunkSize},o=new d({async pull(e){let t=new l(((e,t)=>Ie.set(Ve,{resolve:e,reject:t})));qe({type:"pull",messageId:Ve}),Ve=(Ve+1)%Number.MAX_SAFE_INTEGER;const{value:n,done:s}=await t;e.enqueue(n),s&&e.close()}},i),c=new g({write(e){qe({type:Ce,data:e})}},i);Re=new De(a,o,c,t,s),qe({type:"close",result:await Re.run()})}catch(e){const{message:t,stack:n}=e;p({error:{message:t,stack:n}})}}function qe(e){if(e.data){let{data:t}=e;if(t&&t.length)try{t=new r(t),e.data=t.buffer,p(e,[e.data])}catch(t){p(e)}else p(e)}else p(e)}function Be(e,n,s){return class{constructor(a){const i=this;t.hasOwn(a,"level")&&void 0===a.level&&delete a.level,i.codec=new e(t.assign({},n,a)),s(i.codec,(e=>{if(i.pendingData){const{pendingData:t}=i;i.pendingData=new r(t.length+e.length),t.set(t,0),t.set(e,t.length)}else i.pendingData=new r(e)}))}append(e){return this.codec.push(e),a(this)}flush(){return this.codec.push(new r,!0),a(this)}};function a(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new r}}addEventListener("message",(async e=>{const t=e.data,{type:n,messageId:s,data:a,done:i}=t;try{if("start"==n&&Ae(t),n==Ce){const{resolve:e}=Ie.get(s);Ie.delete(s),e({value:new r(a),done:i})}}catch(e){p({error:{message:e.message,stack:e.stack}})}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:Be(e.Deflate,t.deflate,n),Inflate:Be(e.Inflate,t.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((e,t)=>e.onData=t));self.Deflate=e,self.Inflate=t}}();
|
|
1
|
+
!function(){"use strict";const{Array:e,Object:t,Math:n,Error:s,Uint8Array:r,Uint16Array:a,Uint32Array:i,Int32Array:o,DataView:c,Promise:l,TextEncoder:h,crypto:u,postMessage:p,TransformStream:f,ReadableStream:d,WritableStream:g,CompressionStream:w,DecompressionStream:y}=globalThis,_=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;_[e]=t}class m{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^_[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class b extends f{constructor(){super({start(){this.crc32=new m},transform(e){this.crc32.append(e)},flush(e){const t=new r(4);new c(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}const k={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=k.getPartial(n);return 32===s?e.concat(t):k._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+k.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const s=(e=e.slice(0,n.ceil(t/32))).length;return t&=31,s>0&&t&&(e[s-1]=k.partial(t,e[s-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>n.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=k.getPartial(r);return s.push(k.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},v={bytes:{fromBits(e){const t=k.bitLength(e)/8,n=new r(t);let s;for(let r=0;t>r;r++)0==(3&r)&&(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3==(3&n)&&(t.push(s),s=0);return 3&n&&t.push(k.partial(8*(3&n),s)),t}}},S={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};S.sha1.prototype={blockSize:512,reset(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update(e){const t=this;"string"==typeof e&&(e=v.utf8String.toBits(e));const n=t._buffer=k.concat(t._buffer,e),r=t._length,a=t._length=r+k.bitLength(e);if(a>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t},finalize(){const e=this;let t=e._buffer;const s=e._h;t=k.concat(t,[k.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(n.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),s},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,s)=>e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s,_S:(e,t)=>t<<e|t>>>32-e,_block(t){const s=this,r=s._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let i=r[0],o=r[1],c=r[2],l=r[3],h=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=s._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=s._S(5,i)+s._f(e,o,c,l)+h+a[e]+s._key[n.floor(e/20)]|0;h=l,l=c,c=s._S(30,o),o=i,i=t}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+h|0}};const z={getRandomValues(e){const t=new i(e.buffer),s=e=>{let t=987654321;const s=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&s,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&s)&s)/4294967296+.5)*(n.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=s(4294967296*(r||n.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},T={importKey:e=>new T.hmacSha1(v.bytes.toBits(e)),pbkdf2(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const a=1+(r>>5)<<2;let i,o,l,h,u;const p=new ArrayBuffer(a),f=new c(p);let d=0;const g=k;for(t=v.bytes.toBits(t),u=1;(a||1)>d;u++){for(i=o=e.encrypt(g.concat(t,[u])),l=1;n>l;l++)for(o=e.encrypt(o),h=0;h<o.length;h++)i[h]^=o[h];for(l=0;(a||1)>d&&l<i.length;l++)f.setInt32(d,i[l]),d+=4}return p.slice(0,r/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=S.sha1,s=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},I=void 0!==u&&"function"==typeof u.getRandomValues,C="Invalid password";function D(e){return I?u.getRandomValues(e):z.getRandomValues(e)}const R=16,A={name:"PBKDF2"},V=t.assign({hash:{name:"HMAC"}},A),q=t.assign({iterations:1e3,hash:{name:"SHA-1"}},A),B=["deriveBits"],H=[8,12,16],K=[16,24,32],x=10,E=[0,0,0,0],W="undefined",M="function",P=typeof u!=W,U=P&&typeof u.subtle!=W,L=P&&U&&typeof u.subtle.importKey==M,N=P&&U&&typeof u.subtle.deriveBits==M,F=v.bytes,G=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],r=t._tables[1],a=e.length;let i,o,c,l=1;if(4!==a&&6!==a&&8!==a)throw new s("invalid aes key size");for(t._key=[o=e.slice(0),c=[]],i=a;4*a+28>i;i++){let e=o[i-1];(i%a==0||8===a&&i%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],i%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),o[i]=o[i-a]^e}for(let e=0;i;e++,i--){const t=o[3&e?i:i-4];c[e]=4>=i||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let i,o,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let h=i=0;!n[h];h^=o||1,i=a[i]||1){let a=i^i<<1^i<<2^i<<3^i<<4;a=a>>8^255&a^99,n[h]=a,s[a]=h,l=r[c=r[o=r[h]]];let u=16843009*l^65537*c^257*o^16843008*h,p=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][h]=p=p<<24^p>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this._key[t],r=n.length/4-2,a=[0,0,0,0],i=this._tables[t],o=i[0],c=i[1],l=i[2],h=i[3],u=i[4];let p,f,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],_=e[t?1:3]^n[3],m=4;for(let e=0;r>e;e++)p=o[g>>>24]^c[w>>16&255]^l[y>>8&255]^h[255&_]^n[m],f=o[w>>>24]^c[y>>16&255]^l[_>>8&255]^h[255&g]^n[m+1],d=o[y>>>24]^c[_>>16&255]^l[g>>8&255]^h[255&w]^n[m+2],_=o[_>>>24]^c[g>>16&255]^l[w>>8&255]^h[255&y]^n[m+3],m+=4,g=p,w=f,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=u[g>>>24]<<24^u[w>>16&255]<<16^u[y>>8&255]<<8^u[255&_]^n[m++],p=g,g=w,w=y,y=_,_=p;return a}},O=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=k.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return k.clamp(t,r)}},X=T.hmacSha1;class j extends f{constructor(n,a,i){let o;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,signed:a,strength:i-1,pending:new r})},async transform(t,n){const a=this;if(a.password){const n=a.password;a.password=null;const r=$(t,0,H[a.strength]+2);await(async(e,t,n)=>{await Y(e,n,$(t,0,H[e.strength]));const r=$(t,H[e.strength]),a=e.keys.passwordVerification;if(a[0]!=r[0]||a[1]!=r[1])throw new s(C)})(a,r,n),a.ctr=new O(new G(a.keys.key),e.from(E)),a.hmac=new X(a.keys.authentication),t=$(t,H[a.strength]+2),a.resolveReady()}else await a.ready;const i=new r(t.length-x-(t.length-x)%R);n.enqueue(Q(a,t,i,0,x,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,s=$(n,0,n.length-x),a=$(n,n.length-x);let i=new r;if(s.length){const e=te(F,s);t.hmac.update(e);const n=t.ctr.update(e);i=ee(F,n)}if(o.valid=!0,t.signed){const e=$(ee(F,t.hmac.digest()),0,x);for(let t=0;x>t;t++)e[t]!=a[t]&&(o.valid=!1)}e.enqueue(i)}}),o=this}}class J extends f{constructor(n,s){let a;super({start(){t.assign(this,{ready:new l((e=>this.resolveReady=e)),password:n,strength:s-1,pending:new r})},async transform(t,n){const s=this;let a=new r;if(s.password){const t=s.password;s.password=null,a=await(async(e,t)=>{const n=D(new r(H[e.strength]));return await Y(e,t,n),Z(n,e.keys.passwordVerification)})(s,t),s.ctr=new O(new G(s.keys.key),e.from(E)),s.hmac=new X(s.keys.authentication),s.resolveReady()}else await s.ready;const i=new r(a.length+t.length-t.length%R);i.set(a,0),n.enqueue(Q(s,t,i,a.length,0))},async flush(e){const t=this;await t.ready;let n=new r;if(t.pending.length){const e=t.ctr.update(te(F,t.pending));t.hmac.update(e),n=ee(F,e)}a.signature=ee(F,t.hmac.digest()).slice(0,x),e.enqueue(Z(n,a.signature))}}),a=this}}function Q(e,t,n,s,a,i){const o=t.length-a;let c;for(e.pending.length&&(t=Z(e.pending,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new r(t)).set(n,0)}return e})(n,o-o%R)),c=0;o-R>=c;c+=R){const r=te(F,$(t,c,c+R));i&&e.hmac.update(r);const a=e.ctr.update(r);i||e.hmac.update(a),n.set(ee(F,a),c+s)}return e.pending=$(t,c),n}async function Y(e,n,s){const a=(e=>{if(void 0===h){const t=new r((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new h).encode(e)})(n),i=await((e,t,n,s,r)=>L?u.subtle.importKey("raw",t,n,!1,r):T.importKey(t))(0,a,V,0,B),o=await(async(e,t,n)=>N?await u.subtle.deriveBits(e,t,n):T.pbkdf2(t,e.salt,q.iterations,n))(t.assign({salt:s},q),i,8*(2*K[e.strength]+2)),c=new r(o);e.keys={key:te(F,$(c,0,K[e.strength])),authentication:te(F,$(c,K[e.strength],2*K[e.strength])),passwordVerification:$(c,2*K[e.strength])}}function Z(e,t){let n=e;return e.length+t.length&&(n=new r(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $(e,t,n){return e.subarray(t,n)}function ee(e,t){return e.fromBits(t)}function te(e,t){return e.toBits(t)}class ne extends f{constructor(e,n){let r;super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;if(n.password){const t=re(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(C);e=e.subarray(12)}t.enqueue(re(n,e))},flush(){r.valid=!0}}),r=this}}class se extends f{constructor(e,n){super({start(){t.assign(this,{password:e,passwordVerification:n}),ie(this,e)},transform(e,t){const n=this;let s,a;if(n.password){n.password=null;const t=D(new r(12));t[11]=n.passwordVerification,s=new r(e.length+t.length),s.set(ae(n,t),0),a=12}else s=new r(e.length),a=0;s.set(ae(n,e),a),t.enqueue(s)},flush(){}})}}function re(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,n[s]);return n}function ae(e,t){const n=new r(t.length);for(let s=0;s<t.length;s++)n[s]=ce(e)^t[s],oe(e,t[s]);return n}function ie(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new m(e.keys[0]),e.crcKey2=new m(e.keys[2]);for(let n=0;n<t.length;n++)oe(e,t.charCodeAt(n))}function oe(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=he(e.keys[1]+le(e.keys[0])),e.keys[1]=he(n.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function ce(e){const t=2|e.keys[2];return le(n.imul(t,1^t)>>>8)}function le(e){return 255&e}function he(e){return 4294967295&e}class ue extends f{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}const pe="Invalid signature",fe="deflate-raw",de="undefined",ge=typeof w==de,we=typeof y==de;let ye=!0,_e=!0;class me extends f{constructor(e,t,{chunkSize:n},...s){super({},...s);const{compressed:r,encrypted:a,useCompressionStream:i,password:o,passwordVerification:l,encryptionStrength:h,zipCrypto:u,signed:p,level:f}=t,d=this;let g,y,_=ve(super.readable);if(a&&!u||!p||([_,g]=_.tee(),g=g.pipeThrough(new b)),r)if(void 0!==i&&!i||ge&&!_e)_=ke(e,_,{chunkSize:n,level:f});else try{_=_.pipeThrough(new w(fe))}catch(t){_e=!1,_=ke(e,_,{chunkSize:n,level:f})}a&&(u?_=_.pipeThrough(new se(o,l)):(y=new J(o,h),_=_.pipeThrough(y))),Se(d,_,(async()=>{let e;a&&!u&&(e=y.signature),a&&!u||!p||(e=await g.getReader().read(),e=new c(e.value.buffer).getUint32(0)),d.signature=e}))}}class be extends f{constructor(e,t,{chunkSize:n},...r){super({},...r);const{zipCrypto:a,encrypted:i,password:o,passwordVerification:l,signed:h,encryptionStrength:u,compressed:p,useCompressionStream:f}=t;let d,g,w=ve(super.readable);if(i&&(a?w=w.pipeThrough(new ne(o,l)):(g=new j(o,h,u),w=w.pipeThrough(g))),p)if(void 0!==f&&!f||we&&!ye)w=ke(e,w,{chunkSize:n});else try{w=w.pipeThrough(new y(fe))}catch(t){ye=!1,w=ke(e,w,{chunkSize:n})}i&&!a||!h||([w,d]=w.tee(),d=d.pipeThrough(new b)),Se(this,w,(async()=>{if(i&&!a&&!g.valid)throw new s(pe);if((!i||a)&&h){const e=await d.getReader().read(),n=new c(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new s(pe)}}))}}function ke(e,t,n){return t.pipeThrough(new ue(e,n))}function ve(e){return e.pipeThrough(new f({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function Se(e,n,s){n=n.pipeThrough(new f({flush:s})),t.defineProperty(e,"readable",{get:()=>n})}const ze="deflate",Te="inflate",Ie="data";class Ce{constructor(e,t,n,s,r){const{codecType:a}=s;async function i(a){const i=new a(e,s,r);await t.pipeThrough(i).pipeThrough(new f({transform(e,t){e&&e.length&&(n.size+=e.length,t.enqueue(e))}})).pipeTo(n,{preventClose:!0,preventAbort:!0});const{size:o,signature:c}=i;return{size:o,signature:c}}a.startsWith(ze)?this.run=()=>i(me):a.startsWith(Te)&&(this.run=()=>i(be))}}const De=new Map,Re=new Map;let Ae,Ve=0;async function qe(e){try{const{options:t,scripts:n,config:s}=e,{codecType:r}=t;let a;n&&n.length&&importScripts.apply(void 0,n),self.initCodec&&self.initCodec(),r.startsWith(ze)?a=self.Deflate:r.startsWith(Te)&&(a=self.Inflate);const i={highWaterMark:1,size:()=>s.chunkSize},o=new d({async pull(e){let t=new l((e=>De.set(Ve,e)));Be({type:"pull",messageId:Ve}),Ve=(Ve+1)%Number.MAX_SAFE_INTEGER;const{value:n,done:s}=await t;e.enqueue(n),s&&e.close()}},i),c=new g({async write(e){let t;const n=new l((e=>t=e));Re.set(Ve,t),Be({type:Ie,data:e,messageId:Ve}),Ve=(Ve+1)%Number.MAX_SAFE_INTEGER,await n}},i);Ae=new Ce(a,o,c,t,s),Be({type:"close",result:await Ae.run()})}catch(e){const{message:t,stack:n}=e;p({error:{message:t,stack:n}})}}function Be(e){if(e.data){let{data:t}=e;if(t&&t.length)try{t=new r(t),e.data=t.buffer,p(e,[e.data])}catch(t){p(e)}else p(e)}else p(e)}function He(e,n,s){return class{constructor(a){const i=this;t.hasOwn(a,"level")&&void 0===a.level&&delete a.level,i.codec=new e(t.assign({},n,a)),s(i.codec,(e=>{if(i.pendingData){const{pendingData:t}=i;i.pendingData=new r(t.length+e.length),t.set(t,0),t.set(e,t.length)}else i.pendingData=new r(e)}))}append(e){return this.codec.push(e),a(this)}flush(){return this.codec.push(new r,!0),a(this)}};function a(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new r}}addEventListener("message",(async e=>{const t=e.data,{type:n,messageId:s,data:a,done:i}=t;try{if("start"==n&&qe(t),n==Ie){const e=De.get(s);De.delete(s),e({value:new r(a),done:i})}if("ack"==n){const e=Re.get(s);Re.delete(s),e()}}catch(e){p({error:{message:e.message,stack:e.stack}})}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:He(e.Deflate,t.deflate,n),Inflate:He(e.Inflate,t.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((e,t)=>e.onData=t));self.Deflate=e,self.Inflate=t}}();
|
package/dist/z-worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";const{Array:e,Object:t,Math:n,Error:i,Uint8Array:a,Uint16Array:r,Uint32Array:s,Int32Array:l,DataView:o,Promise:_,TextEncoder:d,crypto:c,postMessage:u,TransformStream:f,ReadableStream:h,WritableStream:b,CompressionStream:w,DecompressionStream:x}=globalThis,p=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;p[e]=t}class g{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,i=0|e.length;i>n;n++)t=t>>>8^p[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class y extends f{constructor(){super({start(){this.crc32=new g},transform(e){this.crc32.append(e)},flush(e){const t=new a(4);new o(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}const m={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],i=m.getPartial(n);return 32===i?e.concat(t):m._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+m.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const i=(e=e.slice(0,n.ceil(t/32))).length;return t&=31,i>0&&t&&(e[i-1]=m.partial(t,e[i-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>n.round(e/1099511627776)||32,_shiftRight(e,t,n,i){for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(let a=0;a<e.length;a++)i.push(n|e[a]>>>t),n=e[a]<<32-t;const a=e.length?e[e.length-1]:0,r=m.getPartial(a);return i.push(m.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},v={bytes:{fromBits(e){const t=m.bitLength(e)/8,n=new a(t);let i;for(let a=0;t>a;a++)0==(3&a)&&(i=e[a/4]),n[a]=i>>>24,i<<=8;return n},toBits(e){const t=[];let n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],3==(3&n)&&(t.push(i),i=0);return 3&n&&t.push(m.partial(8*(3&n),i)),t}}},k={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};k.sha1.prototype={blockSize:512,reset(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update(e){const t=this;"string"==typeof e&&(e=v.utf8String.toBits(e));const n=t._buffer=m.concat(t._buffer,e),a=t._length,r=t._length=a+m.bitLength(e);if(r>9007199254740991)throw new i("Cannot hash more than 2^53 - 1 bits");const l=new s(n);let o=0;for(let e=t.blockSize+a-(t.blockSize+a&t.blockSize-1);r>=e;e+=t.blockSize)t._block(l.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),t},finalize(){const e=this;let t=e._buffer;const i=e._h;t=m.concat(t,[m.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(n.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),i},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,i)=>e>19?e>39?e>59?e>79?void 0:t^n^i:t&n|t&i|n&i:t^n^i:t&n|~t&i,_S:(e,t)=>t<<e|t>>>32-e,_block(t){const i=this,a=i._h,r=e(80);for(let e=0;16>e;e++)r[e]=t[e];let s=a[0],l=a[1],o=a[2],_=a[3],d=a[4];for(let e=0;79>=e;e++){16>e||(r[e]=i._S(1,r[e-3]^r[e-8]^r[e-14]^r[e-16]));const t=i._S(5,s)+i._f(e,l,o,_)+d+r[e]+i._key[n.floor(e/20)]|0;d=_,_=o,o=i._S(30,l),l=s,s=t}a[0]=a[0]+s|0,a[1]=a[1]+l|0,a[2]=a[2]+o|0,a[3]=a[3]+_|0,a[4]=a[4]+d|0}};const S={getRandomValues(e){const t=new s(e.buffer),i=e=>{let t=987654321;const i=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&i,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&i)&i)/4294967296+.5)*(n.random()>.5?1:-1))};for(let a,r=0;r<e.length;r+=4){const e=i(4294967296*(a||n.random()));a=987654071*e(),t[r/4]=4294967296*e()|0}return e}},z={importKey:e=>new z.hmacSha1(v.bytes.toBits(e)),pbkdf2(e,t,n,a){if(n=n||1e4,0>a||0>n)throw new i("invalid params to pbkdf2");const r=1+(a>>5)<<2;let s,l,_,d,c;const u=new ArrayBuffer(r),f=new o(u);let h=0;const b=m;for(t=v.bytes.toBits(t),c=1;(r||1)>h;c++){for(s=l=e.encrypt(b.concat(t,[c])),_=1;n>_;_++)for(l=e.encrypt(l),d=0;d<l.length;d++)s[d]^=l[d];for(_=0;(r||1)>h&&_<s.length;_++)f.setInt32(h,s[_]),h+=4}return u.slice(0,a/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=k.sha1,i=[[],[]],a=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>a&&(e=n.hash(e));for(let t=0;a>t;t++)i[0][t]=909522486^e[t],i[1][t]=1549556828^e[t];t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new i("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},I=void 0!==c&&"function"==typeof c.getRandomValues,T="Invalid password";function E(e){return I?c.getRandomValues(e):S.getRandomValues(e)}const q=16,C={name:"PBKDF2"},R=t.assign({hash:{name:"HMAC"}},C),A=t.assign({iterations:1e3,hash:{name:"SHA-1"}},C),V=["deriveBits"],B=[8,12,16],H=[16,24,32],D=10,K=[0,0,0,0],P="undefined",W="function",U=typeof c!=P,M=U&&typeof c.subtle!=P,L=U&&M&&typeof c.subtle.importKey==W,j=U&&M&&typeof c.subtle.deriveBits==W,F=v.bytes,N=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],a=t._tables[1],r=e.length;let s,l,o,_=1;if(4!==r&&6!==r&&8!==r)throw new i("invalid aes key size");for(t._key=[l=e.slice(0),o=[]],s=r;4*r+28>s;s++){let e=l[s-1];(s%r==0||8===r&&s%r==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],s%r==0&&(e=e<<8^e>>>24^_<<24,_=_<<1^283*(_>>7))),l[s]=l[s-r]^e}for(let e=0;s;e++,s--){const t=l[3&e?s:s-4];o[e]=4>=s||4>e?t:a[0][n[t>>>24]]^a[1][n[t>>16&255]]^a[2][n[t>>8&255]]^a[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],a=[],r=[];let s,l,o,_;for(let e=0;256>e;e++)r[(a[e]=e<<1^283*(e>>7))^e]=e;for(let d=s=0;!n[d];d^=l||1,s=r[s]||1){let r=s^s<<1^s<<2^s<<3^s<<4;r=r>>8^255&r^99,n[d]=r,i[r]=d,_=a[o=a[l=a[d]]];let c=16843009*_^65537*o^257*l^16843008*d,u=257*a[r]^16843008*r;for(let n=0;4>n;n++)e[n][d]=u=u<<24^u>>>8,t[n][r]=c=c<<24^c>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new i("invalid aes block size");const n=this._key[t],a=n.length/4-2,r=[0,0,0,0],s=this._tables[t],l=s[0],o=s[1],_=s[2],d=s[3],c=s[4];let u,f,h,b=e[0]^n[0],w=e[t?3:1]^n[1],x=e[2]^n[2],p=e[t?1:3]^n[3],g=4;for(let e=0;a>e;e++)u=l[b>>>24]^o[w>>16&255]^_[x>>8&255]^d[255&p]^n[g],f=l[w>>>24]^o[x>>16&255]^_[p>>8&255]^d[255&b]^n[g+1],h=l[x>>>24]^o[p>>16&255]^_[b>>8&255]^d[255&w]^n[g+2],p=l[p>>>24]^o[b>>16&255]^_[w>>8&255]^d[255&x]^n[g+3],g+=4,b=u,w=f,x=h;for(let e=0;4>e;e++)r[t?3&-e:e]=c[b>>>24]<<24^c[w>>16&255]<<16^c[x>>8&255]<<8^c[255&p]^n[g++],u=b,b=w,w=x,x=p,p=u;return r}},G=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];const a=m.bitLength(t);for(let a=0;i>a;a+=4){this.incCounter(n);const i=e.encrypt(n);t[a]^=i[0],t[a+1]^=i[1],t[a+2]^=i[2],t[a+3]^=i[3]}return m.clamp(t,a)}},O=z.hmacSha1;class X extends f{constructor(n,r,s){let l;super({start(){t.assign(this,{ready:new _((e=>this.resolveReady=e)),password:n,signed:r,strength:s-1,pending:new a})},async transform(t,n){const r=this;if(r.password){const n=r.password;r.password=null;const a=$(t,0,B[r.strength]+2);await(async(e,t,n)=>{await Y(e,n,$(t,0,B[e.strength]));const a=$(t,B[e.strength]),r=e.keys.passwordVerification;if(r[0]!=a[0]||r[1]!=a[1])throw new i(T)})(r,a,n),r.ctr=new G(new N(r.keys.key),e.from(K)),r.hmac=new O(r.keys.authentication),t=$(t,B[r.strength]+2),r.resolveReady()}else await r.ready;const s=new a(t.length-D-(t.length-D)%q);n.enqueue(Q(r,t,s,0,D,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,i=$(n,0,n.length-D),r=$(n,n.length-D);let s=new a;if(i.length){const e=te(F,i);t.hmac.update(e);const n=t.ctr.update(e);s=ee(F,n)}if(l.valid=!0,t.signed){const e=$(ee(F,t.hmac.digest()),0,D);for(let t=0;D>t;t++)e[t]!=r[t]&&(l.valid=!1)}e.enqueue(s)}}),l=this}}class J extends f{constructor(n,i){let r;super({start(){t.assign(this,{ready:new _((e=>this.resolveReady=e)),password:n,strength:i-1,pending:new a})},async transform(t,n){const i=this;let r=new a;if(i.password){const t=i.password;i.password=null,r=await(async(e,t)=>{const n=E(new a(B[e.strength]));return await Y(e,t,n),Z(n,e.keys.passwordVerification)})(i,t),i.ctr=new G(new N(i.keys.key),e.from(K)),i.hmac=new O(i.keys.authentication),i.resolveReady()}else await i.ready;const s=new a(r.length+t.length-t.length%q);s.set(r,0),n.enqueue(Q(i,t,s,r.length,0))},async flush(e){const t=this;await t.ready;let n=new a;if(t.pending.length){const e=t.ctr.update(te(F,t.pending));t.hmac.update(e),n=ee(F,e)}r.signature=ee(F,t.hmac.digest()).slice(0,D),e.enqueue(Z(n,r.signature))}}),r=this}}function Q(e,t,n,i,r,s){const l=t.length-r;let o;for(e.pending.length&&(t=Z(e.pending,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new a(t)).set(n,0)}return e})(n,l-l%q)),o=0;l-q>=o;o+=q){const a=te(F,$(t,o,o+q));s&&e.hmac.update(a);const r=e.ctr.update(a);s||e.hmac.update(r),n.set(ee(F,r),o+i)}return e.pending=$(t,o),n}async function Y(e,n,i){const r=(e=>{if(void 0===d){const t=new a((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new d).encode(e)})(n),s=await((e,t,n,i,a)=>L?c.subtle.importKey("raw",t,n,!1,a):z.importKey(t))(0,r,R,0,V),l=await(async(e,t,n)=>j?await c.subtle.deriveBits(e,t,n):z.pbkdf2(t,e.salt,A.iterations,n))(t.assign({salt:i},A),s,8*(2*H[e.strength]+2)),o=new a(l);e.keys={key:te(F,$(o,0,H[e.strength])),authentication:te(F,$(o,H[e.strength],2*H[e.strength])),passwordVerification:$(o,2*H[e.strength])}}function Z(e,t){let n=e;return e.length+t.length&&(n=new a(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $(e,t,n){return e.subarray(t,n)}function ee(e,t){return e.fromBits(t)}function te(e,t){return e.toBits(t)}class ne extends f{constructor(e,n){let a;super({start(){t.assign(this,{password:e,passwordVerification:n}),se(this,e)},transform(e,t){const n=this;if(n.password){const t=ae(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new i(T);e=e.subarray(12)}t.enqueue(ae(n,e))},flush(){a.valid=!0}}),a=this}}class ie extends f{constructor(e,n){super({start(){t.assign(this,{password:e,passwordVerification:n}),se(this,e)},transform(e,t){const n=this;let i,r;if(n.password){n.password=null;const t=E(new a(12));t[11]=n.passwordVerification,i=new a(e.length+t.length),i.set(re(n,t),0),r=12}else i=new a(e.length),r=0;i.set(re(n,e),r),t.enqueue(i)},flush(){}})}}function ae(e,t){const n=new a(t.length);for(let i=0;i<t.length;i++)n[i]=oe(e)^t[i],le(e,n[i]);return n}function re(e,t){const n=new a(t.length);for(let i=0;i<t.length;i++)n[i]=oe(e)^t[i],le(e,t[i]);return n}function se(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new g(e.keys[0]),e.crcKey2=new g(e.keys[2]);for(let n=0;n<t.length;n++)le(e,t.charCodeAt(n))}function le(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=de(e.keys[1]+_e(e.keys[0])),e.keys[1]=de(n.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function oe(e){const t=2|e.keys[2];return _e(n.imul(t,1^t)>>>8)}function _e(e){return 255&e}function de(e){return 4294967295&e}class ce extends f{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}const ue="Invalid signature",fe="deflate-raw",he="undefined",be=typeof w==he,we=typeof x==he;let xe=!0,pe=!0;class ge extends f{constructor(e,t,{chunkSize:n},...i){super({},...i);const{compressed:a,encrypted:r,useCompressionStream:s,password:l,passwordVerification:_,encryptionStrength:d,zipCrypto:c,signed:u,level:f}=t,h=this;let b,x,p=ve(super.readable);if(r&&!c||!u||([p,b]=p.tee(),b=b.pipeThrough(new y)),a)if(void 0!==s&&!s||be&&!pe)p=me(e,p,{chunkSize:n,level:f});else try{p=p.pipeThrough(new w(fe))}catch(t){pe=!1,p=me(e,p,{chunkSize:n,level:f})}r&&(c?p=p.pipeThrough(new ie(l,_)):(x=new J(l,d),p=p.pipeThrough(x))),ke(h,p,(async()=>{let e;r&&!c&&(e=x.signature),r&&!c||!u||(e=await b.getReader().read(),e=new o(e.value.buffer).getUint32(0)),h.signature=e}))}}class ye extends f{constructor(e,t,{chunkSize:n},...a){super({},...a);const{zipCrypto:r,encrypted:s,password:l,passwordVerification:_,signed:d,encryptionStrength:c,compressed:u,useCompressionStream:f}=t;let h,b,w=ve(super.readable);if(s&&(r?w=w.pipeThrough(new ne(l,_)):(b=new X(l,d,c),w=w.pipeThrough(b))),u)if(void 0!==f&&!f||we&&!xe)w=me(e,w,{chunkSize:n});else try{w=w.pipeThrough(new x(fe))}catch(t){xe=!1,w=me(e,w,{chunkSize:n})}s&&!r||!d||([w,h]=w.tee(),h=h.pipeThrough(new y)),ke(this,w,(async()=>{if(s&&!r&&!b.valid)throw new i(ue);if((!s||r)&&d){const e=await h.getReader().read(),n=new o(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new i(ue)}}))}}function me(e,t,n){return t.pipeThrough(new ce(e,n))}function ve(e){return e.pipeThrough(new f({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ke(e,n,i){e.size=0,n=n.pipeThrough(new f({transform(t,n){t&&t.length&&(e.size+=t.length,n.enqueue(t))},flush:i})),t.defineProperty(e,"readable",{get:()=>n})}const Se="deflate",ze="inflate",Ie="data";class Te{constructor(e,t,n,i,a){const{codecType:r}=i;async function s(r){const s=new r(e,i,a);await t.pipeThrough(s).pipeTo(n,{preventClose:!0,preventAbort:!0});const{size:l,signature:o}=s;return{size:l,signature:o}}r.startsWith(Se)?this.run=()=>s(ge):r.startsWith(ze)&&(this.run=()=>s(ye))}}const Ee=new Map;let qe,Ce=0;async function Re(e){try{const{options:t,scripts:n,config:i}=e,{codecType:a}=t;let r;n&&n.length&&importScripts.apply(void 0,n),self.initCodec&&self.initCodec(),a.startsWith(Se)?r=self.Deflate:a.startsWith(ze)&&(r=self.Inflate);const s={highWaterMark:1,size:()=>i.chunkSize},l=new h({async pull(e){let t=new _(((e,t)=>Ee.set(Ce,{resolve:e,reject:t})));Ae({type:"pull",messageId:Ce}),Ce=(Ce+1)%Number.MAX_SAFE_INTEGER;const{value:n,done:i}=await t;e.enqueue(n),i&&e.close()}},s),o=new b({write(e){Ae({type:Ie,data:e})}},s);qe=new Te(r,l,o,t,i),Ae({type:"close",result:await qe.run()})}catch(e){const{message:t,stack:n}=e;u({error:{message:t,stack:n}})}}function Ae(e){if(e.data){let{data:t}=e;if(t&&t.length)try{t=new a(t),e.data=t.buffer,u(e,[e.data])}catch(t){u(e)}else u(e)}else u(e)}addEventListener("message",(async e=>{const t=e.data,{type:n,messageId:i,data:r,done:s}=t;try{if("start"==n&&Re(t),n==Ie){const{resolve:e}=Ee.get(i);Ee.delete(i),e({value:new a(r),done:s})}}catch(e){u({error:{message:e.message,stack:e.stack}})}}));const Ve=(()=>{const t=-2;function s(t){return l(t.map((([t,n])=>new e(t).fill(n,0,t))))}function l(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?l(n):n)),[])}const o=[0,1,2,3].concat(...s([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function _(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.build_tree=i=>{const a=e.dyn_tree,r=e.stat_desc.static_tree,s=e.stat_desc.elems;let l,o,_,d=-1;for(i.heap_len=0,i.heap_max=573,l=0;s>l;l++)0!==a[2*l]?(i.heap[++i.heap_len]=d=l,i.depth[l]=0):a[2*l+1]=0;for(;2>i.heap_len;)_=i.heap[++i.heap_len]=2>d?++d:0,a[2*_]=1,i.depth[_]=0,i.opt_len--,r&&(i.static_len-=r[2*_+1]);for(e.max_code=d,l=n.floor(i.heap_len/2);l>=1;l--)i.pqdownheap(a,l);_=s;do{l=i.heap[1],i.heap[1]=i.heap[i.heap_len--],i.pqdownheap(a,1),o=i.heap[1],i.heap[--i.heap_max]=l,i.heap[--i.heap_max]=o,a[2*_]=a[2*l]+a[2*o],i.depth[_]=n.max(i.depth[l],i.depth[o])+1,a[2*l+1]=a[2*o+1]=_,i.heap[1]=_++,i.pqdownheap(a,1)}while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],(t=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,r=e.stat_desc.extra_base,s=e.stat_desc.max_length;let l,o,_,d,c,u,f=0;for(d=0;15>=d;d++)t.bl_count[d]=0;for(n[2*t.heap[t.heap_max]+1]=0,l=t.heap_max+1;573>l;l++)o=t.heap[l],d=n[2*n[2*o+1]+1]+1,d>s&&(d=s,f++),n[2*o+1]=d,o>e.max_code||(t.bl_count[d]++,c=0,r>o||(c=a[o-r]),u=n[2*o],t.opt_len+=u*(d+c),i&&(t.static_len+=u*(i[2*o+1]+c)));if(0!==f){do{for(d=s-1;0===t.bl_count[d];)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[s]--,f-=2}while(f>0);for(d=s;0!==d;d--)for(o=t.bl_count[d];0!==o;)_=t.heap[--l],_>e.max_code||(n[2*_+1]!=d&&(t.opt_len+=(d-n[2*_+1])*n[2*_],n[2*_+1]=d),o--)}})(i),((e,n,i)=>{const a=[];let r,s,l,o=0;for(r=1;15>=r;r++)a[r]=o=o+i[r-1]<<1;for(s=0;n>=s;s++)l=e[2*s+1],0!==l&&(e[2*s]=t(a[l]++,l))})(a,e.max_code,i.bl_count)}}function d(e,t,n,i,a){const r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=a}_._length_code=[0,1,2,3,4,5,6,7].concat(...s([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),_.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],_.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],_.d_code=e=>256>e?o[e]:o[256+(e>>>7)],_.extra_lbits=[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],_.extra_dbits=[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],_.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],_.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const c=s([[144,8],[112,9],[24,7],[8,8]]);d.static_ltree=l([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,c[t]])));const u=s([[30,5]]);function f(e,t,n,i,a){const r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=a}d.static_dtree=l([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,u[t]]))),d.static_l_desc=new d(d.static_ltree,_.extra_lbits,257,286,15),d.static_d_desc=new d(d.static_dtree,_.extra_dbits,0,30,15),d.static_bl_desc=new d(null,_.extra_blbits,0,19,7);const h=[new f(0,0,0,0,0),new f(4,4,8,4,1),new f(4,5,16,8,1),new f(4,6,32,32,1),new f(4,4,16,16,2),new f(8,16,32,32,2),new f(8,16,128,128,2),new f(8,32,128,256,2),new f(32,128,258,1024,2),new f(32,258,258,4096,2)],b=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],w=113,x=666,p=262;function g(e,t,n,i){const a=e[2*t],r=e[2*n];return r>a||a==r&&i[t]<=i[n]}function y(){const e=this;let i,s,l,o,c,u,f,y,m,v,k,S,z,I,T,E,q,C,R,A,V,B,H,D,K,P,W,U,M,L,j,F,N;const G=new _,O=new _,X=new _;let J,Q,Y,Z,$,ee;function te(){let t;for(t=0;286>t;t++)j[2*t]=0;for(t=0;30>t;t++)F[2*t]=0;for(t=0;19>t;t++)N[2*t]=0;j[512]=1,e.opt_len=e.static_len=0,Q=Y=0}function ne(e,t){let n,i=-1,a=e[1],r=0,s=7,l=4;0===a&&(s=138,l=3),e[2*(t+1)+1]=65535;for(let o=0;t>=o;o++)n=a,a=e[2*(o+1)+1],++r<s&&n==a||(l>r?N[2*n]+=r:0!==n?(n!=i&&N[2*n]++,N[32]++):r>10?N[36]++:N[34]++,r=0,i=n,0===a?(s=138,l=3):n==a?(s=6,l=3):(s=7,l=4))}function ie(t){e.pending_buf[e.pending++]=t}function ae(e){ie(255&e),ie(e>>>8&255)}function re(e,t){let n;const i=t;ee>16-i?(n=e,$|=n<<ee&65535,ae($),$=n>>>16-ee,ee+=i-16):($|=e<<ee&65535,ee+=i)}function se(e,t){const n=2*e;re(65535&t[n],65535&t[n+1])}function le(e,t){let n,i,a=-1,r=e[1],s=0,l=7,o=4;for(0===r&&(l=138,o=3),n=0;t>=n;n++)if(i=r,r=e[2*(n+1)+1],++s>=l||i!=r){if(o>s)do{se(i,N)}while(0!=--s);else 0!==i?(i!=a&&(se(i,N),s--),se(16,N),re(s-3,2)):s>10?(se(18,N),re(s-11,7)):(se(17,N),re(s-3,3));s=0,a=i,0===r?(l=138,o=3):i==r?(l=6,o=3):(l=7,o=4)}}function oe(){16==ee?(ae($),$=0,ee=0):8>ee||(ie(255&$),$>>>=8,ee-=8)}function _e(t,i){let a,r,s;if(e.dist_buf[Q]=t,e.lc_buf[Q]=255&i,Q++,0===t?j[2*i]++:(Y++,t--,j[2*(_._length_code[i]+256+1)]++,F[2*_.d_code(t)]++),0==(8191&Q)&&W>2){for(a=8*Q,r=V-q,s=0;30>s;s++)a+=F[2*s]*(5+_.extra_dbits[s]);if(a>>>=3,Y<n.floor(Q/2)&&a<n.floor(r/2))return!0}return Q==J-1}function de(t,n){let i,a,r,s,l=0;if(0!==Q)do{i=e.dist_buf[l],a=e.lc_buf[l],l++,0===i?se(a,t):(r=_._length_code[a],se(r+256+1,t),s=_.extra_lbits[r],0!==s&&(a-=_.base_length[r],re(a,s)),i--,r=_.d_code(i),se(r,n),s=_.extra_dbits[r],0!==s&&(i-=_.base_dist[r],re(i,s)))}while(Q>l);se(256,t),Z=t[513]}function ce(){ee>8?ae($):ee>0&&ie(255&$),$=0,ee=0}function ue(t,n,i){re(0+(i?1:0),3),((t,n)=>{ce(),Z=8,ae(n),ae(~n),e.pending_buf.set(y.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function fe(t){((t,n,i)=>{let a,r,s=0;W>0?(G.build_tree(e),O.build_tree(e),s=(()=>{let t;for(ne(j,G.max_code),ne(F,O.max_code),X.build_tree(e),t=18;t>=3&&0===N[2*_.bl_order[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r>a||(a=r)):a=r=n+5,n+4>a||-1==t?r==a?(re(2+(i?1:0),3),de(d.static_ltree,d.static_dtree)):(re(4+(i?1:0),3),((e,t,n)=>{let i;for(re(e-257,5),re(t-1,5),re(n-4,4),i=0;n>i;i++)re(N[2*_.bl_order[i]+1],3);le(j,e-1),le(F,t-1)})(G.max_code+1,O.max_code+1,s+1),de(j,F)):ue(t,n,i),te(),i&&ce()})(0>q?-1:q,V-q,t),q=V,i.flush_pending()}function he(){let e,t,n,a;do{if(a=m-H-V,0===a&&0===V&&0===H)a=c;else if(-1==a)a--;else if(V>=c+c-p){y.set(y.subarray(c,c+c),0),B-=c,V-=c,q-=c,e=z,n=e;do{t=65535&k[--n],k[n]=c>t?0:t-c}while(0!=--e);e=c,n=e;do{t=65535&v[--n],v[n]=c>t?0:t-c}while(0!=--e);a+=c}if(0===i.avail_in)return;e=i.read_buf(y,V+H,a),H+=e,3>H||(S=255&y[V],S=(S<<E^255&y[V+1])&T)}while(p>H&&0!==i.avail_in)}function be(e){let t,n,i=K,a=V,r=D;const s=V>c-p?V-(c-p):0;let l=L;const o=f,_=V+258;let d=y[a+r-1],u=y[a+r];M>D||(i>>=2),l>H&&(l=H);do{if(t=e,y[t+r]==u&&y[t+r-1]==d&&y[t]==y[a]&&y[++t]==y[a+1]){a+=2,t++;do{}while(y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&_>a);if(n=258-(_-a),a=_-258,n>r){if(B=e,r=n,n>=l)break;d=y[a+r-1],u=y[a+r]}}}while((e=65535&v[e&o])>s&&0!=--i);return r>H?H:r}e.depth=[],e.bl_count=[],e.heap=[],j=[],F=[],N=[],e.pqdownheap=(t,n)=>{const i=e.heap,a=i[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&g(t,i[r+1],i[r],e.depth)&&r++,!g(t,a,i[r],e.depth));)i[n]=i[r],n=r,r<<=1;i[n]=a},e.deflateInit=(i,_,b,x,p,g)=>(x||(x=8),p||(p=8),g||(g=0),i.msg=null,-1==_&&(_=6),1>p||p>9||8!=x||9>b||b>15||0>_||_>9||0>g||g>2?t:(i.dstate=e,u=b,c=1<<u,f=c-1,I=p+7,z=1<<I,T=z-1,E=n.floor((I+3-1)/3),y=new a(2*c),v=[],k=[],J=1<<p+6,e.pending_buf=new a(4*J),l=4*J,e.dist_buf=new r(J),e.lc_buf=new a(J),W=_,U=g,(t=>(t.total_in=t.total_out=0,t.msg=null,e.pending=0,e.pending_out=0,s=w,o=0,G.dyn_tree=j,G.stat_desc=d.static_l_desc,O.dyn_tree=F,O.stat_desc=d.static_d_desc,X.dyn_tree=N,X.stat_desc=d.static_bl_desc,$=0,ee=0,Z=8,te(),(()=>{m=2*c,k[z-1]=0;for(let e=0;z-1>e;e++)k[e]=0;P=h[W].max_lazy,M=h[W].good_length,L=h[W].nice_length,K=h[W].max_chain,V=0,q=0,H=0,C=D=2,A=0,S=0})(),0))(i))),e.deflateEnd=()=>42!=s&&s!=w&&s!=x?t:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,k=null,v=null,y=null,e.dstate=null,s==w?-3:0),e.deflateParams=(e,n,i)=>{let a=0;return-1==n&&(n=6),0>n||n>9||0>i||i>2?t:(h[W].func!=h[n].func&&0!==e.total_in&&(a=e.deflate(1)),W!=n&&(W=n,P=h[W].max_lazy,M=h[W].good_length,L=h[W].nice_length,K=h[W].max_chain),U=i,a)},e.deflateSetDictionary=(e,n,i)=>{let a,r=i,l=0;if(!n||42!=s)return t;if(3>r)return 0;for(r>c-p&&(r=c-p,l=i-r),y.set(n.subarray(l,l+r),0),V=r,q=r,S=255&y[0],S=(S<<E^255&y[1])&T,a=0;r-3>=a;a++)S=(S<<E^255&y[a+2])&T,v[a&f]=k[S],k[S]=a;return 0},e.deflate=(n,a)=>{let r,_,g,m,I;if(a>4||0>a)return t;if(!n.next_out||!n.next_in&&0!==n.avail_in||s==x&&4!=a)return n.msg=b[4],t;if(0===n.avail_out)return n.msg=b[7],-5;var K;if(i=n,m=o,o=a,42==s&&(_=8+(u-8<<4)<<8,g=(W-1&255)>>1,g>3&&(g=3),_|=g<<6,0!==V&&(_|=32),_+=31-_%31,s=w,ie((K=_)>>8&255),ie(255&K)),0!==e.pending){if(i.flush_pending(),0===i.avail_out)return o=-1,0}else if(0===i.avail_in&&m>=a&&4!=a)return i.msg=b[7],-5;if(s==x&&0!==i.avail_in)return n.msg=b[7],-5;if(0!==i.avail_in||0!==H||0!=a&&s!=x){switch(I=-1,h[W].func){case 0:I=(e=>{let t,n=65535;for(n>l-5&&(n=l-5);;){if(1>=H){if(he(),0===H&&0==e)return 0;if(0===H)break}if(V+=H,H=0,t=q+n,(0===V||V>=t)&&(H=V-t,V=t,fe(!1),0===i.avail_out))return 0;if(V-q>=c-p&&(fe(!1),0===i.avail_out))return 0}return fe(4==e),0===i.avail_out?4==e?2:0:4==e?3:1})(a);break;case 1:I=(e=>{let t,n=0;for(;;){if(p>H){if(he(),p>H&&0==e)return 0;if(0===H)break}if(3>H||(S=(S<<E^255&y[V+2])&T,n=65535&k[S],v[V&f]=k[S],k[S]=V),0===n||(V-n&65535)>c-p||2!=U&&(C=be(n)),3>C)t=_e(0,255&y[V]),H--,V++;else if(t=_e(V-B,C-3),H-=C,C>P||3>H)V+=C,C=0,S=255&y[V],S=(S<<E^255&y[V+1])&T;else{C--;do{V++,S=(S<<E^255&y[V+2])&T,n=65535&k[S],v[V&f]=k[S],k[S]=V}while(0!=--C);V++}if(t&&(fe(!1),0===i.avail_out))return 0}return fe(4==e),0===i.avail_out?4==e?2:0:4==e?3:1})(a);break;case 2:I=(e=>{let t,n,a=0;for(;;){if(p>H){if(he(),p>H&&0==e)return 0;if(0===H)break}if(3>H||(S=(S<<E^255&y[V+2])&T,a=65535&k[S],v[V&f]=k[S],k[S]=V),D=C,R=B,C=2,0!==a&&P>D&&c-p>=(V-a&65535)&&(2!=U&&(C=be(a)),5>=C&&(1==U||3==C&&V-B>4096)&&(C=2)),3>D||C>D)if(0!==A){if(t=_e(0,255&y[V-1]),t&&fe(!1),V++,H--,0===i.avail_out)return 0}else A=1,V++,H--;else{n=V+H-3,t=_e(V-1-R,D-3),H-=D-1,D-=2;do{++V>n||(S=(S<<E^255&y[V+2])&T,a=65535&k[S],v[V&f]=k[S],k[S]=V)}while(0!=--D);if(A=0,C=2,V++,t&&(fe(!1),0===i.avail_out))return 0}}return 0!==A&&(t=_e(0,255&y[V-1]),A=0),fe(4==e),0===i.avail_out?4==e?2:0:4==e?3:1})(a)}if(2!=I&&3!=I||(s=x),0==I||2==I)return 0===i.avail_out&&(o=-1),0;if(1==I){if(1==a)re(2,3),se(256,d.static_ltree),oe(),9>1+Z+10-ee&&(re(2,3),se(256,d.static_ltree),oe()),Z=7;else if(ue(0,0,!1),3==a)for(r=0;z>r;r++)k[r]=0;if(i.flush_pending(),0===i.avail_out)return o=-1,0}}return 4!=a?0:1}}function m(){const e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}return m.prototype={deflateInit(e,t){const n=this;return n.dstate=new y,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){const n=this;return n.dstate?n.dstate.deflate(n,e):t},deflateEnd(){const e=this;if(!e.dstate)return t;const n=e.dstate.deflateEnd();return e.dstate=null,n},deflateParams(e,n){const i=this;return i.dstate?i.dstate.deflateParams(i,e,n):t},deflateSetDictionary(e,n){const i=this;return i.dstate?i.dstate.deflateSetDictionary(i,e,n):t},read_buf(e,t,n){const i=this;let a=i.avail_in;return a>n&&(a=n),0===a?0:(i.avail_in-=a,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+a),t),i.next_in_index+=a,i.total_in+=a,a)},flush_pending(){const e=this;let t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,0===e.dstate.pending&&(e.dstate.pending_out=0))}},function(e){const t=new m,r=(s=e&&e.chunkSize?e.chunkSize:65536)+5*(n.floor(s/16383)+1);var s;const l=new a(r);let o=e?e.level:-1;void 0===o&&(o=-1),t.deflateInit(o),t.next_out=l,this.append=(e,n)=>{let s,o,_=0,d=0,c=0;const u=[];if(e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=r,s=t.deflate(0),0!=s)throw new i("deflating: "+t.msg);t.next_out_index&&(t.next_out_index==r?u.push(new a(l)):u.push(l.slice(0,t.next_out_index))),c+=t.next_out_index,n&&t.next_in_index>0&&t.next_in_index!=_&&(n(t.next_in_index),_=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return u.length>1?(o=new a(c),u.forEach((e=>{o.set(e,d),d+=e.length}))):o=u[0]||new a,o}},this.flush=()=>{let e,n,s=0,o=0;const _=[];do{if(t.next_out_index=0,t.avail_out=r,e=t.deflate(4),1!=e&&0!=e)throw new i("deflating: "+t.msg);r-t.avail_out>0&&_.push(l.slice(0,t.next_out_index)),o+=t.next_out_index}while(t.avail_in>0||0===t.avail_out);return t.deflateEnd(),n=new a(o),_.forEach((e=>{n.set(e,s),s+=e.length})),n}}})(),Be=(()=>{const e=-2,t=-3,r=-5,s=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],o=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],_=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],c=[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,112,112],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],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];function h(){let e,n,i,a,s,o;function _(e,n,l,_,d,c,u,f,h,b,w){let x,p,g,y,m,v,k,S,z,I,T,E,q,C,R;I=0,m=l;do{i[e[n+I]]++,I++,m--}while(0!==m);if(i[0]==l)return u[0]=-1,f[0]=0,0;for(S=f[0],v=1;15>=v&&0===i[v];v++);for(k=v,v>S&&(S=v),m=15;0!==m&&0===i[m];m--);for(g=m,S>m&&(S=m),f[0]=S,C=1<<v;m>v;v++,C<<=1)if(0>(C-=i[v]))return t;if(0>(C-=i[m]))return t;for(i[m]+=C,o[1]=v=0,I=1,q=2;0!=--m;)o[q]=v+=i[I],q++,I++;m=0,I=0;do{0!==(v=e[n+I])&&(w[o[v]++]=m),I++}while(++m<l);for(l=o[g],o[0]=m=0,I=0,y=-1,E=-S,s[0]=0,T=0,R=0;g>=k;k++)for(x=i[k];0!=x--;){for(;k>E+S;){if(y++,E+=S,R=g-E,R=R>S?S:R,(p=1<<(v=k-E))>x+1&&(p-=x+1,q=k,R>v))for(;++v<R&&(p<<=1)>i[++q];)p-=i[q];if(R=1<<v,b[0]+R>1440)return t;s[y]=T=b[0],b[0]+=R,0!==y?(o[y]=m,a[0]=v,a[1]=S,v=m>>>E-S,a[2]=T-s[y-1]-v,h.set(a,3*(s[y-1]+v))):u[0]=T}for(a[1]=k-E,l>I?w[I]<_?(a[0]=256>w[I]?0:96,a[2]=w[I++]):(a[0]=c[w[I]-_]+16+64,a[2]=d[w[I++]-_]):a[0]=192,p=1<<k-E,v=m>>>E;R>v;v+=p)h.set(a,3*(T+v));for(v=1<<k-1;0!=(m&v);v>>>=1)m^=v;for(m^=v,z=(1<<E)-1;(m&z)!=o[y];)y--,E-=S,z=(1<<E)-1}return 0!==C&&1!=g?r:0}function h(t){let r;for(e||(e=[],n=[],i=new l(16),a=[],s=new l(15),o=new l(16)),n.length<t&&(n=[]),r=0;t>r;r++)n[r]=0;for(r=0;16>r;r++)i[r]=0;for(r=0;3>r;r++)a[r]=0;s.set(i.subarray(0,15),0),o.set(i.subarray(0,16),0)}this.inflate_trees_bits=(i,a,s,l,o)=>{let d;return h(19),e[0]=0,d=_(i,0,19,19,null,null,s,a,l,e,n),d==t?o.msg="oversubscribed dynamic bit lengths tree":d!=r&&0!==a[0]||(o.msg="incomplete dynamic bit lengths tree",d=t),d},this.inflate_trees_dynamic=(i,a,s,l,o,b,w,x,p)=>{let g;return h(288),e[0]=0,g=_(s,0,i,257,d,c,b,l,x,e,n),0!=g||0===l[0]?(g==t?p.msg="oversubscribed literal/length tree":-4!=g&&(p.msg="incomplete literal/length tree",g=t),g):(h(288),g=_(s,i,a,0,u,f,w,o,x,e,n),0!=g||0===o[0]&&i>257?(g==t?p.msg="oversubscribed distance tree":g==r?(p.msg="incomplete distance tree",g=t):-4!=g&&(p.msg="empty distance tree with lengths",g=t),g):0)}}function b(){const n=this;let i,a,r,l,o=0,_=0,d=0,c=0,u=0,f=0,h=0,b=0,w=0,x=0;function p(e,n,i,a,r,l,o,_){let d,c,u,f,h,b,w,x,p,g,y,m,v,k,S,z;w=_.next_in_index,x=_.avail_in,h=o.bitb,b=o.bitk,p=o.write,g=p<o.read?o.read-p-1:o.end-p,y=s[e],m=s[n];do{for(;20>b;)x--,h|=(255&_.read_byte(w++))<<b,b+=8;if(d=h&y,c=i,u=a,z=3*(u+d),0!==(f=c[z]))for(;;){if(h>>=c[z+1],b-=c[z+1],0!=(16&f)){for(f&=15,v=c[z+2]+(h&s[f]),h>>=f,b-=f;15>b;)x--,h|=(255&_.read_byte(w++))<<b,b+=8;for(d=h&m,c=r,u=l,z=3*(u+d),f=c[z];;){if(h>>=c[z+1],b-=c[z+1],0!=(16&f)){for(f&=15;f>b;)x--,h|=(255&_.read_byte(w++))<<b,b+=8;if(k=c[z+2]+(h&s[f]),h>>=f,b-=f,g-=v,k>p){S=p-k;do{S+=o.end}while(0>S);if(f=o.end-S,v>f){if(v-=f,p-S>0&&f>p-S)do{o.win[p++]=o.win[S++]}while(0!=--f);else o.win.set(o.win.subarray(S,S+f),p),p+=f,S+=f,f=0;S=0}}else S=p-k,p-S>0&&2>p-S?(o.win[p++]=o.win[S++],o.win[p++]=o.win[S++],v-=2):(o.win.set(o.win.subarray(S,S+2),p),p+=2,S+=2,v-=2);if(p-S>0&&v>p-S)do{o.win[p++]=o.win[S++]}while(0!=--v);else o.win.set(o.win.subarray(S,S+v),p),p+=v,S+=v,v=0;break}if(0!=(64&f))return _.msg="invalid distance code",v=_.avail_in-x,v=v>b>>3?b>>3:v,x+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=x,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=p,t;d+=c[z+2],d+=h&s[f],z=3*(u+d),f=c[z]}break}if(0!=(64&f))return 0!=(32&f)?(v=_.avail_in-x,v=v>b>>3?b>>3:v,x+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=x,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=p,1):(_.msg="invalid literal/length code",v=_.avail_in-x,v=v>b>>3?b>>3:v,x+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=x,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=p,t);if(d+=c[z+2],d+=h&s[f],z=3*(u+d),0===(f=c[z])){h>>=c[z+1],b-=c[z+1],o.win[p++]=c[z+2],g--;break}}else h>>=c[z+1],b-=c[z+1],o.win[p++]=c[z+2],g--}while(g>=258&&x>=10);return v=_.avail_in-x,v=v>b>>3?b>>3:v,x+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=x,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=p,0}n.init=(e,t,n,s,o,_)=>{i=0,h=e,b=t,r=n,w=s,l=o,x=_,a=null},n.proc=(n,g,y)=>{let m,v,k,S,z,I,T,E=0,q=0,C=0;for(C=g.next_in_index,S=g.avail_in,E=n.bitb,q=n.bitk,z=n.write,I=z<n.read?n.read-z-1:n.end-z;;)switch(i){case 0:if(I>=258&&S>=10&&(n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,y=p(h,b,r,w,l,x,n,g),C=g.next_in_index,S=g.avail_in,E=n.bitb,q=n.bitk,z=n.write,I=z<n.read?n.read-z-1:n.end-z,0!=y)){i=1==y?7:9;break}d=h,a=r,_=w,i=1;case 1:for(m=d;m>q;){if(0===S)return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);y=0,S--,E|=(255&g.read_byte(C++))<<q,q+=8}if(v=3*(_+(E&s[m])),E>>>=a[v+1],q-=a[v+1],k=a[v],0===k){c=a[v+2],i=6;break}if(0!=(16&k)){u=15&k,o=a[v+2],i=2;break}if(0==(64&k)){d=k,_=v/3+a[v+2];break}if(0!=(32&k)){i=7;break}return i=9,g.msg="invalid literal/length code",y=t,n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);case 2:for(m=u;m>q;){if(0===S)return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);y=0,S--,E|=(255&g.read_byte(C++))<<q,q+=8}o+=E&s[m],E>>=m,q-=m,d=b,a=l,_=x,i=3;case 3:for(m=d;m>q;){if(0===S)return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);y=0,S--,E|=(255&g.read_byte(C++))<<q,q+=8}if(v=3*(_+(E&s[m])),E>>=a[v+1],q-=a[v+1],k=a[v],0!=(16&k)){u=15&k,f=a[v+2],i=4;break}if(0==(64&k)){d=k,_=v/3+a[v+2];break}return i=9,g.msg="invalid distance code",y=t,n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);case 4:for(m=u;m>q;){if(0===S)return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);y=0,S--,E|=(255&g.read_byte(C++))<<q,q+=8}f+=E&s[m],E>>=m,q-=m,i=5;case 5:for(T=z-f;0>T;)T+=n.end;for(;0!==o;){if(0===I&&(z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I&&(n.write=z,y=n.inflate_flush(g,y),z=n.write,I=z<n.read?n.read-z-1:n.end-z,z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I)))return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);n.win[z++]=n.win[T++],I--,T==n.end&&(T=0),o--}i=0;break;case 6:if(0===I&&(z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I&&(n.write=z,y=n.inflate_flush(g,y),z=n.write,I=z<n.read?n.read-z-1:n.end-z,z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I)))return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);y=0,n.win[z++]=c,I--,i=0;break;case 7:if(q>7&&(q-=8,S++,C--),n.write=z,y=n.inflate_flush(g,y),z=n.write,I=z<n.read?n.read-z-1:n.end-z,n.read!=n.write)return n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);i=8;case 8:return y=1,n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);case 9:return y=t,n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y);default:return y=e,n.bitb=E,n.bitk=q,g.avail_in=S,g.total_in+=C-g.next_in_index,g.next_in_index=C,n.write=z,n.inflate_flush(g,y)}},n.free=()=>{}}h.inflate_trees_fixed=(e,t,n,i)=>(e[0]=9,t[0]=5,n[0]=o,i[0]=_,0);const w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function x(n,i){const o=this;let _,d=0,c=0,u=0,f=0;const x=[0],p=[0],g=new b;let y=0,m=new l(4320);const v=new h;o.bitk=0,o.bitb=0,o.win=new a(i),o.end=i,o.read=0,o.write=0,o.reset=(e,t)=>{t&&(t[0]=0),6==d&&g.free(e),d=0,o.bitk=0,o.bitb=0,o.read=o.write=0},o.reset(n,null),o.inflate_flush=(e,t)=>{let n,i,a;return i=e.next_out_index,a=o.read,n=(a>o.write?o.end:o.write)-a,n>e.avail_out&&(n=e.avail_out),0!==n&&t==r&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(o.win.subarray(a,a+n),i),i+=n,a+=n,a==o.end&&(a=0,o.write==o.end&&(o.write=0),n=o.write-a,n>e.avail_out&&(n=e.avail_out),0!==n&&t==r&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(o.win.subarray(a,a+n),i),i+=n,a+=n),e.next_out_index=i,o.read=a,t},o.proc=(n,i)=>{let a,r,l,b,k,S,z,I;for(b=n.next_in_index,k=n.avail_in,r=o.bitb,l=o.bitk,S=o.write,z=S<o.read?o.read-S-1:o.end-S;;){let T,E,q,C,R,A,V,B;switch(d){case 0:for(;3>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}switch(a=7&r,y=1&a,a>>>1){case 0:r>>>=3,l-=3,a=7&l,r>>>=a,l-=a,d=1;break;case 1:T=[],E=[],q=[[]],C=[[]],h.inflate_trees_fixed(T,E,q,C),g.init(T[0],E[0],q[0],0,C[0],0),r>>>=3,l-=3,d=6;break;case 2:r>>>=3,l-=3,d=3;break;case 3:return r>>>=3,l-=3,d=9,n.msg="invalid block type",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i)}break;case 1:for(;32>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if((~r>>>16&65535)!=(65535&r))return d=9,n.msg="invalid stored block lengths",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);c=65535&r,r=l=0,d=0!==c?2:0!==y?7:0;break;case 2:if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);if(0===z&&(S==o.end&&0!==o.read&&(S=0,z=S<o.read?o.read-S-1:o.end-S),0===z&&(o.write=S,i=o.inflate_flush(n,i),S=o.write,z=S<o.read?o.read-S-1:o.end-S,S==o.end&&0!==o.read&&(S=0,z=S<o.read?o.read-S-1:o.end-S),0===z)))return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);if(i=0,a=c,a>k&&(a=k),a>z&&(a=z),o.win.set(n.read_buf(b,a),S),b+=a,k-=a,S+=a,z-=a,0!=(c-=a))break;d=0!==y?7:0;break;case 3:for(;14>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if(u=a=16383&r,(31&a)>29||(a>>5&31)>29)return d=9,n.msg="too many length or distance symbols",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);if(a=258+(31&a)+(a>>5&31),!_||_.length<a)_=[];else for(I=0;a>I;I++)_[I]=0;r>>>=14,l-=14,f=0,d=4;case 4:for(;4+(u>>>10)>f;){for(;3>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}_[w[f++]]=7&r,r>>>=3,l-=3}for(;19>f;)_[w[f++]]=0;if(x[0]=7,a=v.inflate_trees_bits(_,x,p,m,n),0!=a)return(i=a)==t&&(_=null,d=9),o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);f=0,d=5;case 5:for(;a=u,258+(31&a)+(a>>5&31)>f;){let e,c;for(a=x[0];a>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if(a=m[3*(p[0]+(r&s[a]))+1],c=m[3*(p[0]+(r&s[a]))+2],16>c)r>>>=a,l-=a,_[f++]=c;else{for(I=18==c?7:c-14,e=18==c?11:3;a+I>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if(r>>>=a,l-=a,e+=r&s[I],r>>>=I,l-=I,I=f,a=u,I+e>258+(31&a)+(a>>5&31)||16==c&&1>I)return _=null,d=9,n.msg="invalid bit length repeat",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);c=16==c?_[I-1]:0;do{_[I++]=c}while(0!=--e);f=I}}if(p[0]=-1,R=[],A=[],V=[],B=[],R[0]=9,A[0]=6,a=u,a=v.inflate_trees_dynamic(257+(31&a),1+(a>>5&31),_,R,A,V,B,m,n),0!=a)return a==t&&(_=null,d=9),i=a,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);g.init(R[0],A[0],m,V[0],m,B[0]),d=6;case 6:if(o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,1!=(i=g.proc(o,n,i)))return o.inflate_flush(n,i);if(i=0,g.free(n),b=n.next_in_index,k=n.avail_in,r=o.bitb,l=o.bitk,S=o.write,z=S<o.read?o.read-S-1:o.end-S,0===y){d=0;break}d=7;case 7:if(o.write=S,i=o.inflate_flush(n,i),S=o.write,z=S<o.read?o.read-S-1:o.end-S,o.read!=o.write)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);d=8;case 8:return i=1,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);case 9:return i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);default:return i=e,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i)}}},o.free=e=>{o.reset(e,null),o.win=null,m=null},o.set_dictionary=(e,t,n)=>{o.win.set(e.subarray(t,t+n),0),o.read=o.write=n},o.sync_point=()=>1==d?1:0}const p=13,g=[0,0,255,255];function y(){const n=this;function i(t){return t&&t.istate?(t.total_in=t.total_out=0,t.msg=null,t.istate.mode=7,t.istate.blocks.reset(t,null),0):e}n.mode=0,n.method=0,n.was=[0],n.need=0,n.marker=0,n.wbits=0,n.inflateEnd=e=>(n.blocks&&n.blocks.free(e),n.blocks=null,0),n.inflateInit=(t,a)=>(t.msg=null,n.blocks=null,8>a||a>15?(n.inflateEnd(t),e):(n.wbits=a,t.istate.blocks=new x(t,1<<a),i(t),0)),n.inflate=(n,i)=>{let a,s;if(!n||!n.istate||!n.next_in)return e;const l=n.istate;for(i=4==i?r:0,a=r;;)switch(l.mode){case 0:if(0===n.avail_in)return a;if(a=i,n.avail_in--,n.total_in++,8!=(15&(l.method=n.read_byte(n.next_in_index++)))){l.mode=p,n.msg="unknown compression method",l.marker=5;break}if(8+(l.method>>4)>l.wbits){l.mode=p,n.msg="invalid win size",l.marker=5;break}l.mode=1;case 1:if(0===n.avail_in)return a;if(a=i,n.avail_in--,n.total_in++,s=255&n.read_byte(n.next_in_index++),((l.method<<8)+s)%31!=0){l.mode=p,n.msg="incorrect header check",l.marker=5;break}if(0==(32&s)){l.mode=7;break}l.mode=2;case 2:if(0===n.avail_in)return a;a=i,n.avail_in--,n.total_in++,l.need=(255&n.read_byte(n.next_in_index++))<<24&4278190080,l.mode=3;case 3:if(0===n.avail_in)return a;a=i,n.avail_in--,n.total_in++,l.need+=(255&n.read_byte(n.next_in_index++))<<16&16711680,l.mode=4;case 4:if(0===n.avail_in)return a;a=i,n.avail_in--,n.total_in++,l.need+=(255&n.read_byte(n.next_in_index++))<<8&65280,l.mode=5;case 5:return 0===n.avail_in?a:(a=i,n.avail_in--,n.total_in++,l.need+=255&n.read_byte(n.next_in_index++),l.mode=6,2);case 6:return l.mode=p,n.msg="need dictionary",l.marker=0,e;case 7:if(a=l.blocks.proc(n,a),a==t){l.mode=p,l.marker=0;break}if(0==a&&(a=i),1!=a)return a;a=i,l.blocks.reset(n,l.was),l.mode=12;case 12:return n.avail_in=0,1;case p:return t;default:return e}},n.inflateSetDictionary=(t,n,i)=>{let a=0,r=i;if(!t||!t.istate||6!=t.istate.mode)return e;const s=t.istate;return r<1<<s.wbits||(r=(1<<s.wbits)-1,a=i-r),s.blocks.set_dictionary(n,a,r),s.mode=7,0},n.inflateSync=n=>{let a,s,l,o,_;if(!n||!n.istate)return e;const d=n.istate;if(d.mode!=p&&(d.mode=p,d.marker=0),0===(a=n.avail_in))return r;for(s=n.next_in_index,l=d.marker;0!==a&&4>l;)n.read_byte(s)==g[l]?l++:l=0!==n.read_byte(s)?0:4-l,s++,a--;return n.total_in+=s-n.next_in_index,n.next_in_index=s,n.avail_in=a,d.marker=l,4!=l?t:(o=n.total_in,_=n.total_out,i(n),n.total_in=o,n.total_out=_,d.mode=7,0)},n.inflateSyncPoint=t=>t&&t.istate&&t.istate.blocks?t.istate.blocks.sync_point():e}function m(){}return m.prototype={inflateInit(e){const t=this;return t.istate=new y,e||(e=15),t.istate.inflateInit(t,e)},inflate(t){const n=this;return n.istate?n.istate.inflate(n,t):e},inflateEnd(){const t=this;if(!t.istate)return e;const n=t.istate.inflateEnd(t);return t.istate=null,n},inflateSync(){const t=this;return t.istate?t.istate.inflateSync(t):e},inflateSetDictionary(t,n){const i=this;return i.istate?i.istate.inflateSetDictionary(i,t,n):e},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}},function(e){const t=new m,s=e&&e.chunkSize?n.floor(2*e.chunkSize):131072,l=new a(s);let o=!1;t.inflateInit(),t.next_out=l,this.append=(e,n)=>{const _=[];let d,c,u=0,f=0,h=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=s,0!==t.avail_in||o||(t.next_in_index=0,o=!0),d=t.inflate(0),o&&d===r){if(0!==t.avail_in)throw new i("inflating: bad input")}else if(0!==d&&1!==d)throw new i("inflating: "+t.msg);if((o||1===d)&&t.avail_in===e.length)throw new i("inflating: bad input");t.next_out_index&&(t.next_out_index===s?_.push(new a(l)):_.push(l.slice(0,t.next_out_index))),h+=t.next_out_index,n&&t.next_in_index>0&&t.next_in_index!=u&&(n(t.next_in_index),u=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return _.length>1?(c=new a(h),_.forEach((e=>{c.set(e,f),f+=e.length}))):c=_[0]||new a,c}},this.flush=()=>{t.inflateEnd()}}})();self.initCodec=()=>{self.Deflate=Ve,self.Inflate=Be}}();
|
|
1
|
+
!function(){"use strict";const{Array:e,Object:t,Math:n,Error:i,Uint8Array:a,Uint16Array:r,Uint32Array:s,Int32Array:l,DataView:o,Promise:_,TextEncoder:d,crypto:c,postMessage:u,TransformStream:f,ReadableStream:h,WritableStream:b,CompressionStream:w,DecompressionStream:p}=globalThis,x=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;x[e]=t}class g{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,i=0|e.length;i>n;n++)t=t>>>8^x[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class y extends f{constructor(){super({start(){this.crc32=new g},transform(e){this.crc32.append(e)},flush(e){const t=new a(4);new o(t.buffer).setUint32(0,this.crc32.get()),e.enqueue(t)}})}}const m={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],i=m.getPartial(n);return 32===i?e.concat(t):m._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+m.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const i=(e=e.slice(0,n.ceil(t/32))).length;return t&=31,i>0&&t&&(e[i-1]=m.partial(t,e[i-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>n.round(e/1099511627776)||32,_shiftRight(e,t,n,i){for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(let a=0;a<e.length;a++)i.push(n|e[a]>>>t),n=e[a]<<32-t;const a=e.length?e[e.length-1]:0,r=m.getPartial(a);return i.push(m.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},v={bytes:{fromBits(e){const t=m.bitLength(e)/8,n=new a(t);let i;for(let a=0;t>a;a++)0==(3&a)&&(i=e[a/4]),n[a]=i>>>24,i<<=8;return n},toBits(e){const t=[];let n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],3==(3&n)&&(t.push(i),i=0);return 3&n&&t.push(m.partial(8*(3&n),i)),t}}},k={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};k.sha1.prototype={blockSize:512,reset(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update(e){const t=this;"string"==typeof e&&(e=v.utf8String.toBits(e));const n=t._buffer=m.concat(t._buffer,e),a=t._length,r=t._length=a+m.bitLength(e);if(r>9007199254740991)throw new i("Cannot hash more than 2^53 - 1 bits");const l=new s(n);let o=0;for(let e=t.blockSize+a-(t.blockSize+a&t.blockSize-1);r>=e;e+=t.blockSize)t._block(l.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),t},finalize(){const e=this;let t=e._buffer;const i=e._h;t=m.concat(t,[m.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(n.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),i},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,i)=>e>19?e>39?e>59?e>79?void 0:t^n^i:t&n|t&i|n&i:t^n^i:t&n|~t&i,_S:(e,t)=>t<<e|t>>>32-e,_block(t){const i=this,a=i._h,r=e(80);for(let e=0;16>e;e++)r[e]=t[e];let s=a[0],l=a[1],o=a[2],_=a[3],d=a[4];for(let e=0;79>=e;e++){16>e||(r[e]=i._S(1,r[e-3]^r[e-8]^r[e-14]^r[e-16]));const t=i._S(5,s)+i._f(e,l,o,_)+d+r[e]+i._key[n.floor(e/20)]|0;d=_,_=o,o=i._S(30,l),l=s,s=t}a[0]=a[0]+s|0,a[1]=a[1]+l|0,a[2]=a[2]+o|0,a[3]=a[3]+_|0,a[4]=a[4]+d|0}};const S={getRandomValues(e){const t=new s(e.buffer),i=e=>{let t=987654321;const i=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&i,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&i)&i)/4294967296+.5)*(n.random()>.5?1:-1))};for(let a,r=0;r<e.length;r+=4){const e=i(4294967296*(a||n.random()));a=987654071*e(),t[r/4]=4294967296*e()|0}return e}},z={importKey:e=>new z.hmacSha1(v.bytes.toBits(e)),pbkdf2(e,t,n,a){if(n=n||1e4,0>a||0>n)throw new i("invalid params to pbkdf2");const r=1+(a>>5)<<2;let s,l,_,d,c;const u=new ArrayBuffer(r),f=new o(u);let h=0;const b=m;for(t=v.bytes.toBits(t),c=1;(r||1)>h;c++){for(s=l=e.encrypt(b.concat(t,[c])),_=1;n>_;_++)for(l=e.encrypt(l),d=0;d<l.length;d++)s[d]^=l[d];for(_=0;(r||1)>h&&_<s.length;_++)f.setInt32(h,s[_]),h+=4}return u.slice(0,a/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=k.sha1,i=[[],[]],a=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>a&&(e=n.hash(e));for(let t=0;a>t;t++)i[0][t]=909522486^e[t],i[1][t]=1549556828^e[t];t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new i("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},I=void 0!==c&&"function"==typeof c.getRandomValues,E="Invalid password";function T(e){return I?c.getRandomValues(e):S.getRandomValues(e)}const q=16,A={name:"PBKDF2"},C=t.assign({hash:{name:"HMAC"}},A),R=t.assign({iterations:1e3,hash:{name:"SHA-1"}},A),V=["deriveBits"],B=[8,12,16],H=[16,24,32],D=10,K=[0,0,0,0],P="undefined",W="function",M=typeof c!=P,U=M&&typeof c.subtle!=P,L=M&&U&&typeof c.subtle.importKey==W,N=M&&U&&typeof c.subtle.deriveBits==W,F=v.bytes,G=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],a=t._tables[1],r=e.length;let s,l,o,_=1;if(4!==r&&6!==r&&8!==r)throw new i("invalid aes key size");for(t._key=[l=e.slice(0),o=[]],s=r;4*r+28>s;s++){let e=l[s-1];(s%r==0||8===r&&s%r==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],s%r==0&&(e=e<<8^e>>>24^_<<24,_=_<<1^283*(_>>7))),l[s]=l[s-r]^e}for(let e=0;s;e++,s--){const t=l[3&e?s:s-4];o[e]=4>=s||4>e?t:a[0][n[t>>>24]]^a[1][n[t>>16&255]]^a[2][n[t>>8&255]]^a[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],a=[],r=[];let s,l,o,_;for(let e=0;256>e;e++)r[(a[e]=e<<1^283*(e>>7))^e]=e;for(let d=s=0;!n[d];d^=l||1,s=r[s]||1){let r=s^s<<1^s<<2^s<<3^s<<4;r=r>>8^255&r^99,n[d]=r,i[r]=d,_=a[o=a[l=a[d]]];let c=16843009*_^65537*o^257*l^16843008*d,u=257*a[r]^16843008*r;for(let n=0;4>n;n++)e[n][d]=u=u<<24^u>>>8,t[n][r]=c=c<<24^c>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new i("invalid aes block size");const n=this._key[t],a=n.length/4-2,r=[0,0,0,0],s=this._tables[t],l=s[0],o=s[1],_=s[2],d=s[3],c=s[4];let u,f,h,b=e[0]^n[0],w=e[t?3:1]^n[1],p=e[2]^n[2],x=e[t?1:3]^n[3],g=4;for(let e=0;a>e;e++)u=l[b>>>24]^o[w>>16&255]^_[p>>8&255]^d[255&x]^n[g],f=l[w>>>24]^o[p>>16&255]^_[x>>8&255]^d[255&b]^n[g+1],h=l[p>>>24]^o[x>>16&255]^_[b>>8&255]^d[255&w]^n[g+2],x=l[x>>>24]^o[b>>16&255]^_[w>>8&255]^d[255&p]^n[g+3],g+=4,b=u,w=f,p=h;for(let e=0;4>e;e++)r[t?3&-e:e]=c[b>>>24]<<24^c[w>>16&255]<<16^c[p>>8&255]<<8^c[255&x]^n[g++],u=b,b=w,w=p,p=x,x=u;return r}},X=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];const a=m.bitLength(t);for(let a=0;i>a;a+=4){this.incCounter(n);const i=e.encrypt(n);t[a]^=i[0],t[a+1]^=i[1],t[a+2]^=i[2],t[a+3]^=i[3]}return m.clamp(t,a)}},j=z.hmacSha1;class O extends f{constructor(n,r,s){let l;super({start(){t.assign(this,{ready:new _((e=>this.resolveReady=e)),password:n,signed:r,strength:s-1,pending:new a})},async transform(t,n){const r=this;if(r.password){const n=r.password;r.password=null;const a=$(t,0,B[r.strength]+2);await(async(e,t,n)=>{await Y(e,n,$(t,0,B[e.strength]));const a=$(t,B[e.strength]),r=e.keys.passwordVerification;if(r[0]!=a[0]||r[1]!=a[1])throw new i(E)})(r,a,n),r.ctr=new X(new G(r.keys.key),e.from(K)),r.hmac=new j(r.keys.authentication),t=$(t,B[r.strength]+2),r.resolveReady()}else await r.ready;const s=new a(t.length-D-(t.length-D)%q);n.enqueue(Q(r,t,s,0,D,!0))},async flush(e){const t=this;await t.ready;const n=t.pending,i=$(n,0,n.length-D),r=$(n,n.length-D);let s=new a;if(i.length){const e=te(F,i);t.hmac.update(e);const n=t.ctr.update(e);s=ee(F,n)}if(l.valid=!0,t.signed){const e=$(ee(F,t.hmac.digest()),0,D);for(let t=0;D>t;t++)e[t]!=r[t]&&(l.valid=!1)}e.enqueue(s)}}),l=this}}class J extends f{constructor(n,i){let r;super({start(){t.assign(this,{ready:new _((e=>this.resolveReady=e)),password:n,strength:i-1,pending:new a})},async transform(t,n){const i=this;let r=new a;if(i.password){const t=i.password;i.password=null,r=await(async(e,t)=>{const n=T(new a(B[e.strength]));return await Y(e,t,n),Z(n,e.keys.passwordVerification)})(i,t),i.ctr=new X(new G(i.keys.key),e.from(K)),i.hmac=new j(i.keys.authentication),i.resolveReady()}else await i.ready;const s=new a(r.length+t.length-t.length%q);s.set(r,0),n.enqueue(Q(i,t,s,r.length,0))},async flush(e){const t=this;await t.ready;let n=new a;if(t.pending.length){const e=t.ctr.update(te(F,t.pending));t.hmac.update(e),n=ee(F,e)}r.signature=ee(F,t.hmac.digest()).slice(0,D),e.enqueue(Z(n,r.signature))}}),r=this}}function Q(e,t,n,i,r,s){const l=t.length-r;let o;for(e.pending.length&&(t=Z(e.pending,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new a(t)).set(n,0)}return e})(n,l-l%q)),o=0;l-q>=o;o+=q){const a=te(F,$(t,o,o+q));s&&e.hmac.update(a);const r=e.ctr.update(a);s||e.hmac.update(r),n.set(ee(F,r),o+i)}return e.pending=$(t,o),n}async function Y(e,n,i){const r=(e=>{if(void 0===d){const t=new a((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new d).encode(e)})(n),s=await((e,t,n,i,a)=>L?c.subtle.importKey("raw",t,n,!1,a):z.importKey(t))(0,r,C,0,V),l=await(async(e,t,n)=>N?await c.subtle.deriveBits(e,t,n):z.pbkdf2(t,e.salt,R.iterations,n))(t.assign({salt:i},R),s,8*(2*H[e.strength]+2)),o=new a(l);e.keys={key:te(F,$(o,0,H[e.strength])),authentication:te(F,$(o,H[e.strength],2*H[e.strength])),passwordVerification:$(o,2*H[e.strength])}}function Z(e,t){let n=e;return e.length+t.length&&(n=new a(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function $(e,t,n){return e.subarray(t,n)}function ee(e,t){return e.fromBits(t)}function te(e,t){return e.toBits(t)}class ne extends f{constructor(e,n){let a;super({start(){t.assign(this,{password:e,passwordVerification:n}),se(this,e)},transform(e,t){const n=this;if(n.password){const t=ae(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new i(E);e=e.subarray(12)}t.enqueue(ae(n,e))},flush(){a.valid=!0}}),a=this}}class ie extends f{constructor(e,n){super({start(){t.assign(this,{password:e,passwordVerification:n}),se(this,e)},transform(e,t){const n=this;let i,r;if(n.password){n.password=null;const t=T(new a(12));t[11]=n.passwordVerification,i=new a(e.length+t.length),i.set(re(n,t),0),r=12}else i=new a(e.length),r=0;i.set(re(n,e),r),t.enqueue(i)},flush(){}})}}function ae(e,t){const n=new a(t.length);for(let i=0;i<t.length;i++)n[i]=oe(e)^t[i],le(e,n[i]);return n}function re(e,t){const n=new a(t.length);for(let i=0;i<t.length;i++)n[i]=oe(e)^t[i],le(e,t[i]);return n}function se(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new g(e.keys[0]),e.crcKey2=new g(e.keys[2]);for(let n=0;n<t.length;n++)le(e,t.charCodeAt(n))}function le(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=de(e.keys[1]+_e(e.keys[0])),e.keys[1]=de(n.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function oe(e){const t=2|e.keys[2];return _e(n.imul(t,1^t)>>>8)}function _e(e){return 255&e}function de(e){return 4294967295&e}class ce extends f{constructor(e,t){let n;super({start(){n=new e(t)},transform(e,t){e=n.append(e),t.enqueue(e)},flush(e){const t=n.flush();t&&e.enqueue(t)}})}}const ue="Invalid signature",fe="deflate-raw",he="undefined",be=typeof w==he,we=typeof p==he;let pe=!0,xe=!0;class ge extends f{constructor(e,t,{chunkSize:n},...i){super({},...i);const{compressed:a,encrypted:r,useCompressionStream:s,password:l,passwordVerification:_,encryptionStrength:d,zipCrypto:c,signed:u,level:f}=t,h=this;let b,p,x=ve(super.readable);if(r&&!c||!u||([x,b]=x.tee(),b=b.pipeThrough(new y)),a)if(void 0!==s&&!s||be&&!xe)x=me(e,x,{chunkSize:n,level:f});else try{x=x.pipeThrough(new w(fe))}catch(t){xe=!1,x=me(e,x,{chunkSize:n,level:f})}r&&(c?x=x.pipeThrough(new ie(l,_)):(p=new J(l,d),x=x.pipeThrough(p))),ke(h,x,(async()=>{let e;r&&!c&&(e=p.signature),r&&!c||!u||(e=await b.getReader().read(),e=new o(e.value.buffer).getUint32(0)),h.signature=e}))}}class ye extends f{constructor(e,t,{chunkSize:n},...a){super({},...a);const{zipCrypto:r,encrypted:s,password:l,passwordVerification:_,signed:d,encryptionStrength:c,compressed:u,useCompressionStream:f}=t;let h,b,w=ve(super.readable);if(s&&(r?w=w.pipeThrough(new ne(l,_)):(b=new O(l,d,c),w=w.pipeThrough(b))),u)if(void 0!==f&&!f||we&&!pe)w=me(e,w,{chunkSize:n});else try{w=w.pipeThrough(new p(fe))}catch(t){pe=!1,w=me(e,w,{chunkSize:n})}s&&!r||!d||([w,h]=w.tee(),h=h.pipeThrough(new y)),ke(this,w,(async()=>{if(s&&!r&&!b.valid)throw new i(ue);if((!s||r)&&d){const e=await h.getReader().read(),n=new o(e.value.buffer);if(t.signature!=n.getUint32(0,!1))throw new i(ue)}}))}}function me(e,t,n){return t.pipeThrough(new ce(e,n))}function ve(e){return e.pipeThrough(new f({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ke(e,n,i){n=n.pipeThrough(new f({flush:i})),t.defineProperty(e,"readable",{get:()=>n})}const Se="deflate",ze="inflate",Ie="data";class Ee{constructor(e,t,n,i,a){const{codecType:r}=i;async function s(r){const s=new r(e,i,a);await t.pipeThrough(s).pipeThrough(new f({transform(e,t){e&&e.length&&(n.size+=e.length,t.enqueue(e))}})).pipeTo(n,{preventClose:!0,preventAbort:!0});const{size:l,signature:o}=s;return{size:l,signature:o}}r.startsWith(Se)?this.run=()=>s(ge):r.startsWith(ze)&&(this.run=()=>s(ye))}}const Te=new Map,qe=new Map;let Ae,Ce=0;async function Re(e){try{const{options:t,scripts:n,config:i}=e,{codecType:a}=t;let r;n&&n.length&&importScripts.apply(void 0,n),self.initCodec&&self.initCodec(),a.startsWith(Se)?r=self.Deflate:a.startsWith(ze)&&(r=self.Inflate);const s={highWaterMark:1,size:()=>i.chunkSize},l=new h({async pull(e){let t=new _((e=>Te.set(Ce,e)));Ve({type:"pull",messageId:Ce}),Ce=(Ce+1)%Number.MAX_SAFE_INTEGER;const{value:n,done:i}=await t;e.enqueue(n),i&&e.close()}},s),o=new b({async write(e){let t;const n=new _((e=>t=e));qe.set(Ce,t),Ve({type:Ie,data:e,messageId:Ce}),Ce=(Ce+1)%Number.MAX_SAFE_INTEGER,await n}},s);Ae=new Ee(r,l,o,t,i),Ve({type:"close",result:await Ae.run()})}catch(e){const{message:t,stack:n}=e;u({error:{message:t,stack:n}})}}function Ve(e){if(e.data){let{data:t}=e;if(t&&t.length)try{t=new a(t),e.data=t.buffer,u(e,[e.data])}catch(t){u(e)}else u(e)}else u(e)}addEventListener("message",(async e=>{const t=e.data,{type:n,messageId:i,data:r,done:s}=t;try{if("start"==n&&Re(t),n==Ie){const e=Te.get(i);Te.delete(i),e({value:new a(r),done:s})}if("ack"==n){const e=qe.get(i);qe.delete(i),e()}}catch(e){u({error:{message:e.message,stack:e.stack}})}}));const Be=(()=>{const t=-2;function s(t){return l(t.map((([t,n])=>new e(t).fill(n,0,t))))}function l(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?l(n):n)),[])}const o=[0,1,2,3].concat(...s([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function _(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.build_tree=i=>{const a=e.dyn_tree,r=e.stat_desc.static_tree,s=e.stat_desc.elems;let l,o,_,d=-1;for(i.heap_len=0,i.heap_max=573,l=0;s>l;l++)0!==a[2*l]?(i.heap[++i.heap_len]=d=l,i.depth[l]=0):a[2*l+1]=0;for(;2>i.heap_len;)_=i.heap[++i.heap_len]=2>d?++d:0,a[2*_]=1,i.depth[_]=0,i.opt_len--,r&&(i.static_len-=r[2*_+1]);for(e.max_code=d,l=n.floor(i.heap_len/2);l>=1;l--)i.pqdownheap(a,l);_=s;do{l=i.heap[1],i.heap[1]=i.heap[i.heap_len--],i.pqdownheap(a,1),o=i.heap[1],i.heap[--i.heap_max]=l,i.heap[--i.heap_max]=o,a[2*_]=a[2*l]+a[2*o],i.depth[_]=n.max(i.depth[l],i.depth[o])+1,a[2*l+1]=a[2*o+1]=_,i.heap[1]=_++,i.pqdownheap(a,1)}while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],(t=>{const n=e.dyn_tree,i=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,r=e.stat_desc.extra_base,s=e.stat_desc.max_length;let l,o,_,d,c,u,f=0;for(d=0;15>=d;d++)t.bl_count[d]=0;for(n[2*t.heap[t.heap_max]+1]=0,l=t.heap_max+1;573>l;l++)o=t.heap[l],d=n[2*n[2*o+1]+1]+1,d>s&&(d=s,f++),n[2*o+1]=d,o>e.max_code||(t.bl_count[d]++,c=0,r>o||(c=a[o-r]),u=n[2*o],t.opt_len+=u*(d+c),i&&(t.static_len+=u*(i[2*o+1]+c)));if(0!==f){do{for(d=s-1;0===t.bl_count[d];)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[s]--,f-=2}while(f>0);for(d=s;0!==d;d--)for(o=t.bl_count[d];0!==o;)_=t.heap[--l],_>e.max_code||(n[2*_+1]!=d&&(t.opt_len+=(d-n[2*_+1])*n[2*_],n[2*_+1]=d),o--)}})(i),((e,n,i)=>{const a=[];let r,s,l,o=0;for(r=1;15>=r;r++)a[r]=o=o+i[r-1]<<1;for(s=0;n>=s;s++)l=e[2*s+1],0!==l&&(e[2*s]=t(a[l]++,l))})(a,e.max_code,i.bl_count)}}function d(e,t,n,i,a){const r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=a}_._length_code=[0,1,2,3,4,5,6,7].concat(...s([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),_.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],_.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],_.d_code=e=>256>e?o[e]:o[256+(e>>>7)],_.extra_lbits=[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],_.extra_dbits=[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],_.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],_.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const c=s([[144,8],[112,9],[24,7],[8,8]]);d.static_ltree=l([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,c[t]])));const u=s([[30,5]]);function f(e,t,n,i,a){const r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=a}d.static_dtree=l([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,u[t]]))),d.static_l_desc=new d(d.static_ltree,_.extra_lbits,257,286,15),d.static_d_desc=new d(d.static_dtree,_.extra_dbits,0,30,15),d.static_bl_desc=new d(null,_.extra_blbits,0,19,7);const h=[new f(0,0,0,0,0),new f(4,4,8,4,1),new f(4,5,16,8,1),new f(4,6,32,32,1),new f(4,4,16,16,2),new f(8,16,32,32,2),new f(8,16,128,128,2),new f(8,32,128,256,2),new f(32,128,258,1024,2),new f(32,258,258,4096,2)],b=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],w=113,p=666,x=262;function g(e,t,n,i){const a=e[2*t],r=e[2*n];return r>a||a==r&&i[t]<=i[n]}function y(){const e=this;let i,s,l,o,c,u,f,y,m,v,k,S,z,I,E,T,q,A,C,R,V,B,H,D,K,P,W,M,U,L,N,F,G;const X=new _,j=new _,O=new _;let J,Q,Y,Z,$,ee;function te(){let t;for(t=0;286>t;t++)N[2*t]=0;for(t=0;30>t;t++)F[2*t]=0;for(t=0;19>t;t++)G[2*t]=0;N[512]=1,e.opt_len=e.static_len=0,Q=Y=0}function ne(e,t){let n,i=-1,a=e[1],r=0,s=7,l=4;0===a&&(s=138,l=3),e[2*(t+1)+1]=65535;for(let o=0;t>=o;o++)n=a,a=e[2*(o+1)+1],++r<s&&n==a||(l>r?G[2*n]+=r:0!==n?(n!=i&&G[2*n]++,G[32]++):r>10?G[36]++:G[34]++,r=0,i=n,0===a?(s=138,l=3):n==a?(s=6,l=3):(s=7,l=4))}function ie(t){e.pending_buf[e.pending++]=t}function ae(e){ie(255&e),ie(e>>>8&255)}function re(e,t){let n;const i=t;ee>16-i?(n=e,$|=n<<ee&65535,ae($),$=n>>>16-ee,ee+=i-16):($|=e<<ee&65535,ee+=i)}function se(e,t){const n=2*e;re(65535&t[n],65535&t[n+1])}function le(e,t){let n,i,a=-1,r=e[1],s=0,l=7,o=4;for(0===r&&(l=138,o=3),n=0;t>=n;n++)if(i=r,r=e[2*(n+1)+1],++s>=l||i!=r){if(o>s)do{se(i,G)}while(0!=--s);else 0!==i?(i!=a&&(se(i,G),s--),se(16,G),re(s-3,2)):s>10?(se(18,G),re(s-11,7)):(se(17,G),re(s-3,3));s=0,a=i,0===r?(l=138,o=3):i==r?(l=6,o=3):(l=7,o=4)}}function oe(){16==ee?(ae($),$=0,ee=0):8>ee||(ie(255&$),$>>>=8,ee-=8)}function _e(t,i){let a,r,s;if(e.dist_buf[Q]=t,e.lc_buf[Q]=255&i,Q++,0===t?N[2*i]++:(Y++,t--,N[2*(_._length_code[i]+256+1)]++,F[2*_.d_code(t)]++),0==(8191&Q)&&W>2){for(a=8*Q,r=V-q,s=0;30>s;s++)a+=F[2*s]*(5+_.extra_dbits[s]);if(a>>>=3,Y<n.floor(Q/2)&&a<n.floor(r/2))return!0}return Q==J-1}function de(t,n){let i,a,r,s,l=0;if(0!==Q)do{i=e.dist_buf[l],a=e.lc_buf[l],l++,0===i?se(a,t):(r=_._length_code[a],se(r+256+1,t),s=_.extra_lbits[r],0!==s&&(a-=_.base_length[r],re(a,s)),i--,r=_.d_code(i),se(r,n),s=_.extra_dbits[r],0!==s&&(i-=_.base_dist[r],re(i,s)))}while(Q>l);se(256,t),Z=t[513]}function ce(){ee>8?ae($):ee>0&&ie(255&$),$=0,ee=0}function ue(t,n,i){re(0+(i?1:0),3),((t,n)=>{ce(),Z=8,ae(n),ae(~n),e.pending_buf.set(y.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function fe(t){((t,n,i)=>{let a,r,s=0;W>0?(X.build_tree(e),j.build_tree(e),s=(()=>{let t;for(ne(N,X.max_code),ne(F,j.max_code),O.build_tree(e),t=18;t>=3&&0===G[2*_.bl_order[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r>a||(a=r)):a=r=n+5,n+4>a||-1==t?r==a?(re(2+(i?1:0),3),de(d.static_ltree,d.static_dtree)):(re(4+(i?1:0),3),((e,t,n)=>{let i;for(re(e-257,5),re(t-1,5),re(n-4,4),i=0;n>i;i++)re(G[2*_.bl_order[i]+1],3);le(N,e-1),le(F,t-1)})(X.max_code+1,j.max_code+1,s+1),de(N,F)):ue(t,n,i),te(),i&&ce()})(0>q?-1:q,V-q,t),q=V,i.flush_pending()}function he(){let e,t,n,a;do{if(a=m-H-V,0===a&&0===V&&0===H)a=c;else if(-1==a)a--;else if(V>=c+c-x){y.set(y.subarray(c,c+c),0),B-=c,V-=c,q-=c,e=z,n=e;do{t=65535&k[--n],k[n]=c>t?0:t-c}while(0!=--e);e=c,n=e;do{t=65535&v[--n],v[n]=c>t?0:t-c}while(0!=--e);a+=c}if(0===i.avail_in)return;e=i.read_buf(y,V+H,a),H+=e,3>H||(S=255&y[V],S=(S<<T^255&y[V+1])&E)}while(x>H&&0!==i.avail_in)}function be(e){let t,n,i=K,a=V,r=D;const s=V>c-x?V-(c-x):0;let l=L;const o=f,_=V+258;let d=y[a+r-1],u=y[a+r];U>D||(i>>=2),l>H&&(l=H);do{if(t=e,y[t+r]==u&&y[t+r-1]==d&&y[t]==y[a]&&y[++t]==y[a+1]){a+=2,t++;do{}while(y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&y[++a]==y[++t]&&_>a);if(n=258-(_-a),a=_-258,n>r){if(B=e,r=n,n>=l)break;d=y[a+r-1],u=y[a+r]}}}while((e=65535&v[e&o])>s&&0!=--i);return r>H?H:r}e.depth=[],e.bl_count=[],e.heap=[],N=[],F=[],G=[],e.pqdownheap=(t,n)=>{const i=e.heap,a=i[n];let r=n<<1;for(;r<=e.heap_len&&(r<e.heap_len&&g(t,i[r+1],i[r],e.depth)&&r++,!g(t,a,i[r],e.depth));)i[n]=i[r],n=r,r<<=1;i[n]=a},e.deflateInit=(i,_,b,p,x,g)=>(p||(p=8),x||(x=8),g||(g=0),i.msg=null,-1==_&&(_=6),1>x||x>9||8!=p||9>b||b>15||0>_||_>9||0>g||g>2?t:(i.dstate=e,u=b,c=1<<u,f=c-1,I=x+7,z=1<<I,E=z-1,T=n.floor((I+3-1)/3),y=new a(2*c),v=[],k=[],J=1<<x+6,e.pending_buf=new a(4*J),l=4*J,e.dist_buf=new r(J),e.lc_buf=new a(J),W=_,M=g,(t=>(t.total_in=t.total_out=0,t.msg=null,e.pending=0,e.pending_out=0,s=w,o=0,X.dyn_tree=N,X.stat_desc=d.static_l_desc,j.dyn_tree=F,j.stat_desc=d.static_d_desc,O.dyn_tree=G,O.stat_desc=d.static_bl_desc,$=0,ee=0,Z=8,te(),(()=>{m=2*c,k[z-1]=0;for(let e=0;z-1>e;e++)k[e]=0;P=h[W].max_lazy,U=h[W].good_length,L=h[W].nice_length,K=h[W].max_chain,V=0,q=0,H=0,A=D=2,R=0,S=0})(),0))(i))),e.deflateEnd=()=>42!=s&&s!=w&&s!=p?t:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,k=null,v=null,y=null,e.dstate=null,s==w?-3:0),e.deflateParams=(e,n,i)=>{let a=0;return-1==n&&(n=6),0>n||n>9||0>i||i>2?t:(h[W].func!=h[n].func&&0!==e.total_in&&(a=e.deflate(1)),W!=n&&(W=n,P=h[W].max_lazy,U=h[W].good_length,L=h[W].nice_length,K=h[W].max_chain),M=i,a)},e.deflateSetDictionary=(e,n,i)=>{let a,r=i,l=0;if(!n||42!=s)return t;if(3>r)return 0;for(r>c-x&&(r=c-x,l=i-r),y.set(n.subarray(l,l+r),0),V=r,q=r,S=255&y[0],S=(S<<T^255&y[1])&E,a=0;r-3>=a;a++)S=(S<<T^255&y[a+2])&E,v[a&f]=k[S],k[S]=a;return 0},e.deflate=(n,a)=>{let r,_,g,m,I;if(a>4||0>a)return t;if(!n.next_out||!n.next_in&&0!==n.avail_in||s==p&&4!=a)return n.msg=b[4],t;if(0===n.avail_out)return n.msg=b[7],-5;var K;if(i=n,m=o,o=a,42==s&&(_=8+(u-8<<4)<<8,g=(W-1&255)>>1,g>3&&(g=3),_|=g<<6,0!==V&&(_|=32),_+=31-_%31,s=w,ie((K=_)>>8&255),ie(255&K)),0!==e.pending){if(i.flush_pending(),0===i.avail_out)return o=-1,0}else if(0===i.avail_in&&m>=a&&4!=a)return i.msg=b[7],-5;if(s==p&&0!==i.avail_in)return n.msg=b[7],-5;if(0!==i.avail_in||0!==H||0!=a&&s!=p){switch(I=-1,h[W].func){case 0:I=(e=>{let t,n=65535;for(n>l-5&&(n=l-5);;){if(1>=H){if(he(),0===H&&0==e)return 0;if(0===H)break}if(V+=H,H=0,t=q+n,(0===V||V>=t)&&(H=V-t,V=t,fe(!1),0===i.avail_out))return 0;if(V-q>=c-x&&(fe(!1),0===i.avail_out))return 0}return fe(4==e),0===i.avail_out?4==e?2:0:4==e?3:1})(a);break;case 1:I=(e=>{let t,n=0;for(;;){if(x>H){if(he(),x>H&&0==e)return 0;if(0===H)break}if(3>H||(S=(S<<T^255&y[V+2])&E,n=65535&k[S],v[V&f]=k[S],k[S]=V),0===n||(V-n&65535)>c-x||2!=M&&(A=be(n)),3>A)t=_e(0,255&y[V]),H--,V++;else if(t=_e(V-B,A-3),H-=A,A>P||3>H)V+=A,A=0,S=255&y[V],S=(S<<T^255&y[V+1])&E;else{A--;do{V++,S=(S<<T^255&y[V+2])&E,n=65535&k[S],v[V&f]=k[S],k[S]=V}while(0!=--A);V++}if(t&&(fe(!1),0===i.avail_out))return 0}return fe(4==e),0===i.avail_out?4==e?2:0:4==e?3:1})(a);break;case 2:I=(e=>{let t,n,a=0;for(;;){if(x>H){if(he(),x>H&&0==e)return 0;if(0===H)break}if(3>H||(S=(S<<T^255&y[V+2])&E,a=65535&k[S],v[V&f]=k[S],k[S]=V),D=A,C=B,A=2,0!==a&&P>D&&c-x>=(V-a&65535)&&(2!=M&&(A=be(a)),5>=A&&(1==M||3==A&&V-B>4096)&&(A=2)),3>D||A>D)if(0!==R){if(t=_e(0,255&y[V-1]),t&&fe(!1),V++,H--,0===i.avail_out)return 0}else R=1,V++,H--;else{n=V+H-3,t=_e(V-1-C,D-3),H-=D-1,D-=2;do{++V>n||(S=(S<<T^255&y[V+2])&E,a=65535&k[S],v[V&f]=k[S],k[S]=V)}while(0!=--D);if(R=0,A=2,V++,t&&(fe(!1),0===i.avail_out))return 0}}return 0!==R&&(t=_e(0,255&y[V-1]),R=0),fe(4==e),0===i.avail_out?4==e?2:0:4==e?3:1})(a)}if(2!=I&&3!=I||(s=p),0==I||2==I)return 0===i.avail_out&&(o=-1),0;if(1==I){if(1==a)re(2,3),se(256,d.static_ltree),oe(),9>1+Z+10-ee&&(re(2,3),se(256,d.static_ltree),oe()),Z=7;else if(ue(0,0,!1),3==a)for(r=0;z>r;r++)k[r]=0;if(i.flush_pending(),0===i.avail_out)return o=-1,0}}return 4!=a?0:1}}function m(){const e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}return m.prototype={deflateInit(e,t){const n=this;return n.dstate=new y,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){const n=this;return n.dstate?n.dstate.deflate(n,e):t},deflateEnd(){const e=this;if(!e.dstate)return t;const n=e.dstate.deflateEnd();return e.dstate=null,n},deflateParams(e,n){const i=this;return i.dstate?i.dstate.deflateParams(i,e,n):t},deflateSetDictionary(e,n){const i=this;return i.dstate?i.dstate.deflateSetDictionary(i,e,n):t},read_buf(e,t,n){const i=this;let a=i.avail_in;return a>n&&(a=n),0===a?0:(i.avail_in-=a,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+a),t),i.next_in_index+=a,i.total_in+=a,a)},flush_pending(){const e=this;let t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,0===e.dstate.pending&&(e.dstate.pending_out=0))}},function(e){const t=new m,r=(s=e&&e.chunkSize?e.chunkSize:65536)+5*(n.floor(s/16383)+1);var s;const l=new a(r);let o=e?e.level:-1;void 0===o&&(o=-1),t.deflateInit(o),t.next_out=l,this.append=(e,n)=>{let s,o,_=0,d=0,c=0;const u=[];if(e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=r,s=t.deflate(0),0!=s)throw new i("deflating: "+t.msg);t.next_out_index&&(t.next_out_index==r?u.push(new a(l)):u.push(l.slice(0,t.next_out_index))),c+=t.next_out_index,n&&t.next_in_index>0&&t.next_in_index!=_&&(n(t.next_in_index),_=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return u.length>1?(o=new a(c),u.forEach((e=>{o.set(e,d),d+=e.length}))):o=u[0]||new a,o}},this.flush=()=>{let e,n,s=0,o=0;const _=[];do{if(t.next_out_index=0,t.avail_out=r,e=t.deflate(4),1!=e&&0!=e)throw new i("deflating: "+t.msg);r-t.avail_out>0&&_.push(l.slice(0,t.next_out_index)),o+=t.next_out_index}while(t.avail_in>0||0===t.avail_out);return t.deflateEnd(),n=new a(o),_.forEach((e=>{n.set(e,s),s+=e.length})),n}}})(),He=(()=>{const e=-2,t=-3,r=-5,s=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],o=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],_=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],c=[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,112,112],u=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],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];function h(){let e,n,i,a,s,o;function _(e,n,l,_,d,c,u,f,h,b,w){let p,x,g,y,m,v,k,S,z,I,E,T,q,A,C;I=0,m=l;do{i[e[n+I]]++,I++,m--}while(0!==m);if(i[0]==l)return u[0]=-1,f[0]=0,0;for(S=f[0],v=1;15>=v&&0===i[v];v++);for(k=v,v>S&&(S=v),m=15;0!==m&&0===i[m];m--);for(g=m,S>m&&(S=m),f[0]=S,A=1<<v;m>v;v++,A<<=1)if(0>(A-=i[v]))return t;if(0>(A-=i[m]))return t;for(i[m]+=A,o[1]=v=0,I=1,q=2;0!=--m;)o[q]=v+=i[I],q++,I++;m=0,I=0;do{0!==(v=e[n+I])&&(w[o[v]++]=m),I++}while(++m<l);for(l=o[g],o[0]=m=0,I=0,y=-1,T=-S,s[0]=0,E=0,C=0;g>=k;k++)for(p=i[k];0!=p--;){for(;k>T+S;){if(y++,T+=S,C=g-T,C=C>S?S:C,(x=1<<(v=k-T))>p+1&&(x-=p+1,q=k,C>v))for(;++v<C&&(x<<=1)>i[++q];)x-=i[q];if(C=1<<v,b[0]+C>1440)return t;s[y]=E=b[0],b[0]+=C,0!==y?(o[y]=m,a[0]=v,a[1]=S,v=m>>>T-S,a[2]=E-s[y-1]-v,h.set(a,3*(s[y-1]+v))):u[0]=E}for(a[1]=k-T,l>I?w[I]<_?(a[0]=256>w[I]?0:96,a[2]=w[I++]):(a[0]=c[w[I]-_]+16+64,a[2]=d[w[I++]-_]):a[0]=192,x=1<<k-T,v=m>>>T;C>v;v+=x)h.set(a,3*(E+v));for(v=1<<k-1;0!=(m&v);v>>>=1)m^=v;for(m^=v,z=(1<<T)-1;(m&z)!=o[y];)y--,T-=S,z=(1<<T)-1}return 0!==A&&1!=g?r:0}function h(t){let r;for(e||(e=[],n=[],i=new l(16),a=[],s=new l(15),o=new l(16)),n.length<t&&(n=[]),r=0;t>r;r++)n[r]=0;for(r=0;16>r;r++)i[r]=0;for(r=0;3>r;r++)a[r]=0;s.set(i.subarray(0,15),0),o.set(i.subarray(0,16),0)}this.inflate_trees_bits=(i,a,s,l,o)=>{let d;return h(19),e[0]=0,d=_(i,0,19,19,null,null,s,a,l,e,n),d==t?o.msg="oversubscribed dynamic bit lengths tree":d!=r&&0!==a[0]||(o.msg="incomplete dynamic bit lengths tree",d=t),d},this.inflate_trees_dynamic=(i,a,s,l,o,b,w,p,x)=>{let g;return h(288),e[0]=0,g=_(s,0,i,257,d,c,b,l,p,e,n),0!=g||0===l[0]?(g==t?x.msg="oversubscribed literal/length tree":-4!=g&&(x.msg="incomplete literal/length tree",g=t),g):(h(288),g=_(s,i,a,0,u,f,w,o,p,e,n),0!=g||0===o[0]&&i>257?(g==t?x.msg="oversubscribed distance tree":g==r?(x.msg="incomplete distance tree",g=t):-4!=g&&(x.msg="empty distance tree with lengths",g=t),g):0)}}function b(){const n=this;let i,a,r,l,o=0,_=0,d=0,c=0,u=0,f=0,h=0,b=0,w=0,p=0;function x(e,n,i,a,r,l,o,_){let d,c,u,f,h,b,w,p,x,g,y,m,v,k,S,z;w=_.next_in_index,p=_.avail_in,h=o.bitb,b=o.bitk,x=o.write,g=x<o.read?o.read-x-1:o.end-x,y=s[e],m=s[n];do{for(;20>b;)p--,h|=(255&_.read_byte(w++))<<b,b+=8;if(d=h&y,c=i,u=a,z=3*(u+d),0!==(f=c[z]))for(;;){if(h>>=c[z+1],b-=c[z+1],0!=(16&f)){for(f&=15,v=c[z+2]+(h&s[f]),h>>=f,b-=f;15>b;)p--,h|=(255&_.read_byte(w++))<<b,b+=8;for(d=h&m,c=r,u=l,z=3*(u+d),f=c[z];;){if(h>>=c[z+1],b-=c[z+1],0!=(16&f)){for(f&=15;f>b;)p--,h|=(255&_.read_byte(w++))<<b,b+=8;if(k=c[z+2]+(h&s[f]),h>>=f,b-=f,g-=v,k>x){S=x-k;do{S+=o.end}while(0>S);if(f=o.end-S,v>f){if(v-=f,x-S>0&&f>x-S)do{o.win[x++]=o.win[S++]}while(0!=--f);else o.win.set(o.win.subarray(S,S+f),x),x+=f,S+=f,f=0;S=0}}else S=x-k,x-S>0&&2>x-S?(o.win[x++]=o.win[S++],o.win[x++]=o.win[S++],v-=2):(o.win.set(o.win.subarray(S,S+2),x),x+=2,S+=2,v-=2);if(x-S>0&&v>x-S)do{o.win[x++]=o.win[S++]}while(0!=--v);else o.win.set(o.win.subarray(S,S+v),x),x+=v,S+=v,v=0;break}if(0!=(64&f))return _.msg="invalid distance code",v=_.avail_in-p,v=v>b>>3?b>>3:v,p+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=p,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=x,t;d+=c[z+2],d+=h&s[f],z=3*(u+d),f=c[z]}break}if(0!=(64&f))return 0!=(32&f)?(v=_.avail_in-p,v=v>b>>3?b>>3:v,p+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=p,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=x,1):(_.msg="invalid literal/length code",v=_.avail_in-p,v=v>b>>3?b>>3:v,p+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=p,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=x,t);if(d+=c[z+2],d+=h&s[f],z=3*(u+d),0===(f=c[z])){h>>=c[z+1],b-=c[z+1],o.win[x++]=c[z+2],g--;break}}else h>>=c[z+1],b-=c[z+1],o.win[x++]=c[z+2],g--}while(g>=258&&p>=10);return v=_.avail_in-p,v=v>b>>3?b>>3:v,p+=v,w-=v,b-=v<<3,o.bitb=h,o.bitk=b,_.avail_in=p,_.total_in+=w-_.next_in_index,_.next_in_index=w,o.write=x,0}n.init=(e,t,n,s,o,_)=>{i=0,h=e,b=t,r=n,w=s,l=o,p=_,a=null},n.proc=(n,g,y)=>{let m,v,k,S,z,I,E,T=0,q=0,A=0;for(A=g.next_in_index,S=g.avail_in,T=n.bitb,q=n.bitk,z=n.write,I=z<n.read?n.read-z-1:n.end-z;;)switch(i){case 0:if(I>=258&&S>=10&&(n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,y=x(h,b,r,w,l,p,n,g),A=g.next_in_index,S=g.avail_in,T=n.bitb,q=n.bitk,z=n.write,I=z<n.read?n.read-z-1:n.end-z,0!=y)){i=1==y?7:9;break}d=h,a=r,_=w,i=1;case 1:for(m=d;m>q;){if(0===S)return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);y=0,S--,T|=(255&g.read_byte(A++))<<q,q+=8}if(v=3*(_+(T&s[m])),T>>>=a[v+1],q-=a[v+1],k=a[v],0===k){c=a[v+2],i=6;break}if(0!=(16&k)){u=15&k,o=a[v+2],i=2;break}if(0==(64&k)){d=k,_=v/3+a[v+2];break}if(0!=(32&k)){i=7;break}return i=9,g.msg="invalid literal/length code",y=t,n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);case 2:for(m=u;m>q;){if(0===S)return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);y=0,S--,T|=(255&g.read_byte(A++))<<q,q+=8}o+=T&s[m],T>>=m,q-=m,d=b,a=l,_=p,i=3;case 3:for(m=d;m>q;){if(0===S)return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);y=0,S--,T|=(255&g.read_byte(A++))<<q,q+=8}if(v=3*(_+(T&s[m])),T>>=a[v+1],q-=a[v+1],k=a[v],0!=(16&k)){u=15&k,f=a[v+2],i=4;break}if(0==(64&k)){d=k,_=v/3+a[v+2];break}return i=9,g.msg="invalid distance code",y=t,n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);case 4:for(m=u;m>q;){if(0===S)return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);y=0,S--,T|=(255&g.read_byte(A++))<<q,q+=8}f+=T&s[m],T>>=m,q-=m,i=5;case 5:for(E=z-f;0>E;)E+=n.end;for(;0!==o;){if(0===I&&(z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I&&(n.write=z,y=n.inflate_flush(g,y),z=n.write,I=z<n.read?n.read-z-1:n.end-z,z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I)))return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);n.win[z++]=n.win[E++],I--,E==n.end&&(E=0),o--}i=0;break;case 6:if(0===I&&(z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I&&(n.write=z,y=n.inflate_flush(g,y),z=n.write,I=z<n.read?n.read-z-1:n.end-z,z==n.end&&0!==n.read&&(z=0,I=z<n.read?n.read-z-1:n.end-z),0===I)))return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);y=0,n.win[z++]=c,I--,i=0;break;case 7:if(q>7&&(q-=8,S++,A--),n.write=z,y=n.inflate_flush(g,y),z=n.write,I=z<n.read?n.read-z-1:n.end-z,n.read!=n.write)return n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);i=8;case 8:return y=1,n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);case 9:return y=t,n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y);default:return y=e,n.bitb=T,n.bitk=q,g.avail_in=S,g.total_in+=A-g.next_in_index,g.next_in_index=A,n.write=z,n.inflate_flush(g,y)}},n.free=()=>{}}h.inflate_trees_fixed=(e,t,n,i)=>(e[0]=9,t[0]=5,n[0]=o,i[0]=_,0);const w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function p(n,i){const o=this;let _,d=0,c=0,u=0,f=0;const p=[0],x=[0],g=new b;let y=0,m=new l(4320);const v=new h;o.bitk=0,o.bitb=0,o.win=new a(i),o.end=i,o.read=0,o.write=0,o.reset=(e,t)=>{t&&(t[0]=0),6==d&&g.free(e),d=0,o.bitk=0,o.bitb=0,o.read=o.write=0},o.reset(n,null),o.inflate_flush=(e,t)=>{let n,i,a;return i=e.next_out_index,a=o.read,n=(a>o.write?o.end:o.write)-a,n>e.avail_out&&(n=e.avail_out),0!==n&&t==r&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(o.win.subarray(a,a+n),i),i+=n,a+=n,a==o.end&&(a=0,o.write==o.end&&(o.write=0),n=o.write-a,n>e.avail_out&&(n=e.avail_out),0!==n&&t==r&&(t=0),e.avail_out-=n,e.total_out+=n,e.next_out.set(o.win.subarray(a,a+n),i),i+=n,a+=n),e.next_out_index=i,o.read=a,t},o.proc=(n,i)=>{let a,r,l,b,k,S,z,I;for(b=n.next_in_index,k=n.avail_in,r=o.bitb,l=o.bitk,S=o.write,z=S<o.read?o.read-S-1:o.end-S;;){let E,T,q,A,C,R,V,B;switch(d){case 0:for(;3>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}switch(a=7&r,y=1&a,a>>>1){case 0:r>>>=3,l-=3,a=7&l,r>>>=a,l-=a,d=1;break;case 1:E=[],T=[],q=[[]],A=[[]],h.inflate_trees_fixed(E,T,q,A),g.init(E[0],T[0],q[0],0,A[0],0),r>>>=3,l-=3,d=6;break;case 2:r>>>=3,l-=3,d=3;break;case 3:return r>>>=3,l-=3,d=9,n.msg="invalid block type",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i)}break;case 1:for(;32>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if((~r>>>16&65535)!=(65535&r))return d=9,n.msg="invalid stored block lengths",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);c=65535&r,r=l=0,d=0!==c?2:0!==y?7:0;break;case 2:if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);if(0===z&&(S==o.end&&0!==o.read&&(S=0,z=S<o.read?o.read-S-1:o.end-S),0===z&&(o.write=S,i=o.inflate_flush(n,i),S=o.write,z=S<o.read?o.read-S-1:o.end-S,S==o.end&&0!==o.read&&(S=0,z=S<o.read?o.read-S-1:o.end-S),0===z)))return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);if(i=0,a=c,a>k&&(a=k),a>z&&(a=z),o.win.set(n.read_buf(b,a),S),b+=a,k-=a,S+=a,z-=a,0!=(c-=a))break;d=0!==y?7:0;break;case 3:for(;14>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if(u=a=16383&r,(31&a)>29||(a>>5&31)>29)return d=9,n.msg="too many length or distance symbols",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);if(a=258+(31&a)+(a>>5&31),!_||_.length<a)_=[];else for(I=0;a>I;I++)_[I]=0;r>>>=14,l-=14,f=0,d=4;case 4:for(;4+(u>>>10)>f;){for(;3>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}_[w[f++]]=7&r,r>>>=3,l-=3}for(;19>f;)_[w[f++]]=0;if(p[0]=7,a=v.inflate_trees_bits(_,p,x,m,n),0!=a)return(i=a)==t&&(_=null,d=9),o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);f=0,d=5;case 5:for(;a=u,258+(31&a)+(a>>5&31)>f;){let e,c;for(a=p[0];a>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if(a=m[3*(x[0]+(r&s[a]))+1],c=m[3*(x[0]+(r&s[a]))+2],16>c)r>>>=a,l-=a,_[f++]=c;else{for(I=18==c?7:c-14,e=18==c?11:3;a+I>l;){if(0===k)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);i=0,k--,r|=(255&n.read_byte(b++))<<l,l+=8}if(r>>>=a,l-=a,e+=r&s[I],r>>>=I,l-=I,I=f,a=u,I+e>258+(31&a)+(a>>5&31)||16==c&&1>I)return _=null,d=9,n.msg="invalid bit length repeat",i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);c=16==c?_[I-1]:0;do{_[I++]=c}while(0!=--e);f=I}}if(x[0]=-1,C=[],R=[],V=[],B=[],C[0]=9,R[0]=6,a=u,a=v.inflate_trees_dynamic(257+(31&a),1+(a>>5&31),_,C,R,V,B,m,n),0!=a)return a==t&&(_=null,d=9),i=a,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);g.init(C[0],R[0],m,V[0],m,B[0]),d=6;case 6:if(o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,1!=(i=g.proc(o,n,i)))return o.inflate_flush(n,i);if(i=0,g.free(n),b=n.next_in_index,k=n.avail_in,r=o.bitb,l=o.bitk,S=o.write,z=S<o.read?o.read-S-1:o.end-S,0===y){d=0;break}d=7;case 7:if(o.write=S,i=o.inflate_flush(n,i),S=o.write,z=S<o.read?o.read-S-1:o.end-S,o.read!=o.write)return o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);d=8;case 8:return i=1,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);case 9:return i=t,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i);default:return i=e,o.bitb=r,o.bitk=l,n.avail_in=k,n.total_in+=b-n.next_in_index,n.next_in_index=b,o.write=S,o.inflate_flush(n,i)}}},o.free=e=>{o.reset(e,null),o.win=null,m=null},o.set_dictionary=(e,t,n)=>{o.win.set(e.subarray(t,t+n),0),o.read=o.write=n},o.sync_point=()=>1==d?1:0}const x=13,g=[0,0,255,255];function y(){const n=this;function i(t){return t&&t.istate?(t.total_in=t.total_out=0,t.msg=null,t.istate.mode=7,t.istate.blocks.reset(t,null),0):e}n.mode=0,n.method=0,n.was=[0],n.need=0,n.marker=0,n.wbits=0,n.inflateEnd=e=>(n.blocks&&n.blocks.free(e),n.blocks=null,0),n.inflateInit=(t,a)=>(t.msg=null,n.blocks=null,8>a||a>15?(n.inflateEnd(t),e):(n.wbits=a,t.istate.blocks=new p(t,1<<a),i(t),0)),n.inflate=(n,i)=>{let a,s;if(!n||!n.istate||!n.next_in)return e;const l=n.istate;for(i=4==i?r:0,a=r;;)switch(l.mode){case 0:if(0===n.avail_in)return a;if(a=i,n.avail_in--,n.total_in++,8!=(15&(l.method=n.read_byte(n.next_in_index++)))){l.mode=x,n.msg="unknown compression method",l.marker=5;break}if(8+(l.method>>4)>l.wbits){l.mode=x,n.msg="invalid win size",l.marker=5;break}l.mode=1;case 1:if(0===n.avail_in)return a;if(a=i,n.avail_in--,n.total_in++,s=255&n.read_byte(n.next_in_index++),((l.method<<8)+s)%31!=0){l.mode=x,n.msg="incorrect header check",l.marker=5;break}if(0==(32&s)){l.mode=7;break}l.mode=2;case 2:if(0===n.avail_in)return a;a=i,n.avail_in--,n.total_in++,l.need=(255&n.read_byte(n.next_in_index++))<<24&4278190080,l.mode=3;case 3:if(0===n.avail_in)return a;a=i,n.avail_in--,n.total_in++,l.need+=(255&n.read_byte(n.next_in_index++))<<16&16711680,l.mode=4;case 4:if(0===n.avail_in)return a;a=i,n.avail_in--,n.total_in++,l.need+=(255&n.read_byte(n.next_in_index++))<<8&65280,l.mode=5;case 5:return 0===n.avail_in?a:(a=i,n.avail_in--,n.total_in++,l.need+=255&n.read_byte(n.next_in_index++),l.mode=6,2);case 6:return l.mode=x,n.msg="need dictionary",l.marker=0,e;case 7:if(a=l.blocks.proc(n,a),a==t){l.mode=x,l.marker=0;break}if(0==a&&(a=i),1!=a)return a;a=i,l.blocks.reset(n,l.was),l.mode=12;case 12:return n.avail_in=0,1;case x:return t;default:return e}},n.inflateSetDictionary=(t,n,i)=>{let a=0,r=i;if(!t||!t.istate||6!=t.istate.mode)return e;const s=t.istate;return r<1<<s.wbits||(r=(1<<s.wbits)-1,a=i-r),s.blocks.set_dictionary(n,a,r),s.mode=7,0},n.inflateSync=n=>{let a,s,l,o,_;if(!n||!n.istate)return e;const d=n.istate;if(d.mode!=x&&(d.mode=x,d.marker=0),0===(a=n.avail_in))return r;for(s=n.next_in_index,l=d.marker;0!==a&&4>l;)n.read_byte(s)==g[l]?l++:l=0!==n.read_byte(s)?0:4-l,s++,a--;return n.total_in+=s-n.next_in_index,n.next_in_index=s,n.avail_in=a,d.marker=l,4!=l?t:(o=n.total_in,_=n.total_out,i(n),n.total_in=o,n.total_out=_,d.mode=7,0)},n.inflateSyncPoint=t=>t&&t.istate&&t.istate.blocks?t.istate.blocks.sync_point():e}function m(){}return m.prototype={inflateInit(e){const t=this;return t.istate=new y,e||(e=15),t.istate.inflateInit(t,e)},inflate(t){const n=this;return n.istate?n.istate.inflate(n,t):e},inflateEnd(){const t=this;if(!t.istate)return e;const n=t.istate.inflateEnd(t);return t.istate=null,n},inflateSync(){const t=this;return t.istate?t.istate.inflateSync(t):e},inflateSetDictionary(t,n){const i=this;return i.istate?i.istate.inflateSetDictionary(i,t,n):e},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}},function(e){const t=new m,s=e&&e.chunkSize?n.floor(2*e.chunkSize):131072,l=new a(s);let o=!1;t.inflateInit(),t.next_out=l,this.append=(e,n)=>{const _=[];let d,c,u=0,f=0,h=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=s,0!==t.avail_in||o||(t.next_in_index=0,o=!0),d=t.inflate(0),o&&d===r){if(0!==t.avail_in)throw new i("inflating: bad input")}else if(0!==d&&1!==d)throw new i("inflating: "+t.msg);if((o||1===d)&&t.avail_in===e.length)throw new i("inflating: bad input");t.next_out_index&&(t.next_out_index===s?_.push(new a(l)):_.push(l.slice(0,t.next_out_index))),h+=t.next_out_index,n&&t.next_in_index>0&&t.next_in_index!=u&&(n(t.next_in_index),u=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return _.length>1?(c=new a(h),_.forEach((e=>{c.set(e,f),f+=e.length}))):c=_[0]||new a,c}},this.flush=()=>{t.inflateEnd()}}})();self.initCodec=()=>{self.Deflate=Be,self.Inflate=He}}();
|