@gmod/cram 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cram-bundle.js +1 -1
- package/dist/cram-bundle.js.LICENSE.txt +0 -9
- package/dist/io/index.d.ts +1 -1
- package/dist/io/index.js +3 -3
- package/dist/io/index.js.map +1 -1
- package/esm/io/index.d.ts +1 -1
- package/esm/io/index.js +1 -1
- package/esm/io/index.js.map +1 -1
- package/package.json +1 -1
- package/src/io/index.ts +1 -1
package/dist/cram-bundle.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see cram-bundle.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={4923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9747),i=r(5931),o=r(8876);function s(e,t){const[r,n,i,o,s,a]=t,A=r;e[A]||(e[A]=[]),e[A].push({start:n,span:i,containerStart:o,sliceStart:s,sliceBytes:a})}t.default=class{constructor(e){this.filehandle=(0,i.open)(e.url,e.path,e.filehandle)}async parseIndex(){const e={},t=31===(r=await this.filehandle.readFile())[0]&&139===r[1]?(0,o.unzip)(r):r;var r;const i=new DataView(t.buffer);if(t.length>4&&21578050===i.getUint32(0,!0))throw new n.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");let a=[],A="";for(const r of t)if(r>=48&&r<=57||!A&&45===r)A+=String.fromCharCode(r);else if(9===r)a.push(Number.parseInt(A,10)),A="";else if(10===r)a.push(Number.parseInt(A,10)),A="",s(e,a),a=[];else if(13!==r&&32!==r)throw new n.CramMalformedError("invalid .crai index file");return A&&a.push(Number.parseInt(A,10)),6===a.length&&s(e,a),Object.entries(e).forEach((([t,r])=>{const n=r;e[t]=n.sort(((e,t)=>e.start-t.start||e.span-t.span))})),e}getIndex(){return this.parseIndexP||(this.parseIndexP=this.parseIndex().catch((e=>{throw this.parseIndexP=void 0,e}))),this.parseIndexP}async hasDataForReferenceSequence(e){return!!(await this.getIndex())[e]}async getEntriesForRange(e,t,r){const n=(await this.getIndex())[e];if(!n)return[];const i=e=>{const n=e.start,i=e.start+e.span;return n>r?-1:i<=t?1:0},o=[];for(const e of n)0===i(e)&&o.push(e);return o}}},9508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t){this.parameters=e,this.dataType=t}}},368:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(612),s=r(9747);class a extends i.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by BETA codec`)}decode(e,t,r,n){return(0,o.getBits)(t.content,n.coreBlock,this.parameters.length)-this.parameters.offset}}t.default=a},8635:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(400);class s extends i.default{constructor(e,t,r){super(e,t),this.instantiateCodec=r}decode(e,t,r,n){const i=this._getLengthCodec().decode(e,t,r,n),o=this._getDataCodec(),s=new Uint8Array(i);for(let a=0;a<i;a+=1)s[a]=o.decode(e,t,r,n);return s}_getLengthCodec(){const e=this.parameters.lengthsEncoding;return this.instantiateCodec(e,"int")}_getDataCodec(){const e=this.parameters.valuesEncoding;return this.instantiateCodec(e,"byte")}}t.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((e=>{(0,o.tinyMemoize)(s,e)}))},4839:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(9747),s=r(612);class a extends i.default{decode(e,t,r,n){const{blockContentId:i}=this.parameters,s=r[i];if(!s)throw new o.CramMalformedError(`no block found with content ID ${i}`);const a=n.externalBlocks.getCursor(i);return this._decodeByteArray(s,a)}_decodeByteArray(e,t){const r=e.content,{stopByte:n}=this.parameters,i=t.bytePosition;let o=t.bytePosition;for(;r[o]!==n&&o<r.length;){if(o===r.length)throw new s.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");o+=1}return t.bytePosition=o+1,r.subarray(i,o)}}t.default=a},8153:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(9747),s=r(400),a=r(612);class A extends i.default{constructor(e,t){if(super(e,t),"int"===this.dataType)this._decodeData=this._decodeInt;else{if("byte"!==this.dataType)throw new o.CramUnimplementedError(`${this.dataType} decoding not yet implemented by EXTERNAL codec`);this._decodeData=this._decodeByte}}decode(e,t,r,n){const{blockContentId:i}=this.parameters,s=r[i];if(!s)throw new o.CramMalformedError(`no block found with content ID ${i}}`);const a=n.externalBlocks.getCursor(i);return this._decodeData(s,a)}_decodeInt(e,t){const[r,n]=(0,s.parseItf8)(e.content,t.bytePosition);return t.bytePosition=t.bytePosition+n,r}_decodeByte(e,t){if(t.bytePosition>=e.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return e.content[t.bytePosition++]}}t.default=A},8185:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(612),s=r(9747);class a extends i.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by GAMMA codec`)}decode(e,t,r,n){let i=1;for(;0===(0,o.getBits)(t.content,n.coreBlock,1);)i+=1;return((0,o.getBits)(t.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset}}t.default=a},612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CramBufferOverrunError=void 0,t.getBits=function(e,t,n){let i=0;if(t.bytePosition+(7-t.bitPosition+n)/8>e.length)throw new r("read error during decoding. the file seems to be truncated.");for(let r=n;r;r--)i<<=1,i|=e[t.bytePosition]>>t.bitPosition&1,t.bitPosition-=1,t.bitPosition<0&&(t.bytePosition+=1),t.bitPosition&=7;return i};class r extends Error{}t.CramBufferOverrunError=r},4341:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(612),s=r(9747);class a extends i.default{constructor(e,t){if(super(e,t),this.codes={},this.codeBook={},this.sortedCodes=[],this.sortedValuesByBitCode=[],this.sortedBitCodes=[],this.sortedBitLengthsByBitCode=[],this.bitCodeToValue=[],!["byte","int"].includes(this.dataType))throw new TypeError(`${this.dataType} decoding not yet implemented by HUFFMAN_INT codec`);this.buildCodeBook(),this.buildCodes(),this.buildCaches(),0===this.sortedCodes[0].bitLength&&(this._decode=this._decodeZeroLengthCode)}buildCodeBook(){let e=new Array(this.parameters.numCodes);for(let t=0;t<this.parameters.numCodes;t++)e[t]={symbol:this.parameters.symbols[t],bitLength:this.parameters.bitLengths[t]};e=e.sort(((e,t)=>e.bitLength-t.bitLength||e.symbol-t.symbol)),this.codeBook={},e.forEach((e=>{this.codeBook[e.bitLength]||(this.codeBook[e.bitLength]=[]),this.codeBook[e.bitLength].push(e.symbol)}))}buildCodes(){this.codes={};let e=0,t=-1;Object.entries(this.codeBook).forEach((([r,n])=>{const i=Number.parseInt(r,10);n.forEach((r=>{const n={bitLength:i,value:r,bitCode:0};t+=1;const o=i-e;if(t<<=o,n.bitCode=t,e+=o,function(e){let t=e-(e>>1)&1431655765;return t=(858993459&t)+(t>>2&858993459),16843009*(t+(t>>4)&252645135)>>24}(t)>i)throw new s.CramMalformedError("Symbol out of range");this.codes[r]=n}))}))}buildCaches(){this.sortedCodes=Object.values(this.codes).sort(((e,t)=>e.bitLength-t.bitLength||e.bitCode-t.bitCode)),this.sortedValuesByBitCode=this.sortedCodes.map((e=>e.value)),this.sortedBitCodes=this.sortedCodes.map((e=>e.bitCode)),this.sortedBitLengthsByBitCode=this.sortedCodes.map((e=>e.bitLength));const e=Math.max(...this.sortedBitCodes);this.bitCodeToValue=new Array(e+1).fill(-1);for(let e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e}decode(e,t,r,n){return this._decode(e,t,n.coreBlock)}_decodeZeroLengthCode(){return this.sortedCodes[0].value}_decode(e,t,r){const n=t.content;let i=0,a=0;for(let e=0;e<this.sortedCodes.length;e+=1){const t=this.sortedCodes[e].bitLength;a<<=t-i,a|=(0,o.getBits)(n,r,t-i),i=t;{const r=this.bitCodeToValue[a];if(r>-1&&this.sortedBitLengthsByBitCode[r]===t)return this.sortedValuesByBitCode[r];for(let r=e;this.sortedCodes[r+1].bitLength===t&&r<this.sortedCodes.length;r+=1)e+=1}}throw new s.CramMalformedError("Huffman symbol not found.")}}t.default=a},6524:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.instantiateCodec=function e(t,r){const n=(i="ignore"===r?0:t.codecId,c[i]);var i;if(!n)throw new u.CramUnimplementedError(`no codec implemented for codec ID ${t.codecId}`);return new n(t.parameters,r,e)};const i=n(r(368)),o=n(r(8635)),s=n(r(4839)),a=n(r(8153)),A=n(r(8185)),h=n(r(4341)),f=n(r(99)),u=r(9747),c={1:a.default,3:h.default,4:o.default,5:s.default,6:i.default,7:f.default,9:A.default}},99:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),o=r(612),s=r(9747);class a extends i.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by SUBEXP codec`)}decode(e,t,r,n){let i,s,a=0;for(;(0,o.getBits)(t.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,s=(0,o.getBits)(t.content,n.coreBlock,i)):(i=a+this.parameters.K-1,s=1<<i|(0,o.getBits)(t.content,n.coreBlock,i)),s-this.parameters.offset}}t.default=a},7295:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},7219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9747),i=r(6524),o={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int"};t.default=class{constructor(e){this.dataSeriesCodecCache={},this.tagCodecCache={},this.tagEncoding={},this.readNamesIncluded=e.preservation.RN,this.APdelta=e.preservation.AP,this.referenceRequired=!!e.preservation.RR,this.tagIdsDictionary=e.preservation.TD,this.substitutionMatrix=function(e){const t=new Array(5);for(let e=0;e<5;e+=1)t[e]=new Array(4);return t[0][e[0]>>6&3]="C",t[0][e[0]>>4&3]="G",t[0][e[0]>>2&3]="T",t[0][3&e[0]]="N",t[1][e[1]>>6&3]="A",t[1][e[1]>>4&3]="G",t[1][e[1]>>2&3]="T",t[1][3&e[1]]="N",t[2][e[2]>>6&3]="A",t[2][e[2]>>4&3]="C",t[2][e[2]>>2&3]="T",t[2][3&e[2]]="N",t[3][e[3]>>6&3]="A",t[3][e[3]>>4&3]="C",t[3][e[3]>>2&3]="G",t[3][3&e[3]]="N",t[4][e[4]>>6&3]="A",t[4][e[4]>>4&3]="C",t[4][e[4]>>2&3]="G",t[4][3&e[4]]="T",t}(e.preservation.SM),this.dataSeriesEncoding=e.dataSeriesEncoding,this.tagEncoding=e.tagEncoding}getCodecForTag(e){const t=this.tagCodecCache[e];if(t)return t;{const t=this.tagEncoding[e];if(!t)throw new Error("Error, no tag encoding");const r=(0,i.instantiateCodec)(t,"byteArray");return this.tagCodecCache[e]=r,r}}getTagNames(e){return this.tagIdsDictionary[e]}getCodecForDataSeries(e){let t=this.dataSeriesCodecCache[e];if(void 0===t){const r=this.dataSeriesEncoding[e];if(r){const s=o[e];if(!s)throw new n.CramMalformedError(`data series name ${e} not defined in file compression header`);t=(0,i.instantiateCodec)(r,s),this.dataSeriesCodecCache[e]=t}}return t}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.endsWith("Cache")||(e[t]=this[t])})),e}}},78:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9747),o=n(r(6771)),s=r(400),a=n(r(7219)),A=r(3165);class h{constructor(e,t){this.file=e,this.filePosition=t}getHeader(){return this._readContainerHeader(this.filePosition)}async getCompressionHeaderBlock(){const e=await this.getHeader();if(!e?.numRecords)return null;const{majorVersion:t}=await this.file.getDefinition(),r=(0,A.getSectionParsers)(t),n=await this.getFirstBlock();if(void 0===n)return;if("COMPRESSION_HEADER"!==n.contentType)throw new i.CramMalformedError(`invalid content type ${n.contentType} in compression header block`);const o=(0,s.parseItem)(n.content,r.cramCompressionHeader.parser,0,n.contentPosition);return{...n,parsedContent:o}}async getFirstBlock(){const e=await this.getHeader();if(e)return this.file.readBlock(e._endPosition)}async getCompressionScheme(){const e=await this.getCompressionHeaderBlock();if(e)return new a.default(e.parsedContent)}getSlice(e,t){return new o.default(this,e,t)}async _readContainerHeader(e){const{majorVersion:t}=await this.file.getDefinition(),r=(0,A.getSectionParsers)(t),{cramContainerHeader1:n,cramContainerHeader2:i}=r,{size:o}=await this.file.stat();if(e>=o)return void console.warn(`pos:${e}>=fileSize:${o} in cram container`);const a=await this.file.read(n.maxLength,e),h=(0,s.parseItem)(a,n.parser),f=(0,s.itf8Size)(h.numLandmarks);if(e+h.length>=o)return void console.warn(`container at ${e} is beyond fileSize:${o}, skipping`);const u=await this.file.read(i.maxLength(h.numLandmarks),e+h._size-f),c=(0,s.parseItem)(u,i.parser);return this.file.validateChecksums&&void 0!==c.crc32&&await this.file.checkCrc32(e,h._size+c._size-f-4,c.crc32,`container header beginning at position ${e}`),Object.assign(h,c,{_size:h._size+c._size-f,_endPosition:h._size+c._size-f+e})}}t.default=h,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((e=>{(0,s.tinyMemoize)(h,e)}))},6794:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(235)),o=n(r(86)),s=n(r(7392)),a=r(1307),A=r(9747),h=n(r(9151)),f=r(5931),u=n(r(9989)),c=r(5417),l=r(8876),g=n(r(78)),d=r(3165),I=r(400);class C{constructor(e){if(this.file=(0,f.open)(e.url,e.path,e.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=e.seqFetch,this.options={checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize??2e4},this.featureCache=new s.default({maxSize:this.options.cacheSize}),function(){const e=new Uint32Array([287454020]),t=new Uint8Array(e.buffer);return 68===t[0]?0:17===t[0]?1:2}()>0)throw new Error("Detected big-endian machine, may be unable to run")}stat(){return this.file.stat()}read(e,t){return this.file.read(e,t)}async getDefinition(){const{maxLength:e,parser:t}=(0,d.cramFileDefinition)(),r=t(await this.file.read(e,0)).value;if(2!==r.majorVersion&&3!==r.majorVersion)throw new A.CramUnimplementedError(`CRAM version ${r.majorVersion} not supported`);return r}async getSamHeader(){const e=await this.getContainerById(0);if(!e)throw new A.CramMalformedError("file contains no containers");const t=await e.getFirstBlock();if(void 0===t)return(0,c.parseHeaderText)("");{const e=t.content,r=new DataView(e.buffer).getInt32(0,!0),n=4,i=new TextDecoder("utf8").decode(e.subarray(n,n+r));return this.header=i,(0,c.parseHeaderText)(i)}}async getHeaderText(){return await this.getSamHeader(),this.header}async getContainerById(e){const{majorVersion:t}=await this.getDefinition(),r=(0,d.getSectionParsers)(t);let n=r.cramFileDefinition.maxLength;const{size:i}=await this.file.stat(),{cramContainerHeader1:o}=r;let s;for(let t=0;t<=e;t++){if(n+o.maxLength+8>=i)return;s=this.getContainerAtPosition(n);const r=await s.getHeader();if(!r)throw new A.CramMalformedError(`container ${e} not found in file`);if(0===t){n=r._endPosition;for(let e=0;e<r.numBlocks;e++){const e=await this.readBlock(n);if(void 0===e)return;n=e._endPosition}}else n+=r._size+r.length}return s}async checkCrc32(e,t,r,n){const i=await this.file.read(t,e),s=(0,o.default)(i)>>>0;if(s!==r)throw new A.CramMalformedError(`crc mismatch in ${n}: recorded CRC32 = ${r}, but calculated CRC32 = ${s}`)}async containerCount(){const{majorVersion:e}=await this.getDefinition(),t=(0,d.getSectionParsers)(e),{size:r}=await this.file.stat(),{cramContainerHeader1:n}=t;let i=0,o=t.cramFileDefinition.maxLength;for(;o+n.maxLength+8<r;){const e=await this.getContainerAtPosition(o).getHeader();if(!e)break;if(0===i){o=e._endPosition;for(let t=0;t<e.numBlocks;t++){const e=await this.readBlock(o);if(void 0===e)return;o=e._endPosition}}else o+=e._size+e.length;i+=1}return i}getContainerAtPosition(e){return new g.default(this,e)}async readBlockHeader(e){const{majorVersion:t}=await this.getDefinition(),r=(0,d.getSectionParsers)(t),{cramBlockHeader:n}=r,{size:i}=await this.file.stat();if(e+n.maxLength>=i)return;const o=await this.file.read(n.maxLength,e);return(0,I.parseItem)(o,n.parser,0,e)}async _parseSection(e,t,r=e.maxLength,n){let i;if(n)i=n;else{const{size:e}=await this.file.stat();if(t+r>=e)return;i=await this.file.read(r,t)}const o=(0,I.parseItem)(i,e.parser,0,t);if(o._size!==r)throw new A.CramMalformedError(`section read error: requested size ${r} does not equal parsed size ${o._size}`);return o}async _uncompress(e,t,r){if("gzip"===e)return(0,l.unzip)(t);if("bzip2"===e){const e=i.default.array(t);let r,n=i.default.header(e);const o=[];do{r=i.default.decompress(e,n),-1!==r&&(o.push(r),n-=r.length)}while(-1!==r);return(0,I.concatUint8Array)(o)}if("lzma"===e){const e=new Response(new a.XzReadableStream((n=t,new ReadableStream({start(e){e.enqueue(n),e.close()}}))));return new Uint8Array(await e.arrayBuffer())}if("rans"===e){const e=new Uint8Array(r);return(0,u.default)(t,e),e}if("rans4x16"===e)return h.default.r4x16_uncompress(t);if("arith"===e)return h.default.arith_uncompress(t);if("fqzcomp"===e)return h.default.fqzcomp_uncompress(t);if("tok3"===e)return h.default.tok3_uncompress(t);throw new A.CramUnimplementedError(`${e} decompression not yet implemented`);var n}async readBlock(e){const{majorVersion:t}=await this.getDefinition(),r=(0,d.getSectionParsers)(t),n=await this.readBlockHeader(e);if(void 0===n)return;const i=n._endPosition,o=await this.file.read(n.compressedSize,i),s="raw"!==n.compressionMethod?await this._uncompress(n.compressionMethod,o,n.uncompressedSize):o,a={...n,_endPosition:i,contentPosition:i,content:s};if(t>=3){const t=await this._parseSection(r.cramBlockCrc32,i+n.compressedSize);if(void 0===t)return;a.crc32=t.crc32,this.validateChecksums&&await this.checkCrc32(e,n._size+n.compressedSize,t.crc32,"block data"),a._endPosition=t._endPosition,a._size=a.compressedSize+r.cramBlockCrc32.maxLength}else a._endPosition=i+a.compressedSize,a._size=a.compressedSize;return a}}t.default=C,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((e=>{(0,I.tinyMemoize)(C,e)}))},7390:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CramRecord=void 0;var i=r(8401);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return n(i).default}});var o=r(6794);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(o).default}})},8401:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MateFlagsDecoder=t.CramFlagsDecoder=t.BamFlagsDecoder=t.MateFlags=t.CramFlags=t.BamFlags=void 0;const i=n(r(7295)),o={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};function s(e){const t={};for(const[r,n]of e)t[`is${n}`]=e=>!!(e&r),t[`set${n}`]=e=>e|r;return t}t.BamFlags=[[1,"Paired"],[2,"ProperlyPaired"],[4,"SegmentUnmapped"],[8,"MateUnmapped"],[16,"ReverseComplemented"],[32,"MateReverseComplemented"],[64,"Read1"],[128,"Read2"],[256,"Secondary"],[512,"FailedQc"],[1024,"Duplicate"],[2048,"Supplementary"]],t.CramFlags=[[1,"PreservingQualityScores"],[2,"Detached"],[4,"WithMateDownstream"],[8,"DecodeSequenceAsStar"]],t.MateFlags=[[1,"OnNegativeStrand"],[2,"Unmapped"]],t.BamFlagsDecoder=s(t.BamFlags),t.CramFlagsDecoder=s(t.CramFlags),t.MateFlagsDecoder=s(t.MateFlags),t.default=class{constructor({flags:e,cramFlags:t,readLength:r,mappingQuality:n,lengthOnRef:i,qualityScores:o,mateRecordNumber:s,readBases:a,readFeatures:A,mateToUse:h,readGroupId:f,readName:u,sequenceId:c,uniqueId:l,templateSize:g,alignmentStart:d,tags:I}){this.flags=e,this.cramFlags=t,this.readLength=r,this.mappingQuality=n,this.lengthOnRef=i,this.qualityScores=o,a&&(this.readBases=a),this.readGroupId=f,this.readName=u,this.sequenceId=c,this.uniqueId=l,this.templateSize=g,this.alignmentStart=d,this.tags=I,A&&(this.readFeatures=A),h&&(this.mate={flags:h.mateFlags,readName:h.mateReadName,sequenceId:h.mateSequenceId,alignmentStart:h.mateAlignmentStart}),s&&(this.mateRecordNumber=s)}isPaired(){return!!(this.flags&i.default.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&i.default.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&i.default.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&i.default.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&i.default.BAM_FMREVERSE)}isRead1(){return!!(this.flags&i.default.BAM_FREAD1)}isRead2(){return!!(this.flags&i.default.BAM_FREAD2)}isSecondary(){return!!(this.flags&i.default.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&i.default.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&i.default.BAM_FDUP)}isSupplementary(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)}isDetached(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)}hasMateDownStream(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)}isPreservingQualityScores(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)}isUnknownBases(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)}getReadBases(){if(!this.readBases&&this._refRegion){const e=function(e,t){if(!e.lengthOnRef&&!e.readLength)return null;if(e.isUnknownBases())return null;const r=e.alignmentStart-t.start;if(!e.readFeatures)return t.seq.slice(r,r+(e.lengthOnRef||0)).toUpperCase();let n="",i=r,o=0;for(;n.length<e.readLength;)if(o<e.readFeatures.length){const r=e.readFeatures[o];if("Q"===r.code||"q"===r.code)o+=1;else if(r.pos===n.length+1)if(o+=1,"b"===r.code){const e=r.data;n+=e,i+=e.length}else"B"===r.code?(n+=r.data[0],i+=1):"X"===r.code?(n+=r.sub,i+=1):"I"===r.code?n+=r.data:"D"===r.code?i+=r.data:"i"===r.code?n+=r.data:"N"===r.code?i+=r.data:"S"===r.code?n+=r.data:"P"===r.code||r.code;else if(o<e.readFeatures.length){const e=t.seq.slice(i,i+r.pos-n.length-1);n+=e,i+=e.length}}else{const r=t.seq.slice(i,i+e.readLength-n.length);n+=r,i+=r.length}return n.toUpperCase()}(this,this._refRegion);e&&(this.readBases=e)}return this.readBases}getPairOrientation(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){const e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F";let r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");const i=[];let o=this.templateLength||this.templateSize;if(void 0===o)throw new Error("One of templateSize and templateLength must be set");return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=e,i[1]=r,i[2]=t,i[3]=n):(i[2]=e,i[3]=r,i[0]=t,i[1]=n),i.join("")}return null}addReferenceSequence(e,t){this.readFeatures&&this.readFeatures.forEach((r=>{"X"===r.code&&function(e,t,r,n){const i=n.refPos-t.start,s=t.seq.charAt(i);s&&(n.ref=s);let a=o[s];void 0===a&&(a=4);const A=r.substitutionMatrix[a][n.data];A&&(n.sub=A)}(0,e,t,r)})),!this.readBases&&e.start<=this.alignmentStart&&e.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=e)}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.startsWith("_")||(e[t]=this[t])})),e.readBases=this.getReadBases(),e}}},3165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cramFileDefinition=i,t.cramBlockHeader=o,t.cramBlockCrc32=s,t.cramTagDictionary=A,t.cramPreservationMap=h,t.isMappedSliceHeader=function(e){return"number"==typeof e.refSeqId},t.getSectionParsers=function(e){return{cramFileDefinition:i(),cramBlockHeader:o(),cramBlockCrc32:s(),cramDataSeriesEncodingMap:g(),cramTagEncodingMap:d(),cramCompressionHeader:{parser:(e,t)=>{const{value:r,offset:n}=h().parser(e,t);t=n;const{value:i,offset:o}=g().parser(e,t);t=o;const{value:s,offset:a}=d().parser(e,t);return t=a,{value:{dataSeriesEncoding:f(i),preservation:f(r),tagEncoding:f(s)},offset:t}}},cramEncoding:{parser:(e,t)=>l(e,t)},cramUnmappedSliceHeader:u(e),cramMappedSliceHeader:c(e),cramContainerHeader1:I(e),cramContainerHeader2:C(e)}};const n=r(400);function i(){return{parser:(e,t=0)=>{const r=new DataView(e.buffer,e.byteOffset,e.length),n=new TextDecoder("utf8");let i=0;const o=n.decode(e.subarray(i,i+4));i+=4;const s=r.getUint8(i);i+=1;const a=r.getUint8(i);i+=1;const A=n.decode(e.subarray(i,i+20)).replaceAll("\0","");return i+=20,{value:{magic:o,majorVersion:s,minorVersion:a,fileId:A},offset:i}},maxLength:26}}function o(){return{parser:(e,t=0)=>{const r=e,i=new DataView(r.buffer,r.byteOffset,r.length);let o=0;const s=i.getUint8(o),a=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][s];if(!a)throw new Error(`compression method number ${s} not implemented`);o+=1;const A=i.getUint8(o),h=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][A];if(!h)throw new Error(`invalid block content type id ${A}`);o+=1;const[f,u]=(0,n.parseItf8)(e,o);o+=u;const[c,l]=(0,n.parseItf8)(e,o);o+=l;const[g,d]=(0,n.parseItf8)(e,o);return o+=d,{offset:o,value:{uncompressedSize:g,compressedSize:c,contentId:f,contentType:h,compressionMethod:a}}},maxLength:17}}function s(){return{parser:(e,t)=>{const r=e,n=new DataView(r.buffer,r.byteOffset,r.length).getUint32(t,!0);return{offset:t+=4,value:{crc32:n}}},maxLength:4}}function a(e,t,r){const n=new TextDecoder("utf8").decode(e.subarray(t,r)),i=[];for(let e=0;e<n.length;e+=3)i.push(n.slice(e,e+3));return i}function A(){return{parser:(e,t)=>{const[r,i]=(0,n.parseItf8)(e,t);t+=i;const o=e.subarray(t,t+r);t+=r;const s=[];let A=0,h=0;for(;h<o.length;h++)o[h]||(s.push(a(o,A,h)),A=h+1);return h>A&&s.push(a(o,A,h)),{value:{size:r,ents:s},offset:t}}}}function h(){return{parser:(e,t)=>{const r=e,i=new DataView(r.buffer,r.byteOffset,r.length),[o,s]=(0,n.parseItf8)(e,t);t+=s;const[a,h]=(0,n.parseItf8)(e,t);t+=h;const f=[];for(let r=0;r<a;r++){const r=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(t+=2,"MI"===r||"UI"===r||"PI"===r||"RN"===r||"AP"===r||"RR"===r)f.push({key:r,value:!!i.getUint8(t)}),t+=1;else if("SM"===r)f.push({key:r,value:[i.getUint8(t),i.getUint8(t+1),i.getUint8(t+2),i.getUint8(t+3),i.getUint8(t+4)]}),t+=5;else{if("TD"!==r)throw new Error(`unknown key ${r}`);{const{offset:n,value:i}=A().parser(e,t);f.push({key:r,value:i.ents}),t=n}}}return{value:{mapSize:o,mapCount:a,ents:f},offset:t}}}}function f(e){const t={};for(const{key:r,value:n}of e.ents)t[r]&&console.warn(`duplicate key ${r} in map`),t[r]=n;return t}function u(e){let t=0;return t+=5,t+=9,t+=10,t+=16,{parser:(t,r)=>{const[i,o]=(0,n.parseItf8)(t,r);r+=o;let s=0;if(e>=3){const[e,i]=(0,n.parseLtf8)(t,r);r+=i,s=e}else if(2===e){const[e,i]=(0,n.parseItf8)(t,r);r+=i,s=e}else console.warn("recordCounter=0");const[a,A]=(0,n.parseItf8)(t,r);r+=A;const[h,f]=(0,n.parseItf8)(t,r);r+=f;const u=[];for(let e=0;e<h;e++){const[e,i]=(0,n.parseItf8)(t,r);r+=i,u.push(e)}let c;return e>=2&&(c=[...t.subarray(r,r+16)],r+=16),{value:{recordCounter:s,md5:c,contentIds:u,numContentIds:h,numBlocks:a,numRecords:i},offset:r}},maxLength:e=>40+5*e}}function c(e){let t=0;return t+=20,t+=9,t+=15,t+=16,{parser:(t,r)=>{const[i,o]=(0,n.parseItf8)(t,r);r+=o;const[s,a]=(0,n.parseItf8)(t,r);r+=a;const[A,h]=(0,n.parseItf8)(t,r);r+=h;const[f,u]=(0,n.parseItf8)(t,r);r+=u;let c=0;if(e>=3){const[e,i]=(0,n.parseLtf8)(t,r);r+=i,c=e}else if(2===e){const[e,i]=(0,n.parseItf8)(t,r);r+=i,c=e}else console.warn("majorVersion is <2, recordCounter set to 0");const[l,g]=(0,n.parseItf8)(t,r);r+=g;const[d,I]=(0,n.parseItf8)(t,r);r+=I;const C=[];for(let e=0;e<d;e++){const[e,i]=(0,n.parseItf8)(t,r);r+=i,C.push(e)}const[p,m]=(0,n.parseItf8)(t,r);let w;return r+=m,e>=2&&(w=[...t.subarray(r,r+16)],r+=16),{value:{md5:w,numBlocks:l,numRecords:f,numContentIds:d,refSeqSpan:A,refSeqId:i,refSeqStart:s,recordCounter:c,refBaseBlockId:p,contentIds:C},offset:r}},maxLength:e=>60+5*e}}function l(e,t){const r=e,i=new DataView(r.buffer,r.byteOffset,r.length),[o,s]=(0,n.parseItf8)(e,t);t+=s;const[a,A]=(0,n.parseItf8)(e,t);t+=A;const h={};if(0===o);else if(1===o){const[r,i]=(0,n.parseItf8)(e,t);h.blockContentId=r,t+=i}else if(2===o){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[o,s]=(0,n.parseItf8)(e,t);h.M=o,t+=s}else if(3===o){const r=(0,n.parseItf8)(e,t),i=r[0];t+=r[1];const o=[];for(let r=0;r<i;r++){const r=(0,n.parseItf8)(e,t);o.push(r[0]),t+=r[1]}h.symbols=o;const s=(0,n.parseItf8)(e,t),a=r[0];h.numLengths=a,h.numCodes=i,h.numLengths=a,t+=s[1];const A=[];for(let r=0;r<a;r++){const r=(0,n.parseItf8)(e,t);t+=r[1],A.push(r[0])}h.bitLengths=A}else if(4===o){const{value:r,offset:n}=l(e,t);h.lengthsEncoding=r,t=n;const{value:i,offset:o}=l(e,t);h.valuesEncoding=i,t=o}else if(5===o){h.stopByte=i.getUint8(t),t+=1;const[r,o]=(0,n.parseItf8)(e,t);h.blockContentId=r,t+=o}else if(6===o){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[o,s]=(0,n.parseItf8)(e,t);h.length=o,t+=s}else if(7===o){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[o,s]=(0,n.parseItf8)(e,t);h.K=o,t+=s}else if(8===o){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[o,s]=(0,n.parseItf8)(e,t);h.log2m=o,t+=s}else{if(9!==o)throw new Error(`unknown codecId ${o}`);{const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i}}return{value:{codecId:o,parametersBytes:a,parameters:h},offset:t}}function g(){return{parser:(e,t)=>{const[r,i]=(0,n.parseItf8)(e,t);t+=i;const[o,s]=(0,n.parseItf8)(e,t);t+=s;const a=[];for(let r=0;r<o;r++){const r=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const{value:n,offset:i}=l(e,t);t=i,a.push({key:r,value:n})}return{value:{mapSize:r,ents:a,mapCount:o},offset:t}}}}function d(){return{parser:(e,t)=>{const[r,i]=(0,n.parseItf8)(e,t);t+=i;const[o,s]=(0,n.parseItf8)(e,t);t+=s;const a=[];for(let r=0;r<o;r++){const[r,i]=(0,n.parseItf8)(e,t);t+=i;const o=String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(255&r),{value:s,offset:A}=l(e,t);t=A,a.push({key:o,value:s})}return{value:{mapSize:r,ents:a,mapCount:o},offset:t}}}}function I(e){let t=4;return t+=20,t+=9,t+=9,t+=10,{maxLength:52,parser:(t,r)=>{const i=t,o=new DataView(i.buffer,i.byteOffset,i.length).getInt32(r,!0);r+=4;const[s,a]=(0,n.parseItf8)(t,r);r+=a;const[A,h]=(0,n.parseItf8)(t,r);r+=h;const[f,u]=(0,n.parseItf8)(t,r);r+=u;const[c,l]=(0,n.parseItf8)(t,r);r+=l;let g,d=0;if(e>=3){const[e,i]=(0,n.parseLtf8)(t,r);d=e,r+=i}else if(2===e){const[e,i]=(0,n.parseItf8)(t,r);d=e,r+=i}else console.warn("setting recordCounter=0");if(e>1){const[e,i]=(0,n.parseLtf8)(t,r);g=e,r+=i}const[I,C]=(0,n.parseItf8)(t,r);r+=C;const[p,m]=(0,n.parseItf8)(t,r);return{value:{length:o,refSeqId:s,refSeqStart:A,alignmentSpan:f,numBlocks:I,numLandmarks:p,numBases:g,recordCounter:d,numRecords:c},offset:r+=m}}}}function C(e){return{parser:(t,r)=>{const i=t,o=new DataView(i.buffer,i.byteOffset,i.length),[s,a]=(0,n.parseItf8)(t,r);r+=a;const A=[];for(let e=0;e<s;e++){const[e,i]=(0,n.parseItf8)(t,r);r+=i,A.push(e)}let h;return e>=3&&(h=o.getUint32(r,!0),r+=4),{value:{...void 0===h?{}:{crc32:h},numLandmarks:s,landmarks:A},offset:r}},maxLength:e=>5+5*e+4}}},6484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,A,h,f,u,c,l){let g=t("BF");const d=t("CF");if(!(0,o.isMappedSliceHeader)(A.parsedContent))throw new Error("slice header not mapped");const I=c>1&&-2===A.parsedContent.refSeqId?t("RI"):A.parsedContent.refSeqId,C=t("RL");let p=t("AP");r.APdelta&&(p+=u.lastAlignmentStart),u.lastAlignmentStart=p;const m=t("RG");let w,B,y,_;if(r.readNamesIncluded&&(w=s(t("RN"))),i.CramFlagsDecoder.isDetached(d)){const e=t("MF");let n;r.readNamesIncluded||(n=s(t("RN")),w=n);const o=t("NS"),a=t("NP");(e||o>-1)&&(B={mateFlags:e,mateSequenceId:o,mateAlignmentStart:a,mateReadName:n}),y=t("TS"),i.MateFlagsDecoder.isUnmapped(e)&&(g=i.BamFlagsDecoder.setMateUnmapped(g)),i.MateFlagsDecoder.isOnNegativeStrand(e)&&(g=i.BamFlagsDecoder.setMateReverseComplemented(g))}else i.CramFlagsDecoder.isWithMateDownstream(d)&&(_=t("NF")+l+1);const E=t("TL");if(E<0)throw new n.CramMalformedError("invalid TL index");const b={},Q=r.getTagNames(E),v=Q.length;for(let t=0;t<v;t++){const n=Q[t],i=n.slice(0,2),o=n.slice(2,3),s=r.getCodecForTag(n).decode(e,h,f,u);b[i]="number"==typeof s?s:a(o,s)}let S,k,D,R,F;if(i.BamFlagsDecoder.isSegmentUnmapped(g))if(i.CramFlagsDecoder.isDecodeSequenceAsStar(d))F=null,R=null;else{const e=new Array(C);for(let r=0;r<e.length;r++)e[r]=t("BA");if(F=String.fromCharCode(...e),i.CramFlagsDecoder.isPreservingQualityScores(d)){R=new Array(C);for(let r=0;r<e.length;r++)R[r]=t("QS")}}else{const e=t("FN");if(e&&(S=function(e,t,r,i,o){let s=0,a=e-1;const A=new Array(t);function h([e,t]){const n=r(t);if("character"===e)return String.fromCharCode(n);if("string"===e){let e="";for(let t=0;t<n.byteLength;t++)e+=String.fromCharCode(n[t]);return e}return"numArray"===e?n.toArray():n}for(let e=0;e<t;e++){const t=String.fromCharCode(r("FC")),i=r("FP"),f={B:["character","BA"],S:["string",o>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[t];if(!f)throw new n.CramMalformedError(`invalid read feature code "${t}"`);let u=h(f);const c={B:["number","QS"]}[t];c&&(u=[u,h(c)]),s+=i;const l=s;a+=i;const g=a;"D"===t||"N"===t?a+=u:"I"===t||"S"===t?a-=u.length:"i"===t&&(a-=1),A[e]={code:t,pos:l,refPos:g,data:u}}return A}(p,e,t,0,c)),k=C,S)for(const{code:e,data:t}of S)"D"===e||"N"===e?k+=t:"I"===e||"S"===e?k-=t.length:"i"===e&&(k-=1);if(Number.isNaN(k)&&(console.warn(`${w||`${I}:${p}`} record has invalid read features`),k=C),D=t("MQ"),i.CramFlagsDecoder.isPreservingQualityScores(d)){R=new Array(C);for(let e=0;e<R.length;e++)R[e]=t("QS")}}return{readLength:C,sequenceId:I,cramFlags:d,flags:g,alignmentStart:p,readGroupId:m,readName:w,mateToUse:B,templateSize:y,mateRecordNumber:_,readFeatures:S,lengthOnRef:k,mappingQuality:D,qualityScores:R,readBases:F,tags:b}};const n=r(9747),i=r(8401),o=r(3165);function s(e){let t="";for(let r=0;r<e.length&&0!==e[r];r++)t+=String.fromCharCode(e[r]);return t}function a(e,t){if("Z"===e)return s(t);if("A"===e)return String.fromCharCode(t[0]);if("I"===e)return new Uint32Array(t.buffer)[0];if("i"===e)return new Int32Array(t.buffer)[0];if("s"===e)return new Int16Array(t.buffer)[0];if("S"===e)return new Uint16Array(t.buffer)[0];if("c"===e)return new Int8Array(t.buffer)[0];if("C"===e)return t[0];if("f"===e)return new Float32Array(t.buffer)[0];if("H"===e)return Number.parseInt(s(t).replace(/^0x/,""),16);if("B"===e)return function(e){const t=String.fromCharCode(e[0]),r=new DataView(e.buffer).getUint32(1,!0),n=new Array(r);if(e=e.slice(5),"c"===t){const t=new Int8Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("C"===t){const t=new Uint8Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("s"===t){const t=new Int16Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("S"===t){const t=new Uint16Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("i"===t){const t=new Int32Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("I"===t){const t=new Uint32Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else{if("f"!==t)throw new Error(`unknown type: ${t}`);{const t=new Float32Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}}return n}(t);throw new n.CramMalformedError(`Unrecognized tag type ${e}`)}},6771:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9747),o=r(612),s=n(r(7295)),a=n(r(6484)),A=n(r(8401)),h=r(3165),f=r(400);function u(e,t,r,n){const o=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==t);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=s.default.BAM_FPAIRED,n.flags&s.default.BAM_FUNMAP&&(r.flags|=s.default.BAM_FMUNMAP),r.flags&s.default.BAM_FUNMAP&&(n.flags|=s.default.BAM_FMUNMAP),n.flags&s.default.BAM_FREVERSE&&(r.flags|=s.default.BAM_FMREVERSE),r.flags&s.default.BAM_FREVERSE&&(n.flags|=s.default.BAM_FMREVERSE),void 0===r.templateLength&&(o?function(e,t,r){const n=function t(r){const n=[r];if(void 0!==r.mateRecordNumber&&r.mateRecordNumber>=0){const o=e[r.mateRecordNumber];if(!o)throw new i.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push(...t(o))}return n}(r),o=n.map((e=>e.alignmentStart)),s=n.map((e=>e.alignmentStart+e.readLength-1)),a=Math.max(...s)-Math.min(...o)+1;a>=0&&n.forEach((e=>{if(void 0!==e.templateLength)throw new i.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");e.templateLength=a}))}(e,0,r):function(e,t){const r=Math.min(e.alignmentStart,t.alignmentStart),n=Math.max(e.alignmentStart+e.readLength-1,t.alignmentStart+t.readLength-1)-r+1;e.templateLength=n,t.templateLength=n}(r,n)),r.mateRecordNumber=void 0}class c{constructor(e,t,r){this.container=e,this.containerPosition=t,this.sliceSize=r,this.file=e.file}async getHeader(){const{majorVersion:e}=await this.file.getDefinition(),t=(0,h.getSectionParsers)(e),r=await this.container.getHeader();if(!r)throw new Error("no container header detected");const n=await this.file.readBlock(r._endPosition+this.containerPosition);if(void 0===n)throw new Error("block header undefined");if("MAPPED_SLICE_HEADER"===n.contentType){const e=(0,f.parseItem)(n.content,t.cramMappedSliceHeader.parser,0,r._endPosition);return{...n,parsedContent:e}}if("UNMAPPED_SLICE_HEADER"===n.contentType){const e=(0,f.parseItem)(n.content,t.cramUnmappedSliceHeader.parser,0,r._endPosition);return{...n,parsedContent:e}}throw new i.CramMalformedError(`error reading slice header block, invalid content type ${n.contentType}`)}async getBlocks(){const e=await this.getHeader();let t=e._endPosition;const r=new Array(e.parsedContent.numBlocks);for(let e=0;e<r.length;e++){const n=await this.file.readBlock(t);if(void 0===n)throw new Error("block undefined");r[e]=n,t=r[e]._endPosition}return r}async getCoreDataBlock(){return(await this.getBlocks())[0]}async _getBlocksContentIdIndex(){const e=await this.getBlocks(),t={};return e.forEach((e=>{"EXTERNAL_DATA"===e.contentType&&(t[e.contentId]=e)})),t}async getBlockByContentId(e){return(await this._getBlocksContentIdIndex())[e]}async getReferenceRegion(){const e=(await this.getHeader()).parsedContent;if(!(0,h.isMappedSliceHeader)(e))throw new Error("slice header not mapped");if(e.refSeqId<0)return;const t=await this.container.getCompressionScheme();if(void 0===t)throw new Error("compression scheme undefined");if(e.refBaseBlockId>=0){const t=await this.getBlockByContentId(e.refBaseBlockId);if(!t)throw new i.CramMalformedError("embedded reference specified, but reference block does not exist");return{seq:t.data.toString("utf8"),start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}}if(t.referenceRequired||this.file.fetchReferenceSequenceCallback){if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");const t=await this.file.fetchReferenceSequenceCallback(e.refSeqId,e.refSeqStart,e.refSeqStart+e.refSeqSpan-1);if(t.length!==e.refSeqSpan)throw new i.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return{seq:t,start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}}}getAllRecords(){return this.getRecords((()=>!0))}async _fetchRecords(){const{majorVersion:e}=await this.file.getDefinition(),t=await this.container.getCompressionScheme();if(void 0===t)throw new Error("compression scheme undefined");const r=await this.getHeader(),n=await this._getBlocksContentIdIndex();if(e>1&&this.file.options.checkSequenceMD5&&(0,h.isMappedSliceHeader)(r.parsedContent)&&r.parsedContent.refSeqId>=0&&"0000000000000000"!==r.parsedContent.md5?.join("")){const e=await this.getReferenceRegion();if(e){const{seq:t,start:n,end:o}=e,s=(0,f.sequenceMD5)(t),a=r.parsedContent.md5?.map((e=>(e<16?"0":"")+e.toString(16))).join("");if(s!==a)throw new i.CramMalformedError(`MD5 checksum reference mismatch for ref ${r.parsedContent.refSeqId} pos ${n}..${o}. recorded MD5: ${a}, calculated MD5: ${s}`)}}const s=await this.getCoreDataBlock(),c={lastAlignmentStart:(0,h.isMappedSliceHeader)(r.parsedContent)?r.parsedContent.refSeqStart:0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor(e){let t=this.map.get(e);return void 0===t&&(t={bitPosition:7,bytePosition:0},this.map.set(e,t)),t}}},l=e=>{const r=t.getCodecForDataSeries(e);if(!r)throw new i.CramMalformedError(`no codec defined for ${e} data series`);return r.decode(this,s,n,c)},g=new Array(r.parsedContent.numRecords);for(let i=0;i<g.length;i+=1)try{const o=(0,a.default)(this,l,t,r,s,n,c,e,i);g[i]=new A.default({...o,uniqueId:r.contentPosition+r.parsedContent.recordCounter+i+1})}catch(e){if(e instanceof o.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated.");break}throw e}for(let e=0;e<g.length;e+=1){const{mateRecordNumber:t}=g[e];void 0!==t&&t>=0&&u(g,e,g[e],g[t])}return g}async getRecords(e){const t=this.container.filePosition+this.containerPosition;let r=this.file.featureCache.get(t.toString());r||(r=this._fetchRecords(),this.file.featureCache.set(t.toString(),r));const n=(await r).filter(e);if(n.length&&this.file.fetchReferenceSequenceCallback){const e=await this.getHeader();if((0,h.isMappedSliceHeader)(e.parsedContent)&&(e.parsedContent.refSeqId>=0||-2===e.parsedContent.refSeqId)){const t=e.parsedContent.refSeqId>=0?e.parsedContent.refSeqId:void 0,r=await this.container.getCompressionScheme();if(void 0===r)throw new Error("compression scheme undefined");const i={};for(const e of n){const r=void 0!==t?t:e.sequenceId;let n=i[r];n||(n={id:r,start:e.alignmentStart,end:Number.NEGATIVE_INFINITY,seq:null},i[r]=n);const o=e.alignmentStart+(e.lengthOnRef||e.readLength)-1;o>n.end&&(n.end=o),e.alignmentStart<n.start&&(n.start=e.alignmentStart)}await Promise.all(Object.values(i).map((async e=>{-1!==e.id&&e.start<=e.end&&this.file.fetchReferenceSequenceCallback&&(e.seq=await this.file.fetchReferenceSequenceCallback(e.id,e.start,e.end))})));for(const e of n){const n=i[void 0!==t?t:e.sequenceId];if(n?.seq){const t=n.seq;e.addReferenceSequence({...n,seq:t},r)}}}}return n}}t.default=c,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((e=>{(0,f.tinyMemoize)(c,e)}))},400:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.itf8Size=function(e){return-128&e?-16384&e?-2097152&e?-268435456&e?5:4:3:2:1},t.parseItf8=function(e,t){let r=t;const n=e[r];let i;if(n<128?(i=n,r+=1):n<192?(i=16383&(n<<8|e[r+1]),r+=2):n<224?(i=2097151&(n<<16|e[r+1]<<8|e[r+2]),r+=3):n<240?(i=268435455&(n<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]),r+=4):(i=(15&n)<<28|e[r+1]<<20|e[r+2]<<12|e[r+3]<<4|15&e[r+4],r+=5),r>e.length)throw new s.CramBufferOverrunError("Attempted to read beyond end of buffer; this file seems truncated.");return[i,r-t]},t.parseLtf8=function(e,t){const r=new DataView(e.buffer);let n=t;const o=e[n];let s;if(o<128)s=o,n+=1;else if(o<192)s=16383&(e[n]<<8|e[n+1]),n+=2;else if(o<224)s=2097151&(e[n]<<16|e[n+1]<<8|e[n+2]),s=(63&o)<<16|r.getUint16(n+1,!0),n+=3;else if(o<240)s=268435455&(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),n+=4;else if(o<248)s=(15&e[n])*2**32+(e[n+1]<<24)|e[n+2]<<16|e[n+3]<<8|e[n+4],n+=5;else if(o<252)s=((7&e[n])<<8|e[n+1])*2**32+(e[n+2]<<24)|e[n+3]<<16|e[n+4]<<8|e[n+5],n+=6;else if(o<254)s=((3&e[n])<<16|e[n+1]<<8|e[n+2])*2**32+(e[n+3]<<24)|e[n+4]<<16|e[n+5]<<8|e[n+6],n+=7;else if(o<255){if(s=i.default.fromBytesBE(e.slice(n+1,n+8)),s.greaterThan(Number.MAX_SAFE_INTEGER)||s.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");s=s.toNumber(),n+=8}else{if(s=i.default.fromBytesBE(e.slice(n+1,n+9)),s.greaterThan(Number.MAX_SAFE_INTEGER)||s.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");s=s.toNumber(),n+=9}return[s,n-t]},t.parseItem=function(e,t,r=0,n=0){const{offset:i,value:o}=t(e,r);return{...o,_endPosition:i+n,_size:i-r}},t.tinyMemoize=function(e,t){const r=e.prototype[t],n=`_memo_${t}`;e.prototype[t]=function(){if(!(n in this)){const e=r.call(this);this[n]=e,Promise.resolve(e).catch((()=>{delete this[n]}))}return this[n]}},t.sequenceMD5=function(e){return(0,o.default)(e.toUpperCase().replaceAll(/[^\u0021-\u007e]/g,""))},t.sum=a,t.concatUint8Array=function(e){const t=new Uint8Array(a(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t};const i=n(r(8570)),o=n(r(3503)),s=r(612);function a(e){let t=0;for(const r of e)t+=r.length;return t}},9747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CramArgumentError=t.CramSizeLimitError=t.CramMalformedError=t.CramUnimplementedError=t.CramError=void 0;class r extends Error{}t.CramError=r;class n extends Error{}t.CramUnimplementedError=n,t.CramMalformedError=class extends r{},t.CramSizeLimitError=class extends r{},t.CramArgumentError=class extends r{}},2884:(e,t,r)=>{"use strict";const n=r(8175),i=r(2935),o=r(5871),s=r(235);e.exports=class{decode(e){return this.stream=new i(e),this.decodeStream(this.stream)}decodeStream(e,t=0){var r=this.stream.ReadByte();16&r||(t=this.stream.ReadUint7());var n,i=t,o=1&r;if(8&r)return this.decodeStripe(this.stream,t);if(128&r&&([n,i]=this.decodePackMeta(this.stream)),32&r)var s=this.decodeCat(this.stream,i);else s=4&r?this.decodeExt(this.stream,i):64&r?o?this.decodeRLE1(this.stream,i):this.decodeRLE0(this.stream,i):o?this.decode1(this.stream,i):this.decode0(this.stream,i);return 128&r&&(s=this.decodePack(s,n,t)),s}decode0(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);var s=new o(i),a=new n(e);a.RangeStartDecode(e);for(var A=0;A<t;A++)r[A]=s.ModelDecode(e,a);return r}decode1(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);for(var s=new Array(i),a=0;a<i;a++)s[a]=new o(i);var A=new n(e);A.RangeStartDecode(e);var h=0;for(a=0;a<t;a++)r[a]=s[h].ModelDecode(e,A),h=r[a];return r}decodeExt(e,t){const r=s.array(e.buf.slice(e.pos));let n,i=s.header(r);const o=[];do{n=s.decompress(r,i),-1!==n&&(o.push(n),i-=n.length)}while(-1!==n);return function(e){const t=new Uint8Array(function(e){let t=0;for(const r of e)t+=r.length;return t}(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t}(o)}decodeRLE0(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);for(var s=new o(i),a=new Array(258),A=0;A<=257;A++)a[A]=new o(4);var h=new n(e);for(h.RangeStartDecode(e),A=0;A<t;){r[A]=s.ModelDecode(e,h);for(var f=a[r[A]].ModelDecode(e,h),u=f,c=256;3==f;)f=a[c].ModelDecode(e,h),c=257,u+=f;for(var l=1;l<=u;l++)r[A+l]=r[A];A+=u+1}return r}decodeRLE1(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);for(var s=new Array(i),a=0;a<i;a++)s[a]=new o(i);var A=new Array(258);for(a=0;a<=257;a++)A[a]=new o(4);var h=new n(e);h.RangeStartDecode(e);var f=0;for(a=0;a<t;){r[a]=s[f].ModelDecode(e,h),f=r[a];for(var u=A[r[a]].ModelDecode(e,h),c=u,l=256;3==u;)u=A[l].ModelDecode(e,h),l=257,c+=u;for(var g=1;g<=c;g++)r[a+g]=r[a];a+=c+1}return r}decodePackMeta(e){this.nsym=e.ReadByte();for(var t=new Array(this.nsym),r=0;r<this.nsym;r++)t[r]=e.ReadByte();return[t,e.ReadUint7()]}decodePack(e,t,r){var n=new Uint8Array(r);if(this.nsym<=1)for(var i=0;i<r;i++)n[i]=t[0];else if(this.nsym<=2){i=0;for(var o=0;i<r;i++){if(i%8==0)var s=e[o++];n[i]=t[1&s],s>>=1}}else if(this.nsym<=4)for(i=0,o=0;i<r;i++)i%4==0&&(s=e[o++]),n[i]=t[3&s],s>>=2;else{if(!(this.nsym<=16))return e;for(i=0,o=0;i<r;i++)i%2==0&&(s=e[o++]),n[i]=t[15&s],s>>=4}return n}packMeta(e){for(var t=new i("",0,1024),r=new Array(256),n=0;n<e.length;n++)r[e[n]]=1;var o=0;for(n=0;n<256;n++)r[n]&&(r[n]=++o);for(t.WriteByte(o),n=0;n<256;n++)r[n]&&(t.WriteByte(n),r[n]--);return[t,r,o]}decodeStripe(e,t){for(var r=e.ReadByte(),n=new Array(r),i=new Array(r),o=0;o<r;o++)n[o]=e.ReadUint7();var s=new Array(r);for(o=0;o<r;o++)i[o]=Math.floor(t/r)+(t%r>o),s[o]=this.decodeStream(e,i[o]);var a=new Uint8Array(t);for(o=0;o<r;o++)for(var A=0;A<i[o];A++)a[A*r+o]=s[o][A];return a}decodeCat(e,t){for(var r=new Uint8Array(t),n=0;n<t;n++)r[n]=e.ReadByte();return r}}},8175:e=>{"use strict";e.exports=class{constructor(e){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(e){for(var t=0;t<5;t++)this.code=(this.code<<8)+e.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(e){return this.range=Math.floor(this.range/e),Math.floor(this.code/this.range)}RangeDecode(e,t,r,n){for(this.code-=t*this.range,this.range*=r;this.range<1<<24;)this.range*=256,this.code=256*this.code+e.ReadByte()}RangeShiftLow(e){if(this.low<4278190080|this.carry){for(e.WriteByte(this.cache+this.carry);this.FFnum;)e.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(e,t,r,n){var i=this.low;for(this.range=Math.floor(this.range/n),this.low+=t*this.range,this.low>>>=0,this.range*=r,this.low<i&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(e)}RangeFinishEncode(e){for(var t=0;t<5;t++)this.RangeShiftLow(e)}}},5871:e=>{"use strict";e.exports=class{constructor(e=256){this.total_freq=e,this.max_sym=e-1,this.S=new Array,this.F=new Array;for(var t=0;t<=this.max_sym;t++)this.S[t]=t,this.F[t]=1}ModelDecode(e,t){for(var r=t.RangeGetFrequency(this.total_freq),n=0,i=0;n+this.F[i]<=r;)n+=this.F[i++];t.RangeDecode(e,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();var o=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var s=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=s,s=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=s}return o}ModelRenormalise(){this.total_freq=0;for(var e=0;e<=this.max_sym;e++)this.F[e]-=Math.floor(this.F[e]/2),this.total_freq+=this.F[e]}ModelEncode(e,t,r){for(var n=0,i=0;this.S[i]!=r;i++)n+=this.F[i];if(t.RangeEncode(e,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise(),r=this.S[i],i>0&&this.F[i]>this.F[i-1]){var o=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=o,o=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=o}}}},4373:(e,t,r)=>{"use strict";const n=r(2935),i=r(5871),o=r(8175);function s(e,t,r){for(var n=0,i=0,o=-1,s=new Array(1024);i<r;){var a=e.ReadByte();if(s[n++]=a,i+=a,a==o){var A=e.ReadByte();for(i+=a*A;A--;)s[n++]=a}o=a}var h=0;for(n=0,i=0;i<r;){var f=0;do{var u=s[n++];f+=u}while(255==u);for(;f--;)t[i++]=h;h++}}function a(e,t,r){var n=e.context;return t.qctx=(t.qctx<<e.qshift)+e.qtab[r],n+=(t.qctx&(1<<e.qbits)-1)<<e.qloc,e.do_pos&&(n+=e.ptab[Math.min(t.p,1023)]<<e.ploc),e.do_delta&&(n+=e.dtab[Math.min(t.delta,255)]<<e.dloc,t.delta+=t.prevq!=r?1:0,t.prevq=r),e.do_sel&&(n+=t.s<<e.sloc),t.p--,65535&n}function A(e){var t={};t.context=e.ReadUint16(),t.pflags=e.ReadByte(),t.do_dedup=2&t.pflags,t.fixed_len=4&t.pflags,t.do_sel=8&t.pflags,t.do_qmap=16&t.pflags,t.do_pos=32&t.pflags,t.do_delta=64&t.pflags,t.do_qtab=128&t.pflags,t.max_sym=e.ReadByte();var r=e.ReadByte();if(t.qbits=r>>4,t.qshift=15&r,r=e.ReadByte(),t.qloc=r>>4,t.sloc=15&r,r=e.ReadByte(),t.ploc=r>>4,t.dloc=15&r,t.qmap=new Array(256),16&t.pflags)for(var n=0;n<t.max_sym;n++)t.qmap[n]=e.ReadByte();else for(n=0;n<256;n++)t.qmap[n]=n;if(t.qtab=new Array(1024),t.qbits>0&&128&t.pflags)s(e,t.qtab,256);else for(n=0;n<256;n++)t.qtab[n]=n;return t.ptab=new Array(1024),32&t.pflags&&s(e,t.ptab,1024),t.dtab=new Array(256),64&t.pflags&&s(e,t.dtab,256),t}function h(e,t,r,n,i,o){r.max_sel>0?i.s=n.sel.ModelDecode(e,t):i.s=0,i.x=r.stab[i.s];var s=r.params[i.x];if(s.fixed_len>=0){var a=n.len[0].ModelDecode(e,t);a|=n.len[1].ModelDecode(e,t)<<8,a|=n.len[2].ModelDecode(e,t)<<16,a|=n.len[3].ModelDecode(e,t)<<24,s.fixed_len>0&&(s.fixed_len=-a)}else a=-s.fixed_len;i.len=a,r.do_rev&&(o[i.rec]=n.rev.ModelDecode(e,t)),i.is_dup=0,2&s.pflags&&n.dup.ModelDecode(e,t)&&(i.is_dup=1),i.p=a,i.delta=0,i.qctx=0,i.prevq=0,i.rec++}e.exports={decode:function(e,t){return function(e,t){var r=e.ReadUint7(),n=function(e){var t={max_sym:0};if(5==e.ReadByte()){var r=e.ReadByte(),n=1&r?e.ReadByte():1,i=r.nparam>1?r.nparam-1:0,o=new Array(256);if(2&r)i=e.ReadByte(),s(e,o,256);else{for(var a=0;a<n;a++)o[a]=a;for(;a<256;a++)o[a]=n-1}t.do_rev=4&r,t.stab=o,t.max_sel=i,t.params=new Array(t.nparam);for(var h=0;h<n;h++)t.params[h]=A(e),t.max_sym<t.params[h].max_sym&&(t.max_sym=t.params[h].max_sym);return t}console.error("Invalid FQZComp version number")}(e);if(n){var f=n.params,u=new Array(t.length),c=function(e){var t={};t.qual=new Array(65536);for(var r=0;r<65536;r++)t.qual[r]=new i(e.max_sym+1);for(t.len=new Array(4),r=0;r<4;r++)t.len[r]=new i(256);return t.rev=new i(2),t.dup=new i(2),e.max_sel>0&&(t.sel=new i(e.max_sel+1)),t}(n),l=new o(e);l.RangeStartDecode(e);for(var g=new Uint8Array(r),d={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0},I=0;I<r;){if(0==d.p){if(h(e,l,n,c,d,u),d.is_dup>0&&c.dup.ModelDecode(e,l)){for(var C=0;C<len;C++)g[I+C]=g[I+C-d.len];I+=d.len,d.p=0;continue}t.push(d.len);var p=(f=n.params[d.x]).context}var m=c.qual[p].ModelDecode(e,l);g[I++]=f.qmap[m],p=a(f,d,m)}return n.do_rev&&function(e,t,r,n){for(var i=0,o=0;o<t;){if(r[i])for(var s=0,a=n[i]-1;s<a;){var A=e[o+s];e[o+s]=e[o+a],e[o+a]=A,s++,a--}o+=n[i++]}}(g,r,u,t),g}}(new n(e),t)}}},9151:(e,t,r)=>{"use strict";var n=r(9725),i=r(6194),o=r(2884),s=r(4373),a=r(680);e.exports={r4x8_uncompress:function(e,t){return n.decode(e)},r4x16_uncompress:function(e){return i.decode(e)},arith_uncompress:function(e){return(new o).decode(e)},fqzcomp_uncompress:function(e){var t=new Array;return s.decode(e,t)},tok3_uncompress:function(e){var t=a.decode(e,0,"\0");return Uint8Array.from(Array.from(t).map((e=>e.charCodeAt(0))))}}},2935:e=>{"use strict";e.exports=class{constructor(e,t=0,r=0){0!=r?(this.buf=new Uint8Array(r),this.length=r):(this.buf=e,this.length=e.length),this.dataView=new DataView(this.buf.buffer),this.pos=t}EOF(){return this.pos>=this.length}ReadData(e){var t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}ReadByte(){const e=this.buf[this.pos];return this.pos++,e}ReadChar(){const e=this.buf[this.pos];return this.pos++,String.fromCharCode(e)}ReadUint16(){return this.ReadByte()|this.ReadByte()<<8}ReadUint32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}ReadString(){var e="";do{var t=this.buf[this.pos++];t&&(e+=String.fromCharCode(t))}while(t);return e}ReadUint7(){var e=0;do{var t=this.ReadByte();e=e<<7|127&t}while(128&t);return e}ReadITF8(){var e=this.buf[this.pos];return this.pos++,e>=240?(e=(15&e)<<28,e+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):e>=224?(e=(15&e)<<24,e+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(0|this.buf[this.pos+2]),this.pos+=3):e>=192?(e=(31&e)<<16,e+=(this.buf[this.pos+0]<<8)+(0|this.buf[this.pos+1]),this.pos+=2):e>=128&&(e=(63&e)<<8,e+=this.buf[this.pos],this.pos++),e}WriteByte(e){this.buf[this.pos++]=e}WriteChar(e){this.buf[this.pos++]=e.charCodeAt(0)}WriteString(e){for(var t=0;t<e.length;t++)this.buf[this.pos++]=e.charCodeAt(t);this.buf[this.pos++]=0}WriteData(e,t){for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]}WriteStream(e){this.WriteData(e.buf,e.pos)}WriteUint16(e){this.WriteByte(255&e),this.WriteByte(e>>8&255)}WriteUint32(e){this.buf.writeInt32LE(e,this.pos),this.pos+=4}WriteUint7(e){var t=0,r=e;do{t+=7,r>>=7}while(r>0);do{t-=7,this.WriteByte((e>>t&127)+((t>0)<<7))}while(t>0)}WriteITF8(e){e<0&&(e=1+e),e<=127?this.buf[this.pos++]=e:e<=16383?(this.buf[this.pos++]=128|Math.floor(e/256),this.buf[this.pos++]=255&e):e<131071?(this.buf[this.pos++]=192|Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):e<268435455?(this.buf[this.pos++]=224|Math.floor(e/16777216),this.buf[this.pos++]=255&Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):(this.buf[this.pos++]=240|Math.floor(e/268435456),this.buf[this.pos++]=255&Math.floor(e/1048576),this.buf[this.pos++]=255&Math.floor(e/4096),this.buf[this.pos++]=255&Math.floor(e/4),this.buf[this.pos++]=15&e)}WriteByteNeg(e){this.buf[--this.pos]=e}}},9725:(e,t,r)=>{"use strict";const n=r(2935);function i(e){return 4095&e}function o(e,t){for(var r=0;t>=e[r+1];)r++;return r}function s(e){for(var t=new Array(4096),r=0,n=0;n<4096;n++){for(;n>=e[r+1];)r++;t[n]=r}return t}function a(e,t,r){return r*(e>>12)+(4095&e)-t}function A(e,t){for(;t<1<<23;)t=(t<<8)+e.ReadByte();return t}function h(e,t,r){for(var n=0;n<256;n++)t[n]=0;var i=e.ReadByte(),o=i,s=0;do{var a=e.ReadITF8();t[i]=a,s>0?(s--,i++):(i=e.ReadByte())==o+1&&(s=e.ReadByte()),o=i}while(0!=i);for(r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+t[n]}e.exports={decode:function(e){var t=new n(e),r=t.ReadByte(),f=(t.ReadUint32(),t.ReadUint32());return 0==r?function(e,t){var r=new Array(256),n=new Array(256);h(e,r,n);for(var o=s(n),f=new Array(4),u=0;u<4;u++)f[u]=e.ReadUint32();var c=new Uint8Array(t);for(u=0;u<t;u++){var l=u%4,g=o[i(f[l])];c[u]=g,f[l]=a(f[l],n[g],r[g]),f[l]=A(e,f[l])}return c}(t,f):function(e,t){var r=new Array(256),n=new Array(256);!function(e,t,r){for(var n=0;n<256;n++){t[n]=new Array(256),r[n]=new Array(256);for(var i=0;i<256;i++)t[n][i]=0}var o=e.ReadByte(),s=o,a=0;do{h(e,t[o],r[o]),a>0?(a--,o++):(o=e.ReadByte())==s+1&&(a=e.ReadByte()),s=o}while(0!=o)}(e,r,n);for(var f=new Array(256),u=0;u<256;u++)f[u]=s(n[u]);for(var c=new Array(4),l=new Array(4),g=0;g<4;g++)c[g]=e.ReadUint32(),l[g]=0;var d=new Uint8Array(t),I=Math.floor(t/4);for(u=0;u<I;u++)for(g=0;g<4;g++){var C=i(c[g]),p=f[l[g]][C];d[u+g*I]=p,c[g]=a(c[g],n[l[g]][p],r[l[g]][p]),c[g]=A(e,c[g]),l[g]=p}for(u*=4;u<t;)C=i(c[3]),p=o(n[l[3]],C),d[u++]=p,c[3]=a(c[3],n[l[3]][p],r[l[3]][p]),c[3]=A(e,c[3]),l[3]=p;return d}(t,f)}}},6194:(e,t,r)=>{"use strict";const n=r(2935);function i(e,t){return e&(1<<t)-1}function o(e,t){for(var r=0;t>=e[r+1];)r++;return r}function s(e,t){for(var r=1<<t,n=new Array(r),i=0,o=0;o<r;o++){for(;o>=e[i+1];)i++;n[o]=i}return n}function a(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}function A(e,t){return t<32768&&(t=(t<<16)+e.ReadUint16()),t}function h(e,t){var r=e.ReadByte(),l=1&r,g=8&r,d=32&r,I=64&r,C=128&r,p=4&r?32:4;if(16&r||(t=e.ReadUint7()),g)return function(e,t){for(var r=e.ReadByte(),n=new Array(r),i=new Array(r),o=0;o<r;o++)n[o]=e.ReadUint7();var s=new Array(r);for(o=0;o<r;o++)i[o]=Math.floor(t/r)+(t%r>o),s[o]=h(e,i[o]);var a=new Uint8Array(t);for(o=0;o<r;o++)for(var A=0;A<i[o];A++)a[A*r+o]=s[o][A];return a}(e,t);if(C)var m=t,[w,B,t]=function(e){for(var t=e.ReadByte(),r=new Array(t),n=0;n<t;n++)r[n]=e.ReadByte();return[r,t,e.ReadUint7()]}(e);if(I)var y=t,[_,E,t]=function(e,t){var r=e.ReadUint7(),i=e.ReadUint7();if(1&r)var o=e.ReadData((r-1)/2);else{var s=e.ReadUint7();o=e.ReadData(s),o=u(new n(o),r/2,t)}o=new n(o);var a=new Array(256),A=o.ReadByte();0==A&&(A=256);for(var h=0;h<A;h++)a[o.ReadByte()]=1;return[a,o,i]}(e,p);if(d)var b=e.ReadData(t);else b=0==l?u(e,t,p):function(e,t,r){var h=(I=e.ReadByte())>>4,l=e;if(1&I){var g=e.ReadUint7(),d=e.ReadUint7(),I=new n(e.ReadData(d));l=new n(u(I,g,4))}var C=new Array(256),p=new Array(256);!function(e,t,r,n){for(var i=0;i<256;i++){t[i]=new Array(256),r[i]=new Array(256);for(var o=0;o<256;o++)t[i][o]=0}var s=f(e);for(i=0;i<256;i++)if(s[i]){var a=0;for(o=0;o<256;o++)s[o]&&(a>0?a--:(t[i][o]=e.ReadUint7(),0==t[i][o]&&(a=e.ReadByte())));for(c(t[i],n),r[i][0]=0,o=0;o<256;o++)r[i][o+1]=r[i][o]+t[i][o]}}(l,C,p,h);for(var m=new Array(256),w=0;w<256;w++)m[w]=s(p[w],h);for(var B=new Array(r),y=new Array(r),_=0;_<r;_++)B[_]=e.ReadUint32(),y[_]=0;var E=new Uint8Array(t),b=Math.floor(t/r);for(w=0;w<b;w++)for(_=0;_<r;_++){var Q=i(B[_],h),v=m[y[_]][Q];E[w+_*b]=v,B[_]=a(B[_],p[y[_]][v],C[y[_]][v],h),B[_]=A(e,B[_]),y[_]=v}for(w*=r;w<t;)Q=i(B[r-1],h),v=o(p[y[r-1]],Q),E[w++]=v,B[r-1]=a(B[r-1],p[y[r-1]][v],C[y[r-1]][v],h),B[r-1]=A(e,B[r-1]),y[r-1]=v;return E}(e,t,p);return I&&(b=function(e,t,r,i){new n(e);for(var o=new Uint8Array(i),s=0,a=0;s<i;a++){var A=e[a];if(t[A])for(var h=r.ReadUint7(),f=0;f<=h;f++)o[s++]=A;else o[s++]=A}return o}(b,_,E,y)),C&&(b=function(e,t,r,n){var i=new Uint8Array(n),o=0;if(r<=1)for(var s=0;s<n;s++)i[s]=t[0];else if(r<=2)for(s=0;s<n;s++){if(s%8==0)var a=e[o++];i[s]=t[1&a],a>>=1}else if(r<=4)for(s=0;s<n;s++)s%4==0&&(a=e[o++]),i[s]=t[3&a],a>>=2;else if(r<=16)for(s=0;s<n;s++)s%2==0&&(a=e[o++]),i[s]=t[15&a],a>>=4;return i}(b,w,B,m)),b}function f(e){for(var t=new Array(256),r=0;r<256;r++)t[r]=0;var n=0,i=e.ReadByte(),o=i;do{t[i]=1,n>0?(n--,i++):(i=e.ReadByte())==o+1&&(n=e.ReadByte()),o=i}while(0!=i);return t}function u(e,t,r){var n=new Array(256),o=new Array(256);!function(e,t,r){for(var n=0;n<256;n++)t[n]=0;var i=f(e);for(n=0;n<256;n++)i[n]>0&&(t[n]=e.ReadUint7());for(c(t,12),r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+t[n]}(e,n,o);for(var h=s(o,12),u=new Array(r),l=0;l<r;l++)u[l]=e.ReadUint32();var g=new Uint8Array(t);for(l=0;l<t;l++){var d=l&r-1,I=h[i(u[d],12)];g[l]=I,u[d]=a(u[d],o[I],n[I],12),u[d]=A(e,u[d])}return g}function c(e,t){for(var r=0,n=0;n<256;n++)r+=e[n];if(0!=r&&r!=1<<t){for(var i=0;r<1<<t;)r*=2,i++;for(n=0;n<256;n++)e[n]<<=i}}e.exports={decode:function(e){return h(new n(e),0)}}},680:(e,t,r)=>{"use strict";const n=r(2935),i=r(6194);function o(e){const t=new Uint8Array(function(e){let t=0;for(const r of e)t+=r.length;return t}(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t}var s=new(r(2884));function a(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r}function A(e,t,r,n){var i=e[0][0].ReadByte(),o=n-e[0][i].ReadUint32();if(5==i)return t[n]=t[o],r[n]=r[o],t[n];var s=1;t[n]="",r[n]=new Array(256);do{switch(i=e[s][0].ReadByte()){case 2:r[n][s]=e[s][2].ReadChar();break;case 1:r[n][s]=e[s][1].ReadString();break;case 7:r[n][s]=e[s][7].ReadUint32();break;case 3:var A=e[s][3].ReadUint32(),h=e[s][4].ReadByte();r[n][s]=a(A,h);break;case 8:r[n][s]=(0|r[o][s])+e[s][8].ReadByte();break;case 9:A=(0|r[o][s])+e[s][9].ReadByte(),h=r[o][s].length,r[n][s]=a(A,h);break;case 10:r[n][s]=r[o][s];break;default:r[n][s]=""}t[n]+=r[n][s++]}while(12!=i);return t[n]}function h(e,t,r,n,i,o){for(var s=0;s<n.length;s++)if(!(r>0&&5==t[s][0].type)&&t[s][r])switch(e[0].WriteByte(t[s][r].type),t[s][r].type){case 6:e[6].WriteUint32(t[s][r].val);break;case 5:e[5].WriteUint32(t[s][r].val);break;case 1:e[1].WriteString(t[s][r].val);break;case 2:e[2].WriteChar(t[s][r].val);break;case 7:e[7].WriteUint32(t[s][r].val);break;case 3:e[3].WriteUint32(t[s][r].val),e[4].WriteByte(t[s][r].val.length);break;case 8:case 9:e[t[s][r].type].WriteByte(t[s][r].val)}}function f(e,t,r,n){for(var i=0;i<=12;i++)if(!(e[i].pos<=0)){n.WriteByte(i+(0==i?128:0)),e[i]=e[i].buf.slice(0,e[i].pos);var o=u(e[i],r);n.WriteUint7(o.length),n.WriteData(o,o.length)}}function u(e,t){var r,n=1<<30,o=[0,1,64,65,128,129,201];for(var a in o){var A=o[a];if(!(1&A&&e.length<100||8&A&&e.length%4!=0)){try{var h=t?s.encode(e,A):i.encode(e,A)}catch(e){h=0}h&&n>h.length&&(n=h.length,r=h)}}return r}function c(e,t,r,n,i){var o=0,s=i-1;e[i]=new Array(256),t[n]?e[i][0]={type:5,val:i-t[n]}:e[i][0]={type:6,val:0==i?0:1},t[n]=i;for(var a=n.match(/([a-zA-Z0-9]{1,9})|([^a-zA-Z0-9]+)/g),A=0;A<a.length;A++){var h=A+1,f=1,u=a[A];if(a[A].match(/^0+[0-9]*$/g)?f=3:a[A].match(/^[0-9]+$/g)?f=7:1==a[A].length&&(f=2),s>=0&&e[s][h])if(e[s][h].str==a[A])f=10,u="";else if(7==e[s][h].type||8==e[s][h].type){var c=u-e[s][h].str;r[h]++,c>=0&&c<256&&r[h]>i/2&&(f=8,u=c)}else 3!=e[s][h].type&&9!=e[s][h].type||e[s][h].str.length!=u.length||(c=u-e[s][h].str,r[h]++,c>=0&&c<256&&r[h]>i/2&&(f=9,u=c));e[i][h]={str:a[A],val:u,type:f},o<e[i][h].val.length+3&&(o=e[i][h].val.length+3)}return e[i][++h]={type:12},[h+1,o]}e.exports={encode:function(e,t){var r=e.toString();"\n"==r[r.length-1]&&(r=r.substring(0,r.length-1));var i=r.split("\n"),o=new n("",0,2*r.length+1e4);o.WriteUint32(r.length),o.WriteUint32(i.length),o.WriteByte(t);for(var s=new Array(i.length),a={},A=new Array(256).fill(0),u=0,l=0,g=0;g<i.length;g++){var[d,I]=c(s,a,A,i[g],g);u<d&&(u=d),l<I&&(l=I)}for(var C=0;C<u;C++){for(var p=new Array(13),m=0;m<=12;m++)p[m]=new n("",0,i.length*l);h(p,s,C,i),f(p,0,t,o)}return o.buf.slice(0,o.pos)},decode:function(e,t,r){(e=new n(e)).ReadUint32();var a=e.ReadUint32(),h=e.ReadByte(),f=function(e,t,r,a){for(var A=-1,h=new Array(256);!e.EOF();){var f=e.ReadByte(),u=128&f,c=64&f,l=63&f;if(u&&(h[++A]=new Array(13)),0!=l&&u){var g=new Array(a-1).fill(10);h[A][0]=new n(o([new Uint8Array(l),g]))}if(c){var d=e.ReadByte(),I=e.ReadByte();h[A][l]=new n(h[d][I].buf)}else{var C=e.ReadUint7(),p=e.ReadData(C);h[A][l]=r?s.decode(p):i.decode(p),h[A][l]=new n(h[A][l])}}return h}(e,0,h,a),u=new Array(a),c=new Array(a),l="";void 0===r&&(r="\n");for(var g=0;g<a;g++)l+=A(f,u,c,g)+r;return l}}},7806:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedCramFile=t.CraiIndex=t.CramFile=t.CramRecord=void 0;var i=r(7390);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return i.CramRecord}}),Object.defineProperty(t,"CramFile",{enumerable:!0,get:function(){return n(i).default}});var o=r(4923);Object.defineProperty(t,"CraiIndex",{enumerable:!0,get:function(){return n(o).default}});var s=r(6014);Object.defineProperty(t,"IndexedCramFile",{enumerable:!0,get:function(){return n(s).default}})},6014:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(7390)),o=r(9747);t.default=class{constructor(e){if(this.cram=e.cram??new i.default({url:e.cramUrl,path:e.cramPath,filehandle:e.cramFilehandle,seqFetch:e.seqFetch,checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize}),!(this.cram instanceof i.default))throw new Error("invalid arguments: no cramfile");this.index=e.index}async getRecordsForRange(e,t,r,n={}){if(n.viewAsPairs=n.viewAsPairs||!1,n.pairAcrossChr=n.pairAcrossChr||!1,n.maxInsertSize=n.maxInsertSize||2e5,"string"==typeof e)throw new o.CramUnimplementedError("string sequence names not yet supported");const i=e,s=await this.index.getEntriesForRange(i,t,r),a=n=>n.sequenceId===e&&n.alignmentStart<=r&&void 0!==n.lengthOnRef&&n.alignmentStart+n.lengthOnRef-1>=t,A=await Promise.all(s.map((e=>this.getRecordsInSlice(e,a))));let h=Array.prototype.concat(...A);if(n.viewAsPairs){const e={},t={};for(const r of h){const n=r.readName;if(void 0===n)throw new Error("readName undefined");const i=r.uniqueId;e[n]||(e[n]=0),e[n]+=1,t[i]=1}const r={};Object.entries(e).forEach((([e,t])=>{1===t&&(r[e]=!0)}));const o=[];for(const e of h){const t=e.readName;if(void 0===t)throw new Error("readName undefined");if(r[t]&&e.mate&&(e.mate.sequenceId===i||n.pairAcrossChr)&&Math.abs(e.alignmentStart-e.mate.alignmentStart)<n.maxInsertSize){const t=this.index.getEntriesForRange(e.mate.sequenceId,e.mate.alignmentStart,e.mate.alignmentStart+1);o.push(t)}}const s=await Promise.all(o);let a=[];for(const e of s)a.push(...e);a=a.sort(((e,t)=>e.toString().localeCompare(t.toString()))).filter(((e,t,r)=>!t||e.toString()!==r[t-1].toString()));const A=[],f=[];for(const e of a){let n=this.cram.featureCache.get(e.toString());n||(n=this.getRecordsInSlice(e,(()=>!0)),this.cram.featureCache.set(e.toString(),n)),A.push(n);const i=n.then((e=>{const n=[];for(const i of e){if(void 0===i.readName)throw new Error("readName undefined");r[i.readName]&&!t[i.uniqueId]&&n.push(i)}return n}));f.push(i)}const u=await Promise.all(f);if(u.length){const e=u.reduce(((e,t)=>e.concat(t)));h=h.concat(e)}}return h}getRecordsInSlice({containerStart:e,sliceStart:t,sliceBytes:r},n){return this.cram.getContainerAtPosition(e).getSlice(t,r).getRecords(n)}hasDataForReferenceSequence(e){return this.index.hasDataForReferenceSequence(e)}}},5931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteFile=t.LocalFile=void 0,t.open=function(e,t,r){if(r)return r;if(e)return new n.RemoteFile(e);if(t)return new n.LocalFile(t);throw new Error("no url, path, or filehandle provided, cannot open")};const n=r(1226);var i=r(1113);Object.defineProperty(t,"LocalFile",{enumerable:!0,get:function(){return i.LocalFile}}),Object.defineProperty(t,"RemoteFile",{enumerable:!0,get:function(){return i.RemoteFile}})},6476:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOTFREQ=t.TF_SHIFT=t.RANS_BYTE_L=void 0,t.TF_SHIFT=12,t.TOTFREQ=4096,t.RANS_BYTE_L=1<<23},997:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){let a=e.getInt(),A=e.getInt(),h=e.getInt(),f=e.getInt();const u=n.remaining(),c=-4&u;for(let i=0;i<c;i+=4){const u=t.R[s.default.get(a,o.TF_SHIFT)],c=t.R[s.default.get(A,o.TF_SHIFT)],l=t.R[s.default.get(h,o.TF_SHIFT)],g=t.R[s.default.get(f,o.TF_SHIFT)];n.putAt(i,u),n.putAt(i+1,c),n.putAt(i+2,l),n.putAt(i+3,g),a=s.default.advanceSymbolStep(a,r[255&u],o.TF_SHIFT),A=s.default.advanceSymbolStep(A,r[255&c],o.TF_SHIFT),h=s.default.advanceSymbolStep(h,r[255&l],o.TF_SHIFT),f=s.default.advanceSymbolStep(f,r[255&g],o.TF_SHIFT),a=s.default.renormalize(a,e),A=s.default.renormalize(A,e),h=s.default.renormalize(h,e),f=s.default.renormalize(f,e)}let l;switch(n.setPosition(c),3&u){case 0:break;case 1:l=t.R[s.default.get(a,o.TF_SHIFT)],s.default.advanceSymbol(a,e,r[255&l],o.TF_SHIFT),n.put(l);break;case 2:l=t.R[s.default.get(a,o.TF_SHIFT)],s.default.advanceSymbol(a,e,r[255&l],o.TF_SHIFT),n.put(l),l=t.R[s.default.get(A,o.TF_SHIFT)],s.default.advanceSymbol(A,e,r[255&l],o.TF_SHIFT),n.put(l);break;case 3:l=t.R[s.default.get(a,o.TF_SHIFT)],s.default.advanceSymbol(a,e,r[255&l],o.TF_SHIFT),n.put(l),l=t.R[s.default.get(A,o.TF_SHIFT)],s.default.advanceSymbol(A,e,r[255&l],o.TF_SHIFT),n.put(l),l=t.R[s.default.get(h,o.TF_SHIFT)],s.default.advanceSymbol(h,e,r[255&l],o.TF_SHIFT),n.put(l);break;default:throw new i.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)};const i=r(9747),o=r(6476),s=n(r(488))},7960:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){const s=t.remaining();let a=e.getInt(),A=e.getInt(),h=e.getInt(),f=e.getInt();const u=s>>2;let c=0,l=u,g=2*u,d=3*u,I=0,C=0,p=0,m=0;for(;c<u;c+=1,l+=1,g+=1,d+=1){const s=255&r[I].R[o.default.get(a,i.TF_SHIFT)],u=255&r[C].R[o.default.get(A,i.TF_SHIFT)],w=255&r[p].R[o.default.get(h,i.TF_SHIFT)],B=255&r[m].R[o.default.get(f,i.TF_SHIFT)];t.putAt(c,s),t.putAt(l,u),t.putAt(g,w),t.putAt(d,B),a=o.default.advanceSymbolStep(a,n[I][s],i.TF_SHIFT),A=o.default.advanceSymbolStep(A,n[C][u],i.TF_SHIFT),h=o.default.advanceSymbolStep(h,n[p][w],i.TF_SHIFT),f=o.default.advanceSymbolStep(f,n[m][B],i.TF_SHIFT),a=o.default.renormalize(a,e),A=o.default.renormalize(A,e),h=o.default.renormalize(h,e),f=o.default.renormalize(f,e),I=s,C=u,p=w,m=B}for(;d<s;d+=1){const s=255&r[m].R[o.default.get(f,i.TF_SHIFT)];t.putAt(d,s),f=o.default.advanceSymbol(f,e,n[m][s],i.TF_SHIFT),m=s}};const i=r(6476),o=n(r(488))},488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9747),i=r(6476);class o{constructor(){this.F=void 0,this.C=void 0}}function s(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}t.default={FC:o,AriDecoder:class{constructor(){this.fc=new Array(256);for(let e=0;e<this.fc.length;e+=1)this.fc[e]=new o;this.R=null}},DecodingSymbol:class{constructor(){this.start=void 0,this.freq=void 0}},symbolInit:function(e,t,r){if(!(t<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(r<=65536-t))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");e.start=t,e.freq=r},advanceStep:s,advanceSymbolStep:function(e,t,r){return s(e,t.start,t.freq,r)},get:function(e,t){return e&(1<<t)-1},advanceSymbol:function(e,t,r,n){return function(e,t,r,n,o){if((e=n*(e>>o)+(e&(1<<o)-1)-r)<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}(e,t,r.start,r.freq,n)},renormalize:function(e,t){if(e<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}}},1971:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.readStatsO0=function(e,t,r){let n=0,i=0,A=255&e.get();do{null==t.fc[A]&&(t.fc[A]=new s.default.FC),t.fc[A].F=255&e.get(),t.fc[A].F>=128&&(t.fc[A].F&=-129,t.fc[A].F=(127&t.fc[A].F)<<8|255&e.get()),t.fc[A].C=i,s.default.symbolInit(r[A],t.fc[A].C,t.fc[A].F),t.R||(t.R=new Array(o.TOTFREQ)),t.R.fill(A,i,i+t.fc[A].F),i+=t.fc[A].F,0===n&&A+1===(255&e.getByteAt(e.position()))?(A=255&e.get(),n=255&e.get()):0!==n?(n-=1,A+=1):A=255&e.get()}while(0!==A);a(i<o.TOTFREQ)},t.readStatsO1=function(e,t,r){let n=0,i=255&e.get();do{let A=0,h=0,f=255&e.get();null==t[i]&&(t[i]=new s.default.AriDecoder);do{null==t[i].fc[f]&&(t[i].fc[f]=new s.default.FC),t[i].fc[f].F=255&e.get(),t[i].fc[f].F>=128&&(t[i].fc[f].F&=-129,t[i].fc[f].F=(127&t[i].fc[f].F)<<8|255&e.get()),t[i].fc[f].C=h,0===t[i].fc[f].F&&(t[i].fc[f].F=o.TOTFREQ),null==r[i][f]&&(r[i][f]=new s.default.RansDecSymbol),s.default.symbolInit(r[i][f],t[i].fc[f].C,t[i].fc[f].F),null==t[i].R&&(t[i].R=new Array(o.TOTFREQ)),t[i].R.fill(f,h,h+t[i].fc[f].F),h+=t[i].fc[f].F,a(h<=o.TOTFREQ),0===A&&f+1===(255&e.getByteAt(e.position()))?(f=255&e.get(),A=255&e.get()):0!==A?(A-=1,f+=1):f=255&e.get()}while(0!==f);0===n&&i+1===(255&e.getByteAt(e.position()))?(i=255&e.get(),n=255&e.get()):0!==n?(n-=1,i+=1):i=255&e.get()}while(0!==i)};const i=r(9747),o=r(6476),s=n(r(488));function a(e){if(!e)throw new i.CramMalformedError("assertion failed")}},9989:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r=0){if(0===e.length)return t.fill(0),t;const n=new f(e,r),u=n.get();if(0!==u&&1!==u)throw new i.CramMalformedError(`Invalid rANS order ${u}`);if(n.getInt()!==n.remaining()-h)throw new i.CramMalformedError("Incorrect input length.");const c=n.getInt(),l=new f(t||new Uint8Array(c));if(l.length<c)throw new i.CramMalformedError(`Output buffer too small to fit ${c} bytes.`);switch(u){case 0:return function(e,t){const r=new a.default.AriDecoder,n=new Array(256);for(let e=0;e<n.length;e+=1)n[e]=new a.default.DecodingSymbol;return(0,A.readStatsO0)(e,r,n),(0,o.default)(e,r,n,t),t}(n,l);case 1:return function(e,t){const r=new Array(256);for(let e=0;e<r.length;e+=1)r[e]=new a.default.AriDecoder;const n=new Array(256);for(let e=0;e<n.length;e+=1){n[e]=new Array(256);for(let t=0;t<n[e].length;t+=1)n[e][t]=new a.default.DecodingSymbol}return(0,A.readStatsO1)(e,r,n),(0,s.default)(e,t,r,n),t}(n,l);default:throw new i.CramMalformedError(`Invalid rANS order: ${u}`)}};const i=r(9747),o=n(r(997)),s=n(r(7960)),a=n(r(488)),A=r(1971),h=4;class f{constructor(e,t=0){this._buffer=e,this._dataView=new DataView(e.buffer),this._position=t,this.length=e.length}get(){const e=this._buffer[this._position];return this._position+=1,e}getByte(){return this.get()}getByteAt(e){return this._buffer[e]}position(){return this._position}put(e){return this._buffer[this._position]=e,this._position+=1,e}putAt(e,t){return this._buffer[e]=t,t}setPosition(e){return this._position=e,e}getInt(){const e=this._dataView.getInt32(this._position,!0);return this._position+=4,e}remaining(){return this._buffer.length-this._position}}},5417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHeaderText=function(e){const t=e.split(/\r?\n/),r=[];for(const e of t){const[t,...n]=e.split(/\t/);t&&r.push({tag:t.slice(1),data:n.map((e=>{const t=e.indexOf(":");return-1!==t?{tag:e.slice(0,t),value:e.slice(t+1)}:{tag:e,value:""}}))})}return r}},8876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unzip=function(e){return(0,n.inflate)(e)};const n=r(1668)},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],A=o[1],h=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,A)),f=0,u=A>0?s-4:s;for(r=0;r<u;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],h[f++]=t>>16&255,h[f++]=t>>8&255,h[f++]=255&t;return 2===A&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,h[f++]=255&t),1===A&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,h[f++]=t>>8&255,h[f++]=255&t),h},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,h=n-i;a<h;a+=s)o.push(A(e,a,a+s>h?h:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function A(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=A,t.IS=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,A.prototype),t}function A(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return h(e,t,r)}function h(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!A.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|d(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return l(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return l(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return l(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return A.from(n,t,r);const i=function(e){if(A.isBuffer(e)){const t=0|g(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return A.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return f(e),a(e<0?0:0|g(e))}function c(e){const t=e.length<0?0:0|g(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,A.prototype),n}function g(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function d(e,t){if(A.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function I(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return Q(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function C(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function p(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=A.from(t,n)),A.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,s=1,a=e.length,A=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,A/=2,r/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(h(e,o)===h(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===A)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+A>a&&(r=a-A),o=r;o>=0;o--){let r=!0;for(let n=0;n<A;n++)if(h(e,o+n)!==h(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(W(n))return s;e[r+s]=n}return s}function B(e,t,r,n){return j(Y(t,e.length-r),e,r,n)}function y(e,t,r,n){return j(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return j(K(t),e,r,n)}function E(e,t,r,n){return j(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function b(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function Q(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,A;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(A=(31&t)<<6|63&r,A>127&&(o=A));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(A=(15&t)<<12|(63&r)<<6|63&n,A>2047&&(A<55296||A>57343)&&(o=A));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(A=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,A>65535&&A<1114112&&(o=A))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=v)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=v));return r}(n)}A.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),A.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.buffer}}),Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:function(){if(A.isBuffer(this))return this.byteOffset}}),A.poolSize=8192,A.from=function(e,t,r){return h(e,t,r)},Object.setPrototypeOf(A.prototype,Uint8Array.prototype),Object.setPrototypeOf(A,Uint8Array),A.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},A.allocUnsafe=function(e){return u(e)},A.allocUnsafeSlow=function(e){return u(e)},A.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==A.prototype},A.compare=function(e,t){if($(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=A.from(t,t.offset,t.byteLength)),!A.isBuffer(e)||!A.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},A.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},A.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return A.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=A.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))i+t.length>n.length?(A.isBuffer(t)||(t=A.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!A.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},A.byteLength=d,A.prototype._isBuffer=!0,A.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)C(this,t,t+1);return this},A.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},A.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},A.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?Q(this,0,e):I.apply(this,arguments)},A.prototype.toLocaleString=A.prototype.toString,A.prototype.equals=function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===A.compare(this,e)},A.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(A.prototype[o]=A.prototype.inspect),A.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),h=this.slice(n,i),f=e.slice(t,r);for(let e=0;e<a;++e)if(h[e]!==f[e]){o=h[e],s=f[e];break}return o<s?-1:s<o?1:0},A.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},A.prototype.indexOf=function(e,t,r){return p(this,e,t,r,!0)},A.prototype.lastIndexOf=function(e,t,r){return p(this,e,t,r,!1)},A.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return B(this,e,t,r);case"ascii":case"latin1":case"binary":return y(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},A.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const v=4096;function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function D(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Z[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function F(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,o){if(!A.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function x(e,t,r,n,i){H(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function q(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}A.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,A.prototype),n},A.prototype.readUintLE=A.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},A.prototype.readUintBE=A.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},A.prototype.readUint8=A.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},A.prototype.readUint16LE=A.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},A.prototype.readUint16BE=A.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},A.prototype.readUint32LE=A.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},A.prototype.readUint32BE=A.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},A.prototype.readBigUInt64LE=V((function(e){P(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),A.prototype.readBigUInt64BE=V((function(e){P(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),A.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},A.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},A.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},A.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},A.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},A.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},A.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},A.prototype.readBigInt64LE=V((function(e){P(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),A.prototype.readBigInt64BE=V((function(e){P(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),A.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!0,23,4)},A.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!1,23,4)},A.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!0,52,8)},A.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!1,52,8)},A.prototype.writeUintLE=A.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},A.prototype.writeUintBE=A.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},A.prototype.writeUint8=A.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},A.prototype.writeUint16LE=A.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeUint16BE=A.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeUint32LE=A.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},A.prototype.writeUint32BE=A.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeBigUInt64LE=V((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),A.prototype.writeBigUInt64BE=V((function(e,t=0){return x(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),A.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},A.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);N(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},A.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},A.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},A.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},A.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},A.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},A.prototype.writeBigInt64LE=V((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),A.prototype.writeBigInt64BE=V((function(e,t=0){return x(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),A.prototype.writeFloatLE=function(e,t,r){return U(this,e,t,!0,r)},A.prototype.writeFloatBE=function(e,t,r){return U(this,e,t,!1,r)},A.prototype.writeDoubleLE=function(e,t,r){return q(this,e,t,!0,r)},A.prototype.writeDoubleBE=function(e,t,r){return q(this,e,t,!1,r)},A.prototype.copy=function(e,t,r,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},A.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=A.isBuffer(e)?e:A.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const T={};function z(e,t,r){T[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function O(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new T.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){P(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(n,i,o)}function P(e,t){if("number"!=typeof e)throw new T.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw P(e,r),new T.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new T.ERR_BUFFER_OUT_OF_BOUNDS;throw new T.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),z("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=O(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=O(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const J=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function V(e){return"undefined"==typeof BigInt?X:e}function X(){throw new Error("BigInt not supported")}},235:e=>{var t={array:function(e){var t=0,r=0,n=[0,1,3,7,15,31,63,127,255];return function(i){for(var o=0;i>0;){var s=8-t;i>=s?(o<<=s,o|=n[s]&e[r++],t=0,i-=s):(o<<=i,o|=(e[r]&n[i]<<8-i-t)>>8-i-t,t+=i,i=0)}return o}},simple:function(e){var r,n,i=t.header(e),o=[],s=0;do{-1!=(n=t.decompress(e,i))&&(o.push(n),s+=n.byteLength)}while(-1!=n);r=new Uint8Array(s),s=0;for(var a=0;a<o.length;++a)n=o[a],r.set(n,s),s+=n.byteLength;return r},header:function(e){if(4348520!=e(24))throw"No magic number found";var t=e(8)-48;if(t<1||t>9)throw"Not a BZIP archive";return t},decompress:function(e,t,r){for(var n=9e5,i="",o=0;o<6;o++)i+=e(8).toString(16);if("177245385090"==i)return-1;if("314159265359"!=i)throw"eek not valid bzip data";if(e(32),e(1))throw"unsupported obsolete version";var s=e(24);if(s>n)throw"Initial position larger than buffer size";var a=e(16),A=new Uint8Array(256),h=0;for(o=0;o<16;o++)if(a&1<<15-o){var f=e(16);for(d=0;d<16;d++)f&1<<15-d&&(A[h++]=16*o+d)}var u=e(3);if(u<2||u>6)throw"another error";var c=e(15);if(0==c)throw"meh";var l=[];for(o=0;o<u;o++)l[o]=o;var g=new Uint8Array(32768);for(o=0;o<c;o++){for(var d=0;e(1);d++)if(d>=u)throw"whoops another error";var I=l[d];l.splice(d,1),l.splice(0,0,I),g[o]=I}var C=h+2,p=[];for(d=0;d<u;d++){var m,w,B,y=new Uint8Array(258),_=new Uint8Array(21);for(a=e(5),o=0;o<C;o++){for(;;){if(a<1||a>20)throw"I gave up a while ago on writing error messages";if(!e(1))break;e(1)?a--:a++}y[o]=a}for(m=w=y[0],o=1;o<C;o++)y[o]>w?w=y[o]:y[o]<m&&(m=y[o]);(B=p[d]={}).permute=new Uint32Array(258),B.limit=new Uint32Array(21),B.base=new Uint32Array(21),B.minLen=m,B.maxLen=w;var E=B.base.subarray(1),b=B.limit.subarray(1),Q=0;for(o=m;o<=w;o++)for(a=0;a<C;a++)y[a]==o&&(B.permute[Q++]=a);for(o=m;o<=w;o++)_[o]=b[o]=0;for(o=0;o<C;o++)_[y[o]]++;for(Q=a=0,o=m;o<w;o++)Q+=_[o],b[o]=Q-1,Q<<=1,E[o+1]=Q-(a+=_[o]);b[w]=Q+_[w]-1,E[m]=0}var v,S,k,D=new Uint32Array(256);for(o=0;o<256;o++)l[o]=o;v=S=C=k=0;for(var R=new Uint32Array(n);;){if(!C--){if(C=49,k>=c)throw"meow i'm a kitty, that's an error";E=(B=p[g[k++]]).base.subarray(1),b=B.limit.subarray(1)}for(d=e(o=B.minLen);;){if(o>B.maxLen)throw"rawr i'm a dinosaur";if(d<=b[o])break;o++,d=d<<1|e(1)}if((d-=E[o])<0||d>=258)throw"moo i'm a cow";var F=B.permute[d];if(0!=F&&1!=F){if(v){if(v=0,S+a>=n)throw"Boom.";for(D[I=A[l[0]]]+=a;a--;)R[S++]=I}if(F>h)break;if(S>=n)throw"I can't think of anything. Error";I=l[o=F-1],l.splice(o,1),l.splice(0,0,I),D[I=A[I]]++,R[S++]=I}else v||(v=1,a=0),a+=0==F?v:2*v,v<<=1}if(s<0||s>=S)throw"I'm a monkey and I'm throwing something at someone, namely you";for(d=0,o=0;o<256;o++)f=d+D[o],D[o]=d,d=f;for(o=0;o<S;o++)R[D[I=255&R[o]]]|=o<<8,D[I]++;var N=0,M=0,x=0;S&&(M=255&(N=R[s]),N>>=8,x=-1);var L,U,q,T=new Uint8Array(n),z=0;for(r||(r=1/0);S;){for(S--,U=M,M=255&(N=R[N]),N>>=8,3==x++?(L=M,q=U,M=-1):(L=1,q=M);L--;)if(T[z++]=q,! --r)return T;M!=U&&(x=0)}return T.subarray(0,z)}};e.exports=t},2151:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=t},3939:e=>{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var r=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?r.push(t.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&r.push((t.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(n))>>>6-2*i);return r}},e.exports=r},1113:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BlobFile:()=>h,LocalFile:()=>i(),RemoteFile:()=>a,fromUrl:()=>f,open:()=>u});var n=r(3617),i=r.n(n),o=r(8287);function s(e){return("object"==typeof e&&null!==e&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class a{async getBufferFromResponse(e){const t=await e.arrayBuffer();return o.hp.from(t)}constructor(e,t={}){this.baseOverrides={},this.url=e;const r=t.fetch||globalThis.fetch.bind(globalThis);if(!r)throw new TypeError("no fetch function supplied, and none found in global environment");t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=r}async fetch(e,t){let r;try{r=await this.fetchImplementation(e,t)}catch(n){if(!`${n}`.includes("Failed to fetch"))throw new Error(`${s(n)} fetching ${e}`,{cause:n});console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{r=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(t){throw new Error(`${s(t)} fetching ${e}`,{cause:t})}}return r}async read(e,t=0,r,n=0,i={}){const{headers:o={},signal:s,overrides:a={}}=i;r<1/0?o.range=`bytes=${n}-${n+r}`:r===1/0&&0!==n&&(o.range=`bytes=${n}-`);const A=await this.fetch(this.url,{...this.baseOverrides,...a,headers:{...o,...a.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:s});if(!A.ok)throw new Error(`HTTP ${A.status} fetching ${this.url}`);if(200===A.status&&0===n||206===A.status){const n=await this.getBufferFromResponse(A),i=n.copy(e,t,0,Math.min(r,n.length)),o=A.headers.get("content-range"),s=/\/(\d+)$/.exec(o||"");return(null==s?void 0:s[1])&&(this._stat={size:parseInt(s[1],10)}),{bytesRead:i,buffer:e}}if(200===A.status)throw new Error(`${this.url} fetch returned status 200, expected 206`);throw new Error(`HTTP ${A.status} fetching ${this.url}`)}async readFile(e={}){let t,r;"string"==typeof e?(t=e,r={}):(t=e.encoding,r=e,delete r.encoding);const{headers:n={},signal:i,overrides:o={}}=r,s=await this.fetch(this.url,{headers:n,method:"GET",redirect:"follow",mode:"cors",signal:i,...this.baseOverrides,...o});if(200!==s.status)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if("utf8"===t)return s.text();if(t)throw new Error(`unsupported encoding: ${t}`);return this.getBufferFromResponse(s)}async stat(){if(!this._stat){const e=o.hp.allocUnsafe(10);if(await this.read(e,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}function A(e){const t=new FileReader;return new Promise(((r,n)=>{t.onerror=()=>{t.abort(),n(new Error("problem reading blob"))},t.onabort=()=>{n(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&"string"!=typeof t.result?r(t.result):n(new Error("unknown error reading blob"))},t.readAsArrayBuffer(e)}))}class h{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0,r,n=0){if(!r)return{bytesRead:0,buffer:e};const i=n,s=i+r,a=await A(this.blob.slice(i,s)),h=o.hp.from(a);return{bytesRead:h.copy(e,t),buffer:h}}async readFile(e){const t="string"==typeof e?e:null==e?void 0:e.encoding;if("utf8"===t)return function(e){const t=new FileReader;return new Promise(((r,n)=>{t.onerror=()=>{t.abort(),n(new Error("problem reading blob"))},t.onabort=()=>{n(new Error("blob reading was aborted"))},t.onload=()=>{t.result&&"string"==typeof t.result?r(t.result):n(new Error("unknown error reading blob"))},t.readAsText(e)}))}(this.blob);if(t)throw new Error(`unsupported encoding: ${t}`);const r=await A(this.blob);return o.hp.from(r)}async stat(){return{size:this.size}}async close(){}}function f(e,t={}){return new a(e,t)}function u(e,t,r,n={}){if(void 0!==r)return r;if(void 0!==e)return f(e,n);if(void 0!==t)return new(i())(t,n);throw new Error("no url, path, or filehandle provided, cannot open")}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,A=(1<<a)-1,h=A>>1,f=-7,u=r?i-1:0,c=r?-1:1,l=e[t+u];for(u+=c,o=l&(1<<-f)-1,l>>=-f,f+=a;f>0;o=256*o+e[t+u],u+=c,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+u],u+=c,f-=8);if(0===o)o=1-h;else{if(o===A)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=h}return(l?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,A,h=8*o-i-1,f=(1<<h)-1,u=f>>1,c=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,g=n?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(A=Math.pow(2,-s))<1&&(s--,A*=2),(t+=s+u>=1?c/A:c*Math.pow(2,1-u))*A>=2&&(s++,A/=2),s+u>=f?(a=0,s=f):s+u>=1?(a=(t*A-1)*Math.pow(2,i),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[r+l]=255&a,l+=g,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;e[r+l]=255&s,l+=g,s/=256,h-=8);e[r+l-g]|=128*d}},8570:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},o={};function s(e,t){var r,n,s;return t?(s=0<=(e>>>=0)&&e<256)&&(n=o[e])?n:(r=A(e,(0|e)<0?-1:0,!0),s&&(o[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=A(e,e<0?-1:0,!1),s&&(i[e]=r),r)}function a(e,t){if(isNaN(e))return t?C:I;if(t){if(e<0)return C;if(e>=l)return y}else{if(e<=-g)return _;if(e+1>=g)return B}return e<0?a(-e,t).neg():A(e%c|0,e/c|0,t)}function A(e,t,n){return new r(e,t,n)}r.fromInt=s,r.fromNumber=a,r.fromBits=A;var h=Math.pow;function f(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return I;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return f(e.substring(1),t,r).neg();for(var i=a(h(r,8)),o=I,s=0;s<e.length;s+=8){var A=Math.min(8,e.length-s),u=parseInt(e.substring(s,s+A),r);if(A<8){var c=a(h(r,A));o=o.mul(c).add(a(u))}else o=(o=o.mul(i)).add(a(u))}return o.unsigned=t,o}function u(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?f(e,t):A(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=f,r.fromValue=u;var c=4294967296,l=c*c,g=l/2,d=s(1<<24),I=s(0);r.ZERO=I;var C=s(0,!0);r.UZERO=C;var p=s(1);r.ONE=p;var m=s(1,!0);r.UONE=m;var w=s(-1);r.NEG_ONE=w;var B=A(-1,2147483647,!1);r.MAX_VALUE=B;var y=A(-1,-1,!0);r.MAX_UNSIGNED_VALUE=y;var _=A(0,-2147483648,!1);r.MIN_VALUE=_;var E=r.prototype;E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},E.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(_)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(h(e,6),this.unsigned),o=this,s="";;){var A=o.div(i),f=(o.sub(A.mul(i)).toInt()>>>0).toString(e);if((o=A).isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},E.isZero=function(){return 0===this.high&&0===this.low},E.eqz=E.isZero,E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return!(1&~this.low)},E.isEven=function(){return!(1&this.low)},E.equals=function(e){return n(e)||(e=u(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(e){if(n(e)||(e=u(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(p)},E.neg=E.negate,E.add=function(e){n(e)||(e=u(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,a=65535&e.high,h=e.low>>>16,f=0,c=0,l=0,g=0;return l+=(g+=o+(65535&e.low))>>>16,c+=(l+=i+h)>>>16,f+=(c+=r+a)>>>16,f+=t+s,A((l&=65535)<<16|(g&=65535),(f&=65535)<<16|(c&=65535),this.unsigned)},E.subtract=function(e){return n(e)||(e=u(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return I;if(n(e)||(e=u(e)),t)return A(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return I;if(this.eq(_))return e.isOdd()?_:I;if(e.eq(_))return this.isOdd()?_:I;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,h=e.high>>>16,f=65535&e.high,c=e.low>>>16,l=65535&e.low,g=0,C=0,p=0,m=0;return p+=(m+=s*l)>>>16,C+=(p+=o*l)>>>16,p&=65535,C+=(p+=s*c)>>>16,g+=(C+=i*l)>>>16,C&=65535,g+=(C+=o*c)>>>16,C&=65535,g+=(C+=s*f)>>>16,g+=r*l+i*c+o*f+s*h,A((p&=65535)<<16|(m&=65535),(g&=65535)<<16|(C&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(n(e)||(e=u(e)),e.isZero())throw Error("division by zero");var r,i,o;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?A((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?C:I;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return C;if(e.gt(this.shru(1)))return m;o=C}else{if(this.eq(_))return e.eq(p)||e.eq(w)?_:e.eq(_)?p:(r=this.shr(1).div(e).shl(1)).eq(I)?e.isNegative()?p:w:(i=this.sub(e.mul(r)),o=r.add(i.div(e)));if(e.eq(_))return this.unsigned?C:I;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=I}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),f=s<=48?1:h(2,s-48),c=a(r),l=c.mul(e);l.isNegative()||l.gt(i);)l=(c=a(r-=f,this.unsigned)).mul(e);c.isZero()&&(c=p),o=o.add(c),i=i.sub(l)}return o},E.div=E.divide,E.modulo=function(e){return n(e)||(e=u(e)),t?A((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return A(~this.low,~this.high,this.unsigned)},E.and=function(e){return n(e)||(e=u(e)),A(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return n(e)||(e=u(e)),A(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return n(e)||(e=u(e)),A(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?A(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):A(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?A(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):A(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?A(this.low>>>e|t<<32-e,t>>>e,this.unsigned):A(32===e?t:t>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?A(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:A(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3503:(e,t,r)=>{var n,i,o,s,a;n=r(3939),i=r(2151).utf8,o=r(652),s=r(2151).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?s.stringToBytes(e):i.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=n.bytesToWords(e),A=8*e.length,h=1732584193,f=-271733879,u=-1732584194,c=271733878,l=0;l<r.length;l++)r[l]=16711935&(r[l]<<8|r[l]>>>24)|4278255360&(r[l]<<24|r[l]>>>8);r[A>>>5]|=128<<A%32,r[14+(A+64>>>9<<4)]=A;var g=a._ff,d=a._gg,I=a._hh,C=a._ii;for(l=0;l<r.length;l+=16){var p=h,m=f,w=u,B=c;h=g(h,f,u,c,r[l+0],7,-680876936),c=g(c,h,f,u,r[l+1],12,-389564586),u=g(u,c,h,f,r[l+2],17,606105819),f=g(f,u,c,h,r[l+3],22,-1044525330),h=g(h,f,u,c,r[l+4],7,-176418897),c=g(c,h,f,u,r[l+5],12,1200080426),u=g(u,c,h,f,r[l+6],17,-1473231341),f=g(f,u,c,h,r[l+7],22,-45705983),h=g(h,f,u,c,r[l+8],7,1770035416),c=g(c,h,f,u,r[l+9],12,-1958414417),u=g(u,c,h,f,r[l+10],17,-42063),f=g(f,u,c,h,r[l+11],22,-1990404162),h=g(h,f,u,c,r[l+12],7,1804603682),c=g(c,h,f,u,r[l+13],12,-40341101),u=g(u,c,h,f,r[l+14],17,-1502002290),h=d(h,f=g(f,u,c,h,r[l+15],22,1236535329),u,c,r[l+1],5,-165796510),c=d(c,h,f,u,r[l+6],9,-1069501632),u=d(u,c,h,f,r[l+11],14,643717713),f=d(f,u,c,h,r[l+0],20,-373897302),h=d(h,f,u,c,r[l+5],5,-701558691),c=d(c,h,f,u,r[l+10],9,38016083),u=d(u,c,h,f,r[l+15],14,-660478335),f=d(f,u,c,h,r[l+4],20,-405537848),h=d(h,f,u,c,r[l+9],5,568446438),c=d(c,h,f,u,r[l+14],9,-1019803690),u=d(u,c,h,f,r[l+3],14,-187363961),f=d(f,u,c,h,r[l+8],20,1163531501),h=d(h,f,u,c,r[l+13],5,-1444681467),c=d(c,h,f,u,r[l+2],9,-51403784),u=d(u,c,h,f,r[l+7],14,1735328473),h=I(h,f=d(f,u,c,h,r[l+12],20,-1926607734),u,c,r[l+5],4,-378558),c=I(c,h,f,u,r[l+8],11,-2022574463),u=I(u,c,h,f,r[l+11],16,1839030562),f=I(f,u,c,h,r[l+14],23,-35309556),h=I(h,f,u,c,r[l+1],4,-1530992060),c=I(c,h,f,u,r[l+4],11,1272893353),u=I(u,c,h,f,r[l+7],16,-155497632),f=I(f,u,c,h,r[l+10],23,-1094730640),h=I(h,f,u,c,r[l+13],4,681279174),c=I(c,h,f,u,r[l+0],11,-358537222),u=I(u,c,h,f,r[l+3],16,-722521979),f=I(f,u,c,h,r[l+6],23,76029189),h=I(h,f,u,c,r[l+9],4,-640364487),c=I(c,h,f,u,r[l+12],11,-421815835),u=I(u,c,h,f,r[l+15],16,530742520),h=C(h,f=I(f,u,c,h,r[l+2],23,-995338651),u,c,r[l+0],6,-198630844),c=C(c,h,f,u,r[l+7],10,1126891415),u=C(u,c,h,f,r[l+14],15,-1416354905),f=C(f,u,c,h,r[l+5],21,-57434055),h=C(h,f,u,c,r[l+12],6,1700485571),c=C(c,h,f,u,r[l+3],10,-1894986606),u=C(u,c,h,f,r[l+10],15,-1051523),f=C(f,u,c,h,r[l+1],21,-2054922799),h=C(h,f,u,c,r[l+8],6,1873313359),c=C(c,h,f,u,r[l+15],10,-30611744),u=C(u,c,h,f,r[l+6],15,-1560198380),f=C(f,u,c,h,r[l+13],21,1309151649),h=C(h,f,u,c,r[l+4],6,-145523070),c=C(c,h,f,u,r[l+11],10,-1120210379),u=C(u,c,h,f,r[l+2],15,718787259),f=C(f,u,c,h,r[l+9],21,-343485551),h=h+p>>>0,f=f+m>>>0,u=u+w>>>0,c=c+B>>>0}return n.endian([h,f,u,c])})._ff=function(e,t,r,n,i,o,s){var a=e+(t&r|~t&n)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._gg=function(e,t,r,n,i,o,s){var a=e+(t&n|r&~n)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._hh=function(e,t,r,n,i,o,s){var a=e+(t^r^n)+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._ii=function(e,t,r,n,i,o,s){var a=e+(r^(t|~n))+(i>>>0)+s;return(a<<o|a>>>32-o)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(a(e,t));return t&&t.asBytes?r:t&&t.asString?s.bytesToString(r):n.bytesToHex(r)}},652:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},1668:(e,t,r)=>{"use strict";var n={};(0,r(9805).assign)(n,r(3303),r(7083),r(9681)),e.exports=n},3303:(e,t,r)=>{"use strict";var n=r(8411),i=r(9805),o=r(1996),s=r(4674),a=r(4442),A=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(s[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var f;if(f="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===A.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,f)))throw new Error(s[r]);this._dict_set=!0}}function f(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}h.prototype.push=function(e,t){var r,s,a=this.strm,h=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=o.string2buf(e):"[object ArrayBuffer]"===A.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new i.Buf8(h),a.next_out=0,a.avail_out=h),1!==(r=n.deflate(a,s))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(a.output,a.next_out))):this.onData(i.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==s||(this.onEnd(0),a.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=f,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,f(e,t)}},7083:(e,t,r)=>{"use strict";var n=r(1447),i=r(9805),o=r(1996),s=r(9681),a=r(4674),A=r(4442),h=r(7414),f=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(a[r]);if(this.header=new h,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===f.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(a[r])}function c(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}u.prototype.push=function(e,t){var r,a,A,h,u,c=this.strm,l=this.options.chunkSize,g=this.options.dictionary,d=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?c.input=o.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?c.input=new Uint8Array(e):c.input=e,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new i.Buf8(l),c.next_out=0,c.avail_out=l),(r=n.inflate(c,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&g&&(r=n.inflateSetDictionary(this.strm,g)),r===s.Z_BUF_ERROR&&!0===d&&(r=s.Z_OK,d=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&r!==s.Z_STREAM_END&&(0!==c.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(A=o.utf8border(c.output,c.next_out),h=c.next_out-A,u=o.buf2string(c.output,A),c.next_out=h,c.avail_out=l-h,h&&i.arraySet(c.output,c.output,A,h,0),this.onData(u)):this.onData(i.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(d=!0)}while((c.avail_in>0||0===c.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),c.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=u,t.inflate=c,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,c(e,t)},t.ungzip=c},9805:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(r)},1996:(e,t,r)=>{"use strict";var n=r(9805),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new n.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function A(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,t.string2buf=function(e){var t,r,i,o,s,a=e.length,A=0;for(o=0;o<a;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),A+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(A),s=0,o=0;s<A;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<a&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return A(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,o,a=t||e.length,h=new Array(2*a);for(n=0,r=0;r<a;)if((i=e[r++])<128)h[n++]=i;else if((o=s[i])>4)h[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<a;)i=i<<6|63&e[r++],o--;o>1?h[n++]=65533:i<65536?h[n++]=i:(i-=65536,h[n++]=55296|i>>10&1023,h[n++]=56320|1023&i)}return A(h,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},3269:e=>{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16}},9681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var o=t,s=i+n;e^=-1;for(var a=i;a<s;a++)e=e>>>8^o[255&(e^r[a])];return~e}},8411:(e,t,r)=>{"use strict";var n,i=r(9805),o=r(3665),s=r(3269),a=r(4823),A=r(4674),h=-2,f=258,u=262,c=103,l=113,g=666;function d(e,t){return e.msg=A[t],t}function I(e){return(e<<1)-(e>4?9:0)}function C(e){for(var t=e.length;--t>=0;)e[t]=0}function p(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function m(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,p(e.strm)}function w(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function y(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),0===o?0:(e.avail_in-=o,i.arraySet(t,e.input,e.next_in,o,r),1===e.state.wrap?e.adler=s(e.adler,t,o,r):2===e.state.wrap&&(e.adler=a(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function _(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,A=e.strstart>e.w_size-u?e.strstart-(e.w_size-u):0,h=e.window,c=e.w_mask,l=e.prev,g=e.strstart+f,d=h[o+s-1],I=h[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(h[(r=t)+s]===I&&h[r+s-1]===d&&h[r]===h[o]&&h[++r]===h[o+1]){o+=2,r++;do{}while(h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&h[++o]===h[++r]&&o<g);if(n=f-(g-o),o=g-f,n>s){if(e.match_start=t,s=n,n>=a)break;d=h[o+s-1],I=h[o+s]}}}while((t=l[t&c])>A&&0!=--i);return s<=e.lookahead?s:e.lookahead}function E(e){var t,r,n,o,s,a=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-u)){i.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=a?n-a:0}while(--r);t=r=a;do{n=e.prev[--t],e.prev[t]=n>=a?n-a:0}while(--r);o+=a}if(0===e.strm.avail_in)break;if(r=y(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=r,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+3-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<u&&0!==e.strm.avail_in)}function b(e,t){for(var r,n;;){if(e.lookahead<u){if(E(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-u&&(e.match_length=_(e,r)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function Q(e,t){for(var r,n,i;;){if(e.lookahead<u){if(E(e),e.lookahead<u&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-u&&(e.match_length=_(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(m(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&m(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function v(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),C(this.dyn_ltree),C(this.dyn_dtree),C(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),C(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),C(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:l,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):d(e,h)}function D(e){var t,r=k(e);return 0===r&&((t=e.state).window_size=2*t.w_size,C(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function R(e,t,r,n,o,s){if(!e)return h;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),o<1||o>9||8!==r||n<8||n>15||t<0||t>9||s<0||s>4)return d(e,h);8===n&&(n=9);var A=new S;return e.state=A,A.strm=e,A.wrap=a,A.gzhead=null,A.w_bits=n,A.w_size=1<<A.w_bits,A.w_mask=A.w_size-1,A.hash_bits=o+7,A.hash_size=1<<A.hash_bits,A.hash_mask=A.hash_size-1,A.hash_shift=~~((A.hash_bits+3-1)/3),A.window=new i.Buf8(2*A.w_size),A.head=new i.Buf16(A.hash_size),A.prev=new i.Buf16(A.w_size),A.lit_bufsize=1<<o+6,A.pending_buf_size=4*A.lit_bufsize,A.pending_buf=new i.Buf8(A.pending_buf_size),A.d_buf=1*A.lit_bufsize,A.l_buf=3*A.lit_bufsize,A.level=t,A.strategy=s,A.method=r,D(e)}n=[new v(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(E(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,m(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-u&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(m(e,!1),e.strm.avail_out),1)})),new v(4,4,8,4,b),new v(4,5,16,8,b),new v(4,6,32,32,b),new v(4,4,16,16,Q),new v(8,16,32,32,Q),new v(8,16,128,128,Q),new v(8,32,128,256,Q),new v(32,128,258,1024,Q),new v(32,258,258,4096,Q)],t.deflateInit=function(e,t){return R(e,t,8,15,8,0)},t.deflateInit2=R,t.deflateReset=D,t.deflateResetKeep=k,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,0):h},t.deflate=function(e,t){var r,i,s,A;if(!e||!e.state||t>5||t<0)return e?d(e,h):h;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===g&&4!==t)return d(e,0===e.avail_out?-5:h);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,w(i,31),w(i,139),w(i,8),i.gzhead?(w(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),w(i,255&i.gzhead.time),w(i,i.gzhead.time>>8&255),w(i,i.gzhead.time>>16&255),w(i,i.gzhead.time>>24&255),w(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),w(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(w(i,255&i.gzhead.extra.length),w(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(w(i,0),w(i,0),w(i,0),w(i,0),w(i,0),w(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),w(i,3),i.status=l);else{var u=8+(i.w_bits-8<<4)<<8;u|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(u|=32),u+=31-u%31,i.status=l,B(i,u),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),p(e),s=i.pending,i.pending!==i.pending_buf_size));)w(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),p(e),s=i.pending,i.pending===i.pending_buf_size)){A=1;break}A=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,w(i,A)}while(0!==A);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===A&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),p(e),s=i.pending,i.pending===i.pending_buf_size)){A=1;break}A=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,w(i,A)}while(0!==A);i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===A&&(i.status=c)}else i.status=c;if(i.status===c&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&p(e),i.pending+2<=i.pending_buf_size&&(w(i,255&e.adler),w(i,e.adler>>8&255),e.adler=0,i.status=l)):i.status=l),0!==i.pending){if(p(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&I(t)<=I(r)&&4!==t)return d(e,-5);if(i.status===g&&0!==e.avail_in)return d(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==g){var y=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(E(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=f){if(E(e),e.lookahead<=f&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+f;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<s);e.match_length=f-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==y&&4!==y||(i.status=g),1===y||3===y)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===y&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(C(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),p(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(w(i,255&e.adler),w(i,e.adler>>8&255),w(i,e.adler>>16&255),w(i,e.adler>>24&255),w(i,255&e.total_in),w(i,e.total_in>>8&255),w(i,e.total_in>>16&255),w(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),p(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==c&&t!==l&&t!==g?d(e,h):(e.state=null,t===l?d(e,-3):0):h},t.deflateSetDictionary=function(e,t){var r,n,o,a,A,f,u,c,l=t.length;if(!e||!e.state)return h;if(2===(a=(r=e.state).wrap)||1===a&&42!==r.status||r.lookahead)return h;for(1===a&&(e.adler=s(e.adler,t,l,0)),r.wrap=0,l>=r.w_size&&(0===a&&(C(r.head),r.strstart=0,r.block_start=0,r.insert=0),c=new i.Buf8(r.w_size),i.arraySet(c,t,l-r.w_size,r.w_size,0),t=c,l=r.w_size),A=e.avail_in,f=e.next_in,u=e.input,e.avail_in=l,e.next_in=0,e.input=t,E(r);r.lookahead>=3;){n=r.strstart,o=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--o);r.strstart=n,r.lookahead=2,E(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=f,e.input=u,e.avail_in=A,r.wrap=a,0},t.deflateInfo="pako deflate (from Nodeca project)"},7414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293:e=>{"use strict";e.exports=function(e,t){var r,n,i,o,s,a,A,h,f,u,c,l,g,d,I,C,p,m,w,B,y,_,E,b,Q;r=e.state,n=e.next_in,b=e.input,i=n+(e.avail_in-5),o=e.next_out,Q=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),A=r.dmax,h=r.wsize,f=r.whave,u=r.wnext,c=r.window,l=r.hold,g=r.bits,d=r.lencode,I=r.distcode,C=(1<<r.lenbits)-1,p=(1<<r.distbits)-1;e:do{g<15&&(l+=b[n++]<<g,g+=8,l+=b[n++]<<g,g+=8),m=d[l&C];t:for(;;){if(l>>>=w=m>>>24,g-=w,0==(w=m>>>16&255))Q[o++]=65535&m;else{if(!(16&w)){if(64&w){if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}m=d[(65535&m)+(l&(1<<w)-1)];continue t}for(B=65535&m,(w&=15)&&(g<w&&(l+=b[n++]<<g,g+=8),B+=l&(1<<w)-1,l>>>=w,g-=w),g<15&&(l+=b[n++]<<g,g+=8,l+=b[n++]<<g,g+=8),m=I[l&p];;){if(l>>>=w=m>>>24,g-=w,16&(w=m>>>16&255)){if(y=65535&m,g<(w&=15)&&(l+=b[n++]<<g,(g+=8)<w&&(l+=b[n++]<<g,g+=8)),(y+=l&(1<<w)-1)>A){e.msg="invalid distance too far back",r.mode=30;break e}if(l>>>=w,g-=w,y>(w=o-s)){if((w=y-w)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(_=0,E=c,0===u){if(_+=h-w,w<B){B-=w;do{Q[o++]=c[_++]}while(--w);_=o-y,E=Q}}else if(u<w){if(_+=h+u-w,(w-=u)<B){B-=w;do{Q[o++]=c[_++]}while(--w);if(_=0,u<B){B-=w=u;do{Q[o++]=c[_++]}while(--w);_=o-y,E=Q}}}else if(_+=u-w,w<B){B-=w;do{Q[o++]=c[_++]}while(--w);_=o-y,E=Q}for(;B>2;)Q[o++]=E[_++],Q[o++]=E[_++],Q[o++]=E[_++],B-=3;B&&(Q[o++]=E[_++],B>1&&(Q[o++]=E[_++]))}else{_=o-y;do{Q[o++]=Q[_++],Q[o++]=Q[_++],Q[o++]=Q[_++],B-=3}while(B>2);B&&(Q[o++]=Q[_++],B>1&&(Q[o++]=Q[_++]))}break}if(64&w){e.msg="invalid distance code",r.mode=30;break e}m=I[(65535&m)+(l&(1<<w)-1)]}}break}}while(n<i&&o<a);n-=B=g>>3,l&=(1<<(g-=B<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<a?a-o+257:257-(o-a),r.hold=l,r.bits=g}},1447:(e,t,r)=>{"use strict";var n=r(9805),i=r(3269),o=r(4823),s=r(7293),a=r(1998),A=-2,h=12,f=30;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function l(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):A}function g(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,l(e)):A}function d(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?A:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,g(e))):A}function I(e,t){var r,n;return e?(n=new c,e.state=n,n.window=null,0!==(r=d(e,t))&&(e.state=null),r):A}var C,p,m=!0;function w(e){if(m){var t;for(C=new n.Buf32(512),p=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,C,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,p,0,e.work,{bits:5}),m=!1}e.lencode=C,e.lenbits=9,e.distcode=p,e.distbits=5}function B(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}t.inflateReset=g,t.inflateReset2=d,t.inflateResetKeep=l,t.inflateInit=function(e){return I(e,15)},t.inflateInit2=I,t.inflate=function(e,t){var r,c,l,g,d,I,C,p,m,y,_,E,b,Q,v,S,k,D,R,F,N,M,x,L,U=0,q=new n.Buf8(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return A;(r=e.state).mode===h&&(r.mode=13),d=e.next_out,l=e.output,C=e.avail_out,g=e.next_in,c=e.input,I=e.avail_in,p=r.hold,m=r.bits,y=I,_=C,M=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(2&r.wrap&&35615===p){r.check=0,q[0]=255&p,q[1]=p>>>8&255,r.check=o(r.check,q,2,0),p=0,m=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&p)<<8)+(p>>8))%31){e.msg="incorrect header check",r.mode=f;break}if(8!=(15&p)){e.msg="unknown compression method",r.mode=f;break}if(m-=4,N=8+(15&(p>>>=4)),0===r.wbits)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=f;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=512&p?10:h,p=0,m=0;break;case 2:for(;m<16;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(r.flags=p,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=f;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=f;break}r.head&&(r.head.text=p>>8&1),512&r.flags&&(q[0]=255&p,q[1]=p>>>8&255,r.check=o(r.check,q,2,0)),p=0,m=0,r.mode=3;case 3:for(;m<32;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}r.head&&(r.head.time=p),512&r.flags&&(q[0]=255&p,q[1]=p>>>8&255,q[2]=p>>>16&255,q[3]=p>>>24&255,r.check=o(r.check,q,4,0)),p=0,m=0,r.mode=4;case 4:for(;m<16;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}r.head&&(r.head.xflags=255&p,r.head.os=p>>8),512&r.flags&&(q[0]=255&p,q[1]=p>>>8&255,r.check=o(r.check,q,2,0)),p=0,m=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}r.length=p,r.head&&(r.head.extra_len=p),512&r.flags&&(q[0]=255&p,q[1]=p>>>8&255,r.check=o(r.check,q,2,0)),p=0,m=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((E=r.length)>I&&(E=I),E&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,g,E,N)),512&r.flags&&(r.check=o(r.check,c,E,g)),I-=E,g+=E,r.length-=E),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===I)break e;E=0;do{N=c[g+E++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N))}while(N&&E<I);if(512&r.flags&&(r.check=o(r.check,c,E,g)),I-=E,g+=E,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===I)break e;E=0;do{N=c[g+E++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N))}while(N&&E<I);if(512&r.flags&&(r.check=o(r.check,c,E,g)),I-=E,g+=E,N)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(p!==(65535&r.check)){e.msg="header crc mismatch",r.mode=f;break}p=0,m=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=h;break;case 10:for(;m<32;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}e.adler=r.check=u(p),p=0,m=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=d,e.avail_out=C,e.next_in=g,e.avail_in=I,r.hold=p,r.bits=m,2;e.adler=r.check=1,r.mode=h;case h:if(5===t||6===t)break e;case 13:if(r.last){p>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}switch(r.last=1&p,m-=1,3&(p>>>=1)){case 0:r.mode=14;break;case 1:if(w(r),r.mode=20,6===t){p>>>=2,m-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=f}p>>>=2,m-=2;break;case 14:for(p>>>=7&m,m-=7&m;m<32;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if((65535&p)!=(p>>>16^65535)){e.msg="invalid stored block lengths",r.mode=f;break}if(r.length=65535&p,p=0,m=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(E=r.length){if(E>I&&(E=I),E>C&&(E=C),0===E)break e;n.arraySet(l,c,g,E,d),I-=E,g+=E,C-=E,d+=E,r.length-=E;break}r.mode=h;break;case 17:for(;m<14;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(r.nlen=257+(31&p),p>>>=5,m-=5,r.ndist=1+(31&p),p>>>=5,m-=5,r.ncode=4+(15&p),p>>>=4,m-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=f;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}r.lens[T[r.have++]]=7&p,p>>>=3,m-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,x={bits:r.lenbits},M=a(0,r.lens,0,19,r.lencode,0,r.work,x),r.lenbits=x.bits,M){e.msg="invalid code lengths set",r.mode=f;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;S=(U=r.lencode[p&(1<<r.lenbits)-1])>>>16&255,k=65535&U,!((v=U>>>24)<=m);){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(k<16)p>>>=v,m-=v,r.lens[r.have++]=k;else{if(16===k){for(L=v+2;m<L;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(p>>>=v,m-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=f;break}N=r.lens[r.have-1],E=3+(3&p),p>>>=2,m-=2}else if(17===k){for(L=v+3;m<L;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}m-=v,N=0,E=3+(7&(p>>>=v)),p>>>=3,m-=3}else{for(L=v+7;m<L;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}m-=v,N=0,E=11+(127&(p>>>=v)),p>>>=7,m-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=f;break}for(;E--;)r.lens[r.have++]=N}}if(r.mode===f)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=f;break}if(r.lenbits=9,x={bits:r.lenbits},M=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,x),r.lenbits=x.bits,M){e.msg="invalid literal/lengths set",r.mode=f;break}if(r.distbits=6,r.distcode=r.distdyn,x={bits:r.distbits},M=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,x),r.distbits=x.bits,M){e.msg="invalid distances set",r.mode=f;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(I>=6&&C>=258){e.next_out=d,e.avail_out=C,e.next_in=g,e.avail_in=I,r.hold=p,r.bits=m,s(e,_),d=e.next_out,l=e.output,C=e.avail_out,g=e.next_in,c=e.input,I=e.avail_in,p=r.hold,m=r.bits,r.mode===h&&(r.back=-1);break}for(r.back=0;S=(U=r.lencode[p&(1<<r.lenbits)-1])>>>16&255,k=65535&U,!((v=U>>>24)<=m);){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(S&&!(240&S)){for(D=v,R=S,F=k;S=(U=r.lencode[F+((p&(1<<D+R)-1)>>D)])>>>16&255,k=65535&U,!(D+(v=U>>>24)<=m);){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}p>>>=D,m-=D,r.back+=D}if(p>>>=v,m-=v,r.back+=v,r.length=k,0===S){r.mode=26;break}if(32&S){r.back=-1,r.mode=h;break}if(64&S){e.msg="invalid literal/length code",r.mode=f;break}r.extra=15&S,r.mode=22;case 22:if(r.extra){for(L=r.extra;m<L;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}r.length+=p&(1<<r.extra)-1,p>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;S=(U=r.distcode[p&(1<<r.distbits)-1])>>>16&255,k=65535&U,!((v=U>>>24)<=m);){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(!(240&S)){for(D=v,R=S,F=k;S=(U=r.distcode[F+((p&(1<<D+R)-1)>>D)])>>>16&255,k=65535&U,!(D+(v=U>>>24)<=m);){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}p>>>=D,m-=D,r.back+=D}if(p>>>=v,m-=v,r.back+=v,64&S){e.msg="invalid distance code",r.mode=f;break}r.offset=k,r.extra=15&S,r.mode=24;case 24:if(r.extra){for(L=r.extra;m<L;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}r.offset+=p&(1<<r.extra)-1,p>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=f;break}r.mode=25;case 25:if(0===C)break e;if(E=_-C,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=f;break}E>r.wnext?(E-=r.wnext,b=r.wsize-E):b=r.wnext-E,E>r.length&&(E=r.length),Q=r.window}else Q=l,b=d-r.offset,E=r.length;E>C&&(E=C),C-=E,r.length-=E;do{l[d++]=Q[b++]}while(--E);0===r.length&&(r.mode=21);break;case 26:if(0===C)break e;l[d++]=r.length,C--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===I)break e;I--,p|=c[g++]<<m,m+=8}if(_-=C,e.total_out+=_,r.total+=_,_&&(e.adler=r.check=r.flags?o(r.check,l,_,d-_):i(r.check,l,_,d-_)),_=C,(r.flags?p:u(p))!==r.check){e.msg="incorrect data check",r.mode=f;break}p=0,m=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===I)break e;I--,p+=c[g++]<<m,m+=8}if(p!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=f;break}p=0,m=0}r.mode=29;case 29:M=1;break e;case f:M=-3;break e;case 31:return-4;default:return A}return e.next_out=d,e.avail_out=C,e.next_in=g,e.avail_in=I,r.hold=p,r.bits=m,(r.wsize||_!==e.avail_out&&r.mode<f&&(r.mode<27||4!==t))&&B(e,e.output,e.next_out,_-e.avail_out)?(r.mode=31,-4):(y-=e.avail_in,_-=e.avail_out,e.total_in+=y,e.total_out+=_,r.total+=_,r.wrap&&_&&(e.adler=r.check=r.flags?o(r.check,l,_,e.next_out-_):i(r.check,l,_,e.next_out-_)),e.data_type=r.bits+(r.last?64:0)+(r.mode===h?128:0)+(20===r.mode||15===r.mode?256:0),(0===y&&0===_||4===t)&&0===M&&(M=-5),M)},t.inflateEnd=function(e){if(!e||!e.state)return A;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?(r.head=t,t.done=!1,0):A},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?A:11===r.mode&&i(1,t,n,0)!==r.check?-3:B(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):A},t.inflateInfo="pako inflate (from Nodeca project)"},1998:(e,t,r)=>{"use strict";var n=r(9805),i=[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],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[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,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,A,h,f,u,c){var l,g,d,I,C,p,m,w,B,y=c.bits,_=0,E=0,b=0,Q=0,v=0,S=0,k=0,D=0,R=0,F=0,N=null,M=0,x=new n.Buf16(16),L=new n.Buf16(16),U=null,q=0;for(_=0;_<=15;_++)x[_]=0;for(E=0;E<A;E++)x[t[r+E]]++;for(v=y,Q=15;Q>=1&&0===x[Q];Q--);if(v>Q&&(v=Q),0===Q)return h[f++]=20971520,h[f++]=20971520,c.bits=1,0;for(b=1;b<Q&&0===x[b];b++);for(v<b&&(v=b),D=1,_=1;_<=15;_++)if(D<<=1,(D-=x[_])<0)return-1;if(D>0&&(0===e||1!==Q))return-1;for(L[1]=0,_=1;_<15;_++)L[_+1]=L[_]+x[_];for(E=0;E<A;E++)0!==t[r+E]&&(u[L[t[r+E]]++]=E);if(0===e?(N=U=u,p=19):1===e?(N=i,M-=257,U=o,q-=257,p=256):(N=s,U=a,p=-1),F=0,E=0,_=b,C=f,S=v,k=0,d=-1,I=(R=1<<v)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){m=_-k,u[E]<p?(w=0,B=u[E]):u[E]>p?(w=U[q+u[E]],B=N[M+u[E]]):(w=96,B=0),l=1<<_-k,b=g=1<<S;do{h[C+(F>>k)+(g-=l)]=m<<24|w<<16|B}while(0!==g);for(l=1<<_-1;F&l;)l>>=1;if(0!==l?(F&=l-1,F+=l):F=0,E++,0==--x[_]){if(_===Q)break;_=t[r+u[E]]}if(_>v&&(F&I)!==d){for(0===k&&(k=v),C+=b,D=1<<(S=_-k);S+k<Q&&!((D-=x[S+k])<=0);)S++,D<<=1;if(R+=1<<S,1===e&&R>852||2===e&&R>592)return 1;h[d=F&I]=v<<24|S<<16|C-f}}return 0!==F&&(h[C+F]=_-k<<24|64<<16),c.bits=v,0}},4674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:(e,t,r)=>{"use strict";var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=[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],s=[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],a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);i(h);var f=new Array(60);i(f);var u=new Array(512);i(u);var c=new Array(256);i(c);var l=new Array(29);i(l);var g,d,I,C=new Array(30);function p(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function m(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function w(e){return e<256?u[e]:u[256+(e>>>7)]}function B(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function y(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,B(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function _(e,t,r){y(e,r[2*t],r[2*t+1])}function E(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function b(e,t,r){var n,i,o=new Array(16),s=0;for(n=1;n<=15;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=E(o[a]++,a))}}function Q(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function v(e){e.bi_valid>8?B(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function S(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function k(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&S(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!S(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function D(e,t,r){var n,i,a,A,h=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*h]<<8|e.pending_buf[e.d_buf+2*h+1],i=e.pending_buf[e.l_buf+h],h++,0===n?_(e,i,t):(_(e,(a=c[i])+256+1,t),0!==(A=o[a])&&y(e,i-=l[a],A),_(e,a=w(--n),r),0!==(A=s[a])&&y(e,n-=C[a],A))}while(h<e.last_lit);_(e,256,t)}function R(e,t){var r,n,i,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,A=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<A;r++)0!==o[2*r]?(e.heap[++e.heap_len]=h=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=s[2*i+1]);for(t.max_code=h,r=e.heap_len>>1;r>=1;r--)k(e,o,r);i=A;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],k(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,k(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,A=t.dyn_tree,h=t.max_code,f=t.stat_desc.static_tree,u=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,g=t.stat_desc.max_length,d=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(A[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=A[2*A[2*(n=e.heap[r])+1]+1]+1)>g&&(o=g,d++),A[2*n+1]=o,n>h||(e.bl_count[o]++,s=0,n>=l&&(s=c[n-l]),a=A[2*n],e.opt_len+=a*(o+s),u&&(e.static_len+=a*(f[2*n+1]+s)));if(0!==d){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,d-=2}while(d>0);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>h||(A[2*i+1]!==o&&(e.opt_len+=(o-A[2*i+1])*A[2*i],A[2*i+1]=o),n--)}}(e,t),b(o,h,e.bl_count)}function F(e,t,r){var n,i,o=-1,s=t[1],a=0,A=7,h=4;for(0===s&&(A=138,h=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a<A&&i===s||(a<h?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,o=i,0===s?(A=138,h=3):i===s?(A=6,h=3):(A=7,h=4))}function N(e,t,r){var n,i,o=-1,s=t[1],a=0,A=7,h=4;for(0===s&&(A=138,h=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++a<A&&i===s)){if(a<h)do{_(e,i,e.bl_tree)}while(0!=--a);else 0!==i?(i!==o&&(_(e,i,e.bl_tree),a--),_(e,16,e.bl_tree),y(e,a-3,2)):a<=10?(_(e,17,e.bl_tree),y(e,a-3,3)):(_(e,18,e.bl_tree),y(e,a-11,7));a=0,o=i,0===s?(A=138,h=3):i===s?(A=6,h=3):(A=7,h=4)}}i(C);var M=!1;function x(e,t,r,i){y(e,0+(i?1:0),3),function(e,t,r){v(e),B(e,r),B(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}t._tr_init=function(e){M||(function(){var e,t,r,n,i,A=new Array(16);for(r=0,n=0;n<28;n++)for(l[n]=r,e=0;e<1<<o[n];e++)c[r++]=n;for(c[r-1]=n,i=0,n=0;n<16;n++)for(C[n]=i,e=0;e<1<<s[n];e++)u[i++]=n;for(i>>=7;n<30;n++)for(C[n]=i<<7,e=0;e<1<<s[n]-7;e++)u[256+i++]=n;for(t=0;t<=15;t++)A[t]=0;for(e=0;e<=143;)h[2*e+1]=8,e++,A[8]++;for(;e<=255;)h[2*e+1]=9,e++,A[9]++;for(;e<=279;)h[2*e+1]=7,e++,A[7]++;for(;e<=287;)h[2*e+1]=8,e++,A[8]++;for(b(h,287,A),e=0;e<30;e++)f[2*e+1]=5,f[2*e]=E(e,5);g=new p(h,o,257,286,15),d=new p(f,s,0,30,15),I=new p(new Array(0),a,0,19,7)}(),M=!0),e.l_desc=new m(e.dyn_ltree,g),e.d_desc=new m(e.dyn_dtree,d),e.bl_desc=new m(e.bl_tree,I),e.bi_buf=0,e.bi_valid=0,Q(e)},t._tr_stored_block=x,t._tr_flush_block=function(e,t,r,n){var i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),R(e,e.l_desc),R(e,e.d_desc),s=function(e){var t;for(F(e,e.dyn_ltree,e.l_desc.max_code),F(e,e.dyn_dtree,e.d_desc.max_code),R(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*A[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?x(e,t,r,n):4===e.strategy||o===i?(y(e,2+(n?1:0),3),D(e,h,f)):(y(e,4+(n?1:0),3),function(e,t,r,n){var i;for(y(e,t-257,5),y(e,r-1,5),y(e,n-4,4),i=0;i<n;i++)y(e,e.bl_tree[2*A[i]+1],3);N(e,e.dyn_ltree,t-1),N(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),D(e,e.dyn_ltree,e.dyn_dtree)),Q(e),n&&v(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(c[r]+256+1)]++,e.dyn_dtree[2*w(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){y(e,2,3),_(e,256,h),function(e){16===e.bi_valid?(B(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},4442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},7392:e=>{"use strict";class t{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}e.exports=t},1307:function(e,t,r){var n;n=e=>(()=>{"use strict";var t=[,e=>{e.exports="data:application/wasm;base64,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IgENAAsLIAJCf4UL1RACDH8CfgJAAkAgACgCJEUNACAAKAIAIQIMAQtBACECIABBADoAKCAAQgA3AwAgAEIANwMYIABByABqQQBB5AAQhoCAgAAaIABBrAFqQQw2AgALIAAgASgCBCIDNgIQIABBsAFqIQQgAEHgAGohBSAAQcgAaiEGIABBtgFqIQcgAEGoAWohCCABKAIQIQkCQAJAAkACQANAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIOCgECAAQFBgcICQoPCyABKAIAIQogACgCqAEhAiAAKAKsASELIAEoAgQhDCABKAIIIQ0MAgsgCCAAKAKoASIMakEIaiABKAIAIAEoAgQiAmogASgCCCACayICIAAoAqwBIAxrIgwgAiAMSRsiAhCHgICAABogASABKAIEIAJqNgIEQQAhDCAAQQAgACgCqAEgAmoiAiACIAAoAqwBIgtGGzYCqAEgAiALRw0RIABBATYCAAJAIARBqIiAgABBBhCEgICAAEUNAEEFIQwMEgsgB0ECQQAQjYCAgAAgACgAuAFHDRBBBiEMIActAAANESAAIAAtALcBIgI2AiAgAkEESw0RQQEgAnRBE3FFDRELIAEoAgQiDCABKAIIIg1GDQ4CQCABKAIAIgogDGotAAAiCw0AIAAgDDYCECABIAxBAWo2AgRBBiECDAwLQQAhAiAAQQA2AqgBIABBAjYCACAAIAtBAnRBBGoiCzYCrAEgACALNgJACyAIIAJqQQhqIAogDGogDSAMayIMIAsgAmsiAiAMIAJJGyICEIeAgIAAGiABIAIgASgCBGo2AgRBACEMIABBACAAKAKoASACaiICIAIgACgCrAEiC0YbNgKoASACIAtHDQ8gACACQXxqIgI2AqwBQQchDCAEIAJBABCNgICAACAAIAAoAqwBIgtqQbABaigAAEcNDyAAQQI2AqgBIAAtALEBIgJBP3ENDAJAAkAgAkHAAHFFDQAgACAEIAggCxCRgICAAEEBRw0RIAAgACkDCDcDMCAALQCxASECDAELIABCfzcDMAtCfyEOAkAgAkEYdEEYdUF/Sg0AIAAgBCAIIAAoAqwBEJGAgIAAQQFHDRAgACkDCCEOCyAAIA43AzggACgCrAEiDSAAKAKoASICa0ECSQ0PIAAgAkEBaiIKNgKoASAIIAJqQQhq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IgM2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQgAyEJCwJAAkAgDiALQQt2IA8vAQAiCmwiA08iEg0AIAAgAzYCACAKQYAQIAprQQV2aiEKDAELIAAgDiADayIONgIEIAAgCyADayIDNgIAIAogCkEFdmshCkEAIQ0LIA8gCjsBACANIBFzIQ0gBEEBdCASciIEQYACSQ0ACwsgACACQQFqNgIgIAAoAhggAmogBDoAAAJAIAAoAiQgACgCICICTw0AIAAgAjYCJAtBACEDAkAgACgCZCIEQQRJDQACQCAEQQlLDQAgBEF9aiEDDAELIARBemohAwsgACADNgJkDAELIAAgDiADayIONgIEIAAgBCADayIDNgIAIA0gDyAPQQV2azsBACAAIApBAXRqIg9B+ANqIQQCQAJAIANB////B00NACAJIQoMAQsgACADQQh0IgM2AgAgACAJQQFqIgo2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQLAkACQCAOIANBC3YgBC8BACINbCIJSQ0AIAAgDiAJayIONgIEIAAgAyAJayIDNgIAIAQgDSANQQV2azsBACAPQZAEaiENAkACQCADQf///wdNDQAgCiEQDAELIAAgA0EIdCIDNgIAIAAgCkEBaiIQNgIQIAAgDkEIdCAAKAIMIApqLQAAciIONgIECwJAAkAgDiADQQt2IA0vAQAiCWwiBE8NACANIAlBgBAgCWtBBXZqOwEAIAxB2ARqIQMCQCAEQf///wdLDQAgACAEQQh0IgQ2AgAgACAQQQFqNgIQIAAgDkEIdCAAKAIMIBBqLQAAciIONgIECwJAIA4gBEELdiADLwEAIg1sIglJDQAgACAOIAlrNgIEIAAgBCAJazYCACADIA0gDUEFdms7AQAMAgsgAyANQYAQIA1rQQV2ajsBACAAIAk2AgAgAEEBNgJoIABBCUELIAAoAmRBB0kbNgJkDAMLIAAgDiAEayIONgIEIA0gCSAJQQV2azsBACAPQagEaiENAkACQCADIARrIgNB////B00NACAQIQoMAQsgACADQQh0IgM2AgAgACAQQQFqIgo2AhAgACAOQQh0IAAoAgwgEGotAAByIg42AgQLAkACQCAOIANBC3YgDS8BACIEbCIJTw0AIAAgCTYCACANIARBgBAgBGtBBXZqOwEAIAAoAlghAwwBCyAAIA4gCWsiDjYCBCANIAQgBEEFdms7AQAgD0HABGohBAJAIAMgCWsiA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgCkEBajYCECAAIA5BCHQgACgCDCAKai0AAHIiDjYCBAsCQAJAIA4gA0ELdiAELwEAIg1sIglPDQAgACAJNgIAIAQgDUGAECANa0EFdmo7AQAgACgCXCEDDAELIAAgDiAJazYCBCAAIAMgCWs2AgAgACgCYCEDIAAgACgCXDYCYCAEIA0gDUEFdms7AQALIAAgACgCWDYCXAsgACAAKAJUNgJYIAAgAzYCVAsgAEEIQQsgACgCZEEHSRs2AmQgACAHIAsQn4CAgAAMAQsgBCANQYAQIA1rQQV2ajsBACAAIAk2AgAgACAAKAJcNgJgIAAgACkCVDcCWCAAQQdBCiAAKAJkQQdJGzYCZCAAIAUgCxCfgICAACAAKAJoIgNBfmpBAyADQQZJGyEKIAAoAgAhA0EBIQ4DQCAAIApBB3RqIA5BAXQiDmpB2AdqIQ0CQAJAIANBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgRBAWo2AhAgACAAKAIEQQh0IAQgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgDS8BACIJbCIPSQ0AIAAgBCAPayIENgIEIAAgAyAPayIDNgIAIA0gCSAJQQV2azsBACAOQQFyIQ4MAQsgACAPNgIAIA0gCUGAECAJa0EFdmo7AQAgDyEDCyAOQcAASQ0ACwJAIA5BQGoiCUEDSw0AIAAgCTYCVAwBCyAAIA5BAXFBAnIiDTYCVCAJQQF2IQ8CQCAJQQ1LDQAgACANIA9Bf2oiDHQiCzYCVEEBIQ0gCCALQQF0akGEC2ohEEE/IA5rIRFBACEPA0AgECARIA1qQQF0aiEOAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA4vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACAOIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDUEBdEEBciENDAELIAAgAzYCACAOIAlBgBAgCWtBBXZqOwEAIA1BAXQhDQsgDCAPQQFqIg9HDQAMAgsLIA9Be2ohDgNAAkAgA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgACgCECIJQQFqNgIQIARBCHQgCSAAKAIMai0AAHIhBAsgACADQQF2IgM2AgAgACAEIANrIgRBH3UiCSANQQF0akEBaiINNgJUIAAgCSADcSAEaiIENgIEIA5Bf2oiDg0ACyAAIA1BBHQiCzYCVEEAIQ9BASEOA0AgACAOQQF0Ig5qQbwNaiENAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA0vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACANIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDkEBciEODAELIAAgAzYCACANIAlBgBAgCWtBBXZqOwEACyAPQQFqIg9BBEcNAAsLAkAgASAGIAAoAlQQnoCAgAANAEEADwsgACgCICECCyACIAAoAihJDQALC0EBIQMCQCAAKAIAIgRB////B0sNACAAIARBCHQ2AgBBASEDIAAgACgCECIEQQFqNgIQIAAgACgCBEEIdCAEIAAoAgxqLQAAcjYCBAsgAwtwAQF/AkBBqN4BEICAgIAAIgJFDQAgAkE0aiABNgIAIAJBPGogADYCAAJAAkACQCAAQX9qDgIAAQILIAIgARCAgICAACIANgIYIAANASACEIKAgIAADAILIAJBADYCGCACQThqQQA2AgALIAIPC0EAC9IBAQJ/QQYhAgJAIAFBJ0sNACAAQTBqIAFBAXFBAnIgAUEBdkELanQiATYCAAJAAkAgAEE8aigCACIDRQ0AQQQhAiABIABBNGooAgBLDQIgAEEsaiABNgIAIANBAkcNACAAQThqIgMoAgAgAU8NACAAIAE2AjggACgCGBCCgICAACAAIAAoAjAQgICAgAAiATYCGCABDQBBAyECDAELQQAhAiAAQQA2AkAgAEHQAGpBAToAACAAQegAakEANgIAIABB5N0BaiEDCyADQQA2AgALIAILIwACQCAAQTxqKAIARQ0AIAAoAhgQgoCAgAALIAAQgoCAgAAL9QEBBH9BACEDAkAgACgCDCACTQ0AIAAoAhggAk0NACABIAEoAgAiBCAAKAIQIAAoAggiBWsiBiAEIAYgBEkbIgRrNgIAIAUgAkF/c2ohAQJAIAUgAksNACAAKAIUIAFqIQELIAAoAgAiAiABai0AACEGQQEhAyAAIAVBAWo2AgggAiAFaiAGOgAAAkAgBEF/aiICRQ0AA0AgACgCACIFQQAgAUEBaiIBIAEgACgCFEYbIgFqLQAAIQQgACAAKAIIIgZBAWo2AgggBSAGaiAEOgAAIAJBf2oiAg0ACwsgACgCDCAAKAIIIgFPDQAgACABNgIMCyADC8gEAQd/AkACQCAAKAIAIgNBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAAKAIEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgAS8BACIGbCIFTw0AIAEgBkGAECAGa0EFdmo7AQAgASACQQR0akEEaiEHQQghCEECIQkMAQsgACAEIAVrIgQ2AgQgASAGIAZBBXZrOwEAAkAgAyAFayIDQf///wdLDQAgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkAgBCADQQt2IAEvAQIiBmwiBU8NACABIAZBgBAgBmtBBXZqOwECIAEgAkEEdGpBhAJqIQdBCCEIQQohCQwBCyAAIAQgBWsiBDYCBCABIAYgBkEFdms7AQIgAUGEBGohByADIAVrIQVBgAIhCEESIQkLIABB6ABqIAk2AgBBASEBA0AgByABQQF0IgFqIQMCQAJAIAVB////B00NACAFIQIMAQsgACAFQQh0IgI2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIAJBC3YgAy8BACIGbCIFSQ0AIAAgBCAFayIENgIEIAAgAiAFayIFNgIAIAMgBiAGQQV2azsBACABQQFyIQEMAQsgACAFNgIAIAMgBkGAECAGa0EFdmo7AQALIAEgCEkNAAsgAEHoAGogASAIayAJajYCAAsLNQEAQYAICy4IAAAAEAAAABgAAAAgAAAAKAAAADAAAABAAAAAUAAAAIAAAAAAAQAA/Td6WFoA"},t=>{t.exports=e}],r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{XzReadableStream:()=>o});var e=n(1);const t=globalThis.ReadableStream||n(2).ReadableStream;class r{constructor(e){this.exports=e.exports,this.memory=this.exports.memory,this.ptr=this.exports.create_context(),this._refresh(),this.bufSize=this.mem32[0],this.inStart=this.mem32[1]-this.ptr,this.inEnd=this.inStart+this.bufSize,this.outStart=this.mem32[4]-this.ptr}supplyInput(e){this._refresh(),this.mem8.subarray(this.inStart,this.inEnd).set(e,0),this.exports.supply_input(this.ptr,e.byteLength),this._refresh()}getNextOutput(){const e=this.exports.get_next_output(this.ptr);if(this._refresh(),0!==e&&1!==e)throw new Error(`get_next_output failed with error code ${e}`);return{outChunk:this.mem8.slice(this.outStart,this.outStart+this.mem32[5]),finished:1===e}}needsMoreInput(){return this.mem32[2]===this.mem32[3]}outputBufferIsFull(){return this.mem32[5]===this.bufSize}resetOutputBuffer(){this.outPos=this.mem32[5]=0}dispose(){this.exports.destroy_context(this.ptr),this.exports=null}_refresh(){this.memory.buffer!==this.mem8?.buffer&&(this.mem8=new Uint8Array(this.memory.buffer,this.ptr),this.mem32=new Uint32Array(this.memory.buffer,this.ptr))}}class o extends t{static _moduleInstancePromise;static _moduleInstance;static async _getModuleInstance(){const t=e.replace("data:application/wasm;base64,",""),r=Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer,n=await WebAssembly.instantiate(r,{});o._moduleInstance=n.instance}constructor(e){let t,n=null;const i=e.getReader();super({async start(e){o._moduleInstance||await(o._moduleInstancePromise||(o._moduleInstancePromise=o._getModuleInstance())),t=new r(o._moduleInstance)},async pull(e){if(t.needsMoreInput()){if(null===n||0===n.byteLength){const{done:e,value:t}=await i.read();e||(n=t)}const e=Math.min(t.bufSize,n.byteLength);t.supplyInput(n.subarray(0,e)),n=n.subarray(e)}const r=t.getNextOutput();e.enqueue(r.outChunk),t.resetOutputBuffer(),r.finished&&(t.dispose(),e.close())},cancel:()=>(t.dispose(),i.cancel())})}}})(),i})(),e.exports=n(r(772))},1226:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BlobFile:()=>a,LocalFile:()=>i(),RemoteFile:()=>s,fromUrl:()=>A,open:()=>h});var n=r(2306),i=r.n(n);function o(e){return("object"==typeof e&&null!==e&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class s{constructor(e,t={}){this.baseOverrides={},this.url=e;const r=t.fetch||globalThis.fetch.bind(globalThis);t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=r}async fetch(e,t){let r;try{r=await this.fetchImplementation(e,t)}catch(n){if(!`${n}`.includes("Failed to fetch"))throw new Error(`${o(n)} fetching ${e}`,{cause:n});console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{r=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(t){throw new Error(`${o(t)} fetching ${e}`,{cause:t})}}return r}async read(e,t,r={}){const{headers:n={},signal:i,overrides:o={}}=r;e<1/0?n.range=`bytes=${t}-${t+e}`:e===1/0&&0!==t&&(n.range=`bytes=${t}-`);const s=await this.fetch(this.url,{...this.baseOverrides,...o,headers:{...n,...o.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:i});if(!s.ok)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if(200===s.status&&0===t||206===s.status){const t=await s.arrayBuffer(),r=s.headers.get("content-range"),n=/\/(\d+)$/.exec(r||"");return n?.[1]&&(this._stat={size:parseInt(n[1],10)}),new Uint8Array(t.slice(0,e))}throw 200===s.status?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${s.status} fetching ${this.url}`)}async readFile(e={}){let t,r;"string"==typeof e?(t=e,r={}):(t=e.encoding,r=e,delete r.encoding);const{headers:n={},signal:i,overrides:o={}}=r,s=await this.fetch(this.url,{headers:n,method:"GET",redirect:"follow",mode:"cors",signal:i,...this.baseOverrides,...o});if(200!==s.status)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if("utf8"===t)return s.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await s.arrayBuffer())}async stat(){if(!this._stat&&(await this.read(10,0),!this._stat))throw new Error(`unable to determine size of file at ${this.url}`);return this._stat}async close(){}}class a{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0){if(!e)return new Uint8Array(0);const r=t,n=r+e;return new Uint8Array(await this.blob.slice(r,n).arrayBuffer())}async readFile(e){const t="string"==typeof e?e:e?.encoding;if("utf8"===t)return this.blob.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await this.blob.arrayBuffer())}async stat(){return{size:this.size}}async close(){}}function A(e,t={}){return new s(e,t)}function h(e,t,r,n={}){if(void 0!==r)return r;if(void 0!==e)return A(e,n);if(void 0!==t)return new(i())(t,n);throw new Error("no url, path, or filehandle provided, cannot open")}},3617:()=>{},772:()=>{},2306:()=>{},86:(e,t,r)=>{const n=r(1308).A;e.exports=n,e.exports.default=n},1308:(e,t)=>{"use strict";let r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(r=new Int32Array(r)),t.A=(e,t)=>{let n=0===t?0:~t;for(let t=0;t<e.length;t++)n=r[255&(n^e[t])]^n>>>8;return~n}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=r(7806);window.gmodCRAM=n})();
|
|
2
|
+
(()=>{var e={4923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9747),i=r(5931),a=r(8876);function s(e,t){const[r,n,i,a,s,A]=t,o=r;e[o]||(e[o]=[]),e[o].push({start:n,span:i,containerStart:a,sliceStart:s,sliceBytes:A})}t.default=class{constructor(e){this.filehandle=(0,i.open)(e.url,e.path,e.filehandle)}async parseIndex(){const e={},t=31===(r=await this.filehandle.readFile())[0]&&139===r[1]?(0,a.unzip)(r):r;var r;const i=new DataView(t.buffer);if(t.length>4&&21578050===i.getUint32(0,!0))throw new n.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");let A=[],o="";for(const r of t)if(r>=48&&r<=57||!o&&45===r)o+=String.fromCharCode(r);else if(9===r)A.push(Number.parseInt(o,10)),o="";else if(10===r)A.push(Number.parseInt(o,10)),o="",s(e,A),A=[];else if(13!==r&&32!==r)throw new n.CramMalformedError("invalid .crai index file");return o&&A.push(Number.parseInt(o,10)),6===A.length&&s(e,A),Object.entries(e).forEach((([t,r])=>{const n=r;e[t]=n.sort(((e,t)=>e.start-t.start||e.span-t.span))})),e}getIndex(){return this.parseIndexP||(this.parseIndexP=this.parseIndex().catch((e=>{throw this.parseIndexP=void 0,e}))),this.parseIndexP}async hasDataForReferenceSequence(e){return!!(await this.getIndex())[e]}async getEntriesForRange(e,t,r){const n=(await this.getIndex())[e];if(!n)return[];const i=e=>{const n=e.start,i=e.start+e.span;return n>r?-1:i<=t?1:0},a=[];for(const e of n)0===i(e)&&a.push(e);return a}}},9508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t){this.parameters=e,this.dataType=t}}},368:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(612),s=r(9747);class A extends i.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by BETA codec`)}decode(e,t,r,n){return(0,a.getBits)(t.content,n.coreBlock,this.parameters.length)-this.parameters.offset}}t.default=A},8635:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(400);class s extends i.default{constructor(e,t,r){super(e,t),this.instantiateCodec=r}decode(e,t,r,n){const i=this._getLengthCodec().decode(e,t,r,n),a=this._getDataCodec(),s=new Uint8Array(i);for(let A=0;A<i;A+=1)s[A]=a.decode(e,t,r,n);return s}_getLengthCodec(){const e=this.parameters.lengthsEncoding;return this.instantiateCodec(e,"int")}_getDataCodec(){const e=this.parameters.valuesEncoding;return this.instantiateCodec(e,"byte")}}t.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((e=>{(0,a.tinyMemoize)(s,e)}))},4839:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(9747),s=r(612);class A extends i.default{decode(e,t,r,n){const{blockContentId:i}=this.parameters,s=r[i];if(!s)throw new a.CramMalformedError(`no block found with content ID ${i}`);const A=n.externalBlocks.getCursor(i);return this._decodeByteArray(s,A)}_decodeByteArray(e,t){const r=e.content,{stopByte:n}=this.parameters,i=t.bytePosition;let a=t.bytePosition;for(;r[a]!==n&&a<r.length;){if(a===r.length)throw new s.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");a+=1}return t.bytePosition=a+1,r.subarray(i,a)}}t.default=A},8153:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(9747),s=r(400),A=r(612);class o extends i.default{constructor(e,t){if(super(e,t),"int"===this.dataType)this._decodeData=this._decodeInt;else{if("byte"!==this.dataType)throw new a.CramUnimplementedError(`${this.dataType} decoding not yet implemented by EXTERNAL codec`);this._decodeData=this._decodeByte}}decode(e,t,r,n){const{blockContentId:i}=this.parameters,s=r[i];if(!s)throw new a.CramMalformedError(`no block found with content ID ${i}}`);const A=n.externalBlocks.getCursor(i);return this._decodeData(s,A)}_decodeInt(e,t){const[r,n]=(0,s.parseItf8)(e.content,t.bytePosition);return t.bytePosition=t.bytePosition+n,r}_decodeByte(e,t){if(t.bytePosition>=e.content.length)throw new A.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return e.content[t.bytePosition++]}}t.default=o},8185:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(612),s=r(9747);class A extends i.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by GAMMA codec`)}decode(e,t,r,n){let i=1;for(;0===(0,a.getBits)(t.content,n.coreBlock,1);)i+=1;return((0,a.getBits)(t.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset}}t.default=A},612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CramBufferOverrunError=void 0,t.getBits=function(e,t,n){let i=0;if(t.bytePosition+(7-t.bitPosition+n)/8>e.length)throw new r("read error during decoding. the file seems to be truncated.");for(let r=n;r;r--)i<<=1,i|=e[t.bytePosition]>>t.bitPosition&1,t.bitPosition-=1,t.bitPosition<0&&(t.bytePosition+=1),t.bitPosition&=7;return i};class r extends Error{}t.CramBufferOverrunError=r},4341:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(612),s=r(9747);class A extends i.default{constructor(e,t){if(super(e,t),this.codes={},this.codeBook={},this.sortedCodes=[],this.sortedValuesByBitCode=[],this.sortedBitCodes=[],this.sortedBitLengthsByBitCode=[],this.bitCodeToValue=[],!["byte","int"].includes(this.dataType))throw new TypeError(`${this.dataType} decoding not yet implemented by HUFFMAN_INT codec`);this.buildCodeBook(),this.buildCodes(),this.buildCaches(),0===this.sortedCodes[0].bitLength&&(this._decode=this._decodeZeroLengthCode)}buildCodeBook(){let e=new Array(this.parameters.numCodes);for(let t=0;t<this.parameters.numCodes;t++)e[t]={symbol:this.parameters.symbols[t],bitLength:this.parameters.bitLengths[t]};e=e.sort(((e,t)=>e.bitLength-t.bitLength||e.symbol-t.symbol)),this.codeBook={},e.forEach((e=>{this.codeBook[e.bitLength]||(this.codeBook[e.bitLength]=[]),this.codeBook[e.bitLength].push(e.symbol)}))}buildCodes(){this.codes={};let e=0,t=-1;Object.entries(this.codeBook).forEach((([r,n])=>{const i=Number.parseInt(r,10);n.forEach((r=>{const n={bitLength:i,value:r,bitCode:0};t+=1;const a=i-e;if(t<<=a,n.bitCode=t,e+=a,function(e){let t=e-(e>>1)&1431655765;return t=(858993459&t)+(t>>2&858993459),16843009*(t+(t>>4)&252645135)>>24}(t)>i)throw new s.CramMalformedError("Symbol out of range");this.codes[r]=n}))}))}buildCaches(){this.sortedCodes=Object.values(this.codes).sort(((e,t)=>e.bitLength-t.bitLength||e.bitCode-t.bitCode)),this.sortedValuesByBitCode=this.sortedCodes.map((e=>e.value)),this.sortedBitCodes=this.sortedCodes.map((e=>e.bitCode)),this.sortedBitLengthsByBitCode=this.sortedCodes.map((e=>e.bitLength));const e=Math.max(...this.sortedBitCodes);this.bitCodeToValue=new Array(e+1).fill(-1);for(let e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e}decode(e,t,r,n){return this._decode(e,t,n.coreBlock)}_decodeZeroLengthCode(){return this.sortedCodes[0].value}_decode(e,t,r){const n=t.content;let i=0,A=0;for(let e=0;e<this.sortedCodes.length;e+=1){const t=this.sortedCodes[e].bitLength;A<<=t-i,A|=(0,a.getBits)(n,r,t-i),i=t;{const r=this.bitCodeToValue[A];if(r>-1&&this.sortedBitLengthsByBitCode[r]===t)return this.sortedValuesByBitCode[r];for(let r=e;this.sortedCodes[r+1].bitLength===t&&r<this.sortedCodes.length;r+=1)e+=1}}throw new s.CramMalformedError("Huffman symbol not found.")}}t.default=A},6524:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.instantiateCodec=function e(t,r){const n=(i="ignore"===r?0:t.codecId,f[i]);var i;if(!n)throw new g.CramUnimplementedError(`no codec implemented for codec ID ${t.codecId}`);return new n(t.parameters,r,e)};const i=n(r(368)),a=n(r(8635)),s=n(r(4839)),A=n(r(8153)),o=n(r(8185)),h=n(r(4341)),d=n(r(99)),g=r(9747),f={1:A.default,3:h.default,4:a.default,5:s.default,6:i.default,7:d.default,9:o.default}},99:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(9508)),a=r(612),s=r(9747);class A extends i.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by SUBEXP codec`)}decode(e,t,r,n){let i,s,A=0;for(;(0,a.getBits)(t.content,n.coreBlock,1);)A+=1;return 0===A?(i=this.parameters.K,s=(0,a.getBits)(t.content,n.coreBlock,i)):(i=A+this.parameters.K-1,s=1<<i|(0,a.getBits)(t.content,n.coreBlock,i)),s-this.parameters.offset}}t.default=A},7295:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},7219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9747),i=r(6524),a={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int"};t.default=class{constructor(e){this.dataSeriesCodecCache={},this.tagCodecCache={},this.tagEncoding={},this.readNamesIncluded=e.preservation.RN,this.APdelta=e.preservation.AP,this.referenceRequired=!!e.preservation.RR,this.tagIdsDictionary=e.preservation.TD,this.substitutionMatrix=function(e){const t=new Array(5);for(let e=0;e<5;e+=1)t[e]=new Array(4);return t[0][e[0]>>6&3]="C",t[0][e[0]>>4&3]="G",t[0][e[0]>>2&3]="T",t[0][3&e[0]]="N",t[1][e[1]>>6&3]="A",t[1][e[1]>>4&3]="G",t[1][e[1]>>2&3]="T",t[1][3&e[1]]="N",t[2][e[2]>>6&3]="A",t[2][e[2]>>4&3]="C",t[2][e[2]>>2&3]="T",t[2][3&e[2]]="N",t[3][e[3]>>6&3]="A",t[3][e[3]>>4&3]="C",t[3][e[3]>>2&3]="G",t[3][3&e[3]]="N",t[4][e[4]>>6&3]="A",t[4][e[4]>>4&3]="C",t[4][e[4]>>2&3]="G",t[4][3&e[4]]="T",t}(e.preservation.SM),this.dataSeriesEncoding=e.dataSeriesEncoding,this.tagEncoding=e.tagEncoding}getCodecForTag(e){const t=this.tagCodecCache[e];if(t)return t;{const t=this.tagEncoding[e];if(!t)throw new Error("Error, no tag encoding");const r=(0,i.instantiateCodec)(t,"byteArray");return this.tagCodecCache[e]=r,r}}getTagNames(e){return this.tagIdsDictionary[e]}getCodecForDataSeries(e){let t=this.dataSeriesCodecCache[e];if(void 0===t){const r=this.dataSeriesEncoding[e];if(r){const s=a[e];if(!s)throw new n.CramMalformedError(`data series name ${e} not defined in file compression header`);t=(0,i.instantiateCodec)(r,s),this.dataSeriesCodecCache[e]=t}}return t}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.endsWith("Cache")||(e[t]=this[t])})),e}}},78:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9747),a=n(r(6771)),s=r(400),A=n(r(7219)),o=r(3165);class h{constructor(e,t){this.file=e,this.filePosition=t}getHeader(){return this._readContainerHeader(this.filePosition)}async getCompressionHeaderBlock(){const e=await this.getHeader();if(!e?.numRecords)return null;const{majorVersion:t}=await this.file.getDefinition(),r=(0,o.getSectionParsers)(t),n=await this.getFirstBlock();if(void 0===n)return;if("COMPRESSION_HEADER"!==n.contentType)throw new i.CramMalformedError(`invalid content type ${n.contentType} in compression header block`);const a=(0,s.parseItem)(n.content,r.cramCompressionHeader.parser,0,n.contentPosition);return{...n,parsedContent:a}}async getFirstBlock(){const e=await this.getHeader();if(e)return this.file.readBlock(e._endPosition)}async getCompressionScheme(){const e=await this.getCompressionHeaderBlock();if(e)return new A.default(e.parsedContent)}getSlice(e,t){return new a.default(this,e,t)}async _readContainerHeader(e){const{majorVersion:t}=await this.file.getDefinition(),r=(0,o.getSectionParsers)(t),{cramContainerHeader1:n,cramContainerHeader2:i}=r,{size:a}=await this.file.stat();if(e>=a)return void console.warn(`pos:${e}>=fileSize:${a} in cram container`);const A=await this.file.read(n.maxLength,e),h=(0,s.parseItem)(A,n.parser),d=(0,s.itf8Size)(h.numLandmarks);if(e+h.length>=a)return void console.warn(`container at ${e} is beyond fileSize:${a}, skipping`);const g=await this.file.read(i.maxLength(h.numLandmarks),e+h._size-d),f=(0,s.parseItem)(g,i.parser);return this.file.validateChecksums&&void 0!==f.crc32&&await this.file.checkCrc32(e,h._size+f._size-d-4,f.crc32,`container header beginning at position ${e}`),Object.assign(h,f,{_size:h._size+f._size-d,_endPosition:h._size+f._size-d+e})}}t.default=h,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((e=>{(0,s.tinyMemoize)(h,e)}))},6794:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(235)),a=n(r(86)),s=n(r(7392)),A=r(1307),o=r(9747),h=n(r(9151)),d=r(5931),g=n(r(9989)),f=r(5417),c=r(8876),l=n(r(78)),u=r(3165),I=r(400);class C{constructor(e){if(this.file=(0,d.open)(e.url,e.path,e.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=e.seqFetch,this.options={checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize??2e4},this.featureCache=new s.default({maxSize:this.options.cacheSize}),function(){const e=new Uint32Array([287454020]),t=new Uint8Array(e.buffer);return 68===t[0]?0:17===t[0]?1:2}()>0)throw new Error("Detected big-endian machine, may be unable to run")}stat(){return this.file.stat()}read(e,t){return this.file.read(e,t)}async getDefinition(){const{maxLength:e,parser:t}=(0,u.cramFileDefinition)(),r=t(await this.file.read(e,0)).value;if(2!==r.majorVersion&&3!==r.majorVersion)throw new o.CramUnimplementedError(`CRAM version ${r.majorVersion} not supported`);return r}async getSamHeader(){const e=await this.getContainerById(0);if(!e)throw new o.CramMalformedError("file contains no containers");const t=await e.getFirstBlock();if(void 0===t)return(0,f.parseHeaderText)("");{const e=t.content,r=new DataView(e.buffer).getInt32(0,!0),n=4,i=new TextDecoder("utf8").decode(e.subarray(n,n+r));return this.header=i,(0,f.parseHeaderText)(i)}}async getHeaderText(){return await this.getSamHeader(),this.header}async getContainerById(e){const{majorVersion:t}=await this.getDefinition(),r=(0,u.getSectionParsers)(t);let n=r.cramFileDefinition.maxLength;const{size:i}=await this.file.stat(),{cramContainerHeader1:a}=r;let s;for(let t=0;t<=e;t++){if(n+a.maxLength+8>=i)return;s=this.getContainerAtPosition(n);const r=await s.getHeader();if(!r)throw new o.CramMalformedError(`container ${e} not found in file`);if(0===t){n=r._endPosition;for(let e=0;e<r.numBlocks;e++){const e=await this.readBlock(n);if(void 0===e)return;n=e._endPosition}}else n+=r._size+r.length}return s}async checkCrc32(e,t,r,n){const i=await this.file.read(t,e),s=(0,a.default)(i)>>>0;if(s!==r)throw new o.CramMalformedError(`crc mismatch in ${n}: recorded CRC32 = ${r}, but calculated CRC32 = ${s}`)}async containerCount(){const{majorVersion:e}=await this.getDefinition(),t=(0,u.getSectionParsers)(e),{size:r}=await this.file.stat(),{cramContainerHeader1:n}=t;let i=0,a=t.cramFileDefinition.maxLength;for(;a+n.maxLength+8<r;){const e=await this.getContainerAtPosition(a).getHeader();if(!e)break;if(0===i){a=e._endPosition;for(let t=0;t<e.numBlocks;t++){const e=await this.readBlock(a);if(void 0===e)return;a=e._endPosition}}else a+=e._size+e.length;i+=1}return i}getContainerAtPosition(e){return new l.default(this,e)}async readBlockHeader(e){const{majorVersion:t}=await this.getDefinition(),r=(0,u.getSectionParsers)(t),{cramBlockHeader:n}=r,{size:i}=await this.file.stat();if(e+n.maxLength>=i)return;const a=await this.file.read(n.maxLength,e);return(0,I.parseItem)(a,n.parser,0,e)}async _parseSection(e,t,r=e.maxLength,n){let i;if(n)i=n;else{const{size:e}=await this.file.stat();if(t+r>=e)return;i=await this.file.read(r,t)}const a=(0,I.parseItem)(i,e.parser,0,t);if(a._size!==r)throw new o.CramMalformedError(`section read error: requested size ${r} does not equal parsed size ${a._size}`);return a}async _uncompress(e,t,r){if("gzip"===e)return(0,c.unzip)(t);if("bzip2"===e){const e=i.default.array(t);let r,n=i.default.header(e);const a=[];do{r=i.default.decompress(e,n),-1!==r&&(a.push(r),n-=r.length)}while(-1!==r);return(0,I.concatUint8Array)(a)}if("lzma"===e){const e=new Response(new A.XzReadableStream((n=t,new ReadableStream({start(e){e.enqueue(n),e.close()}}))));return new Uint8Array(await e.arrayBuffer())}if("rans"===e){const e=new Uint8Array(r);return(0,g.default)(t,e),e}if("rans4x16"===e)return h.default.r4x16_uncompress(t);if("arith"===e)return h.default.arith_uncompress(t);if("fqzcomp"===e)return h.default.fqzcomp_uncompress(t);if("tok3"===e)return h.default.tok3_uncompress(t);throw new o.CramUnimplementedError(`${e} decompression not yet implemented`);var n}async readBlock(e){const{majorVersion:t}=await this.getDefinition(),r=(0,u.getSectionParsers)(t),n=await this.readBlockHeader(e);if(void 0===n)return;const i=n._endPosition,a=await this.file.read(n.compressedSize,i),s="raw"!==n.compressionMethod?await this._uncompress(n.compressionMethod,a,n.uncompressedSize):a,A={...n,_endPosition:i,contentPosition:i,content:s};if(t>=3){const t=await this._parseSection(r.cramBlockCrc32,i+n.compressedSize);if(void 0===t)return;A.crc32=t.crc32,this.validateChecksums&&await this.checkCrc32(e,n._size+n.compressedSize,t.crc32,"block data"),A._endPosition=t._endPosition,A._size=A.compressedSize+r.cramBlockCrc32.maxLength}else A._endPosition=i+A.compressedSize,A._size=A.compressedSize;return A}}t.default=C,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((e=>{(0,I.tinyMemoize)(C,e)}))},7390:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CramRecord=void 0;var i=r(8401);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return n(i).default}});var a=r(6794);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(a).default}})},8401:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MateFlagsDecoder=t.CramFlagsDecoder=t.BamFlagsDecoder=t.MateFlags=t.CramFlags=t.BamFlags=void 0;const i=n(r(7295)),a={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};function s(e){const t={};for(const[r,n]of e)t[`is${n}`]=e=>!!(e&r),t[`set${n}`]=e=>e|r;return t}t.BamFlags=[[1,"Paired"],[2,"ProperlyPaired"],[4,"SegmentUnmapped"],[8,"MateUnmapped"],[16,"ReverseComplemented"],[32,"MateReverseComplemented"],[64,"Read1"],[128,"Read2"],[256,"Secondary"],[512,"FailedQc"],[1024,"Duplicate"],[2048,"Supplementary"]],t.CramFlags=[[1,"PreservingQualityScores"],[2,"Detached"],[4,"WithMateDownstream"],[8,"DecodeSequenceAsStar"]],t.MateFlags=[[1,"OnNegativeStrand"],[2,"Unmapped"]],t.BamFlagsDecoder=s(t.BamFlags),t.CramFlagsDecoder=s(t.CramFlags),t.MateFlagsDecoder=s(t.MateFlags),t.default=class{constructor({flags:e,cramFlags:t,readLength:r,mappingQuality:n,lengthOnRef:i,qualityScores:a,mateRecordNumber:s,readBases:A,readFeatures:o,mateToUse:h,readGroupId:d,readName:g,sequenceId:f,uniqueId:c,templateSize:l,alignmentStart:u,tags:I}){this.flags=e,this.cramFlags=t,this.readLength=r,this.mappingQuality=n,this.lengthOnRef=i,this.qualityScores=a,A&&(this.readBases=A),this.readGroupId=d,this.readName=g,this.sequenceId=f,this.uniqueId=c,this.templateSize=l,this.alignmentStart=u,this.tags=I,o&&(this.readFeatures=o),h&&(this.mate={flags:h.mateFlags,readName:h.mateReadName,sequenceId:h.mateSequenceId,alignmentStart:h.mateAlignmentStart}),s&&(this.mateRecordNumber=s)}isPaired(){return!!(this.flags&i.default.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&i.default.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&i.default.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&i.default.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&i.default.BAM_FMREVERSE)}isRead1(){return!!(this.flags&i.default.BAM_FREAD1)}isRead2(){return!!(this.flags&i.default.BAM_FREAD2)}isSecondary(){return!!(this.flags&i.default.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&i.default.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&i.default.BAM_FDUP)}isSupplementary(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)}isDetached(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)}hasMateDownStream(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)}isPreservingQualityScores(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)}isUnknownBases(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)}getReadBases(){if(!this.readBases&&this._refRegion){const e=function(e,t){if(!e.lengthOnRef&&!e.readLength)return null;if(e.isUnknownBases())return null;const r=e.alignmentStart-t.start;if(!e.readFeatures)return t.seq.slice(r,r+(e.lengthOnRef||0)).toUpperCase();let n="",i=r,a=0;for(;n.length<e.readLength;)if(a<e.readFeatures.length){const r=e.readFeatures[a];if("Q"===r.code||"q"===r.code)a+=1;else if(r.pos===n.length+1)if(a+=1,"b"===r.code){const e=r.data;n+=e,i+=e.length}else"B"===r.code?(n+=r.data[0],i+=1):"X"===r.code?(n+=r.sub,i+=1):"I"===r.code?n+=r.data:"D"===r.code?i+=r.data:"i"===r.code?n+=r.data:"N"===r.code?i+=r.data:"S"===r.code?n+=r.data:"P"===r.code||r.code;else if(a<e.readFeatures.length){const e=t.seq.slice(i,i+r.pos-n.length-1);n+=e,i+=e.length}}else{const r=t.seq.slice(i,i+e.readLength-n.length);n+=r,i+=r.length}return n.toUpperCase()}(this,this._refRegion);e&&(this.readBases=e)}return this.readBases}getPairOrientation(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){const e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F";let r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");const i=[];let a=this.templateLength||this.templateSize;if(void 0===a)throw new Error("One of templateSize and templateLength must be set");return this.alignmentStart>this.mate.alignmentStart&&a>0&&(a=-a),a>0?(i[0]=e,i[1]=r,i[2]=t,i[3]=n):(i[2]=e,i[3]=r,i[0]=t,i[1]=n),i.join("")}return null}addReferenceSequence(e,t){this.readFeatures&&this.readFeatures.forEach((r=>{"X"===r.code&&function(e,t,r,n){const i=n.refPos-t.start,s=t.seq.charAt(i);s&&(n.ref=s);let A=a[s];void 0===A&&(A=4);const o=r.substitutionMatrix[A][n.data];o&&(n.sub=o)}(0,e,t,r)})),!this.readBases&&e.start<=this.alignmentStart&&e.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=e)}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.startsWith("_")||(e[t]=this[t])})),e.readBases=this.getReadBases(),e}}},3165:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cramFileDefinition=i,t.cramBlockHeader=a,t.cramBlockCrc32=s,t.cramTagDictionary=o,t.cramPreservationMap=h,t.isMappedSliceHeader=function(e){return"number"==typeof e.refSeqId},t.getSectionParsers=function(e){return{cramFileDefinition:i(),cramBlockHeader:a(),cramBlockCrc32:s(),cramDataSeriesEncodingMap:l(),cramTagEncodingMap:u(),cramCompressionHeader:{parser:(e,t)=>{const{value:r,offset:n}=h().parser(e,t);t=n;const{value:i,offset:a}=l().parser(e,t);t=a;const{value:s,offset:A}=u().parser(e,t);return t=A,{value:{dataSeriesEncoding:d(i),preservation:d(r),tagEncoding:d(s)},offset:t}}},cramEncoding:{parser:(e,t)=>c(e,t)},cramUnmappedSliceHeader:g(e),cramMappedSliceHeader:f(e),cramContainerHeader1:I(e),cramContainerHeader2:C(e)}};const n=r(400);function i(){return{parser:(e,t=0)=>{const r=new DataView(e.buffer,e.byteOffset,e.length),n=new TextDecoder("utf8");let i=0;const a=n.decode(e.subarray(i,i+4));i+=4;const s=r.getUint8(i);i+=1;const A=r.getUint8(i);i+=1;const o=n.decode(e.subarray(i,i+20)).replaceAll("\0","");return i+=20,{value:{magic:a,majorVersion:s,minorVersion:A,fileId:o},offset:i}},maxLength:26}}function a(){return{parser:(e,t=0)=>{const r=e,i=new DataView(r.buffer,r.byteOffset,r.length);let a=0;const s=i.getUint8(a),A=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][s];if(!A)throw new Error(`compression method number ${s} not implemented`);a+=1;const o=i.getUint8(a),h=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][o];if(!h)throw new Error(`invalid block content type id ${o}`);a+=1;const[d,g]=(0,n.parseItf8)(e,a);a+=g;const[f,c]=(0,n.parseItf8)(e,a);a+=c;const[l,u]=(0,n.parseItf8)(e,a);return a+=u,{offset:a,value:{uncompressedSize:l,compressedSize:f,contentId:d,contentType:h,compressionMethod:A}}},maxLength:17}}function s(){return{parser:(e,t)=>{const r=e,n=new DataView(r.buffer,r.byteOffset,r.length).getUint32(t,!0);return{offset:t+=4,value:{crc32:n}}},maxLength:4}}function A(e,t,r){const n=new TextDecoder("utf8").decode(e.subarray(t,r)),i=[];for(let e=0;e<n.length;e+=3)i.push(n.slice(e,e+3));return i}function o(){return{parser:(e,t)=>{const[r,i]=(0,n.parseItf8)(e,t);t+=i;const a=e.subarray(t,t+r);t+=r;const s=[];let o=0,h=0;for(;h<a.length;h++)a[h]||(s.push(A(a,o,h)),o=h+1);return h>o&&s.push(A(a,o,h)),{value:{size:r,ents:s},offset:t}}}}function h(){return{parser:(e,t)=>{const r=e,i=new DataView(r.buffer,r.byteOffset,r.length),[a,s]=(0,n.parseItf8)(e,t);t+=s;const[A,h]=(0,n.parseItf8)(e,t);t+=h;const d=[];for(let r=0;r<A;r++){const r=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(t+=2,"MI"===r||"UI"===r||"PI"===r||"RN"===r||"AP"===r||"RR"===r)d.push({key:r,value:!!i.getUint8(t)}),t+=1;else if("SM"===r)d.push({key:r,value:[i.getUint8(t),i.getUint8(t+1),i.getUint8(t+2),i.getUint8(t+3),i.getUint8(t+4)]}),t+=5;else{if("TD"!==r)throw new Error(`unknown key ${r}`);{const{offset:n,value:i}=o().parser(e,t);d.push({key:r,value:i.ents}),t=n}}}return{value:{mapSize:a,mapCount:A,ents:d},offset:t}}}}function d(e){const t={};for(const{key:r,value:n}of e.ents)t[r]&&console.warn(`duplicate key ${r} in map`),t[r]=n;return t}function g(e){let t=0;return t+=5,t+=9,t+=10,t+=16,{parser:(t,r)=>{const[i,a]=(0,n.parseItf8)(t,r);r+=a;let s=0;if(e>=3){const[e,i]=(0,n.parseLtf8)(t,r);r+=i,s=e}else if(2===e){const[e,i]=(0,n.parseItf8)(t,r);r+=i,s=e}else console.warn("recordCounter=0");const[A,o]=(0,n.parseItf8)(t,r);r+=o;const[h,d]=(0,n.parseItf8)(t,r);r+=d;const g=[];for(let e=0;e<h;e++){const[e,i]=(0,n.parseItf8)(t,r);r+=i,g.push(e)}let f;return e>=2&&(f=[...t.subarray(r,r+16)],r+=16),{value:{recordCounter:s,md5:f,contentIds:g,numContentIds:h,numBlocks:A,numRecords:i},offset:r}},maxLength:e=>40+5*e}}function f(e){let t=0;return t+=20,t+=9,t+=15,t+=16,{parser:(t,r)=>{const[i,a]=(0,n.parseItf8)(t,r);r+=a;const[s,A]=(0,n.parseItf8)(t,r);r+=A;const[o,h]=(0,n.parseItf8)(t,r);r+=h;const[d,g]=(0,n.parseItf8)(t,r);r+=g;let f=0;if(e>=3){const[e,i]=(0,n.parseLtf8)(t,r);r+=i,f=e}else if(2===e){const[e,i]=(0,n.parseItf8)(t,r);r+=i,f=e}else console.warn("majorVersion is <2, recordCounter set to 0");const[c,l]=(0,n.parseItf8)(t,r);r+=l;const[u,I]=(0,n.parseItf8)(t,r);r+=I;const C=[];for(let e=0;e<u;e++){const[e,i]=(0,n.parseItf8)(t,r);r+=i,C.push(e)}const[m,B]=(0,n.parseItf8)(t,r);let p;return r+=B,e>=2&&(p=[...t.subarray(r,r+16)],r+=16),{value:{md5:p,numBlocks:c,numRecords:d,numContentIds:u,refSeqSpan:o,refSeqId:i,refSeqStart:s,recordCounter:f,refBaseBlockId:m,contentIds:C},offset:r}},maxLength:e=>60+5*e}}function c(e,t){const r=e,i=new DataView(r.buffer,r.byteOffset,r.length),[a,s]=(0,n.parseItf8)(e,t);t+=s;const[A,o]=(0,n.parseItf8)(e,t);t+=o;const h={};if(0===a);else if(1===a){const[r,i]=(0,n.parseItf8)(e,t);h.blockContentId=r,t+=i}else if(2===a){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[a,s]=(0,n.parseItf8)(e,t);h.M=a,t+=s}else if(3===a){const r=(0,n.parseItf8)(e,t),i=r[0];t+=r[1];const a=[];for(let r=0;r<i;r++){const r=(0,n.parseItf8)(e,t);a.push(r[0]),t+=r[1]}h.symbols=a;const s=(0,n.parseItf8)(e,t),A=r[0];h.numLengths=A,h.numCodes=i,h.numLengths=A,t+=s[1];const o=[];for(let r=0;r<A;r++){const r=(0,n.parseItf8)(e,t);t+=r[1],o.push(r[0])}h.bitLengths=o}else if(4===a){const{value:r,offset:n}=c(e,t);h.lengthsEncoding=r,t=n;const{value:i,offset:a}=c(e,t);h.valuesEncoding=i,t=a}else if(5===a){h.stopByte=i.getUint8(t),t+=1;const[r,a]=(0,n.parseItf8)(e,t);h.blockContentId=r,t+=a}else if(6===a){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[a,s]=(0,n.parseItf8)(e,t);h.length=a,t+=s}else if(7===a){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[a,s]=(0,n.parseItf8)(e,t);h.K=a,t+=s}else if(8===a){const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i;const[a,s]=(0,n.parseItf8)(e,t);h.log2m=a,t+=s}else{if(9!==a)throw new Error(`unknown codecId ${a}`);{const[r,i]=(0,n.parseItf8)(e,t);h.offset=r,t+=i}}return{value:{codecId:a,parametersBytes:A,parameters:h},offset:t}}function l(){return{parser:(e,t)=>{const[r,i]=(0,n.parseItf8)(e,t);t+=i;const[a,s]=(0,n.parseItf8)(e,t);t+=s;const A=[];for(let r=0;r<a;r++){const r=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const{value:n,offset:i}=c(e,t);t=i,A.push({key:r,value:n})}return{value:{mapSize:r,ents:A,mapCount:a},offset:t}}}}function u(){return{parser:(e,t)=>{const[r,i]=(0,n.parseItf8)(e,t);t+=i;const[a,s]=(0,n.parseItf8)(e,t);t+=s;const A=[];for(let r=0;r<a;r++){const[r,i]=(0,n.parseItf8)(e,t);t+=i;const a=String.fromCharCode(r>>16&255)+String.fromCharCode(r>>8&255)+String.fromCharCode(255&r),{value:s,offset:o}=c(e,t);t=o,A.push({key:a,value:s})}return{value:{mapSize:r,ents:A,mapCount:a},offset:t}}}}function I(e){let t=4;return t+=20,t+=9,t+=9,t+=10,{maxLength:52,parser:(t,r)=>{const i=t,a=new DataView(i.buffer,i.byteOffset,i.length).getInt32(r,!0);r+=4;const[s,A]=(0,n.parseItf8)(t,r);r+=A;const[o,h]=(0,n.parseItf8)(t,r);r+=h;const[d,g]=(0,n.parseItf8)(t,r);r+=g;const[f,c]=(0,n.parseItf8)(t,r);r+=c;let l,u=0;if(e>=3){const[e,i]=(0,n.parseLtf8)(t,r);u=e,r+=i}else if(2===e){const[e,i]=(0,n.parseItf8)(t,r);u=e,r+=i}else console.warn("setting recordCounter=0");if(e>1){const[e,i]=(0,n.parseLtf8)(t,r);l=e,r+=i}const[I,C]=(0,n.parseItf8)(t,r);r+=C;const[m,B]=(0,n.parseItf8)(t,r);return{value:{length:a,refSeqId:s,refSeqStart:o,alignmentSpan:d,numBlocks:I,numLandmarks:m,numBases:l,recordCounter:u,numRecords:f},offset:r+=B}}}}function C(e){return{parser:(t,r)=>{const i=t,a=new DataView(i.buffer,i.byteOffset,i.length),[s,A]=(0,n.parseItf8)(t,r);r+=A;const o=[];for(let e=0;e<s;e++){const[e,i]=(0,n.parseItf8)(t,r);r+=i,o.push(e)}let h;return e>=3&&(h=a.getUint32(r,!0),r+=4),{value:{...void 0===h?{}:{crc32:h},numLandmarks:s,landmarks:o},offset:r}},maxLength:e=>5+5*e+4}}},6484:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,o,h,d,g,f,c){let l=t("BF");const u=t("CF");if(!(0,a.isMappedSliceHeader)(o.parsedContent))throw new Error("slice header not mapped");const I=f>1&&-2===o.parsedContent.refSeqId?t("RI"):o.parsedContent.refSeqId,C=t("RL");let m=t("AP");r.APdelta&&(m+=g.lastAlignmentStart),g.lastAlignmentStart=m;const B=t("RG");let p,w,_,E;if(r.readNamesIncluded&&(p=s(t("RN"))),i.CramFlagsDecoder.isDetached(u)){const e=t("MF");let n;r.readNamesIncluded||(n=s(t("RN")),p=n);const a=t("NS"),A=t("NP");(e||a>-1)&&(w={mateFlags:e,mateSequenceId:a,mateAlignmentStart:A,mateReadName:n}),_=t("TS"),i.MateFlagsDecoder.isUnmapped(e)&&(l=i.BamFlagsDecoder.setMateUnmapped(l)),i.MateFlagsDecoder.isOnNegativeStrand(e)&&(l=i.BamFlagsDecoder.setMateReverseComplemented(l))}else i.CramFlagsDecoder.isWithMateDownstream(u)&&(E=t("NF")+c+1);const Q=t("TL");if(Q<0)throw new n.CramMalformedError("invalid TL index");const y={},b=r.getTagNames(Q),v=b.length;for(let t=0;t<v;t++){const n=b[t],i=n.slice(0,2),a=n.slice(2,3),s=r.getCodecForTag(n).decode(e,h,d,g);y[i]="number"==typeof s?s:A(a,s)}let S,k,D,R,F;if(i.BamFlagsDecoder.isSegmentUnmapped(l))if(i.CramFlagsDecoder.isDecodeSequenceAsStar(u))F=null,R=null;else{const e=new Array(C);for(let r=0;r<e.length;r++)e[r]=t("BA");if(F=String.fromCharCode(...e),i.CramFlagsDecoder.isPreservingQualityScores(u)){R=new Array(C);for(let r=0;r<e.length;r++)R[r]=t("QS")}}else{const e=t("FN");if(e&&(S=function(e,t,r,i,a){let s=0,A=e-1;const o=new Array(t);function h([e,t]){const n=r(t);if("character"===e)return String.fromCharCode(n);if("string"===e){let e="";for(let t=0;t<n.byteLength;t++)e+=String.fromCharCode(n[t]);return e}return"numArray"===e?n.toArray():n}for(let e=0;e<t;e++){const t=String.fromCharCode(r("FC")),i=r("FP"),d={B:["character","BA"],S:["string",a>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[t];if(!d)throw new n.CramMalformedError(`invalid read feature code "${t}"`);let g=h(d);const f={B:["number","QS"]}[t];f&&(g=[g,h(f)]),s+=i;const c=s;A+=i;const l=A;"D"===t||"N"===t?A+=g:"I"===t||"S"===t?A-=g.length:"i"===t&&(A-=1),o[e]={code:t,pos:c,refPos:l,data:g}}return o}(m,e,t,0,f)),k=C,S)for(const{code:e,data:t}of S)"D"===e||"N"===e?k+=t:"I"===e||"S"===e?k-=t.length:"i"===e&&(k-=1);if(Number.isNaN(k)&&(console.warn(`${p||`${I}:${m}`} record has invalid read features`),k=C),D=t("MQ"),i.CramFlagsDecoder.isPreservingQualityScores(u)){R=new Array(C);for(let e=0;e<R.length;e++)R[e]=t("QS")}}return{readLength:C,sequenceId:I,cramFlags:u,flags:l,alignmentStart:m,readGroupId:B,readName:p,mateToUse:w,templateSize:_,mateRecordNumber:E,readFeatures:S,lengthOnRef:k,mappingQuality:D,qualityScores:R,readBases:F,tags:y}};const n=r(9747),i=r(8401),a=r(3165);function s(e){let t="";for(let r=0;r<e.length&&0!==e[r];r++)t+=String.fromCharCode(e[r]);return t}function A(e,t){if("Z"===e)return s(t);if("A"===e)return String.fromCharCode(t[0]);if("I"===e)return new Uint32Array(t.buffer)[0];if("i"===e)return new Int32Array(t.buffer)[0];if("s"===e)return new Int16Array(t.buffer)[0];if("S"===e)return new Uint16Array(t.buffer)[0];if("c"===e)return new Int8Array(t.buffer)[0];if("C"===e)return t[0];if("f"===e)return new Float32Array(t.buffer)[0];if("H"===e)return Number.parseInt(s(t).replace(/^0x/,""),16);if("B"===e)return function(e){const t=String.fromCharCode(e[0]),r=new DataView(e.buffer).getUint32(1,!0),n=new Array(r);if(e=e.slice(5),"c"===t){const t=new Int8Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("C"===t){const t=new Uint8Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("s"===t){const t=new Int16Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("S"===t){const t=new Uint16Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("i"===t){const t=new Int32Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else if("I"===t){const t=new Uint32Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}else{if("f"!==t)throw new Error(`unknown type: ${t}`);{const t=new Float32Array(e.buffer);for(let e=0;e<r;e++)n[e]=t[e]}}return n}(t);throw new n.CramMalformedError(`Unrecognized tag type ${e}`)}},6771:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9747),a=r(612),s=n(r(7295)),A=n(r(6484)),o=n(r(8401)),h=r(3165),d=r(400);function g(e,t,r,n){const a=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==t);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=s.default.BAM_FPAIRED,n.flags&s.default.BAM_FUNMAP&&(r.flags|=s.default.BAM_FMUNMAP),r.flags&s.default.BAM_FUNMAP&&(n.flags|=s.default.BAM_FMUNMAP),n.flags&s.default.BAM_FREVERSE&&(r.flags|=s.default.BAM_FMREVERSE),r.flags&s.default.BAM_FREVERSE&&(n.flags|=s.default.BAM_FMREVERSE),void 0===r.templateLength&&(a?function(e,t,r){const n=function t(r){const n=[r];if(void 0!==r.mateRecordNumber&&r.mateRecordNumber>=0){const a=e[r.mateRecordNumber];if(!a)throw new i.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push(...t(a))}return n}(r),a=n.map((e=>e.alignmentStart)),s=n.map((e=>e.alignmentStart+e.readLength-1)),A=Math.max(...s)-Math.min(...a)+1;A>=0&&n.forEach((e=>{if(void 0!==e.templateLength)throw new i.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");e.templateLength=A}))}(e,0,r):function(e,t){const r=Math.min(e.alignmentStart,t.alignmentStart),n=Math.max(e.alignmentStart+e.readLength-1,t.alignmentStart+t.readLength-1)-r+1;e.templateLength=n,t.templateLength=n}(r,n)),r.mateRecordNumber=void 0}class f{constructor(e,t,r){this.container=e,this.containerPosition=t,this.sliceSize=r,this.file=e.file}async getHeader(){const{majorVersion:e}=await this.file.getDefinition(),t=(0,h.getSectionParsers)(e),r=await this.container.getHeader();if(!r)throw new Error("no container header detected");const n=await this.file.readBlock(r._endPosition+this.containerPosition);if(void 0===n)throw new Error("block header undefined");if("MAPPED_SLICE_HEADER"===n.contentType){const e=(0,d.parseItem)(n.content,t.cramMappedSliceHeader.parser,0,r._endPosition);return{...n,parsedContent:e}}if("UNMAPPED_SLICE_HEADER"===n.contentType){const e=(0,d.parseItem)(n.content,t.cramUnmappedSliceHeader.parser,0,r._endPosition);return{...n,parsedContent:e}}throw new i.CramMalformedError(`error reading slice header block, invalid content type ${n.contentType}`)}async getBlocks(){const e=await this.getHeader();let t=e._endPosition;const r=new Array(e.parsedContent.numBlocks);for(let e=0;e<r.length;e++){const n=await this.file.readBlock(t);if(void 0===n)throw new Error("block undefined");r[e]=n,t=r[e]._endPosition}return r}async getCoreDataBlock(){return(await this.getBlocks())[0]}async _getBlocksContentIdIndex(){const e=await this.getBlocks(),t={};return e.forEach((e=>{"EXTERNAL_DATA"===e.contentType&&(t[e.contentId]=e)})),t}async getBlockByContentId(e){return(await this._getBlocksContentIdIndex())[e]}async getReferenceRegion(){const e=(await this.getHeader()).parsedContent;if(!(0,h.isMappedSliceHeader)(e))throw new Error("slice header not mapped");if(e.refSeqId<0)return;const t=await this.container.getCompressionScheme();if(void 0===t)throw new Error("compression scheme undefined");if(e.refBaseBlockId>=0){const t=await this.getBlockByContentId(e.refBaseBlockId);if(!t)throw new i.CramMalformedError("embedded reference specified, but reference block does not exist");return{seq:t.data.toString("utf8"),start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}}if(t.referenceRequired||this.file.fetchReferenceSequenceCallback){if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");const t=await this.file.fetchReferenceSequenceCallback(e.refSeqId,e.refSeqStart,e.refSeqStart+e.refSeqSpan-1);if(t.length!==e.refSeqSpan)throw new i.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return{seq:t,start:e.refSeqStart,end:e.refSeqStart+e.refSeqSpan-1,span:e.refSeqSpan}}}getAllRecords(){return this.getRecords((()=>!0))}async _fetchRecords(){const{majorVersion:e}=await this.file.getDefinition(),t=await this.container.getCompressionScheme();if(void 0===t)throw new Error("compression scheme undefined");const r=await this.getHeader(),n=await this._getBlocksContentIdIndex();if(e>1&&this.file.options.checkSequenceMD5&&(0,h.isMappedSliceHeader)(r.parsedContent)&&r.parsedContent.refSeqId>=0&&"0000000000000000"!==r.parsedContent.md5?.join("")){const e=await this.getReferenceRegion();if(e){const{seq:t,start:n,end:a}=e,s=(0,d.sequenceMD5)(t),A=r.parsedContent.md5?.map((e=>(e<16?"0":"")+e.toString(16))).join("");if(s!==A)throw new i.CramMalformedError(`MD5 checksum reference mismatch for ref ${r.parsedContent.refSeqId} pos ${n}..${a}. recorded MD5: ${A}, calculated MD5: ${s}`)}}const s=await this.getCoreDataBlock(),f={lastAlignmentStart:(0,h.isMappedSliceHeader)(r.parsedContent)?r.parsedContent.refSeqStart:0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor(e){let t=this.map.get(e);return void 0===t&&(t={bitPosition:7,bytePosition:0},this.map.set(e,t)),t}}},c=e=>{const r=t.getCodecForDataSeries(e);if(!r)throw new i.CramMalformedError(`no codec defined for ${e} data series`);return r.decode(this,s,n,f)},l=new Array(r.parsedContent.numRecords);for(let i=0;i<l.length;i+=1)try{const a=(0,A.default)(this,c,t,r,s,n,f,e,i);l[i]=new o.default({...a,uniqueId:r.contentPosition+r.parsedContent.recordCounter+i+1})}catch(e){if(e instanceof a.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated.");break}throw e}for(let e=0;e<l.length;e+=1){const{mateRecordNumber:t}=l[e];void 0!==t&&t>=0&&g(l,e,l[e],l[t])}return l}async getRecords(e){const t=this.container.filePosition+this.containerPosition;let r=this.file.featureCache.get(t.toString());r||(r=this._fetchRecords(),this.file.featureCache.set(t.toString(),r));const n=(await r).filter(e);if(n.length&&this.file.fetchReferenceSequenceCallback){const e=await this.getHeader();if((0,h.isMappedSliceHeader)(e.parsedContent)&&(e.parsedContent.refSeqId>=0||-2===e.parsedContent.refSeqId)){const t=e.parsedContent.refSeqId>=0?e.parsedContent.refSeqId:void 0,r=await this.container.getCompressionScheme();if(void 0===r)throw new Error("compression scheme undefined");const i={};for(const e of n){const r=void 0!==t?t:e.sequenceId;let n=i[r];n||(n={id:r,start:e.alignmentStart,end:Number.NEGATIVE_INFINITY,seq:null},i[r]=n);const a=e.alignmentStart+(e.lengthOnRef||e.readLength)-1;a>n.end&&(n.end=a),e.alignmentStart<n.start&&(n.start=e.alignmentStart)}await Promise.all(Object.values(i).map((async e=>{-1!==e.id&&e.start<=e.end&&this.file.fetchReferenceSequenceCallback&&(e.seq=await this.file.fetchReferenceSequenceCallback(e.id,e.start,e.end))})));for(const e of n){const n=i[void 0!==t?t:e.sequenceId];if(n?.seq){const t=n.seq;e.addReferenceSequence({...n,seq:t},r)}}}}return n}}t.default=f,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((e=>{(0,d.tinyMemoize)(f,e)}))},400:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.itf8Size=function(e){return-128&e?-16384&e?-2097152&e?-268435456&e?5:4:3:2:1},t.parseItf8=function(e,t){let r=t;const n=e[r];let i;if(n<128?(i=n,r+=1):n<192?(i=16383&(n<<8|e[r+1]),r+=2):n<224?(i=2097151&(n<<16|e[r+1]<<8|e[r+2]),r+=3):n<240?(i=268435455&(n<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]),r+=4):(i=(15&n)<<28|e[r+1]<<20|e[r+2]<<12|e[r+3]<<4|15&e[r+4],r+=5),r>e.length)throw new s.CramBufferOverrunError("Attempted to read beyond end of buffer; this file seems truncated.");return[i,r-t]},t.parseLtf8=function(e,t){const r=new DataView(e.buffer);let n=t;const a=e[n];let s;if(a<128)s=a,n+=1;else if(a<192)s=16383&(e[n]<<8|e[n+1]),n+=2;else if(a<224)s=2097151&(e[n]<<16|e[n+1]<<8|e[n+2]),s=(63&a)<<16|r.getUint16(n+1,!0),n+=3;else if(a<240)s=268435455&(e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3]),n+=4;else if(a<248)s=(15&e[n])*2**32+(e[n+1]<<24)|e[n+2]<<16|e[n+3]<<8|e[n+4],n+=5;else if(a<252)s=((7&e[n])<<8|e[n+1])*2**32+(e[n+2]<<24)|e[n+3]<<16|e[n+4]<<8|e[n+5],n+=6;else if(a<254)s=((3&e[n])<<16|e[n+1]<<8|e[n+2])*2**32+(e[n+3]<<24)|e[n+4]<<16|e[n+5]<<8|e[n+6],n+=7;else if(a<255){if(s=i.default.fromBytesBE(e.slice(n+1,n+8)),s.greaterThan(Number.MAX_SAFE_INTEGER)||s.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");s=s.toNumber(),n+=8}else{if(s=i.default.fromBytesBE(e.slice(n+1,n+9)),s.greaterThan(Number.MAX_SAFE_INTEGER)||s.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");s=s.toNumber(),n+=9}return[s,n-t]},t.parseItem=function(e,t,r=0,n=0){const{offset:i,value:a}=t(e,r);return{...a,_endPosition:i+n,_size:i-r}},t.tinyMemoize=function(e,t){const r=e.prototype[t],n=`_memo_${t}`;e.prototype[t]=function(){if(!(n in this)){const e=r.call(this);this[n]=e,Promise.resolve(e).catch((()=>{delete this[n]}))}return this[n]}},t.sequenceMD5=function(e){return(0,a.default)(e.toUpperCase().replaceAll(/[^\u0021-\u007e]/g,""))},t.sum=A,t.concatUint8Array=function(e){const t=new Uint8Array(A(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t};const i=n(r(8570)),a=n(r(3503)),s=r(612);function A(e){let t=0;for(const r of e)t+=r.length;return t}},9747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CramArgumentError=t.CramSizeLimitError=t.CramMalformedError=t.CramUnimplementedError=t.CramError=void 0;class r extends Error{}t.CramError=r;class n extends Error{}t.CramUnimplementedError=n,t.CramMalformedError=class extends r{},t.CramSizeLimitError=class extends r{},t.CramArgumentError=class extends r{}},2884:(e,t,r)=>{"use strict";const n=r(8175),i=r(2935),a=r(5871),s=r(235);e.exports=class{decode(e){return this.stream=new i(e),this.decodeStream(this.stream)}decodeStream(e,t=0){var r=this.stream.ReadByte();16&r||(t=this.stream.ReadUint7());var n,i=t,a=1&r;if(8&r)return this.decodeStripe(this.stream,t);if(128&r&&([n,i]=this.decodePackMeta(this.stream)),32&r)var s=this.decodeCat(this.stream,i);else s=4&r?this.decodeExt(this.stream,i):64&r?a?this.decodeRLE1(this.stream,i):this.decodeRLE0(this.stream,i):a?this.decode1(this.stream,i):this.decode0(this.stream,i);return 128&r&&(s=this.decodePack(s,n,t)),s}decode0(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);var s=new a(i),A=new n(e);A.RangeStartDecode(e);for(var o=0;o<t;o++)r[o]=s.ModelDecode(e,A);return r}decode1(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);for(var s=new Array(i),A=0;A<i;A++)s[A]=new a(i);var o=new n(e);o.RangeStartDecode(e);var h=0;for(A=0;A<t;A++)r[A]=s[h].ModelDecode(e,o),h=r[A];return r}decodeExt(e,t){const r=s.array(e.buf.slice(e.pos));let n,i=s.header(r);const a=[];do{n=s.decompress(r,i),-1!==n&&(a.push(n),i-=n.length)}while(-1!==n);return function(e){const t=new Uint8Array(function(e){let t=0;for(const r of e)t+=r.length;return t}(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t}(a)}decodeRLE0(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);for(var s=new a(i),A=new Array(258),o=0;o<=257;o++)A[o]=new a(4);var h=new n(e);for(h.RangeStartDecode(e),o=0;o<t;){r[o]=s.ModelDecode(e,h);for(var d=A[r[o]].ModelDecode(e,h),g=d,f=256;3==d;)d=A[f].ModelDecode(e,h),f=257,g+=d;for(var c=1;c<=g;c++)r[o+c]=r[o];o+=g+1}return r}decodeRLE1(e,t){var r=new Uint8Array(t),i=e.ReadByte();0==i&&(i=256);for(var s=new Array(i),A=0;A<i;A++)s[A]=new a(i);var o=new Array(258);for(A=0;A<=257;A++)o[A]=new a(4);var h=new n(e);h.RangeStartDecode(e);var d=0;for(A=0;A<t;){r[A]=s[d].ModelDecode(e,h),d=r[A];for(var g=o[r[A]].ModelDecode(e,h),f=g,c=256;3==g;)g=o[c].ModelDecode(e,h),c=257,f+=g;for(var l=1;l<=f;l++)r[A+l]=r[A];A+=f+1}return r}decodePackMeta(e){this.nsym=e.ReadByte();for(var t=new Array(this.nsym),r=0;r<this.nsym;r++)t[r]=e.ReadByte();return[t,e.ReadUint7()]}decodePack(e,t,r){var n=new Uint8Array(r);if(this.nsym<=1)for(var i=0;i<r;i++)n[i]=t[0];else if(this.nsym<=2){i=0;for(var a=0;i<r;i++){if(i%8==0)var s=e[a++];n[i]=t[1&s],s>>=1}}else if(this.nsym<=4)for(i=0,a=0;i<r;i++)i%4==0&&(s=e[a++]),n[i]=t[3&s],s>>=2;else{if(!(this.nsym<=16))return e;for(i=0,a=0;i<r;i++)i%2==0&&(s=e[a++]),n[i]=t[15&s],s>>=4}return n}packMeta(e){for(var t=new i("",0,1024),r=new Array(256),n=0;n<e.length;n++)r[e[n]]=1;var a=0;for(n=0;n<256;n++)r[n]&&(r[n]=++a);for(t.WriteByte(a),n=0;n<256;n++)r[n]&&(t.WriteByte(n),r[n]--);return[t,r,a]}decodeStripe(e,t){for(var r=e.ReadByte(),n=new Array(r),i=new Array(r),a=0;a<r;a++)n[a]=e.ReadUint7();var s=new Array(r);for(a=0;a<r;a++)i[a]=Math.floor(t/r)+(t%r>a),s[a]=this.decodeStream(e,i[a]);var A=new Uint8Array(t);for(a=0;a<r;a++)for(var o=0;o<i[a];o++)A[o*r+a]=s[a][o];return A}decodeCat(e,t){for(var r=new Uint8Array(t),n=0;n<t;n++)r[n]=e.ReadByte();return r}}},8175:e=>{"use strict";e.exports=class{constructor(e){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(e){for(var t=0;t<5;t++)this.code=(this.code<<8)+e.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(e){return this.range=Math.floor(this.range/e),Math.floor(this.code/this.range)}RangeDecode(e,t,r,n){for(this.code-=t*this.range,this.range*=r;this.range<1<<24;)this.range*=256,this.code=256*this.code+e.ReadByte()}RangeShiftLow(e){if(this.low<4278190080|this.carry){for(e.WriteByte(this.cache+this.carry);this.FFnum;)e.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(e,t,r,n){var i=this.low;for(this.range=Math.floor(this.range/n),this.low+=t*this.range,this.low>>>=0,this.range*=r,this.low<i&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(e)}RangeFinishEncode(e){for(var t=0;t<5;t++)this.RangeShiftLow(e)}}},5871:e=>{"use strict";e.exports=class{constructor(e=256){this.total_freq=e,this.max_sym=e-1,this.S=new Array,this.F=new Array;for(var t=0;t<=this.max_sym;t++)this.S[t]=t,this.F[t]=1}ModelDecode(e,t){for(var r=t.RangeGetFrequency(this.total_freq),n=0,i=0;n+this.F[i]<=r;)n+=this.F[i++];t.RangeDecode(e,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();var a=this.S[i];if(i>0&&this.F[i]>this.F[i-1]){var s=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=s,s=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=s}return a}ModelRenormalise(){this.total_freq=0;for(var e=0;e<=this.max_sym;e++)this.F[e]-=Math.floor(this.F[e]/2),this.total_freq+=this.F[e]}ModelEncode(e,t,r){for(var n=0,i=0;this.S[i]!=r;i++)n+=this.F[i];if(t.RangeEncode(e,n,this.F[i],this.total_freq),this.F[i]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise(),r=this.S[i],i>0&&this.F[i]>this.F[i-1]){var a=this.F[i];this.F[i]=this.F[i-1],this.F[i-1]=a,a=this.S[i],this.S[i]=this.S[i-1],this.S[i-1]=a}}}},4373:(e,t,r)=>{"use strict";const n=r(2935),i=r(5871),a=r(8175);function s(e,t,r){for(var n=0,i=0,a=-1,s=new Array(1024);i<r;){var A=e.ReadByte();if(s[n++]=A,i+=A,A==a){var o=e.ReadByte();for(i+=A*o;o--;)s[n++]=A}a=A}var h=0;for(n=0,i=0;i<r;){var d=0;do{var g=s[n++];d+=g}while(255==g);for(;d--;)t[i++]=h;h++}}function A(e,t,r){var n=e.context;return t.qctx=(t.qctx<<e.qshift)+e.qtab[r],n+=(t.qctx&(1<<e.qbits)-1)<<e.qloc,e.do_pos&&(n+=e.ptab[Math.min(t.p,1023)]<<e.ploc),e.do_delta&&(n+=e.dtab[Math.min(t.delta,255)]<<e.dloc,t.delta+=t.prevq!=r?1:0,t.prevq=r),e.do_sel&&(n+=t.s<<e.sloc),t.p--,65535&n}function o(e){var t={};t.context=e.ReadUint16(),t.pflags=e.ReadByte(),t.do_dedup=2&t.pflags,t.fixed_len=4&t.pflags,t.do_sel=8&t.pflags,t.do_qmap=16&t.pflags,t.do_pos=32&t.pflags,t.do_delta=64&t.pflags,t.do_qtab=128&t.pflags,t.max_sym=e.ReadByte();var r=e.ReadByte();if(t.qbits=r>>4,t.qshift=15&r,r=e.ReadByte(),t.qloc=r>>4,t.sloc=15&r,r=e.ReadByte(),t.ploc=r>>4,t.dloc=15&r,t.qmap=new Array(256),16&t.pflags)for(var n=0;n<t.max_sym;n++)t.qmap[n]=e.ReadByte();else for(n=0;n<256;n++)t.qmap[n]=n;if(t.qtab=new Array(1024),t.qbits>0&&128&t.pflags)s(e,t.qtab,256);else for(n=0;n<256;n++)t.qtab[n]=n;return t.ptab=new Array(1024),32&t.pflags&&s(e,t.ptab,1024),t.dtab=new Array(256),64&t.pflags&&s(e,t.dtab,256),t}function h(e,t,r,n,i,a){r.max_sel>0?i.s=n.sel.ModelDecode(e,t):i.s=0,i.x=r.stab[i.s];var s=r.params[i.x];if(s.fixed_len>=0){var A=n.len[0].ModelDecode(e,t);A|=n.len[1].ModelDecode(e,t)<<8,A|=n.len[2].ModelDecode(e,t)<<16,A|=n.len[3].ModelDecode(e,t)<<24,s.fixed_len>0&&(s.fixed_len=-A)}else A=-s.fixed_len;i.len=A,r.do_rev&&(a[i.rec]=n.rev.ModelDecode(e,t)),i.is_dup=0,2&s.pflags&&n.dup.ModelDecode(e,t)&&(i.is_dup=1),i.p=A,i.delta=0,i.qctx=0,i.prevq=0,i.rec++}e.exports={decode:function(e,t){return function(e,t){var r=e.ReadUint7(),n=function(e){var t={max_sym:0};if(5==e.ReadByte()){var r=e.ReadByte(),n=1&r?e.ReadByte():1,i=r.nparam>1?r.nparam-1:0,a=new Array(256);if(2&r)i=e.ReadByte(),s(e,a,256);else{for(var A=0;A<n;A++)a[A]=A;for(;A<256;A++)a[A]=n-1}t.do_rev=4&r,t.stab=a,t.max_sel=i,t.params=new Array(t.nparam);for(var h=0;h<n;h++)t.params[h]=o(e),t.max_sym<t.params[h].max_sym&&(t.max_sym=t.params[h].max_sym);return t}console.error("Invalid FQZComp version number")}(e);if(n){var d=n.params,g=new Array(t.length),f=function(e){var t={};t.qual=new Array(65536);for(var r=0;r<65536;r++)t.qual[r]=new i(e.max_sym+1);for(t.len=new Array(4),r=0;r<4;r++)t.len[r]=new i(256);return t.rev=new i(2),t.dup=new i(2),e.max_sel>0&&(t.sel=new i(e.max_sel+1)),t}(n),c=new a(e);c.RangeStartDecode(e);for(var l=new Uint8Array(r),u={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0},I=0;I<r;){if(0==u.p){if(h(e,c,n,f,u,g),u.is_dup>0&&f.dup.ModelDecode(e,c)){for(var C=0;C<len;C++)l[I+C]=l[I+C-u.len];I+=u.len,u.p=0;continue}t.push(u.len);var m=(d=n.params[u.x]).context}var B=f.qual[m].ModelDecode(e,c);l[I++]=d.qmap[B],m=A(d,u,B)}return n.do_rev&&function(e,t,r,n){for(var i=0,a=0;a<t;){if(r[i])for(var s=0,A=n[i]-1;s<A;){var o=e[a+s];e[a+s]=e[a+A],e[a+A]=o,s++,A--}a+=n[i++]}}(l,r,g,t),l}}(new n(e),t)}}},9151:(e,t,r)=>{"use strict";var n=r(9725),i=r(6194),a=r(2884),s=r(4373),A=r(680);e.exports={r4x8_uncompress:function(e,t){return n.decode(e)},r4x16_uncompress:function(e){return i.decode(e)},arith_uncompress:function(e){return(new a).decode(e)},fqzcomp_uncompress:function(e){var t=new Array;return s.decode(e,t)},tok3_uncompress:function(e){var t=A.decode(e,0,"\0");return Uint8Array.from(Array.from(t).map((e=>e.charCodeAt(0))))}}},2935:e=>{"use strict";e.exports=class{constructor(e,t=0,r=0){0!=r?(this.buf=new Uint8Array(r),this.length=r):(this.buf=e,this.length=e.length),this.dataView=new DataView(this.buf.buffer),this.pos=t}EOF(){return this.pos>=this.length}ReadData(e){var t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}ReadByte(){const e=this.buf[this.pos];return this.pos++,e}ReadChar(){const e=this.buf[this.pos];return this.pos++,String.fromCharCode(e)}ReadUint16(){return this.ReadByte()|this.ReadByte()<<8}ReadUint32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}ReadString(){var e="";do{var t=this.buf[this.pos++];t&&(e+=String.fromCharCode(t))}while(t);return e}ReadUint7(){var e=0;do{var t=this.ReadByte();e=e<<7|127&t}while(128&t);return e}ReadITF8(){var e=this.buf[this.pos];return this.pos++,e>=240?(e=(15&e)<<28,e+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):e>=224?(e=(15&e)<<24,e+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(0|this.buf[this.pos+2]),this.pos+=3):e>=192?(e=(31&e)<<16,e+=(this.buf[this.pos+0]<<8)+(0|this.buf[this.pos+1]),this.pos+=2):e>=128&&(e=(63&e)<<8,e+=this.buf[this.pos],this.pos++),e}WriteByte(e){this.buf[this.pos++]=e}WriteChar(e){this.buf[this.pos++]=e.charCodeAt(0)}WriteString(e){for(var t=0;t<e.length;t++)this.buf[this.pos++]=e.charCodeAt(t);this.buf[this.pos++]=0}WriteData(e,t){for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]}WriteStream(e){this.WriteData(e.buf,e.pos)}WriteUint16(e){this.WriteByte(255&e),this.WriteByte(e>>8&255)}WriteUint32(e){this.buf.writeInt32LE(e,this.pos),this.pos+=4}WriteUint7(e){var t=0,r=e;do{t+=7,r>>=7}while(r>0);do{t-=7,this.WriteByte((e>>t&127)+((t>0)<<7))}while(t>0)}WriteITF8(e){e<0&&(e=1+e),e<=127?this.buf[this.pos++]=e:e<=16383?(this.buf[this.pos++]=128|Math.floor(e/256),this.buf[this.pos++]=255&e):e<131071?(this.buf[this.pos++]=192|Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):e<268435455?(this.buf[this.pos++]=224|Math.floor(e/16777216),this.buf[this.pos++]=255&Math.floor(e/65536),this.buf[this.pos++]=255&Math.floor(e/256),this.buf[this.pos++]=255&e):(this.buf[this.pos++]=240|Math.floor(e/268435456),this.buf[this.pos++]=255&Math.floor(e/1048576),this.buf[this.pos++]=255&Math.floor(e/4096),this.buf[this.pos++]=255&Math.floor(e/4),this.buf[this.pos++]=15&e)}WriteByteNeg(e){this.buf[--this.pos]=e}}},9725:(e,t,r)=>{"use strict";const n=r(2935);function i(e){return 4095&e}function a(e,t){for(var r=0;t>=e[r+1];)r++;return r}function s(e){for(var t=new Array(4096),r=0,n=0;n<4096;n++){for(;n>=e[r+1];)r++;t[n]=r}return t}function A(e,t,r){return r*(e>>12)+(4095&e)-t}function o(e,t){for(;t<1<<23;)t=(t<<8)+e.ReadByte();return t}function h(e,t,r){for(var n=0;n<256;n++)t[n]=0;var i=e.ReadByte(),a=i,s=0;do{var A=e.ReadITF8();t[i]=A,s>0?(s--,i++):(i=e.ReadByte())==a+1&&(s=e.ReadByte()),a=i}while(0!=i);for(r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+t[n]}e.exports={decode:function(e){var t=new n(e),r=t.ReadByte(),d=(t.ReadUint32(),t.ReadUint32());return 0==r?function(e,t){var r=new Array(256),n=new Array(256);h(e,r,n);for(var a=s(n),d=new Array(4),g=0;g<4;g++)d[g]=e.ReadUint32();var f=new Uint8Array(t);for(g=0;g<t;g++){var c=g%4,l=a[i(d[c])];f[g]=l,d[c]=A(d[c],n[l],r[l]),d[c]=o(e,d[c])}return f}(t,d):function(e,t){var r=new Array(256),n=new Array(256);!function(e,t,r){for(var n=0;n<256;n++){t[n]=new Array(256),r[n]=new Array(256);for(var i=0;i<256;i++)t[n][i]=0}var a=e.ReadByte(),s=a,A=0;do{h(e,t[a],r[a]),A>0?(A--,a++):(a=e.ReadByte())==s+1&&(A=e.ReadByte()),s=a}while(0!=a)}(e,r,n);for(var d=new Array(256),g=0;g<256;g++)d[g]=s(n[g]);for(var f=new Array(4),c=new Array(4),l=0;l<4;l++)f[l]=e.ReadUint32(),c[l]=0;var u=new Uint8Array(t),I=Math.floor(t/4);for(g=0;g<I;g++)for(l=0;l<4;l++){var C=i(f[l]),m=d[c[l]][C];u[g+l*I]=m,f[l]=A(f[l],n[c[l]][m],r[c[l]][m]),f[l]=o(e,f[l]),c[l]=m}for(g*=4;g<t;)C=i(f[3]),m=a(n[c[3]],C),u[g++]=m,f[3]=A(f[3],n[c[3]][m],r[c[3]][m]),f[3]=o(e,f[3]),c[3]=m;return u}(t,d)}}},6194:(e,t,r)=>{"use strict";const n=r(2935);function i(e,t){return e&(1<<t)-1}function a(e,t){for(var r=0;t>=e[r+1];)r++;return r}function s(e,t){for(var r=1<<t,n=new Array(r),i=0,a=0;a<r;a++){for(;a>=e[i+1];)i++;n[a]=i}return n}function A(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}function o(e,t){return t<32768&&(t=(t<<16)+e.ReadUint16()),t}function h(e,t){var r=e.ReadByte(),c=1&r,l=8&r,u=32&r,I=64&r,C=128&r,m=4&r?32:4;if(16&r||(t=e.ReadUint7()),l)return function(e,t){for(var r=e.ReadByte(),n=new Array(r),i=new Array(r),a=0;a<r;a++)n[a]=e.ReadUint7();var s=new Array(r);for(a=0;a<r;a++)i[a]=Math.floor(t/r)+(t%r>a),s[a]=h(e,i[a]);var A=new Uint8Array(t);for(a=0;a<r;a++)for(var o=0;o<i[a];o++)A[o*r+a]=s[a][o];return A}(e,t);if(C)var B=t,[p,w,t]=function(e){for(var t=e.ReadByte(),r=new Array(t),n=0;n<t;n++)r[n]=e.ReadByte();return[r,t,e.ReadUint7()]}(e);if(I)var _=t,[E,Q,t]=function(e,t){var r=e.ReadUint7(),i=e.ReadUint7();if(1&r)var a=e.ReadData((r-1)/2);else{var s=e.ReadUint7();a=e.ReadData(s),a=g(new n(a),r/2,t)}a=new n(a);var A=new Array(256),o=a.ReadByte();0==o&&(o=256);for(var h=0;h<o;h++)A[a.ReadByte()]=1;return[A,a,i]}(e,m);if(u)var y=e.ReadData(t);else y=0==c?g(e,t,m):function(e,t,r){var h=(I=e.ReadByte())>>4,c=e;if(1&I){var l=e.ReadUint7(),u=e.ReadUint7(),I=new n(e.ReadData(u));c=new n(g(I,l,4))}var C=new Array(256),m=new Array(256);!function(e,t,r,n){for(var i=0;i<256;i++){t[i]=new Array(256),r[i]=new Array(256);for(var a=0;a<256;a++)t[i][a]=0}var s=d(e);for(i=0;i<256;i++)if(s[i]){var A=0;for(a=0;a<256;a++)s[a]&&(A>0?A--:(t[i][a]=e.ReadUint7(),0==t[i][a]&&(A=e.ReadByte())));for(f(t[i],n),r[i][0]=0,a=0;a<256;a++)r[i][a+1]=r[i][a]+t[i][a]}}(c,C,m,h);for(var B=new Array(256),p=0;p<256;p++)B[p]=s(m[p],h);for(var w=new Array(r),_=new Array(r),E=0;E<r;E++)w[E]=e.ReadUint32(),_[E]=0;var Q=new Uint8Array(t),y=Math.floor(t/r);for(p=0;p<y;p++)for(E=0;E<r;E++){var b=i(w[E],h),v=B[_[E]][b];Q[p+E*y]=v,w[E]=A(w[E],m[_[E]][v],C[_[E]][v],h),w[E]=o(e,w[E]),_[E]=v}for(p*=r;p<t;)b=i(w[r-1],h),v=a(m[_[r-1]],b),Q[p++]=v,w[r-1]=A(w[r-1],m[_[r-1]][v],C[_[r-1]][v],h),w[r-1]=o(e,w[r-1]),_[r-1]=v;return Q}(e,t,m);return I&&(y=function(e,t,r,i){new n(e);for(var a=new Uint8Array(i),s=0,A=0;s<i;A++){var o=e[A];if(t[o])for(var h=r.ReadUint7(),d=0;d<=h;d++)a[s++]=o;else a[s++]=o}return a}(y,E,Q,_)),C&&(y=function(e,t,r,n){var i=new Uint8Array(n),a=0;if(r<=1)for(var s=0;s<n;s++)i[s]=t[0];else if(r<=2)for(s=0;s<n;s++){if(s%8==0)var A=e[a++];i[s]=t[1&A],A>>=1}else if(r<=4)for(s=0;s<n;s++)s%4==0&&(A=e[a++]),i[s]=t[3&A],A>>=2;else if(r<=16)for(s=0;s<n;s++)s%2==0&&(A=e[a++]),i[s]=t[15&A],A>>=4;return i}(y,p,w,B)),y}function d(e){for(var t=new Array(256),r=0;r<256;r++)t[r]=0;var n=0,i=e.ReadByte(),a=i;do{t[i]=1,n>0?(n--,i++):(i=e.ReadByte())==a+1&&(n=e.ReadByte()),a=i}while(0!=i);return t}function g(e,t,r){var n=new Array(256),a=new Array(256);!function(e,t,r){for(var n=0;n<256;n++)t[n]=0;var i=d(e);for(n=0;n<256;n++)i[n]>0&&(t[n]=e.ReadUint7());for(f(t,12),r[0]=0,n=0;n<=255;n++)r[n+1]=r[n]+t[n]}(e,n,a);for(var h=s(a,12),g=new Array(r),c=0;c<r;c++)g[c]=e.ReadUint32();var l=new Uint8Array(t);for(c=0;c<t;c++){var u=c&r-1,I=h[i(g[u],12)];l[c]=I,g[u]=A(g[u],a[I],n[I],12),g[u]=o(e,g[u])}return l}function f(e,t){for(var r=0,n=0;n<256;n++)r+=e[n];if(0!=r&&r!=1<<t){for(var i=0;r<1<<t;)r*=2,i++;for(n=0;n<256;n++)e[n]<<=i}}e.exports={decode:function(e){return h(new n(e),0)}}},680:(e,t,r)=>{"use strict";const n=r(2935),i=r(6194);function a(e){const t=new Uint8Array(function(e){let t=0;for(const r of e)t+=r.length;return t}(e));let r=0;for(const n of e)t.set(n,r),r+=n.length;return t}var s=new(r(2884));function A(e,t){for(var r=e+"";r.length<t;)r="0"+r;return r}function o(e,t,r,n){var i=e[0][0].ReadByte(),a=n-e[0][i].ReadUint32();if(5==i)return t[n]=t[a],r[n]=r[a],t[n];var s=1;t[n]="",r[n]=new Array(256);do{switch(i=e[s][0].ReadByte()){case 2:r[n][s]=e[s][2].ReadChar();break;case 1:r[n][s]=e[s][1].ReadString();break;case 7:r[n][s]=e[s][7].ReadUint32();break;case 3:var o=e[s][3].ReadUint32(),h=e[s][4].ReadByte();r[n][s]=A(o,h);break;case 8:r[n][s]=(0|r[a][s])+e[s][8].ReadByte();break;case 9:o=(0|r[a][s])+e[s][9].ReadByte(),h=r[a][s].length,r[n][s]=A(o,h);break;case 10:r[n][s]=r[a][s];break;default:r[n][s]=""}t[n]+=r[n][s++]}while(12!=i);return t[n]}function h(e,t,r,n,i,a){for(var s=0;s<n.length;s++)if(!(r>0&&5==t[s][0].type)&&t[s][r])switch(e[0].WriteByte(t[s][r].type),t[s][r].type){case 6:e[6].WriteUint32(t[s][r].val);break;case 5:e[5].WriteUint32(t[s][r].val);break;case 1:e[1].WriteString(t[s][r].val);break;case 2:e[2].WriteChar(t[s][r].val);break;case 7:e[7].WriteUint32(t[s][r].val);break;case 3:e[3].WriteUint32(t[s][r].val),e[4].WriteByte(t[s][r].val.length);break;case 8:case 9:e[t[s][r].type].WriteByte(t[s][r].val)}}function d(e,t,r,n){for(var i=0;i<=12;i++)if(!(e[i].pos<=0)){n.WriteByte(i+(0==i?128:0)),e[i]=e[i].buf.slice(0,e[i].pos);var a=g(e[i],r);n.WriteUint7(a.length),n.WriteData(a,a.length)}}function g(e,t){var r,n=1<<30,a=[0,1,64,65,128,129,201];for(var A in a){var o=a[A];if(!(1&o&&e.length<100||8&o&&e.length%4!=0)){try{var h=t?s.encode(e,o):i.encode(e,o)}catch(e){h=0}h&&n>h.length&&(n=h.length,r=h)}}return r}function f(e,t,r,n,i){var a=0,s=i-1;e[i]=new Array(256),t[n]?e[i][0]={type:5,val:i-t[n]}:e[i][0]={type:6,val:0==i?0:1},t[n]=i;for(var A=n.match(/([a-zA-Z0-9]{1,9})|([^a-zA-Z0-9]+)/g),o=0;o<A.length;o++){var h=o+1,d=1,g=A[o];if(A[o].match(/^0+[0-9]*$/g)?d=3:A[o].match(/^[0-9]+$/g)?d=7:1==A[o].length&&(d=2),s>=0&&e[s][h])if(e[s][h].str==A[o])d=10,g="";else if(7==e[s][h].type||8==e[s][h].type){var f=g-e[s][h].str;r[h]++,f>=0&&f<256&&r[h]>i/2&&(d=8,g=f)}else 3!=e[s][h].type&&9!=e[s][h].type||e[s][h].str.length!=g.length||(f=g-e[s][h].str,r[h]++,f>=0&&f<256&&r[h]>i/2&&(d=9,g=f));e[i][h]={str:A[o],val:g,type:d},a<e[i][h].val.length+3&&(a=e[i][h].val.length+3)}return e[i][++h]={type:12},[h+1,a]}e.exports={encode:function(e,t){var r=e.toString();"\n"==r[r.length-1]&&(r=r.substring(0,r.length-1));var i=r.split("\n"),a=new n("",0,2*r.length+1e4);a.WriteUint32(r.length),a.WriteUint32(i.length),a.WriteByte(t);for(var s=new Array(i.length),A={},o=new Array(256).fill(0),g=0,c=0,l=0;l<i.length;l++){var[u,I]=f(s,A,o,i[l],l);g<u&&(g=u),c<I&&(c=I)}for(var C=0;C<g;C++){for(var m=new Array(13),B=0;B<=12;B++)m[B]=new n("",0,i.length*c);h(m,s,C,i),d(m,0,t,a)}return a.buf.slice(0,a.pos)},decode:function(e,t,r){(e=new n(e)).ReadUint32();var A=e.ReadUint32(),h=e.ReadByte(),d=function(e,t,r,A){for(var o=-1,h=new Array(256);!e.EOF();){var d=e.ReadByte(),g=128&d,f=64&d,c=63&d;if(g&&(h[++o]=new Array(13)),0!=c&&g){var l=new Array(A-1).fill(10);h[o][0]=new n(a([new Uint8Array(c),l]))}if(f){var u=e.ReadByte(),I=e.ReadByte();h[o][c]=new n(h[u][I].buf)}else{var C=e.ReadUint7(),m=e.ReadData(C);h[o][c]=r?s.decode(m):i.decode(m),h[o][c]=new n(h[o][c])}}return h}(e,0,h,A),g=new Array(A),f=new Array(A),c="";void 0===r&&(r="\n");for(var l=0;l<A;l++)c+=o(d,g,f,l)+r;return c}}},7806:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedCramFile=t.CraiIndex=t.CramFile=t.CramRecord=void 0;var i=r(7390);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return i.CramRecord}}),Object.defineProperty(t,"CramFile",{enumerable:!0,get:function(){return n(i).default}});var a=r(4923);Object.defineProperty(t,"CraiIndex",{enumerable:!0,get:function(){return n(a).default}});var s=r(6014);Object.defineProperty(t,"IndexedCramFile",{enumerable:!0,get:function(){return n(s).default}})},6014:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(7390)),a=r(9747);t.default=class{constructor(e){if(this.cram=e.cram??new i.default({url:e.cramUrl,path:e.cramPath,filehandle:e.cramFilehandle,seqFetch:e.seqFetch,checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize}),!(this.cram instanceof i.default))throw new Error("invalid arguments: no cramfile");this.index=e.index}async getRecordsForRange(e,t,r,n={}){if(n.viewAsPairs=n.viewAsPairs||!1,n.pairAcrossChr=n.pairAcrossChr||!1,n.maxInsertSize=n.maxInsertSize||2e5,"string"==typeof e)throw new a.CramUnimplementedError("string sequence names not yet supported");const i=e,s=await this.index.getEntriesForRange(i,t,r),A=n=>n.sequenceId===e&&n.alignmentStart<=r&&void 0!==n.lengthOnRef&&n.alignmentStart+n.lengthOnRef-1>=t,o=await Promise.all(s.map((e=>this.getRecordsInSlice(e,A))));let h=Array.prototype.concat(...o);if(n.viewAsPairs){const e={},t={};for(const r of h){const n=r.readName;if(void 0===n)throw new Error("readName undefined");const i=r.uniqueId;e[n]||(e[n]=0),e[n]+=1,t[i]=1}const r={};Object.entries(e).forEach((([e,t])=>{1===t&&(r[e]=!0)}));const a=[];for(const e of h){const t=e.readName;if(void 0===t)throw new Error("readName undefined");if(r[t]&&e.mate&&(e.mate.sequenceId===i||n.pairAcrossChr)&&Math.abs(e.alignmentStart-e.mate.alignmentStart)<n.maxInsertSize){const t=this.index.getEntriesForRange(e.mate.sequenceId,e.mate.alignmentStart,e.mate.alignmentStart+1);a.push(t)}}const s=await Promise.all(a);let A=[];for(const e of s)A.push(...e);A=A.sort(((e,t)=>e.toString().localeCompare(t.toString()))).filter(((e,t,r)=>!t||e.toString()!==r[t-1].toString()));const o=[],d=[];for(const e of A){let n=this.cram.featureCache.get(e.toString());n||(n=this.getRecordsInSlice(e,(()=>!0)),this.cram.featureCache.set(e.toString(),n)),o.push(n);const i=n.then((e=>{const n=[];for(const i of e){if(void 0===i.readName)throw new Error("readName undefined");r[i.readName]&&!t[i.uniqueId]&&n.push(i)}return n}));d.push(i)}const g=await Promise.all(d);if(g.length){const e=g.reduce(((e,t)=>e.concat(t)));h=h.concat(e)}}return h}getRecordsInSlice({containerStart:e,sliceStart:t,sliceBytes:r},n){return this.cram.getContainerAtPosition(e).getSlice(t,r).getRecords(n)}hasDataForReferenceSequence(e){return this.index.hasDataForReferenceSequence(e)}}},5931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteFile=t.LocalFile=void 0,t.open=function(e,t,r){if(r)return r;if(e)return new n.RemoteFile(e);if(t)return new n.LocalFile(t);throw new Error("no url, path, or filehandle provided, cannot open")};const n=r(1226);var i=r(1226);Object.defineProperty(t,"LocalFile",{enumerable:!0,get:function(){return i.LocalFile}}),Object.defineProperty(t,"RemoteFile",{enumerable:!0,get:function(){return i.RemoteFile}})},6476:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOTFREQ=t.TF_SHIFT=t.RANS_BYTE_L=void 0,t.TF_SHIFT=12,t.TOTFREQ=4096,t.RANS_BYTE_L=1<<23},997:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){let A=e.getInt(),o=e.getInt(),h=e.getInt(),d=e.getInt();const g=n.remaining(),f=-4&g;for(let i=0;i<f;i+=4){const g=t.R[s.default.get(A,a.TF_SHIFT)],f=t.R[s.default.get(o,a.TF_SHIFT)],c=t.R[s.default.get(h,a.TF_SHIFT)],l=t.R[s.default.get(d,a.TF_SHIFT)];n.putAt(i,g),n.putAt(i+1,f),n.putAt(i+2,c),n.putAt(i+3,l),A=s.default.advanceSymbolStep(A,r[255&g],a.TF_SHIFT),o=s.default.advanceSymbolStep(o,r[255&f],a.TF_SHIFT),h=s.default.advanceSymbolStep(h,r[255&c],a.TF_SHIFT),d=s.default.advanceSymbolStep(d,r[255&l],a.TF_SHIFT),A=s.default.renormalize(A,e),o=s.default.renormalize(o,e),h=s.default.renormalize(h,e),d=s.default.renormalize(d,e)}let c;switch(n.setPosition(f),3&g){case 0:break;case 1:c=t.R[s.default.get(A,a.TF_SHIFT)],s.default.advanceSymbol(A,e,r[255&c],a.TF_SHIFT),n.put(c);break;case 2:c=t.R[s.default.get(A,a.TF_SHIFT)],s.default.advanceSymbol(A,e,r[255&c],a.TF_SHIFT),n.put(c),c=t.R[s.default.get(o,a.TF_SHIFT)],s.default.advanceSymbol(o,e,r[255&c],a.TF_SHIFT),n.put(c);break;case 3:c=t.R[s.default.get(A,a.TF_SHIFT)],s.default.advanceSymbol(A,e,r[255&c],a.TF_SHIFT),n.put(c),c=t.R[s.default.get(o,a.TF_SHIFT)],s.default.advanceSymbol(o,e,r[255&c],a.TF_SHIFT),n.put(c),c=t.R[s.default.get(h,a.TF_SHIFT)],s.default.advanceSymbol(h,e,r[255&c],a.TF_SHIFT),n.put(c);break;default:throw new i.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)};const i=r(9747),a=r(6476),s=n(r(488))},7960:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){const s=t.remaining();let A=e.getInt(),o=e.getInt(),h=e.getInt(),d=e.getInt();const g=s>>2;let f=0,c=g,l=2*g,u=3*g,I=0,C=0,m=0,B=0;for(;f<g;f+=1,c+=1,l+=1,u+=1){const s=255&r[I].R[a.default.get(A,i.TF_SHIFT)],g=255&r[C].R[a.default.get(o,i.TF_SHIFT)],p=255&r[m].R[a.default.get(h,i.TF_SHIFT)],w=255&r[B].R[a.default.get(d,i.TF_SHIFT)];t.putAt(f,s),t.putAt(c,g),t.putAt(l,p),t.putAt(u,w),A=a.default.advanceSymbolStep(A,n[I][s],i.TF_SHIFT),o=a.default.advanceSymbolStep(o,n[C][g],i.TF_SHIFT),h=a.default.advanceSymbolStep(h,n[m][p],i.TF_SHIFT),d=a.default.advanceSymbolStep(d,n[B][w],i.TF_SHIFT),A=a.default.renormalize(A,e),o=a.default.renormalize(o,e),h=a.default.renormalize(h,e),d=a.default.renormalize(d,e),I=s,C=g,m=p,B=w}for(;u<s;u+=1){const s=255&r[B].R[a.default.get(d,i.TF_SHIFT)];t.putAt(u,s),d=a.default.advanceSymbol(d,e,n[B][s],i.TF_SHIFT),B=s}};const i=r(6476),a=n(r(488))},488:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9747),i=r(6476);class a{constructor(){this.F=void 0,this.C=void 0}}function s(e,t,r,n){return r*(e>>n)+(e&(1<<n)-1)-t}t.default={FC:a,AriDecoder:class{constructor(){this.fc=new Array(256);for(let e=0;e<this.fc.length;e+=1)this.fc[e]=new a;this.R=null}},DecodingSymbol:class{constructor(){this.start=void 0,this.freq=void 0}},symbolInit:function(e,t,r){if(!(t<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(r<=65536-t))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");e.start=t,e.freq=r},advanceStep:s,advanceSymbolStep:function(e,t,r){return s(e,t.start,t.freq,r)},get:function(e,t){return e&(1<<t)-1},advanceSymbol:function(e,t,r,n){return function(e,t,r,n,a){if((e=n*(e>>a)+(e&(1<<a)-1)-r)<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}(e,t,r.start,r.freq,n)},renormalize:function(e,t){if(e<i.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<i.RANS_BYTE_L);return e}}},1971:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.readStatsO0=function(e,t,r){let n=0,i=0,o=255&e.get();do{null==t.fc[o]&&(t.fc[o]=new s.default.FC),t.fc[o].F=255&e.get(),t.fc[o].F>=128&&(t.fc[o].F&=-129,t.fc[o].F=(127&t.fc[o].F)<<8|255&e.get()),t.fc[o].C=i,s.default.symbolInit(r[o],t.fc[o].C,t.fc[o].F),t.R||(t.R=new Array(a.TOTFREQ)),t.R.fill(o,i,i+t.fc[o].F),i+=t.fc[o].F,0===n&&o+1===(255&e.getByteAt(e.position()))?(o=255&e.get(),n=255&e.get()):0!==n?(n-=1,o+=1):o=255&e.get()}while(0!==o);A(i<a.TOTFREQ)},t.readStatsO1=function(e,t,r){let n=0,i=255&e.get();do{let o=0,h=0,d=255&e.get();null==t[i]&&(t[i]=new s.default.AriDecoder);do{null==t[i].fc[d]&&(t[i].fc[d]=new s.default.FC),t[i].fc[d].F=255&e.get(),t[i].fc[d].F>=128&&(t[i].fc[d].F&=-129,t[i].fc[d].F=(127&t[i].fc[d].F)<<8|255&e.get()),t[i].fc[d].C=h,0===t[i].fc[d].F&&(t[i].fc[d].F=a.TOTFREQ),null==r[i][d]&&(r[i][d]=new s.default.RansDecSymbol),s.default.symbolInit(r[i][d],t[i].fc[d].C,t[i].fc[d].F),null==t[i].R&&(t[i].R=new Array(a.TOTFREQ)),t[i].R.fill(d,h,h+t[i].fc[d].F),h+=t[i].fc[d].F,A(h<=a.TOTFREQ),0===o&&d+1===(255&e.getByteAt(e.position()))?(d=255&e.get(),o=255&e.get()):0!==o?(o-=1,d+=1):d=255&e.get()}while(0!==d);0===n&&i+1===(255&e.getByteAt(e.position()))?(i=255&e.get(),n=255&e.get()):0!==n?(n-=1,i+=1):i=255&e.get()}while(0!==i)};const i=r(9747),a=r(6476),s=n(r(488));function A(e){if(!e)throw new i.CramMalformedError("assertion failed")}},9989:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r=0){if(0===e.length)return t.fill(0),t;const n=new d(e,r),g=n.get();if(0!==g&&1!==g)throw new i.CramMalformedError(`Invalid rANS order ${g}`);if(n.getInt()!==n.remaining()-h)throw new i.CramMalformedError("Incorrect input length.");const f=n.getInt(),c=new d(t||new Uint8Array(f));if(c.length<f)throw new i.CramMalformedError(`Output buffer too small to fit ${f} bytes.`);switch(g){case 0:return function(e,t){const r=new A.default.AriDecoder,n=new Array(256);for(let e=0;e<n.length;e+=1)n[e]=new A.default.DecodingSymbol;return(0,o.readStatsO0)(e,r,n),(0,a.default)(e,r,n,t),t}(n,c);case 1:return function(e,t){const r=new Array(256);for(let e=0;e<r.length;e+=1)r[e]=new A.default.AriDecoder;const n=new Array(256);for(let e=0;e<n.length;e+=1){n[e]=new Array(256);for(let t=0;t<n[e].length;t+=1)n[e][t]=new A.default.DecodingSymbol}return(0,o.readStatsO1)(e,r,n),(0,s.default)(e,t,r,n),t}(n,c);default:throw new i.CramMalformedError(`Invalid rANS order: ${g}`)}};const i=r(9747),a=n(r(997)),s=n(r(7960)),A=n(r(488)),o=r(1971),h=4;class d{constructor(e,t=0){this._buffer=e,this._dataView=new DataView(e.buffer),this._position=t,this.length=e.length}get(){const e=this._buffer[this._position];return this._position+=1,e}getByte(){return this.get()}getByteAt(e){return this._buffer[e]}position(){return this._position}put(e){return this._buffer[this._position]=e,this._position+=1,e}putAt(e,t){return this._buffer[e]=t,t}setPosition(e){return this._position=e,e}getInt(){const e=this._dataView.getInt32(this._position,!0);return this._position+=4,e}remaining(){return this._buffer.length-this._position}}},5417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseHeaderText=function(e){const t=e.split(/\r?\n/),r=[];for(const e of t){const[t,...n]=e.split(/\t/);t&&r.push({tag:t.slice(1),data:n.map((e=>{const t=e.indexOf(":");return-1!==t?{tag:e.slice(0,t),value:e.slice(t+1)}:{tag:e,value:""}}))})}return r}},8876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unzip=function(e){return(0,n.inflate)(e)};const n=r(1668)},235:e=>{var t={array:function(e){var t=0,r=0,n=[0,1,3,7,15,31,63,127,255];return function(i){for(var a=0;i>0;){var s=8-t;i>=s?(a<<=s,a|=n[s]&e[r++],t=0,i-=s):(a<<=i,a|=(e[r]&n[i]<<8-i-t)>>8-i-t,t+=i,i=0)}return a}},simple:function(e){var r,n,i=t.header(e),a=[],s=0;do{-1!=(n=t.decompress(e,i))&&(a.push(n),s+=n.byteLength)}while(-1!=n);r=new Uint8Array(s),s=0;for(var A=0;A<a.length;++A)n=a[A],r.set(n,s),s+=n.byteLength;return r},header:function(e){if(4348520!=e(24))throw"No magic number found";var t=e(8)-48;if(t<1||t>9)throw"Not a BZIP archive";return t},decompress:function(e,t,r){for(var n=9e5,i="",a=0;a<6;a++)i+=e(8).toString(16);if("177245385090"==i)return-1;if("314159265359"!=i)throw"eek not valid bzip data";if(e(32),e(1))throw"unsupported obsolete version";var s=e(24);if(s>n)throw"Initial position larger than buffer size";var A=e(16),o=new Uint8Array(256),h=0;for(a=0;a<16;a++)if(A&1<<15-a){var d=e(16);for(u=0;u<16;u++)d&1<<15-u&&(o[h++]=16*a+u)}var g=e(3);if(g<2||g>6)throw"another error";var f=e(15);if(0==f)throw"meh";var c=[];for(a=0;a<g;a++)c[a]=a;var l=new Uint8Array(32768);for(a=0;a<f;a++){for(var u=0;e(1);u++)if(u>=g)throw"whoops another error";var I=c[u];c.splice(u,1),c.splice(0,0,I),l[a]=I}var C=h+2,m=[];for(u=0;u<g;u++){var B,p,w,_=new Uint8Array(258),E=new Uint8Array(21);for(A=e(5),a=0;a<C;a++){for(;;){if(A<1||A>20)throw"I gave up a while ago on writing error messages";if(!e(1))break;e(1)?A--:A++}_[a]=A}for(B=p=_[0],a=1;a<C;a++)_[a]>p?p=_[a]:_[a]<B&&(B=_[a]);(w=m[u]={}).permute=new Uint32Array(258),w.limit=new Uint32Array(21),w.base=new Uint32Array(21),w.minLen=B,w.maxLen=p;var Q=w.base.subarray(1),y=w.limit.subarray(1),b=0;for(a=B;a<=p;a++)for(A=0;A<C;A++)_[A]==a&&(w.permute[b++]=A);for(a=B;a<=p;a++)E[a]=y[a]=0;for(a=0;a<C;a++)E[_[a]]++;for(b=A=0,a=B;a<p;a++)b+=E[a],y[a]=b-1,b<<=1,Q[a+1]=b-(A+=E[a]);y[p]=b+E[p]-1,Q[B]=0}var v,S,k,D=new Uint32Array(256);for(a=0;a<256;a++)c[a]=a;v=S=C=k=0;for(var R=new Uint32Array(n);;){if(!C--){if(C=49,k>=f)throw"meow i'm a kitty, that's an error";Q=(w=m[l[k++]]).base.subarray(1),y=w.limit.subarray(1)}for(u=e(a=w.minLen);;){if(a>w.maxLen)throw"rawr i'm a dinosaur";if(u<=y[a])break;a++,u=u<<1|e(1)}if((u-=Q[a])<0||u>=258)throw"moo i'm a cow";var F=w.permute[u];if(0!=F&&1!=F){if(v){if(v=0,S+A>=n)throw"Boom.";for(D[I=o[c[0]]]+=A;A--;)R[S++]=I}if(F>h)break;if(S>=n)throw"I can't think of anything. Error";I=c[a=F-1],c.splice(a,1),c.splice(0,0,I),D[I=o[I]]++,R[S++]=I}else v||(v=1,A=0),A+=0==F?v:2*v,v<<=1}if(s<0||s>=S)throw"I'm a monkey and I'm throwing something at someone, namely you";for(u=0,a=0;a<256;a++)d=u+D[a],D[a]=u,u=d;for(a=0;a<S;a++)R[D[I=255&R[a]]]|=a<<8,D[I]++;var N=0,M=0,x=0;S&&(M=255&(N=R[s]),N>>=8,x=-1);var L,q,U,T=new Uint8Array(n),z=0;for(r||(r=1/0);S;){for(S--,q=M,M=255&(N=R[N]),N>>=8,3==x++?(L=M,U=q,M=-1):(L=1,U=M);L--;)if(T[z++]=U,! --r)return T;M!=q&&(x=0)}return T.subarray(0,z)}};e.exports=t},2151:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=t},3939:e=>{var t,r;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var r=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],a=0;a<4;a++)8*n+6*a<=8*e.length?r.push(t.charAt(i>>>6*(3-a)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var r=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&r.push((t.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(n))>>>6-2*i);return r}},e.exports=r},8570:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function s(e,t){var r,n,s;return t?(s=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=o(e,(0|e)<0?-1:0,!0),s&&(a[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=o(e,e<0?-1:0,!1),s&&(i[e]=r),r)}function A(e,t){if(isNaN(e))return t?C:I;if(t){if(e<0)return C;if(e>=c)return _}else{if(e<=-l)return E;if(e+1>=l)return w}return e<0?A(-e,t).neg():o(e%f|0,e/f|0,t)}function o(e,t,n){return new r(e,t,n)}r.fromInt=s,r.fromNumber=A,r.fromBits=o;var h=Math.pow;function d(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return I;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return d(e.substring(1),t,r).neg();for(var i=A(h(r,8)),a=I,s=0;s<e.length;s+=8){var o=Math.min(8,e.length-s),g=parseInt(e.substring(s,s+o),r);if(o<8){var f=A(h(r,o));a=a.mul(f).add(A(g))}else a=(a=a.mul(i)).add(A(g))}return a.unsigned=t,a}function g(e,t){return"number"==typeof e?A(e,t):"string"==typeof e?d(e,t):o(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=d,r.fromValue=g;var f=4294967296,c=f*f,l=c/2,u=s(1<<24),I=s(0);r.ZERO=I;var C=s(0,!0);r.UZERO=C;var m=s(1);r.ONE=m;var B=s(1,!0);r.UONE=B;var p=s(-1);r.NEG_ONE=p;var w=o(-1,2147483647,!1);r.MAX_VALUE=w;var _=o(-1,-1,!0);r.MAX_UNSIGNED_VALUE=_;var E=o(0,-2147483648,!1);r.MIN_VALUE=E;var Q=r.prototype;Q.toInt=function(){return this.unsigned?this.low>>>0:this.low},Q.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},Q.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var t=A(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=A(h(e,6),this.unsigned),a=this,s="";;){var o=a.div(i),d=(a.sub(o.mul(i)).toInt()>>>0).toString(e);if((a=o).isZero())return d+s;for(;d.length<6;)d="0"+d;s=""+d+s}},Q.getHighBits=function(){return this.high},Q.getHighBitsUnsigned=function(){return this.high>>>0},Q.getLowBits=function(){return this.low},Q.getLowBitsUnsigned=function(){return this.low>>>0},Q.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},Q.isZero=function(){return 0===this.high&&0===this.low},Q.eqz=Q.isZero,Q.isNegative=function(){return!this.unsigned&&this.high<0},Q.isPositive=function(){return this.unsigned||this.high>=0},Q.isOdd=function(){return!(1&~this.low)},Q.isEven=function(){return!(1&this.low)},Q.equals=function(e){return n(e)||(e=g(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},Q.eq=Q.equals,Q.notEquals=function(e){return!this.eq(e)},Q.neq=Q.notEquals,Q.ne=Q.notEquals,Q.lessThan=function(e){return this.comp(e)<0},Q.lt=Q.lessThan,Q.lessThanOrEqual=function(e){return this.comp(e)<=0},Q.lte=Q.lessThanOrEqual,Q.le=Q.lessThanOrEqual,Q.greaterThan=function(e){return this.comp(e)>0},Q.gt=Q.greaterThan,Q.greaterThanOrEqual=function(e){return this.comp(e)>=0},Q.gte=Q.greaterThanOrEqual,Q.ge=Q.greaterThanOrEqual,Q.compare=function(e){if(n(e)||(e=g(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},Q.comp=Q.compare,Q.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(m)},Q.neg=Q.negate,Q.add=function(e){n(e)||(e=g(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,s=e.high>>>16,A=65535&e.high,h=e.low>>>16,d=0,f=0,c=0,l=0;return c+=(l+=a+(65535&e.low))>>>16,f+=(c+=i+h)>>>16,d+=(f+=r+A)>>>16,d+=t+s,o((c&=65535)<<16|(l&=65535),(d&=65535)<<16|(f&=65535),this.unsigned)},Q.subtract=function(e){return n(e)||(e=g(e)),this.add(e.neg())},Q.sub=Q.subtract,Q.multiply=function(e){if(this.isZero())return I;if(n(e)||(e=g(e)),t)return o(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return I;if(this.eq(E))return e.isOdd()?E:I;if(e.eq(E))return this.isOdd()?E:I;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(u)&&e.lt(u))return A(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,s=65535&this.low,h=e.high>>>16,d=65535&e.high,f=e.low>>>16,c=65535&e.low,l=0,C=0,m=0,B=0;return m+=(B+=s*c)>>>16,C+=(m+=a*c)>>>16,m&=65535,C+=(m+=s*f)>>>16,l+=(C+=i*c)>>>16,C&=65535,l+=(C+=a*f)>>>16,C&=65535,l+=(C+=s*d)>>>16,l+=r*c+i*f+a*d+s*h,o((m&=65535)<<16|(B&=65535),(l&=65535)<<16|(C&=65535),this.unsigned)},Q.mul=Q.multiply,Q.divide=function(e){if(n(e)||(e=g(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?o((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?C:I;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return C;if(e.gt(this.shru(1)))return B;a=C}else{if(this.eq(E))return e.eq(m)||e.eq(p)?E:e.eq(E)?m:(r=this.shr(1).div(e).shl(1)).eq(I)?e.isNegative()?m:p:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(E))return this.unsigned?C:I;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=I}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),d=s<=48?1:h(2,s-48),f=A(r),c=f.mul(e);c.isNegative()||c.gt(i);)c=(f=A(r-=d,this.unsigned)).mul(e);f.isZero()&&(f=m),a=a.add(f),i=i.sub(c)}return a},Q.div=Q.divide,Q.modulo=function(e){return n(e)||(e=g(e)),t?o((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},Q.mod=Q.modulo,Q.rem=Q.modulo,Q.not=function(){return o(~this.low,~this.high,this.unsigned)},Q.and=function(e){return n(e)||(e=g(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},Q.or=function(e){return n(e)||(e=g(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},Q.xor=function(e){return n(e)||(e=g(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},Q.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},Q.shl=Q.shiftLeft,Q.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},Q.shr=Q.shiftRight,Q.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?o(this.low>>>e|t<<32-e,t>>>e,this.unsigned):o(32===e?t:t>>>e-32,0,this.unsigned)},Q.shru=Q.shiftRightUnsigned,Q.shr_u=Q.shiftRightUnsigned,Q.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},Q.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},Q.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},Q.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},Q.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3503:(e,t,r)=>{var n,i,a,s,A;n=r(3939),i=r(2151).utf8,a=r(652),s=r(2151).bin,(A=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?s.stringToBytes(e):i.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=n.bytesToWords(e),o=8*e.length,h=1732584193,d=-271733879,g=-1732584194,f=271733878,c=0;c<r.length;c++)r[c]=16711935&(r[c]<<8|r[c]>>>24)|4278255360&(r[c]<<24|r[c]>>>8);r[o>>>5]|=128<<o%32,r[14+(o+64>>>9<<4)]=o;var l=A._ff,u=A._gg,I=A._hh,C=A._ii;for(c=0;c<r.length;c+=16){var m=h,B=d,p=g,w=f;h=l(h,d,g,f,r[c+0],7,-680876936),f=l(f,h,d,g,r[c+1],12,-389564586),g=l(g,f,h,d,r[c+2],17,606105819),d=l(d,g,f,h,r[c+3],22,-1044525330),h=l(h,d,g,f,r[c+4],7,-176418897),f=l(f,h,d,g,r[c+5],12,1200080426),g=l(g,f,h,d,r[c+6],17,-1473231341),d=l(d,g,f,h,r[c+7],22,-45705983),h=l(h,d,g,f,r[c+8],7,1770035416),f=l(f,h,d,g,r[c+9],12,-1958414417),g=l(g,f,h,d,r[c+10],17,-42063),d=l(d,g,f,h,r[c+11],22,-1990404162),h=l(h,d,g,f,r[c+12],7,1804603682),f=l(f,h,d,g,r[c+13],12,-40341101),g=l(g,f,h,d,r[c+14],17,-1502002290),h=u(h,d=l(d,g,f,h,r[c+15],22,1236535329),g,f,r[c+1],5,-165796510),f=u(f,h,d,g,r[c+6],9,-1069501632),g=u(g,f,h,d,r[c+11],14,643717713),d=u(d,g,f,h,r[c+0],20,-373897302),h=u(h,d,g,f,r[c+5],5,-701558691),f=u(f,h,d,g,r[c+10],9,38016083),g=u(g,f,h,d,r[c+15],14,-660478335),d=u(d,g,f,h,r[c+4],20,-405537848),h=u(h,d,g,f,r[c+9],5,568446438),f=u(f,h,d,g,r[c+14],9,-1019803690),g=u(g,f,h,d,r[c+3],14,-187363961),d=u(d,g,f,h,r[c+8],20,1163531501),h=u(h,d,g,f,r[c+13],5,-1444681467),f=u(f,h,d,g,r[c+2],9,-51403784),g=u(g,f,h,d,r[c+7],14,1735328473),h=I(h,d=u(d,g,f,h,r[c+12],20,-1926607734),g,f,r[c+5],4,-378558),f=I(f,h,d,g,r[c+8],11,-2022574463),g=I(g,f,h,d,r[c+11],16,1839030562),d=I(d,g,f,h,r[c+14],23,-35309556),h=I(h,d,g,f,r[c+1],4,-1530992060),f=I(f,h,d,g,r[c+4],11,1272893353),g=I(g,f,h,d,r[c+7],16,-155497632),d=I(d,g,f,h,r[c+10],23,-1094730640),h=I(h,d,g,f,r[c+13],4,681279174),f=I(f,h,d,g,r[c+0],11,-358537222),g=I(g,f,h,d,r[c+3],16,-722521979),d=I(d,g,f,h,r[c+6],23,76029189),h=I(h,d,g,f,r[c+9],4,-640364487),f=I(f,h,d,g,r[c+12],11,-421815835),g=I(g,f,h,d,r[c+15],16,530742520),h=C(h,d=I(d,g,f,h,r[c+2],23,-995338651),g,f,r[c+0],6,-198630844),f=C(f,h,d,g,r[c+7],10,1126891415),g=C(g,f,h,d,r[c+14],15,-1416354905),d=C(d,g,f,h,r[c+5],21,-57434055),h=C(h,d,g,f,r[c+12],6,1700485571),f=C(f,h,d,g,r[c+3],10,-1894986606),g=C(g,f,h,d,r[c+10],15,-1051523),d=C(d,g,f,h,r[c+1],21,-2054922799),h=C(h,d,g,f,r[c+8],6,1873313359),f=C(f,h,d,g,r[c+15],10,-30611744),g=C(g,f,h,d,r[c+6],15,-1560198380),d=C(d,g,f,h,r[c+13],21,1309151649),h=C(h,d,g,f,r[c+4],6,-145523070),f=C(f,h,d,g,r[c+11],10,-1120210379),g=C(g,f,h,d,r[c+2],15,718787259),d=C(d,g,f,h,r[c+9],21,-343485551),h=h+m>>>0,d=d+B>>>0,g=g+p>>>0,f=f+w>>>0}return n.endian([h,d,g,f])})._ff=function(e,t,r,n,i,a,s){var A=e+(t&r|~t&n)+(i>>>0)+s;return(A<<a|A>>>32-a)+t},A._gg=function(e,t,r,n,i,a,s){var A=e+(t&n|r&~n)+(i>>>0)+s;return(A<<a|A>>>32-a)+t},A._hh=function(e,t,r,n,i,a,s){var A=e+(t^r^n)+(i>>>0)+s;return(A<<a|A>>>32-a)+t},A._ii=function(e,t,r,n,i,a,s){var A=e+(r^(t|~n))+(i>>>0)+s;return(A<<a|A>>>32-a)+t},A._blocksize=16,A._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=n.wordsToBytes(A(e,t));return t&&t.asBytes?r:t&&t.asString?s.bytesToString(r):n.bytesToHex(r)}},652:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},1668:(e,t,r)=>{"use strict";var n={};(0,r(9805).assign)(n,r(3303),r(7083),r(9681)),e.exports=n},3303:(e,t,r)=>{"use strict";var n=r(8411),i=r(9805),a=r(1996),s=r(4674),A=r(4442),o=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(s[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var d;if(d="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===o.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,d)))throw new Error(s[r]);this._dict_set=!0}}function d(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}h.prototype.push=function(e,t){var r,s,A=this.strm,h=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?A.input=a.string2buf(e):"[object ArrayBuffer]"===o.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;do{if(0===A.avail_out&&(A.output=new i.Buf8(h),A.next_out=0,A.avail_out=h),1!==(r=n.deflate(A,s))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==A.avail_out&&(0!==A.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(A.output,A.next_out))):this.onData(i.shrinkBuf(A.output,A.next_out)))}while((A.avail_in>0||0===A.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==s||(this.onEnd(0),A.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=d,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},7083:(e,t,r)=>{"use strict";var n=r(1447),i=r(9805),a=r(1996),s=r(9681),A=r(4674),o=r(4442),h=r(7414),d=Object.prototype.toString;function g(e){if(!(this instanceof g))return new g(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==s.Z_OK)throw new Error(A[r]);if(this.header=new h,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(A[r])}function f(e,t){var r=new g(t);if(r.push(e,!0),r.err)throw r.msg||A[r.err];return r.result}g.prototype.push=function(e,t){var r,A,o,h,g,f=this.strm,c=this.options.chunkSize,l=this.options.dictionary,u=!1;if(this.ended)return!1;A=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?f.input=a.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(c),f.next_out=0,f.avail_out=c),(r=n.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&l&&(r=n.inflateSetDictionary(this.strm,l)),r===s.Z_BUF_ERROR&&!0===u&&(r=s.Z_OK,u=!1),r!==s.Z_STREAM_END&&r!==s.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&r!==s.Z_STREAM_END&&(0!==f.avail_in||A!==s.Z_FINISH&&A!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(o=a.utf8border(f.output,f.next_out),h=f.next_out-o,g=a.buf2string(f.output,o),f.next_out=h,f.avail_out=c-h,h&&i.arraySet(f.output,f.output,o,h,0),this.onData(g)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(u=!0)}while((f.avail_in>0||0===f.avail_out)&&r!==s.Z_STREAM_END);return r===s.Z_STREAM_END&&(A=s.Z_FINISH),A===s.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===s.Z_OK):A!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},g.prototype.onData=function(e){this.chunks.push(e)},g.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=g,t.inflate=f,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},t.ungzip=f},9805:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],s.set(a,i),i+=a.length;return s}},a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(r)},1996:(e,t,r)=>{"use strict";var n=r(9805),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new n.Buf8(256),A=0;A<256;A++)s[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;function o(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",s=0;s<t;s++)r+=String.fromCharCode(e[s]);return r}s[254]=s[254]=1,t.string2buf=function(e){var t,r,i,a,s,A=e.length,o=0;for(a=0;a<A;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<A&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(o),s=0,a=0;s<o;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<A&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|63&r):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|63&r):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|63&r);return t},t.buf2binstring=function(e){return o(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,a,A=t||e.length,h=new Array(2*A);for(n=0,r=0;r<A;)if((i=e[r++])<128)h[n++]=i;else if((a=s[i])>4)h[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r<A;)i=i<<6|63&e[r++],a--;a>1?h[n++]=65533:i<65536?h[n++]=i:(i-=65536,h[n++]=55296|i>>10&1023,h[n++]=56320|1023&i)}return o(h,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},3269:e=>{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e,a=e>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--s);i%=65521,a%=65521}return i|a<<16}},9681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,s=i+n;e^=-1;for(var A=i;A<s;A++)e=e>>>8^a[255&(e^r[A])];return~e}},8411:(e,t,r)=>{"use strict";var n,i=r(9805),a=r(3665),s=r(3269),A=r(4823),o=r(4674),h=-2,d=258,g=262,f=103,c=113,l=666;function u(e,t){return e.msg=o[t],t}function I(e){return(e<<1)-(e>4?9:0)}function C(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function B(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function w(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _(e,t,r,n){var a=e.avail_in;return a>n&&(a=n),0===a?0:(e.avail_in-=a,i.arraySet(t,e.input,e.next_in,a,r),1===e.state.wrap?e.adler=s(e.adler,t,a,r):2===e.state.wrap&&(e.adler=A(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)}function E(e,t){var r,n,i=e.max_chain_length,a=e.strstart,s=e.prev_length,A=e.nice_match,o=e.strstart>e.w_size-g?e.strstart-(e.w_size-g):0,h=e.window,f=e.w_mask,c=e.prev,l=e.strstart+d,u=h[a+s-1],I=h[a+s];e.prev_length>=e.good_match&&(i>>=2),A>e.lookahead&&(A=e.lookahead);do{if(h[(r=t)+s]===I&&h[r+s-1]===u&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&a<l);if(n=d-(l-a),a=l-d,n>s){if(e.match_start=t,s=n,n>=A)break;u=h[a+s-1],I=h[a+s]}}}while((t=c[t&f])>o&&0!=--i);return s<=e.lookahead?s:e.lookahead}function Q(e){var t,r,n,a,s,A=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=A+(A-g)){i.arraySet(e.window,e.window,A,A,0),e.match_start-=A,e.strstart-=A,e.block_start-=A,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=A?n-A:0}while(--r);t=r=A;do{n=e.prev[--t],e.prev[t]=n>=A?n-A:0}while(--r);a+=A}if(0===e.strm.avail_in)break;if(r=_(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+3-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<g&&0!==e.strm.avail_in)}function y(e,t){for(var r,n;;){if(e.lookahead<g){if(Q(e),e.lookahead<g&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-g&&(e.match_length=E(e,r)),e.match_length>=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(B(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(B(e,!1),0===e.strm.avail_out)?1:2}function b(e,t){for(var r,n,i;;){if(e.lookahead<g){if(Q(e),e.lookahead<g&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-g&&(e.match_length=E(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(B(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=a._tr_tally(e,0,e.window[e.strstart-1]))&&B(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(B(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(B(e,!1),0===e.strm.avail_out)?1:2}function v(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),C(this.dyn_ltree),C(this.dyn_dtree),C(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),C(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),C(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function k(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:c,e.adler=2===t.wrap?0:1,t.last_flush=0,a._tr_init(t),0):u(e,h)}function D(e){var t,r=k(e);return 0===r&&((t=e.state).window_size=2*t.w_size,C(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function R(e,t,r,n,a,s){if(!e)return h;var A=1;if(-1===t&&(t=6),n<0?(A=0,n=-n):n>15&&(A=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||s<0||s>4)return u(e,h);8===n&&(n=9);var o=new S;return e.state=o,o.strm=e,o.wrap=A,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=a+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new i.Buf8(2*o.w_size),o.head=new i.Buf16(o.hash_size),o.prev=new i.Buf16(o.w_size),o.lit_bufsize=1<<a+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new i.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=s,o.method=r,D(e)}n=[new v(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Q(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,B(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-g&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(B(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(B(e,!1),e.strm.avail_out),1)})),new v(4,4,8,4,y),new v(4,5,16,8,y),new v(4,6,32,32,y),new v(4,4,16,16,b),new v(8,16,32,32,b),new v(8,16,128,128,b),new v(8,32,128,256,b),new v(32,128,258,1024,b),new v(32,258,258,4096,b)],t.deflateInit=function(e,t){return R(e,t,8,15,8,0)},t.deflateInit2=R,t.deflateReset=D,t.deflateResetKeep=k,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,0):h},t.deflate=function(e,t){var r,i,s,o;if(!e||!e.state||t>5||t<0)return e?u(e,h):h;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===l&&4!==t)return u(e,0===e.avail_out?-5:h);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,p(i,31),p(i,139),p(i,8),i.gzhead?(p(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),p(i,255&i.gzhead.time),p(i,i.gzhead.time>>8&255),p(i,i.gzhead.time>>16&255),p(i,i.gzhead.time>>24&255),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(p(i,255&i.gzhead.extra.length),p(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=A(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(p(i,0),p(i,0),p(i,0),p(i,0),p(i,0),p(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),p(i,3),i.status=c);else{var g=8+(i.w_bits-8<<4)<<8;g|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(g|=32),g+=31-g%31,i.status=c,w(i,g),0!==i.strstart&&(w(i,e.adler>>>16),w(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=A(e.adler,i.pending_buf,i.pending-s,s)),m(e),s=i.pending,i.pending!==i.pending_buf_size));)p(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=A(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=A(e.adler,i.pending_buf,i.pending-s,s)),m(e),s=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,p(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>s&&(e.adler=A(e.adler,i.pending_buf,i.pending-s,s)),0===o&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=A(e.adler,i.pending_buf,i.pending-s,s)),m(e),s=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,p(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>s&&(e.adler=A(e.adler,i.pending_buf,i.pending-s,s)),0===o&&(i.status=f)}else i.status=f;if(i.status===f&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&m(e),i.pending+2<=i.pending_buf_size&&(p(i,255&e.adler),p(i,e.adler>>8&255),e.adler=0,i.status=c)):i.status=c),0!==i.pending){if(m(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&I(t)<=I(r)&&4!==t)return u(e,-5);if(i.status===l&&0!==e.avail_in)return u(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==l){var _=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(Q(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(B(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(B(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,A=e.window;;){if(e.lookahead<=d){if(Q(e),e.lookahead<=d&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=A[i=e.strstart-1])===A[++i]&&n===A[++i]&&n===A[++i]){s=e.strstart+d;do{}while(n===A[++i]&&n===A[++i]&&n===A[++i]&&n===A[++i]&&n===A[++i]&&n===A[++i]&&n===A[++i]&&n===A[++i]&&i<s);e.match_length=d-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(B(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(B(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(B(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==_&&4!==_||(i.status=l),1===_||3===_)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===_&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(C(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),m(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(p(i,255&e.adler),p(i,e.adler>>8&255),p(i,e.adler>>16&255),p(i,e.adler>>24&255),p(i,255&e.total_in),p(i,e.total_in>>8&255),p(i,e.total_in>>16&255),p(i,e.total_in>>24&255)):(w(i,e.adler>>>16),w(i,65535&e.adler)),m(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==f&&t!==c&&t!==l?u(e,h):(e.state=null,t===c?u(e,-3):0):h},t.deflateSetDictionary=function(e,t){var r,n,a,A,o,d,g,f,c=t.length;if(!e||!e.state)return h;if(2===(A=(r=e.state).wrap)||1===A&&42!==r.status||r.lookahead)return h;for(1===A&&(e.adler=s(e.adler,t,c,0)),r.wrap=0,c>=r.w_size&&(0===A&&(C(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,t,c-r.w_size,r.w_size,0),t=f,c=r.w_size),o=e.avail_in,d=e.next_in,g=e.input,e.avail_in=c,e.next_in=0,e.input=t,Q(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--a);r.strstart=n,r.lookahead=2,Q(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=d,e.input=g,e.avail_in=o,r.wrap=A,0},t.deflateInfo="pako deflate (from Nodeca project)"},7414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293:e=>{"use strict";e.exports=function(e,t){var r,n,i,a,s,A,o,h,d,g,f,c,l,u,I,C,m,B,p,w,_,E,Q,y,b;r=e.state,n=e.next_in,y=e.input,i=n+(e.avail_in-5),a=e.next_out,b=e.output,s=a-(t-e.avail_out),A=a+(e.avail_out-257),o=r.dmax,h=r.wsize,d=r.whave,g=r.wnext,f=r.window,c=r.hold,l=r.bits,u=r.lencode,I=r.distcode,C=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{l<15&&(c+=y[n++]<<l,l+=8,c+=y[n++]<<l,l+=8),B=u[c&C];t:for(;;){if(c>>>=p=B>>>24,l-=p,0==(p=B>>>16&255))b[a++]=65535&B;else{if(!(16&p)){if(64&p){if(32&p){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}B=u[(65535&B)+(c&(1<<p)-1)];continue t}for(w=65535&B,(p&=15)&&(l<p&&(c+=y[n++]<<l,l+=8),w+=c&(1<<p)-1,c>>>=p,l-=p),l<15&&(c+=y[n++]<<l,l+=8,c+=y[n++]<<l,l+=8),B=I[c&m];;){if(c>>>=p=B>>>24,l-=p,16&(p=B>>>16&255)){if(_=65535&B,l<(p&=15)&&(c+=y[n++]<<l,(l+=8)<p&&(c+=y[n++]<<l,l+=8)),(_+=c&(1<<p)-1)>o){e.msg="invalid distance too far back",r.mode=30;break e}if(c>>>=p,l-=p,_>(p=a-s)){if((p=_-p)>d&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(E=0,Q=f,0===g){if(E+=h-p,p<w){w-=p;do{b[a++]=f[E++]}while(--p);E=a-_,Q=b}}else if(g<p){if(E+=h+g-p,(p-=g)<w){w-=p;do{b[a++]=f[E++]}while(--p);if(E=0,g<w){w-=p=g;do{b[a++]=f[E++]}while(--p);E=a-_,Q=b}}}else if(E+=g-p,p<w){w-=p;do{b[a++]=f[E++]}while(--p);E=a-_,Q=b}for(;w>2;)b[a++]=Q[E++],b[a++]=Q[E++],b[a++]=Q[E++],w-=3;w&&(b[a++]=Q[E++],w>1&&(b[a++]=Q[E++]))}else{E=a-_;do{b[a++]=b[E++],b[a++]=b[E++],b[a++]=b[E++],w-=3}while(w>2);w&&(b[a++]=b[E++],w>1&&(b[a++]=b[E++]))}break}if(64&p){e.msg="invalid distance code",r.mode=30;break e}B=I[(65535&B)+(c&(1<<p)-1)]}}break}}while(n<i&&a<A);n-=w=l>>3,c&=(1<<(l-=w<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<A?A-a+257:257-(a-A),r.hold=c,r.bits=l}},1447:(e,t,r)=>{"use strict";var n=r(9805),i=r(3269),a=r(4823),s=r(7293),A=r(1998),o=-2,h=12,d=30;function g(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):o}function l(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):o}function u(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?o:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,l(e))):o}function I(e,t){var r,n;return e?(n=new f,e.state=n,n.window=null,0!==(r=u(e,t))&&(e.state=null),r):o}var C,m,B=!0;function p(e){if(B){var t;for(C=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(A(1,e.lens,0,288,C,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;A(2,e.lens,0,32,m,0,e.work,{bits:5}),B=!1}e.lencode=C,e.lenbits=9,e.distcode=m,e.distbits=5}function w(e,t,r,i){var a,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),i>=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((a=s.wsize-s.wnext)>i&&(a=i),n.arraySet(s.window,t,r-i,a,s.wnext),(i-=a)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}t.inflateReset=l,t.inflateReset2=u,t.inflateResetKeep=c,t.inflateInit=function(e){return I(e,15)},t.inflateInit2=I,t.inflate=function(e,t){var r,f,c,l,u,I,C,m,B,_,E,Q,y,b,v,S,k,D,R,F,N,M,x,L,q=0,U=new n.Buf8(4),T=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return o;(r=e.state).mode===h&&(r.mode=13),u=e.next_out,c=e.output,C=e.avail_out,l=e.next_in,f=e.input,I=e.avail_in,m=r.hold,B=r.bits,_=I,E=C,M=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;B<16;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(2&r.wrap&&35615===m){r.check=0,U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0),m=0,B=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=d;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=d;break}if(B-=4,N=8+(15&(m>>>=4)),0===r.wbits)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=d;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=512&m?10:h,m=0,B=0;break;case 2:for(;B<16;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(r.flags=m,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=d;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=d;break}r.head&&(r.head.text=m>>8&1),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,B=0,r.mode=3;case 3:for(;B<32;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}r.head&&(r.head.time=m),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,U[2]=m>>>16&255,U[3]=m>>>24&255,r.check=a(r.check,U,4,0)),m=0,B=0,r.mode=4;case 4:for(;B<16;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}r.head&&(r.head.xflags=255&m,r.head.os=m>>8),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,B=0,r.mode=5;case 5:if(1024&r.flags){for(;B<16;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}r.length=m,r.head&&(r.head.extra_len=m),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,B=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((Q=r.length)>I&&(Q=I),Q&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,f,l,Q,N)),512&r.flags&&(r.check=a(r.check,f,Q,l)),I-=Q,l+=Q,r.length-=Q),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===I)break e;Q=0;do{N=f[l+Q++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N))}while(N&&Q<I);if(512&r.flags&&(r.check=a(r.check,f,Q,l)),I-=Q,l+=Q,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===I)break e;Q=0;do{N=f[l+Q++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N))}while(N&&Q<I);if(512&r.flags&&(r.check=a(r.check,f,Q,l)),I-=Q,l+=Q,N)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;B<16;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(m!==(65535&r.check)){e.msg="header crc mismatch",r.mode=d;break}m=0,B=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=h;break;case 10:for(;B<32;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}e.adler=r.check=g(m),m=0,B=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=u,e.avail_out=C,e.next_in=l,e.avail_in=I,r.hold=m,r.bits=B,2;e.adler=r.check=1,r.mode=h;case h:if(5===t||6===t)break e;case 13:if(r.last){m>>>=7&B,B-=7&B,r.mode=27;break}for(;B<3;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}switch(r.last=1&m,B-=1,3&(m>>>=1)){case 0:r.mode=14;break;case 1:if(p(r),r.mode=20,6===t){m>>>=2,B-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=d}m>>>=2,B-=2;break;case 14:for(m>>>=7&B,B-=7&B;B<32;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",r.mode=d;break}if(r.length=65535&m,m=0,B=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(Q=r.length){if(Q>I&&(Q=I),Q>C&&(Q=C),0===Q)break e;n.arraySet(c,f,l,Q,u),I-=Q,l+=Q,C-=Q,u+=Q,r.length-=Q;break}r.mode=h;break;case 17:for(;B<14;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(r.nlen=257+(31&m),m>>>=5,B-=5,r.ndist=1+(31&m),m>>>=5,B-=5,r.ncode=4+(15&m),m>>>=4,B-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=d;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;B<3;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}r.lens[T[r.have++]]=7&m,m>>>=3,B-=3}for(;r.have<19;)r.lens[T[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,x={bits:r.lenbits},M=A(0,r.lens,0,19,r.lencode,0,r.work,x),r.lenbits=x.bits,M){e.msg="invalid code lengths set",r.mode=d;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;S=(q=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,k=65535&q,!((v=q>>>24)<=B);){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(k<16)m>>>=v,B-=v,r.lens[r.have++]=k;else{if(16===k){for(L=v+2;B<L;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(m>>>=v,B-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=d;break}N=r.lens[r.have-1],Q=3+(3&m),m>>>=2,B-=2}else if(17===k){for(L=v+3;B<L;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}B-=v,N=0,Q=3+(7&(m>>>=v)),m>>>=3,B-=3}else{for(L=v+7;B<L;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}B-=v,N=0,Q=11+(127&(m>>>=v)),m>>>=7,B-=7}if(r.have+Q>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=d;break}for(;Q--;)r.lens[r.have++]=N}}if(r.mode===d)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=d;break}if(r.lenbits=9,x={bits:r.lenbits},M=A(1,r.lens,0,r.nlen,r.lencode,0,r.work,x),r.lenbits=x.bits,M){e.msg="invalid literal/lengths set",r.mode=d;break}if(r.distbits=6,r.distcode=r.distdyn,x={bits:r.distbits},M=A(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,x),r.distbits=x.bits,M){e.msg="invalid distances set",r.mode=d;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(I>=6&&C>=258){e.next_out=u,e.avail_out=C,e.next_in=l,e.avail_in=I,r.hold=m,r.bits=B,s(e,E),u=e.next_out,c=e.output,C=e.avail_out,l=e.next_in,f=e.input,I=e.avail_in,m=r.hold,B=r.bits,r.mode===h&&(r.back=-1);break}for(r.back=0;S=(q=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,k=65535&q,!((v=q>>>24)<=B);){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(S&&!(240&S)){for(D=v,R=S,F=k;S=(q=r.lencode[F+((m&(1<<D+R)-1)>>D)])>>>16&255,k=65535&q,!(D+(v=q>>>24)<=B);){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}m>>>=D,B-=D,r.back+=D}if(m>>>=v,B-=v,r.back+=v,r.length=k,0===S){r.mode=26;break}if(32&S){r.back=-1,r.mode=h;break}if(64&S){e.msg="invalid literal/length code",r.mode=d;break}r.extra=15&S,r.mode=22;case 22:if(r.extra){for(L=r.extra;B<L;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}r.length+=m&(1<<r.extra)-1,m>>>=r.extra,B-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;S=(q=r.distcode[m&(1<<r.distbits)-1])>>>16&255,k=65535&q,!((v=q>>>24)<=B);){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(!(240&S)){for(D=v,R=S,F=k;S=(q=r.distcode[F+((m&(1<<D+R)-1)>>D)])>>>16&255,k=65535&q,!(D+(v=q>>>24)<=B);){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}m>>>=D,B-=D,r.back+=D}if(m>>>=v,B-=v,r.back+=v,64&S){e.msg="invalid distance code",r.mode=d;break}r.offset=k,r.extra=15&S,r.mode=24;case 24:if(r.extra){for(L=r.extra;B<L;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}r.offset+=m&(1<<r.extra)-1,m>>>=r.extra,B-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=d;break}r.mode=25;case 25:if(0===C)break e;if(Q=E-C,r.offset>Q){if((Q=r.offset-Q)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=d;break}Q>r.wnext?(Q-=r.wnext,y=r.wsize-Q):y=r.wnext-Q,Q>r.length&&(Q=r.length),b=r.window}else b=c,y=u-r.offset,Q=r.length;Q>C&&(Q=C),C-=Q,r.length-=Q;do{c[u++]=b[y++]}while(--Q);0===r.length&&(r.mode=21);break;case 26:if(0===C)break e;c[u++]=r.length,C--,r.mode=21;break;case 27:if(r.wrap){for(;B<32;){if(0===I)break e;I--,m|=f[l++]<<B,B+=8}if(E-=C,e.total_out+=E,r.total+=E,E&&(e.adler=r.check=r.flags?a(r.check,c,E,u-E):i(r.check,c,E,u-E)),E=C,(r.flags?m:g(m))!==r.check){e.msg="incorrect data check",r.mode=d;break}m=0,B=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;B<32;){if(0===I)break e;I--,m+=f[l++]<<B,B+=8}if(m!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=d;break}m=0,B=0}r.mode=29;case 29:M=1;break e;case d:M=-3;break e;case 31:return-4;default:return o}return e.next_out=u,e.avail_out=C,e.next_in=l,e.avail_in=I,r.hold=m,r.bits=B,(r.wsize||E!==e.avail_out&&r.mode<d&&(r.mode<27||4!==t))&&w(e,e.output,e.next_out,E-e.avail_out)?(r.mode=31,-4):(_-=e.avail_in,E-=e.avail_out,e.total_in+=_,e.total_out+=E,r.total+=E,r.wrap&&E&&(e.adler=r.check=r.flags?a(r.check,c,E,e.next_out-E):i(r.check,c,E,e.next_out-E)),e.data_type=r.bits+(r.last?64:0)+(r.mode===h?128:0)+(20===r.mode||15===r.mode?256:0),(0===_&&0===E||4===t)&&0===M&&(M=-5),M)},t.inflateEnd=function(e){if(!e||!e.state)return o;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?(r.head=t,t.done=!1,0):o},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?o:11===r.mode&&i(1,t,n,0)!==r.check?-3:w(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):o},t.inflateInfo="pako inflate (from Nodeca project)"},1998:(e,t,r)=>{"use strict";var n=r(9805),i=[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],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[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,0,0],A=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,o,h,d,g,f){var c,l,u,I,C,m,B,p,w,_=f.bits,E=0,Q=0,y=0,b=0,v=0,S=0,k=0,D=0,R=0,F=0,N=null,M=0,x=new n.Buf16(16),L=new n.Buf16(16),q=null,U=0;for(E=0;E<=15;E++)x[E]=0;for(Q=0;Q<o;Q++)x[t[r+Q]]++;for(v=_,b=15;b>=1&&0===x[b];b--);if(v>b&&(v=b),0===b)return h[d++]=20971520,h[d++]=20971520,f.bits=1,0;for(y=1;y<b&&0===x[y];y++);for(v<y&&(v=y),D=1,E=1;E<=15;E++)if(D<<=1,(D-=x[E])<0)return-1;if(D>0&&(0===e||1!==b))return-1;for(L[1]=0,E=1;E<15;E++)L[E+1]=L[E]+x[E];for(Q=0;Q<o;Q++)0!==t[r+Q]&&(g[L[t[r+Q]]++]=Q);if(0===e?(N=q=g,m=19):1===e?(N=i,M-=257,q=a,U-=257,m=256):(N=s,q=A,m=-1),F=0,Q=0,E=y,C=d,S=v,k=0,u=-1,I=(R=1<<v)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){B=E-k,g[Q]<m?(p=0,w=g[Q]):g[Q]>m?(p=q[U+g[Q]],w=N[M+g[Q]]):(p=96,w=0),c=1<<E-k,y=l=1<<S;do{h[C+(F>>k)+(l-=c)]=B<<24|p<<16|w}while(0!==l);for(c=1<<E-1;F&c;)c>>=1;if(0!==c?(F&=c-1,F+=c):F=0,Q++,0==--x[E]){if(E===b)break;E=t[r+g[Q]]}if(E>v&&(F&I)!==u){for(0===k&&(k=v),C+=y,D=1<<(S=E-k);S+k<b&&!((D-=x[S+k])<=0);)S++,D<<=1;if(R+=1<<S,1===e&&R>852||2===e&&R>592)return 1;h[u=F&I]=v<<24|S<<16|C-d}}return 0!==F&&(h[C+F]=E-k<<24|64<<16),f.bits=v,0}},4674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:(e,t,r)=>{"use strict";var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=[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],s=[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],A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],o=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);i(h);var d=new Array(60);i(d);var g=new Array(512);i(g);var f=new Array(256);i(f);var c=new Array(29);i(c);var l,u,I,C=new Array(30);function m(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function B(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function p(e){return e<256?g[e]:g[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function _(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function E(e,t,r){_(e,r[2*t],r[2*t+1])}function Q(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function y(e,t,r){var n,i,a=new Array(16),s=0;for(n=1;n<=15;n++)a[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var A=e[2*i+1];0!==A&&(e[2*i]=Q(a[A]++,A))}}function b(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function v(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function S(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function k(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&S(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!S(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function D(e,t,r){var n,i,A,o,h=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*h]<<8|e.pending_buf[e.d_buf+2*h+1],i=e.pending_buf[e.l_buf+h],h++,0===n?E(e,i,t):(E(e,(A=f[i])+256+1,t),0!==(o=a[A])&&_(e,i-=c[A],o),E(e,A=p(--n),r),0!==(o=s[A])&&_(e,n-=C[A],o))}while(h<e.last_lit);E(e,256,t)}function R(e,t){var r,n,i,a=t.dyn_tree,s=t.stat_desc.static_tree,A=t.stat_desc.has_stree,o=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<o;r++)0!==a[2*r]?(e.heap[++e.heap_len]=h=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[i]=0,e.opt_len--,A&&(e.static_len-=s[2*i+1]);for(t.max_code=h,r=e.heap_len>>1;r>=1;r--)k(e,a,r);i=o;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],k(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,k(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,s,A,o=t.dyn_tree,h=t.max_code,d=t.stat_desc.static_tree,g=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,l=t.stat_desc.max_length,u=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(o[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=o[2*o[2*(n=e.heap[r])+1]+1]+1)>l&&(a=l,u++),o[2*n+1]=a,n>h||(e.bl_count[a]++,s=0,n>=c&&(s=f[n-c]),A=o[2*n],e.opt_len+=A*(a+s),g&&(e.static_len+=A*(d[2*n+1]+s)));if(0!==u){do{for(a=l-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[l]--,u-=2}while(u>0);for(a=l;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>h||(o[2*i+1]!==a&&(e.opt_len+=(a-o[2*i+1])*o[2*i],o[2*i+1]=a),n--)}}(e,t),y(a,h,e.bl_count)}function F(e,t,r){var n,i,a=-1,s=t[1],A=0,o=7,h=4;for(0===s&&(o=138,h=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++A<o&&i===s||(A<h?e.bl_tree[2*i]+=A:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):A<=10?e.bl_tree[34]++:e.bl_tree[36]++,A=0,a=i,0===s?(o=138,h=3):i===s?(o=6,h=3):(o=7,h=4))}function N(e,t,r){var n,i,a=-1,s=t[1],A=0,o=7,h=4;for(0===s&&(o=138,h=3),n=0;n<=r;n++)if(i=s,s=t[2*(n+1)+1],!(++A<o&&i===s)){if(A<h)do{E(e,i,e.bl_tree)}while(0!=--A);else 0!==i?(i!==a&&(E(e,i,e.bl_tree),A--),E(e,16,e.bl_tree),_(e,A-3,2)):A<=10?(E(e,17,e.bl_tree),_(e,A-3,3)):(E(e,18,e.bl_tree),_(e,A-11,7));A=0,a=i,0===s?(o=138,h=3):i===s?(o=6,h=3):(o=7,h=4)}}i(C);var M=!1;function x(e,t,r,i){_(e,0+(i?1:0),3),function(e,t,r){v(e),w(e,r),w(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}t._tr_init=function(e){M||(function(){var e,t,r,n,i,o=new Array(16);for(r=0,n=0;n<28;n++)for(c[n]=r,e=0;e<1<<a[n];e++)f[r++]=n;for(f[r-1]=n,i=0,n=0;n<16;n++)for(C[n]=i,e=0;e<1<<s[n];e++)g[i++]=n;for(i>>=7;n<30;n++)for(C[n]=i<<7,e=0;e<1<<s[n]-7;e++)g[256+i++]=n;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)h[2*e+1]=8,e++,o[8]++;for(;e<=255;)h[2*e+1]=9,e++,o[9]++;for(;e<=279;)h[2*e+1]=7,e++,o[7]++;for(;e<=287;)h[2*e+1]=8,e++,o[8]++;for(y(h,287,o),e=0;e<30;e++)d[2*e+1]=5,d[2*e]=Q(e,5);l=new m(h,a,257,286,15),u=new m(d,s,0,30,15),I=new m(new Array(0),A,0,19,7)}(),M=!0),e.l_desc=new B(e.dyn_ltree,l),e.d_desc=new B(e.dyn_dtree,u),e.bl_desc=new B(e.bl_tree,I),e.bi_buf=0,e.bi_valid=0,b(e)},t._tr_stored_block=x,t._tr_flush_block=function(e,t,r,n){var i,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),R(e,e.l_desc),R(e,e.d_desc),s=function(e){var t;for(F(e,e.dyn_ltree,e.l_desc.max_code),F(e,e.dyn_dtree,e.d_desc.max_code),R(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*o[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?x(e,t,r,n):4===e.strategy||a===i?(_(e,2+(n?1:0),3),D(e,h,d)):(_(e,4+(n?1:0),3),function(e,t,r,n){var i;for(_(e,t-257,5),_(e,r-1,5),_(e,n-4,4),i=0;i<n;i++)_(e,e.bl_tree[2*o[i]+1],3);N(e,e.dyn_ltree,t-1),N(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),D(e,e.dyn_ltree,e.dyn_dtree)),b(e),n&&v(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(f[r]+256+1)]++,e.dyn_dtree[2*p(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){_(e,2,3),E(e,256,h),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},4442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},7392:e=>{"use strict";class t{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}e.exports=t},1307:function(e,t,r){var n;n=e=>(()=>{"use strict";var t=[,e=>{e.exports="data:application/wasm;base64,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IgENAAsLIAJCf4UL1RACDH8CfgJAAkAgACgCJEUNACAAKAIAIQIMAQtBACECIABBADoAKCAAQgA3AwAgAEIANwMYIABByABqQQBB5AAQhoCAgAAaIABBrAFqQQw2AgALIAAgASgCBCIDNgIQIABBsAFqIQQgAEHgAGohBSAAQcgAaiEGIABBtgFqIQcgAEGoAWohCCABKAIQIQkCQAJAAkACQANAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIOCgECAAQFBgcICQoPCyABKAIAIQogACgCqAEhAiAAKAKsASELIAEoAgQhDCABKAIIIQ0MAgsgCCAAKAKoASIMakEIaiABKAIAIAEoAgQiAmogASgCCCACayICIAAoAqwBIAxrIgwgAiAMSRsiAhCHgICAABogASABKAIEIAJqNgIEQQAhDCAAQQAgACgCqAEgAmoiAiACIAAoAqwBIgtGGzYCqAEgAiALRw0RIABBATYCAAJAIARBqIiAgABBBhCEgICAAEUNAEEFIQwMEgsgB0ECQQAQjYCAgAAgACgAuAFHDRBBBiEMIActAAANESAAIAAtALcBIgI2AiAgAkEESw0RQQEgAnRBE3FFDRELIAEoAgQiDCABKAIIIg1GDQ4CQCABKAIAIgogDGotAAAiCw0AIAAgDDYCECABIAxBAWo2AgRBBiECDAwLQQAhAiAAQQA2AqgBIABBAjYCACAAIAtBAnRBBGoiCzYCrAEgACALNgJACyAIIAJqQQhqIAogDGogDSAMayIMIAsgAmsiAiAMIAJJGyICEIeAgIAAGiABIAIgASgCBGo2AgRBACEMIABBACAAKAKoASACaiICIAIgACgCrAEiC0YbNgKoASACIAtHDQ8gACACQXxqIgI2AqwBQQchDCAEIAJBABCNgICAACAAIAAoAqwBIgtqQbABaigAAEcNDyAAQQI2AqgBIAAtALEBIgJBP3ENDAJAAkAgAkHAAHFFDQAgACAEIAggCxCRgICAAEEBRw0RIAAgACkDCDcDMCAALQCxASECDAELIABCfzcDMAtCfyEOAkAgAkEYdEEYdUF/Sg0AIAAgBCAIIAAoAqwBEJGAgIAAQQFHDRAgACkDCCEOCyAAIA43AzggACgCrAEiDSAAKAKoASICa0ECSQ0PIAAgAkEBaiIKNgKoASAIIAJqQQhq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IgM2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQgAyEJCwJAAkAgDiALQQt2IA8vAQAiCmwiA08iEg0AIAAgAzYCACAKQYAQIAprQQV2aiEKDAELIAAgDiADayIONgIEIAAgCyADayIDNgIAIAogCkEFdmshCkEAIQ0LIA8gCjsBACANIBFzIQ0gBEEBdCASciIEQYACSQ0ACwsgACACQQFqNgIgIAAoAhggAmogBDoAAAJAIAAoAiQgACgCICICTw0AIAAgAjYCJAtBACEDAkAgACgCZCIEQQRJDQACQCAEQQlLDQAgBEF9aiEDDAELIARBemohAwsgACADNgJkDAELIAAgDiADayIONgIEIAAgBCADayIDNgIAIA0gDyAPQQV2azsBACAAIApBAXRqIg9B+ANqIQQCQAJAIANB////B00NACAJIQoMAQsgACADQQh0IgM2AgAgACAJQQFqIgo2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQLAkACQCAOIANBC3YgBC8BACINbCIJSQ0AIAAgDiAJayIONgIEIAAgAyAJayIDNgIAIAQgDSANQQV2azsBACAPQZAEaiENAkACQCADQf///wdNDQAgCiEQDAELIAAgA0EIdCIDNgIAIAAgCkEBaiIQNgIQIAAgDkEIdCAAKAIMIApqLQAAciIONgIECwJAAkAgDiADQQt2IA0vAQAiCWwiBE8NACANIAlBgBAgCWtBBXZqOwEAIAxB2ARqIQMCQCAEQf///wdLDQAgACAEQQh0IgQ2AgAgACAQQQFqNgIQIAAgDkEIdCAAKAIMIBBqLQAAciIONgIECwJAIA4gBEELdiADLwEAIg1sIglJDQAgACAOIAlrNgIEIAAgBCAJazYCACADIA0gDUEFdms7AQAMAgsgAyANQYAQIA1rQQV2ajsBACAAIAk2AgAgAEEBNgJoIABBCUELIAAoAmRBB0kbNgJkDAMLIAAgDiAEayIONgIEIA0gCSAJQQV2azsBACAPQagEaiENAkACQCADIARrIgNB////B00NACAQIQoMAQsgACADQQh0IgM2AgAgACAQQQFqIgo2AhAgACAOQQh0IAAoAgwgEGotAAByIg42AgQLAkACQCAOIANBC3YgDS8BACIEbCIJTw0AIAAgCTYCACANIARBgBAgBGtBBXZqOwEAIAAoAlghAwwBCyAAIA4gCWsiDjYCBCANIAQgBEEFdms7AQAgD0HABGohBAJAIAMgCWsiA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgCkEBajYCECAAIA5BCHQgACgCDCAKai0AAHIiDjYCBAsCQAJAIA4gA0ELdiAELwEAIg1sIglPDQAgACAJNgIAIAQgDUGAECANa0EFdmo7AQAgACgCXCEDDAELIAAgDiAJazYCBCAAIAMgCWs2AgAgACgCYCEDIAAgACgCXDYCYCAEIA0gDUEFdms7AQALIAAgACgCWDYCXAsgACAAKAJUNgJYIAAgAzYCVAsgAEEIQQsgACgCZEEHSRs2AmQgACAHIAsQn4CAgAAMAQsgBCANQYAQIA1rQQV2ajsBACAAIAk2AgAgACAAKAJcNgJgIAAgACkCVDcCWCAAQQdBCiAAKAJkQQdJGzYCZCAAIAUgCxCfgICAACAAKAJoIgNBfmpBAyADQQZJGyEKIAAoAgAhA0EBIQ4DQCAAIApBB3RqIA5BAXQiDmpB2AdqIQ0CQAJAIANBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgRBAWo2AhAgACAAKAIEQQh0IAQgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgDS8BACIJbCIPSQ0AIAAgBCAPayIENgIEIAAgAyAPayIDNgIAIA0gCSAJQQV2azsBACAOQQFyIQ4MAQsgACAPNgIAIA0gCUGAECAJa0EFdmo7AQAgDyEDCyAOQcAASQ0ACwJAIA5BQGoiCUEDSw0AIAAgCTYCVAwBCyAAIA5BAXFBAnIiDTYCVCAJQQF2IQ8CQCAJQQ1LDQAgACANIA9Bf2oiDHQiCzYCVEEBIQ0gCCALQQF0akGEC2ohEEE/IA5rIRFBACEPA0AgECARIA1qQQF0aiEOAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA4vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACAOIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDUEBdEEBciENDAELIAAgAzYCACAOIAlBgBAgCWtBBXZqOwEAIA1BAXQhDQsgDCAPQQFqIg9HDQAMAgsLIA9Be2ohDgNAAkAgA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgACgCECIJQQFqNgIQIARBCHQgCSAAKAIMai0AAHIhBAsgACADQQF2IgM2AgAgACAEIANrIgRBH3UiCSANQQF0akEBaiINNgJUIAAgCSADcSAEaiIENgIEIA5Bf2oiDg0ACyAAIA1BBHQiCzYCVEEAIQ9BASEOA0AgACAOQQF0Ig5qQbwNaiENAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA0vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACANIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDkEBciEODAELIAAgAzYCACANIAlBgBAgCWtBBXZqOwEACyAPQQFqIg9BBEcNAAsLAkAgASAGIAAoAlQQnoCAgAANAEEADwsgACgCICECCyACIAAoAihJDQALC0EBIQMCQCAAKAIAIgRB////B0sNACAAIARBCHQ2AgBBASEDIAAgACgCECIEQQFqNgIQIAAgACgCBEEIdCAEIAAoAgxqLQAAcjYCBAsgAwtwAQF/AkBBqN4BEICAgIAAIgJFDQAgAkE0aiABNgIAIAJBPGogADYCAAJAAkACQCAAQX9qDgIAAQILIAIgARCAgICAACIANgIYIAANASACEIKAgIAADAILIAJBADYCGCACQThqQQA2AgALIAIPC0EAC9IBAQJ/QQYhAgJAIAFBJ0sNACAAQTBqIAFBAXFBAnIgAUEBdkELanQiATYCAAJAAkAgAEE8aigCACIDRQ0AQQQhAiABIABBNGooAgBLDQIgAEEsaiABNgIAIANBAkcNACAAQThqIgMoAgAgAU8NACAAIAE2AjggACgCGBCCgICAACAAIAAoAjAQgICAgAAiATYCGCABDQBBAyECDAELQQAhAiAAQQA2AkAgAEHQAGpBAToAACAAQegAakEANgIAIABB5N0BaiEDCyADQQA2AgALIAILIwACQCAAQTxqKAIARQ0AIAAoAhgQgoCAgAALIAAQgoCAgAAL9QEBBH9BACEDAkAgACgCDCACTQ0AIAAoAhggAk0NACABIAEoAgAiBCAAKAIQIAAoAggiBWsiBiAEIAYgBEkbIgRrNgIAIAUgAkF/c2ohAQJAIAUgAksNACAAKAIUIAFqIQELIAAoAgAiAiABai0AACEGQQEhAyAAIAVBAWo2AgggAiAFaiAGOgAAAkAgBEF/aiICRQ0AA0AgACgCACIFQQAgAUEBaiIBIAEgACgCFEYbIgFqLQAAIQQgACAAKAIIIgZBAWo2AgggBSAGaiAEOgAAIAJBf2oiAg0ACwsgACgCDCAAKAIIIgFPDQAgACABNgIMCyADC8gEAQd/AkACQCAAKAIAIgNBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAAKAIEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgAS8BACIGbCIFTw0AIAEgBkGAECAGa0EFdmo7AQAgASACQQR0akEEaiEHQQghCEECIQkMAQsgACAEIAVrIgQ2AgQgASAGIAZBBXZrOwEAAkAgAyAFayIDQf///wdLDQAgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkAgBCADQQt2IAEvAQIiBmwiBU8NACABIAZBgBAgBmtBBXZqOwECIAEgAkEEdGpBhAJqIQdBCCEIQQohCQwBCyAAIAQgBWsiBDYCBCABIAYgBkEFdms7AQIgAUGEBGohByADIAVrIQVBgAIhCEESIQkLIABB6ABqIAk2AgBBASEBA0AgByABQQF0IgFqIQMCQAJAIAVB////B00NACAFIQIMAQsgACAFQQh0IgI2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIAJBC3YgAy8BACIGbCIFSQ0AIAAgBCAFayIENgIEIAAgAiAFayIFNgIAIAMgBiAGQQV2azsBACABQQFyIQEMAQsgACAFNgIAIAMgBkGAECAGa0EFdmo7AQALIAEgCEkNAAsgAEHoAGogASAIayAJajYCAAsLNQEAQYAICy4IAAAAEAAAABgAAAAgAAAAKAAAADAAAABAAAAAUAAAAIAAAAAAAQAA/Td6WFoA"},t=>{t.exports=e}],r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{XzReadableStream:()=>a});var e=n(1);const t=globalThis.ReadableStream||n(2).ReadableStream;class r{constructor(e){this.exports=e.exports,this.memory=this.exports.memory,this.ptr=this.exports.create_context(),this._refresh(),this.bufSize=this.mem32[0],this.inStart=this.mem32[1]-this.ptr,this.inEnd=this.inStart+this.bufSize,this.outStart=this.mem32[4]-this.ptr}supplyInput(e){this._refresh(),this.mem8.subarray(this.inStart,this.inEnd).set(e,0),this.exports.supply_input(this.ptr,e.byteLength),this._refresh()}getNextOutput(){const e=this.exports.get_next_output(this.ptr);if(this._refresh(),0!==e&&1!==e)throw new Error(`get_next_output failed with error code ${e}`);return{outChunk:this.mem8.slice(this.outStart,this.outStart+this.mem32[5]),finished:1===e}}needsMoreInput(){return this.mem32[2]===this.mem32[3]}outputBufferIsFull(){return this.mem32[5]===this.bufSize}resetOutputBuffer(){this.outPos=this.mem32[5]=0}dispose(){this.exports.destroy_context(this.ptr),this.exports=null}_refresh(){this.memory.buffer!==this.mem8?.buffer&&(this.mem8=new Uint8Array(this.memory.buffer,this.ptr),this.mem32=new Uint32Array(this.memory.buffer,this.ptr))}}class a extends t{static _moduleInstancePromise;static _moduleInstance;static async _getModuleInstance(){const t=e.replace("data:application/wasm;base64,",""),r=Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer,n=await WebAssembly.instantiate(r,{});a._moduleInstance=n.instance}constructor(e){let t,n=null;const i=e.getReader();super({async start(e){a._moduleInstance||await(a._moduleInstancePromise||(a._moduleInstancePromise=a._getModuleInstance())),t=new r(a._moduleInstance)},async pull(e){if(t.needsMoreInput()){if(null===n||0===n.byteLength){const{done:e,value:t}=await i.read();e||(n=t)}const e=Math.min(t.bufSize,n.byteLength);t.supplyInput(n.subarray(0,e)),n=n.subarray(e)}const r=t.getNextOutput();e.enqueue(r.outChunk),t.resetOutputBuffer(),r.finished&&(t.dispose(),e.close())},cancel:()=>(t.dispose(),i.cancel())})}}})(),i})(),e.exports=n(r(772))},1226:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BlobFile:()=>A,LocalFile:()=>i(),RemoteFile:()=>s,fromUrl:()=>o,open:()=>h});var n=r(2306),i=r.n(n);function a(e){return("object"==typeof e&&null!==e&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class s{constructor(e,t={}){this.baseOverrides={},this.url=e;const r=t.fetch||globalThis.fetch.bind(globalThis);t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=r}async fetch(e,t){let r;try{r=await this.fetchImplementation(e,t)}catch(n){if(!`${n}`.includes("Failed to fetch"))throw new Error(`${a(n)} fetching ${e}`,{cause:n});console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{r=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(t){throw new Error(`${a(t)} fetching ${e}`,{cause:t})}}return r}async read(e,t,r={}){const{headers:n={},signal:i,overrides:a={}}=r;e<1/0?n.range=`bytes=${t}-${t+e}`:e===1/0&&0!==t&&(n.range=`bytes=${t}-`);const s=await this.fetch(this.url,{...this.baseOverrides,...a,headers:{...n,...a.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:i});if(!s.ok)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if(200===s.status&&0===t||206===s.status){const t=await s.arrayBuffer(),r=s.headers.get("content-range"),n=/\/(\d+)$/.exec(r||"");return n?.[1]&&(this._stat={size:parseInt(n[1],10)}),new Uint8Array(t.slice(0,e))}throw 200===s.status?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${s.status} fetching ${this.url}`)}async readFile(e={}){let t,r;"string"==typeof e?(t=e,r={}):(t=e.encoding,r=e,delete r.encoding);const{headers:n={},signal:i,overrides:a={}}=r,s=await this.fetch(this.url,{headers:n,method:"GET",redirect:"follow",mode:"cors",signal:i,...this.baseOverrides,...a});if(200!==s.status)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if("utf8"===t)return s.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await s.arrayBuffer())}async stat(){if(!this._stat&&(await this.read(10,0),!this._stat))throw new Error(`unable to determine size of file at ${this.url}`);return this._stat}async close(){}}class A{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0){if(!e)return new Uint8Array(0);const r=t,n=r+e;return new Uint8Array(await this.blob.slice(r,n).arrayBuffer())}async readFile(e){const t="string"==typeof e?e:e?.encoding;if("utf8"===t)return this.blob.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await this.blob.arrayBuffer())}async stat(){return{size:this.size}}async close(){}}function o(e,t={}){return new s(e,t)}function h(e,t,r,n={}){if(void 0!==r)return r;if(void 0!==e)return o(e,n);if(void 0!==t)return new(i())(t,n);throw new Error("no url, path, or filehandle provided, cannot open")}},772:()=>{},2306:()=>{},86:(e,t,r)=>{const n=r(1308).A;e.exports=n,e.exports.default=n},1308:(e,t)=>{"use strict";let r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(r=new Int32Array(r)),t.A=(e,t)=>{let n=0===t?0:~t;for(let t=0;t<e.length;t++)n=r[255&(n^e[t])]^n>>>8;return~n}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=r(7806);window.gmodCRAM=n})();
|
|
@@ -10,12 +10,3 @@
|
|
|
10
10
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
11
11
|
* @license MIT
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
/*!
|
|
15
|
-
* The buffer module from node.js, for the browser.
|
|
16
|
-
*
|
|
17
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
18
|
-
* @license MIT
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
package/dist/io/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { GenericFilehandle } from 'generic-filehandle2';
|
|
2
2
|
declare function open(maybeUrl?: string, maybePath?: string, maybeFilehandle?: GenericFilehandle): GenericFilehandle;
|
|
3
3
|
export { open };
|
|
4
|
-
export { LocalFile, RemoteFile } from 'generic-
|
|
4
|
+
export { LocalFile, RemoteFile } from 'generic-filehandle2';
|
package/dist/io/index.js
CHANGED
|
@@ -15,7 +15,7 @@ function open(maybeUrl, maybePath, maybeFilehandle) {
|
|
|
15
15
|
}
|
|
16
16
|
throw new Error('no url, path, or filehandle provided, cannot open');
|
|
17
17
|
}
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "LocalFile", { enumerable: true, get: function () { return
|
|
20
|
-
Object.defineProperty(exports, "RemoteFile", { enumerable: true, get: function () { return
|
|
18
|
+
var generic_filehandle2_2 = require("generic-filehandle2");
|
|
19
|
+
Object.defineProperty(exports, "LocalFile", { enumerable: true, get: function () { return generic_filehandle2_2.LocalFile; } });
|
|
20
|
+
Object.defineProperty(exports, "RemoteFile", { enumerable: true, get: function () { return generic_filehandle2_2.RemoteFile; } });
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
package/dist/io/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":";;;AAqBS,oBAAI;AArBb,6DAA2D;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,gCAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,+BAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAID,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":";;;AAqBS,oBAAI;AArBb,6DAA2D;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,gCAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,+BAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAID,2DAA2D;AAAlD,gHAAA,SAAS,OAAA;AAAE,iHAAA,UAAU,OAAA"}
|
package/esm/io/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { GenericFilehandle } from 'generic-filehandle2';
|
|
2
2
|
declare function open(maybeUrl?: string, maybePath?: string, maybeFilehandle?: GenericFilehandle): GenericFilehandle;
|
|
3
3
|
export { open };
|
|
4
|
-
export { LocalFile, RemoteFile } from 'generic-
|
|
4
|
+
export { LocalFile, RemoteFile } from 'generic-filehandle2';
|
package/esm/io/index.js
CHANGED
|
@@ -12,5 +12,5 @@ function open(maybeUrl, maybePath, maybeFilehandle) {
|
|
|
12
12
|
throw new Error('no url, path, or filehandle provided, cannot open');
|
|
13
13
|
}
|
|
14
14
|
export { open };
|
|
15
|
-
export { LocalFile, RemoteFile } from 'generic-
|
|
15
|
+
export { LocalFile, RemoteFile } from 'generic-filehandle2';
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
package/esm/io/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/io/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAI3D,SAAS,IAAI,CACX,QAAiB,EACjB,SAAkB,EAClB,eAAmC;IAEnC,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAA;IACxB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,IAAI,SAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;AACtE,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA"}
|
package/package.json
CHANGED
package/src/io/index.ts
CHANGED