documonster 0.20.0 → 0.20.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/README.md +1 -1
- package/README_zh.md +1 -1
- package/dist/esm/modules/archive/compression/deflate-fallback.js +20 -50
- package/dist/esm/modules/archive/compression/streaming-compress.js +3 -2
- package/dist/esm/modules/archive/unzip/stream.js +1 -1
- package/dist/esm/modules/csv/stream/parser.js +5 -1
- package/dist/esm/modules/excel/stream/workbook-reader.browser.js +86 -14
- package/dist/esm/modules/excel/stream/workbook-reader.js +6 -3
- package/dist/esm/modules/excel/stream/xlsb-record-stream.js +32 -11
- package/dist/esm/modules/excel/stream/xlsb-worksheet-reader.js +32 -28
- package/dist/esm/modules/excel/utils/copy-style.js +28 -14
- package/dist/esm/modules/excel/utils/stream-buf.js +74 -2
- package/dist/esm/modules/excel/xlsx/xform/style/styles-xform.js +13 -0
- package/dist/esm/modules/word/writer/streaming-writer.js +38 -6
- package/dist/esm/modules/xml/encode.js +15 -0
- package/dist/iife/documonster.archive.iife.min.js +2 -2
- package/dist/iife/documonster.csv.iife.min.js +3 -2
- package/dist/iife/documonster.draw.iife.min.js +1 -1
- package/dist/iife/documonster.excel.iife.min.js +53 -53
- package/dist/iife/documonster.formula.iife.min.js +1 -1
- package/dist/iife/documonster.markdown.iife.min.js +1 -1
- package/dist/iife/documonster.mermaid.iife.min.js +1 -1
- package/dist/iife/documonster.pdf.iife.min.js +11 -11
- package/dist/iife/documonster.stream.iife.min.js +1 -1
- package/dist/iife/documonster.word.iife.min.js +60 -60
- package/dist/iife/documonster.xml.iife.min.js +7 -7
- package/dist/types/modules/excel/stream/workbook-reader.browser.d.ts +26 -0
- package/dist/types/modules/excel/stream/xlsb-record-stream.d.ts +11 -0
- package/dist/types/modules/excel/utils/stream-buf.d.ts +19 -0
- package/dist/types/modules/word/writer/streaming-writer.d.ts +13 -0
- package/package.json +2 -2
|
@@ -120,6 +120,14 @@ function nop() { }
|
|
|
120
120
|
class StreamBuf extends EventEmitter {
|
|
121
121
|
constructor(options) {
|
|
122
122
|
super();
|
|
123
|
+
/**
|
|
124
|
+
* Strings written in batch mode to a `data` listener, not yet emitted. Joined and encoded once per `bufSize`
|
|
125
|
+
* characters rather than once per write: the streaming worksheet writer writes one string per row, and encoding,
|
|
126
|
+
* emitting and handing each to the ZIP layer on its own cost more than the rows took to render. Flushed before any
|
|
127
|
+
* other write and at `pause()`/`end()`, so the bytes and their order are exactly those of an unbatched stream.
|
|
128
|
+
*/
|
|
129
|
+
this._pendingText = [];
|
|
130
|
+
this._pendingChars = 0;
|
|
123
131
|
// Native WritableStream support
|
|
124
132
|
this._writableStreamWriter = null;
|
|
125
133
|
this._asyncWriteQueue = Promise.resolve();
|
|
@@ -215,6 +223,33 @@ class StreamBuf extends EventEmitter {
|
|
|
215
223
|
else {
|
|
216
224
|
throw new InvalidValueTypeError(typeof data, "Chunk must be one of type String, Uint8Array, ArrayBuffer or StringBuf.");
|
|
217
225
|
}
|
|
226
|
+
if (this.batch &&
|
|
227
|
+
typeof data === "string" &&
|
|
228
|
+
!this.pipes.length &&
|
|
229
|
+
!this.paused &&
|
|
230
|
+
!this._writableStreamWriter &&
|
|
231
|
+
this.listenerCount("data") > 0) {
|
|
232
|
+
// Joining must not change the bytes: encoded one write at a time, a surrogate pair split across two writes
|
|
233
|
+
// becomes two U+FFFD; joined first, it would become the character. So a write that starts with a low surrogate
|
|
234
|
+
// is never joined to what came before it.
|
|
235
|
+
const first = data.charCodeAt(0);
|
|
236
|
+
if (first >= 0xdc00 && first <= 0xdfff) {
|
|
237
|
+
this._flushPendingText();
|
|
238
|
+
}
|
|
239
|
+
this._pendingText.push(data);
|
|
240
|
+
this._pendingChars += data.length;
|
|
241
|
+
const last = data.charCodeAt(data.length - 1);
|
|
242
|
+
if (last >= 0xd800 && last <= 0xdbff) {
|
|
243
|
+
// …and one that ends with a high surrogate is never joined to what follows.
|
|
244
|
+
this._flushPendingText();
|
|
245
|
+
}
|
|
246
|
+
if (this._pendingChars >= this.bufSize) {
|
|
247
|
+
this._flushPendingText();
|
|
248
|
+
}
|
|
249
|
+
callback();
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
this._flushPendingText();
|
|
218
253
|
// Handle piping and buffering
|
|
219
254
|
if (this.pipes.length) {
|
|
220
255
|
if (this.batch) {
|
|
@@ -234,6 +269,24 @@ class StreamBuf extends EventEmitter {
|
|
|
234
269
|
}
|
|
235
270
|
}
|
|
236
271
|
else {
|
|
272
|
+
this._deliver(chunk);
|
|
273
|
+
callback();
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
/** Emit the batched strings as one chunk. */
|
|
278
|
+
_flushPendingText() {
|
|
279
|
+
if (this._pendingText.length === 0) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const text = this._pendingText.length === 1 ? this._pendingText[0] : this._pendingText.join("");
|
|
283
|
+
this._pendingText = [];
|
|
284
|
+
this._pendingChars = 0;
|
|
285
|
+
this._deliver(new StringChunk(text));
|
|
286
|
+
}
|
|
287
|
+
/** Hand a chunk to the `data` listeners or the native writer, or keep it if nobody is listening. */
|
|
288
|
+
_deliver(chunk) {
|
|
289
|
+
{
|
|
237
290
|
const chunkBuffer = chunk.toBuffer();
|
|
238
291
|
// Track whether the data has been delivered to a consumer.
|
|
239
292
|
// When a consumer exists ("data" listeners or a native WritableStream),
|
|
@@ -257,9 +310,7 @@ class StreamBuf extends EventEmitter {
|
|
|
257
310
|
this._writeToBuffers(chunk);
|
|
258
311
|
this.emit("readable");
|
|
259
312
|
}
|
|
260
|
-
callback();
|
|
261
313
|
}
|
|
262
|
-
return true;
|
|
263
314
|
}
|
|
264
315
|
/**
|
|
265
316
|
* Cork the stream - buffer writes until uncork
|
|
@@ -294,6 +345,7 @@ class StreamBuf extends EventEmitter {
|
|
|
294
345
|
callback?.(error);
|
|
295
346
|
return;
|
|
296
347
|
}
|
|
348
|
+
this._flushPendingText();
|
|
297
349
|
this._ended = true;
|
|
298
350
|
this._flush();
|
|
299
351
|
this.pipes.forEach((pipe) => {
|
|
@@ -364,10 +416,30 @@ class StreamBuf extends EventEmitter {
|
|
|
364
416
|
setEncoding(encoding) {
|
|
365
417
|
this.encoding = encoding;
|
|
366
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Text batched for the `data` listeners belongs to the listeners attached when it was written, so it is delivered
|
|
421
|
+
* before one of them is removed — otherwise removing the last listener would leave it to be buffered instead.
|
|
422
|
+
*/
|
|
423
|
+
off(event, listener) {
|
|
424
|
+
if (event === "data") {
|
|
425
|
+
this._flushPendingText();
|
|
426
|
+
}
|
|
427
|
+
return super.off(event, listener);
|
|
428
|
+
}
|
|
429
|
+
removeListener(event, listener) {
|
|
430
|
+
return this.off(event, listener);
|
|
431
|
+
}
|
|
432
|
+
removeAllListeners(event) {
|
|
433
|
+
if (event === undefined || event === "data") {
|
|
434
|
+
this._flushPendingText();
|
|
435
|
+
}
|
|
436
|
+
return super.removeAllListeners(event);
|
|
437
|
+
}
|
|
367
438
|
/**
|
|
368
439
|
* Pause the stream
|
|
369
440
|
*/
|
|
370
441
|
pause() {
|
|
442
|
+
this._flushPendingText();
|
|
371
443
|
this.paused = true;
|
|
372
444
|
}
|
|
373
445
|
/**
|
|
@@ -45,6 +45,15 @@ function packXfFlags(model) {
|
|
|
45
45
|
*/
|
|
46
46
|
const _allStyleFacetsAreKeyed = true;
|
|
47
47
|
void _allStyleFacetsAreKeyed;
|
|
48
|
+
/** The key of an empty style model, per cell type — the string the fast path below would build, built once. */
|
|
49
|
+
const TYPE_KEYS = [];
|
|
50
|
+
/** Whether a style model has no keys at all, without allocating the key array `Object.keys` would. */
|
|
51
|
+
function isEmptyStyleModel(model) {
|
|
52
|
+
for (const _key in model) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
48
57
|
/** Absent facet marker. Keeps a literal `null` in a key unambiguous — see below. */
|
|
49
58
|
const ABSENT = 0;
|
|
50
59
|
/**
|
|
@@ -76,6 +85,10 @@ const ABSENT = 0;
|
|
|
76
85
|
* never correctness, because `_addStyle` still deduplicates by rendered XML.
|
|
77
86
|
*/
|
|
78
87
|
function styleModelKey(model, type) {
|
|
88
|
+
// An unstyled cell — almost every cell of a large sheet — has an empty style object, whose key is just its type.
|
|
89
|
+
if (isEmptyStyleModel(model)) {
|
|
90
|
+
return (TYPE_KEYS[type] ?? (TYPE_KEYS[type] = `${type}`));
|
|
91
|
+
}
|
|
79
92
|
const { numFmt, font, border, fill, alignment, protection, styleName } = model;
|
|
80
93
|
// Truthiness, not `!== undefined`, to mirror `addStyleModel`'s own
|
|
81
94
|
// `if (model.numFmt)`: a falsy numFmt (a JS caller's `null`, an empty string)
|
|
@@ -55,6 +55,8 @@ import { StringBuf } from "./string-buf.js";
|
|
|
55
55
|
import { xmlEncodeAttr } from "../../xml/encode.js";
|
|
56
56
|
import { XmlWriter } from "../../xml/writer.js";
|
|
57
57
|
// Per-instance StringBuf is created in the constructor (see _xmlBuffer field below).
|
|
58
|
+
/** How much `document.xml` is collected before it is handed to the compressor — see `_write`. */
|
|
59
|
+
const XML_FLUSH_BYTES = 65536;
|
|
58
60
|
// Previously this was a module-level singleton which caused data races with concurrent instances.
|
|
59
61
|
const EMPTY_U8 = new Uint8Array(0);
|
|
60
62
|
// =============================================================================
|
|
@@ -93,7 +95,13 @@ export class StreamingDocxWriter {
|
|
|
93
95
|
*/
|
|
94
96
|
this._pendingDrain = Promise.resolve();
|
|
95
97
|
/** Completion of every ZipDeflate push registered so far. */
|
|
96
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Compression pushes not yet settled. A set rather than a chain: chaining every push onto the last with
|
|
100
|
+
* `Promise.all(...).then(...)` built two promises per element written — for a 200k-paragraph document most of the
|
|
101
|
+
* writer's own time and a fifth of it in garbage collection — while a push that has already settled, which is every
|
|
102
|
+
* push on the synchronous compression path, has nothing left to wait for.
|
|
103
|
+
*/
|
|
104
|
+
this._pendingCompression = new Set();
|
|
97
105
|
this._headerWritten = false;
|
|
98
106
|
/**
|
|
99
107
|
* Whether the previously-written body element was a `<w:tbl>`. Tracked
|
|
@@ -216,6 +224,7 @@ export class StreamingDocxWriter {
|
|
|
216
224
|
async addAsync(element) {
|
|
217
225
|
this.add(element);
|
|
218
226
|
if (this._sinkAdapter) {
|
|
227
|
+
this._flushXml();
|
|
219
228
|
// ZipDeflate batches small inputs. A non-final empty push flushes that
|
|
220
229
|
// batch into the compressor without ending document.xml.
|
|
221
230
|
this._trackCompression(this._documentZipFile.push(EMPTY_U8));
|
|
@@ -343,7 +352,10 @@ export class StreamingDocxWriter {
|
|
|
343
352
|
this._outputChunks = [];
|
|
344
353
|
this._streamError = null;
|
|
345
354
|
this._pendingDrain = Promise.resolve();
|
|
346
|
-
this._pendingCompression
|
|
355
|
+
this._pendingCompression.clear();
|
|
356
|
+
// XML collected for the previous document's `document.xml` belongs to that document: it was never written, and
|
|
357
|
+
// must not be written into the next one.
|
|
358
|
+
this._xmlBuffer.reset();
|
|
347
359
|
if (this._options.sink && !this._sinkAdapter) {
|
|
348
360
|
this._sinkAdapter = new SinkAdapter(this._options.sink);
|
|
349
361
|
}
|
|
@@ -421,11 +433,15 @@ export class StreamingDocxWriter {
|
|
|
421
433
|
this._streamError = err instanceof Error ? err : new Error(String(err));
|
|
422
434
|
}
|
|
423
435
|
});
|
|
424
|
-
this._pendingCompression
|
|
436
|
+
this._pendingCompression.add(tracked);
|
|
437
|
+
void tracked.then(() => this._pendingCompression.delete(tracked));
|
|
425
438
|
return tracked;
|
|
426
439
|
}
|
|
427
440
|
async _awaitOutputBoundary(message) {
|
|
428
|
-
|
|
441
|
+
// Pushes made while waiting are waited for too, as the chain did.
|
|
442
|
+
while (this._pendingCompression.size > 0) {
|
|
443
|
+
await Promise.all(this._pendingCompression);
|
|
444
|
+
}
|
|
429
445
|
// Compression callbacks enqueue sink writes synchronously. Capture the
|
|
430
446
|
// drain only after compression completes so browser output is included.
|
|
431
447
|
await this._pendingDrain;
|
|
@@ -435,10 +451,23 @@ export class StreamingDocxWriter {
|
|
|
435
451
|
});
|
|
436
452
|
}
|
|
437
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Append XML to `document.xml`. Collected and handed to the compressor 64 KB at a time rather than once per
|
|
456
|
+
* element: each hand-off copied the element's bytes out and pushed them through the ZIP layer on their own, which
|
|
457
|
+
* for short paragraphs cost more than rendering them. {@link _flushXml} sends what is collected; it runs before
|
|
458
|
+
* `document.xml` is closed and before `addAsync` waits on the sink, so the bytes and their order are unchanged.
|
|
459
|
+
*/
|
|
438
460
|
_write(text) {
|
|
439
|
-
this._xmlBuffer.reset();
|
|
440
461
|
this._xmlBuffer.addText(text);
|
|
441
|
-
|
|
462
|
+
if (this._xmlBuffer.length >= XML_FLUSH_BYTES) {
|
|
463
|
+
this._flushXml();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
_flushXml() {
|
|
467
|
+
if (this._xmlBuffer.length > 0) {
|
|
468
|
+
this._documentStream.write(this._xmlBuffer);
|
|
469
|
+
this._xmlBuffer.reset();
|
|
470
|
+
}
|
|
442
471
|
}
|
|
443
472
|
// ===========================================================================
|
|
444
473
|
// Private: Document XML generation
|
|
@@ -1327,6 +1356,9 @@ export class StreamingDocxWriter {
|
|
|
1327
1356
|
}
|
|
1328
1357
|
stream.once("zipped", () => resolve());
|
|
1329
1358
|
stream.once("error", (err) => reject(err));
|
|
1359
|
+
if (stream === this._documentStream) {
|
|
1360
|
+
this._flushXml();
|
|
1361
|
+
}
|
|
1330
1362
|
stream.end();
|
|
1331
1363
|
});
|
|
1332
1364
|
}
|
|
@@ -19,6 +19,9 @@ export { isLegalXmlChar, xmlDecode, xmlEncode, xmlEncodeAttr, stripXmlIllegalCha
|
|
|
19
19
|
* not a full XML NameChar validation (which would require Unicode tables).
|
|
20
20
|
*/
|
|
21
21
|
const INVALID_NAME_CHARS = /[\s<>"'/=&]/;
|
|
22
|
+
/** Names that have passed {@link validateXmlName}, so the common ones are tested once. */
|
|
23
|
+
const VALID_NAMES = new Set();
|
|
24
|
+
const VALID_NAMES_CAP = 4096;
|
|
22
25
|
/**
|
|
23
26
|
* Validate an XML element or attribute name against injection attacks.
|
|
24
27
|
*
|
|
@@ -31,6 +34,18 @@ const INVALID_NAME_CHARS = /[\s<>"'/=&]/;
|
|
|
31
34
|
* tables). It is a focused security check to prevent markup injection.
|
|
32
35
|
*/
|
|
33
36
|
export function validateXmlName(name) {
|
|
37
|
+
// A writer names the same few elements and attributes over and over — `c`, `r`, `s`, `t`, `v` for every cell of a
|
|
38
|
+
// sheet — so a name that has passed once is not tested again. Capped, so names a caller invents cannot grow it
|
|
39
|
+
// without bound; past the cap a name is simply checked every time, as before.
|
|
40
|
+
if (VALID_NAMES.has(name)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
checkXmlName(name);
|
|
44
|
+
if (VALID_NAMES.size < VALID_NAMES_CAP) {
|
|
45
|
+
VALID_NAMES.add(name);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function checkXmlName(name) {
|
|
34
49
|
if (!name) {
|
|
35
50
|
throw new XmlError("XML name must not be empty");
|
|
36
51
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* documonster v0.20.
|
|
2
|
+
* documonster v0.20.1
|
|
3
3
|
* Zero-dependency TypeScript toolkit for Excel, Word, PDF, CSV, Markdown, XML & ZIP — one API across Node.js, Bun & browsers.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the Apache-2.0 License
|
|
6
6
|
*/
|
|
7
|
-
(function(){this.Documonster=this.Documonster||{},(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r=/* @__PURE__ */ new Uint8Array;function i(e,t,n=0){let r=e.length,i=t.length;if(i===0)return 0;if(i>r)return-1;let a=n|0;if(a<0&&(a=0),a>r-i)return-1;if(i===1)return e.indexOf(t[0],a);if(i===2){let n=t[0],i=t[1],o=r-2,s=e.indexOf(n,a);for(;s!==-1&&s<=o;){if(e[s+1]===i)return s;s=e.indexOf(n,s+1)}return-1}if(i===3){let n=t[0],i=t[1],o=t[2],s=r-3,c=e.indexOf(n,a);for(;c!==-1&&c<=s;){if(e[c+1]===i&&e[c+2]===o)return c;c=e.indexOf(n,c+1)}return-1}if(i===4){let n=t[0],i=t[1],o=t[2],s=t[3],c=r-4,l=e.indexOf(n,a);for(;l!==-1&&l<=c;){if(e[l+1]===i&&e[l+2]===o&&e[l+3]===s)return l;l=e.indexOf(n,l+1)}return-1}for(let n=a;n<=r-i;n++){let r=!0;for(let a=0;a<i;a++)if(e[n+a]!==t[a]){r=!1;break}if(r)return n}return-1}var a=class extends Error{constructor(e,t){super(e,t),this.name=`BaseError`,Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?p(this.cause):this.cause}}},o=class extends a{constructor(e){super(`The operation was aborted`,e===void 0?void 0:{cause:e}),this.name=`AbortError`,this.code=`ABORT_ERR`}};function s(e){return e instanceof o?e:new o(e)}function c(e){return!!e&&typeof e==`object`&&e.name===`AbortError`}function l(e,t){if(e&&e.aborted)throw s(t??e.reason)}function u(e){let t=new AbortController;if(!e)return{controller:t,cleanup:()=>{}};if(e.aborted)return t.abort(e.reason),{controller:t,cleanup:()=>{}};let n=()=>{try{t.abort(e.reason)}catch{t.abort()}};return e.addEventListener(`abort`,n,{once:!0}),{controller:t,cleanup:()=>{try{e.removeEventListener(`abort`,n)}catch{}}}}function d(e){return e instanceof Error?e:Error(String(e))}function f(e){e.catch(()=>{})}function p(e){return e instanceof a?e.toJSON():{name:e.name,message:e.message,stack:e.stack,cause:e.cause instanceof Error?p(e.cause):e.cause}}var m=class extends a{constructor(e,t){super(e,t),this.name=`ArchiveError`}},h=class extends m{constructor(...e){super(...e),this.name=`ZipParseError`}},g=class extends h{constructor(e,t,n,r){let i=n?`Invalid ${n}: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`:`Invalid signature: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`;super(i,r),this.name=`InvalidZipSignatureError`}},_=class extends h{constructor(e){super(`Invalid ZIP file: End of Central Directory not found`,e),this.name=`EocdNotFoundError`}},v=class extends m{constructor(e,t,n,r){super(`CRC32 mismatch for "${e}": expected 0x${t.toString(16).padStart(8,`0`)}, got 0x${n.toString(16).padStart(8,`0`)}`,r),this.path=e,this.expected=t,this.actual=n,this.name=`Crc32MismatchError`}},y=class extends m{constructor(e,t,n,r,i){let a=r===`too-few-bytes`?`Entry "${e}" produced fewer bytes than declared: expected ${t}, got ${n}`:n===void 0?`Entry "${e}" exceeds its declared ${t} bytes`:`Entry "${e}" produced more bytes than declared: expected ${t}, got at least ${n}`;super(a,i),this.path=e,this.expected=t,this.actual=n,this.reason=r,this.name=`EntrySizeMismatchError`}isZipBomb(){return this.reason===`too-many-bytes`}isCorruption(){return this.reason===`too-few-bytes`}},b=class extends m{constructor(e,t,n){super(e===`maxOutputLength`?`Decompressed output exceeds maxOutputLength (${t} bytes)`:e===`maxEntries`?`Archive entry count exceeds maxEntries (${t})`:`Archive uncompressed size exceeds maxTotalUncompressedSize (${t} bytes)`,n),this.limit=e,this.allowed=t,this.name=`ArchiveLimitError`}},x=class extends m{constructor(e,t,n){super(t?`Failed to decrypt "${e}": ${t}`:`Failed to decrypt "${e}": incorrect password or corrupted data`,n),this.name=`DecryptionError`}},S=class extends m{constructor(e,t){super(`File "${e}" is encrypted. Please provide a password to extract.`,t),this.name=`PasswordRequiredError`}},C=class extends m{constructor(e,t){super(`Server does not support Range requests for: ${e}`,t),this.name=`RangeNotSupportedError`}},ee=class extends m{constructor(e,t,n,r){super(`HTTP ${t} ${n} for: ${e}`,r),this.url=e,this.status=t,this.statusText=n,this.name=`HttpRangeError`}},w=class extends m{constructor(e,t,n){super(`File "${e}" is too large to extract into memory (${t})`,n),this.name=`FileTooLargeError`}},T=class extends m{constructor(e,t){super(`Unsupported compression method: ${e}`,t),this.name=`UnsupportedCompressionError`}};function te(e){return!!e&&typeof e==`object`&&typeof e.getReader==`function`}function ne(e){return!!e&&typeof e==`object`&&typeof e.getWriter==`function`}function re(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e[Symbol.asyncIterator]==`function`}function ie(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!t.readable&&!!t.writable&&te(t.readable)&&ne(t.writable)}let E=new TextEncoder,D=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ae=/* @__PURE__ */ new Map;function oe(e){let t=(e??`utf-8`).trim().toLowerCase();return t===``||t===`utf8`||t===`utf-8`?`utf-8`:t===`utf16le`||t===`utf-16le`||t===`ucs2`||t===`ucs-2`?`utf-16le`:t===`binary`?`latin1`:t}function se(e){let t=oe(e);if(t===`utf-8`)return D;let n=ae.get(t);return n||(n=ce(t),ae.set(t,n)),n}function ce(e,t){try{return new TextDecoder(e,t)}catch(t){throw TypeError(`Unsupported text encoding: ${e}`,{cause:t})}}function le(e){let t=oe(e);switch(t){case`hex`:return{decode:de};case`base64`:return new me(!1);case`base64url`:return new me(!0);case`ascii`:return{decode:he};default:return ce(t,{ignoreBOM:!0})}}let ue=/* @__PURE__ */ (()=>{let e=Array(256);for(let t=0;t<256;t++)e[t]=t.toString(16).padStart(2,`0`);return e})();function de(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}let fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,pe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;var me=class{constructor(e){this._remainder=null,this._chars=e?pe:fe}decode(e,t){let n;if(this._remainder){let t=new Uint8Array(this._remainder.length+e.length);t.set(this._remainder),t.set(e,this._remainder.length),n=t}else n=e;if(t?.stream??!1){let e=n.length%3,t=n.length-e;return this._remainder=e>0?n.slice(t):null,t>0?this._encodeBytes(n,t):``}return this._remainder=null,n.length>0?this._encodeBytes(n,n.length):``}_encodeBytes(e,t){let n=this._chars,r=n===pe,i=``,a=0;for(;a+2<t;a+=3){let t=e[a],r=e[a+1],o=e[a+2];i+=n[t>>>2]+n[(t&3)<<4|r>>>4]+n[(r&15)<<2|o>>>6]+n[o&63]}let o=t-a;if(o===1){let t=e[a];i+=n[t>>>2]+n[(t&3)<<4],r||(i+=`==`)}else if(o===2){let t=e[a],o=e[a+1];i+=n[t>>>2]+n[(t&3)<<4|o>>>4]+n[(o&15)<<2],r||(i+=`=`)}return i}};function he(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ge(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}function _e(e,t){let n=t?pe:fe,r=``,i=0;for(;i+2<e.length;i+=3){let t=e[i],a=e[i+1],o=e[i+2];r+=n[t>>>2]+n[(t&3)<<4|a>>>4]+n[(a&15)<<2|o>>>6]+n[o&63]}let a=e.length-i;if(a===1){let a=e[i];r+=n[a>>>2]+n[(a&3)<<4],t||(r+=`==`)}else if(a===2){let a=e[i],o=e[i+1];r+=n[a>>>2]+n[(a&3)<<4|o>>>4]+n[(o&15)<<2],t||(r+=`=`)}return r}function ve(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ye(e,t){let n=oe(t);switch(n){case`hex`:return ge(e);case`base64`:return _e(e,!1);case`base64url`:return _e(e,!0);case`ascii`:return ve(e);default:return se(n).decode(e)}}function O(e){return E.encode(e)}function k(e,t){return se(t).decode(e)}function A(e,t){let n=e.length;if(n===0)return/* @__PURE__ */ new Uint8Array;if(n===1){let t=e[0];return t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(t===void 0){let r=0;for(let t=0;t<n;t++)r+=e[t].length;t=r}let r=new Uint8Array(t),i=0;for(let t=0;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}function be(e,t,n){if(!Number.isInteger(t)||t<0||t+n>e.length)throw RangeError(`cannot read ${n} byte(s) at offset ${t}: length is ${e.length}`)}function xe(e,t){return be(e,t,2),(e[t]|e[t+1]<<8)>>>0}function j(e,t){return be(e,t,4),(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Se(e){let t=/* @__PURE__ */ new Uint8Array(4);return t[0]=e&255,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24&255,t}var Ce=class{constructor(e,t=0,n=`binary stream`){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.label=n,this.offset=0,this.position=t}get position(){return this.offset}set position(e){if(!Number.isInteger(e)||e<0||e>this.data.length)throw RangeError(`${this.label}: cannot seek to ${e} — length is ${this.data.length}`);this.offset=e}get remaining(){return this.data.length-this.offset}get bytes(){return this.data}require(e){if(!Number.isInteger(e)||e<0||e>this.remaining)throw RangeError(`${this.label}: truncated at byte ${this.offset} — need ${e} byte(s), ${this.remaining} remain`)}readUint8(){this.require(1);let e=this.view.getUint8(this.offset);return this.offset+=1,e}readInt8(){this.require(1);let e=this.view.getInt8(this.offset);return this.offset+=1,e}readUint16(){this.require(2);let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readInt16(){this.require(2);let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUint32(){this.require(4);let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readInt32(){this.require(4);let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readFloat64(){this.require(8);let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBigUint64(){this.require(8);let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readBytes(e){this.require(e);let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}skip(e){this.require(e),this.offset+=e}slice(e,t){return this.data.subarray(e,t)}peekUint32(e){if(!Number.isInteger(e)||e<0||e+4>this.data.length)throw RangeError(`${this.label}: cannot peek 4 byte(s) at ${e} — length is ${this.data.length}`);return this.view.getUint32(e,!0)}};function we(e,t={}){let n=N(e,t)[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let{value:t,done:r}=await n.next();if(r){e.close();return}e.enqueue(t)},async cancel(){try{await n.return?.()}catch{}}})}function M(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`||typeof Blob<`u`&&e instanceof Blob}function Te(e){if(!e)return null;if(e instanceof Uint8Array)return e.length?e:null;if(typeof e==`string`){let t=O(e);return t.length?t:null}if(e instanceof ArrayBuffer)return e.byteLength?new Uint8Array(e):null;if(ArrayBuffer.isView(e))return e.byteLength?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null;throw TypeError(`Unsupported archive source chunk type: ${Object.prototype.toString.call(e)}`)}function Ee(e){return e instanceof Uint8Array?e:typeof e==`string`?O(e):new Uint8Array(e)}function De(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`}async function Oe(e){if(e instanceof Uint8Array)return e;if(typeof e==`string`)return O(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=await e.arrayBuffer();return new Uint8Array(t)}async function ke(e,t={}){if(M(e))return Oe(e);let n=[],i=0;for await(let r of N(e,t))n.push(r),i+=r.length;return n.length===0?r:n.length===1?n[0]:A(n,i)}async function Ae(e,t={}){return ke(e,t)}async function*N(e,t={}){let{signal:n,onChunk:r}=t,i=()=>{if(n?.aborted)throw s(n?.reason)};if(i(),e instanceof Uint8Array){r&&r(e),yield e;return}if(typeof e==`string`){let t=O(e);r&&r(t),yield t;return}if(e instanceof ArrayBuffer){let t=new Uint8Array(e);r&&r(t),yield t;return}if(typeof Blob<`u`&&e instanceof Blob){if(typeof e.stream==`function`){yield*N(e.stream(),t);return}let n=await Oe(e);i(),r&&r(n),yield n;return}if(te(e)){let t=e.getReader(),a=!1,o=()=>{a=!0;try{t.cancel()}catch{}};n&&(n.aborted?o():n.addEventListener(`abort`,o,{once:!0}));try{for(;;){if(a)throw s(n?.reason);i();let{done:e,value:o}=await t.read();if(e)return;let c=Te(o);if(c){if(a)throw s(n?.reason);i(),r&&r(c),yield c}}}finally{if(n)try{n.removeEventListener(`abort`,o)}catch{}try{t.releaseLock()}catch{}}}if(re(e)){for await(let t of e){i();let e=Te(t);e&&(r&&r(e),yield e)}return}throw new m(`Unsupported archive source`)}function je(e){if(!e)return null;let t=e.lastIndexOf(`/`);if(t===-1)return null;let n=e.slice(t+1).trim();if(!n||n===`*`)return null;let r=parseInt(n,10);return Number.isFinite(r)&&r>=0?r:null}var Me=class e{constructor(e,t,n={}){this._requestCount=0,this._bytesDownloaded=0,this.url=e,this._size=t,this.headers=n.headers??{},this.fetchFn=n.fetch??globalThis.fetch,this.signal=n.signal,this.credentials=n.credentials??`same-origin`}get size(){return this._size}static async open(t,n={}){let r=n.fetch??globalThis.fetch,i=n.headers??{},a=n.credentials??`same-origin`,o=n.validateRangeSupport??!0,s=0,c=0,l=async e=>{let n=await r(t,e);return s++,n};if(n.size!==void 0){if(o){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new C(t)}let r=new e(t,n.size,n);return r._requestCount=s,r._bytesDownloaded=c,r}let u=await l({method:`HEAD`,headers:i,signal:n.signal,credentials:a});if(!u.ok)throw new ee(t,u.status,u.statusText);let d=u.headers.get(`Accept-Ranges`);if(o&&d!==`bytes`){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new C(t)}let f=u.headers.get(`Content-Length`),p=f?parseInt(f,10):NaN;if(!Number.isFinite(p)||p<0){let r=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a}),o=je(r.headers.get(`Content-Range`));if(o!==null)p=o;else if(r.status===200)try{let i=new Uint8Array(await r.arrayBuffer());c+=i.length,p=i.length;let a=new e(t,p,n);return a._fullData=i,a._requestCount=s,a._bytesDownloaded=c,a}catch{let r=await l({method:`GET`,headers:i,signal:n.signal,credentials:a});if(!r.ok)throw new ee(t,r.status,r.statusText);let o=new Uint8Array(await r.arrayBuffer());c+=o.length,p=o.length;let u=new e(t,p,n);return u._fullData=o,u._requestCount=s,u._bytesDownloaded=c,u}else throw new m(f?`Invalid Content-Length "${f}" for: ${t}`:`Server did not provide Content-Length for: ${t}`)}let h=new e(t,p,n);return h._requestCount=s,h._bytesDownloaded=c,h}async read(e,t){if(e<0||t>this._size||e>=t)throw RangeError(`Invalid range [${e}, ${t}) for file of size ${this._size}`);if(this._fullData)return this._fullData.subarray(e,t);let n=`bytes=${e}-${t-1}`,r=await this.fetchFn(this.url,{method:`GET`,headers:{...this.headers,Range:n},signal:this.signal,credentials:this.credentials});if(r.status===200){let n=new Uint8Array(await r.arrayBuffer());return this._fullData=n,this._size=n.length,this._requestCount++,this._bytesDownloaded+=n.length,n.subarray(e,t)}if(r.status!==206)throw new ee(this.url,r.status,r.statusText);let i=new Uint8Array(await r.arrayBuffer());this._requestCount++,this._bytesDownloaded+=i.length;let a=t-e;return i.length===a?i:i.subarray(0,a)}getStats(){return{requestCount:this._requestCount,bytesDownloaded:this._bytesDownloaded,totalSize:this._size,downloadedPercent:this._size>0?Math.round(this._bytesDownloaded/this._size*1e4)/100:0}}async close(){}};function Ne(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):e;return{get size(){return t.length},async read(e,n){if(e<0||n>t.length||e>=n)throw RangeError(`Invalid range [${e}, ${n}) for buffer of size ${t.length}`);return t.subarray(e,n)},async close(){}}}let Pe=null;function Fe(){if(Pe)return Pe;let e=/* @__PURE__ */ new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return Pe=e,e}function P(e,t){let n=Fe();for(let r=0;r<t.length;r++)e=n[(e^t[r])&255]^e>>>8;return e}function Ie(e){return(e^4294967295)>>>0}function F(e){return Ie(P(4294967295,e))}function Le(e,t){return(Fe()[(e^t)&255]^e>>>8)>>>0}let Re=`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function ze(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]>=128){t=!0;break}if(!t)return qe(e);let n=Array(e.length);for(let t=0;t<e.length;t++){let r=e[t];r<128?n[t]=String.fromCharCode(r):n[t]=Re[r-128]}return n.join(``)}function Be(e){if(e.length===0)return r;let t=new Uint8Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),a=i;if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+(t-56320)+65536,r++)}if(a<128){t[n++]=a;continue}if(a>65535){t[n++]=63;continue}let o=Ve.get(String.fromCharCode(a));t[n++]=o??63}return n===t.length?t:t.subarray(0,n)}let Ve=(()=>{let e=/* @__PURE__ */ new Map;for(let t=0;t<128;t++)e.set(Re[t],128+t);return e})(),He={name:`utf-8`,encode:O,decode:k,useUtf8Flag:!0,useUnicodeExtraFields:!1},Ue={name:`cp437`,encode:Be,decode:ze,useUtf8Flag:!1,useUnicodeExtraFields:!0},We=/* @__PURE__ */ new WeakMap;function I(e){if(!e||e===`utf-8`)return He;if(e===`cp437`)return Ue;let t=e,n=We.get(t);if(n)return n;let r=t.useUtf8Flag??t.name===`utf-8`,i={...t,useUtf8Flag:r,useUnicodeExtraFields:t.useUnicodeExtraFields??!r};return We.set(t,i),i}function Ge(e,t){return Ke(e,I(t))}function Ke(e,t){return e?t.encode(e):r}function qe(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,Math.min(r+n,e.length));t+=String.fromCharCode(...i)}return t}function Je(e,t,n,r){return e.length===0?``:(t??0)&2048?k(e):n&&n.version===1&&n.originalCrc32===F(e)?n.unicodeValue:r?r.decode(e):ze(e)}function Ye(e,t,n,r){return Je(e,t,n?.unicodePath,r)}function Xe(e,t,n,r){return Je(e,t,n?.unicodeComment,r)}function Ze(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer.constructor===ArrayBuffer?e.buffer:e.slice().buffer}function Qe(e){let t={key0:305419896,key1:591751049,key2:878082192},n=typeof e==`string`?O(e):e;for(let e=0;e<n.length;e++)$e(t,n[e]);return t}function $e(e,t){e.key0=Le(e.key0,t),e.key1=e.key1+(e.key0&255)>>>0,e.key1=(Math.imul(e.key1,134775813)>>>0)+1>>>0,e.key2=Le(e.key2,e.key1>>>24&255)}function et(e){let t=(e.key2|2)>>>0;return Math.imul(t,t^1)>>>8&255}function tt(e,t){let n=(t^et(e))&255;return $e(e,n),n}function nt(e,t){let n=(t^et(e))&255;return $e(e,t),n}function rt(e,t,n,r){if(t.length!==12)return!1;let i=/* @__PURE__ */ new Uint8Array(12);for(let n=0;n<12;n++)i[n]=tt(e,t[n]);let a=i[11];return a===(n>>>24&255)||r!==void 0&&a===(r>>>8&255)}function it(e,t,n){let r=/* @__PURE__ */ new Uint8Array(12),i=n(11);for(let t=0;t<11;t++)r[t]=nt(e,i[t]);return r[11]=nt(e,t>>>24&255),r}function at(e,t,n,r){if(e.length<12)return null;let i=Qe(t);if(!rt(i,e.subarray(0,12),n,r))return null;let a=e.length-12,o=new Uint8Array(a);for(let t=0;t<a;t++)o[t]=tt(i,e[12+t]);return o}function ot(e,t,n,r){let i=Qe(t),a=new Uint8Array(12+e.length),o=r(11);for(let e=0;e<11;e++)a[e]=nt(i,o[e]);a[11]=nt(i,n>>>24&255);for(let t=0;t<e.length;t++)a[12+t]=nt(i,e[t]);return a}function st(e,t,n,r){return e.length<12?!1:rt(Qe(t),e.subarray(0,12),n,r)}new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),new Uint32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]);function ct(e){let t=new Uint8Array(e);return globalThis.crypto.getRandomValues(t),t}let lt=17729,ut=39169,dt={128:8,192:12,256:16},ft={128:16,192:24,256:32},pt={128:1,192:2,256:3},mt={1:128,2:192,3:256};function ht(){if(globalThis.crypto?.subtle!==void 0)return globalThis.crypto.subtle;throw new m(`Web Crypto API not available`)}async function gt(e,t,n){let r=ht(),i=typeof e==`string`?O(e):e,a=ft[n],o=a+a+2,s=await r.importKey(`raw`,Ze(i),`PBKDF2`,!1,[`deriveBits`]),c=await r.deriveBits({name:`PBKDF2`,salt:Ze(t),iterations:1e3,hash:`SHA-1`},s,o*8),l=new Uint8Array(c);return{encryptionKey:l.subarray(0,a),hmacKey:l.subarray(a,a+a),passwordVerify:l.subarray(a+a,a+a+2)}}async function _t(e,t){let n=ht(),r=await n.importKey(`raw`,Ze(e),{name:`HMAC`,hash:`SHA-1`},!1,[`sign`]),i=await n.sign(`HMAC`,r,Ze(t));return new Uint8Array(i,0,10)}function vt(e){let t=/* @__PURE__ */ new Uint8Array(16);return new DataView(t.buffer).setUint32(0,e,!0),t}async function yt(e,t,n=!0){let r=ht(),i=await r.importKey(`raw`,Ze(e),{name:`AES-CTR`},!1,[`encrypt`]),a=new Uint8Array(t.length),o=/* @__PURE__ */ new Uint8Array(16),s=Math.ceil(t.length/16);for(let e=0;e<s;e++){let n=vt(e+1),s=await r.encrypt({name:`AES-CTR`,counter:Ze(n),length:128},i,Ze(o)),c=new Uint8Array(s),l=e*16,u=Math.min(l+16,t.length);for(let e=l;e<u;e++)a[e]=t[e]^c[e-l]}return a}function bt(e,t,n){let r=/* @__PURE__ */ new Uint8Array(11),i=new DataView(r.buffer);return i.setUint16(0,ut,!0),i.setUint16(2,7,!0),i.setUint16(4,e,!0),i.setUint16(6,lt,!0),r[8]=pt[t],i.setUint16(9,n,!0),r}function xt(e,t){let n=dt[t],r=n+2+10;return e.length<r?null:{salt:e.subarray(0,n),storedVerify:e.subarray(n,n+2),ciphertext:e.subarray(n+2,e.length-10),storedHmac:e.subarray(e.length-10)}}function St(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ct(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}async function wt(e,t,n){let r=xt(e,n);if(!r)throw new m(`Encrypted data too short`);let{salt:i,storedVerify:a,ciphertext:o,storedHmac:s}=r,c=await gt(t,i,n);if(!St(c.passwordVerify,a))throw new m(`Password verification failed`);if(!Ct(await _t(c.hmacKey,o),s))throw new m(`HMAC verification failed`);return yt(c.encryptionKey,o,!1)}async function Tt(e,t,n){let r=dt[n],i=ct(r),a=await gt(t,i,n),o=await yt(a.encryptionKey,e,!0),s=await _t(a.hmacKey,o),c=new Uint8Array(r+2+o.length+10),l=0;return c.set(i,l),l+=r,c.set(a.passwordVerify,l),l+=2,c.set(o,l),l+=o.length,c.set(s,l),c}function Et(e,t){return dt[t]+2+e+10}async function Dt(e,t,n){let r=dt[n],i=r+2;if(e.length<i)return!1;let a=e.subarray(0,r),o=e.subarray(r,r+2);return St((await gt(t,a,n)).passwordVerify,o)}let Ot={none:`None`,zipcrypto:`ZipCrypto (Traditional PKWARE)`,"aes-128":`AES-128`,"aes-192":`AES-192`,"aes-256":`AES-256`},kt={"aes-128":128,"aes-192":192,"aes-256":256},At={128:`aes-128`,192:`aes-192`,256:`aes-256`};function jt(e){return Ot[e]}function Mt(e){return e in kt}function Nt(e){return kt[e]}function Pt(e){return At[e]}function Ft(e,t,n){typeof e.off==`function`?e.off(t,n):typeof e.removeListener==`function`&&e.removeListener(t,n)}function It(e,t,n={}){let r=!1,i=!1,a=null,o,s,c=new Promise((e,t)=>{o=e,s=t}),l=()=>{Ft(e,`error`,d);for(let n of t)Ft(e,n,f)},u=()=>{for(let n of t)Ft(e,n,f)},d=e=>{i||(a=e instanceof Error?e:Error(String(e)),l(),r||(r=!0,s(a)))},f=()=>{i||r||(r=!0,n.keepErrorUntilCancel?u():l(),o())},p=()=>{i||(i=!0,l(),r||(r=!0,o()))};if(typeof e.once==`function`){e.once(`error`,d);for(let n of t)e.once(n,f)}else{e.on?.(`error`,d);for(let n of t)e.on?.(n,f)}return c.catch(()=>{}),{promise:c,cancel:p,error:()=>a}}async function Lt(e,t){if(ne(t)){let n=t.getWriter();try{for await(let t of e)await n.write(t);await n.close()}finally{try{n.releaseLock()}catch{}}return}for await(let n of e){let e=typeof t.once==`function`||typeof t.on==`function`?It(t,[`drain`],{keepErrorUntilCancel:!0}):null,r;try{r=await t.write(n)}catch(t){throw e?.cancel(),t}if(e?.error())throw e.error();r===!1&&e?(await e.promise,e.cancel()):e?.cancel()}if(typeof t.end==`function`){if(typeof t.once==`function`||typeof t.on==`function`){let e=It(t,[`finish`,`close`]);try{await t.end(),await e.promise}catch(t){throw e.cancel(),t}}else await t.end()}}async function Rt(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.length;return A(t,n)}var zt=class{_activeChunkCount(){return this._chunks.length-this._chunkHead}_headChunk(){return this._chunks[this._chunkHead]}_compactConsumedChunks(){if(this._chunkHead!==0){if(this._chunkHead>=this._chunks.length){this._chunks=[],this._chunkHead=0;return}this._chunkHead>32&&this._chunkHead*2>=this._chunks.length&&(this._chunks=this._chunks.slice(this._chunkHead),this._chunkHead=0)}}_dropHeadChunk(){this._chunkHead++,this._headOffset=0,this._compactConsumedChunks()}constructor(e){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0,e&&e.length>0&&this.reset(e)}get length(){return this._length}isEmpty(){return this.length===0}view(){if(this._length===0)return r;if(this._activeChunkCount()===1)return this._headChunk().subarray(this._headOffset,this._headOffset+this._length);if(this._cachedView&&this._cachedLength===this._length)return this._cachedView;let e=new Uint8Array(this._length),t=0;for(let n=this._chunkHead;n<this._chunks.length;n++){let r=this._chunks[n],i=n===this._chunkHead?this._headOffset:0,a=n===this._chunks.length-1?i+(this._length-t):r.length;if(e.set(r.subarray(i,a),t),t+=a-i,t>=e.length)break}return this._cachedView=e,this._cachedLength=this._length,e}reset(e){if(this._cachedView=null,this._cachedLength=0,this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,!e||e.length===0)return;let t=new Uint8Array(e.length);t.set(e),this._chunks=[t],this._chunkHead=0,this._headOffset=0,this._length=t.length}append(e){e.length!==0&&(this._cachedView=null,this._cachedLength=0,this._chunks.push(e),this._length+=e.length)}read(e){if(e<=0)return r;if(e>this._length)throw RangeError(`ByteQueue: read beyond available data`);if(this._cachedView=null,this._cachedLength=0,this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset,r=n+e,i=t.subarray(n,r);return this._headOffset=r,this._length-=e,this._length===0?(this._chunks=[],this._chunkHead=0,this._headOffset=0):this._headOffset>=t.length&&this._dropHeadChunk(),i}let t=new Uint8Array(e),n=0,i=e;for(;i>0;){let e=this._headChunk(),r=this._headOffset,a=e.length-r,o=Math.min(a,i);t.set(e.subarray(r,r+o),n),n+=o,i-=o,this._headOffset+=o,this._length-=o,this._headOffset>=e.length&&this._dropHeadChunk()}return this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0),t}peekChunks(e){if(e<=0)return[];if(e>this._length)throw RangeError(`ByteQueue: peek beyond available data`);if(this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset;return[t.subarray(n,n+e)]}let t=[],n=e;for(let e=this._chunkHead;e<this._chunks.length&&n>0;e++){let r=this._chunks[e],i=e===this._chunkHead?this._headOffset:0,a=r.length-i;if(a<=0)continue;let o=Math.min(a,n);t.push(r.subarray(i,i+o)),n-=o}return t}discard(e){if(e<=0)return;if(e>=this._length){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0;return}this._cachedView=null,this._cachedLength=0;let t=e;for(;t>0;){let e=this._headChunk(),n=this._headOffset,r=e.length-n,i=Math.min(r,t);this._headOffset+=i,this._length-=i,t-=i,this._headOffset>=e.length&&this._dropHeadChunk()}this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0)}indexOfPattern(e,t=0){let n=e.length;if(n===0)return 0;let r=this._length;if(n>r)return-1;let a=t|0;if(a<0&&(a=0),a>r-n)return-1;if(this._activeChunkCount()===1){let t=this._headChunk(),o=this._headOffset,s=t.subarray(o,o+r);return n===1?s.indexOf(e[0],a):i(s,e,a)}if(n>4)return i(this.view(),e,a);let o=e[0],s=n>=2?e[1]:0,c=n>=3?e[2]:0,l=n>=4?e[3]:0,u=this._chunks,d=this._chunkHead,f=(e,t)=>{let n=e,r=t;for(;n<u.length;){let e=u[n];if(r<e.length)return e[r]|0;r-=e.length,n++}return null},p=0;for(let e=d;e<u.length;e++){let t=u[e],i=e===d?this._headOffset:0,m=t.length-i;if(m<=0)continue;let h=p,g=h+m,_=a<=h?i:a>=g?t.length:i+(a-h);if(_>t.length-1){p+=m;continue}let v=t.length-1,y=t.indexOf(o,_);for(;y!==-1&&y<=v;){let a=h+(y-i);if(a>r-n)return-1;if(n===1)return a;if(y+n<=t.length){if(t[y+1]!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;if(t[y+2]!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;if(t[y+3]!==l){y=t.indexOf(o,y+1);continue}return a}let u=f(e,y+1);if(u===null||u!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;let d=f(e,y+2);if(d===null||d!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;let p=f(e,y+3);if(p===null||p!==l){y=t.indexOf(o,y+1);continue}return a}p+=m}return-1}peekUint32LE(e){let t=e|0;if(t<0||t+4>this._length)return null;let n=this._chunks,r=t;for(let e=this._chunkHead;e<n.length;e++){let t=n[e],i=e===this._chunkHead?this._headOffset:0,a=t.length-i;if(r<a){let a=i+r;if(a+4<=t.length){let e=t[a]|0,n=t[a+1]|0,r=t[a+2]|0,i=t[a+3]|0;return(e|n<<8|r<<16|i<<24)>>>0}let o=t[a]|0,s=0,c=0,l=0,u=e,d=a+1;for(let e=1;e<4;e++)for(;u<n.length;){let t=n[u];if(d<t.length){let n=t[d]|0;e===1?s=n:e===2?c=n:l=n,d++;break}u++,d=0}return(o|s<<8|c<<16|l<<24)>>>0}r-=a}return null}peekByte(e){let t=e|0;if(t<0||t>=this._length)throw RangeError(`ByteQueue: peek beyond available data`);let n=t;for(let e=this._chunkHead;e<this._chunks.length;e++){let t=this._chunks[e],r=e===this._chunkHead?this._headOffset:0,i=t.length-r;if(n<i)return t[r+n]|0;n-=i}throw RangeError(`ByteQueue: peek beyond available data`)}};function Bt(){return typeof CompressionStream<`u`}function Vt(){try{return typeof CompressionStream>`u`?!1:(new CompressionStream(`deflate-raw`),!0)}catch{return!1}}function Ht(){try{return typeof DecompressionStream>`u`?!1:(new DecompressionStream(`deflate-raw`),!0)}catch{return!1}}let Ut=null,Wt=null;function Gt(){return typeof CompressionStream>`u`?!1:(Ut===null&&(Ut=Vt()),Ut)}function Kt(){return typeof DecompressionStream>`u`?!1:(Wt===null&&(Wt=Ht()),Wt)}function qt(){return Gt()&&Kt()}async function Jt(e,t){let n=new zt;for(;;){let{done:r,value:i}=await e.read();if(r)break;if(t!==void 0&&n.length+i.length>t)throw new b(`maxOutputLength`,t);n.append(i)}return n.read(n.length)}async function Yt(e,t,n){let r=t.writable.getWriter(),i=t.readable.getReader(),a=Jt(i,n).then(e=>({ok:!0,value:e}),e=>(e instanceof b&&i.cancel(e).catch(()=>{}),{ok:!1,error:e}));try{let t;try{await r.write(e),await r.close()}catch(e){t={error:e},await i.cancel().catch(()=>{})}let n=await a;if(!n.ok)throw n.error;if(t)throw t.error;return n.value}finally{try{r.releaseLock()}catch{}try{i.releaseLock()}catch{}}}async function Xt(e){return Yt(e,new CompressionStream(`deflate-raw`))}async function Zt(e,t){return Yt(e,new DecompressionStream(`deflate-raw`),t)}let Qt=65521;function $t(e){let t=1,n=0;for(let r=0;r<e.length;){let i=Math.min(r+5552,e.length);for(;r<i;)t+=e[r++],n+=t;t%=Qt,n%=Qt}return n<<16|t}function en(e){return e.length>=2&&e[0]===31&&e[1]===139}let tn={};function nn(e,t){let n=`${e}:${t}`;return()=>{let r=e===`compression`?typeof CompressionStream<`u`?CompressionStream:void 0:typeof DecompressionStream<`u`?DecompressionStream:void 0;if(!r)return!1;let i=tn[n];if(i!=null)return i;try{new r(t),tn[n]=!0}catch{tn[n]=!1}return tn[n]}}let rn=nn(`compression`,`gzip`),an=nn(`decompression`,`gzip`),on=nn(`compression`,`deflate`),sn=nn(`decompression`,`deflate`);function cn(e){if(e.length<2)return!1;let t=e[0],n=e[1];return(t&15)!=8||t>>4>7?!1:(t<<8|n)%31==0}function ln(e){return en(e)?`gzip`:cn(e)?`zlib`:`deflate-raw`}let un={0:new Uint8Array([120,1]),1:new Uint8Array([120,1]),2:new Uint8Array([120,94]),3:new Uint8Array([120,94]),4:new Uint8Array([120,94]),5:new Uint8Array([120,94]),6:new Uint8Array([120,156]),7:new Uint8Array([120,218]),8:new Uint8Array([120,218]),9:new Uint8Array([120,218])};function dn(e){return un[Math.max(0,Math.min(9,e))]??un[6]}function fn(e){let t=/* @__PURE__ */ new Uint8Array(4);return t[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t}function pn(e){if(e.length<6)throw new m(`Invalid zlib data (too small)`);let t=e[0],n=e[1];if((t&15)!=8)throw new m(`Invalid zlib compression method`);if(t>>4>7)throw new m(`Invalid zlib CINFO value`);if((t<<8|n)%31!=0)throw new m(`Invalid zlib header checksum`);if(n&32)throw new m(`Zlib preset dictionary not supported`);return 2}function mn(e){let t=e.length-4;return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function hn(e,t){if($t(e)>>>0!=t>>>0)throw new m(`Invalid zlib data (Adler-32 mismatch)`)}function L(e,t){if(t!==void 0&&(typeof t!=`number`||Number.isNaN(t)||t<0))throw RangeError(`${e} must be a non-negative number or Infinity, got ${String(t)}`)}let gn=/* @__PURE__ */ (()=>{let e=/* @__PURE__ */ new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e})(),_n=/* @__PURE__ */ (/* @__PURE__ */ new Uint8Array(32)).fill(5),vn=[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],yn=[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],bn=[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],xn=[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],Sn=[[1,0,0],[2,1,0],[3,2,0],[4,3,0],[6,4,1],[8,5,1],[12,6,2],[16,7,2],[24,8,3],[32,9,3],[48,10,4],[64,11,4],[96,12,5],[128,13,5],[192,14,6],[256,15,6],[384,16,7],[512,17,7],[768,18,8],[1024,19,8],[1536,20,9],[2048,21,9],[3072,22,10],[4096,23,10],[6144,24,11],[8192,25,11],[12288,26,12],[16384,27,12],[24576,28,13],[32768,29,13]],Cn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wn(e,t){let n=/* @__PURE__ */ new Uint16Array(16);for(let r=0;r<t;r++)e[r]>0&&n[e[r]]++;let r=/* @__PURE__ */ new Uint16Array(16),i=0;for(let e=1;e<=15;e++)i=i+n[e-1]<<1,r[e]=i;let a={};for(let n=0;n<t;n++){let t=e[n];if(t===0)continue;i=r[t]++;let o=a;for(let e=t-1;e>=0;e--)i>>e&1?(o.right||(o.right={}),o=o.right):(o.left||(o.left={}),o=o.left);o.symbol=n}return a}var Tn=class{constructor(e){this.data=e,this.pos=0,this.bitBuf=0,this.bitCount=0}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw new m(`Unexpected end of DEFLATE data`);this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}let t=this.bitBuf&(1<<e)-1;return this.bitBuf>>=e,this.bitCount-=e,t}decodeSymbol(e){let t=e;for(;t.symbol===void 0;)if(t=this.readBits(1)===0?t.left:t.right,!t)throw new m(`Invalid Huffman code`);return t.symbol}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw new m(`Unexpected end of data`);return this.data[this.pos++]}readUint16(){return this.readByte()|this.readByte()<<8}};function En(e,t){let n=new Tn(e);L(`maxOutputLength`,t);let r=t??1/0,i=new Uint8Array(Math.min(Math.max(64,e.length*4),r)),a=0,o=e=>{let t=a+e;if(t>r)throw new b(`maxOutputLength`,r);if(t<=i.length)return;let n=i.length;for(;n<t;)n*=2;n=Math.min(n,r);let o=new Uint8Array(n);o.set(i.subarray(0,a)),i=o},s=!1;for(;!s;){s=n.readBits(1)===1;let e=n.readBits(2);if(e===0){n.alignToByte();let e=n.readUint16();if((e^n.readUint16())!==65535)throw new m(`Invalid stored block length`);o(e);for(let t=0;t<e;t++)i[a++]=n.readByte()}else if(e===1||e===2){let t,r;if(e===1)t=wn(gn,288),r=wn(_n,32);else{let e=n.readBits(5)+257,i=n.readBits(5)+1,a=n.readBits(4)+4,o=/* @__PURE__ */ new Uint8Array(19);for(let e=0;e<a;e++)o[Cn[e]]=n.readBits(3);let s=wn(o,19),c=new Uint8Array(e+i),l=0;for(;l<e+i;){let e=n.decodeSymbol(s);if(e<16)c[l++]=e;else if(e===16){let e=n.readBits(2)+3,t=c[l-1];for(let n=0;n<e;n++)c[l++]=t}else if(e===17){let e=n.readBits(3)+3;for(let t=0;t<e;t++)c[l++]=0}else if(e===18){let e=n.readBits(7)+11;for(let t=0;t<e;t++)c[l++]=0}}t=wn(c.subarray(0,e),e),r=wn(c.subarray(e),i)}for(;;){let e=n.decodeSymbol(t);if(e<256)o(1),i[a++]=e;else if(e===256)break;else{let t=e-257,s=vn[t]+n.readBits(yn[t]),c=n.decodeSymbol(r),l=bn[c]+n.readBits(xn[c]);o(s);let u=a-l;for(let e=0;e<s;e++)i[a++]=i[u+e]}}}else throw new m(`Invalid DEFLATE block type: `+e)}return i.slice(0,a)}function Dn(e){let t=65535,n=Math.ceil(e.length/t)||1,r=n*5+e.length,i=new Uint8Array(r),a=0,o=0;for(let r=0;r<n;r++){let s=r===n-1,c=Math.min(t,e.length-o);i[a++]=+!!s,i[a++]=c&255,i[a++]=c>>8&255,i[a++]=~c&255,i[a++]=~c>>8&255,i.set(e.subarray(o,o+c),a),a+=c,o+=c}return i.subarray(0,a)}let On=32768,kn=32768;function An(e){return e<=1?{maxChainLen:4,goodLen:4,niceLen:8,lazy:!1}:e<=3?{maxChainLen:8,goodLen:8,niceLen:32,lazy:!0}:e<=5?{maxChainLen:32,goodLen:16,niceLen:128,lazy:!0}:e<=7?{maxChainLen:64,goodLen:32,niceLen:258,lazy:!0}:{maxChainLen:128,goodLen:64,niceLen:258,lazy:!0}}function jn(e,t,n){return(e<<16|t<<8|n)*506832829>>>17&32767}function Mn(e,t=6){if(e.length===0)return new Uint8Array([3,0]);if(e.length<100)return Dn(e);let n=An(t),r=Vn(e,0,e.length,n,null),i=new Nn;return Bn(i,r,!0),i.finish()}var Nn=class e{constructor(){this.chunks=[],this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,this.bitBuf=0,this.bitCount=0}static{this.CHUNK_SIZE=65536}alignToByte(){this.bitCount>0&&this.writeBits(0,8-this.bitCount)}pushByte(t){this.buffer[this.bufLen++]=t,this.bufLen>=e.CHUNK_SIZE&&(this.chunks.push(this.buffer),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0)}writeBits(e,t){for(this.bitBuf|=e<<this.bitCount,this.bitCount+=t;this.bitCount>=8;)this.pushByte(this.bitBuf&255),this.bitBuf>>=8,this.bitCount-=8}writeBitsReverse(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;this.writeBits(n,t)}finish(){return this.bitCount>0&&(this.pushByte(this.bitBuf&255),this.bitBuf=0,this.bitCount=0),this.chunks.length===0?this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),A(this.chunks))}flushBytes(){if(this.chunks.length===0&&this.bufLen===0)return/* @__PURE__ */ new Uint8Array;let t;return this.chunks.length===0?t=this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),t=A(this.chunks),this.chunks=[]),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,t}};let Pn=/* @__PURE__ */ (()=>{let e=[];for(let t=0;t<=287;t++){let n,r;t<=143?(n=48+t,r=8):t<=255?(n=400+(t-144),r=9):t<=279?(n=t-256,r=7):(n=192+(t-280),r=8),e[t]=[n,r]}return e})();function Fn(e,t){let[n,r]=Pn[t];e.writeBitsReverse(n,r)}function In(e){for(let t=0;t<vn.length;t++)if(t===vn.length-1||e<vn[t+1])return{code:257+t,extra:e-vn[t],extraBits:yn[t]};return{code:285,extra:0,extraBits:0}}function Ln(e){for(let t=0;t<Sn.length;t++){let[n,r,i]=Sn[t];if(e<=n)return{code:r,extra:e-(t===0?1:Sn[t-1][0]+1),extraBits:i}}return{code:29,extra:0,extraBits:13}}function Rn(e,t){let n=e.length,r=new Uint8Array(n),i=[];for(let t=0;t<n;t++)e[t]>0&&i.push({sym:t,freq:e[t]});if(i.length===0)return r;if(i.length===1)return r[i[0].sym]=1,r;i.sort((e,t)=>e.freq-t.freq||e.sym-t.sym);let a=i.map(e=>({freq:e.freq,sym:e.sym,left:null,right:null})),o=0,s=0,c=[];function l(){let e=o<a.length,t=s<c.length;return e&&t?a[o].freq<=c[s].freq?a[o++]:c[s++]:e?a[o++]:c[s++]}let u=i.length;for(let e=0;e<u-1;e++){let e=l(),t=l(),n={freq:e.freq+t.freq,sym:-1,left:e,right:t};c.push(n)}let d=c[c.length-1];function f(e,t){if(e.sym>=0){r[e.sym]=t;return}e.left&&f(e.left,t+1),e.right&&f(e.right,t+1)}f(d,0);let p=new Uint16Array(t+1);for(let e=0;e<n;e++)r[e]>0&&(r[e]>t?(p[t]++,r[e]=t):p[r[e]]++);let m=0;for(let e=1;e<=t;e++)m+=p[e]<<t-e;let h=1<<t;if(m===h)return r;for(;m>h;){let e=t-1;for(;e>0&&p[e]===0;)e--;if(e===0)break;p[e]--,p[t]++,m-=(1<<t-e)-1}for(;m<h;)p[t]++,m++;let g=[];for(let t=0;t<n;t++)r[t]>0&&g.push({sym:t,origLen:r[t],freq:e[t]});g.sort((e,t)=>t.origLen-e.origLen||e.freq-t.freq),r.fill(0);let _=0;for(let e=t;e>=1;e--)for(let t=p[e];t>0;t--)_<g.length&&(r[g[_].sym]=e,_++);return r}function zn(e){let t=e.length,n=Array(t),r=/* @__PURE__ */ new Uint16Array(16);for(let n=0;n<t;n++)e[n]>0&&r[e[n]]++;let i=/* @__PURE__ */ new Uint16Array(16),a=0;for(let e=1;e<=15;e++)a=a+r[e-1]<<1,i[e]=a;for(let r=0;r<t;r++){let t=e[r];t>0?n[r]=[i[t]++,t]:n[r]=[0,0]}return n}function Bn(e,t,n){let r=/* @__PURE__ */ new Uint32Array(286),i=/* @__PURE__ */ new Uint32Array(30);r[256]=1;for(let e of t)if(e.dist===0)r[e.litOrLen]++;else{let t=In(e.litOrLen);r[t.code]++;let n=Ln(e.dist);i[n.code]++}let a=Rn(r,15),o=Rn(i,15),s=!1;for(let e=0;e<o.length;e++)if(o[e]>0){s=!0;break}s||(o=/* @__PURE__ */ new Uint8Array(30),o[0]=1,o[1]=1);let c=zn(a),l=zn(o),u=286;for(;u>257&&a[u-1]===0;)u--;let d=30;for(;d>1&&o[d-1]===0;)d--;let f=new Uint8Array(u+d);f.set(a.subarray(0,u)),f.set(o.subarray(0,d),u);let p=[],m=/* @__PURE__ */ new Uint32Array(19);for(let e=0;e<f.length;){let t=f[e];if(t===0){let t=1;for(;e+t<f.length&&f[e+t]===0;)t++;for(;t>0;)if(t>=11){let n=Math.min(t,138);p.push({sym:18,extra:n-11,extraBits:7}),m[18]++,t-=n,e+=n}else if(t>=3){let n=Math.min(t,10);p.push({sym:17,extra:n-3,extraBits:3}),m[17]++,t-=n,e+=n}else p.push({sym:0,extra:0,extraBits:0}),m[0]++,t--,e++}else{p.push({sym:t,extra:0,extraBits:0}),m[t]++,e++;let n=0;for(;e+n<f.length&&f[e+n]===t;)n++;for(;n>=3;){let t=Math.min(n,6);p.push({sym:16,extra:t-3,extraBits:2}),m[16]++,n-=t,e+=t}for(;n>0;)p.push({sym:t,extra:0,extraBits:0}),m[t]++,n--,e++}}let h=Rn(m,7),g=zn(h),_=19;for(;_>4&&h[Cn[_-1]]===0;)_--;e.writeBits(+!!n,1),e.writeBits(2,2),e.writeBits(u-257,5),e.writeBits(d-1,5),e.writeBits(_-4,4);for(let t=0;t<_;t++)e.writeBits(h[Cn[t]],3);for(let t of p){let[n,r]=g[t.sym];e.writeBitsReverse(n,r),t.extraBits>0&&e.writeBits(t.extra,t.extraBits)}for(let n of t)if(n.dist===0){let[t,r]=c[n.litOrLen];e.writeBitsReverse(t,r)}else{let t=In(n.litOrLen),[r,i]=c[t.code];e.writeBitsReverse(r,i),t.extraBits>0&&e.writeBits(t.extra,t.extraBits);let a=Ln(n.dist),[o,s]=l[a.code];e.writeBitsReverse(o,s),a.extraBits>0&&e.writeBits(a.extra,a.extraBits)}let[v,y]=c[256];e.writeBitsReverse(v,y)}function Vn(e,t,n,r,i){let a=[],o=r.maxChainLen,s=r.goodLen,c=r.niceLen,l=r.lazy,u,d,f,p,m,h,g,_,v;i?(u=i.head,d=i.prev,f=i.window,p=i.windowLen,m=i.totalIn,h=i.hasPrevMatch,g=i.prevMatchLen,_=i.prevMatchDist,v=i.prevLiteral):(u=new Int32Array(On),d=new Int32Array(kn),f=null,p=0,m=0,h=!1,g=0,_=0,v=0);let y=i?r=>{let i=r-m;return i>=t&&i<n?e[i]:f[r&32767]}:t=>e[t],b=i?t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]),i=m+t;d[i&32767]=u[r],u[r]=i+1}:t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]);d[t&32767]=u[r],u[r]=t+1},x=i?(t,n)=>{for(let r=0;r<n;r++)f[p+r&32767]=e[t+r];p+=n}:(e,t)=>{},S=t;for(;S<n;){let t=0,r=0;if(S+2<n){let a=jn(e[S],e[S+1],e[S+2]),f=i?m+S:S,p=l&&h&&g>=s?o>>2:o,_=u[a];for(;_>0&&p-->0;){let i=_-1,a=f-i;if(a>kn||a<=0)break;if(t>=3&&y(i+t)!==e[S+t]){_=d[i&32767];continue}let o=Math.min(258,n-S),s=0;for(;s<o&&y(i+s)===e[S+s];)s++;if(s>t&&(t=s,r=a,s>=c))break;_=d[i&32767]}i?(d[f&32767]=u[a],u[a]=f+1):(d[S&32767]=u[a],u[a]=S+1)}if(l&&h){if(t>g)a.push({litOrLen:v,dist:0}),g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),S=e,h=!1,g=0}}else if(t>=3){if(l)h=!0,g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:t,dist:r});let e=Math.min(S+t,n);for(let t=S+1;t<e;t++)b(t);x(S,e-S),S=e}}else h&&(a.push({litOrLen:g,dist:_}),h=!1,g=0),a.push({litOrLen:e[S],dist:0}),x(S,1),S++}if(h){a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),h=!1,g=0}return i&&(i.windowLen=p,i.totalIn=m+(n-t),i.hasPrevMatch=h,i.prevMatchLen=g,i.prevMatchDist=_,i.prevLiteral=v),a}var Hn=class{constructor(e=6){this._output=new Nn,this._state={head:new Int32Array(On),prev:new Int32Array(kn),window:new Uint8Array(kn),windowLen:0,totalIn:0,hasPrevMatch:!1,prevMatchLen:0,prevMatchDist:0,prevLiteral:0},this._level=Math.max(0,Math.min(9,e)),this._config=An(this._level)}write(e){if(e.length===0)return/* @__PURE__ */ new Uint8Array;let t=this._output;return this._level===0?(this._writeStore(e),t.flushBytes()):(Bn(t,Vn(e,0,e.length,this._config,this._state),!1),t.flushBytes())}finish(){let e=this._output;return e.writeBits(1,1),e.writeBits(1,2),Fn(e,256),e.finish()}_writeStore(e){let t=this._output,n=0;for(;n<e.length;){let r=e.length-n,i=Math.min(65535,r);t.alignToByte(),t.writeBits(0,1),t.writeBits(0,2),t.alignToByte(),t.writeBits(i&255,8),t.writeBits(i>>8&255,8),t.writeBits(~i&255,8),t.writeBits(~i>>8&255,8);for(let r=0;r<i;r++)t.writeBits(e[n+r],8);n+=i}}};let Un={maxWorkers:typeof navigator<`u`&&navigator.hardwareConcurrency||4,minWorkers:0,idleTimeout:3e4,useTransferables:!0,workerUrl:void 0};function Wn(e){let t=e?.maxWorkers??Un.maxWorkers,n=e?.minWorkers??Un.minWorkers;return{maxWorkers:Math.max(1,t),minWorkers:Math.max(0,Math.min(n,t)),idleTimeout:Math.max(0,e?.idleTimeout??Un.idleTimeout),useTransferables:e?.useTransferables??Un.useTransferables,workerUrl:e?.workerUrl}}let Gn={high:3,normal:2,low:1};function Kn(e){return e?Gn[e]??Gn.normal:Gn.normal}function qn(){return typeof Worker<`u`&&typeof Blob<`u`}function Jn(){return`
|
|
7
|
+
(function(){this.Documonster=this.Documonster||{},(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r=/* @__PURE__ */ new Uint8Array;function i(e,t,n=0){let r=e.length,i=t.length;if(i===0)return 0;if(i>r)return-1;let a=n|0;if(a<0&&(a=0),a>r-i)return-1;if(i===1)return e.indexOf(t[0],a);if(i===2){let n=t[0],i=t[1],o=r-2,s=e.indexOf(n,a);for(;s!==-1&&s<=o;){if(e[s+1]===i)return s;s=e.indexOf(n,s+1)}return-1}if(i===3){let n=t[0],i=t[1],o=t[2],s=r-3,c=e.indexOf(n,a);for(;c!==-1&&c<=s;){if(e[c+1]===i&&e[c+2]===o)return c;c=e.indexOf(n,c+1)}return-1}if(i===4){let n=t[0],i=t[1],o=t[2],s=t[3],c=r-4,l=e.indexOf(n,a);for(;l!==-1&&l<=c;){if(e[l+1]===i&&e[l+2]===o&&e[l+3]===s)return l;l=e.indexOf(n,l+1)}return-1}for(let n=a;n<=r-i;n++){let r=!0;for(let a=0;a<i;a++)if(e[n+a]!==t[a]){r=!1;break}if(r)return n}return-1}var a=class extends Error{constructor(e,t){super(e,t),this.name=`BaseError`,Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?p(this.cause):this.cause}}},o=class extends a{constructor(e){super(`The operation was aborted`,e===void 0?void 0:{cause:e}),this.name=`AbortError`,this.code=`ABORT_ERR`}};function s(e){return e instanceof o?e:new o(e)}function c(e){return!!e&&typeof e==`object`&&e.name===`AbortError`}function l(e,t){if(e&&e.aborted)throw s(t??e.reason)}function u(e){let t=new AbortController;if(!e)return{controller:t,cleanup:()=>{}};if(e.aborted)return t.abort(e.reason),{controller:t,cleanup:()=>{}};let n=()=>{try{t.abort(e.reason)}catch{t.abort()}};return e.addEventListener(`abort`,n,{once:!0}),{controller:t,cleanup:()=>{try{e.removeEventListener(`abort`,n)}catch{}}}}function d(e){return e instanceof Error?e:Error(String(e))}function f(e){e.catch(()=>{})}function p(e){return e instanceof a?e.toJSON():{name:e.name,message:e.message,stack:e.stack,cause:e.cause instanceof Error?p(e.cause):e.cause}}var m=class extends a{constructor(e,t){super(e,t),this.name=`ArchiveError`}},h=class extends m{constructor(...e){super(...e),this.name=`ZipParseError`}},g=class extends h{constructor(e,t,n,r){let i=n?`Invalid ${n}: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`:`Invalid signature: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`;super(i,r),this.name=`InvalidZipSignatureError`}},_=class extends h{constructor(e){super(`Invalid ZIP file: End of Central Directory not found`,e),this.name=`EocdNotFoundError`}},v=class extends m{constructor(e,t,n,r){super(`CRC32 mismatch for "${e}": expected 0x${t.toString(16).padStart(8,`0`)}, got 0x${n.toString(16).padStart(8,`0`)}`,r),this.path=e,this.expected=t,this.actual=n,this.name=`Crc32MismatchError`}},y=class extends m{constructor(e,t,n,r,i){let a=r===`too-few-bytes`?`Entry "${e}" produced fewer bytes than declared: expected ${t}, got ${n}`:n===void 0?`Entry "${e}" exceeds its declared ${t} bytes`:`Entry "${e}" produced more bytes than declared: expected ${t}, got at least ${n}`;super(a,i),this.path=e,this.expected=t,this.actual=n,this.reason=r,this.name=`EntrySizeMismatchError`}isZipBomb(){return this.reason===`too-many-bytes`}isCorruption(){return this.reason===`too-few-bytes`}},b=class extends m{constructor(e,t,n){super(e===`maxOutputLength`?`Decompressed output exceeds maxOutputLength (${t} bytes)`:e===`maxEntries`?`Archive entry count exceeds maxEntries (${t})`:`Archive uncompressed size exceeds maxTotalUncompressedSize (${t} bytes)`,n),this.limit=e,this.allowed=t,this.name=`ArchiveLimitError`}},x=class extends m{constructor(e,t,n){super(t?`Failed to decrypt "${e}": ${t}`:`Failed to decrypt "${e}": incorrect password or corrupted data`,n),this.name=`DecryptionError`}},S=class extends m{constructor(e,t){super(`File "${e}" is encrypted. Please provide a password to extract.`,t),this.name=`PasswordRequiredError`}},C=class extends m{constructor(e,t){super(`Server does not support Range requests for: ${e}`,t),this.name=`RangeNotSupportedError`}},ee=class extends m{constructor(e,t,n,r){super(`HTTP ${t} ${n} for: ${e}`,r),this.url=e,this.status=t,this.statusText=n,this.name=`HttpRangeError`}},w=class extends m{constructor(e,t,n){super(`File "${e}" is too large to extract into memory (${t})`,n),this.name=`FileTooLargeError`}},T=class extends m{constructor(e,t){super(`Unsupported compression method: ${e}`,t),this.name=`UnsupportedCompressionError`}};function te(e){return!!e&&typeof e==`object`&&typeof e.getReader==`function`}function ne(e){return!!e&&typeof e==`object`&&typeof e.getWriter==`function`}function re(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e[Symbol.asyncIterator]==`function`}function ie(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!t.readable&&!!t.writable&&te(t.readable)&&ne(t.writable)}let E=new TextEncoder,D=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ae=/* @__PURE__ */ new Map;function oe(e){let t=(e??`utf-8`).trim().toLowerCase();return t===``||t===`utf8`||t===`utf-8`?`utf-8`:t===`utf16le`||t===`utf-16le`||t===`ucs2`||t===`ucs-2`?`utf-16le`:t===`binary`?`latin1`:t}function se(e){let t=oe(e);if(t===`utf-8`)return D;let n=ae.get(t);return n||(n=ce(t),ae.set(t,n)),n}function ce(e,t){try{return new TextDecoder(e,t)}catch(t){throw TypeError(`Unsupported text encoding: ${e}`,{cause:t})}}function le(e){let t=oe(e);switch(t){case`hex`:return{decode:de};case`base64`:return new me(!1);case`base64url`:return new me(!0);case`ascii`:return{decode:he};default:return ce(t,{ignoreBOM:!0})}}let ue=/* @__PURE__ */ (()=>{let e=Array(256);for(let t=0;t<256;t++)e[t]=t.toString(16).padStart(2,`0`);return e})();function de(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}let fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,pe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;var me=class{constructor(e){this._remainder=null,this._chars=e?pe:fe}decode(e,t){let n;if(this._remainder){let t=new Uint8Array(this._remainder.length+e.length);t.set(this._remainder),t.set(e,this._remainder.length),n=t}else n=e;if(t?.stream??!1){let e=n.length%3,t=n.length-e;return this._remainder=e>0?n.slice(t):null,t>0?this._encodeBytes(n,t):``}return this._remainder=null,n.length>0?this._encodeBytes(n,n.length):``}_encodeBytes(e,t){let n=this._chars,r=n===pe,i=``,a=0;for(;a+2<t;a+=3){let t=e[a],r=e[a+1],o=e[a+2];i+=n[t>>>2]+n[(t&3)<<4|r>>>4]+n[(r&15)<<2|o>>>6]+n[o&63]}let o=t-a;if(o===1){let t=e[a];i+=n[t>>>2]+n[(t&3)<<4],r||(i+=`==`)}else if(o===2){let t=e[a],o=e[a+1];i+=n[t>>>2]+n[(t&3)<<4|o>>>4]+n[(o&15)<<2],r||(i+=`=`)}return i}};function he(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ge(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}function _e(e,t){let n=t?pe:fe,r=``,i=0;for(;i+2<e.length;i+=3){let t=e[i],a=e[i+1],o=e[i+2];r+=n[t>>>2]+n[(t&3)<<4|a>>>4]+n[(a&15)<<2|o>>>6]+n[o&63]}let a=e.length-i;if(a===1){let a=e[i];r+=n[a>>>2]+n[(a&3)<<4],t||(r+=`==`)}else if(a===2){let a=e[i],o=e[i+1];r+=n[a>>>2]+n[(a&3)<<4|o>>>4]+n[(o&15)<<2],t||(r+=`=`)}return r}function ve(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ye(e,t){let n=oe(t);switch(n){case`hex`:return ge(e);case`base64`:return _e(e,!1);case`base64url`:return _e(e,!0);case`ascii`:return ve(e);default:return se(n).decode(e)}}function O(e){return E.encode(e)}function k(e,t){return se(t).decode(e)}function A(e,t){let n=e.length;if(n===0)return/* @__PURE__ */ new Uint8Array;if(n===1){let t=e[0];return t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(t===void 0){let r=0;for(let t=0;t<n;t++)r+=e[t].length;t=r}let r=new Uint8Array(t),i=0;for(let t=0;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}function be(e,t,n){if(!Number.isInteger(t)||t<0||t+n>e.length)throw RangeError(`cannot read ${n} byte(s) at offset ${t}: length is ${e.length}`)}function xe(e,t){return be(e,t,2),(e[t]|e[t+1]<<8)>>>0}function j(e,t){return be(e,t,4),(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Se(e){let t=/* @__PURE__ */ new Uint8Array(4);return t[0]=e&255,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24&255,t}var Ce=class{constructor(e,t=0,n=`binary stream`){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.label=n,this.offset=0,this.position=t}get position(){return this.offset}set position(e){if(!Number.isInteger(e)||e<0||e>this.data.length)throw RangeError(`${this.label}: cannot seek to ${e} — length is ${this.data.length}`);this.offset=e}get remaining(){return this.data.length-this.offset}get bytes(){return this.data}require(e){if(!Number.isInteger(e)||e<0||e>this.remaining)throw RangeError(`${this.label}: truncated at byte ${this.offset} — need ${e} byte(s), ${this.remaining} remain`)}readUint8(){this.require(1);let e=this.view.getUint8(this.offset);return this.offset+=1,e}readInt8(){this.require(1);let e=this.view.getInt8(this.offset);return this.offset+=1,e}readUint16(){this.require(2);let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readInt16(){this.require(2);let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUint32(){this.require(4);let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readInt32(){this.require(4);let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readFloat64(){this.require(8);let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBigUint64(){this.require(8);let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readBytes(e){this.require(e);let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}skip(e){this.require(e),this.offset+=e}slice(e,t){return this.data.subarray(e,t)}peekUint32(e){if(!Number.isInteger(e)||e<0||e+4>this.data.length)throw RangeError(`${this.label}: cannot peek 4 byte(s) at ${e} — length is ${this.data.length}`);return this.view.getUint32(e,!0)}};function we(e,t={}){let n=N(e,t)[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let{value:t,done:r}=await n.next();if(r){e.close();return}e.enqueue(t)},async cancel(){try{await n.return?.()}catch{}}})}function M(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`||typeof Blob<`u`&&e instanceof Blob}function Te(e){if(!e)return null;if(e instanceof Uint8Array)return e.length?e:null;if(typeof e==`string`){let t=O(e);return t.length?t:null}if(e instanceof ArrayBuffer)return e.byteLength?new Uint8Array(e):null;if(ArrayBuffer.isView(e))return e.byteLength?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null;throw TypeError(`Unsupported archive source chunk type: ${Object.prototype.toString.call(e)}`)}function Ee(e){return e instanceof Uint8Array?e:typeof e==`string`?O(e):new Uint8Array(e)}function De(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`}async function Oe(e){if(e instanceof Uint8Array)return e;if(typeof e==`string`)return O(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=await e.arrayBuffer();return new Uint8Array(t)}async function ke(e,t={}){if(M(e))return Oe(e);let n=[],i=0;for await(let r of N(e,t))n.push(r),i+=r.length;return n.length===0?r:n.length===1?n[0]:A(n,i)}async function Ae(e,t={}){return ke(e,t)}async function*N(e,t={}){let{signal:n,onChunk:r}=t,i=()=>{if(n?.aborted)throw s(n?.reason)};if(i(),e instanceof Uint8Array){r&&r(e),yield e;return}if(typeof e==`string`){let t=O(e);r&&r(t),yield t;return}if(e instanceof ArrayBuffer){let t=new Uint8Array(e);r&&r(t),yield t;return}if(typeof Blob<`u`&&e instanceof Blob){if(typeof e.stream==`function`){yield*N(e.stream(),t);return}let n=await Oe(e);i(),r&&r(n),yield n;return}if(te(e)){let t=e.getReader(),a=!1,o=()=>{a=!0;try{t.cancel()}catch{}};n&&(n.aborted?o():n.addEventListener(`abort`,o,{once:!0}));try{for(;;){if(a)throw s(n?.reason);i();let{done:e,value:o}=await t.read();if(e)return;let c=Te(o);if(c){if(a)throw s(n?.reason);i(),r&&r(c),yield c}}}finally{if(n)try{n.removeEventListener(`abort`,o)}catch{}try{t.releaseLock()}catch{}}}if(re(e)){for await(let t of e){i();let e=Te(t);e&&(r&&r(e),yield e)}return}throw new m(`Unsupported archive source`)}function je(e){if(!e)return null;let t=e.lastIndexOf(`/`);if(t===-1)return null;let n=e.slice(t+1).trim();if(!n||n===`*`)return null;let r=parseInt(n,10);return Number.isFinite(r)&&r>=0?r:null}var Me=class e{constructor(e,t,n={}){this._requestCount=0,this._bytesDownloaded=0,this.url=e,this._size=t,this.headers=n.headers??{},this.fetchFn=n.fetch??globalThis.fetch,this.signal=n.signal,this.credentials=n.credentials??`same-origin`}get size(){return this._size}static async open(t,n={}){let r=n.fetch??globalThis.fetch,i=n.headers??{},a=n.credentials??`same-origin`,o=n.validateRangeSupport??!0,s=0,c=0,l=async e=>{let n=await r(t,e);return s++,n};if(n.size!==void 0){if(o){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new C(t)}let r=new e(t,n.size,n);return r._requestCount=s,r._bytesDownloaded=c,r}let u=await l({method:`HEAD`,headers:i,signal:n.signal,credentials:a});if(!u.ok)throw new ee(t,u.status,u.statusText);let d=u.headers.get(`Accept-Ranges`);if(o&&d!==`bytes`){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new C(t)}let f=u.headers.get(`Content-Length`),p=f?parseInt(f,10):NaN;if(!Number.isFinite(p)||p<0){let r=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a}),o=je(r.headers.get(`Content-Range`));if(o!==null)p=o;else if(r.status===200)try{let i=new Uint8Array(await r.arrayBuffer());c+=i.length,p=i.length;let a=new e(t,p,n);return a._fullData=i,a._requestCount=s,a._bytesDownloaded=c,a}catch{let r=await l({method:`GET`,headers:i,signal:n.signal,credentials:a});if(!r.ok)throw new ee(t,r.status,r.statusText);let o=new Uint8Array(await r.arrayBuffer());c+=o.length,p=o.length;let u=new e(t,p,n);return u._fullData=o,u._requestCount=s,u._bytesDownloaded=c,u}else throw new m(f?`Invalid Content-Length "${f}" for: ${t}`:`Server did not provide Content-Length for: ${t}`)}let h=new e(t,p,n);return h._requestCount=s,h._bytesDownloaded=c,h}async read(e,t){if(e<0||t>this._size||e>=t)throw RangeError(`Invalid range [${e}, ${t}) for file of size ${this._size}`);if(this._fullData)return this._fullData.subarray(e,t);let n=`bytes=${e}-${t-1}`,r=await this.fetchFn(this.url,{method:`GET`,headers:{...this.headers,Range:n},signal:this.signal,credentials:this.credentials});if(r.status===200){let n=new Uint8Array(await r.arrayBuffer());return this._fullData=n,this._size=n.length,this._requestCount++,this._bytesDownloaded+=n.length,n.subarray(e,t)}if(r.status!==206)throw new ee(this.url,r.status,r.statusText);let i=new Uint8Array(await r.arrayBuffer());this._requestCount++,this._bytesDownloaded+=i.length;let a=t-e;return i.length===a?i:i.subarray(0,a)}getStats(){return{requestCount:this._requestCount,bytesDownloaded:this._bytesDownloaded,totalSize:this._size,downloadedPercent:this._size>0?Math.round(this._bytesDownloaded/this._size*1e4)/100:0}}async close(){}};function Ne(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):e;return{get size(){return t.length},async read(e,n){if(e<0||n>t.length||e>=n)throw RangeError(`Invalid range [${e}, ${n}) for buffer of size ${t.length}`);return t.subarray(e,n)},async close(){}}}let Pe=null;function Fe(){if(Pe)return Pe;let e=/* @__PURE__ */ new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return Pe=e,e}function P(e,t){let n=Fe();for(let r=0;r<t.length;r++)e=n[(e^t[r])&255]^e>>>8;return e}function Ie(e){return(e^4294967295)>>>0}function F(e){return Ie(P(4294967295,e))}function Le(e,t){return(Fe()[(e^t)&255]^e>>>8)>>>0}let Re=`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function ze(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]>=128){t=!0;break}if(!t)return qe(e);let n=Array(e.length);for(let t=0;t<e.length;t++){let r=e[t];r<128?n[t]=String.fromCharCode(r):n[t]=Re[r-128]}return n.join(``)}function Be(e){if(e.length===0)return r;let t=new Uint8Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),a=i;if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+(t-56320)+65536,r++)}if(a<128){t[n++]=a;continue}if(a>65535){t[n++]=63;continue}let o=Ve.get(String.fromCharCode(a));t[n++]=o??63}return n===t.length?t:t.subarray(0,n)}let Ve=(()=>{let e=/* @__PURE__ */ new Map;for(let t=0;t<128;t++)e.set(Re[t],128+t);return e})(),He={name:`utf-8`,encode:O,decode:k,useUtf8Flag:!0,useUnicodeExtraFields:!1},Ue={name:`cp437`,encode:Be,decode:ze,useUtf8Flag:!1,useUnicodeExtraFields:!0},We=/* @__PURE__ */ new WeakMap;function I(e){if(!e||e===`utf-8`)return He;if(e===`cp437`)return Ue;let t=e,n=We.get(t);if(n)return n;let r=t.useUtf8Flag??t.name===`utf-8`,i={...t,useUtf8Flag:r,useUnicodeExtraFields:t.useUnicodeExtraFields??!r};return We.set(t,i),i}function Ge(e,t){return Ke(e,I(t))}function Ke(e,t){return e?t.encode(e):r}function qe(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,Math.min(r+n,e.length));t+=String.fromCharCode(...i)}return t}function Je(e,t,n,r){return e.length===0?``:(t??0)&2048?k(e):n&&n.version===1&&n.originalCrc32===F(e)?n.unicodeValue:r?r.decode(e):ze(e)}function Ye(e,t,n,r){return Je(e,t,n?.unicodePath,r)}function Xe(e,t,n,r){return Je(e,t,n?.unicodeComment,r)}function Ze(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer.constructor===ArrayBuffer?e.buffer:e.slice().buffer}function Qe(e){let t={key0:305419896,key1:591751049,key2:878082192},n=typeof e==`string`?O(e):e;for(let e=0;e<n.length;e++)$e(t,n[e]);return t}function $e(e,t){e.key0=Le(e.key0,t),e.key1=e.key1+(e.key0&255)>>>0,e.key1=(Math.imul(e.key1,134775813)>>>0)+1>>>0,e.key2=Le(e.key2,e.key1>>>24&255)}function et(e){let t=(e.key2|2)>>>0;return Math.imul(t,t^1)>>>8&255}function tt(e,t){let n=(t^et(e))&255;return $e(e,n),n}function nt(e,t){let n=(t^et(e))&255;return $e(e,t),n}function rt(e,t,n,r){if(t.length!==12)return!1;let i=/* @__PURE__ */ new Uint8Array(12);for(let n=0;n<12;n++)i[n]=tt(e,t[n]);let a=i[11];return a===(n>>>24&255)||r!==void 0&&a===(r>>>8&255)}function it(e,t,n){let r=/* @__PURE__ */ new Uint8Array(12),i=n(11);for(let t=0;t<11;t++)r[t]=nt(e,i[t]);return r[11]=nt(e,t>>>24&255),r}function at(e,t,n,r){if(e.length<12)return null;let i=Qe(t);if(!rt(i,e.subarray(0,12),n,r))return null;let a=e.length-12,o=new Uint8Array(a);for(let t=0;t<a;t++)o[t]=tt(i,e[12+t]);return o}function ot(e,t,n,r){let i=Qe(t),a=new Uint8Array(12+e.length),o=r(11);for(let e=0;e<11;e++)a[e]=nt(i,o[e]);a[11]=nt(i,n>>>24&255);for(let t=0;t<e.length;t++)a[12+t]=nt(i,e[t]);return a}function st(e,t,n,r){return e.length<12?!1:rt(Qe(t),e.subarray(0,12),n,r)}new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),new Uint32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]);function ct(e){let t=new Uint8Array(e);return globalThis.crypto.getRandomValues(t),t}let lt=17729,ut=39169,dt={128:8,192:12,256:16},ft={128:16,192:24,256:32},pt={128:1,192:2,256:3},mt={1:128,2:192,3:256};function ht(){if(globalThis.crypto?.subtle!==void 0)return globalThis.crypto.subtle;throw new m(`Web Crypto API not available`)}async function gt(e,t,n){let r=ht(),i=typeof e==`string`?O(e):e,a=ft[n],o=a+a+2,s=await r.importKey(`raw`,Ze(i),`PBKDF2`,!1,[`deriveBits`]),c=await r.deriveBits({name:`PBKDF2`,salt:Ze(t),iterations:1e3,hash:`SHA-1`},s,o*8),l=new Uint8Array(c);return{encryptionKey:l.subarray(0,a),hmacKey:l.subarray(a,a+a),passwordVerify:l.subarray(a+a,a+a+2)}}async function _t(e,t){let n=ht(),r=await n.importKey(`raw`,Ze(e),{name:`HMAC`,hash:`SHA-1`},!1,[`sign`]),i=await n.sign(`HMAC`,r,Ze(t));return new Uint8Array(i,0,10)}function vt(e){let t=/* @__PURE__ */ new Uint8Array(16);return new DataView(t.buffer).setUint32(0,e,!0),t}async function yt(e,t,n=!0){let r=ht(),i=await r.importKey(`raw`,Ze(e),{name:`AES-CTR`},!1,[`encrypt`]),a=new Uint8Array(t.length),o=/* @__PURE__ */ new Uint8Array(16),s=Math.ceil(t.length/16);for(let e=0;e<s;e++){let n=vt(e+1),s=await r.encrypt({name:`AES-CTR`,counter:Ze(n),length:128},i,Ze(o)),c=new Uint8Array(s),l=e*16,u=Math.min(l+16,t.length);for(let e=l;e<u;e++)a[e]=t[e]^c[e-l]}return a}function bt(e,t,n){let r=/* @__PURE__ */ new Uint8Array(11),i=new DataView(r.buffer);return i.setUint16(0,ut,!0),i.setUint16(2,7,!0),i.setUint16(4,e,!0),i.setUint16(6,lt,!0),r[8]=pt[t],i.setUint16(9,n,!0),r}function xt(e,t){let n=dt[t],r=n+2+10;return e.length<r?null:{salt:e.subarray(0,n),storedVerify:e.subarray(n,n+2),ciphertext:e.subarray(n+2,e.length-10),storedHmac:e.subarray(e.length-10)}}function St(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ct(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}async function wt(e,t,n){let r=xt(e,n);if(!r)throw new m(`Encrypted data too short`);let{salt:i,storedVerify:a,ciphertext:o,storedHmac:s}=r,c=await gt(t,i,n);if(!St(c.passwordVerify,a))throw new m(`Password verification failed`);if(!Ct(await _t(c.hmacKey,o),s))throw new m(`HMAC verification failed`);return yt(c.encryptionKey,o,!1)}async function Tt(e,t,n){let r=dt[n],i=ct(r),a=await gt(t,i,n),o=await yt(a.encryptionKey,e,!0),s=await _t(a.hmacKey,o),c=new Uint8Array(r+2+o.length+10),l=0;return c.set(i,l),l+=r,c.set(a.passwordVerify,l),l+=2,c.set(o,l),l+=o.length,c.set(s,l),c}function Et(e,t){return dt[t]+2+e+10}async function Dt(e,t,n){let r=dt[n],i=r+2;if(e.length<i)return!1;let a=e.subarray(0,r),o=e.subarray(r,r+2);return St((await gt(t,a,n)).passwordVerify,o)}let Ot={none:`None`,zipcrypto:`ZipCrypto (Traditional PKWARE)`,"aes-128":`AES-128`,"aes-192":`AES-192`,"aes-256":`AES-256`},kt={"aes-128":128,"aes-192":192,"aes-256":256},At={128:`aes-128`,192:`aes-192`,256:`aes-256`};function jt(e){return Ot[e]}function Mt(e){return e in kt}function Nt(e){return kt[e]}function Pt(e){return At[e]}function Ft(e,t,n){typeof e.off==`function`?e.off(t,n):typeof e.removeListener==`function`&&e.removeListener(t,n)}function It(e,t,n={}){let r=!1,i=!1,a=null,o,s,c=new Promise((e,t)=>{o=e,s=t}),l=()=>{Ft(e,`error`,d);for(let n of t)Ft(e,n,f)},u=()=>{for(let n of t)Ft(e,n,f)},d=e=>{i||(a=e instanceof Error?e:Error(String(e)),l(),r||(r=!0,s(a)))},f=()=>{i||r||(r=!0,n.keepErrorUntilCancel?u():l(),o())},p=()=>{i||(i=!0,l(),r||(r=!0,o()))};if(typeof e.once==`function`){e.once(`error`,d);for(let n of t)e.once(n,f)}else{e.on?.(`error`,d);for(let n of t)e.on?.(n,f)}return c.catch(()=>{}),{promise:c,cancel:p,error:()=>a}}async function Lt(e,t){if(ne(t)){let n=t.getWriter();try{for await(let t of e)await n.write(t);await n.close()}finally{try{n.releaseLock()}catch{}}return}for await(let n of e){let e=typeof t.once==`function`||typeof t.on==`function`?It(t,[`drain`],{keepErrorUntilCancel:!0}):null,r;try{r=await t.write(n)}catch(t){throw e?.cancel(),t}if(e?.error())throw e.error();r===!1&&e?(await e.promise,e.cancel()):e?.cancel()}if(typeof t.end==`function`){if(typeof t.once==`function`||typeof t.on==`function`){let e=It(t,[`finish`,`close`]);try{await t.end(),await e.promise}catch(t){throw e.cancel(),t}}else await t.end()}}async function Rt(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.length;return A(t,n)}var zt=class{_activeChunkCount(){return this._chunks.length-this._chunkHead}_headChunk(){return this._chunks[this._chunkHead]}_compactConsumedChunks(){if(this._chunkHead!==0){if(this._chunkHead>=this._chunks.length){this._chunks=[],this._chunkHead=0;return}this._chunkHead>32&&this._chunkHead*2>=this._chunks.length&&(this._chunks=this._chunks.slice(this._chunkHead),this._chunkHead=0)}}_dropHeadChunk(){this._chunkHead++,this._headOffset=0,this._compactConsumedChunks()}constructor(e){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0,e&&e.length>0&&this.reset(e)}get length(){return this._length}isEmpty(){return this.length===0}view(){if(this._length===0)return r;if(this._activeChunkCount()===1)return this._headChunk().subarray(this._headOffset,this._headOffset+this._length);if(this._cachedView&&this._cachedLength===this._length)return this._cachedView;let e=new Uint8Array(this._length),t=0;for(let n=this._chunkHead;n<this._chunks.length;n++){let r=this._chunks[n],i=n===this._chunkHead?this._headOffset:0,a=n===this._chunks.length-1?i+(this._length-t):r.length;if(e.set(r.subarray(i,a),t),t+=a-i,t>=e.length)break}return this._cachedView=e,this._cachedLength=this._length,e}reset(e){if(this._cachedView=null,this._cachedLength=0,this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,!e||e.length===0)return;let t=new Uint8Array(e.length);t.set(e),this._chunks=[t],this._chunkHead=0,this._headOffset=0,this._length=t.length}append(e){e.length!==0&&(this._cachedView=null,this._cachedLength=0,this._chunks.push(e),this._length+=e.length)}read(e){if(e<=0)return r;if(e>this._length)throw RangeError(`ByteQueue: read beyond available data`);if(this._cachedView=null,this._cachedLength=0,this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset,r=n+e,i=t.subarray(n,r);return this._headOffset=r,this._length-=e,this._length===0?(this._chunks=[],this._chunkHead=0,this._headOffset=0):this._headOffset>=t.length&&this._dropHeadChunk(),i}let t=new Uint8Array(e),n=0,i=e;for(;i>0;){let e=this._headChunk(),r=this._headOffset,a=e.length-r,o=Math.min(a,i);t.set(e.subarray(r,r+o),n),n+=o,i-=o,this._headOffset+=o,this._length-=o,this._headOffset>=e.length&&this._dropHeadChunk()}return this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0),t}peekChunks(e){if(e<=0)return[];if(e>this._length)throw RangeError(`ByteQueue: peek beyond available data`);if(this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset;return[t.subarray(n,n+e)]}let t=[],n=e;for(let e=this._chunkHead;e<this._chunks.length&&n>0;e++){let r=this._chunks[e],i=e===this._chunkHead?this._headOffset:0,a=r.length-i;if(a<=0)continue;let o=Math.min(a,n);t.push(r.subarray(i,i+o)),n-=o}return t}discard(e){if(e<=0)return;if(e>=this._length){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0;return}this._cachedView=null,this._cachedLength=0;let t=e;for(;t>0;){let e=this._headChunk(),n=this._headOffset,r=e.length-n,i=Math.min(r,t);this._headOffset+=i,this._length-=i,t-=i,this._headOffset>=e.length&&this._dropHeadChunk()}this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0)}indexOfPattern(e,t=0){let n=e.length;if(n===0)return 0;let r=this._length;if(n>r)return-1;let a=t|0;if(a<0&&(a=0),a>r-n)return-1;if(this._activeChunkCount()===1){let t=this._headChunk(),o=this._headOffset,s=t.subarray(o,o+r);return n===1?s.indexOf(e[0],a):i(s,e,a)}if(n>4)return i(this.view(),e,a);let o=e[0],s=n>=2?e[1]:0,c=n>=3?e[2]:0,l=n>=4?e[3]:0,u=this._chunks,d=this._chunkHead,f=(e,t)=>{let n=e,r=t;for(;n<u.length;){let e=u[n];if(r<e.length)return e[r]|0;r-=e.length,n++}return null},p=0;for(let e=d;e<u.length;e++){let t=u[e],i=e===d?this._headOffset:0,m=t.length-i;if(m<=0)continue;let h=p,g=h+m,_=a<=h?i:a>=g?t.length:i+(a-h);if(_>t.length-1){p+=m;continue}let v=t.length-1,y=t.indexOf(o,_);for(;y!==-1&&y<=v;){let a=h+(y-i);if(a>r-n)return-1;if(n===1)return a;if(y+n<=t.length){if(t[y+1]!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;if(t[y+2]!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;if(t[y+3]!==l){y=t.indexOf(o,y+1);continue}return a}let u=f(e,y+1);if(u===null||u!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;let d=f(e,y+2);if(d===null||d!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;let p=f(e,y+3);if(p===null||p!==l){y=t.indexOf(o,y+1);continue}return a}p+=m}return-1}peekUint32LE(e){let t=e|0;if(t<0||t+4>this._length)return null;let n=this._chunks,r=t;for(let e=this._chunkHead;e<n.length;e++){let t=n[e],i=e===this._chunkHead?this._headOffset:0,a=t.length-i;if(r<a){let a=i+r;if(a+4<=t.length){let e=t[a]|0,n=t[a+1]|0,r=t[a+2]|0,i=t[a+3]|0;return(e|n<<8|r<<16|i<<24)>>>0}let o=t[a]|0,s=0,c=0,l=0,u=e,d=a+1;for(let e=1;e<4;e++)for(;u<n.length;){let t=n[u];if(d<t.length){let n=t[d]|0;e===1?s=n:e===2?c=n:l=n,d++;break}u++,d=0}return(o|s<<8|c<<16|l<<24)>>>0}r-=a}return null}peekByte(e){let t=e|0;if(t<0||t>=this._length)throw RangeError(`ByteQueue: peek beyond available data`);let n=t;for(let e=this._chunkHead;e<this._chunks.length;e++){let t=this._chunks[e],r=e===this._chunkHead?this._headOffset:0,i=t.length-r;if(n<i)return t[r+n]|0;n-=i}throw RangeError(`ByteQueue: peek beyond available data`)}};function Bt(){return typeof CompressionStream<`u`}function Vt(){try{return typeof CompressionStream>`u`?!1:(new CompressionStream(`deflate-raw`),!0)}catch{return!1}}function Ht(){try{return typeof DecompressionStream>`u`?!1:(new DecompressionStream(`deflate-raw`),!0)}catch{return!1}}let Ut=null,Wt=null;function Gt(){return typeof CompressionStream>`u`?!1:(Ut===null&&(Ut=Vt()),Ut)}function Kt(){return typeof DecompressionStream>`u`?!1:(Wt===null&&(Wt=Ht()),Wt)}function qt(){return Gt()&&Kt()}async function Jt(e,t){let n=new zt;for(;;){let{done:r,value:i}=await e.read();if(r)break;if(t!==void 0&&n.length+i.length>t)throw new b(`maxOutputLength`,t);n.append(i)}return n.read(n.length)}async function Yt(e,t,n){let r=t.writable.getWriter(),i=t.readable.getReader(),a=Jt(i,n).then(e=>({ok:!0,value:e}),e=>(e instanceof b&&i.cancel(e).catch(()=>{}),{ok:!1,error:e}));try{let t;try{await r.write(e),await r.close()}catch(e){t={error:e},await i.cancel().catch(()=>{})}let n=await a;if(!n.ok)throw n.error;if(t)throw t.error;return n.value}finally{try{r.releaseLock()}catch{}try{i.releaseLock()}catch{}}}async function Xt(e){return Yt(e,new CompressionStream(`deflate-raw`))}async function Zt(e,t){return Yt(e,new DecompressionStream(`deflate-raw`),t)}let Qt=65521;function $t(e){let t=1,n=0;for(let r=0;r<e.length;){let i=Math.min(r+5552,e.length);for(;r<i;)t+=e[r++],n+=t;t%=Qt,n%=Qt}return n<<16|t}function en(e){return e.length>=2&&e[0]===31&&e[1]===139}let tn={};function nn(e,t){let n=`${e}:${t}`;return()=>{let r=e===`compression`?typeof CompressionStream<`u`?CompressionStream:void 0:typeof DecompressionStream<`u`?DecompressionStream:void 0;if(!r)return!1;let i=tn[n];if(i!=null)return i;try{new r(t),tn[n]=!0}catch{tn[n]=!1}return tn[n]}}let rn=nn(`compression`,`gzip`),an=nn(`decompression`,`gzip`),on=nn(`compression`,`deflate`),sn=nn(`decompression`,`deflate`);function cn(e){if(e.length<2)return!1;let t=e[0],n=e[1];return(t&15)!=8||t>>4>7?!1:(t<<8|n)%31==0}function ln(e){return en(e)?`gzip`:cn(e)?`zlib`:`deflate-raw`}let un={0:new Uint8Array([120,1]),1:new Uint8Array([120,1]),2:new Uint8Array([120,94]),3:new Uint8Array([120,94]),4:new Uint8Array([120,94]),5:new Uint8Array([120,94]),6:new Uint8Array([120,156]),7:new Uint8Array([120,218]),8:new Uint8Array([120,218]),9:new Uint8Array([120,218])};function dn(e){return un[Math.max(0,Math.min(9,e))]??un[6]}function fn(e){let t=/* @__PURE__ */ new Uint8Array(4);return t[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t}function pn(e){if(e.length<6)throw new m(`Invalid zlib data (too small)`);let t=e[0],n=e[1];if((t&15)!=8)throw new m(`Invalid zlib compression method`);if(t>>4>7)throw new m(`Invalid zlib CINFO value`);if((t<<8|n)%31!=0)throw new m(`Invalid zlib header checksum`);if(n&32)throw new m(`Zlib preset dictionary not supported`);return 2}function mn(e){let t=e.length-4;return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function hn(e,t){if($t(e)>>>0!=t>>>0)throw new m(`Invalid zlib data (Adler-32 mismatch)`)}function L(e,t){if(t!==void 0&&(typeof t!=`number`||Number.isNaN(t)||t<0))throw RangeError(`${e} must be a non-negative number or Infinity, got ${String(t)}`)}let gn=/* @__PURE__ */ (()=>{let e=/* @__PURE__ */ new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e})(),_n=/* @__PURE__ */ (/* @__PURE__ */ new Uint8Array(32)).fill(5),vn=[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],yn=[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],bn=[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],xn=[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],Sn=[[1,0,0],[2,1,0],[3,2,0],[4,3,0],[6,4,1],[8,5,1],[12,6,2],[16,7,2],[24,8,3],[32,9,3],[48,10,4],[64,11,4],[96,12,5],[128,13,5],[192,14,6],[256,15,6],[384,16,7],[512,17,7],[768,18,8],[1024,19,8],[1536,20,9],[2048,21,9],[3072,22,10],[4096,23,10],[6144,24,11],[8192,25,11],[12288,26,12],[16384,27,12],[24576,28,13],[32768,29,13]],Cn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wn(e,t){let n=/* @__PURE__ */ new Uint16Array(16);for(let r=0;r<t;r++)e[r]>0&&n[e[r]]++;let r=/* @__PURE__ */ new Uint16Array(16),i=0;for(let e=1;e<=15;e++)i=i+n[e-1]<<1,r[e]=i;let a={};for(let n=0;n<t;n++){let t=e[n];if(t===0)continue;i=r[t]++;let o=a;for(let e=t-1;e>=0;e--)i>>e&1?(o.right||(o.right={}),o=o.right):(o.left||(o.left={}),o=o.left);o.symbol=n}return a}var Tn=class{constructor(e){this.data=e,this.pos=0,this.bitBuf=0,this.bitCount=0}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw new m(`Unexpected end of DEFLATE data`);this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}let t=this.bitBuf&(1<<e)-1;return this.bitBuf>>=e,this.bitCount-=e,t}decodeSymbol(e){let t=e;for(;t.symbol===void 0;)if(t=this.readBits(1)===0?t.left:t.right,!t)throw new m(`Invalid Huffman code`);return t.symbol}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw new m(`Unexpected end of data`);return this.data[this.pos++]}readUint16(){return this.readByte()|this.readByte()<<8}};function En(e,t){let n=new Tn(e);L(`maxOutputLength`,t);let r=t??1/0,i=new Uint8Array(Math.min(Math.max(64,e.length*4),r)),a=0,o=e=>{let t=a+e;if(t>r)throw new b(`maxOutputLength`,r);if(t<=i.length)return;let n=i.length;for(;n<t;)n*=2;n=Math.min(n,r);let o=new Uint8Array(n);o.set(i.subarray(0,a)),i=o},s=!1;for(;!s;){s=n.readBits(1)===1;let e=n.readBits(2);if(e===0){n.alignToByte();let e=n.readUint16();if((e^n.readUint16())!==65535)throw new m(`Invalid stored block length`);o(e);for(let t=0;t<e;t++)i[a++]=n.readByte()}else if(e===1||e===2){let t,r;if(e===1)t=wn(gn,288),r=wn(_n,32);else{let e=n.readBits(5)+257,i=n.readBits(5)+1,a=n.readBits(4)+4,o=/* @__PURE__ */ new Uint8Array(19);for(let e=0;e<a;e++)o[Cn[e]]=n.readBits(3);let s=wn(o,19),c=new Uint8Array(e+i),l=0;for(;l<e+i;){let e=n.decodeSymbol(s);if(e<16)c[l++]=e;else if(e===16){let e=n.readBits(2)+3,t=c[l-1];for(let n=0;n<e;n++)c[l++]=t}else if(e===17){let e=n.readBits(3)+3;for(let t=0;t<e;t++)c[l++]=0}else if(e===18){let e=n.readBits(7)+11;for(let t=0;t<e;t++)c[l++]=0}}t=wn(c.subarray(0,e),e),r=wn(c.subarray(e),i)}for(;;){let e=n.decodeSymbol(t);if(e<256)o(1),i[a++]=e;else if(e===256)break;else{let t=e-257,s=vn[t]+n.readBits(yn[t]),c=n.decodeSymbol(r),l=bn[c]+n.readBits(xn[c]);o(s);let u=a-l;for(let e=0;e<s;e++)i[a++]=i[u+e]}}}else throw new m(`Invalid DEFLATE block type: `+e)}return i.slice(0,a)}function Dn(e){let t=65535,n=Math.ceil(e.length/t)||1,r=n*5+e.length,i=new Uint8Array(r),a=0,o=0;for(let r=0;r<n;r++){let s=r===n-1,c=Math.min(t,e.length-o);i[a++]=+!!s,i[a++]=c&255,i[a++]=c>>8&255,i[a++]=~c&255,i[a++]=~c>>8&255,i.set(e.subarray(o,o+c),a),a+=c,o+=c}return i.subarray(0,a)}let On=32768,kn=32768;function An(e){return e<=1?{maxChainLen:4,goodLen:4,niceLen:8,lazy:!1}:e<=3?{maxChainLen:8,goodLen:8,niceLen:32,lazy:!0}:e<=5?{maxChainLen:32,goodLen:16,niceLen:128,lazy:!0}:e<=7?{maxChainLen:64,goodLen:32,niceLen:258,lazy:!0}:{maxChainLen:128,goodLen:64,niceLen:258,lazy:!0}}function jn(e,t,n){return(e<<16|t<<8|n)*506832829>>>17&32767}function Mn(e,t=6){if(e.length===0)return new Uint8Array([3,0]);if(e.length<100)return Dn(e);let n=An(t),r=Vn(e,0,e.length,n,null),i=new Nn;return Bn(i,r,!0),i.finish()}var Nn=class e{constructor(){this.chunks=[],this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,this.bitBuf=0,this.bitCount=0}static{this.CHUNK_SIZE=65536}alignToByte(){this.bitCount>0&&this.writeBits(0,8-this.bitCount)}pushByte(t){this.buffer[this.bufLen++]=t,this.bufLen>=e.CHUNK_SIZE&&(this.chunks.push(this.buffer),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0)}writeBits(e,t){for(this.bitBuf|=e<<this.bitCount,this.bitCount+=t;this.bitCount>=8;)this.pushByte(this.bitBuf&255),this.bitBuf>>=8,this.bitCount-=8}writeBitsReverse(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;this.writeBits(n,t)}finish(){return this.bitCount>0&&(this.pushByte(this.bitBuf&255),this.bitBuf=0,this.bitCount=0),this.chunks.length===0?this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),A(this.chunks))}flushBytes(){if(this.chunks.length===0&&this.bufLen===0)return/* @__PURE__ */ new Uint8Array;let t;return this.chunks.length===0?t=this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),t=A(this.chunks),this.chunks=[]),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,t}};let Pn=/* @__PURE__ */ (()=>{let e=[];for(let t=0;t<=287;t++){let n,r;t<=143?(n=48+t,r=8):t<=255?(n=400+(t-144),r=9):t<=279?(n=t-256,r=7):(n=192+(t-280),r=8),e[t]=[n,r]}return e})();function Fn(e,t){let[n,r]=Pn[t];e.writeBitsReverse(n,r)}function In(e){for(let t=0;t<vn.length;t++)if(t===vn.length-1||e<vn[t+1])return{code:257+t,extra:e-vn[t],extraBits:yn[t]};return{code:285,extra:0,extraBits:0}}function Ln(e){for(let t=0;t<Sn.length;t++){let[n,r,i]=Sn[t];if(e<=n)return{code:r,extra:e-(t===0?1:Sn[t-1][0]+1),extraBits:i}}return{code:29,extra:0,extraBits:13}}function Rn(e,t){let n=e.length,r=new Uint8Array(n),i=[];for(let t=0;t<n;t++)e[t]>0&&i.push({sym:t,freq:e[t]});if(i.length===0)return r;if(i.length===1)return r[i[0].sym]=1,r;i.sort((e,t)=>e.freq-t.freq||e.sym-t.sym);let a=i.map(e=>({freq:e.freq,sym:e.sym,left:null,right:null})),o=0,s=0,c=[];function l(){let e=o<a.length,t=s<c.length;return e&&t?a[o].freq<=c[s].freq?a[o++]:c[s++]:e?a[o++]:c[s++]}let u=i.length;for(let e=0;e<u-1;e++){let e=l(),t=l(),n={freq:e.freq+t.freq,sym:-1,left:e,right:t};c.push(n)}let d=c[c.length-1];function f(e,t){if(e.sym>=0){r[e.sym]=t;return}e.left&&f(e.left,t+1),e.right&&f(e.right,t+1)}f(d,0);let p=new Uint16Array(t+1);for(let e=0;e<n;e++)r[e]>0&&p[Math.min(r[e],t)]++;let m=1<<t,h=0;for(let e=1;e<=t;e++)h+=p[e]<<t-e;if(h===m)return r;for(;h>m;){let e=t-1;for(;p[e]===0;)e--;p[e]--,p[e+1]+=2,p[t]--,h--}let g=i.slice().sort((e,t)=>e.freq-t.freq||t.sym-e.sym),_=0;for(let e=t;e>=1;e--)for(let t=p[e];t>0;t--)r[g[_++].sym]=e;return r}function zn(e){let t=e.length,n=Array(t),r=/* @__PURE__ */ new Uint16Array(16);for(let n=0;n<t;n++)e[n]>0&&r[e[n]]++;let i=/* @__PURE__ */ new Uint16Array(16),a=0;for(let e=1;e<=15;e++)a=a+r[e-1]<<1,i[e]=a;for(let r=0;r<t;r++){let t=e[r];t>0?n[r]=[i[t]++,t]:n[r]=[0,0]}return n}function Bn(e,t,n){let r=/* @__PURE__ */ new Uint32Array(286),i=/* @__PURE__ */ new Uint32Array(30);r[256]=1;for(let e of t)if(e.dist===0)r[e.litOrLen]++;else{let t=In(e.litOrLen);r[t.code]++;let n=Ln(e.dist);i[n.code]++}let a=Rn(r,15),o=Rn(i,15),s=!1;for(let e=0;e<o.length;e++)if(o[e]>0){s=!0;break}s||(o=/* @__PURE__ */ new Uint8Array(30),o[0]=1,o[1]=1);let c=zn(a),l=zn(o),u=286;for(;u>257&&a[u-1]===0;)u--;let d=30;for(;d>1&&o[d-1]===0;)d--;let f=new Uint8Array(u+d);f.set(a.subarray(0,u)),f.set(o.subarray(0,d),u);let p=[],m=/* @__PURE__ */ new Uint32Array(19);for(let e=0;e<f.length;){let t=f[e];if(t===0){let t=1;for(;e+t<f.length&&f[e+t]===0;)t++;for(;t>0;)if(t>=11){let n=Math.min(t,138);p.push({sym:18,extra:n-11,extraBits:7}),m[18]++,t-=n,e+=n}else if(t>=3){let n=Math.min(t,10);p.push({sym:17,extra:n-3,extraBits:3}),m[17]++,t-=n,e+=n}else p.push({sym:0,extra:0,extraBits:0}),m[0]++,t--,e++}else{p.push({sym:t,extra:0,extraBits:0}),m[t]++,e++;let n=0;for(;e+n<f.length&&f[e+n]===t;)n++;for(;n>=3;){let t=Math.min(n,6);p.push({sym:16,extra:t-3,extraBits:2}),m[16]++,n-=t,e+=t}for(;n>0;)p.push({sym:t,extra:0,extraBits:0}),m[t]++,n--,e++}}let h=Rn(m,7),g=zn(h),_=19;for(;_>4&&h[Cn[_-1]]===0;)_--;e.writeBits(+!!n,1),e.writeBits(2,2),e.writeBits(u-257,5),e.writeBits(d-1,5),e.writeBits(_-4,4);for(let t=0;t<_;t++)e.writeBits(h[Cn[t]],3);for(let t of p){let[n,r]=g[t.sym];e.writeBitsReverse(n,r),t.extraBits>0&&e.writeBits(t.extra,t.extraBits)}for(let n of t)if(n.dist===0){let[t,r]=c[n.litOrLen];e.writeBitsReverse(t,r)}else{let t=In(n.litOrLen),[r,i]=c[t.code];e.writeBitsReverse(r,i),t.extraBits>0&&e.writeBits(t.extra,t.extraBits);let a=Ln(n.dist),[o,s]=l[a.code];e.writeBitsReverse(o,s),a.extraBits>0&&e.writeBits(a.extra,a.extraBits)}let[v,y]=c[256];e.writeBitsReverse(v,y)}function Vn(e,t,n,r,i){let a=[],o=r.maxChainLen,s=r.goodLen,c=r.niceLen,l=r.lazy,u,d,f,p,m,h,g,_,v;i?(u=i.head,d=i.prev,f=i.window,p=i.windowLen,m=i.totalIn,h=i.hasPrevMatch,g=i.prevMatchLen,_=i.prevMatchDist,v=i.prevLiteral):(u=new Int32Array(On),d=new Int32Array(kn),f=null,p=0,m=0,h=!1,g=0,_=0,v=0);let y=i?r=>{let i=r-m;return i>=t&&i<n?e[i]:f[r&32767]}:t=>e[t],b=i?t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]),i=m+t;d[i&32767]=u[r],u[r]=i+1}:t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]);d[t&32767]=u[r],u[r]=t+1},x=i?(t,n)=>{for(let r=0;r<n;r++)f[p+r&32767]=e[t+r];p+=n}:(e,t)=>{},S=t;for(;S<n;){let t=0,r=0;if(S+2<n){let a=jn(e[S],e[S+1],e[S+2]),f=i?m+S:S,p=l&&h&&g>=s?o>>2:o,_=u[a];for(;_>0&&p-->0;){let i=_-1,a=f-i;if(a>kn||a<=0)break;if(t>=3&&y(i+t)!==e[S+t]){_=d[i&32767];continue}let o=Math.min(258,n-S),s=0;for(;s<o&&y(i+s)===e[S+s];)s++;if(s>t&&(t=s,r=a,s>=c))break;_=d[i&32767]}i?(d[f&32767]=u[a],u[a]=f+1):(d[S&32767]=u[a],u[a]=S+1)}if(l&&h){if(t>g)a.push({litOrLen:v,dist:0}),g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),S=e,h=!1,g=0}}else if(t>=3){if(l)h=!0,g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:t,dist:r});let e=Math.min(S+t,n);for(let t=S+1;t<e;t++)b(t);x(S,e-S),S=e}}else h&&(a.push({litOrLen:g,dist:_}),h=!1,g=0),a.push({litOrLen:e[S],dist:0}),x(S,1),S++}if(h){a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),h=!1,g=0}return i&&(i.windowLen=p,i.totalIn=m+(n-t),i.hasPrevMatch=h,i.prevMatchLen=g,i.prevMatchDist=_,i.prevLiteral=v),a}var Hn=class{constructor(e=6){this._output=new Nn,this._state={head:new Int32Array(On),prev:new Int32Array(kn),window:new Uint8Array(kn),windowLen:0,totalIn:0,hasPrevMatch:!1,prevMatchLen:0,prevMatchDist:0,prevLiteral:0},this._level=Math.max(0,Math.min(9,e)),this._config=An(this._level)}write(e){if(e.length===0)return/* @__PURE__ */ new Uint8Array;let t=this._output;return this._level===0?(this._writeStore(e),t.flushBytes()):(Bn(t,Vn(e,0,e.length,this._config,this._state),!1),t.flushBytes())}finish(){let e=this._output;return e.writeBits(1,1),e.writeBits(1,2),Fn(e,256),e.finish()}_writeStore(e){let t=this._output,n=0;for(;n<e.length;){let r=e.length-n,i=Math.min(65535,r);t.alignToByte(),t.writeBits(0,1),t.writeBits(0,2),t.alignToByte(),t.writeBits(i&255,8),t.writeBits(i>>8&255,8),t.writeBits(~i&255,8),t.writeBits(~i>>8&255,8);for(let r=0;r<i;r++)t.writeBits(e[n+r],8);n+=i}}};let Un={maxWorkers:typeof navigator<`u`&&navigator.hardwareConcurrency||4,minWorkers:0,idleTimeout:3e4,useTransferables:!0,workerUrl:void 0};function Wn(e){let t=e?.maxWorkers??Un.maxWorkers,n=e?.minWorkers??Un.minWorkers;return{maxWorkers:Math.max(1,t),minWorkers:Math.max(0,Math.min(n,t)),idleTimeout:Math.max(0,e?.idleTimeout??Un.idleTimeout),useTransferables:e?.useTransferables??Un.useTransferables,workerUrl:e?.workerUrl}}let Gn={high:3,normal:2,low:1};function Kn(e){return e?Gn[e]??Gn.normal:Gn.normal}function qn(){return typeof Worker<`u`&&typeof Blob<`u`}function Jn(){return`
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
// Check deflate-raw support once at startup
|